@aviaratech/ai-delivery 0.3.36 → 0.3.38
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.
- package/README.md +5 -6
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -3
- package/dist/agent.js.map +2 -2
- package/dist/callerErrors.test.js +0 -14
- package/dist/callerErrors.test.js.map +2 -2
- package/dist/cli.js +0 -15
- package/dist/cli.js.map +2 -2
- package/dist/contributorChecks.test.js +5 -2
- package/dist/contributorChecks.test.js.map +2 -2
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +1 -15
- package/dist/dispatch.js.map +2 -2
- package/dist/fixtures/discovery.d.ts +16 -16
- package/dist/git.d.ts +0 -3
- package/dist/git.js +2 -25
- package/dist/git.js.map +2 -2
- package/dist/github/commandIdentityPolicy.js +0 -2
- package/dist/github/commandIdentityPolicy.js.map +2 -2
- package/dist/issue.js +7 -2
- package/dist/issue.js.map +2 -2
- package/dist/issueInfoReadback.test.js +59 -1
- package/dist/issueInfoReadback.test.js.map +2 -2
- package/dist/issueIntake.test.js +0 -7
- package/dist/issueIntake.test.js.map +2 -2
- package/dist/mcp/tools.d.ts +0 -36
- package/dist/mcp/tools.js +0 -34
- package/dist/mcp/tools.js.map +2 -2
- package/dist/pluginPackaging.test.js +0 -47
- package/dist/pluginPackaging.test.js.map +2 -2
- package/dist/pr.d.ts +0 -55
- package/dist/pr.js +0 -211
- package/dist/pr.js.map +3 -3
- package/dist/pr.test.js +5 -737
- package/dist/pr.test.js.map +3 -3
- package/dist/prAssociation.test.js +1 -1
- package/dist/prAssociation.test.js.map +2 -2
- package/dist/prDispatch.test.js +4 -31
- package/dist/prDispatch.test.js.map +2 -2
- package/dist/readView.d.ts +1 -0
- package/dist/readView.js +1 -0
- package/dist/readView.js.map +2 -2
- package/dist/readView.test.js +29 -2
- package/dist/readView.test.js.map +2 -2
- package/dist/stdoutRegression.test.js +0 -38
- package/dist/stdoutRegression.test.js.map +2 -2
- package/dist/targetPolicyRoutes.test.js +1 -32
- package/dist/targetPolicyRoutes.test.js.map +2 -2
- package/dist/targetRepositoryExecution.test.js +0 -12
- package/dist/targetRepositoryExecution.test.js.map +2 -2
- package/dist/utils/atomicJson.d.ts +0 -2
- package/dist/utils/atomicJson.js +0 -4
- package/dist/utils/atomicJson.js.map +2 -2
- package/dist/utils/filesystem.d.ts +0 -8
- package/dist/utils/filesystem.js +1 -12
- package/dist/utils/filesystem.js.map +2 -2
- package/dist/verification.d.ts +0 -35
- package/dist/verification.js +1 -47
- package/dist/verification.js.map +2 -2
- package/dist/version.js +24 -2
- package/dist/version.js.map +2 -2
- package/package.json +1 -1
- package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
- package/plugins/ai-delivery/plugin.json +1 -1
- package/plugins/ai-delivery/runtime/dist/cli.js +128 -135
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +4 -4
- package/dist/services/deliveryAdmission.d.ts +0 -49
- package/dist/services/deliveryAdmission.js +0 -142
- package/dist/services/deliveryAdmission.js.map +0 -7
- package/dist/services/worktreeRegistry.d.ts +0 -342
- package/dist/services/worktreeRegistry.js +0 -831
- package/dist/services/worktreeRegistry.js.map +0 -7
- package/dist/worktree.d.ts +0 -16
- package/dist/worktree.js +0 -108
- package/dist/worktree.js.map +0 -7
package/dist/mcp/tools.d.ts
CHANGED
|
@@ -1063,42 +1063,6 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
1063
1063
|
identity: z.ZodOptional<z.ZodString>;
|
|
1064
1064
|
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
1065
1065
|
}, z.core.$strict>;
|
|
1066
|
-
}, {
|
|
1067
|
-
readonly name: 'issue_pr_merge';
|
|
1068
|
-
readonly commandName: 'pr:merge';
|
|
1069
|
-
readonly description: 'Guarded exact-head merge';
|
|
1070
|
-
readonly inputSchema: z.ZodObject<{
|
|
1071
|
-
repo: z.ZodOptional<z.ZodString>;
|
|
1072
|
-
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
1073
|
-
issueNumber: z.ZodOptional<z.ZodNumber>;
|
|
1074
|
-
prNumber: z.ZodNumber;
|
|
1075
|
-
nonClosing: z.ZodOptional<z.ZodBoolean>;
|
|
1076
|
-
reviewedHeadSha: z.ZodOptional<z.ZodString>;
|
|
1077
|
-
strategy: z.ZodOptional<z.ZodEnum<{
|
|
1078
|
-
merge: "merge";
|
|
1079
|
-
rebase: "rebase";
|
|
1080
|
-
squash: "squash";
|
|
1081
|
-
}>>;
|
|
1082
|
-
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
1083
|
-
}, z.core.$strict>;
|
|
1084
|
-
}, {
|
|
1085
|
-
readonly name: 'issue_finish';
|
|
1086
|
-
readonly commandName: 'finish';
|
|
1087
|
-
readonly description: 'Finish merged delivery';
|
|
1088
|
-
readonly inputSchema: z.ZodObject<{
|
|
1089
|
-
repo: z.ZodOptional<z.ZodString>;
|
|
1090
|
-
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
1091
|
-
issueNumber: z.ZodNumber;
|
|
1092
|
-
prNumber: z.ZodNumber;
|
|
1093
|
-
nonClosing: z.ZodOptional<z.ZodBoolean>;
|
|
1094
|
-
reviewedHeadSha: z.ZodOptional<z.ZodString>;
|
|
1095
|
-
strategy: z.ZodOptional<z.ZodEnum<{
|
|
1096
|
-
merge: "merge";
|
|
1097
|
-
rebase: "rebase";
|
|
1098
|
-
squash: "squash";
|
|
1099
|
-
}>>;
|
|
1100
|
-
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
1101
|
-
}, z.core.$strict>;
|
|
1102
1066
|
}];
|
|
1103
1067
|
export type AiDeliveryMcpToolName = (typeof AI_DELIVERY_MCP_TOOLS)[number]['name'];
|
|
1104
1068
|
export declare function getAiDeliveryMcpTool(name: string): (typeof AI_DELIVERY_MCP_TOOLS)[number] | null;
|
package/dist/mcp/tools.js
CHANGED
|
@@ -81,16 +81,6 @@ const NormalStart = z.strictObject({
|
|
|
81
81
|
resumeCreated: z.boolean().optional(),
|
|
82
82
|
branch: z.string().min(1).optional()
|
|
83
83
|
});
|
|
84
|
-
const NormalFinish = z.strictObject({
|
|
85
|
-
repo: Repo,
|
|
86
|
-
verbose: Verbose,
|
|
87
|
-
issueNumber: Positive,
|
|
88
|
-
prNumber: Positive,
|
|
89
|
-
nonClosing: z.boolean().optional(),
|
|
90
|
-
reviewedHeadSha: z.string().regex(/^[a-f0-9]{40}$/u).optional(),
|
|
91
|
-
strategy: z.enum(["merge", "squash", "rebase"]).optional(),
|
|
92
|
-
dryRun: z.boolean().optional()
|
|
93
|
-
});
|
|
94
84
|
const IssueListing = {
|
|
95
85
|
repo: Repo,
|
|
96
86
|
verbose: Verbose,
|
|
@@ -261,30 +251,6 @@ const AI_DELIVERY_MCP_TOOLS = [
|
|
|
261
251
|
identity: z.string().min(1).optional(),
|
|
262
252
|
dryRun: z.boolean().optional()
|
|
263
253
|
})
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
name: "issue_pr_merge",
|
|
267
|
-
commandName: "pr:merge",
|
|
268
|
-
description: "Guarded exact-head merge",
|
|
269
|
-
inputSchema: z.strictObject({
|
|
270
|
-
repo: Repo,
|
|
271
|
-
verbose: Verbose,
|
|
272
|
-
issueNumber: Positive.optional(),
|
|
273
|
-
prNumber: Positive,
|
|
274
|
-
nonClosing: z.boolean().optional(),
|
|
275
|
-
reviewedHeadSha: z.string().regex(/^[a-f0-9]{40}$/u, "Reviewed head is invalid; provide the exact 40-character lowercase commit SHA.").optional(),
|
|
276
|
-
strategy: z.enum(["merge", "squash", "rebase"]).optional(),
|
|
277
|
-
dryRun: z.boolean().optional()
|
|
278
|
-
}).refine((input) => input.issueNumber !== void 0, {
|
|
279
|
-
path: ["issueNumber"],
|
|
280
|
-
message: "Direct merge is missing its issue number; provide issueNumber."
|
|
281
|
-
})
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
name: "issue_finish",
|
|
285
|
-
commandName: "finish",
|
|
286
|
-
description: "Finish merged delivery",
|
|
287
|
-
inputSchema: NormalFinish
|
|
288
254
|
}
|
|
289
255
|
];
|
|
290
256
|
function getAiDeliveryMcpTool(name) {
|
package/dist/mcp/tools.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mcp/tools.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod';\nimport { NativeIssueDateFields } from '../github/nativeIssueMetadata.js';\nimport { DeliveryHealthInput } from '../services/deliveryHealthService.js';\nimport { BoardReconcileInput } from '../services/boardReconcileService.js';\nimport { OverrideReason } from '../services/blockerGuardService.js';\nimport { JournalInputSchema, JOURNAL_SCHEMA_METADATA } from '../issueJournal.js';\nimport {\n IssueFields,\n IssueWriteFields,\n ISSUE_JSON_SCHEMAS,\n issueInputSchema,\n CreateIssueStatus,\n IssueStatusPatch,\n ProjectStatusPatch,\n IssueDeferralPatch,\n} from '../issueContract.js';\n\nconst Verbose = z.boolean().optional().describe('Return the full payload, including bodies, diffs and routing.');\nconst Positive = z.number().int().positive();\nconst Labels = z.array(z.string().trim().min(1));\nconst REPO_HELP =\n 'GitHub owner/name. Pass the repository named by the user. An explicit repo avoids launch-directory Git for ordinary remote issue/PR work; retained local modes keep their own checkout requirements.';\nconst Repo = z\n .string()\n .regex(/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$/u)\n .optional()\n .describe(REPO_HELP);\nexport const AI_DELIVERY_MCP_CONTRACT_VERSION = 'ai-delivery.mcp@2' as const;\nconst IssueUpdateInput = issueInputSchema(\n z\n .strictObject({\n ...IssueWriteFields,\n ...NativeIssueDateFields,\n status: IssueStatusPatch.optional(),\n projectStatus: ProjectStatusPatch.optional(),\n repo: Repo,\n blockedBy: z.array(Positive).optional(),\n blocks: z.array(Positive).optional(),\n overrideReason: OverrideReason.optional(),\n body: z.string().optional(),\n issueNumber: Positive,\n issueType: IssueWriteFields.issueType,\n labels: Labels.optional(),\n milestone: Positive.nullable().optional(),\n parentIssueNumber: Positive.nullable().optional(),\n park: z.literal(true).optional(),\n ...IssueDeferralPatch,\n points: IssueWriteFields.points,\n priority: z.string().min(1).optional(),\n state: z.enum(['open', 'closed']).optional(),\n preserveHistory: z.boolean().optional(),\n closeReason: z.enum(['completed', 'not_planned', 'duplicate']).optional(),\n supersededBy: Positive.optional(),\n title: IssueWriteFields.title,\n })\n .superRefine((input, ctx) => {\n if (input.defer !== undefined && input.undefer !== undefined)\n ctx.addIssue({ code: 'custom', message: 'Choose defer or undefer, never both.', path: ['defer'] });\n if ((input.closeReason !== undefined || input.supersededBy !== undefined) && input.state !== 'closed')\n ctx.addIssue({\n code: 'custom',\n path: ['state'],\n message: 'Closure details require a closed issue; set state to closed.',\n params: { issueCode: 'closure.state' },\n });\n }),\n);\n\nconst Tracking = {\n verbose: Verbose,\n blockedBy: z.array(Positive).optional(),\n blocks: z.array(Positive).optional(),\n overrideReason: OverrideReason.optional(),\n body: z.string().optional(),\n issueType: z.string().min(1).optional(),\n labels: Labels.optional(),\n milestone: Positive.optional(),\n parentIssueNumber: Positive.optional(),\n points: Positive.optional(),\n priority: z.string().min(1).optional(),\n repo: z\n .string()\n .regex(/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$/u)\n .optional()\n .describe(REPO_HELP),\n title: z\n .string()\n .trim()\n .min(1, 'Issue title is empty; enter a title.')\n .max(256, 'Issue title exceeds 256 characters; shorten the title.'),\n};\nconst NormalStart = z.strictObject({\n ...Tracking,\n title: Tracking.title.optional(),\n issueNumber: Positive.optional(),\n request: z.string().min(1).optional(),\n requestId: z.string().trim().min(1).max(256).optional(),\n resumeCreated: z.boolean().optional(),\n branch: z.string().min(1).optional(),\n});\nconst NormalFinish = z.strictObject({\n repo: Repo,\n verbose: Verbose,\n issueNumber: Positive,\n prNumber: Positive,\n nonClosing: z.boolean().optional(),\n reviewedHeadSha: z\n .string()\n .regex(/^[a-f0-9]{40}$/u)\n .optional(),\n strategy: z.enum(['merge', 'squash', 'rebase']).optional(),\n dryRun: z.boolean().optional(),\n});\nconst IssueListing = {\n repo: Repo,\n verbose: Verbose,\n state: z.enum(['open', 'closed', 'all']).optional(),\n labels: z\n .array(\n z\n .string()\n .min(1)\n .regex(/^[^\"\\\\\\r\\n]+$/u),\n )\n .optional(),\n parentIssueNumber: Positive.nullable().optional(),\n issueType: z.string().min(1).optional(),\n projectStatus: z.enum(['Todo', 'In Progress', 'Blocked', 'Done']).nullable().optional(),\n updatedSince: z.iso.datetime({ offset: true }).optional(),\n page: Positive.optional(),\n perPage: Positive.max(100).optional(),\n};\nconst SearchText = z\n .string()\n .trim()\n .min(1)\n .max(256)\n .regex(/^[^\"\\\\\\r\\n]+$/u);\n\nexport const AI_DELIVERY_MCP_TOOLS = [\n {\n name: 'delivery_board',\n commandName: 'board',\n description:\n 'Read human attention, native PR readiness, stale In Progress issues and seven-day delivery marker fractions for explicit repositories. Partial observations are data, never merge authority.',\n inputSchema: z.strictObject({\n repos: z.array(Repo.unwrap()).min(1),\n decisionLabels: z.array(z.string().min(1)).optional(),\n verbose: Verbose,\n }),\n },\n {\n name: 'board_reconcile',\n commandName: 'board:reconcile',\n description:\n 'Plan or apply bounded Project membership and proven Status reconciliation for 1\u201310 explicit repositories. Retain the original plan and optional prior result for recovery; unknown activity and metadata suggestions never authorize writes.',\n inputSchema: BoardReconcileInput,\n },\n {\n name: 'delivery_health',\n commandName: 'health',\n description: 'Read bounded native delivery health for an explicit repository and UTC window',\n inputSchema: DeliveryHealthInput,\n },\n {\n name: 'issue_comment',\n commandName: 'comment',\n description:\n 'Post a typed issue journal with authoritative comment readback. Provide the fields required by kind: start: outcome; progress: done, decisionNeeded and non-empty evidence; decision: non-empty decision and rationale; blocker: blocker and resolution; closeout: acceptance and followUps. Omit fields belonging to other kinds.',\n inputSchema: z\n .strictObject({ ...JournalInputSchema.shape, repo: Repo, verbose: Verbose })\n .superRefine(({ repo: _repo, verbose: _verbose, ...journal }, ctx) => {\n // Repository routing belongs to the MCP envelope, not the strict journal variants.\n const parsed = JournalInputSchema.safeParse(journal);\n if (!parsed.success)\n for (const issue of parsed.error.issues)\n ctx.addIssue({ code: 'custom', path: issue.path, message: issue.message });\n })\n .meta(JOURNAL_SCHEMA_METADATA),\n },\n {\n name: 'issue_create',\n commandName: 'create',\n description: 'Create a native GitHub tracking issue with configured metadata and relationships',\n issueContract: ISSUE_JSON_SCHEMAS,\n inputSchema: issueInputSchema(\n z.strictObject({\n ...Tracking,\n ...NativeIssueDateFields,\n ...IssueWriteFields,\n title: IssueFields.shape.title,\n opId: z\n .string()\n .trim()\n .min(1)\n .max(256)\n .optional()\n .describe(\n 'Stable retry identity: repeat the same original arguments to complete a partial create without another issue.',\n ),\n status: CreateIssueStatus.optional(),\n }),\n ),\n },\n {\n name: 'issue_start',\n commandName: 'start',\n description: 'Start a linked issue',\n inputSchema: NormalStart,\n },\n {\n name: 'issue_list',\n commandName: 'list',\n description: 'List repository issues with native filters, named organization fields and pagination',\n inputSchema: z.strictObject({ ...IssueListing, query: SearchText.optional() }),\n },\n {\n name: 'issue_search',\n commandName: 'search',\n description: 'Search literal issue text in the selected repository with native filters and pagination',\n inputSchema: z.strictObject({ ...IssueListing, query: SearchText }),\n },\n {\n name: 'issue_update',\n commandName: 'update',\n description: 'Update native issue fields and exact relationship sets with readback',\n inputSchema: IssueUpdateInput.safeExtend({ verbose: Verbose }),\n },\n {\n name: 'issue_batch_update',\n commandName: 'batch:update',\n description: 'Plan or apply 1\u201350 issue updates in one repository, with ordered partial results and readback',\n inputSchema: issueInputSchema(\n z.strictObject({\n repo: Repo,\n verbose: Verbose,\n items: z.array(IssueUpdateInput).min(1).max(50),\n dryRun: z.boolean().optional(),\n }),\n ),\n },\n {\n name: 'issue_info',\n commandName: 'info',\n description:\n 'Read live GitHub issue metadata, relationships, Project status, linked PRs (state, checks, reviews) and the latest journal in one call. Child counts by default; verbose adds the body, routing and full child progress. Pass the requested owner/name as repo; an explicit repo works outside Git without a checkout. This read does not start or update the issue.',\n inputSchema: z.strictObject({ issueNumber: Positive, repo: Repo, verbose: Verbose }),\n },\n {\n name: 'issue_ready_check',\n commandName: 'ready:check',\n description: 'Evaluate deterministic readiness from live native issue state',\n inputSchema: z.strictObject({ issueNumber: Positive, repo: Tracking.repo, verbose: Verbose }),\n },\n {\n name: 'issue_pr_create',\n commandName: 'pr:create',\n description:\n 'Create or reuse an issue-closing PR from any directory using repo, issueNumber and a pushed head. Restore a missing closing link on reuse.',\n inputSchema: z\n .strictObject({\n repo: Repo,\n verbose: Verbose,\n issueNumber: Positive,\n prNumber: Positive.optional(),\n nonClosing: z.boolean().optional(),\n reconcileNonClosingReference: z.boolean().optional(),\n expectedHeadSha: z\n .string()\n .regex(/^[a-f0-9]{40}$/u)\n .optional(),\n expectedBaseSha: z\n .string()\n .regex(/^[a-f0-9]{40}$/u)\n .optional(),\n body: z.string().min(1, 'PR body is empty; enter a body or omit it to use the default body.').optional(),\n draft: z.boolean().optional(),\n dryRun: z.boolean().optional(),\n title: z.string().min(1, 'PR title is empty; enter a title or omit it to use the issue title.').optional(),\n headBranch: z.string().min(1).optional(),\n head: z.string().min(1).optional(),\n base: z.string().min(1).optional(),\n })\n .refine(\n (input) => input.head === undefined || input.headBranch === undefined || input.head === input.headBranch,\n 'PR head selectors disagree; use the same branch for head and headBranch.',\n )\n .refine(\n (input) =>\n input.reconcileNonClosingReference === true\n ? input.nonClosing === true &&\n input.draft !== false &&\n input.body !== undefined &&\n input.expectedHeadSha !== undefined &&\n input.expectedBaseSha !== undefined\n : input.expectedHeadSha === undefined && input.expectedBaseSha === undefined,\n 'Reference reconciliation requires explicit nonClosing, DRAFT, body and exact head/base; SHA inputs require the action.',\n ),\n },\n {\n name: 'issue_pr_info',\n commandName: 'pr:info',\n description:\n \"Inspect a PR by number or its GitHub-linked issue branch: state, merge state, checks, reviews and each linked issue's state, Project status and latest journal, in one call\",\n inputSchema: z.strictObject({\n repo: Repo,\n verbose: Verbose,\n issueNumber: Positive.optional(),\n prNumber: Positive.optional(),\n nonClosing: z.boolean().optional(),\n }),\n },\n {\n name: 'issue_pr_review',\n commandName: 'pr:review',\n description: 'Submit one existing exact-head independent review with the reviewer App role',\n inputSchema: z.strictObject({\n repo: Repo,\n verbose: Verbose,\n issueNumber: Positive,\n prNumber: Positive,\n nonClosing: z.boolean().optional(),\n artifact: z.string().min(1, 'Review artifact is empty; provide the independent review artifact JSON.'),\n identity: z.string().min(1).optional(),\n dryRun: z.boolean().optional(),\n }),\n },\n {\n name: 'issue_pr_merge',\n commandName: 'pr:merge',\n description: 'Guarded exact-head merge',\n inputSchema: z\n .strictObject({\n repo: Repo,\n verbose: Verbose,\n issueNumber: Positive.optional(),\n prNumber: Positive,\n nonClosing: z.boolean().optional(),\n reviewedHeadSha: z\n .string()\n .regex(/^[a-f0-9]{40}$/u, 'Reviewed head is invalid; provide the exact 40-character lowercase commit SHA.')\n .optional(),\n strategy: z.enum(['merge', 'squash', 'rebase']).optional(),\n dryRun: z.boolean().optional(),\n })\n .refine((input) => input.issueNumber !== undefined, {\n path: ['issueNumber'],\n message: 'Direct merge is missing its issue number; provide issueNumber.',\n }),\n },\n {\n name: 'issue_finish',\n commandName: 'finish',\n description: 'Finish merged delivery',\n inputSchema: NormalFinish,\n },\n] as const;\n\nexport type AiDeliveryMcpToolName = (typeof AI_DELIVERY_MCP_TOOLS)[number]['name'];\n\nexport function getAiDeliveryMcpTool(name: string): (typeof AI_DELIVERY_MCP_TOOLS)[number] | null {\n return AI_DELIVERY_MCP_TOOLS.find((tool) => tool.name === name) ?? null;\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,6BAA6B;AACtC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB,+BAA+B;AAC5D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAA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CAAC,EAAE,SAAS;AAAA,EACpC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EACtD,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AACrC,CAAC;AACD,MAAM,eAAe
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod';\nimport { NativeIssueDateFields } from '../github/nativeIssueMetadata.js';\nimport { DeliveryHealthInput } from '../services/deliveryHealthService.js';\nimport { BoardReconcileInput } from '../services/boardReconcileService.js';\nimport { OverrideReason } from '../services/blockerGuardService.js';\nimport { JournalInputSchema, JOURNAL_SCHEMA_METADATA } from '../issueJournal.js';\nimport {\n IssueFields,\n IssueWriteFields,\n ISSUE_JSON_SCHEMAS,\n issueInputSchema,\n CreateIssueStatus,\n IssueStatusPatch,\n ProjectStatusPatch,\n IssueDeferralPatch,\n} from '../issueContract.js';\n\nconst Verbose = z.boolean().optional().describe('Return the full payload, including bodies, diffs and routing.');\nconst Positive = z.number().int().positive();\nconst Labels = z.array(z.string().trim().min(1));\nconst REPO_HELP =\n 'GitHub owner/name. Pass the repository named by the user. An explicit repo avoids launch-directory Git for ordinary remote issue/PR work; retained local modes keep their own checkout requirements.';\nconst Repo = z\n .string()\n .regex(/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$/u)\n .optional()\n .describe(REPO_HELP);\nexport const AI_DELIVERY_MCP_CONTRACT_VERSION = 'ai-delivery.mcp@2' as const;\nconst IssueUpdateInput = issueInputSchema(\n z\n .strictObject({\n ...IssueWriteFields,\n ...NativeIssueDateFields,\n status: IssueStatusPatch.optional(),\n projectStatus: ProjectStatusPatch.optional(),\n repo: Repo,\n blockedBy: z.array(Positive).optional(),\n blocks: z.array(Positive).optional(),\n overrideReason: OverrideReason.optional(),\n body: z.string().optional(),\n issueNumber: Positive,\n issueType: IssueWriteFields.issueType,\n labels: Labels.optional(),\n milestone: Positive.nullable().optional(),\n parentIssueNumber: Positive.nullable().optional(),\n park: z.literal(true).optional(),\n ...IssueDeferralPatch,\n points: IssueWriteFields.points,\n priority: z.string().min(1).optional(),\n state: z.enum(['open', 'closed']).optional(),\n preserveHistory: z.boolean().optional(),\n closeReason: z.enum(['completed', 'not_planned', 'duplicate']).optional(),\n supersededBy: Positive.optional(),\n title: IssueWriteFields.title,\n })\n .superRefine((input, ctx) => {\n if (input.defer !== undefined && input.undefer !== undefined)\n ctx.addIssue({ code: 'custom', message: 'Choose defer or undefer, never both.', path: ['defer'] });\n if ((input.closeReason !== undefined || input.supersededBy !== undefined) && input.state !== 'closed')\n ctx.addIssue({\n code: 'custom',\n path: ['state'],\n message: 'Closure details require a closed issue; set state to closed.',\n params: { issueCode: 'closure.state' },\n });\n }),\n);\n\nconst Tracking = {\n verbose: Verbose,\n blockedBy: z.array(Positive).optional(),\n blocks: z.array(Positive).optional(),\n overrideReason: OverrideReason.optional(),\n body: z.string().optional(),\n issueType: z.string().min(1).optional(),\n labels: Labels.optional(),\n milestone: Positive.optional(),\n parentIssueNumber: Positive.optional(),\n points: Positive.optional(),\n priority: z.string().min(1).optional(),\n repo: z\n .string()\n .regex(/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$/u)\n .optional()\n .describe(REPO_HELP),\n title: z\n .string()\n .trim()\n .min(1, 'Issue title is empty; enter a title.')\n .max(256, 'Issue title exceeds 256 characters; shorten the title.'),\n};\nconst NormalStart = z.strictObject({\n ...Tracking,\n title: Tracking.title.optional(),\n issueNumber: Positive.optional(),\n request: z.string().min(1).optional(),\n requestId: z.string().trim().min(1).max(256).optional(),\n resumeCreated: z.boolean().optional(),\n branch: z.string().min(1).optional(),\n});\nconst IssueListing = {\n repo: Repo,\n verbose: Verbose,\n state: z.enum(['open', 'closed', 'all']).optional(),\n labels: z\n .array(\n z\n .string()\n .min(1)\n .regex(/^[^\"\\\\\\r\\n]+$/u),\n )\n .optional(),\n parentIssueNumber: Positive.nullable().optional(),\n issueType: z.string().min(1).optional(),\n projectStatus: z.enum(['Todo', 'In Progress', 'Blocked', 'Done']).nullable().optional(),\n updatedSince: z.iso.datetime({ offset: true }).optional(),\n page: Positive.optional(),\n perPage: Positive.max(100).optional(),\n};\nconst SearchText = z\n .string()\n .trim()\n .min(1)\n .max(256)\n .regex(/^[^\"\\\\\\r\\n]+$/u);\n\nexport const AI_DELIVERY_MCP_TOOLS = [\n {\n name: 'delivery_board',\n commandName: 'board',\n description:\n 'Read human attention, native PR readiness, stale In Progress issues and seven-day delivery marker fractions for explicit repositories. Partial observations are data, never merge authority.',\n inputSchema: z.strictObject({\n repos: z.array(Repo.unwrap()).min(1),\n decisionLabels: z.array(z.string().min(1)).optional(),\n verbose: Verbose,\n }),\n },\n {\n name: 'board_reconcile',\n commandName: 'board:reconcile',\n description:\n 'Plan or apply bounded Project membership and proven Status reconciliation for 1\u201310 explicit repositories. Retain the original plan and optional prior result for recovery; unknown activity and metadata suggestions never authorize writes.',\n inputSchema: BoardReconcileInput,\n },\n {\n name: 'delivery_health',\n commandName: 'health',\n description: 'Read bounded native delivery health for an explicit repository and UTC window',\n inputSchema: DeliveryHealthInput,\n },\n {\n name: 'issue_comment',\n commandName: 'comment',\n description:\n 'Post a typed issue journal with authoritative comment readback. Provide the fields required by kind: start: outcome; progress: done, decisionNeeded and non-empty evidence; decision: non-empty decision and rationale; blocker: blocker and resolution; closeout: acceptance and followUps. Omit fields belonging to other kinds.',\n inputSchema: z\n .strictObject({ ...JournalInputSchema.shape, repo: Repo, verbose: Verbose })\n .superRefine(({ repo: _repo, verbose: _verbose, ...journal }, ctx) => {\n // Repository routing belongs to the MCP envelope, not the strict journal variants.\n const parsed = JournalInputSchema.safeParse(journal);\n if (!parsed.success)\n for (const issue of parsed.error.issues)\n ctx.addIssue({ code: 'custom', path: issue.path, message: issue.message });\n })\n .meta(JOURNAL_SCHEMA_METADATA),\n },\n {\n name: 'issue_create',\n commandName: 'create',\n description: 'Create a native GitHub tracking issue with configured metadata and relationships',\n issueContract: ISSUE_JSON_SCHEMAS,\n inputSchema: issueInputSchema(\n z.strictObject({\n ...Tracking,\n ...NativeIssueDateFields,\n ...IssueWriteFields,\n title: IssueFields.shape.title,\n opId: z\n .string()\n .trim()\n .min(1)\n .max(256)\n .optional()\n .describe(\n 'Stable retry identity: repeat the same original arguments to complete a partial create without another issue.',\n ),\n status: CreateIssueStatus.optional(),\n }),\n ),\n },\n {\n name: 'issue_start',\n commandName: 'start',\n description: 'Start a linked issue',\n inputSchema: NormalStart,\n },\n {\n name: 'issue_list',\n commandName: 'list',\n description: 'List repository issues with native filters, named organization fields and pagination',\n inputSchema: z.strictObject({ ...IssueListing, query: SearchText.optional() }),\n },\n {\n name: 'issue_search',\n commandName: 'search',\n description: 'Search literal issue text in the selected repository with native filters and pagination',\n inputSchema: z.strictObject({ ...IssueListing, query: SearchText }),\n },\n {\n name: 'issue_update',\n commandName: 'update',\n description: 'Update native issue fields and exact relationship sets with readback',\n inputSchema: IssueUpdateInput.safeExtend({ verbose: Verbose }),\n },\n {\n name: 'issue_batch_update',\n commandName: 'batch:update',\n description: 'Plan or apply 1\u201350 issue updates in one repository, with ordered partial results and readback',\n inputSchema: issueInputSchema(\n z.strictObject({\n repo: Repo,\n verbose: Verbose,\n items: z.array(IssueUpdateInput).min(1).max(50),\n dryRun: z.boolean().optional(),\n }),\n ),\n },\n {\n name: 'issue_info',\n commandName: 'info',\n description:\n 'Read live GitHub issue metadata, relationships, Project status, linked PRs (state, checks, reviews) and the latest journal in one call. Child counts by default; verbose adds the body, routing and full child progress. Pass the requested owner/name as repo; an explicit repo works outside Git without a checkout. This read does not start or update the issue.',\n inputSchema: z.strictObject({ issueNumber: Positive, repo: Repo, verbose: Verbose }),\n },\n {\n name: 'issue_ready_check',\n commandName: 'ready:check',\n description: 'Evaluate deterministic readiness from live native issue state',\n inputSchema: z.strictObject({ issueNumber: Positive, repo: Tracking.repo, verbose: Verbose }),\n },\n {\n name: 'issue_pr_create',\n commandName: 'pr:create',\n description:\n 'Create or reuse an issue-closing PR from any directory using repo, issueNumber and a pushed head. Restore a missing closing link on reuse.',\n inputSchema: z\n .strictObject({\n repo: Repo,\n verbose: Verbose,\n issueNumber: Positive,\n prNumber: Positive.optional(),\n nonClosing: z.boolean().optional(),\n reconcileNonClosingReference: z.boolean().optional(),\n expectedHeadSha: z\n .string()\n .regex(/^[a-f0-9]{40}$/u)\n .optional(),\n expectedBaseSha: z\n .string()\n .regex(/^[a-f0-9]{40}$/u)\n .optional(),\n body: z.string().min(1, 'PR body is empty; enter a body or omit it to use the default body.').optional(),\n draft: z.boolean().optional(),\n dryRun: z.boolean().optional(),\n title: z.string().min(1, 'PR title is empty; enter a title or omit it to use the issue title.').optional(),\n headBranch: z.string().min(1).optional(),\n head: z.string().min(1).optional(),\n base: z.string().min(1).optional(),\n })\n .refine(\n (input) => input.head === undefined || input.headBranch === undefined || input.head === input.headBranch,\n 'PR head selectors disagree; use the same branch for head and headBranch.',\n )\n .refine(\n (input) =>\n input.reconcileNonClosingReference === true\n ? input.nonClosing === true &&\n input.draft !== false &&\n input.body !== undefined &&\n input.expectedHeadSha !== undefined &&\n input.expectedBaseSha !== undefined\n : input.expectedHeadSha === undefined && input.expectedBaseSha === undefined,\n 'Reference reconciliation requires explicit nonClosing, DRAFT, body and exact head/base; SHA inputs require the action.',\n ),\n },\n {\n name: 'issue_pr_info',\n commandName: 'pr:info',\n description:\n \"Inspect a PR by number or its GitHub-linked issue branch: state, merge state, checks, reviews and each linked issue's state, Project status and latest journal, in one call\",\n inputSchema: z.strictObject({\n repo: Repo,\n verbose: Verbose,\n issueNumber: Positive.optional(),\n prNumber: Positive.optional(),\n nonClosing: z.boolean().optional(),\n }),\n },\n {\n name: 'issue_pr_review',\n commandName: 'pr:review',\n description: 'Submit one existing exact-head independent review with the reviewer App role',\n inputSchema: z.strictObject({\n repo: Repo,\n verbose: Verbose,\n issueNumber: Positive,\n prNumber: Positive,\n nonClosing: z.boolean().optional(),\n artifact: z.string().min(1, 'Review artifact is empty; provide the independent review artifact JSON.'),\n identity: z.string().min(1).optional(),\n dryRun: z.boolean().optional(),\n }),\n },\n] as const;\n\nexport type AiDeliveryMcpToolName = (typeof AI_DELIVERY_MCP_TOOLS)[number]['name'];\n\nexport function getAiDeliveryMcpTool(name: string): (typeof AI_DELIVERY_MCP_TOOLS)[number] | null {\n return AI_DELIVERY_MCP_TOOLS.find((tool) => tool.name === name) ?? null;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,6BAA6B;AACtC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB,+BAA+B;AAC5D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,+DAA+D;AAC/G,MAAM,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAC3C,MAAM,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAC/C,MAAM,YACJ;AACF,MAAM,OAAO,EACV,OAAO,EACP,MAAM,qCAAqC,EAC3C,SAAS,EACT,SAAS,SAAS;AACd,MAAM,mCAAmC;AAChD,MAAM,mBAAmB;AAAA,EACvB,EACG,aAAa;AAAA,IACZ,GAAG;AAAA,IACH,GAAG;AAAA,IACH,QAAQ,iBAAiB,SAAS;AAAA,IAClC,eAAe,mBAAmB,SAAS;AAAA,IAC3C,MAAM;AAAA,IACN,WAAW,EAAE,MAAM,QAAQ,EAAE,SAAS;AAAA,IACtC,QAAQ,EAAE,MAAM,QAAQ,EAAE,SAAS;AAAA,IACnC,gBAAgB,eAAe,SAAS;AAAA,IACxC,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,IAC1B,aAAa;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E;AAAA,IACF;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aACE;AAAA,IACF,aAAa,EAAE,aAAa;AAAA,MAC1B,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa,SAAS,SAAS;AAAA,MAC/B,UAAU,SAAS,SAAS;AAAA,MAC5B,YAAY,EAAE,QAAQ,EAAE,SAAS;AAAA,IACnC,CAAC;AAAA,EACH;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa,EAAE,aAAa;AAAA,MAC1B,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,MACV,YAAY,EAAE,QAAQ,EAAE,SAAS;AAAA,MACjC,UAAU,EAAE,OAAO,EAAE,IAAI,GAAG,yEAAyE;AAAA,MACrG,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,MACrC,QAAQ,EAAE,QAAQ,EAAE,SAAS;AAAA,IAC/B,CAAC;AAAA,EACH;AACF;AAIO,SAAS,qBAAqB,MAA6D;AAChG,SAAO,sBAAsB,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK;AACrE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -9,8 +9,6 @@ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"
|
|
|
9
9
|
import { test } from "vitest";
|
|
10
10
|
import pkg from "../package.json" with { type: "json" };
|
|
11
11
|
import { AI_DELIVERY_MCP_TOOLS } from "./mcp/tools.js";
|
|
12
|
-
import { buildRuntimeAdmission, validateRuntimeAdmission } from "./services/deliveryAdmission.js";
|
|
13
|
-
import { retainedWorktreeTransitionProducerDigest } from "./verification.js";
|
|
14
12
|
import { syntheticDiscoveryConfig } from "./fixtures/discovery.js";
|
|
15
13
|
import { BoardReconcilePlanSchema, BoardReconcileResultSchema } from "./services/boardReconcileService.js";
|
|
16
14
|
const packageRoot = fileURLToPath(new URL("../", import.meta.url));
|
|
@@ -499,49 +497,4 @@ test("standalone plugin ships application and bundled dependency notices", () =>
|
|
|
499
497
|
assert.match(notices, /@modelcontextprotocol\/sdk/u);
|
|
500
498
|
assert.match(notices, /commander/u);
|
|
501
499
|
});
|
|
502
|
-
test(
|
|
503
|
-
"a copied plugin has a real CLI and producer identity that existing admission can bind",
|
|
504
|
-
{ tags: ["release"] },
|
|
505
|
-
() => {
|
|
506
|
-
const directory = realpathSync(mkdtempSync(join(tmpdir(), "ai-delivery-native-identity-")));
|
|
507
|
-
const copiedRoot = join(directory, "plugin");
|
|
508
|
-
cpSync(pluginRoot, copiedRoot, { recursive: true });
|
|
509
|
-
const configuration = {
|
|
510
|
-
config: { repository: "example/widget" },
|
|
511
|
-
configDigest: `sha256:${"a".repeat(64)}`
|
|
512
|
-
};
|
|
513
|
-
try {
|
|
514
|
-
const cliPath = join(copiedRoot, "runtime", "dist", "cli.js");
|
|
515
|
-
assert.equal(
|
|
516
|
-
execFileSync(process.execPath, [cliPath, "--version"], { encoding: "utf8", maxBuffer: 65536 }).trim(),
|
|
517
|
-
pkg.version
|
|
518
|
-
);
|
|
519
|
-
const admission = buildRuntimeAdmission({
|
|
520
|
-
cliPath,
|
|
521
|
-
mcpLauncherPath: join(copiedRoot, "dist", "mcp-launcher.js"),
|
|
522
|
-
pluginManifestPath: join(copiedRoot, ".claude-plugin", "plugin.json"),
|
|
523
|
-
packageVersion: pkg.version,
|
|
524
|
-
sourceArchiveSha256: `sha256:${"b".repeat(64)}`,
|
|
525
|
-
sourceCommit: "1".repeat(40),
|
|
526
|
-
configuration
|
|
527
|
-
});
|
|
528
|
-
assert.equal(validateRuntimeAdmission(admission, configuration, cliPath).admissionId, admission.admissionId);
|
|
529
|
-
assert.match(
|
|
530
|
-
retainedWorktreeTransitionProducerDigest(join(copiedRoot, "runtime", "dist")),
|
|
531
|
-
/^sha256:[a-f0-9]{64}$/u
|
|
532
|
-
);
|
|
533
|
-
const otherRoot = join(directory, "other");
|
|
534
|
-
cpSync(copiedRoot, otherRoot, { recursive: true });
|
|
535
|
-
assert.throws(
|
|
536
|
-
() => validateRuntimeAdmission(admission, configuration, join(otherRoot, "runtime", "dist", "cli.js"))
|
|
537
|
-
);
|
|
538
|
-
writeFileSync(cliPath, `${readFileSync(cliPath, "utf8")}
|
|
539
|
-
/* altered runtime */
|
|
540
|
-
`);
|
|
541
|
-
assert.throws(() => validateRuntimeAdmission(admission, configuration, cliPath));
|
|
542
|
-
} finally {
|
|
543
|
-
rmSync(directory, { recursive: true, force: true });
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
);
|
|
547
500
|
//# sourceMappingURL=pluginPackaging.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/pluginPackaging.test.ts"],
|
|
4
|
-
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { execFileSync, spawnSync } from 'node:child_process';\nimport { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';\nimport { test } from 'vitest';\n\nimport pkg from '../package.json' with { type: 'json' };\nimport { AI_DELIVERY_MCP_TOOLS } from './mcp/tools.js';\nimport type { LoadedDeliveryConfig } from './config/deliveryConfig.js';\nimport { buildRuntimeAdmission, validateRuntimeAdmission } from './services/deliveryAdmission.js';\nimport { retainedWorktreeTransitionProducerDigest } from './verification.js';\nimport { syntheticDiscoveryConfig } from './fixtures/discovery.js';\nimport { BoardReconcilePlanSchema, BoardReconcileResultSchema } from './services/boardReconcileService.js';\n\nconst packageRoot = fileURLToPath(new URL('../', import.meta.url));\nconst pluginRoot = join(packageRoot, 'plugins', 'ai-delivery');\nconst qualificationOwner = (await import(new URL('../scripts/current-qualification.mjs', import.meta.url).href)) as {\n copyReleaseArchive(\n contractPath: string,\n cwd: string,\n destination: string,\n ): { archivePath: string; archiveSha256: string };\n};\n\ntest(\n 'README and delivery skill CLI examples name supported commands and required options',\n { tags: ['release'] },\n () => {\n const cli = readFileSync(join(packageRoot, 'src', 'cli.ts'), 'utf8');\n const declarations = [...cli.matchAll(/\\.command\\('([^']+)'\\)/gu)];\n const required = new Map(\n declarations.map((match) => {\n const next = cli.indexOf('.command(', match.index + match[0].length);\n return [\n match[1]!,\n [...cli.slice(match.index, next < 0 ? undefined : next).matchAll(/\\.requiredOption\\('--([a-z0-9-]+)/gu)].map(\n (option) => `--${option[1]}`,\n ),\n ];\n }),\n );\n const globals = new Set(['--repo', '--repo-root', '--identity']);\n for (const path of [\n 'README.md',\n 'plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md',\n 'plugins/ai-delivery/skills/pr-handoff/SKILL.md',\n ]) {\n const source = readFileSync(join(packageRoot, path), 'utf8').replace(/\\\\\\r?\\n\\s*/gu, ' ');\n for (const match of source.matchAll(/^ai-delivery\\s+(.+)$/gmu)) {\n const words = match[1]!.split(/\\s+/u);\n let index = 0;\n while (globals.has(words[index] ?? '')) index += 2;\n const command = words[index]!;\n const commandPath =\n command === 'merge'\n ? words.slice(index, index + 3)\n : command === 'plugin'\n ? words.slice(index, index + 2)\n : [command];\n const help = execFileSync(process.execPath, [join(packageRoot, 'dist', 'cli.js'), ...commandPath, '--help'], {\n encoding: 'utf8',\n maxBuffer: 65536,\n });\n for (const flag of required.get(command) ?? [])\n assert.ok(words.includes(flag), `${path}: ${command} requires ${flag}`);\n for (const flag of words.filter((word) => word.startsWith('--')))\n assert.ok(globals.has(flag) || help.includes(flag), `${path}: ${command} does not support ${flag}`);\n }\n }\n },\n);\n\nfor (const launchCheckout of [false, true]) {\n test(\n `the ${launchCheckout ? 'bundled' : 'packed'} launcher creates, updates and journals repository B from ${launchCheckout ? 'checkout A' : 'a non-Git directory'} without an identity environment`,\n { tags: ['release'] },\n async () => {\n const directory = realpathSync(mkdtempSync(join(tmpdir(), 'delivery-launch-routing-')));\n let selectedPluginRoot = pluginRoot;\n let discoveryFixture = new URL('./fixtures/discovery.js', import.meta.url).href;\n if (!launchCheckout) {\n try {\n const archive = qualificationOwner.copyReleaseArchive(\n process.env.AI_DELIVERY_RELEASE_CONTRACT ?? '',\n packageRoot,\n join(directory, 'qualified.tgz'),\n );\n const unpacked = join(directory, 'unpacked');\n mkdirSync(unpacked);\n execFileSync('tar', ['-xzf', archive.archivePath, '-C', unpacked]);\n selectedPluginRoot = join(directory, 'plugin-cache');\n // Detach the packed native plugin so the launcher uses its bundled runtime,\n // rather than the package-local CLI whose npm dependencies are not installed here.\n cpSync(join(unpacked, 'package', 'plugins', 'ai-delivery'), selectedPluginRoot, { recursive: true });\n discoveryFixture = pathToFileURL(join(unpacked, 'package', 'dist', 'fixtures', 'discovery.js')).href;\n assert.equal(existsSync(join(selectedPluginRoot, 'runtime', 'dist', 'cli.js')), true);\n } catch (error) {\n rmSync(directory, { recursive: true, force: true });\n throw error;\n }\n }\n if (launchCheckout) {\n execFileSync('git', ['init', '-q', directory]);\n execFileSync('git', ['remote', 'add', 'origin', 'https://github.com/example/a.git'], { cwd: directory });\n }\n const preload = join(directory, 'mock-github.mjs');\n const calls = join(directory, 'requests.json');\n const settings = join(directory, 'user.json');\n const boardStatePath = join(directory, 'board-state.json');\n writeFileSync(boardStatePath, JSON.stringify({ member: 'ITEM17', status: 'Todo', writes: [] }));\n writeFileSync(\n settings,\n JSON.stringify({\n schemaVersion: 'ai-delivery.user@1',\n roles: {\n author: { authSource: 'personal', identity: 'operator', credentialEnv: { token: 'SYNTHETIC_TOKEN' } },\n reviewer: {\n identity: 'reviewer',\n credentialEnv: { appId: 'REVIEW_APP', installationId: 'REVIEW_INSTALL', privateKeyPath: 'REVIEW_KEY' },\n },\n },\n project: 1,\n checkoutRoots: [],\n pointsField: 'Estimate',\n priorityField: 'Urgency',\n statusField: 'Flow',\n statuses: syntheticDiscoveryConfig.native.project.statuses,\n }),\n );\n writeFileSync(\n preload,\n `\nimport {existsSync,readFileSync,writeFileSync} from 'node:fs';\nimport {syntheticDiscoveryClients} from ${JSON.stringify(discoveryFixture)};\nconst configuration=${JSON.stringify(syntheticDiscoveryConfig)};\nconst comments=[];\nconst fields=[configuration.native.points,configuration.native.priority].map(field=>({id:Number(field.databaseId),name:field.name,data_type:'single_select',options:field.values.map(name=>({name:String(name)}))}));\nlet fieldValues=[];\nlet issue={id:117,number:17,node_id:'ISSUE17',title:'Widget',body:'',state:'open',labels:[],html_url:'https://github.com/example/b/issues/17'};\nconst page=nodes=>({nodes,pageInfo:{hasNextPage:false,endCursor:null}});\nglobalThis.fetch=async(url,init)=>{\n const requests=existsSync(${JSON.stringify(calls)})?JSON.parse(readFileSync(${JSON.stringify(calls)},'utf8')):[];\n const boardState=JSON.parse(readFileSync(${JSON.stringify(boardStatePath)},'utf8'));\n const saveBoard=()=>writeFileSync(${JSON.stringify(boardStatePath)},JSON.stringify(boardState));\n const path=new URL(String(url)).pathname;const method=init?.method??'GET';\n requests.push({path,method});writeFileSync(${JSON.stringify(calls)},JSON.stringify(requests));\n const json=init?.body?JSON.parse(init.body):{};\n let data;\n if(path==='/graphql'){\n const query=json.query;\n const item=()=>({id:boardState.member,isArchived:false,project:{id:'PROJECT-1',number:1},content:{__typename:'Issue',id:'ISSUE17',number:17,repository:{nameWithOwner:'example/b'}},fieldValueByName:boardState.status===null?null:{name:'Queued',optionId:'STATUS-0'}});\n if(boardState.failDiscovery==='access'&&query.includes('DeliveryRepository'))return new Response(JSON.stringify({message:'Synthetic access denied'}),{status:403,headers:{'content-type':'application/json'}});\n if(query.includes('AddProjectDeliveryItem')){\n boardState.member='ADDED17';boardState.status='Todo';boardState.writes.push('add');\n const lost=boardState.failAddResponse;boardState.failAddResponse=false;saveBoard();\n if(lost)throw new Error('Synthetic lost add response');\n data={addProjectV2ItemById:{item:{id:boardState.member}}};\n }\n else if(query.includes('ProjectDeliveryIssueItems'))data={node:{id:json.variables.issueNodeId,projectItems:{nodes:boardState.member?[item()]:[],pageInfo:{hasNextPage:false}}}};\n else if(query.includes('ProjectDeliveryItems'))data={organization:{projectV2:{id:'PROJECT-1',number:1,items:page(boardState.member?[item()]:[])}}};\n else if(query.includes('ProjectDeliveryItemReadback'))data={node:boardState.member===json.variables.itemId?item():null};\n else if(query.includes('blockedBy('))data={repository:{issue:{id:'ISSUE17',number:17,repository:{nameWithOwner:'example/b'},parent:null,blockedBy:page([])}}};\n else if(query.includes('DeliveryIssueBranches'))data={repository:{issue:{linkedBranches:page([])}}};\n else {\n data=await syntheticDiscoveryClients({...configuration,repository:'example/'+(json.variables?.repo??'b')}).graphql(query,json.variables);\n if(boardState.failDiscovery==='pages'&&query.includes('ProjectDeliveryConfiguration')){\n if(json.variables.cursor!=null)data.organization.projectV2.fields.nodes=[];\n data.organization.projectV2.fields.pageInfo={hasNextPage:true,endCursor:'next-'+String(json.variables.cursor??'first')};\n }\n }\n return new Response(JSON.stringify({data}),{status:200,headers:{'content-type':'application/json'}});\n }\n if(path==='/user')data={id:1,login:'operator'};\n else if(path.endsWith('/issues/17/comments')){\n if(method==='POST'){\n const id=91+comments.length;\n data={id,body:json.body,html_url:'https://github.com/example/b/issues/17#issuecomment-'+id,issue_url:'https://api.github.com/repos/example/b/issues/17',user:{login:'operator'}};\n comments.push(data);\n }else data=comments;\n }\n else if(path.includes('/issues/comments/'))data=comments.find(comment=>comment.id===Number(path.split('/').at(-1)));\n else if(path.endsWith('/labels'))data=[{name:'enhancement'},{name:'bug'}];\n else if(path==='/repos/example/b/issues/17/sub_issues'&&method==='GET')data=[];\n else if(path.endsWith('/issue-fields'))data=fields;\n else if(path.endsWith('/issue-field-values')){\n if(method==='POST')fieldValues=json.issue_field_values.map(entry=>({issue_field_id:entry.field_id,issue_field_name:fields.find(field=>field.id===entry.field_id).name,data_type:'single_select',value:entry.value}));\n data=fieldValues;\n }\n else if(path.endsWith('/issues')&&method==='POST'){issue={...issue,...json};data=issue;}\n else if(path.endsWith('/issues')&&method==='GET')data=[issue];\n else if(path.endsWith('/sub_issues'))data=[];\n else if(path.endsWith('/issues/17')){if(method==='PATCH')issue={...issue,...json};data=issue;}\n else throw new Error('Unexpected synthetic request '+method+' '+path);\n return new Response(JSON.stringify(data),{status:200,headers:{'content-type':'application/json'}});\n};\n`,\n );\n const transport = new StdioClientTransport({\n command: process.execPath,\n args: [join(selectedPluginRoot, 'dist', 'mcp-launcher.js')],\n cwd: directory,\n env: {\n PATH: process.env.PATH ?? '',\n TMPDIR: tmpdir(),\n HOME: directory,\n AI_DELIVERY_CONFIG: settings,\n SYNTHETIC_TOKEN: 'inert-personal-token',\n NODE_OPTIONS: `--v8-pool-size=1 --import=${preload}`,\n },\n stderr: 'pipe',\n });\n const client = new Client({ name: 'actual-launch-routing', version: '1' });\n try {\n await client.connect(transport, { timeout: 30000 });\n const readyInput = {\n repo: 'example/b',\n title: 'Validate widget launch routing across repositories',\n points: 2,\n problem: 'A launcher can bind a widget issue to the checkout repository instead of the explicit caller.',\n outcome: 'Create and update the issue only in explicitly selected repository B.',\n acceptanceCriteria: [\n {\n behavior: 'Create, update and journal requests address repository B with zero repository A requests.',\n verifiedBy: 'Packaged stdio client results and captured REST path assertions.',\n },\n ],\n outOfScope: ['Live authentication and host configuration.'],\n };\n const created = await client.callTool({\n name: 'issue_create',\n arguments: { ...readyInput, labels: ['enhancement'] },\n });\n assert.equal(created.isError, undefined, JSON.stringify(created));\n const updated = await client.callTool({\n name: 'issue_update',\n arguments: { repo: 'example/b', issueNumber: 17, labels: ['bug'] },\n });\n assert.equal(updated.isError, undefined, JSON.stringify(updated));\n const common = {\n repo: 'example/b',\n issueNumber: 17,\n summary: 'Packed journal validation works.',\n status: 'In progress',\n nextStep: 'Independent review',\n nextDate: '2026-10-09',\n keyNumbers: ['5 journal kinds'],\n evidence: ['https://github.com/example/b/issues/17'],\n };\n const journals = [\n { ...common, kind: 'start', outcome: 'Deliver strict validation' },\n { ...common, kind: 'progress', done: ['Added regression'], decisionNeeded: 'None' },\n { ...common, kind: 'decision', decision: 'Keep variants strict', rationale: 'Preserve the contract' },\n { ...common, kind: 'blocker', blocker: 'Review pending', resolution: 'Independent acceptance' },\n {\n ...common,\n kind: 'closeout',\n acceptance: [{ criterion: 'Explicit repo works', evidence: common.evidence[0] }],\n followUps: [],\n },\n ];\n const decoded = (response: unknown) =>\n JSON.parse((response as { content: { text: string }[] }).content[0]!.text) as {\n commentId: number;\n url: string;\n body: string;\n reused: boolean;\n };\n for (const [index, journal] of journals.entries()) {\n const response = await client.callTool({ name: 'issue_comment', arguments: { ...journal, verbose: true } });\n assert.equal(response.isError, undefined, JSON.stringify(response));\n const readback = decoded(response);\n assert.equal(readback.commentId, 91 + index);\n assert.equal(readback.url, `https://github.com/example/b/issues/17#issuecomment-${String(91 + index)}`);\n assert.equal(readback.body.split('\\n')[2], common.summary);\n assert.ok(readback.body.includes(`**Kind:** ${journal.kind}.`));\n assert.match(readback.body, /<!-- ai-delivery:journal@1:sha256:[a-f0-9]{64} -->$/u);\n assert.equal(readback.reused, false);\n }\n const retried = await client.callTool({ name: 'issue_comment', arguments: journals[1]! });\n assert.equal(retried.isError, undefined, JSON.stringify(retried));\n assert.equal(decoded(retried).commentId, 92);\n assert.equal(decoded(retried).reused, true);\n const beforeInvalidRequests = (JSON.parse(readFileSync(calls, 'utf8')) as unknown[]).length;\n for (const invalid of [\n { ...journals[1], unknown: true },\n { ...journals[1], outcome: 'Wrong variant' },\n { ...journals[1], kind: 'unsupported' },\n { ...journals[1], nextDate: '2026-02-30' },\n { ...journals[1], 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 assert.equal(\n (JSON.parse(readFileSync(calls, 'utf8')) as unknown[]).length,\n beforeInvalidRequests,\n 'invalid packed journals never reach configuration discovery, author authentication or writes',\n );\n const unknown = await client.callTool({\n name: 'issue_create',\n arguments: { ...readyInput, labels: ['missing-label'] },\n });\n assert.equal(unknown.isError, true);\n assert.match(JSON.stringify(unknown), /Unknown repository label.*missing-label/u);\n // Exercise the actual bundled coordinator and CLI against the same synthetic provider state.\n const boardValue = async (arguments_: Record<string, unknown>) => {\n const response = await client.callTool({ name: 'board_reconcile', arguments: arguments_ });\n assert.equal(response.isError, undefined, JSON.stringify(response));\n return JSON.parse((response.content as { text: string }[])[0]!.text) as unknown;\n };\n const boardEnv = {\n PATH: process.env.PATH ?? '',\n TMPDIR: tmpdir(),\n HOME: directory,\n AI_DELIVERY_CONFIG: settings,\n SYNTHETIC_TOKEN: 'inert-personal-token',\n NODE_OPTIONS: `--v8-pool-size=1 --import=${preload}`,\n };\n const activeCli = launchCheckout\n ? join(packageRoot, 'dist', 'cli.js')\n : join(selectedPluginRoot, 'runtime', 'dist', 'cli.js');\n const boardCli = (...args: string[]) =>\n spawnSync(process.execPath, [activeCli, 'board:reconcile', '--repositories', 'example/b', ...args], {\n cwd: directory,\n env: boardEnv,\n encoding: 'utf8',\n maxBuffer: 32 * 1024 * 1024,\n });\n writeFileSync(\n boardStatePath,\n JSON.stringify({ member: null, status: null, writes: [], failAddResponse: true }),\n );\n const plan = BoardReconcilePlanSchema.parse(await boardValue({ repositories: ['example/b'] }));\n assert.equal(plan.scopeComplete, true);\n assert.equal(plan.operations.length, 1);\n assert.equal(plan.operations[0]!.kind, 'add-membership');\n const rootLibrary = spawnSync(\n process.execPath,\n [\n '--input-type=module',\n '-e',\n `import {executeTool} from ${JSON.stringify(pathToFileURL(join(packageRoot, 'dist', 'agent.js')).href)};console.log(JSON.stringify(await executeTool('board_reconcile',{repositories:['example/b']},{repoRoot:process.cwd()})));`,\n ],\n { cwd: directory, env: boardEnv, encoding: 'utf8', maxBuffer: 32 * 1024 * 1024 },\n );\n assert.equal(rootLibrary.status, 0, rootLibrary.stderr);\n const rootPlan = BoardReconcilePlanSchema.parse(JSON.parse(rootLibrary.stdout));\n assert.equal(rootPlan.packageIdentity!.packageVersion, plan.packageIdentity!.packageVersion);\n assert.deepEqual(rootPlan.scope, plan.scope);\n assert.deepEqual(rootPlan.operations, plan.operations);\n if (!launchCheckout) {\n assert.notDeepEqual(rootPlan.packageIdentity, plan.packageIdentity);\n const crossArtifact = BoardReconcileResultSchema.parse(\n await boardValue({ repositories: rootPlan.scope, mode: 'apply', plan: rootPlan }),\n );\n assert.equal(crossArtifact.summary.applied, 0);\n assert.equal(crossArtifact.summary.refused, 1);\n } else assert.deepEqual(rootPlan.packageIdentity, plan.packageIdentity);\n const interrupted = BoardReconcileResultSchema.parse(\n await boardValue({ repositories: plan.scope, mode: 'apply', plan }),\n );\n assert.equal(interrupted.summary.unknown, 1);\n assert.equal(interrupted.operations[0]!.attempted, true);\n const planFile = join(directory, 'plan.json'),\n priorFile = join(directory, 'prior-result.json');\n writeFileSync(planFile, JSON.stringify(plan));\n writeFileSync(priorFile, JSON.stringify(interrupted));\n const resumedCli = boardCli('--apply', '--plan-file', planFile, '--prior-result-file', priorFile);\n assert.equal(resumedCli.status, 1, resumedCli.stderr);\n const resumed = BoardReconcileResultSchema.parse(JSON.parse(resumedCli.stdout));\n assert.equal(resumed.summary.applied, 0);\n assert.equal(resumed.summary.satisfied, 1);\n assert.equal(resumed.operations[0]!.priorEvidence.at(-1)!.outcome, 'unknown');\n assert.equal(resumed.summary.unresolved, 1);\n assert.deepEqual((JSON.parse(readFileSync(boardStatePath, 'utf8')) as { writes: string[] }).writes, ['add']);\n writeFileSync(boardStatePath, JSON.stringify({ member: null, status: null, writes: [] }));\n const partialCli = boardCli('--apply', '--plan-file', planFile);\n assert.equal(partialCli.status, 1, partialCli.stderr);\n const applied = BoardReconcileResultSchema.parse(JSON.parse(partialCli.stdout));\n assert.equal(applied.summary.applied, 1);\n assert.equal(applied.operations[0]!.readback!.itemId, 'ADDED17');\n const historical = structuredClone(applied);\n historical.operations[0]!.outcome = 'unknown';\n historical.summary.applied = 0;\n historical.summary.unknown = 1;\n writeFileSync(priorFile, JSON.stringify(historical));\n const emptyPlan = BoardReconcilePlanSchema.parse(await boardValue({ repositories: ['example/b'] }));\n assert.equal(emptyPlan.operations.length, 0);\n for (const failure of ['pages', 'access']) {\n writeFileSync(\n boardStatePath,\n JSON.stringify({ member: 'ADDED17', status: 'Todo', writes: ['add'], failDiscovery: failure }),\n );\n for (const value of [\n await boardValue({ repositories: plan.scope, mode: 'apply', plan, priorResult: historical }),\n ...(() => {\n const result = boardCli('--apply', '--plan-file', planFile, '--prior-result-file', priorFile);\n assert.equal(result.status, 1, result.stderr);\n return [JSON.parse(result.stdout) as unknown];\n })(),\n ]) {\n const result = BoardReconcileResultSchema.parse(value);\n assert.equal(result.scopeComplete, false);\n assert.equal(result.planId, plan.planId);\n assert.equal(result.summary.applied, 0);\n assert.equal(result.summary.satisfied, 0);\n assert.equal(result.operations[0]!.attempted, false);\n assert.equal(result.operations[0]!.operationId, plan.operations[0]!.operationId);\n assert.ok(result.operations[0]!.knownItemIds.includes('ADDED17'));\n assert.deepEqual(result.operations[0]!.priorEvidence.at(-1)!.readback, historical.operations[0]!.readback);\n if (failure === 'pages') assert.equal(result.gaps[0]!.pagesRequested, 20);\n }\n const dry = boardCli('--dry-run');\n assert.equal(dry.status, 1, dry.stderr);\n assert.equal(BoardReconcilePlanSchema.parse(JSON.parse(dry.stdout)).scopeComplete, false);\n const empty = BoardReconcileResultSchema.parse(\n await boardValue({ repositories: emptyPlan.scope, mode: 'apply', plan: emptyPlan }),\n );\n assert.equal(empty.scopeComplete, false);\n assert.deepEqual(empty.operations, []);\n }\n writeFileSync(boardStatePath, JSON.stringify({ member: 'ADDED17', status: 'Todo', writes: ['add'] }));\n const completeDry = boardCli('--dry-run');\n assert.equal(completeDry.status, 0, completeDry.stderr);\n assert.equal(BoardReconcilePlanSchema.parse(JSON.parse(completeDry.stdout)).scopeComplete, true);\n const requests = JSON.parse(readFileSync(calls, 'utf8')) as Array<{ path: string; method: string }>;\n assert.equal(\n requests.some((call) => call.path.startsWith('/repos/example/a/')),\n false,\n );\n assert.equal(requests.filter((call) => call.path.endsWith('/issues') && call.method === 'POST').length, 1);\n assert.equal(\n requests.filter((call) => call.path.endsWith('/issues/17/comments') && call.method === 'POST').length,\n 5,\n 'five authored journals read back; retry adds no sixth write',\n );\n assert.equal(existsSync(join(directory, '.issue-cli')), false);\n } finally {\n await client.close();\n await transport.close();\n rmSync(directory, { recursive: true, force: true });\n }\n },\n );\n}\n\ntest('CLI reports the selected package version', { tags: ['release'] }, () => {\n const displayed = execFileSync(process.execPath, [join(packageRoot, 'dist', 'cli.js'), '--version'], {\n encoding: 'utf8',\n maxBuffer: 65536,\n }).trim();\n assert.equal(displayed, pkg.version);\n});\n\ntest('portable and Claude plugin metadata bind the same package and launcher', () => {\n const portable = JSON.parse(readFileSync(join(pluginRoot, 'plugin.json'), 'utf8')) as {\n $schema: string;\n name: string;\n version: string;\n };\n const claude = JSON.parse(readFileSync(join(pluginRoot, '.claude-plugin', 'plugin.json'), 'utf8')) as {\n name: string;\n version: string;\n packageVersion: string;\n deliveryCapabilityVersion: number;\n };\n assert.equal(portable.$schema, 'https://agent-plugins.org/schemas/1.0.0/plugin.schema.json');\n assert.equal(portable.name, 'ai-delivery');\n assert.equal(portable.version, pkg.version);\n assert.equal(claude.name, portable.name);\n assert.equal(claude.version, pkg.version);\n assert.equal(claude.packageVersion, pkg.version);\n assert.equal(claude.deliveryCapabilityVersion, 2);\n const mcp = JSON.parse(readFileSync(join(pluginRoot, 'mcp.json'), 'utf8')) as {\n $schema: string;\n mcpServers: Record<string, { type: string; command: string; args: string[] }>;\n };\n assert.equal(mcp.$schema, 'https://agent-plugins.org/schemas/1.0.0/mcp.schema.json');\n assert.deepEqual(mcp.mcpServers['ai-delivery'], {\n type: 'stdio',\n command: 'node',\n args: ['${PLUGIN_ROOT}/dist/mcp-launcher.js'],\n });\n});\n\ntest(\n 'a copied plugin root starts its exact MCP contract without a parent runtime installation',\n { tags: ['release'] },\n async () => {\n const directory = mkdtempSync(join(tmpdir(), 'ai-delivery-plugin-cache-'));\n const copiedRoot = join(directory, 'plugin');\n cpSync(pluginRoot, copiedRoot, { recursive: true });\n const transport = new StdioClientTransport({\n command: process.execPath,\n args: [join(copiedRoot, 'dist', 'mcp-launcher.js')],\n cwd: copiedRoot,\n env: { PATH: process.env.PATH ?? '', TMPDIR: tmpdir(), NODE_OPTIONS: '--max-old-space-size=2048' },\n stderr: 'pipe',\n maxBufferSize: 1024 * 1024,\n });\n const client = new Client({ name: 'isolated-plugin-cache-test', version: '1.0.0' });\n let pid: number | null = null;\n try {\n await client.connect(transport, { timeout: 30000 });\n pid = transport.pid;\n assert.equal(client.getServerVersion()?.version, pkg.version);\n const instructions = client.getInstructions();\n assert.equal(typeof instructions, 'string', 'the copied native plugin must retain initialize guidance');\n assert.match(instructions ?? '', /\\brepo\\b/u);\n assert.match(instructions ?? '', /\\bissue_info\\b/u);\n const result = await client.listTools({}, { timeout: 30000 });\n const issueInfo = result.tools.find((tool) => tool.name === 'issue_info');\n assert.ok(issueInfo);\n const properties = issueInfo.inputSchema.properties as Record<string, { description?: string }>;\n assert.equal(typeof properties.repo?.description, 'string');\n assert.deepEqual(\n result.tools.map((tool) => tool.name).sort(),\n AI_DELIVERY_MCP_TOOLS.map((tool) => tool.name).sort(),\n );\n assert.equal(existsSync(join(copiedRoot, '.issue-cli')), false);\n } finally {\n await client.close();\n await transport.close();\n const ownedPid = pid;\n try {\n if (ownedPid !== null) assert.throws(() => process.kill(ownedPid, 0), { code: 'ESRCH' });\n } finally {\n rmSync(directory, { recursive: true, force: true });\n }\n }\n },\n);\n\ntest('standalone plugin ships application and bundled dependency notices', () => {\n assert.equal(readFileSync(join(pluginRoot, 'LICENSE'), 'utf8'), readFileSync(join(packageRoot, 'LICENSE'), 'utf8'));\n const notices = readFileSync(join(pluginRoot, 'runtime', 'dist', 'THIRD-PARTY-NOTICES.md'), 'utf8');\n assert.match(notices, /@modelcontextprotocol\\/sdk/u);\n assert.match(notices, /commander/u);\n});\n\ntest(\n 'a copied plugin has a real CLI and producer identity that existing admission can bind',\n { tags: ['release'] },\n () => {\n const directory = realpathSync(mkdtempSync(join(tmpdir(), 'ai-delivery-native-identity-')));\n const copiedRoot = join(directory, 'plugin');\n cpSync(pluginRoot, copiedRoot, { recursive: true });\n // The validator only reads repository/configDigest. No repository config,\n // credentials, admission publication or lifecycle authority exists here.\n const configuration = {\n config: { repository: 'example/widget' },\n configDigest: `sha256:${'a'.repeat(64)}`,\n } as unknown as LoadedDeliveryConfig;\n try {\n const cliPath = join(copiedRoot, 'runtime', 'dist', 'cli.js');\n assert.equal(\n execFileSync(process.execPath, [cliPath, '--version'], { encoding: 'utf8', maxBuffer: 65536 }).trim(),\n pkg.version,\n );\n const admission = buildRuntimeAdmission({\n cliPath,\n mcpLauncherPath: join(copiedRoot, 'dist', 'mcp-launcher.js'),\n pluginManifestPath: join(copiedRoot, '.claude-plugin', 'plugin.json'),\n packageVersion: pkg.version,\n sourceArchiveSha256: `sha256:${'b'.repeat(64)}`,\n sourceCommit: '1'.repeat(40),\n configuration,\n });\n assert.equal(validateRuntimeAdmission(admission, configuration, cliPath).admissionId, admission.admissionId);\n assert.match(\n retainedWorktreeTransitionProducerDigest(join(copiedRoot, 'runtime', 'dist')),\n /^sha256:[a-f0-9]{64}$/u,\n );\n const otherRoot = join(directory, 'other');\n cpSync(copiedRoot, otherRoot, { recursive: true });\n assert.throws(() =>\n validateRuntimeAdmission(admission, configuration, join(otherRoot, 'runtime', 'dist', 'cli.js')),\n );\n writeFileSync(cliPath, `${readFileSync(cliPath, 'utf8')}\\n/* altered runtime */\\n`);\n assert.throws(() => validateRuntimeAdmission(admission, configuration, cliPath));\n } finally {\n rmSync(directory, { recursive: true, force: true });\n }\n },\n);\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,cAAc,iBAAiB;AACx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AAc,UAAU,IAAI,OAAO,EAAE,CAAC;AAAA,IACxC;AACA,QAAI;AACF,YAAM,UAAU,KAAK,YAAY,WAAW,QAAQ,QAAQ;AAC5D,aAAO;AAAA,QACL,aAAa,QAAQ,UAAU,CAAC,SAAS,WAAW,GAAG,EAAE,UAAU,QAAQ,WAAW,MAAM,CAAC,EAAE,KAAK;AAAA,QACpG,IAAI;AAAA,MACN;AACA,YAAM,YAAY,sBAAsB;AAAA,QACtC;AAAA,QACA,iBAAiB,KAAK,YAAY,QAAQ,iBAAiB;AAAA,QAC3D,oBAAoB,KAAK,YAAY,kBAAkB,aAAa;AAAA,QACpE,gBAAgB,IAAI;AAAA,QACpB,qBAAqB,UAAU,IAAI,OAAO,EAAE,CAAC;AAAA,QAC7C,cAAc,IAAI,OAAO,EAAE;AAAA,QAC3B;AAAA,MACF,CAAC;AACD,aAAO,MAAM,yBAAyB,WAAW,eAAe,OAAO,EAAE,aAAa,UAAU,WAAW;AAC3G,aAAO;AAAA,QACL,yCAAyC,KAAK,YAAY,WAAW,MAAM,CAAC;AAAA,QAC5E;AAAA,MACF;AACA,YAAM,YAAY,KAAK,WAAW,OAAO;AACzC,aAAO,YAAY,WAAW,EAAE,WAAW,KAAK,CAAC;AACjD,aAAO;AAAA,QAAO,MACZ,yBAAyB,WAAW,eAAe,KAAK,WAAW,WAAW,QAAQ,QAAQ,CAAC;AAAA,MACjG;AACA,oBAAc,SAAS,GAAG,aAAa,SAAS,MAAM,CAAC;AAAA;AAAA,CAA2B;AAClF,aAAO,OAAO,MAAM,yBAAyB,WAAW,eAAe,OAAO,CAAC;AAAA,IACjF,UAAE;AACA,aAAO,WAAW,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,IACpD;AAAA,EACF;AACF;",
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { execFileSync, spawnSync } from 'node:child_process';\nimport { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';\nimport { test } from 'vitest';\n\nimport pkg from '../package.json' with { type: 'json' };\nimport { AI_DELIVERY_MCP_TOOLS } from './mcp/tools.js';\nimport { syntheticDiscoveryConfig } from './fixtures/discovery.js';\nimport { BoardReconcilePlanSchema, BoardReconcileResultSchema } from './services/boardReconcileService.js';\n\nconst packageRoot = fileURLToPath(new URL('../', import.meta.url));\nconst pluginRoot = join(packageRoot, 'plugins', 'ai-delivery');\nconst qualificationOwner = (await import(new URL('../scripts/current-qualification.mjs', import.meta.url).href)) as {\n copyReleaseArchive(\n contractPath: string,\n cwd: string,\n destination: string,\n ): { archivePath: string; archiveSha256: string };\n};\n\ntest(\n 'README and delivery skill CLI examples name supported commands and required options',\n { tags: ['release'] },\n () => {\n const cli = readFileSync(join(packageRoot, 'src', 'cli.ts'), 'utf8');\n const declarations = [...cli.matchAll(/\\.command\\('([^']+)'\\)/gu)];\n const required = new Map(\n declarations.map((match) => {\n const next = cli.indexOf('.command(', match.index + match[0].length);\n return [\n match[1]!,\n [...cli.slice(match.index, next < 0 ? undefined : next).matchAll(/\\.requiredOption\\('--([a-z0-9-]+)/gu)].map(\n (option) => `--${option[1]}`,\n ),\n ];\n }),\n );\n const globals = new Set(['--repo', '--repo-root', '--identity']);\n for (const path of [\n 'README.md',\n 'plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md',\n 'plugins/ai-delivery/skills/pr-handoff/SKILL.md',\n ]) {\n const source = readFileSync(join(packageRoot, path), 'utf8').replace(/\\\\\\r?\\n\\s*/gu, ' ');\n for (const match of source.matchAll(/^ai-delivery\\s+(.+)$/gmu)) {\n const words = match[1]!.split(/\\s+/u);\n let index = 0;\n while (globals.has(words[index] ?? '')) index += 2;\n const command = words[index]!;\n const commandPath =\n command === 'merge'\n ? words.slice(index, index + 3)\n : command === 'plugin'\n ? words.slice(index, index + 2)\n : [command];\n const help = execFileSync(process.execPath, [join(packageRoot, 'dist', 'cli.js'), ...commandPath, '--help'], {\n encoding: 'utf8',\n maxBuffer: 65536,\n });\n for (const flag of required.get(command) ?? [])\n assert.ok(words.includes(flag), `${path}: ${command} requires ${flag}`);\n for (const flag of words.filter((word) => word.startsWith('--')))\n assert.ok(globals.has(flag) || help.includes(flag), `${path}: ${command} does not support ${flag}`);\n }\n }\n },\n);\n\nfor (const launchCheckout of [false, true]) {\n test(\n `the ${launchCheckout ? 'bundled' : 'packed'} launcher creates, updates and journals repository B from ${launchCheckout ? 'checkout A' : 'a non-Git directory'} without an identity environment`,\n { tags: ['release'] },\n async () => {\n const directory = realpathSync(mkdtempSync(join(tmpdir(), 'delivery-launch-routing-')));\n let selectedPluginRoot = pluginRoot;\n let discoveryFixture = new URL('./fixtures/discovery.js', import.meta.url).href;\n if (!launchCheckout) {\n try {\n const archive = qualificationOwner.copyReleaseArchive(\n process.env.AI_DELIVERY_RELEASE_CONTRACT ?? '',\n packageRoot,\n join(directory, 'qualified.tgz'),\n );\n const unpacked = join(directory, 'unpacked');\n mkdirSync(unpacked);\n execFileSync('tar', ['-xzf', archive.archivePath, '-C', unpacked]);\n selectedPluginRoot = join(directory, 'plugin-cache');\n // Detach the packed native plugin so the launcher uses its bundled runtime,\n // rather than the package-local CLI whose npm dependencies are not installed here.\n cpSync(join(unpacked, 'package', 'plugins', 'ai-delivery'), selectedPluginRoot, { recursive: true });\n discoveryFixture = pathToFileURL(join(unpacked, 'package', 'dist', 'fixtures', 'discovery.js')).href;\n assert.equal(existsSync(join(selectedPluginRoot, 'runtime', 'dist', 'cli.js')), true);\n } catch (error) {\n rmSync(directory, { recursive: true, force: true });\n throw error;\n }\n }\n if (launchCheckout) {\n execFileSync('git', ['init', '-q', directory]);\n execFileSync('git', ['remote', 'add', 'origin', 'https://github.com/example/a.git'], { cwd: directory });\n }\n const preload = join(directory, 'mock-github.mjs');\n const calls = join(directory, 'requests.json');\n const settings = join(directory, 'user.json');\n const boardStatePath = join(directory, 'board-state.json');\n writeFileSync(boardStatePath, JSON.stringify({ member: 'ITEM17', status: 'Todo', writes: [] }));\n writeFileSync(\n settings,\n JSON.stringify({\n schemaVersion: 'ai-delivery.user@1',\n roles: {\n author: { authSource: 'personal', identity: 'operator', credentialEnv: { token: 'SYNTHETIC_TOKEN' } },\n reviewer: {\n identity: 'reviewer',\n credentialEnv: { appId: 'REVIEW_APP', installationId: 'REVIEW_INSTALL', privateKeyPath: 'REVIEW_KEY' },\n },\n },\n project: 1,\n checkoutRoots: [],\n pointsField: 'Estimate',\n priorityField: 'Urgency',\n statusField: 'Flow',\n statuses: syntheticDiscoveryConfig.native.project.statuses,\n }),\n );\n writeFileSync(\n preload,\n `\nimport {existsSync,readFileSync,writeFileSync} from 'node:fs';\nimport {syntheticDiscoveryClients} from ${JSON.stringify(discoveryFixture)};\nconst configuration=${JSON.stringify(syntheticDiscoveryConfig)};\nconst comments=[];\nconst fields=[configuration.native.points,configuration.native.priority].map(field=>({id:Number(field.databaseId),name:field.name,data_type:'single_select',options:field.values.map(name=>({name:String(name)}))}));\nlet fieldValues=[];\nlet issue={id:117,number:17,node_id:'ISSUE17',title:'Widget',body:'',state:'open',labels:[],html_url:'https://github.com/example/b/issues/17'};\nconst page=nodes=>({nodes,pageInfo:{hasNextPage:false,endCursor:null}});\nglobalThis.fetch=async(url,init)=>{\n const requests=existsSync(${JSON.stringify(calls)})?JSON.parse(readFileSync(${JSON.stringify(calls)},'utf8')):[];\n const boardState=JSON.parse(readFileSync(${JSON.stringify(boardStatePath)},'utf8'));\n const saveBoard=()=>writeFileSync(${JSON.stringify(boardStatePath)},JSON.stringify(boardState));\n const path=new URL(String(url)).pathname;const method=init?.method??'GET';\n requests.push({path,method});writeFileSync(${JSON.stringify(calls)},JSON.stringify(requests));\n const json=init?.body?JSON.parse(init.body):{};\n let data;\n if(path==='/graphql'){\n const query=json.query;\n const item=()=>({id:boardState.member,isArchived:false,project:{id:'PROJECT-1',number:1},content:{__typename:'Issue',id:'ISSUE17',number:17,repository:{nameWithOwner:'example/b'}},fieldValueByName:boardState.status===null?null:{name:'Queued',optionId:'STATUS-0'}});\n if(boardState.failDiscovery==='access'&&query.includes('DeliveryRepository'))return new Response(JSON.stringify({message:'Synthetic access denied'}),{status:403,headers:{'content-type':'application/json'}});\n if(query.includes('AddProjectDeliveryItem')){\n boardState.member='ADDED17';boardState.status='Todo';boardState.writes.push('add');\n const lost=boardState.failAddResponse;boardState.failAddResponse=false;saveBoard();\n if(lost)throw new Error('Synthetic lost add response');\n data={addProjectV2ItemById:{item:{id:boardState.member}}};\n }\n else if(query.includes('ProjectDeliveryIssueItems'))data={node:{id:json.variables.issueNodeId,projectItems:{nodes:boardState.member?[item()]:[],pageInfo:{hasNextPage:false}}}};\n else if(query.includes('ProjectDeliveryItems'))data={organization:{projectV2:{id:'PROJECT-1',number:1,items:page(boardState.member?[item()]:[])}}};\n else if(query.includes('ProjectDeliveryItemReadback'))data={node:boardState.member===json.variables.itemId?item():null};\n else if(query.includes('blockedBy('))data={repository:{issue:{id:'ISSUE17',number:17,repository:{nameWithOwner:'example/b'},parent:null,blockedBy:page([])}}};\n else if(query.includes('DeliveryIssueBranches'))data={repository:{issue:{linkedBranches:page([])}}};\n else {\n data=await syntheticDiscoveryClients({...configuration,repository:'example/'+(json.variables?.repo??'b')}).graphql(query,json.variables);\n if(boardState.failDiscovery==='pages'&&query.includes('ProjectDeliveryConfiguration')){\n if(json.variables.cursor!=null)data.organization.projectV2.fields.nodes=[];\n data.organization.projectV2.fields.pageInfo={hasNextPage:true,endCursor:'next-'+String(json.variables.cursor??'first')};\n }\n }\n return new Response(JSON.stringify({data}),{status:200,headers:{'content-type':'application/json'}});\n }\n if(path==='/user')data={id:1,login:'operator'};\n else if(path.endsWith('/issues/17/comments')){\n if(method==='POST'){\n const id=91+comments.length;\n data={id,body:json.body,html_url:'https://github.com/example/b/issues/17#issuecomment-'+id,issue_url:'https://api.github.com/repos/example/b/issues/17',user:{login:'operator'}};\n comments.push(data);\n }else data=comments;\n }\n else if(path.includes('/issues/comments/'))data=comments.find(comment=>comment.id===Number(path.split('/').at(-1)));\n else if(path.endsWith('/labels'))data=[{name:'enhancement'},{name:'bug'}];\n else if(path==='/repos/example/b/issues/17/sub_issues'&&method==='GET')data=[];\n else if(path.endsWith('/issue-fields'))data=fields;\n else if(path.endsWith('/issue-field-values')){\n if(method==='POST')fieldValues=json.issue_field_values.map(entry=>({issue_field_id:entry.field_id,issue_field_name:fields.find(field=>field.id===entry.field_id).name,data_type:'single_select',value:entry.value}));\n data=fieldValues;\n }\n else if(path.endsWith('/issues')&&method==='POST'){issue={...issue,...json};data=issue;}\n else if(path.endsWith('/issues')&&method==='GET')data=[issue];\n else if(path.endsWith('/sub_issues'))data=[];\n else if(path.endsWith('/issues/17')){if(method==='PATCH')issue={...issue,...json};data=issue;}\n else throw new Error('Unexpected synthetic request '+method+' '+path);\n return new Response(JSON.stringify(data),{status:200,headers:{'content-type':'application/json'}});\n};\n`,\n );\n const transport = new StdioClientTransport({\n command: process.execPath,\n args: [join(selectedPluginRoot, 'dist', 'mcp-launcher.js')],\n cwd: directory,\n env: {\n PATH: process.env.PATH ?? '',\n TMPDIR: tmpdir(),\n HOME: directory,\n AI_DELIVERY_CONFIG: settings,\n SYNTHETIC_TOKEN: 'inert-personal-token',\n NODE_OPTIONS: `--v8-pool-size=1 --import=${preload}`,\n },\n stderr: 'pipe',\n });\n const client = new Client({ name: 'actual-launch-routing', version: '1' });\n try {\n await client.connect(transport, { timeout: 30000 });\n const readyInput = {\n repo: 'example/b',\n title: 'Validate widget launch routing across repositories',\n points: 2,\n problem: 'A launcher can bind a widget issue to the checkout repository instead of the explicit caller.',\n outcome: 'Create and update the issue only in explicitly selected repository B.',\n acceptanceCriteria: [\n {\n behavior: 'Create, update and journal requests address repository B with zero repository A requests.',\n verifiedBy: 'Packaged stdio client results and captured REST path assertions.',\n },\n ],\n outOfScope: ['Live authentication and host configuration.'],\n };\n const created = await client.callTool({\n name: 'issue_create',\n arguments: { ...readyInput, labels: ['enhancement'] },\n });\n assert.equal(created.isError, undefined, JSON.stringify(created));\n const updated = await client.callTool({\n name: 'issue_update',\n arguments: { repo: 'example/b', issueNumber: 17, labels: ['bug'] },\n });\n assert.equal(updated.isError, undefined, JSON.stringify(updated));\n const common = {\n repo: 'example/b',\n issueNumber: 17,\n summary: 'Packed journal validation works.',\n status: 'In progress',\n nextStep: 'Independent review',\n nextDate: '2026-10-09',\n keyNumbers: ['5 journal kinds'],\n evidence: ['https://github.com/example/b/issues/17'],\n };\n const journals = [\n { ...common, kind: 'start', outcome: 'Deliver strict validation' },\n { ...common, kind: 'progress', done: ['Added regression'], decisionNeeded: 'None' },\n { ...common, kind: 'decision', decision: 'Keep variants strict', rationale: 'Preserve the contract' },\n { ...common, kind: 'blocker', blocker: 'Review pending', resolution: 'Independent acceptance' },\n {\n ...common,\n kind: 'closeout',\n acceptance: [{ criterion: 'Explicit repo works', evidence: common.evidence[0] }],\n followUps: [],\n },\n ];\n const decoded = (response: unknown) =>\n JSON.parse((response as { content: { text: string }[] }).content[0]!.text) as {\n commentId: number;\n url: string;\n body: string;\n reused: boolean;\n };\n for (const [index, journal] of journals.entries()) {\n const response = await client.callTool({ name: 'issue_comment', arguments: { ...journal, verbose: true } });\n assert.equal(response.isError, undefined, JSON.stringify(response));\n const readback = decoded(response);\n assert.equal(readback.commentId, 91 + index);\n assert.equal(readback.url, `https://github.com/example/b/issues/17#issuecomment-${String(91 + index)}`);\n assert.equal(readback.body.split('\\n')[2], common.summary);\n assert.ok(readback.body.includes(`**Kind:** ${journal.kind}.`));\n assert.match(readback.body, /<!-- ai-delivery:journal@1:sha256:[a-f0-9]{64} -->$/u);\n assert.equal(readback.reused, false);\n }\n const retried = await client.callTool({ name: 'issue_comment', arguments: journals[1]! });\n assert.equal(retried.isError, undefined, JSON.stringify(retried));\n assert.equal(decoded(retried).commentId, 92);\n assert.equal(decoded(retried).reused, true);\n const beforeInvalidRequests = (JSON.parse(readFileSync(calls, 'utf8')) as unknown[]).length;\n for (const invalid of [\n { ...journals[1], unknown: true },\n { ...journals[1], outcome: 'Wrong variant' },\n { ...journals[1], kind: 'unsupported' },\n { ...journals[1], nextDate: '2026-02-30' },\n { ...journals[1], 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 assert.equal(\n (JSON.parse(readFileSync(calls, 'utf8')) as unknown[]).length,\n beforeInvalidRequests,\n 'invalid packed journals never reach configuration discovery, author authentication or writes',\n );\n const unknown = await client.callTool({\n name: 'issue_create',\n arguments: { ...readyInput, labels: ['missing-label'] },\n });\n assert.equal(unknown.isError, true);\n assert.match(JSON.stringify(unknown), /Unknown repository label.*missing-label/u);\n // Exercise the actual bundled coordinator and CLI against the same synthetic provider state.\n const boardValue = async (arguments_: Record<string, unknown>) => {\n const response = await client.callTool({ name: 'board_reconcile', arguments: arguments_ });\n assert.equal(response.isError, undefined, JSON.stringify(response));\n return JSON.parse((response.content as { text: string }[])[0]!.text) as unknown;\n };\n const boardEnv = {\n PATH: process.env.PATH ?? '',\n TMPDIR: tmpdir(),\n HOME: directory,\n AI_DELIVERY_CONFIG: settings,\n SYNTHETIC_TOKEN: 'inert-personal-token',\n NODE_OPTIONS: `--v8-pool-size=1 --import=${preload}`,\n };\n const activeCli = launchCheckout\n ? join(packageRoot, 'dist', 'cli.js')\n : join(selectedPluginRoot, 'runtime', 'dist', 'cli.js');\n const boardCli = (...args: string[]) =>\n spawnSync(process.execPath, [activeCli, 'board:reconcile', '--repositories', 'example/b', ...args], {\n cwd: directory,\n env: boardEnv,\n encoding: 'utf8',\n maxBuffer: 32 * 1024 * 1024,\n });\n writeFileSync(\n boardStatePath,\n JSON.stringify({ member: null, status: null, writes: [], failAddResponse: true }),\n );\n const plan = BoardReconcilePlanSchema.parse(await boardValue({ repositories: ['example/b'] }));\n assert.equal(plan.scopeComplete, true);\n assert.equal(plan.operations.length, 1);\n assert.equal(plan.operations[0]!.kind, 'add-membership');\n const rootLibrary = spawnSync(\n process.execPath,\n [\n '--input-type=module',\n '-e',\n `import {executeTool} from ${JSON.stringify(pathToFileURL(join(packageRoot, 'dist', 'agent.js')).href)};console.log(JSON.stringify(await executeTool('board_reconcile',{repositories:['example/b']},{repoRoot:process.cwd()})));`,\n ],\n { cwd: directory, env: boardEnv, encoding: 'utf8', maxBuffer: 32 * 1024 * 1024 },\n );\n assert.equal(rootLibrary.status, 0, rootLibrary.stderr);\n const rootPlan = BoardReconcilePlanSchema.parse(JSON.parse(rootLibrary.stdout));\n assert.equal(rootPlan.packageIdentity!.packageVersion, plan.packageIdentity!.packageVersion);\n assert.deepEqual(rootPlan.scope, plan.scope);\n assert.deepEqual(rootPlan.operations, plan.operations);\n if (!launchCheckout) {\n assert.notDeepEqual(rootPlan.packageIdentity, plan.packageIdentity);\n const crossArtifact = BoardReconcileResultSchema.parse(\n await boardValue({ repositories: rootPlan.scope, mode: 'apply', plan: rootPlan }),\n );\n assert.equal(crossArtifact.summary.applied, 0);\n assert.equal(crossArtifact.summary.refused, 1);\n } else assert.deepEqual(rootPlan.packageIdentity, plan.packageIdentity);\n const interrupted = BoardReconcileResultSchema.parse(\n await boardValue({ repositories: plan.scope, mode: 'apply', plan }),\n );\n assert.equal(interrupted.summary.unknown, 1);\n assert.equal(interrupted.operations[0]!.attempted, true);\n const planFile = join(directory, 'plan.json'),\n priorFile = join(directory, 'prior-result.json');\n writeFileSync(planFile, JSON.stringify(plan));\n writeFileSync(priorFile, JSON.stringify(interrupted));\n const resumedCli = boardCli('--apply', '--plan-file', planFile, '--prior-result-file', priorFile);\n assert.equal(resumedCli.status, 1, resumedCli.stderr);\n const resumed = BoardReconcileResultSchema.parse(JSON.parse(resumedCli.stdout));\n assert.equal(resumed.summary.applied, 0);\n assert.equal(resumed.summary.satisfied, 1);\n assert.equal(resumed.operations[0]!.priorEvidence.at(-1)!.outcome, 'unknown');\n assert.equal(resumed.summary.unresolved, 1);\n assert.deepEqual((JSON.parse(readFileSync(boardStatePath, 'utf8')) as { writes: string[] }).writes, ['add']);\n writeFileSync(boardStatePath, JSON.stringify({ member: null, status: null, writes: [] }));\n const partialCli = boardCli('--apply', '--plan-file', planFile);\n assert.equal(partialCli.status, 1, partialCli.stderr);\n const applied = BoardReconcileResultSchema.parse(JSON.parse(partialCli.stdout));\n assert.equal(applied.summary.applied, 1);\n assert.equal(applied.operations[0]!.readback!.itemId, 'ADDED17');\n const historical = structuredClone(applied);\n historical.operations[0]!.outcome = 'unknown';\n historical.summary.applied = 0;\n historical.summary.unknown = 1;\n writeFileSync(priorFile, JSON.stringify(historical));\n const emptyPlan = BoardReconcilePlanSchema.parse(await boardValue({ repositories: ['example/b'] }));\n assert.equal(emptyPlan.operations.length, 0);\n for (const failure of ['pages', 'access']) {\n writeFileSync(\n boardStatePath,\n JSON.stringify({ member: 'ADDED17', status: 'Todo', writes: ['add'], failDiscovery: failure }),\n );\n for (const value of [\n await boardValue({ repositories: plan.scope, mode: 'apply', plan, priorResult: historical }),\n ...(() => {\n const result = boardCli('--apply', '--plan-file', planFile, '--prior-result-file', priorFile);\n assert.equal(result.status, 1, result.stderr);\n return [JSON.parse(result.stdout) as unknown];\n })(),\n ]) {\n const result = BoardReconcileResultSchema.parse(value);\n assert.equal(result.scopeComplete, false);\n assert.equal(result.planId, plan.planId);\n assert.equal(result.summary.applied, 0);\n assert.equal(result.summary.satisfied, 0);\n assert.equal(result.operations[0]!.attempted, false);\n assert.equal(result.operations[0]!.operationId, plan.operations[0]!.operationId);\n assert.ok(result.operations[0]!.knownItemIds.includes('ADDED17'));\n assert.deepEqual(result.operations[0]!.priorEvidence.at(-1)!.readback, historical.operations[0]!.readback);\n if (failure === 'pages') assert.equal(result.gaps[0]!.pagesRequested, 20);\n }\n const dry = boardCli('--dry-run');\n assert.equal(dry.status, 1, dry.stderr);\n assert.equal(BoardReconcilePlanSchema.parse(JSON.parse(dry.stdout)).scopeComplete, false);\n const empty = BoardReconcileResultSchema.parse(\n await boardValue({ repositories: emptyPlan.scope, mode: 'apply', plan: emptyPlan }),\n );\n assert.equal(empty.scopeComplete, false);\n assert.deepEqual(empty.operations, []);\n }\n writeFileSync(boardStatePath, JSON.stringify({ member: 'ADDED17', status: 'Todo', writes: ['add'] }));\n const completeDry = boardCli('--dry-run');\n assert.equal(completeDry.status, 0, completeDry.stderr);\n assert.equal(BoardReconcilePlanSchema.parse(JSON.parse(completeDry.stdout)).scopeComplete, true);\n const requests = JSON.parse(readFileSync(calls, 'utf8')) as Array<{ path: string; method: string }>;\n assert.equal(\n requests.some((call) => call.path.startsWith('/repos/example/a/')),\n false,\n );\n assert.equal(requests.filter((call) => call.path.endsWith('/issues') && call.method === 'POST').length, 1);\n assert.equal(\n requests.filter((call) => call.path.endsWith('/issues/17/comments') && call.method === 'POST').length,\n 5,\n 'five authored journals read back; retry adds no sixth write',\n );\n assert.equal(existsSync(join(directory, '.issue-cli')), false);\n } finally {\n await client.close();\n await transport.close();\n rmSync(directory, { recursive: true, force: true });\n }\n },\n );\n}\n\ntest('CLI reports the selected package version', { tags: ['release'] }, () => {\n const displayed = execFileSync(process.execPath, [join(packageRoot, 'dist', 'cli.js'), '--version'], {\n encoding: 'utf8',\n maxBuffer: 65536,\n }).trim();\n assert.equal(displayed, pkg.version);\n});\n\ntest('portable and Claude plugin metadata bind the same package and launcher', () => {\n const portable = JSON.parse(readFileSync(join(pluginRoot, 'plugin.json'), 'utf8')) as {\n $schema: string;\n name: string;\n version: string;\n };\n const claude = JSON.parse(readFileSync(join(pluginRoot, '.claude-plugin', 'plugin.json'), 'utf8')) as {\n name: string;\n version: string;\n packageVersion: string;\n deliveryCapabilityVersion: number;\n };\n assert.equal(portable.$schema, 'https://agent-plugins.org/schemas/1.0.0/plugin.schema.json');\n assert.equal(portable.name, 'ai-delivery');\n assert.equal(portable.version, pkg.version);\n assert.equal(claude.name, portable.name);\n assert.equal(claude.version, pkg.version);\n assert.equal(claude.packageVersion, pkg.version);\n assert.equal(claude.deliveryCapabilityVersion, 2);\n const mcp = JSON.parse(readFileSync(join(pluginRoot, 'mcp.json'), 'utf8')) as {\n $schema: string;\n mcpServers: Record<string, { type: string; command: string; args: string[] }>;\n };\n assert.equal(mcp.$schema, 'https://agent-plugins.org/schemas/1.0.0/mcp.schema.json');\n assert.deepEqual(mcp.mcpServers['ai-delivery'], {\n type: 'stdio',\n command: 'node',\n args: ['${PLUGIN_ROOT}/dist/mcp-launcher.js'],\n });\n});\n\ntest(\n 'a copied plugin root starts its exact MCP contract without a parent runtime installation',\n { tags: ['release'] },\n async () => {\n const directory = mkdtempSync(join(tmpdir(), 'ai-delivery-plugin-cache-'));\n const copiedRoot = join(directory, 'plugin');\n cpSync(pluginRoot, copiedRoot, { recursive: true });\n const transport = new StdioClientTransport({\n command: process.execPath,\n args: [join(copiedRoot, 'dist', 'mcp-launcher.js')],\n cwd: copiedRoot,\n env: { PATH: process.env.PATH ?? '', TMPDIR: tmpdir(), NODE_OPTIONS: '--max-old-space-size=2048' },\n stderr: 'pipe',\n maxBufferSize: 1024 * 1024,\n });\n const client = new Client({ name: 'isolated-plugin-cache-test', version: '1.0.0' });\n let pid: number | null = null;\n try {\n await client.connect(transport, { timeout: 30000 });\n pid = transport.pid;\n assert.equal(client.getServerVersion()?.version, pkg.version);\n const instructions = client.getInstructions();\n assert.equal(typeof instructions, 'string', 'the copied native plugin must retain initialize guidance');\n assert.match(instructions ?? '', /\\brepo\\b/u);\n assert.match(instructions ?? '', /\\bissue_info\\b/u);\n const result = await client.listTools({}, { timeout: 30000 });\n const issueInfo = result.tools.find((tool) => tool.name === 'issue_info');\n assert.ok(issueInfo);\n const properties = issueInfo.inputSchema.properties as Record<string, { description?: string }>;\n assert.equal(typeof properties.repo?.description, 'string');\n assert.deepEqual(\n result.tools.map((tool) => tool.name).sort(),\n AI_DELIVERY_MCP_TOOLS.map((tool) => tool.name).sort(),\n );\n assert.equal(existsSync(join(copiedRoot, '.issue-cli')), false);\n } finally {\n await client.close();\n await transport.close();\n const ownedPid = pid;\n try {\n if (ownedPid !== null) assert.throws(() => process.kill(ownedPid, 0), { code: 'ESRCH' });\n } finally {\n rmSync(directory, { recursive: true, force: true });\n }\n }\n },\n);\n\ntest('standalone plugin ships application and bundled dependency notices', () => {\n assert.equal(readFileSync(join(pluginRoot, 'LICENSE'), 'utf8'), readFileSync(join(packageRoot, 'LICENSE'), 'utf8'));\n const notices = readFileSync(join(pluginRoot, 'runtime', 'dist', 'THIRD-PARTY-NOTICES.md'), 'utf8');\n assert.match(notices, /@modelcontextprotocol\\/sdk/u);\n assert.match(notices, /commander/u);\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,cAAc,iBAAiB;AACxC,SAAS,QAAQ,YAAY,WAAW,aAAa,cAAc,cAAc,QAAQ,qBAAqB;AAC9G,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,eAAe,qBAAqB;AAC7C,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,YAAY;AAErB,OAAO,SAAS,kBAAkB,KAAK,EAAE,MAAM,OAAO;AACtD,SAAS,6BAA6B;AACtC,SAAS,gCAAgC;AACzC,SAAS,0BAA0B,kCAAkC;AAErE,MAAM,cAAc,cAAc,IAAI,IAAI,OAAO,YAAY,GAAG,CAAC;AACjE,MAAM,aAAa,KAAK,aAAa,WAAW,aAAa;AAC7D,MAAM,qBAAsB,MAAM,OAAO,IAAI,IAAI,wCAAwC,YAAY,GAAG,EAAE;AAQ1G;AAAA,EACE;AAAA,EACA,EAAE,MAAM,CAAC,SAAS,EAAE;AAAA,EACpB,MAAM;AACJ,UAAM,MAAM,aAAa,KAAK,aAAa,OAAO,QAAQ,GAAG,MAAM;AACnE,UAAM,eAAe,CAAC,GAAG,IAAI,SAAS,0BAA0B,CAAC;A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G,MAAM,GAAG,aAAa,KAAK,aAAa,SAAS,GAAG,MAAM,CAAC;AAClH,QAAM,UAAU,aAAa,KAAK,YAAY,WAAW,QAAQ,wBAAwB,GAAG,MAAM;AAClG,SAAO,MAAM,SAAS,6BAA6B;AACnD,SAAO,MAAM,SAAS,YAAY;AACpC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/pr.d.ts
CHANGED
|
@@ -207,59 +207,4 @@ export declare function submitFormalReview(context: DeliveryContext, input: {
|
|
|
207
207
|
receiptId: string;
|
|
208
208
|
requiredReview: RequiredReviewState;
|
|
209
209
|
}>;
|
|
210
|
-
export declare function mergePr(context: DeliveryContext, input: {
|
|
211
|
-
issueNumber: number;
|
|
212
|
-
prNumber: number;
|
|
213
|
-
strategy?: 'merge' | 'squash' | 'rebase';
|
|
214
|
-
reviewedHeadSha?: string;
|
|
215
|
-
dryRun?: boolean;
|
|
216
|
-
nonClosing?: boolean;
|
|
217
|
-
}, queue?: {
|
|
218
|
-
expectedBase: string;
|
|
219
|
-
checkProof(): Promise<void>;
|
|
220
|
-
beforeMutation(): Promise<void>;
|
|
221
|
-
}): Promise<{
|
|
222
|
-
mergeSha: string;
|
|
223
|
-
headSha: string;
|
|
224
|
-
reused: boolean;
|
|
225
|
-
} | {
|
|
226
|
-
mergeSha?: never;
|
|
227
|
-
reused?: never;
|
|
228
|
-
commit_title?: string;
|
|
229
|
-
commit_message?: string;
|
|
230
|
-
dryRun: boolean;
|
|
231
|
-
headSha: string;
|
|
232
|
-
prNumber: number;
|
|
233
|
-
nonClosing?: boolean;
|
|
234
|
-
}>;
|
|
235
|
-
export declare function finishIssue(context: DeliveryContext, input: {
|
|
236
|
-
issueNumber: number;
|
|
237
|
-
prNumber: number;
|
|
238
|
-
strategy?: 'merge' | 'squash' | 'rebase';
|
|
239
|
-
reviewedHeadSha?: string;
|
|
240
|
-
dryRun?: boolean;
|
|
241
|
-
nonClosing?: boolean;
|
|
242
|
-
}): Promise<{
|
|
243
|
-
mergeSha: string;
|
|
244
|
-
headSha: string;
|
|
245
|
-
reused: boolean;
|
|
246
|
-
} | {
|
|
247
|
-
mergeSha?: never;
|
|
248
|
-
reused?: never;
|
|
249
|
-
commit_title?: string;
|
|
250
|
-
commit_message?: string;
|
|
251
|
-
dryRun: boolean;
|
|
252
|
-
headSha: string;
|
|
253
|
-
prNumber: number;
|
|
254
|
-
nonClosing?: boolean;
|
|
255
|
-
} | {
|
|
256
|
-
mergeSha: string;
|
|
257
|
-
headSha: string;
|
|
258
|
-
reused: boolean;
|
|
259
|
-
issueClosed: boolean;
|
|
260
|
-
cleanup: {
|
|
261
|
-
status: 'absent' | 'removed' | 'retained';
|
|
262
|
-
reason?: string;
|
|
263
|
-
};
|
|
264
|
-
}>;
|
|
265
210
|
export { startIssueBranch };
|