{
  "repo": "tidbcloud/agent-jira",
  "binary": "jira",
  "binary_path": "lib/cli.ts",
  "dependencies": {
    "JiraCLI.fetch": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Only when an output file is provided"
          ],
          "operations": [
            {
              "operation": "WRITE CLEANED ISSUE JSON",
              "trigger": "Persist fetched Jira issues to a local JSON file",
              "conditions": [
                "options.output is non-empty"
              ],
              "implementation": "cli fetch -> fs.writeFileSync(output, JSON.stringify(data, null, 2))"
            }
          ]
        }
      },
      "services": [
        {
          "name": "jira",
          "target_interface": "issue search API",
          "operation_type": "http_get",
          "conditions": [
            "Jira credentials are configured"
          ],
          "operations": [
            {
              "operation": "FETCH ISSUES",
              "trigger": "Read issues from Jira and normalize fields",
              "conditions": [
                "initJiraClient() succeeds"
              ],
              "implementation": "cli fetch -> initJiraClient() -> fetchJiraIssues(...)"
            }
          ]
        }
      ]
    },
    "JiraCLI.prepare": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Input and output paths are provided"
          ],
          "operations": [
            {
              "operation": "READ CLEANED INPUT AND WRITE JSONL",
              "trigger": "Prepare batch JSONL input for Gemini processing",
              "conditions": [
                "handleFileCreate(...) succeeds"
              ],
              "implementation": "cli prepare -> handleFileCreate(...)"
            }
          ]
        }
      },
      "services": []
    },
    "JiraCLI.classify": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Job metadata or local input/output files are provided"
          ],
          "operations": [
            {
              "operation": "READ OR WRITE JOB ARTIFACTS",
              "trigger": "Persist or read Gemini batch job metadata and result files",
              "conditions": [
                "selected classify subcommand executes"
              ],
              "implementation": "cli classify -> fs.readFileSync(...) / fs.writeFileSync(...)"
            }
          ]
        }
      },
      "services": [
        {
          "name": "gemini-batch",
          "target_interface": "batch job submit/status/download API",
          "operation_type": "http_post",
          "conditions": [
            "Selected classify subcommand talks to Gemini batch services"
          ],
          "operations": [
            {
              "operation": "RUN CLASSIFICATION",
              "trigger": "Submit or inspect Gemini classification jobs, or call direct classification",
              "conditions": [
                "classify subcommand is selected"
              ],
              "implementation": "cli classify -> handleJobSubmit/handleJobGet/handleJobDownload/geminiStructuredClassifyWithRetry"
            }
          ]
        }
      ]
    },
    "JiraCLI.merge": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Input and output files are provided"
          ],
          "operations": [
            {
              "operation": "READ RESULTS AND WRITE MERGED OUTPUT",
              "trigger": "Transform classification results into BigQuery upload format",
              "conditions": [
                "merge command executes"
              ],
              "implementation": "cli merge -> fs.readFileSync(...) / fs.writeFileSync(...)"
            }
          ]
        }
      },
      "services": []
    },
    "JiraCLI.upload": {
      "infrastructure": {},
      "services": [
        {
          "name": "bigquery",
          "target_interface": "dataset table insert API",
          "operation_type": "http_post",
          "conditions": [
            "BigQuery credentials are configured"
          ],
          "operations": [
            {
              "operation": "UPLOAD RECORDS",
              "trigger": "Upload merged Jira data into BigQuery",
              "conditions": [
                "uploadToBigQuery(...) succeeds"
              ],
              "implementation": "cli upload -> uploadToBigQuery(...)"
            }
          ]
        }
      ]
    }
  }
}
