{
  "id": "git-board",
  "title": "Git Board",
  "type": "full",
  "tier": "starlark",
  "route": "/s/git-board",
  "auth": "authenticated",
  "layout": "single",
  "version": "0.2.0",
  "icon": "🔀",
  "description": "Gitea issue and PR board powered by the gitea-client library. Uses extension connections for authentication.",
  "author": "armature",

  "permissions": ["connections.read"],

  "dependencies": {
    "gitea-client": ">=1.0.0"
  },

  "api_routes": [
    {"method": "GET",  "path": "/repos"},
    {"method": "GET",  "path": "/board"},
    {"method": "GET",  "path": "/issue/*"},
    {"method": "POST", "path": "/issue/*"},
    {"method": "GET",  "path": "/ci/*"}
  ],

  "tools": [
    {
      "name": "list_issues",
      "description": "List issues for a repository. Returns titles, numbers, labels, assignees, and state.",
      "parameters": {
        "owner":  {"type": "string", "required": true,  "description": "Repository owner or org"},
        "repo":   {"type": "string", "required": true,  "description": "Repository name"},
        "state":  {"type": "string", "required": false, "description": "Filter: open (default), closed, all"}
      }
    },
    {
      "name": "get_issue",
      "description": "Get full details for a single issue including body and comments.",
      "parameters": {
        "owner":  {"type": "string", "required": true},
        "repo":   {"type": "string", "required": true},
        "number": {"type": "number", "required": true, "description": "Issue number"}
      }
    },
    {
      "name": "create_issue",
      "description": "Create a new issue in a repository.",
      "parameters": {
        "owner":  {"type": "string", "required": true},
        "repo":   {"type": "string", "required": true},
        "title":  {"type": "string", "required": true},
        "body":   {"type": "string", "required": false},
        "labels": {"type": "string", "required": false, "description": "Comma-separated label names"}
      }
    },
    {
      "name": "update_issue",
      "description": "Update an existing issue (title, body, state, labels).",
      "parameters": {
        "owner":  {"type": "string", "required": true},
        "repo":   {"type": "string", "required": true},
        "number": {"type": "number", "required": true},
        "title":  {"type": "string", "required": false},
        "body":   {"type": "string", "required": false},
        "state":  {"type": "string", "required": false, "description": "open or closed"}
      }
    },
    {
      "name": "add_comment",
      "description": "Add a comment to an issue or pull request.",
      "parameters": {
        "owner":  {"type": "string", "required": true},
        "repo":   {"type": "string", "required": true},
        "number": {"type": "number", "required": true},
        "body":   {"type": "string", "required": true}
      }
    },
    {
      "name": "list_pull_requests",
      "description": "List pull requests for a repository with status, branch, and review state.",
      "parameters": {
        "owner":  {"type": "string", "required": true},
        "repo":   {"type": "string", "required": true},
        "state":  {"type": "string", "required": false, "description": "open (default), closed, all"}
      }
    },
    {
      "name": "get_ci_status",
      "description": "Get CI/CD job status for a commit or branch reference.",
      "parameters": {
        "owner":  {"type": "string", "required": true},
        "repo":   {"type": "string", "required": true},
        "ref":    {"type": "string", "required": true, "description": "Branch name, tag, or commit SHA"}
      }
    }
  ],

  "settings": {
    "default_owner": {
      "type": "string",
      "label": "Default Owner/Org",
      "description": "Default repository owner for the board view.",
      "default": ""
    },
    "default_repo": {
      "type": "string",
      "label": "Default Repository",
      "description": "Default repository name for the board view.",
      "default": ""
    }
  }
}
