{
  "repo": "pingcap/agent-git-service",
  "binary": "gh-server",
  "binary_path": "main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "extensions": {},
  "services": [
    {
      "name": "GHServerLifecycle",
      "package": "main",
      "methods": [
        {
          "name": "Bootstrap",
          "name_key": "GHServerLifecycle.Bootstrap",
          "input": "environment variables + local .env + certificates + repository directory",
          "output": "initialized config, DB, git store, service layer, router, and HTTP servers",
          "type": "local"
        },
        {
          "name": "StartProvisioningWorker",
          "name_key": "GHServerLifecycle.StartProvisioningWorker",
          "input": "control plane DSN + TiDB Cloud credentials + background waitgroup",
          "output": "background provisioning polling loop",
          "type": "local"
        },
        {
          "name": "StartHTTPServers",
          "name_key": "GHServerLifecycle.StartHTTPServers",
          "input": "listen mode + HTTP/TLS ports + chi mux",
          "output": "running HTTP listeners",
          "type": "local"
        },
        {
          "name": "GracefulShutdown",
          "name_key": "GHServerLifecycle.GracefulShutdown",
          "input": "SIGINT or SIGTERM",
          "output": "stopped HTTP servers and background workers",
          "type": "local"
        }
      ]
    },
    {
      "name": "GHServerHTTP",
      "type": "http",
      "methods": [
        {
          "name": "POST /login/device/code",
          "name_key": "HTTP POST /login/device/code",
          "input": "OAuth device flow request",
          "output": "device verification payload",
          "path": "/login/device/code",
          "type": "http"
        },
        {
          "name": "POST /login/oauth/access_token",
          "name_key": "HTTP POST /login/oauth/access_token",
          "input": "OAuth device code exchange request",
          "output": "access token payload",
          "path": "/login/oauth/access_token",
          "type": "http"
        },
        {
          "name": "GET /login/oauth/authorize",
          "name_key": "HTTP GET /login/oauth/authorize",
          "input": "OAuth authorize request",
          "output": "authorization redirect or approval response",
          "path": "/login/oauth/authorize",
          "type": "http"
        },
        {
          "name": "POST /api/graphql",
          "name_key": "HTTP POST /api/graphql",
          "input": "GraphQL query or mutation",
          "output": "GraphQL response",
          "path": "/api/graphql",
          "type": "http"
        },
        {
          "name": "GET /metrics",
          "name_key": "HTTP GET /metrics",
          "input": "Prometheus scrape request",
          "output": "Prometheus metrics",
          "path": "/metrics",
          "type": "http"
        },
        {
          "name": "GET /readyz",
          "name_key": "HTTP GET /readyz",
          "input": "readiness probe",
          "output": "database and router readiness state",
          "path": "/readyz",
          "type": "http"
        },
        {
          "name": "GET /api/v3/*",
          "name_key": "HTTP GET /api/v3/*",
          "input": "REST API request across user/org/repo/actions/search domains",
          "output": "GitHub-compatible REST response",
          "path": "/api/v3/*",
          "type": "http"
        },
        {
          "name": "GET /{owner}/{repo}/info/refs",
          "name_key": "HTTP GET /{owner}/{repo}/info/refs",
          "input": "Git Smart HTTP discovery request",
          "output": "repository refs advertisement",
          "path": "/{owner}/{repo}/info/refs",
          "type": "http"
        },
        {
          "name": "POST /{owner}/{repo}/git-*",
          "name_key": "HTTP POST /{owner}/{repo}/git-*",
          "input": "Git Smart HTTP request",
          "output": "git upload-pack/receive-pack transport",
          "path": "/{owner}/{repo}/git-*",
          "type": "http"
        }
      ]
    }
  ]
}
