@aviaratech/ai-delivery 0.3.43 → 0.3.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +1 -1
  2. package/dist/agentReadiness.test.js +12 -0
  3. package/dist/agentReadiness.test.js.map +2 -2
  4. package/dist/cli.js +2 -1
  5. package/dist/cli.js.map +2 -2
  6. package/dist/directoryIndependent.test.js +22 -3
  7. package/dist/directoryIndependent.test.js.map +3 -3
  8. package/dist/dispatch.js.map +2 -2
  9. package/dist/fixtures/builderReady.d.ts +4 -0
  10. package/dist/fixtures/builderReady.js +2 -0
  11. package/dist/fixtures/builderReady.js.map +2 -2
  12. package/dist/fixtures/inertTarget.d.ts +11 -0
  13. package/dist/fixtures/inertTarget.js +5 -0
  14. package/dist/fixtures/inertTarget.js.map +2 -2
  15. package/dist/fixtures/issue63.d.ts +7 -0
  16. package/dist/issue.d.ts +21 -1
  17. package/dist/issue.js +103 -12
  18. package/dist/issue.js.map +2 -2
  19. package/dist/issueBlockerGuard.test.js +11 -0
  20. package/dist/issueBlockerGuard.test.js.map +2 -2
  21. package/dist/issueContract.d.ts +23 -0
  22. package/dist/issueContract.js +77 -9
  23. package/dist/issueContract.js.map +2 -2
  24. package/dist/issueContract.test.d.ts +3 -0
  25. package/dist/issueContract.test.js +92 -5
  26. package/dist/issueContract.test.js.map +2 -2
  27. package/dist/issueIntake.test.js +37 -0
  28. package/dist/issueIntake.test.js.map +2 -2
  29. package/dist/issueJournal.d.ts +13 -9
  30. package/dist/issueJournal.js +14 -10
  31. package/dist/issueJournal.js.map +2 -2
  32. package/dist/issueJournal.test.js +11 -8
  33. package/dist/issueJournal.test.js.map +2 -2
  34. package/dist/issueTracking.test.js +135 -2
  35. package/dist/issueTracking.test.js.map +3 -3
  36. package/dist/mcp/index.js +10 -3
  37. package/dist/mcp/index.js.map +2 -2
  38. package/dist/mcp/tools.d.ts +49 -25
  39. package/dist/mcp/tools.js +23 -5
  40. package/dist/mcp/tools.js.map +2 -2
  41. package/dist/readView.d.ts +2 -0
  42. package/dist/readView.js +1 -1
  43. package/dist/readView.js.map +2 -2
  44. package/dist/releaseReconciliation.test.js +20 -6
  45. package/dist/releaseReconciliation.test.js.map +2 -2
  46. package/package.json +1 -1
  47. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  48. package/plugins/ai-delivery/plugin.json +1 -1
  49. package/plugins/ai-delivery/runtime/dist/cli.js +139 -113
  50. package/plugins/ai-delivery/runtime/package.json +1 -1
  51. package/plugins/ai-delivery/skills/ticket-design/SKILL.md +11 -10
package/README.md CHANGED
@@ -117,4 +117,4 @@ Release still requires the exact mandatory archive inventory, complete release/c
117
117
 
118
118
  Release is manual, main-only and uses npm trusted publishing. A packaged README edit changes the release candidate: retain accepted archives and independently qualify the new exact source/archive before dispatching.
119
119
 
120
- Source version **0.3.43** and green PR checks do not establish its qualification; see [#199](https://github.com/aviaratech/ai-delivery/issues/199). Wrappers and workflow definitions do not prove [#200](https://github.com/aviaratech/ai-delivery/issues/200)'s **under-60-second regular checks / under-five-minute qualification** targets. Functional removals and remaining documentation obligations stay with [#201](https://github.com/aviaratech/ai-delivery/issues/201).
120
+ Source version **0.3.45** and green PR checks do not establish its qualification; see [#199](https://github.com/aviaratech/ai-delivery/issues/199). Wrappers and workflow definitions do not prove [#200](https://github.com/aviaratech/ai-delivery/issues/200)'s **under-60-second regular checks / under-five-minute qualification** targets. Functional removals and remaining documentation obligations stay with [#201](https://github.com/aviaratech/ai-delivery/issues/201).
@@ -95,4 +95,16 @@ test("a legacy Ready issue without builder is ready and warns builder.unset; a b
95
95
  assert.equal(result.ready, true);
96
96
  assert.deepEqual(result.warnings, []);
97
97
  });
98
+ test("an already-Ready issue with a local path, no Prior work and a long contract is ready and warns", () => {
99
+ const issue = {
100
+ ...builderReady(),
101
+ priorWork: void 0,
102
+ outcome: Array.from({ length: 800 }, () => "w").join(" "),
103
+ proof: [".local/operator/run.sh"]
104
+ };
105
+ const result = evaluate({ title: issue.title, body: renderIssueBody(issue) });
106
+ assert.equal(result.ready, true);
107
+ const codes = result.warnings.map((w) => w.code);
108
+ for (const code of ["priorWork", "local-path", "contract-words"]) assert.ok(codes.includes(code), code);
109
+ });
98
110
  //# sourceMappingURL=agentReadiness.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/agentReadiness.test.ts"],
4
- "sourcesContent": ["import assert from 'node:assert/strict';\nimport { mkdtempSync, rmSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { test } from 'vitest';\nimport { evaluateAgentReadiness } from './agent.js';\nimport { IssueFields, renderIssueBody } from './issueContract.js';\nimport { builderReady } from './fixtures/builderReady.js';\n\nfunction fixture() {\n return IssueFields.parse({\n title: 'Reject invalid widget identifiers before persistence',\n issueType: 'Task',\n points: 2,\n problem: 'The Project Todo column tracks work; TODO/TBD are literal documentation.',\n outcome: 'Reject malformed widget identifiers.',\n acceptanceCriteria: [\n {\n behavior: 'An invalid widget identifier returns an error without a write.',\n verifiedBy: 'A synthetic mock asserts no write.',\n },\n ],\n outOfScope: ['Changing storage.'],\n context: { files: ['src/absent.ts'], components: [], evidence: [] },\n });\n}\nfunction evaluate(overrides: Partial<Parameters<typeof evaluateAgentReadiness>[0]> = {}) {\n const issue = fixture();\n return evaluateAgentReadiness({\n title: issue.title,\n body: renderIssueBody(issue),\n points: 2,\n priority: 'High',\n issueType: 'Task',\n repoRoot: undefined,\n ...overrides,\n });\n}\n\ntest('readiness from a non-git directory accepts Todo prose, absent paths and portable non-command verification', () => {\n const prior = process.cwd();\n const root = mkdtempSync(join(tmpdir(), 'typed-readiness-'));\n try {\n process.chdir(root);\n const result = evaluate();\n assert.equal(result.ready, true);\n assert.deepEqual(result.failures, []);\n } finally {\n process.chdir(prior);\n rmSync(root, { recursive: true, force: true });\n }\n});\ntest('one or eight observable criteria are valid; count warns above seven', () => {\n for (const count of [1, 8]) {\n const issue = fixture();\n issue.acceptanceCriteria = Array.from({ length: count }, () => ({ ...issue.acceptanceCriteria[0]! }));\n const result = evaluate({ body: renderIssueBody(issue) });\n assert.equal(result.ready, true);\n assert.equal(\n result.warnings.some((w) => w.code === 'many-criteria'),\n count === 8,\n );\n }\n});\nfor (const [name, override, code] of [\n ['missing live Points', { points: undefined }, 'points'],\n ['missing live Priority', { priority: undefined }, 'priority'],\n ['missing live issue type', { issueType: undefined }, 'issue-type'],\n ['open native blocker', { blockedBy: [17] }, 'blocked'],\n ['tracking parent', { trackingParent: true }, 'tracking-parent'],\n] as const)\n test(name + ' blocks independently of a valid body', () => {\n const result = evaluate(override);\n assert.equal(result.ready, false);\n assert.ok(result.failures.some((f) => f.code === code));\n });\ntest('draft and structured open questions block even without TODO markers', () => {\n for (const changed of [{ draft: true }, { openQuestions: ['Select the persistence contract.'] }]) {\n const issue = { ...fixture(), ...changed };\n assert.equal(evaluate({ body: renderIssueBody(issue) }).ready, false);\n }\n});\ntest('native Points drift and visible/payload divergence cannot pass canonical readiness', () => {\n assert.ok(evaluate({ points: 3 }).failures.some((f) => f.code === 'points.sync'));\n assert.ok(\n evaluate({ body: renderIssueBody(fixture()).replace('## Status', '## Changed status') }).failures.some(\n (f) => f.code === 'body.canonical',\n ),\n );\n});\n\ntest('a legacy Ready issue without builder is ready and warns builder.unset; a builder-ready one does not', () => {\n const legacy = evaluate();\n assert.equal(legacy.ready, true);\n assert.ok(legacy.warnings.some((w) => w.code === 'builder.unset'));\n const built = builderReady();\n const result = evaluate({ title: built.title, body: renderIssueBody(built) });\n assert.equal(result.ready, true);\n assert.deepEqual(result.warnings, []);\n});\n"],
5
- "mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,aAAa,cAAc;AACpC,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,8BAA8B;AACvC,SAAS,aAAa,uBAAuB;AAC7C,SAAS,oBAAoB;AAE7B,SAAS,UAAU;AACjB,S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AM,EAAE,SAAS;AAAA,IACpB;AAAA,EACF;AACF,CAAC;AAED,KAAK,uGAAuG,MAAM;AAChH,QAAM,SAAS,SAAS;AACxB,SAAO,MAAM,OAAO,OAAO,IAAI;AAC/B,SAAO,GAAG,OAAO,SAAS,KAAK,CAAC,MAAM,EAAE,SAAS,eAAe,CAAC;AACjE,QAAM,QAAQ,aAAa;AAC3B,QAAM,SAAS,SAAS,EAAE,OAAO,MAAM,OAAO,MAAM,gBAAgB,KAAK,EAAE,CAAC;AAC5E,SAAO,MAAM,OAAO,OAAO,IAAI;AAC/B,SAAO,UAAU,OAAO,UAAU,CAAC,CAAC;AACtC,CAAC;",
4
+ "sourcesContent": ["import assert from 'node:assert/strict';\nimport { mkdtempSync, rmSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { test } from 'vitest';\nimport { evaluateAgentReadiness } from './agent.js';\nimport { IssueFields, renderIssueBody } from './issueContract.js';\nimport { builderReady } from './fixtures/builderReady.js';\n\nfunction fixture() {\n return IssueFields.parse({\n title: 'Reject invalid widget identifiers before persistence',\n issueType: 'Task',\n points: 2,\n problem: 'The Project Todo column tracks work; TODO/TBD are literal documentation.',\n outcome: 'Reject malformed widget identifiers.',\n acceptanceCriteria: [\n {\n behavior: 'An invalid widget identifier returns an error without a write.',\n verifiedBy: 'A synthetic mock asserts no write.',\n },\n ],\n outOfScope: ['Changing storage.'],\n context: { files: ['src/absent.ts'], components: [], evidence: [] },\n });\n}\nfunction evaluate(overrides: Partial<Parameters<typeof evaluateAgentReadiness>[0]> = {}) {\n const issue = fixture();\n return evaluateAgentReadiness({\n title: issue.title,\n body: renderIssueBody(issue),\n points: 2,\n priority: 'High',\n issueType: 'Task',\n repoRoot: undefined,\n ...overrides,\n });\n}\n\ntest('readiness from a non-git directory accepts Todo prose, absent paths and portable non-command verification', () => {\n const prior = process.cwd();\n const root = mkdtempSync(join(tmpdir(), 'typed-readiness-'));\n try {\n process.chdir(root);\n const result = evaluate();\n assert.equal(result.ready, true);\n assert.deepEqual(result.failures, []);\n } finally {\n process.chdir(prior);\n rmSync(root, { recursive: true, force: true });\n }\n});\ntest('one or eight observable criteria are valid; count warns above seven', () => {\n for (const count of [1, 8]) {\n const issue = fixture();\n issue.acceptanceCriteria = Array.from({ length: count }, () => ({ ...issue.acceptanceCriteria[0]! }));\n const result = evaluate({ body: renderIssueBody(issue) });\n assert.equal(result.ready, true);\n assert.equal(\n result.warnings.some((w) => w.code === 'many-criteria'),\n count === 8,\n );\n }\n});\nfor (const [name, override, code] of [\n ['missing live Points', { points: undefined }, 'points'],\n ['missing live Priority', { priority: undefined }, 'priority'],\n ['missing live issue type', { issueType: undefined }, 'issue-type'],\n ['open native blocker', { blockedBy: [17] }, 'blocked'],\n ['tracking parent', { trackingParent: true }, 'tracking-parent'],\n] as const)\n test(name + ' blocks independently of a valid body', () => {\n const result = evaluate(override);\n assert.equal(result.ready, false);\n assert.ok(result.failures.some((f) => f.code === code));\n });\ntest('draft and structured open questions block even without TODO markers', () => {\n for (const changed of [{ draft: true }, { openQuestions: ['Select the persistence contract.'] }]) {\n const issue = { ...fixture(), ...changed };\n assert.equal(evaluate({ body: renderIssueBody(issue) }).ready, false);\n }\n});\ntest('native Points drift and visible/payload divergence cannot pass canonical readiness', () => {\n assert.ok(evaluate({ points: 3 }).failures.some((f) => f.code === 'points.sync'));\n assert.ok(\n evaluate({ body: renderIssueBody(fixture()).replace('## Status', '## Changed status') }).failures.some(\n (f) => f.code === 'body.canonical',\n ),\n );\n});\n\ntest('a legacy Ready issue without builder is ready and warns builder.unset; a builder-ready one does not', () => {\n const legacy = evaluate();\n assert.equal(legacy.ready, true);\n assert.ok(legacy.warnings.some((w) => w.code === 'builder.unset'));\n const built = builderReady();\n const result = evaluate({ title: built.title, body: renderIssueBody(built) });\n assert.equal(result.ready, true);\n assert.deepEqual(result.warnings, []);\n});\n\ntest('an already-Ready issue with a local path, no Prior work and a long contract is ready and warns', () => {\n const issue = {\n ...builderReady(),\n priorWork: undefined,\n outcome: Array.from({ length: 800 }, () => 'w').join(' '),\n proof: ['.local/operator/run.sh'],\n };\n const result = evaluate({ title: issue.title, body: renderIssueBody(issue) });\n assert.equal(result.ready, true);\n const codes = result.warnings.map((w) => w.code);\n for (const code of ['priorWork', 'local-path', 'contract-words']) assert.ok(codes.includes(code), code);\n});\n"],
5
+ "mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,aAAa,cAAc;AACpC,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,8BAA8B;AACvC,SAAS,aAAa,uBAAuB;AAC7C,SAAS,oBAAoB;AAE7B,SAAS,UAAU;AACjB,SAAO,YAAY,MAAM;AAAA,IACvB,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,oBAAoB;AAAA,MAClB;AAAA,QACE,UAAU;AAAA,QACV,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IACA,YAAY,CAAC,mBAAmB;AAAA,IAChC,SAAS,EAAE,OAAO,CAAC,eAAe,GAAG,YAAY,CAAC,GAAG,UAAU,CAAC,EAAE;AAAA,EACpE,CAAC;AACH;AACA,SAAS,SAAS,YAAmE,CAAC,GAAG;AACvF,QAAM,QAAQ,QAAQ;AACtB,SAAO,uBAAuB;AAAA,IAC5B,OAAO,MAAM;AAAA,IACb,MAAM,gBAAgB,KAAK;AAAA,IAC3B,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,WAAW;AAAA,IACX,UAAU;AAAA,IACV,GAAG;AAAA,EACL,CAAC;AACH;AAEA,KAAK,6GAA6G,MAAM;AACtH,QAAM,QAAQ,QAAQ,IAAI;AAC1B,QAAM,OAAO,YAAY,KAAK,OAAO,GAAG,kBAAkB,CAAC;AAC3D,MAAI;AACF,YAAQ,MAAM,IAAI;AAClB,UAAM,SAAS,SAAS;AACxB,WAAO,MAAM,OAAO,OAAO,IAAI;AAC/B,WAAO,U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C/C,aAAW,QAAQ,CAAC,aAAa,cAAc,gBAAgB,EAAG,QAAO,GAAG,MAAM,SAAS,IAAI,GAAG,IAAI;AACxG,CAAC;",
6
6
  "names": []
7
7
  }
package/dist/cli.js CHANGED
@@ -200,7 +200,7 @@ for (const name of ["list", "search"]) {
200
200
  })
201
201
  );
202
202
  }
203
- program.command("update").requiredOption("--issue <number>").option("--fields-file <path>", "UTF-8 JSON typed issue field patch").option("--draft", "Explicitly write an incomplete parked draft").option("--title <title>").option("--body <markdown>").option("--body-file <path>").option("--type <type>").option("--points <number>").option("--priority <priority>").option("--labels <labels>").option("--blocked-by <numbers>").option("--blocks <numbers>", "Add this issue as a blocker of these dependents").option("--override-reason <reason>", "Required explanation when adding a blocker to active work").option("--milestone <number>").option("--parent <number>").option("--state <state>").option("--project-status <status>", "Set Todo, In Progress, Blocked or Done with a public reason").option("--project-status-reason <reason>", "Required public reason for an explicit Project Status").option("--preserve-history", "Preserve the previous title and body before a rewrite").option("--close-reason <reason>").option("--superseded-by <number>").option("--park", "Park execution while retaining the issue worktree").option("--defer", "Defer until an explicit undefer").option("--defer-until <date>", "Record an ISO date condition without automatic undeferral").option("--defer-trigger <text>", "Record the condition for reconsidering deferred work").option("--undefer", "Explicitly clear deferral; draft and park remain unchanged").action(
203
+ program.command("update").requiredOption("--issue <number>").option("--fields-file <path>", "UTF-8 JSON typed issue field patch").option("--draft", "Explicitly write an incomplete parked draft").option("--title <title>").option("--body <markdown>").option("--body-file <path>").option("--type <type>").option("--points <number>").option("--priority <priority>").option("--labels <labels>").option("--blocked-by <numbers>").option("--blocks <numbers>", "Add this issue as a blocker of these dependents").option("--override-reason <reason>", "Required explanation when adding a blocker to active work").option("--milestone <number>").option("--parent <number>").option("--state <state>").option("--project-status <status>", "Set Todo, In Progress, Blocked or Done with a public reason").option("--project-status-reason <reason>", "Required public reason for an explicit Project Status").option("--preserve-history", "Preserve the previous title and body before a rewrite").option("--close-reason <reason>").option("--closeout-verdict <text>", "Study verdict (1\u20133 lines); required to close a study as completed").option("--closeout-result-file <path>", "File holding the study READOUT's Result section, verbatim").option("--superseded-by <number>").option("--park", "Park execution while retaining the issue worktree").option("--defer", "Defer until an explicit undefer").option("--defer-until <date>", "Record an ISO date condition without automatic undeferral").option("--defer-trigger <text>", "Record the condition for reconsidering deferred work").option("--undefer", "Explicitly clear deferral; draft and park remain unchanged").action(
204
204
  async (o) => run(
205
205
  "issue_update",
206
206
  fields(
@@ -223,6 +223,7 @@ program.command("update").requiredOption("--issue <number>").option("--fields-fi
223
223
  projectStatus: o.projectStatus === void 0 && o.projectStatusReason === void 0 ? void 0 : ProjectStatusPatch.parse({ status: o.projectStatus, reason: o.projectStatusReason }),
224
224
  preserveHistory: o.preserveHistory === true ? true : void 0,
225
225
  closeReason: o.closeReason,
226
+ closeout: o.closeoutVerdict === void 0 && o.closeoutResultFile === void 0 ? void 0 : { verdict: o.closeoutVerdict, result: body(void 0, o.closeoutResultFile) },
226
227
  supersededBy: int(o.supersededBy),
227
228
  park: o.park === true ? true : void 0,
228
229
  defer: o.defer === true || o.deferUntil !== void 0 || o.deferTrigger !== void 0 ? {
package/dist/cli.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/cli.ts"],
4
- "sourcesContent": ["#!/usr/bin/env node\nimport { closeSync, constants, fstatSync, openSync, readFileSync, readSync } from 'node:fs';\nimport { createHash } from 'node:crypto';\nimport { createDeliveryGitHubClients } from './github/client.js';\nimport { appCredentialSource, loadDeliverySettings } from './config/deliveryConfig.js';\nimport { Command } from 'commander';\nimport { z } from 'zod';\n\nimport { printCommandError, printCommandResult } from './cliResult.js';\nimport { contextFor, executeTool, type ExecutionContext } from './dispatch.js';\nimport { listPrs, preflightReviewRoute, prChecks, submitFormalReview } from './pr.js';\nimport {\n assertReviewVerdictTarget,\n buildReviewArtifact,\n parseReviewVerdict,\n readGitHubReviewBase,\n ReviewSubmissionError,\n validateReviewTarget,\n} from './review.js';\nimport { serveAiDeliveryMcp } from './mcp/index.js';\nimport type { AiDeliveryMcpToolName } from './mcp/tools.js';\nimport { PACKAGE_VERSION } from './version.js';\nimport { managePlugin } from './pluginInstaller.js';\nimport { IssueWriteSchema, IssueStatusPatch, IssueDeferralPatch, ProjectStatusPatch } from './issueContract.js';\nimport { NativeIssueDateFields } from './github/nativeIssueMetadata.js';\nimport { ProjectTradeFields } from './github/projectNumbers.js';\nimport { DeliveryError } from './errors.js';\n\nconst program = new Command();\nprogram\n .name('ai-delivery')\n .description('Generic GitHub issue and pull request delivery')\n .version(PACKAGE_VERSION)\n .option('--identity <name>', 'Configured author or reviewer identity')\n .option('--personal-auth', 'Explicit legacy personal-token author override')\n .option('--json', 'Print JSON output')\n .option('--verbose', 'Include full bodies, diffs and routing with --json')\n .option('--repo <owner/name>', 'GitHub repository owner/name; works from any directory')\n .option('--repo-root <path>', 'Launch directory or explicit clone for local operations', process.cwd());\n\n// Only the plugin command group owns a local --version input. Skip global option\n// values when selecting its parser so an unrelated argument named plugin has no effect.\nfor (let index = 2; index < process.argv.length; index++) {\n const argument = process.argv[index]!;\n const option = program.options.find((value) => value.long === argument.split('=')[0] || value.short === argument);\n if (option) {\n if (option.required && !argument.includes('=')) index++;\n continue;\n }\n if (argument === 'plugin') program.enablePositionalOptions();\n break;\n}\n\nfunction execution(): ExecutionContext {\n const options = program.opts<{\n identity?: string;\n personalAuth?: boolean;\n repo?: string;\n repoRoot: string;\n verbose?: boolean;\n }>();\n const identity = (options.identity ?? process.env.AI_DELIVERY_IDENTITY)?.trim() || undefined;\n return {\n repoRoot: options.repoRoot,\n ...(options.verbose === true ? { verbose: true } : {}),\n ...(identity === undefined ? {} : { identity }),\n personalAuth: options.personalAuth === true,\n ...(options.repo === undefined ? {} : { repo: options.repo }),\n };\n}\nfunction int(value: string | undefined): number | undefined {\n return value === undefined ? undefined : Number(value);\n}\nfunction list(value: string | undefined): string[] | undefined {\n return value === undefined\n ? undefined\n : value\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean);\n}\nfunction ints(value: string | undefined): number[] | undefined {\n return list(value)?.map(Number);\n}\nfunction body(value: string | undefined, file: string | undefined): string | undefined {\n if (value !== undefined && file !== undefined) throw new Error('Pass either --body or --body-file.');\n return file === undefined ? value : readFileSync(file, 'utf8');\n}\nfunction fields(file: string | undefined, overrides: Record<string, unknown>, update = false): Record<string, unknown> {\n const value: unknown = file === undefined ? {} : JSON.parse(readFileSync(file, 'utf8'));\n return {\n ...IssueWriteSchema.extend({\n ...NativeIssueDateFields,\n ...(update ? ProjectTradeFields : {}),\n ...IssueDeferralPatch,\n status: IssueStatusPatch.optional(),\n ...(update ? { projectStatus: ProjectStatusPatch.optional() } : {}),\n preserveHistory: z.boolean().optional(),\n }).parse(value),\n ...Object.fromEntries(Object.entries(overrides).filter(([, item]) => item !== undefined)),\n };\n}\nfunction run(name: AiDeliveryMcpToolName, input: Record<string, unknown>): Promise<void> {\n const options = program.opts<{ json?: boolean; verbose?: boolean }>();\n return executeTool(name, input, execution()).then((value) =>\n printCommandResult(name, value, options.json === true && options.verbose === true),\n );\n}\nfunction print(value: unknown): void {\n process.stdout.write(`${JSON.stringify(value, null, 2)}\\n`);\n}\n\nconst plugin = program.command('plugin').description('Manage the ai-delivery native plugin');\nfor (const action of ['install', 'doctor', 'preview', 'update', 'rollback', 'remove'] as const) {\n const command = plugin\n .command(action)\n .requiredOption('--host <host>', 'Native host: codex or claude-code')\n .option('--scope <scope>', 'Native scope: user, project, or local; Codex supports user', 'user')\n .option('--dry-run', 'Describe the selected target without changing files or contacting native tools')\n .option('--json', 'Print the result as JSON');\n if (action === 'install' || action === 'update')\n command.requiredOption('--version <version>', 'Explicit published package version');\n if (action === 'doctor')\n command.option('--check-auth', 'Read configured role identities and repository access; requires explicit --repo');\n command.action(\n async (options: {\n host: string;\n scope: string;\n version?: string;\n dryRun?: boolean;\n json?: boolean;\n checkAuth?: boolean;\n }) => {\n const result = await managePlugin({\n action,\n host: options.host,\n scope: options.scope,\n ...(options.version === undefined ? {} : { version: options.version }),\n dryRun: options.dryRun === true,\n checkAuth: options.checkAuth === true,\n ...(options.checkAuth && execution().repo ? { repo: execution().repo } : {}),\n repoRoot: execution().repoRoot,\n });\n if (options.json) {\n print(result);\n return;\n }\n process.stdout.write(\n `${result.dryRun ? 'Dry run: ' : ''}${result.host} ${result.scope}: ${action}; version ${result.version ?? 'none'}; installed ${result.installed}; changed ${result.changed}\\n`,\n );\n if (result.mcp)\n process.stdout.write(\n `Bundled MCP startup: ${result.mcp.startup}${result.mcp.error ? ` (${result.mcp.error})` : ''}\\n`,\n );\n if (result.diagnostics) {\n process.stdout.write(\n `Registration observations: ${result.diagnostics.registrations.length}; completeness ${result.diagnostics.completeness}; migration ${result.diagnostics.migration}; planned changes ${result.diagnostics.plannedChanges.length}\\n`,\n );\n for (const entry of result.diagnostics.registrations)\n process.stdout.write(\n `${entry.kind} ${entry.scope}: ownership ${entry.ownership}; source ${entry.source}; version ${entry.version ?? 'unknown'}\\n`,\n );\n process.stdout.write(`Unverified conditions: ${result.diagnostics.findings.join(', ')}\\n`);\n }\n if (result.activation)\n process.stdout.write(\n `Native session loaded version: unverified. Installed observation: ${result.activation.installedVersion ?? 'unknown'}; separate startup: ${result.activation.startupVersion ?? 'not checked'}. Use the host's surface-specific activation guidance.\\n`,\n );\n if (result.recoveryRequired)\n process.stdout.write('Resume the interrupted original plugin command to recover this target.\\n');\n if (result.authProbe)\n process.stdout.write(\n `Selected-runtime CLI auth probe: ${result.authProbe.outcome}; settings ${result.authProbe.settings}; process references ${result.authProbe.processReferences.status}; authentication ${result.authProbe.authentication.status}; repository access ${result.authProbe.repositoryAccess.status}${result.authProbe.reason ? ` (${result.authProbe.reason})` : ''}\\nNative GUI credential propagation and counted exact-head approval remain unverified.\\n`,\n );\n },\n );\n}\n\nprogram\n .command('create')\n .requiredOption('--title <title>')\n .option('--fields-file <path>', 'UTF-8 JSON typed fields; explicit CLI fields take precedence')\n .option('--epic', 'Create an active unsized parent issue')\n .option('--op-id <id>', 'Stable identity for retrying the same create')\n .option('--draft', 'Explicitly write an incomplete parked draft')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Required explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .action(async (o: Record<string, string> & { draft?: boolean; epic?: boolean }) =>\n run(\n 'issue_create',\n fields(o.fieldsFile, {\n title: o.title,\n epic: o.epic,\n opId: o.opId,\n body: body(o.body, o.bodyFile),\n issueType: o.type,\n points: int(o.points),\n priority: o.priority,\n labels: list(o.labels),\n blockedBy: ints(o.blockedBy),\n blocks: ints(o.blocks),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone),\n parentIssueNumber: int(o.parent),\n ...(o.draft === true ? { draft: true } : {}),\n }),\n ),\n );\n\nprogram\n .command('start')\n .option('--issue <number>')\n .option('--request <text>')\n .option('--request-id <id>', 'Stable retry identity for a new issue start')\n .option('--title <title>')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Capacity override reason, or explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .option('--branch <branch>')\n .option('--resume-created')\n .action(async (o: Record<string, string | boolean>) =>\n run('issue_start', {\n issueNumber: int(o.issue as string),\n request: o.request,\n requestId: o.requestId,\n title: o.title,\n body: body(o.body as string, o.bodyFile as string),\n issueType: o.type,\n points: int(o.points as string),\n priority: o.priority,\n labels: list(o.labels as string),\n blockedBy: ints(o.blockedBy as string),\n blocks: ints(o.blocks as string),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone as string),\n parentIssueNumber: int(o.parent as string),\n branch: o.branch,\n resumeCreated: o.resumeCreated === true,\n }),\n );\n\nfor (const name of ['list', 'search'] as const) {\n program\n .command(name)\n .option('--query <text>', 'Literal text to search in the selected repository')\n .option('--state <state>')\n .option('--labels <labels>')\n .option('--parent <number>')\n .option('--type <type>')\n .option('--project-status <status>')\n .option('--updated-since <timestamp>')\n .option('--page <number>')\n .option('--per-page <number>')\n .action(async (o: Record<string, string>) =>\n run(name === 'list' ? 'issue_list' : 'issue_search', {\n query: o.query,\n state: o.state,\n labels: list(o.labels),\n parentIssueNumber: int(o.parent),\n issueType: o.type,\n projectStatus: o.projectStatus,\n updatedSince: o.updatedSince,\n page: int(o.page),\n perPage: int(o.perPage),\n }),\n );\n}\n\nprogram\n .command('update')\n .requiredOption('--issue <number>')\n .option('--fields-file <path>', 'UTF-8 JSON typed issue field patch')\n .option('--draft', 'Explicitly write an incomplete parked draft')\n .option('--title <title>')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Required explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .option('--state <state>')\n .option('--project-status <status>', 'Set Todo, In Progress, Blocked or Done with a public reason')\n .option('--project-status-reason <reason>', 'Required public reason for an explicit Project Status')\n .option('--preserve-history', 'Preserve the previous title and body before a rewrite')\n .option('--close-reason <reason>')\n .option('--superseded-by <number>')\n .option('--park', 'Park execution while retaining the issue worktree')\n .option('--defer', 'Defer until an explicit undefer')\n .option('--defer-until <date>', 'Record an ISO date condition without automatic undeferral')\n .option('--defer-trigger <text>', 'Record the condition for reconsidering deferred work')\n .option('--undefer', 'Explicitly clear deferral; draft and park remain unchanged')\n .action(\n async (\n o: Record<string, string> & {\n park?: boolean;\n preserveHistory?: boolean;\n draft?: boolean;\n defer?: boolean;\n undefer?: boolean;\n },\n ) =>\n run(\n 'issue_update',\n fields(\n o.fieldsFile,\n {\n issueNumber: int(o.issue),\n title: o.title,\n ...(o.draft === true ? { draft: true } : {}),\n body: body(o.body, o.bodyFile),\n issueType: o.type,\n points: int(o.points),\n priority: o.priority,\n labels: list(o.labels),\n blockedBy: ints(o.blockedBy),\n blocks: ints(o.blocks),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone),\n parentIssueNumber: int(o.parent),\n state: o.state,\n projectStatus:\n o.projectStatus === undefined && o.projectStatusReason === undefined\n ? undefined\n : ProjectStatusPatch.parse({ status: o.projectStatus, reason: o.projectStatusReason }),\n preserveHistory: o.preserveHistory === true ? true : undefined,\n closeReason: o.closeReason,\n supersededBy: int(o.supersededBy),\n park: o.park === true ? true : undefined,\n defer:\n o.defer === true || o.deferUntil !== undefined || o.deferTrigger !== undefined\n ? {\n ...(o.deferUntil === undefined ? {} : { until: o.deferUntil }),\n ...(o.deferTrigger === undefined ? {} : { trigger: o.deferTrigger }),\n }\n : undefined,\n undefer: o.undefer === true ? true : undefined,\n },\n true,\n ),\n ),\n );\n\nprogram\n .command('batch:update')\n .description('Plan or apply 1\u201350 current-repository issue updates with ordered readback')\n .requiredOption('--items-file <path>', 'UTF-8 JSON array of complete issue_update inputs')\n .option('--dry-run', 'Return plans and readback without any native writes')\n .action(async (o: { itemsFile: string; dryRun?: boolean }) =>\n run('issue_batch_update', {\n items: JSON.parse(readFileSync(o.itemsFile, 'utf8')) as unknown,\n dryRun: o.dryRun === true,\n }),\n );\n\nprogram\n .command('milestone:create')\n .description('Create a repository milestone with an optional due date and description')\n .requiredOption('--title <title>')\n .option('--due-on <date>', 'ISO date, YYYY-MM-DD')\n .option('--description <text>')\n .action(async (o: { title: string; dueOn?: string; description?: string }) =>\n run('milestone_create', {\n title: o.title,\n ...(o.dueOn === undefined ? {} : { dueOn: o.dueOn }),\n ...(o.description === undefined ? {} : { description: o.description }),\n }),\n );\n\nprogram\n .command('info')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => run('issue_info', { issueNumber: int(o.issue) }));\nprogram\n .command('ready:check')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => run('issue_ready_check', { issueNumber: int(o.issue) }));\nprogram\n .command('pr:create')\n .description('Create or reuse an issue-closing PR from a pushed --head, from any directory.')\n .requiredOption('--issue <number>')\n .option('--pr <number>', 'Exact existing PR selector; never creates a replacement')\n .option('--non-closing', 'Open a draft PR that references the issue and leaves it open')\n .option('--expected-head <sha>', 'Refuse unless the pushed head is this SHA')\n .option('--title <title>')\n .option('--body-file <path>')\n .option('--head <branch>', 'Pushed remote head; no ai-delivery branch or worktree setup required')\n .option('--base <branch>', 'Repository default branch (inferred when omitted)')\n .option('--ready', 'Publish ready, or promote the author-owned PR selected by --head')\n .option('--dry-run')\n .action(\n async (o: {\n issue: string;\n pr?: string;\n nonClosing?: boolean;\n expectedHead?: string;\n title?: string;\n bodyFile?: string;\n head?: string;\n base?: string;\n ready?: boolean;\n dryRun?: boolean;\n }) =>\n run('issue_pr_create', {\n issueNumber: int(o.issue),\n prNumber: int(o.pr),\n nonClosing: o.nonClosing,\n expectedHeadSha: o.expectedHead,\n title: o.title,\n body: body(undefined, o.bodyFile),\n headBranch: o.head,\n base: o.base,\n draft: o.ready !== true,\n dryRun: o.dryRun === true,\n }),\n );\nprogram\n .command('pr:info')\n .description('Inspect an exact PR; combine --issue and --pr to verify its native closing-issue association.')\n .option('--non-closing', 'Verify an exact native non-closing PR-to-issue reference')\n .option('--issue <number>', 'Issue to verify; issue-only lookup requires a GitHub-linked branch')\n .option('--pr <number>', 'Exact PR number; include --issue after issue branch links are replaced on publication')\n .action(async (o: { issue?: string; pr?: string; nonClosing?: boolean }) =>\n run('issue_pr_info', { issueNumber: int(o.issue), prNumber: int(o.pr), nonClosing: o.nonClosing }),\n );\nprogram\n .command('pr:list')\n .option('--state <state>', 'open, closed or all', 'open')\n .action(async (o: { state: string }) => {\n if (!['open', 'closed', 'all'].includes(o.state)) throw new Error('Invalid PR state.');\n const context = await contextFor(execution(), 'pr:list');\n print(await listPrs(context, o.state as 'open' | 'closed' | 'all'));\n });\nprogram\n .command('pr:checks')\n .requiredOption('--pr <number>')\n .action(async (o: { pr: string }) => {\n const context = await contextFor(execution(), 'pr:checks');\n print(await prChecks(context, Number(o.pr)));\n });\nprogram\n .command('pr:review')\n .requiredOption('--issue <number>')\n .requiredOption('--pr <number>')\n .requiredOption('--artifact <path>', 'Path to a UTF-8 JSON review artifact file (not inline JSON)')\n .option('--non-closing', 'Retain the referenced issue OPEN; finish refuses this mode')\n .option('--dry-run')\n .action(async (o: { issue: string; pr: string; artifact: string; dryRun?: boolean; nonClosing?: boolean }) =>\n run('issue_pr_review', {\n issueNumber: int(o.issue),\n prNumber: int(o.pr),\n artifact: readFileSync(o.artifact, 'utf8'),\n dryRun: o.dryRun === true,\n nonClosing: o.nonClosing,\n }),\n );\nprogram\n .command('review')\n .argument('<action>', 'submit or doctor')\n .description('Submit an independent verdict or check its configured App')\n .option('--pr <number>', 'Required for submit')\n .option('--head <sha>', 'Required exact head for submit')\n .option('--identity <name>', 'Required configured reviewer profile')\n .option('--verdict <path>', 'Required for submit: UTF-8 JSON verdict, at most 64 KiB')\n .action(async (action: string, o: { pr?: string; head?: string; identity?: string; verdict?: string }) => {\n if (!['submit', 'doctor'].includes(action)) throw new DeliveryError('review action must be submit or doctor.');\n const identity = o.identity ?? execution().identity ?? '';\n const settings = await loadDeliverySettings(undefined, { reviewerIdentity: identity, prepareEnvironment: true });\n const profile = settings.roles.reviewer;\n if (!('appId' in profile))\n throw new DeliveryError('identity: Select a reviewer profile with explicit App/provider binding.');\n if (action === 'doctor') {\n if (o.pr !== undefined || o.head !== undefined || o.verdict !== undefined)\n throw new DeliveryError('review doctor does not accept submission inputs.');\n const clients = await createDeliveryGitHubClients({\n config: settings,\n identity,\n role: 'reviewer',\n env: settings.environment!,\n });\n const actorLogin = await clients.appActorLogin!();\n printCommandResult('review:doctor', {\n status: 'authenticated',\n identity,\n provider: profile.provider,\n appId: profile.appId,\n installationId: profile.installationId,\n actorLogin,\n source: appCredentialSource(profile).type,\n });\n return;\n }\n if (o.pr === undefined || o.head === undefined || o.verdict === undefined)\n throw new DeliveryError('review submit requires --pr, --head and --verdict.');\n const fd = openSync(o.verdict, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);\n let raw: string;\n let verdictFileSha256: string;\n try {\n if (!fstatSync(fd).isFile()) throw new DeliveryError('verdict: Expected a regular file.');\n const bytes = Buffer.alloc(64 * 1024 + 1);\n let size = 0;\n while (size < bytes.length) {\n const count = readSync(fd, bytes, size, bytes.length - size, null);\n if (count === 0) break;\n size += count;\n }\n if (size > 64 * 1024) throw new DeliveryError('verdict: File exceeds 64 KiB.');\n const content = bytes.subarray(0, size);\n raw = content.toString('utf8');\n if (!Buffer.from(raw, 'utf8').equals(content)) throw new DeliveryError('verdict: Expected valid UTF-8.');\n verdictFileSha256 = `sha256:${createHash('sha256').update(content).digest('hex')}`;\n } finally {\n closeSync(fd);\n }\n const verdict = parseReviewVerdict(raw);\n assertReviewVerdictTarget(verdict, profile.provider, o.head);\n const prNumber = z.number().int().positive().parse(Number(o.pr));\n const authorContext = await contextFor(\n { ...execution(), settings, identity, reviewSubmission: true },\n 'pr:info',\n 'author',\n );\n const reviewBase = await readGitHubReviewBase(authorContext, prNumber, o.head);\n const artifact = buildReviewArtifact({\n verdict,\n verdictFileSha256,\n identity,\n provider: profile.provider,\n expectedHead: o.head,\n prNumber,\n authorIdentity: settings.roles.author.identity,\n reviewBase,\n });\n await validateReviewTarget(authorContext, artifact, prNumber);\n const clients = await createDeliveryGitHubClients({\n config: authorContext.config,\n identity,\n role: 'reviewer',\n selectedAuthor: authorContext.clients,\n ...(authorContext.credentialEnvironment === undefined ? {} : { env: authorContext.credentialEnvironment }),\n });\n const context = { ...authorContext, clients };\n try {\n printCommandResult(\n 'review:submit',\n await submitFormalReview(context, {\n artifact: JSON.stringify(artifact),\n issueNumber: verdict.issueNumber,\n prNumber,\n ...(verdict.nonClosing === undefined ? {} : { nonClosing: verdict.nonClosing }),\n }),\n );\n } catch (error) {\n if (!(error instanceof ReviewSubmissionError)) throw error;\n process.stdout.write(\n `${JSON.stringify({ status: 'submission-unverified', submission: error.submission, nextAction: error.message })}\\n`,\n );\n process.exitCode = 1;\n }\n });\n\nprogram\n .command('config:resolve')\n .description('Read the effective GitHub destination and admission digest')\n .action(async () => {\n const context = await contextFor(execution(), 'config:resolve');\n print({\n configDigest: context.configuration?.configDigest,\n routing: context.configuration?.routing,\n reviewRoute: await preflightReviewRoute(context, undefined, undefined, 'development'),\n });\n });\nprogram.command('mcp:serve').action(async () => serveAiDeliveryMcp(execution()));\n\nprogram.parseAsync(process.argv).catch((error: unknown) => {\n const options = program.opts<{ json?: boolean; verbose?: boolean }>();\n printCommandError(error, options.json === true && options.verbose === true);\n});\n"],
5
- "mappings": ";AACA,SAAS,WAAW,WAAW,WAAW,UAAU,cAAc,gBAAgB;AAClF,SAAS,kBAAkB;AAC3B,SAAS,mCAAmC;AAC5C,SAAS,qBAAqB,4BAA4B;AAC1D,SAAS,eAAe;AACxB,SAAS,SAAS;AAElB,SAAS,mBAAmB,0BAA0B;AACtD,SAAS,YAAY,mBAA0C;AAC/D,SAAS,SAAS,sBAAsB,UAAU,0BAA0B;AAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAEnC,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,kBAAkB,oBAAoB,0BAA0B;AAC3F,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAE9B,MAAM,UAAU,IAAI,QAAQ;AAC5B,QACG,KAAK,aAAa,EAClB,YAAY,gDAAgD,EAC5D,QAAQ,eAAe,EACvB,OAAO,qBAAqB,wCAAwC,EACpE,OAAO,mBAAmB,gDAAgD,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AAc,QAAQ,eAAe;AAAA,IACrC,SAAS,QAAQ,eAAe;AAAA,IAChC,aAAa,MAAM,qBAAqB,SAAS,QAAW,QAAW,aAAa;AAAA,EACtF,CAAC;AACH,CAAC;AACH,QAAQ,QAAQ,WAAW,EAAE,OAAO,YAAY,mBAAmB,UAAU,CAAC,CAAC;AAE/E,QAAQ,WAAW,QAAQ,IAAI,EAAE,MAAM,CAAC,UAAmB;AACzD,QAAM,UAAU,QAAQ,KAA4C;AACpE,oBAAkB,OAAO,QAAQ,SAAS,QAAQ,QAAQ,YAAY,IAAI;AAC5E,CAAC;",
4
+ "sourcesContent": ["#!/usr/bin/env node\nimport { closeSync, constants, fstatSync, openSync, readFileSync, readSync } from 'node:fs';\nimport { createHash } from 'node:crypto';\nimport { createDeliveryGitHubClients } from './github/client.js';\nimport { appCredentialSource, loadDeliverySettings } from './config/deliveryConfig.js';\nimport { Command } from 'commander';\nimport { z } from 'zod';\n\nimport { printCommandError, printCommandResult } from './cliResult.js';\nimport { contextFor, executeTool, type ExecutionContext } from './dispatch.js';\nimport { listPrs, preflightReviewRoute, prChecks, submitFormalReview } from './pr.js';\nimport {\n assertReviewVerdictTarget,\n buildReviewArtifact,\n parseReviewVerdict,\n readGitHubReviewBase,\n ReviewSubmissionError,\n validateReviewTarget,\n} from './review.js';\nimport { serveAiDeliveryMcp } from './mcp/index.js';\nimport type { AiDeliveryMcpToolName } from './mcp/tools.js';\nimport { PACKAGE_VERSION } from './version.js';\nimport { managePlugin } from './pluginInstaller.js';\nimport { IssueWriteSchema, IssueStatusPatch, IssueDeferralPatch, ProjectStatusPatch } from './issueContract.js';\nimport { NativeIssueDateFields } from './github/nativeIssueMetadata.js';\nimport { ProjectTradeFields } from './github/projectNumbers.js';\nimport { DeliveryError } from './errors.js';\n\nconst program = new Command();\nprogram\n .name('ai-delivery')\n .description('Generic GitHub issue and pull request delivery')\n .version(PACKAGE_VERSION)\n .option('--identity <name>', 'Configured author or reviewer identity')\n .option('--personal-auth', 'Explicit legacy personal-token author override')\n .option('--json', 'Print JSON output')\n .option('--verbose', 'Include full bodies, diffs and routing with --json')\n .option('--repo <owner/name>', 'GitHub repository owner/name; works from any directory')\n .option('--repo-root <path>', 'Launch directory or explicit clone for local operations', process.cwd());\n\n// Only the plugin command group owns a local --version input. Skip global option\n// values when selecting its parser so an unrelated argument named plugin has no effect.\nfor (let index = 2; index < process.argv.length; index++) {\n const argument = process.argv[index]!;\n const option = program.options.find((value) => value.long === argument.split('=')[0] || value.short === argument);\n if (option) {\n if (option.required && !argument.includes('=')) index++;\n continue;\n }\n if (argument === 'plugin') program.enablePositionalOptions();\n break;\n}\n\nfunction execution(): ExecutionContext {\n const options = program.opts<{\n identity?: string;\n personalAuth?: boolean;\n repo?: string;\n repoRoot: string;\n verbose?: boolean;\n }>();\n const identity = (options.identity ?? process.env.AI_DELIVERY_IDENTITY)?.trim() || undefined;\n return {\n repoRoot: options.repoRoot,\n ...(options.verbose === true ? { verbose: true } : {}),\n ...(identity === undefined ? {} : { identity }),\n personalAuth: options.personalAuth === true,\n ...(options.repo === undefined ? {} : { repo: options.repo }),\n };\n}\nfunction int(value: string | undefined): number | undefined {\n return value === undefined ? undefined : Number(value);\n}\nfunction list(value: string | undefined): string[] | undefined {\n return value === undefined\n ? undefined\n : value\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean);\n}\nfunction ints(value: string | undefined): number[] | undefined {\n return list(value)?.map(Number);\n}\nfunction body(value: string | undefined, file: string | undefined): string | undefined {\n if (value !== undefined && file !== undefined) throw new Error('Pass either --body or --body-file.');\n return file === undefined ? value : readFileSync(file, 'utf8');\n}\nfunction fields(file: string | undefined, overrides: Record<string, unknown>, update = false): Record<string, unknown> {\n const value: unknown = file === undefined ? {} : JSON.parse(readFileSync(file, 'utf8'));\n return {\n ...IssueWriteSchema.extend({\n ...NativeIssueDateFields,\n ...(update ? ProjectTradeFields : {}),\n ...IssueDeferralPatch,\n status: IssueStatusPatch.optional(),\n ...(update ? { projectStatus: ProjectStatusPatch.optional() } : {}),\n preserveHistory: z.boolean().optional(),\n }).parse(value),\n ...Object.fromEntries(Object.entries(overrides).filter(([, item]) => item !== undefined)),\n };\n}\nfunction run(name: AiDeliveryMcpToolName, input: Record<string, unknown>): Promise<void> {\n const options = program.opts<{ json?: boolean; verbose?: boolean }>();\n return executeTool(name, input, execution()).then((value) =>\n printCommandResult(name, value, options.json === true && options.verbose === true),\n );\n}\nfunction print(value: unknown): void {\n process.stdout.write(`${JSON.stringify(value, null, 2)}\\n`);\n}\n\nconst plugin = program.command('plugin').description('Manage the ai-delivery native plugin');\nfor (const action of ['install', 'doctor', 'preview', 'update', 'rollback', 'remove'] as const) {\n const command = plugin\n .command(action)\n .requiredOption('--host <host>', 'Native host: codex or claude-code')\n .option('--scope <scope>', 'Native scope: user, project, or local; Codex supports user', 'user')\n .option('--dry-run', 'Describe the selected target without changing files or contacting native tools')\n .option('--json', 'Print the result as JSON');\n if (action === 'install' || action === 'update')\n command.requiredOption('--version <version>', 'Explicit published package version');\n if (action === 'doctor')\n command.option('--check-auth', 'Read configured role identities and repository access; requires explicit --repo');\n command.action(\n async (options: {\n host: string;\n scope: string;\n version?: string;\n dryRun?: boolean;\n json?: boolean;\n checkAuth?: boolean;\n }) => {\n const result = await managePlugin({\n action,\n host: options.host,\n scope: options.scope,\n ...(options.version === undefined ? {} : { version: options.version }),\n dryRun: options.dryRun === true,\n checkAuth: options.checkAuth === true,\n ...(options.checkAuth && execution().repo ? { repo: execution().repo } : {}),\n repoRoot: execution().repoRoot,\n });\n if (options.json) {\n print(result);\n return;\n }\n process.stdout.write(\n `${result.dryRun ? 'Dry run: ' : ''}${result.host} ${result.scope}: ${action}; version ${result.version ?? 'none'}; installed ${result.installed}; changed ${result.changed}\\n`,\n );\n if (result.mcp)\n process.stdout.write(\n `Bundled MCP startup: ${result.mcp.startup}${result.mcp.error ? ` (${result.mcp.error})` : ''}\\n`,\n );\n if (result.diagnostics) {\n process.stdout.write(\n `Registration observations: ${result.diagnostics.registrations.length}; completeness ${result.diagnostics.completeness}; migration ${result.diagnostics.migration}; planned changes ${result.diagnostics.plannedChanges.length}\\n`,\n );\n for (const entry of result.diagnostics.registrations)\n process.stdout.write(\n `${entry.kind} ${entry.scope}: ownership ${entry.ownership}; source ${entry.source}; version ${entry.version ?? 'unknown'}\\n`,\n );\n process.stdout.write(`Unverified conditions: ${result.diagnostics.findings.join(', ')}\\n`);\n }\n if (result.activation)\n process.stdout.write(\n `Native session loaded version: unverified. Installed observation: ${result.activation.installedVersion ?? 'unknown'}; separate startup: ${result.activation.startupVersion ?? 'not checked'}. Use the host's surface-specific activation guidance.\\n`,\n );\n if (result.recoveryRequired)\n process.stdout.write('Resume the interrupted original plugin command to recover this target.\\n');\n if (result.authProbe)\n process.stdout.write(\n `Selected-runtime CLI auth probe: ${result.authProbe.outcome}; settings ${result.authProbe.settings}; process references ${result.authProbe.processReferences.status}; authentication ${result.authProbe.authentication.status}; repository access ${result.authProbe.repositoryAccess.status}${result.authProbe.reason ? ` (${result.authProbe.reason})` : ''}\\nNative GUI credential propagation and counted exact-head approval remain unverified.\\n`,\n );\n },\n );\n}\n\nprogram\n .command('create')\n .requiredOption('--title <title>')\n .option('--fields-file <path>', 'UTF-8 JSON typed fields; explicit CLI fields take precedence')\n .option('--epic', 'Create an active unsized parent issue')\n .option('--op-id <id>', 'Stable identity for retrying the same create')\n .option('--draft', 'Explicitly write an incomplete parked draft')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Required explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .action(async (o: Record<string, string> & { draft?: boolean; epic?: boolean }) =>\n run(\n 'issue_create',\n fields(o.fieldsFile, {\n title: o.title,\n epic: o.epic,\n opId: o.opId,\n body: body(o.body, o.bodyFile),\n issueType: o.type,\n points: int(o.points),\n priority: o.priority,\n labels: list(o.labels),\n blockedBy: ints(o.blockedBy),\n blocks: ints(o.blocks),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone),\n parentIssueNumber: int(o.parent),\n ...(o.draft === true ? { draft: true } : {}),\n }),\n ),\n );\n\nprogram\n .command('start')\n .option('--issue <number>')\n .option('--request <text>')\n .option('--request-id <id>', 'Stable retry identity for a new issue start')\n .option('--title <title>')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Capacity override reason, or explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .option('--branch <branch>')\n .option('--resume-created')\n .action(async (o: Record<string, string | boolean>) =>\n run('issue_start', {\n issueNumber: int(o.issue as string),\n request: o.request,\n requestId: o.requestId,\n title: o.title,\n body: body(o.body as string, o.bodyFile as string),\n issueType: o.type,\n points: int(o.points as string),\n priority: o.priority,\n labels: list(o.labels as string),\n blockedBy: ints(o.blockedBy as string),\n blocks: ints(o.blocks as string),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone as string),\n parentIssueNumber: int(o.parent as string),\n branch: o.branch,\n resumeCreated: o.resumeCreated === true,\n }),\n );\n\nfor (const name of ['list', 'search'] as const) {\n program\n .command(name)\n .option('--query <text>', 'Literal text to search in the selected repository')\n .option('--state <state>')\n .option('--labels <labels>')\n .option('--parent <number>')\n .option('--type <type>')\n .option('--project-status <status>')\n .option('--updated-since <timestamp>')\n .option('--page <number>')\n .option('--per-page <number>')\n .action(async (o: Record<string, string>) =>\n run(name === 'list' ? 'issue_list' : 'issue_search', {\n query: o.query,\n state: o.state,\n labels: list(o.labels),\n parentIssueNumber: int(o.parent),\n issueType: o.type,\n projectStatus: o.projectStatus,\n updatedSince: o.updatedSince,\n page: int(o.page),\n perPage: int(o.perPage),\n }),\n );\n}\n\nprogram\n .command('update')\n .requiredOption('--issue <number>')\n .option('--fields-file <path>', 'UTF-8 JSON typed issue field patch')\n .option('--draft', 'Explicitly write an incomplete parked draft')\n .option('--title <title>')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Required explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .option('--state <state>')\n .option('--project-status <status>', 'Set Todo, In Progress, Blocked or Done with a public reason')\n .option('--project-status-reason <reason>', 'Required public reason for an explicit Project Status')\n .option('--preserve-history', 'Preserve the previous title and body before a rewrite')\n .option('--close-reason <reason>')\n .option('--closeout-verdict <text>', 'Study verdict (1\u20133 lines); required to close a study as completed')\n .option('--closeout-result-file <path>', \"File holding the study READOUT's Result section, verbatim\")\n .option('--superseded-by <number>')\n .option('--park', 'Park execution while retaining the issue worktree')\n .option('--defer', 'Defer until an explicit undefer')\n .option('--defer-until <date>', 'Record an ISO date condition without automatic undeferral')\n .option('--defer-trigger <text>', 'Record the condition for reconsidering deferred work')\n .option('--undefer', 'Explicitly clear deferral; draft and park remain unchanged')\n .action(\n async (\n o: Record<string, string> & {\n park?: boolean;\n preserveHistory?: boolean;\n draft?: boolean;\n defer?: boolean;\n undefer?: boolean;\n },\n ) =>\n run(\n 'issue_update',\n fields(\n o.fieldsFile,\n {\n issueNumber: int(o.issue),\n title: o.title,\n ...(o.draft === true ? { draft: true } : {}),\n body: body(o.body, o.bodyFile),\n issueType: o.type,\n points: int(o.points),\n priority: o.priority,\n labels: list(o.labels),\n blockedBy: ints(o.blockedBy),\n blocks: ints(o.blocks),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone),\n parentIssueNumber: int(o.parent),\n state: o.state,\n projectStatus:\n o.projectStatus === undefined && o.projectStatusReason === undefined\n ? undefined\n : ProjectStatusPatch.parse({ status: o.projectStatus, reason: o.projectStatusReason }),\n preserveHistory: o.preserveHistory === true ? true : undefined,\n closeReason: o.closeReason,\n closeout:\n o.closeoutVerdict === undefined && o.closeoutResultFile === undefined\n ? undefined\n : { verdict: o.closeoutVerdict, result: body(undefined, o.closeoutResultFile) },\n supersededBy: int(o.supersededBy),\n park: o.park === true ? true : undefined,\n defer:\n o.defer === true || o.deferUntil !== undefined || o.deferTrigger !== undefined\n ? {\n ...(o.deferUntil === undefined ? {} : { until: o.deferUntil }),\n ...(o.deferTrigger === undefined ? {} : { trigger: o.deferTrigger }),\n }\n : undefined,\n undefer: o.undefer === true ? true : undefined,\n },\n true,\n ),\n ),\n );\n\nprogram\n .command('batch:update')\n .description('Plan or apply 1\u201350 current-repository issue updates with ordered readback')\n .requiredOption('--items-file <path>', 'UTF-8 JSON array of complete issue_update inputs')\n .option('--dry-run', 'Return plans and readback without any native writes')\n .action(async (o: { itemsFile: string; dryRun?: boolean }) =>\n run('issue_batch_update', {\n items: JSON.parse(readFileSync(o.itemsFile, 'utf8')) as unknown,\n dryRun: o.dryRun === true,\n }),\n );\n\nprogram\n .command('milestone:create')\n .description('Create a repository milestone with an optional due date and description')\n .requiredOption('--title <title>')\n .option('--due-on <date>', 'ISO date, YYYY-MM-DD')\n .option('--description <text>')\n .action(async (o: { title: string; dueOn?: string; description?: string }) =>\n run('milestone_create', {\n title: o.title,\n ...(o.dueOn === undefined ? {} : { dueOn: o.dueOn }),\n ...(o.description === undefined ? {} : { description: o.description }),\n }),\n );\n\nprogram\n .command('info')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => run('issue_info', { issueNumber: int(o.issue) }));\nprogram\n .command('ready:check')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => run('issue_ready_check', { issueNumber: int(o.issue) }));\nprogram\n .command('pr:create')\n .description('Create or reuse an issue-closing PR from a pushed --head, from any directory.')\n .requiredOption('--issue <number>')\n .option('--pr <number>', 'Exact existing PR selector; never creates a replacement')\n .option('--non-closing', 'Open a draft PR that references the issue and leaves it open')\n .option('--expected-head <sha>', 'Refuse unless the pushed head is this SHA')\n .option('--title <title>')\n .option('--body-file <path>')\n .option('--head <branch>', 'Pushed remote head; no ai-delivery branch or worktree setup required')\n .option('--base <branch>', 'Repository default branch (inferred when omitted)')\n .option('--ready', 'Publish ready, or promote the author-owned PR selected by --head')\n .option('--dry-run')\n .action(\n async (o: {\n issue: string;\n pr?: string;\n nonClosing?: boolean;\n expectedHead?: string;\n title?: string;\n bodyFile?: string;\n head?: string;\n base?: string;\n ready?: boolean;\n dryRun?: boolean;\n }) =>\n run('issue_pr_create', {\n issueNumber: int(o.issue),\n prNumber: int(o.pr),\n nonClosing: o.nonClosing,\n expectedHeadSha: o.expectedHead,\n title: o.title,\n body: body(undefined, o.bodyFile),\n headBranch: o.head,\n base: o.base,\n draft: o.ready !== true,\n dryRun: o.dryRun === true,\n }),\n );\nprogram\n .command('pr:info')\n .description('Inspect an exact PR; combine --issue and --pr to verify its native closing-issue association.')\n .option('--non-closing', 'Verify an exact native non-closing PR-to-issue reference')\n .option('--issue <number>', 'Issue to verify; issue-only lookup requires a GitHub-linked branch')\n .option('--pr <number>', 'Exact PR number; include --issue after issue branch links are replaced on publication')\n .action(async (o: { issue?: string; pr?: string; nonClosing?: boolean }) =>\n run('issue_pr_info', { issueNumber: int(o.issue), prNumber: int(o.pr), nonClosing: o.nonClosing }),\n );\nprogram\n .command('pr:list')\n .option('--state <state>', 'open, closed or all', 'open')\n .action(async (o: { state: string }) => {\n if (!['open', 'closed', 'all'].includes(o.state)) throw new Error('Invalid PR state.');\n const context = await contextFor(execution(), 'pr:list');\n print(await listPrs(context, o.state as 'open' | 'closed' | 'all'));\n });\nprogram\n .command('pr:checks')\n .requiredOption('--pr <number>')\n .action(async (o: { pr: string }) => {\n const context = await contextFor(execution(), 'pr:checks');\n print(await prChecks(context, Number(o.pr)));\n });\nprogram\n .command('pr:review')\n .requiredOption('--issue <number>')\n .requiredOption('--pr <number>')\n .requiredOption('--artifact <path>', 'Path to a UTF-8 JSON review artifact file (not inline JSON)')\n .option('--non-closing', 'Retain the referenced issue OPEN; finish refuses this mode')\n .option('--dry-run')\n .action(async (o: { issue: string; pr: string; artifact: string; dryRun?: boolean; nonClosing?: boolean }) =>\n run('issue_pr_review', {\n issueNumber: int(o.issue),\n prNumber: int(o.pr),\n artifact: readFileSync(o.artifact, 'utf8'),\n dryRun: o.dryRun === true,\n nonClosing: o.nonClosing,\n }),\n );\nprogram\n .command('review')\n .argument('<action>', 'submit or doctor')\n .description('Submit an independent verdict or check its configured App')\n .option('--pr <number>', 'Required for submit')\n .option('--head <sha>', 'Required exact head for submit')\n .option('--identity <name>', 'Required configured reviewer profile')\n .option('--verdict <path>', 'Required for submit: UTF-8 JSON verdict, at most 64 KiB')\n .action(async (action: string, o: { pr?: string; head?: string; identity?: string; verdict?: string }) => {\n if (!['submit', 'doctor'].includes(action)) throw new DeliveryError('review action must be submit or doctor.');\n const identity = o.identity ?? execution().identity ?? '';\n const settings = await loadDeliverySettings(undefined, { reviewerIdentity: identity, prepareEnvironment: true });\n const profile = settings.roles.reviewer;\n if (!('appId' in profile))\n throw new DeliveryError('identity: Select a reviewer profile with explicit App/provider binding.');\n if (action === 'doctor') {\n if (o.pr !== undefined || o.head !== undefined || o.verdict !== undefined)\n throw new DeliveryError('review doctor does not accept submission inputs.');\n const clients = await createDeliveryGitHubClients({\n config: settings,\n identity,\n role: 'reviewer',\n env: settings.environment!,\n });\n const actorLogin = await clients.appActorLogin!();\n printCommandResult('review:doctor', {\n status: 'authenticated',\n identity,\n provider: profile.provider,\n appId: profile.appId,\n installationId: profile.installationId,\n actorLogin,\n source: appCredentialSource(profile).type,\n });\n return;\n }\n if (o.pr === undefined || o.head === undefined || o.verdict === undefined)\n throw new DeliveryError('review submit requires --pr, --head and --verdict.');\n const fd = openSync(o.verdict, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);\n let raw: string;\n let verdictFileSha256: string;\n try {\n if (!fstatSync(fd).isFile()) throw new DeliveryError('verdict: Expected a regular file.');\n const bytes = Buffer.alloc(64 * 1024 + 1);\n let size = 0;\n while (size < bytes.length) {\n const count = readSync(fd, bytes, size, bytes.length - size, null);\n if (count === 0) break;\n size += count;\n }\n if (size > 64 * 1024) throw new DeliveryError('verdict: File exceeds 64 KiB.');\n const content = bytes.subarray(0, size);\n raw = content.toString('utf8');\n if (!Buffer.from(raw, 'utf8').equals(content)) throw new DeliveryError('verdict: Expected valid UTF-8.');\n verdictFileSha256 = `sha256:${createHash('sha256').update(content).digest('hex')}`;\n } finally {\n closeSync(fd);\n }\n const verdict = parseReviewVerdict(raw);\n assertReviewVerdictTarget(verdict, profile.provider, o.head);\n const prNumber = z.number().int().positive().parse(Number(o.pr));\n const authorContext = await contextFor(\n { ...execution(), settings, identity, reviewSubmission: true },\n 'pr:info',\n 'author',\n );\n const reviewBase = await readGitHubReviewBase(authorContext, prNumber, o.head);\n const artifact = buildReviewArtifact({\n verdict,\n verdictFileSha256,\n identity,\n provider: profile.provider,\n expectedHead: o.head,\n prNumber,\n authorIdentity: settings.roles.author.identity,\n reviewBase,\n });\n await validateReviewTarget(authorContext, artifact, prNumber);\n const clients = await createDeliveryGitHubClients({\n config: authorContext.config,\n identity,\n role: 'reviewer',\n selectedAuthor: authorContext.clients,\n ...(authorContext.credentialEnvironment === undefined ? {} : { env: authorContext.credentialEnvironment }),\n });\n const context = { ...authorContext, clients };\n try {\n printCommandResult(\n 'review:submit',\n await submitFormalReview(context, {\n artifact: JSON.stringify(artifact),\n issueNumber: verdict.issueNumber,\n prNumber,\n ...(verdict.nonClosing === undefined ? {} : { nonClosing: verdict.nonClosing }),\n }),\n );\n } catch (error) {\n if (!(error instanceof ReviewSubmissionError)) throw error;\n process.stdout.write(\n `${JSON.stringify({ status: 'submission-unverified', submission: error.submission, nextAction: error.message })}\\n`,\n );\n process.exitCode = 1;\n }\n });\n\nprogram\n .command('config:resolve')\n .description('Read the effective GitHub destination and admission digest')\n .action(async () => {\n const context = await contextFor(execution(), 'config:resolve');\n print({\n configDigest: context.configuration?.configDigest,\n routing: context.configuration?.routing,\n reviewRoute: await preflightReviewRoute(context, undefined, undefined, 'development'),\n });\n });\nprogram.command('mcp:serve').action(async () => serveAiDeliveryMcp(execution()));\n\nprogram.parseAsync(process.argv).catch((error: unknown) => {\n const options = program.opts<{ json?: boolean; verbose?: boolean }>();\n printCommandError(error, options.json === true && options.verbose === true);\n});\n"],
5
+ "mappings": ";AACA,SAAS,WAAW,WAAW,WAAW,UAAU,cAAc,gBAAgB;AAClF,SAAS,kBAAkB;AAC3B,SAAS,mCAAmC;AAC5C,SAAS,qBAAqB,4BAA4B;AAC1D,SAAS,eAAe;AACxB,SAAS,SAAS;AAElB,SAAS,mBAAmB,0BAA0B;AACtD,SAAS,YAAY,mBAA0C;AAC/D,SAAS,SAAS,sBAAsB,UAAU,0BAA0B;AAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAEnC,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,kBAAkB,oBAAoB,0BAA0B;AAC3F,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAE9B,MAAM,UAAU,IAAI,QAAQ;AAC5B,QACG,KAAK,aAAa,EAClB,YAAY,gDAAgD,EAC5D,QAAQ,eAAe,EACvB,OAAO,qBAAqB,wCAAwC,EACpE,OAAO,mBAAmB,gDAAgD,EAC1E,OAAO,UAAU,mBAAmB,EACpC,OAAO,aAAa,oDAAoD,EACxE,OAAO,uBAAuB,wDAAwD,EACtF,OAAO,sBAAsB,2DAA2D,QAAQ,IAAI,CAAC;AAIxG,SAAS,QAAQ,GAAG,QAAQ,QAAQ,KAAK,QAAQ,SAAS;AACxD,QAAM,WAAW,QAAQ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,SAAS,QAAQ,eAAe;AAAA,IAChC,aAAa,MAAM,qBAAqB,SAAS,QAAW,QAAW,aAAa;AAAA,EACtF,CAAC;AACH,CAAC;AACH,QAAQ,QAAQ,WAAW,EAAE,OAAO,YAAY,mBAAmB,UAAU,CAAC,CAAC;AAE/E,QAAQ,WAAW,QAAQ,IAAI,EAAE,MAAM,CAAC,UAAmB;AACzD,QAAM,UAAU,QAAQ,KAA4C;AACpE,oBAAkB,OAAO,QAAQ,SAAS,QAAQ,QAAQ,YAAY,IAAI;AAC5E,CAAC;",
6
6
  "names": ["clients"]
7
7
  }
@@ -380,9 +380,9 @@ describe("per-call repository selection", () => {
380
380
  assert.deepEqual(journalTargets, ["example/a", "example/b", "example/a"], "refusals do not read a target");
381
381
  const inherited = await fixedClient.callTool({ name: "issue_comment", arguments: journal });
382
382
  assert.equal(inherited.isError, void 0, JSON.stringify(inherited));
383
- const readback = JSON.parse(inherited.content[0].text);
384
- assert.equal(readback.url, "https://github.com/example/a/issues/17#issuecomment-101");
385
- assert.equal(readback.reused, true, "omitting repo uses the fixed server selector");
383
+ const readback2 = JSON.parse(inherited.content[0].text);
384
+ assert.equal(readback2.url, "https://github.com/example/a/issues/17#issuecomment-101");
385
+ assert.equal(readback2.reused, true, "omitting repo uses the fixed server selector");
386
386
  } finally {
387
387
  await fixedClient.close();
388
388
  await fixedServer.close();
@@ -390,6 +390,25 @@ describe("per-call repository selection", () => {
390
390
  assert.equal(stored.length, 2, "inheriting the server selector reuses repository A");
391
391
  assert.deepEqual(journalTargets, ["example/a", "example/b", "example/a", "example/a"]);
392
392
  assert.equal(vi.mocked(repository.resolveRepoFromRemote).mock.calls.length, 0);
393
+ const call = (args) => client.callTool({ name: "issue_comment", arguments: { repo: "example/a", ...args } });
394
+ const plain = await call({ issueNumber: 17, body: "Plain note." });
395
+ assert.equal(plain.isError, void 0, JSON.stringify(plain));
396
+ assert.equal(stored.at(-1)?.body, "Plain note.", "a plain body posts exactly as sent");
397
+ const afterPlain = stored.length;
398
+ const mixed = await call({ ...journal, body: "Plain note." });
399
+ assert.equal(mixed.isError, true);
400
+ assert.match(JSON.stringify(mixed), /Send body alone for a plain comment, or kind with its journal fields\./u);
401
+ assert.equal(stored.length, afterPlain, "a mixed request writes nothing");
402
+ const asNull = await call({ ...journal, nextDate: null });
403
+ const asString = await call({ ...journal, nextDate: "null" });
404
+ assert.equal(asString.isError, void 0, JSON.stringify(asString));
405
+ assert.equal(stored.length, afterPlain + 1, 'the string "null" posts the same journal as null');
406
+ const readback = (result) => JSON.parse(result.content[0].text);
407
+ assert.equal(readback(asString).url, readback(asNull).url);
408
+ assert.equal(readback(asString).reused, true);
409
+ const impossible = await call({ ...journal, nextDate: "2026-02-30" });
410
+ assert.equal(impossible.isError, true);
411
+ assert.match(JSON.stringify(impossible), /nextDate must be a YYYY-MM-DD date, or null when none is scheduled\./u);
393
412
  const names = AI_DELIVERY_MCP_TOOLS.map((tool) => tool.name);
394
413
  for (const removed of [
395
414
  "issue_develop",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/directoryIndependent.test.ts"],
4
- "sourcesContent": ["import assert from 'node:assert/strict';\nimport { execFileSync } from 'node:child_process';\nimport { existsSync, mkdirSync, mkdtempSync, unlinkSync, rmSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { afterEach, describe, it, vi } from 'vitest';\n\nimport { loadDeliveryConfig, loadDeliverySettings } from './config/deliveryConfig.js';\nimport * as githubClients from './github/client.js';\nimport * as repository from './github/repo.js';\nimport * as gitCommands from './git.js';\nimport { executeTool } from './dispatch.js';\nimport { loadDeliveryContext } from './issue.js';\nimport * as deliveryConfig from './config/deliveryConfig.js';\nimport { createAiDeliveryMcpServer, AI_DELIVERY_MCP_TOOLS } from './mcp/index.js';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';\nimport { syntheticDiscoveryClients, syntheticDiscoveryConfig } from './fixtures/discovery.js';\n\nconst userSettings = {\n schemaVersion: 'ai-delivery.user@1',\n roles: {\n author: { authSource: 'personal', identity: 'host-author', credentialEnv: { token: 'SYNTHETIC_TOKEN' } },\n reviewer: {\n identity: 'app-reviewer',\n credentialEnv: { appId: 'APP_ID', installationId: 'INSTALLATION_ID', privateKeyPath: 'KEY_PATH' },\n },\n },\n project: 1,\n checkoutRoots: [],\n pointsField: 'Estimate',\n priorityField: 'Urgency',\n statusField: 'Flow',\n statuses: { blocked: 'Waiting', done: 'Shipped', inProgress: 'Active', todo: 'Queued' },\n};\n\ndescribe('directory-independent user configuration', () => {\n it('publishes repository guidance during initialization before a tool is called outside Git', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-discovery-guidance-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify(userSettings));\n const server = createAiDeliveryMcpServer({ repoRoot: root });\n const client = new Client({ name: 'discovery-guidance-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n const instructions = client.getInstructions();\n assert.equal(typeof instructions, 'string', 'initialize must provide guidance before deferred tool discovery');\n assert.match(instructions ?? '', /\\brepo\\b/u);\n assert.match(instructions ?? '', /\\bissue_info\\b/u);\n // This observes real protocol metadata, not whether an agent follows it.\n const listed = await client.listTools();\n for (const name of ['issue_info', 'issue_ready_check']) {\n const tool = listed.tools.find((candidate) => candidate.name === name);\n assert.ok(tool);\n const properties = tool.inputSchema.properties as Record<string, { description?: string }>;\n assert.equal(typeof properties.repo?.description, 'string', `${name} must describe its repository input`);\n assert.match(properties.repo?.description ?? '', /owner\\/name/u);\n }\n for (const arguments_ of [\n { issueNumber: 17, repo: 'example/widget', cached: true },\n { issueNumber: 17, repository: 'example/widget' },\n { issueNumber: 17, repo: 'invalid' },\n ]) {\n const rejected = await client.callTool({ name: 'issue_info', arguments: arguments_ });\n assert.equal(rejected.isError, true);\n assert.match(JSON.stringify(rejected), /Invalid arguments/u);\n assert.doesNotMatch(JSON.stringify(rejected), /SYNTHETIC_TOKEN|Git remotes/u);\n }\n assert.equal(existsSync(join(root, '.git')), false);\n assert.equal(existsSync(join(root, '.issue-cli')), false);\n } finally {\n await client.close();\n await server.close();\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('resolves an explicit repository in a non-Git directory without repository policy', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-directory-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n try {\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify(userSettings));\n const loaded = await loadDeliveryConfig(root, {\n repository: 'example/widget',\n clients: syntheticDiscoveryClients(syntheticDiscoveryConfig),\n } as never);\n assert.equal(loaded.config.repository, 'example/widget');\n assert.equal(loaded.config.roles.author.identity, 'host-author');\n assert.equal(loaded.configPath, process.env.AI_DELIVERY_CONFIG);\n assert.equal('policy' in loaded.config, false);\n } finally {\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n // #65: tools load their Project configuration through this context, not a fresh Project read.\n it('carries a discovered In Review option into the delivery context', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-review-option-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n try {\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify(userSettings));\n const loaded = await loadDeliveryConfig(root, {\n repository: 'example/widget',\n clients: syntheticDiscoveryClients(syntheticDiscoveryConfig, ['In Review']),\n } as never);\n vi.spyOn(deliveryConfig, 'loadDeliveryConfig').mockResolvedValue(loaded);\n vi.spyOn(githubClients, 'createDeliveryGitHubClients').mockResolvedValue({} as never);\n const context = await loadDeliveryContext({\n identity: 'host-author',\n role: 'author',\n repoRoot: root,\n repository: 'example/widget',\n });\n assert.equal(context.projectConfiguration?.reviewOptionId, 'STATUS-EXTRA-0');\n } finally {\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('never imports a tracked hostile policy while resolving a local checkout', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-hostile-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n const sentinel = join(root, 'executed');\n try {\n execFileSync('git', ['init', '--quiet', root]);\n execFileSync('git', ['remote', 'add', 'origin', 'https://github.com/example/widget.git'], { cwd: root });\n writeFileSync(\n join(root, 'ai-delivery.policy.mjs'),\n `import {writeFileSync} from 'node:fs';writeFileSync(${JSON.stringify(sentinel)},'executed');export const deliverySettings={};`,\n );\n execFileSync('git', ['add', 'ai-delivery.policy.mjs'], { cwd: root });\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify(userSettings));\n await loadDeliverySettings(root);\n for (const body of ['tracked', 'edited']) {\n writeFileSync(\n join(root, 'ai-delivery.policy.mjs'),\n `import {writeFileSync} from 'node:fs';writeFileSync(${JSON.stringify(sentinel)},${JSON.stringify(body)});export const deliverySettings={};`,\n );\n await loadDeliveryConfig(root, {\n repository: 'example/widget',\n clients: syntheticDiscoveryClients(syntheticDiscoveryConfig),\n });\n }\n assert.equal(existsSync(sentinel), false);\n } finally {\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('names a missing user setting before accessing Git or credentials', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-setting-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n try {\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify({ ...userSettings, roles: {} }));\n await assert.rejects(loadDeliverySettings(root), /roles.author/u);\n } finally {\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n});\n\nfor (const path of [\n 'schemaVersion',\n 'roles.author',\n 'roles.reviewer',\n 'roles.author.identity',\n 'roles.reviewer.identity',\n 'roles.author.credentialEnv',\n 'roles.reviewer.credentialEnv',\n 'project',\n 'checkoutRoots',\n 'roles.author.credentialEnv.token',\n 'roles.reviewer.credentialEnv.appId',\n 'roles.reviewer.credentialEnv.installationId',\n 'roles.reviewer.credentialEnv.privateKeyPath',\n]) {\n it(`names missing ${path} in operator settings`, async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-required-'));\n vi.stubEnv('AI_DELIVERY_CONFIG', join(root, 'user.json'));\n const settings = structuredClone(userSettings) as unknown as Record<string, unknown>;\n const keys = path.split('.');\n let target = settings;\n for (const key of keys.slice(0, -1)) target = target[key] as Record<string, unknown>;\n delete target[keys.at(-1)!];\n writeFileSync(process.env.AI_DELIVERY_CONFIG!, JSON.stringify(settings));\n try {\n await assert.rejects(\n loadDeliverySettings(root),\n (error) => error instanceof Error && error.message.includes(path),\n );\n } finally {\n rmSync(root, { recursive: true, force: true });\n }\n });\n}\n\nafterEach(() => {\n vi.restoreAllMocks();\n vi.unstubAllEnvs();\n});\n\ndescribe('per-call repository selection', () => {\n it('does not execute checkout filters or fsmonitor during local Git probes', () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-hostile-git-'));\n const sentinel = join(root, 'executed');\n const git = (...args: string[]) => execFileSync('git', args, { cwd: root });\n try {\n git('init', '-q');\n git('config', 'user.name', 'Synthetic');\n git('config', 'user.email', 'synthetic@example.test');\n writeFileSync(join(root, '.gitattributes'), '*.txt filter=hostile\\n');\n writeFileSync(join(root, 'change.txt'), 'original');\n git('add', '.');\n git('commit', '-qm', 'fixture');\n const script = join(root, 'hostile.cjs');\n writeFileSync(\n script,\n `require('node:fs').writeFileSync(${JSON.stringify(sentinel)},'executed');process.stdin.pipe(process.stdout);`,\n );\n git('config', 'filter.hostile.clean', `${process.execPath} ${script}`);\n git('config', 'filter.hostile.smudge', `${process.execPath} ${script}`);\n git('config', 'core.fsmonitor', `${process.execPath} ${script}`);\n mkdirSync(join(root, '.git', 'hooks'), { recursive: true });\n writeFileSync(join(root, 'change.txt'), 'changed');\n git('hash-object', '--path', 'change.txt', 'change.txt');\n assert.equal(existsSync(sentinel), true, 'fixture filter must be executable before the protected probe');\n unlinkSync(sentinel);\n gitCommands.git(root, 'hash-object', '--path', 'change.txt', 'change.txt');\n gitCommands.git(root, 'status', '--porcelain', '--untracked-files=all');\n assert.equal(existsSync(sentinel), false);\n } finally {\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('routes PRs and journals through one MCP server A \u2192 B \u2192 A without launch Git or identity environment', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-mcp-routing-'));\n const visited: string[] = [];\n const journalTargets: string[] = [];\n const stored: { id: number; body: string; html_url: string; issue_url: string; user: { login: string } }[] = [];\n let authorCalls = 0;\n vi.stubEnv('AI_DELIVERY_CONFIG', join(root, 'user.json'));\n vi.stubEnv('AI_DELIVERY_IDENTITY', '');\n writeFileSync(process.env.AI_DELIVERY_CONFIG!, JSON.stringify(userSettings));\n vi.spyOn(repository, 'resolveRepoFromRemote').mockImplementation(() => {\n throw new Error('launch Git must never run');\n });\n vi.spyOn(gitCommands, 'git').mockImplementation(() => {\n throw new Error('launch Git must never run');\n });\n vi.spyOn(githubClients, 'createDeliveryGitHubClients').mockImplementation(\n async (input) =>\n ({\n role: input.role,\n authSource: 'personal',\n authenticatedAuthor: async () => {\n authorCalls += 1;\n return { actorLogin: 'operator', credentialIdentity: 'user:1' };\n },\n graphql: (async (query: string, variables: Record<string, unknown>) => {\n const repo = typeof variables.repo === 'string' ? variables.repo : 'a';\n return syntheticDiscoveryClients({ ...syntheticDiscoveryConfig, repository: `example/${repo}` }).graphql(\n query,\n variables,\n );\n }) as githubClients.GitHubClients['graphql'],\n rest: {\n issues: {\n get: async (input: { owner: string; repo: string; issue_number: number }) => {\n journalTargets.push(`${input.owner}/${input.repo}`);\n return { data: { number: input.issue_number } };\n },\n listComments: async (input: { owner: string; repo: string; issue_number: number }) => ({\n data: stored.filter(\n (comment) =>\n comment.issue_url ===\n `https://api.github.com/repos/${input.owner}/${input.repo}/issues/${String(input.issue_number)}`,\n ),\n }),\n createComment: async (input: { owner: string; repo: string; issue_number: number; body: string }) => {\n const id = 101 + stored.length;\n const data = {\n id,\n body: input.body,\n html_url: `https://github.com/${input.owner}/${input.repo}/issues/${String(input.issue_number)}#issuecomment-${String(id)}`,\n issue_url: `https://api.github.com/repos/${input.owner}/${input.repo}/issues/${String(input.issue_number)}`,\n user: { login: 'operator' },\n };\n stored.push(data);\n return { data };\n },\n getComment: async (input: { owner: string; repo: string; comment_id: number }) => ({\n data: stored.find(\n (comment) =>\n comment.id === input.comment_id &&\n comment.issue_url === `https://api.github.com/repos/${input.owner}/${input.repo}/issues/17`,\n ),\n }),\n },\n pulls: {\n get: async (input: { owner: string; repo: string; pull_number: number }) => {\n visited.push(`${input.owner}/${input.repo}`);\n return {\n data: {\n number: input.pull_number,\n head: { sha: 'a'.repeat(40), ref: 'issue/17', repo: { full_name: `${input.owner}/${input.repo}` } },\n base: { sha: 'b'.repeat(40), ref: 'main', repo: { full_name: `${input.owner}/${input.repo}` } },\n state: 'open',\n merged: false,\n draft: true,\n html_url: `https://github.com/${input.owner}/${input.repo}/pull/23`,\n },\n };\n },\n },\n },\n }) as unknown as githubClients.GitHubClients,\n );\n const server = createAiDeliveryMcpServer({ repoRoot: root });\n const client = new Client({ name: 'directory-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n const journal = {\n issueNumber: 17,\n kind: 'progress',\n summary: 'Validation is implemented.',\n status: 'In progress',\n done: ['Added validation'],\n decisionNeeded: 'None',\n keyNumbers: [],\n evidence: ['https://github.com/example/widget/pull/23'],\n nextStep: 'Review',\n nextDate: '2026-10-09',\n };\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n for (const repo of ['example/a', 'example/b', 'example/a']) {\n const response = await client.callTool({ name: 'issue_pr_info', arguments: { repo, prNumber: 23 } });\n assert.equal(response.isError, undefined);\n const comment = await client.callTool({ name: 'issue_comment', arguments: { ...journal, repo } });\n assert.equal(comment.isError, undefined, JSON.stringify(comment));\n assert.match(\n JSON.stringify(comment),\n new RegExp(`https://github.com/${repo}/issues/17#issuecomment-10[12]`, 'u'),\n );\n }\n await executeTool('issue_pr_info', { repo: 'example/b', prNumber: 23 }, { repoRoot: root });\n assert.deepEqual(visited, ['example/a', 'example/b', 'example/a', 'example/b']);\n assert.deepEqual(journalTargets, ['example/a', 'example/b', 'example/a']);\n assert.equal(stored.length, 2, 'A retry reuses its own journal, without leaking repository B');\n const beforeInvalid = vi.mocked(githubClients.createDeliveryGitHubClients).mock.calls.length;\n const beforeInvalidAuthor = authorCalls;\n for (const invalid of [\n { ...journal, repo: 'example/a', unknown: true },\n { ...journal, repo: 'example/a', outcome: 'Wrong variant' },\n { ...journal, repo: 'example/a', kind: 'unsupported' },\n { ...journal, repo: 'example/a', nextDate: '2026-02-30' },\n { ...journal, repo: 'invalid' },\n ]) {\n const refused = await client.callTool({ name: 'issue_comment', arguments: invalid }).then(\n (result) => result.isError === true,\n () => true,\n );\n assert.equal(refused, true);\n }\n const fixedServer = createAiDeliveryMcpServer({ repoRoot: root, repo: 'example/a' });\n const fixedClient = new Client({ name: 'fixed-repository-fixture', version: '1' });\n const [fixedClientTransport, fixedServerTransport] = InMemoryTransport.createLinkedPair();\n try {\n await fixedServer.connect(fixedServerTransport);\n await fixedClient.connect(fixedClientTransport);\n const conflict = await fixedClient.callTool({\n name: 'issue_comment',\n arguments: { ...journal, repo: 'example/b' },\n });\n assert.equal(conflict.isError, true);\n assert.match(JSON.stringify(conflict), /selectors disagree/u);\n assert.equal(vi.mocked(githubClients.createDeliveryGitHubClients).mock.calls.length, beforeInvalid);\n assert.equal(authorCalls, beforeInvalidAuthor, 'refusals precede authentication');\n assert.equal(stored.length, 2, 'refusals do not write');\n assert.deepEqual(journalTargets, ['example/a', 'example/b', 'example/a'], 'refusals do not read a target');\n const inherited = await fixedClient.callTool({ name: 'issue_comment', arguments: journal });\n assert.equal(inherited.isError, undefined, JSON.stringify(inherited));\n const readback = JSON.parse((inherited.content as { text: string }[])[0]!.text) as {\n url: string;\n reused: boolean;\n };\n assert.equal(readback.url, 'https://github.com/example/a/issues/17#issuecomment-101');\n assert.equal(readback.reused, true, 'omitting repo uses the fixed server selector');\n } finally {\n await fixedClient.close();\n await fixedServer.close();\n }\n assert.equal(stored.length, 2, 'inheriting the server selector reuses repository A');\n assert.deepEqual(journalTargets, ['example/a', 'example/b', 'example/a', 'example/a']);\n assert.equal(vi.mocked(repository.resolveRepoFromRemote).mock.calls.length, 0);\n const names = AI_DELIVERY_MCP_TOOLS.map((tool) => tool.name as string);\n for (const removed of [\n 'issue_develop',\n 'issue_verify',\n 'issue_worktree_create',\n 'runtime_stage',\n 'runtime_admit',\n 'issue_worktree_transition_inspect',\n 'issue_worktree_transition_apply',\n ])\n assert.equal(names.includes(removed), false);\n } finally {\n await client.close();\n await server.close();\n rmSync(root, { recursive: true, force: true });\n }\n });\n});\n"],
5
- "mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,oBAAoB;AAC7B,SAAS,YAAY,WAAW,aAAa,YAAY,QAAQ,qBAAqB;AACtF,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,WAAW,UAAU,IAAI,UAAU;AAE5C,SAAS,oBAAoB,4BAA4B;AACzD,YAAY,mBAAmB;AAC/B,YAAY,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AAM,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,IAC/C;AAAA,EACF,CAAC;AACH,CAAC;",
6
- "names": ["input"]
4
+ "sourcesContent": ["import assert from 'node:assert/strict';\nimport { execFileSync } from 'node:child_process';\nimport { existsSync, mkdirSync, mkdtempSync, unlinkSync, rmSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { afterEach, describe, it, vi } from 'vitest';\n\nimport { loadDeliveryConfig, loadDeliverySettings } from './config/deliveryConfig.js';\nimport * as githubClients from './github/client.js';\nimport * as repository from './github/repo.js';\nimport * as gitCommands from './git.js';\nimport { executeTool } from './dispatch.js';\nimport { loadDeliveryContext } from './issue.js';\nimport * as deliveryConfig from './config/deliveryConfig.js';\nimport { createAiDeliveryMcpServer, AI_DELIVERY_MCP_TOOLS } from './mcp/index.js';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';\nimport { syntheticDiscoveryClients, syntheticDiscoveryConfig } from './fixtures/discovery.js';\n\nconst userSettings = {\n schemaVersion: 'ai-delivery.user@1',\n roles: {\n author: { authSource: 'personal', identity: 'host-author', credentialEnv: { token: 'SYNTHETIC_TOKEN' } },\n reviewer: {\n identity: 'app-reviewer',\n credentialEnv: { appId: 'APP_ID', installationId: 'INSTALLATION_ID', privateKeyPath: 'KEY_PATH' },\n },\n },\n project: 1,\n checkoutRoots: [],\n pointsField: 'Estimate',\n priorityField: 'Urgency',\n statusField: 'Flow',\n statuses: { blocked: 'Waiting', done: 'Shipped', inProgress: 'Active', todo: 'Queued' },\n};\n\ndescribe('directory-independent user configuration', () => {\n it('publishes repository guidance during initialization before a tool is called outside Git', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-discovery-guidance-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify(userSettings));\n const server = createAiDeliveryMcpServer({ repoRoot: root });\n const client = new Client({ name: 'discovery-guidance-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n const instructions = client.getInstructions();\n assert.equal(typeof instructions, 'string', 'initialize must provide guidance before deferred tool discovery');\n assert.match(instructions ?? '', /\\brepo\\b/u);\n assert.match(instructions ?? '', /\\bissue_info\\b/u);\n // This observes real protocol metadata, not whether an agent follows it.\n const listed = await client.listTools();\n for (const name of ['issue_info', 'issue_ready_check']) {\n const tool = listed.tools.find((candidate) => candidate.name === name);\n assert.ok(tool);\n const properties = tool.inputSchema.properties as Record<string, { description?: string }>;\n assert.equal(typeof properties.repo?.description, 'string', `${name} must describe its repository input`);\n assert.match(properties.repo?.description ?? '', /owner\\/name/u);\n }\n for (const arguments_ of [\n { issueNumber: 17, repo: 'example/widget', cached: true },\n { issueNumber: 17, repository: 'example/widget' },\n { issueNumber: 17, repo: 'invalid' },\n ]) {\n const rejected = await client.callTool({ name: 'issue_info', arguments: arguments_ });\n assert.equal(rejected.isError, true);\n assert.match(JSON.stringify(rejected), /Invalid arguments/u);\n assert.doesNotMatch(JSON.stringify(rejected), /SYNTHETIC_TOKEN|Git remotes/u);\n }\n assert.equal(existsSync(join(root, '.git')), false);\n assert.equal(existsSync(join(root, '.issue-cli')), false);\n } finally {\n await client.close();\n await server.close();\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('resolves an explicit repository in a non-Git directory without repository policy', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-directory-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n try {\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify(userSettings));\n const loaded = await loadDeliveryConfig(root, {\n repository: 'example/widget',\n clients: syntheticDiscoveryClients(syntheticDiscoveryConfig),\n } as never);\n assert.equal(loaded.config.repository, 'example/widget');\n assert.equal(loaded.config.roles.author.identity, 'host-author');\n assert.equal(loaded.configPath, process.env.AI_DELIVERY_CONFIG);\n assert.equal('policy' in loaded.config, false);\n } finally {\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n // #65: tools load their Project configuration through this context, not a fresh Project read.\n it('carries a discovered In Review option into the delivery context', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-review-option-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n try {\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify(userSettings));\n const loaded = await loadDeliveryConfig(root, {\n repository: 'example/widget',\n clients: syntheticDiscoveryClients(syntheticDiscoveryConfig, ['In Review']),\n } as never);\n vi.spyOn(deliveryConfig, 'loadDeliveryConfig').mockResolvedValue(loaded);\n vi.spyOn(githubClients, 'createDeliveryGitHubClients').mockResolvedValue({} as never);\n const context = await loadDeliveryContext({\n identity: 'host-author',\n role: 'author',\n repoRoot: root,\n repository: 'example/widget',\n });\n assert.equal(context.projectConfiguration?.reviewOptionId, 'STATUS-EXTRA-0');\n } finally {\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('never imports a tracked hostile policy while resolving a local checkout', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-hostile-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n const sentinel = join(root, 'executed');\n try {\n execFileSync('git', ['init', '--quiet', root]);\n execFileSync('git', ['remote', 'add', 'origin', 'https://github.com/example/widget.git'], { cwd: root });\n writeFileSync(\n join(root, 'ai-delivery.policy.mjs'),\n `import {writeFileSync} from 'node:fs';writeFileSync(${JSON.stringify(sentinel)},'executed');export const deliverySettings={};`,\n );\n execFileSync('git', ['add', 'ai-delivery.policy.mjs'], { cwd: root });\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify(userSettings));\n await loadDeliverySettings(root);\n for (const body of ['tracked', 'edited']) {\n writeFileSync(\n join(root, 'ai-delivery.policy.mjs'),\n `import {writeFileSync} from 'node:fs';writeFileSync(${JSON.stringify(sentinel)},${JSON.stringify(body)});export const deliverySettings={};`,\n );\n await loadDeliveryConfig(root, {\n repository: 'example/widget',\n clients: syntheticDiscoveryClients(syntheticDiscoveryConfig),\n });\n }\n assert.equal(existsSync(sentinel), false);\n } finally {\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('names a missing user setting before accessing Git or credentials', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-setting-'));\n const previous = process.env.AI_DELIVERY_CONFIG;\n try {\n process.env.AI_DELIVERY_CONFIG = join(root, 'user.json');\n writeFileSync(process.env.AI_DELIVERY_CONFIG, JSON.stringify({ ...userSettings, roles: {} }));\n await assert.rejects(loadDeliverySettings(root), /roles.author/u);\n } finally {\n if (previous === undefined) delete process.env.AI_DELIVERY_CONFIG;\n else process.env.AI_DELIVERY_CONFIG = previous;\n rmSync(root, { recursive: true, force: true });\n }\n });\n});\n\nfor (const path of [\n 'schemaVersion',\n 'roles.author',\n 'roles.reviewer',\n 'roles.author.identity',\n 'roles.reviewer.identity',\n 'roles.author.credentialEnv',\n 'roles.reviewer.credentialEnv',\n 'project',\n 'checkoutRoots',\n 'roles.author.credentialEnv.token',\n 'roles.reviewer.credentialEnv.appId',\n 'roles.reviewer.credentialEnv.installationId',\n 'roles.reviewer.credentialEnv.privateKeyPath',\n]) {\n it(`names missing ${path} in operator settings`, async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-required-'));\n vi.stubEnv('AI_DELIVERY_CONFIG', join(root, 'user.json'));\n const settings = structuredClone(userSettings) as unknown as Record<string, unknown>;\n const keys = path.split('.');\n let target = settings;\n for (const key of keys.slice(0, -1)) target = target[key] as Record<string, unknown>;\n delete target[keys.at(-1)!];\n writeFileSync(process.env.AI_DELIVERY_CONFIG!, JSON.stringify(settings));\n try {\n await assert.rejects(\n loadDeliverySettings(root),\n (error) => error instanceof Error && error.message.includes(path),\n );\n } finally {\n rmSync(root, { recursive: true, force: true });\n }\n });\n}\n\nafterEach(() => {\n vi.restoreAllMocks();\n vi.unstubAllEnvs();\n});\n\ndescribe('per-call repository selection', () => {\n it('does not execute checkout filters or fsmonitor during local Git probes', () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-hostile-git-'));\n const sentinel = join(root, 'executed');\n const git = (...args: string[]) => execFileSync('git', args, { cwd: root });\n try {\n git('init', '-q');\n git('config', 'user.name', 'Synthetic');\n git('config', 'user.email', 'synthetic@example.test');\n writeFileSync(join(root, '.gitattributes'), '*.txt filter=hostile\\n');\n writeFileSync(join(root, 'change.txt'), 'original');\n git('add', '.');\n git('commit', '-qm', 'fixture');\n const script = join(root, 'hostile.cjs');\n writeFileSync(\n script,\n `require('node:fs').writeFileSync(${JSON.stringify(sentinel)},'executed');process.stdin.pipe(process.stdout);`,\n );\n git('config', 'filter.hostile.clean', `${process.execPath} ${script}`);\n git('config', 'filter.hostile.smudge', `${process.execPath} ${script}`);\n git('config', 'core.fsmonitor', `${process.execPath} ${script}`);\n mkdirSync(join(root, '.git', 'hooks'), { recursive: true });\n writeFileSync(join(root, 'change.txt'), 'changed');\n git('hash-object', '--path', 'change.txt', 'change.txt');\n assert.equal(existsSync(sentinel), true, 'fixture filter must be executable before the protected probe');\n unlinkSync(sentinel);\n gitCommands.git(root, 'hash-object', '--path', 'change.txt', 'change.txt');\n gitCommands.git(root, 'status', '--porcelain', '--untracked-files=all');\n assert.equal(existsSync(sentinel), false);\n } finally {\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('routes PRs and journals through one MCP server A \u2192 B \u2192 A without launch Git or identity environment', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-mcp-routing-'));\n const visited: string[] = [];\n const journalTargets: string[] = [];\n const stored: { id: number; body: string; html_url: string; issue_url: string; user: { login: string } }[] = [];\n let authorCalls = 0;\n vi.stubEnv('AI_DELIVERY_CONFIG', join(root, 'user.json'));\n vi.stubEnv('AI_DELIVERY_IDENTITY', '');\n writeFileSync(process.env.AI_DELIVERY_CONFIG!, JSON.stringify(userSettings));\n vi.spyOn(repository, 'resolveRepoFromRemote').mockImplementation(() => {\n throw new Error('launch Git must never run');\n });\n vi.spyOn(gitCommands, 'git').mockImplementation(() => {\n throw new Error('launch Git must never run');\n });\n vi.spyOn(githubClients, 'createDeliveryGitHubClients').mockImplementation(\n async (input) =>\n ({\n role: input.role,\n authSource: 'personal',\n authenticatedAuthor: async () => {\n authorCalls += 1;\n return { actorLogin: 'operator', credentialIdentity: 'user:1' };\n },\n graphql: (async (query: string, variables: Record<string, unknown>) => {\n const repo = typeof variables.repo === 'string' ? variables.repo : 'a';\n return syntheticDiscoveryClients({ ...syntheticDiscoveryConfig, repository: `example/${repo}` }).graphql(\n query,\n variables,\n );\n }) as githubClients.GitHubClients['graphql'],\n rest: {\n issues: {\n get: async (input: { owner: string; repo: string; issue_number: number }) => {\n journalTargets.push(`${input.owner}/${input.repo}`);\n return { data: { number: input.issue_number } };\n },\n listComments: async (input: { owner: string; repo: string; issue_number: number }) => ({\n data: stored.filter(\n (comment) =>\n comment.issue_url ===\n `https://api.github.com/repos/${input.owner}/${input.repo}/issues/${String(input.issue_number)}`,\n ),\n }),\n createComment: async (input: { owner: string; repo: string; issue_number: number; body: string }) => {\n const id = 101 + stored.length;\n const data = {\n id,\n body: input.body,\n html_url: `https://github.com/${input.owner}/${input.repo}/issues/${String(input.issue_number)}#issuecomment-${String(id)}`,\n issue_url: `https://api.github.com/repos/${input.owner}/${input.repo}/issues/${String(input.issue_number)}`,\n user: { login: 'operator' },\n };\n stored.push(data);\n return { data };\n },\n getComment: async (input: { owner: string; repo: string; comment_id: number }) => ({\n data: stored.find(\n (comment) =>\n comment.id === input.comment_id &&\n comment.issue_url === `https://api.github.com/repos/${input.owner}/${input.repo}/issues/17`,\n ),\n }),\n },\n pulls: {\n get: async (input: { owner: string; repo: string; pull_number: number }) => {\n visited.push(`${input.owner}/${input.repo}`);\n return {\n data: {\n number: input.pull_number,\n head: { sha: 'a'.repeat(40), ref: 'issue/17', repo: { full_name: `${input.owner}/${input.repo}` } },\n base: { sha: 'b'.repeat(40), ref: 'main', repo: { full_name: `${input.owner}/${input.repo}` } },\n state: 'open',\n merged: false,\n draft: true,\n html_url: `https://github.com/${input.owner}/${input.repo}/pull/23`,\n },\n };\n },\n },\n },\n }) as unknown as githubClients.GitHubClients,\n );\n const server = createAiDeliveryMcpServer({ repoRoot: root });\n const client = new Client({ name: 'directory-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n const journal = {\n issueNumber: 17,\n kind: 'progress',\n summary: 'Validation is implemented.',\n status: 'In progress',\n done: ['Added validation'],\n decisionNeeded: 'None',\n keyNumbers: [],\n evidence: ['https://github.com/example/widget/pull/23'],\n nextStep: 'Review',\n nextDate: '2026-10-09',\n };\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n for (const repo of ['example/a', 'example/b', 'example/a']) {\n const response = await client.callTool({ name: 'issue_pr_info', arguments: { repo, prNumber: 23 } });\n assert.equal(response.isError, undefined);\n const comment = await client.callTool({ name: 'issue_comment', arguments: { ...journal, repo } });\n assert.equal(comment.isError, undefined, JSON.stringify(comment));\n assert.match(\n JSON.stringify(comment),\n new RegExp(`https://github.com/${repo}/issues/17#issuecomment-10[12]`, 'u'),\n );\n }\n await executeTool('issue_pr_info', { repo: 'example/b', prNumber: 23 }, { repoRoot: root });\n assert.deepEqual(visited, ['example/a', 'example/b', 'example/a', 'example/b']);\n assert.deepEqual(journalTargets, ['example/a', 'example/b', 'example/a']);\n assert.equal(stored.length, 2, 'A retry reuses its own journal, without leaking repository B');\n const beforeInvalid = vi.mocked(githubClients.createDeliveryGitHubClients).mock.calls.length;\n const beforeInvalidAuthor = authorCalls;\n for (const invalid of [\n { ...journal, repo: 'example/a', unknown: true },\n { ...journal, repo: 'example/a', outcome: 'Wrong variant' },\n { ...journal, repo: 'example/a', kind: 'unsupported' },\n { ...journal, repo: 'example/a', nextDate: '2026-02-30' },\n { ...journal, repo: 'invalid' },\n ]) {\n const refused = await client.callTool({ name: 'issue_comment', arguments: invalid }).then(\n (result) => result.isError === true,\n () => true,\n );\n assert.equal(refused, true);\n }\n const fixedServer = createAiDeliveryMcpServer({ repoRoot: root, repo: 'example/a' });\n const fixedClient = new Client({ name: 'fixed-repository-fixture', version: '1' });\n const [fixedClientTransport, fixedServerTransport] = InMemoryTransport.createLinkedPair();\n try {\n await fixedServer.connect(fixedServerTransport);\n await fixedClient.connect(fixedClientTransport);\n const conflict = await fixedClient.callTool({\n name: 'issue_comment',\n arguments: { ...journal, repo: 'example/b' },\n });\n assert.equal(conflict.isError, true);\n assert.match(JSON.stringify(conflict), /selectors disagree/u);\n assert.equal(vi.mocked(githubClients.createDeliveryGitHubClients).mock.calls.length, beforeInvalid);\n assert.equal(authorCalls, beforeInvalidAuthor, 'refusals precede authentication');\n assert.equal(stored.length, 2, 'refusals do not write');\n assert.deepEqual(journalTargets, ['example/a', 'example/b', 'example/a'], 'refusals do not read a target');\n const inherited = await fixedClient.callTool({ name: 'issue_comment', arguments: journal });\n assert.equal(inherited.isError, undefined, JSON.stringify(inherited));\n const readback = JSON.parse((inherited.content as { text: string }[])[0]!.text) as {\n url: string;\n reused: boolean;\n };\n assert.equal(readback.url, 'https://github.com/example/a/issues/17#issuecomment-101');\n assert.equal(readback.reused, true, 'omitting repo uses the fixed server selector');\n } finally {\n await fixedClient.close();\n await fixedServer.close();\n }\n assert.equal(stored.length, 2, 'inheriting the server selector reuses repository A');\n assert.deepEqual(journalTargets, ['example/a', 'example/b', 'example/a', 'example/a']);\n assert.equal(vi.mocked(repository.resolveRepoFromRemote).mock.calls.length, 0);\n const call = (args: Record<string, unknown>) =>\n client.callTool({ name: 'issue_comment', arguments: { repo: 'example/a', ...args } });\n const plain = await call({ issueNumber: 17, body: 'Plain note.' });\n assert.equal(plain.isError, undefined, JSON.stringify(plain));\n assert.equal(stored.at(-1)?.body, 'Plain note.', 'a plain body posts exactly as sent');\n const afterPlain = stored.length;\n const mixed = await call({ ...journal, body: 'Plain note.' });\n assert.equal(mixed.isError, true);\n assert.match(JSON.stringify(mixed), /Send body alone for a plain comment, or kind with its journal fields\\./u);\n assert.equal(stored.length, afterPlain, 'a mixed request writes nothing');\n const asNull = await call({ ...journal, nextDate: null });\n const asString = await call({ ...journal, nextDate: 'null' });\n assert.equal(asString.isError, undefined, JSON.stringify(asString));\n assert.equal(stored.length, afterPlain + 1, 'the string \"null\" posts the same journal as null');\n const readback = (result: typeof asNull) =>\n JSON.parse((result.content as { text: string }[])[0]!.text) as { url: string; reused: boolean };\n assert.equal(readback(asString).url, readback(asNull).url);\n assert.equal(readback(asString).reused, true);\n const impossible = await call({ ...journal, nextDate: '2026-02-30' });\n assert.equal(impossible.isError, true);\n assert.match(JSON.stringify(impossible), /nextDate must be a YYYY-MM-DD date, or null when none is scheduled\\./u);\n const names = AI_DELIVERY_MCP_TOOLS.map((tool) => tool.name as string);\n for (const removed of [\n 'issue_develop',\n 'issue_verify',\n 'issue_worktree_create',\n 'runtime_stage',\n 'runtime_admit',\n 'issue_worktree_transition_inspect',\n 'issue_worktree_transition_apply',\n ])\n assert.equal(names.includes(removed), false);\n } finally {\n await client.close();\n await server.close();\n rmSync(root, { recursive: true, force: true });\n }\n });\n});\n"],
5
+ "mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,oBAAoB;AAC7B,SAAS,YAAY,WAAW,aAAa,YAAY,QAAQ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