@aviaratech/ai-delivery 0.3.41 → 0.3.43
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 +7 -1
- package/dist/agentReadiness.test.js +15 -0
- package/dist/agentReadiness.test.js.map +2 -2
- package/dist/callerErrors.test.js +11 -1
- package/dist/callerErrors.test.js.map +2 -2
- package/dist/contributorChecks.test.js +4 -1
- package/dist/contributorChecks.test.js.map +2 -2
- package/dist/currentConsumer.test.js +3 -2
- package/dist/currentConsumer.test.js.map +2 -2
- package/dist/currentTrackingScenario.test.js +3 -2
- package/dist/currentTrackingScenario.test.js.map +2 -2
- package/dist/fixtures/builderReady.d.ts +82 -0
- package/dist/fixtures/builderReady.js +56 -0
- package/dist/fixtures/builderReady.js.map +7 -0
- package/dist/fixtures/inertTarget.d.ts +75 -0
- package/dist/fixtures/inertTarget.js +20 -15
- package/dist/fixtures/inertTarget.js.map +2 -2
- package/dist/fixtures/issue63.d.ts +96 -0
- package/dist/fixtures/issue63.js +21 -2
- package/dist/fixtures/issue63.js.map +2 -2
- package/dist/fixtures/readView.d.ts +9 -1
- package/dist/fixtures/readView.js +4 -0
- package/dist/fixtures/readView.js.map +2 -2
- package/dist/issue.d.ts +2 -2
- package/dist/issue.js +96 -27
- package/dist/issue.js.map +2 -2
- package/dist/issue63Routes.test.js +3 -3
- package/dist/issue63Routes.test.js.map +2 -2
- package/dist/issueBlockerGuard.test.js +5 -5
- package/dist/issueBlockerGuard.test.js.map +2 -2
- package/dist/issueContract.d.ts +242 -2
- package/dist/issueContract.js +147 -28
- package/dist/issueContract.js.map +2 -2
- package/dist/issueContract.test.d.ts +20 -0
- package/dist/issueContract.test.js +210 -13
- package/dist/issueContract.test.js.map +2 -2
- package/dist/issueDates.test.js +5 -6
- package/dist/issueDates.test.js.map +2 -2
- package/dist/issueInfoReadback.test.js +144 -7
- package/dist/issueInfoReadback.test.js.map +2 -2
- package/dist/issueIntake.test.js +201 -33
- package/dist/issueIntake.test.js.map +2 -2
- package/dist/issueJournal.js +4 -2
- package/dist/issueJournal.js.map +2 -2
- package/dist/issueJournal.test.js +22 -0
- package/dist/issueJournal.test.js.map +2 -2
- package/dist/issueTracking.test.js +4 -1
- package/dist/issueTracking.test.js.map +2 -2
- package/dist/issueWriteRecovery.test.js +12 -12
- package/dist/issueWriteRecovery.test.js.map +2 -2
- package/dist/mcp/index.js +3 -3
- package/dist/mcp/index.js.map +2 -2
- package/dist/mcp/tools.d.ts +155 -5
- package/dist/mcp/tools.js +136 -103
- package/dist/mcp/tools.js.map +2 -2
- package/dist/pluginPackaging.test.js +6 -3
- package/dist/pluginPackaging.test.js.map +2 -2
- package/dist/pr.d.ts +2 -0
- package/dist/pr.js +28 -3
- package/dist/pr.js.map +2 -2
- package/dist/pr.test.js +0 -7
- package/dist/pr.test.js.map +2 -2
- package/dist/prAssociation.test.js +82 -9
- package/dist/prAssociation.test.js.map +2 -2
- package/dist/projectNumbers.test.js +1 -1
- package/dist/projectNumbers.test.js.map +1 -1
- package/dist/readView.d.ts +32 -3
- package/dist/readView.js +29 -12
- package/dist/readView.js.map +2 -2
- package/dist/readView.test.js +63 -1
- package/dist/readView.test.js.map +2 -2
- package/dist/releaseWorkflow.test.js +2 -2
- package/dist/releaseWorkflow.test.js.map +2 -2
- package/dist/review.d.ts +8 -0
- package/dist/review.js +30 -2
- package/dist/review.js.map +2 -2
- package/dist/review.test.js +64 -1
- package/dist/review.test.js.map +2 -2
- package/dist/services/agentReadinessService.d.ts +2 -1
- package/dist/services/agentReadinessService.js +6 -0
- package/dist/services/agentReadinessService.js.map +2 -2
- package/dist/stdoutRegression.test.js +27 -15
- package/dist/stdoutRegression.test.js.map +2 -2
- package/dist/targetPolicyEntrypoints.test.js +1 -1
- package/dist/targetPolicyEntrypoints.test.js.map +2 -2
- package/dist/targetPolicyRoutes.test.js +1 -1
- package/dist/targetPolicyRoutes.test.js.map +2 -2
- package/dist/targetRepositoryExecution.test.js +11 -3
- package/dist/targetRepositoryExecution.test.js.map +2 -2
- package/dist/toolOutput.test.js +14 -0
- package/dist/toolOutput.test.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 +130 -124
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/intake-create/SKILL.md +1 -11
- package/plugins/ai-delivery/skills/ticket-design/SKILL.md +29 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/issueWriteRecovery.test.ts"],
|
|
4
|
-
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { test } from 'vitest';\nimport { createIssue, CreatedTrackingIssueError, canonicalIssueBody } from './issue.js';\nimport { issue63Fixture } from './fixtures/issue63.js';\nimport { parseIssueBody, validateIssue } from './issueContract.js';\nimport { inertTarget, fixtureFields } from './fixtures/inertTarget.js';\n\nfunction fixture() {\n const f = issue63Fixture();\n let parent: number | null = null;\n let parentCleared = false;\n const nativeValues = new Map<number, Record<string, string>>();\n const rest = f.context.clients.rest;\n const originalRequest = rest.request.bind(rest);\n const originalGraphql = f.context.clients.graphql;\n const recovery = { member: false, failProject: false, lostCreateResponse: false };\n rest.paginate = (async () => (parent === 19 ? [f.rows.get(20)!] : [])) as unknown as typeof rest.paginate;\n rest.issues.addSubIssue = (async () => {\n f.writes.push('parent');\n parent = 19;\n return { data: {} };\n }) as unknown as typeof rest.issues.addSubIssue;\n rest.request = (async (\n route: string,\n args: { issue_number?: number; issue_field_values?: { field_id: number; value: string }[] },\n ) => {\n if (route.includes('/orgs/')) {\n const result = await originalRequest(route, args);\n return { data: [...(result.data as unknown[]), { id: 103, name: 'Start date', data_type: 'date' }] };\n }\n if (args.issue_number === 20) {\n const values = nativeValues.get(20)!;\n if (route.startsWith('POST')) {\n f.writes.push('metadata');\n for (const field of args.issue_field_values ?? []) values[String(field.field_id)] = field.value;\n }\n return {\n data: Object.entries(values).map(([id, value]) => ({\n issue_field_id: Number(id),\n issue_field_name: id === '101' ? 'Estimate' : id === '102' ? 'Urgency' : 'Start date',\n data_type: id === '103' ? 'date' : 'single_select',\n value,\n })),\n };\n }\n if (route.startsWith('DELETE')) {\n parentCleared = true;\n return { data: [] };\n }\n if (parentCleared && args.issue_number === 19) return { data: [] };\n return originalRequest(route, args);\n }) as typeof rest.request;\n f.context.clients.graphql = (async (query: string, variables: Record<string, unknown>) => {\n if (query.includes('AddProjectDeliveryItem')) {\n recovery.member = true;\n f.writes.push('membership');\n return { addProjectV2ItemById: { item: { id: 'ITEM20' } } };\n }\n if (query.includes('UpdateProjectDeliveryStatus') && recovery.failProject)\n throw new Error('Synthetic Project write failure');\n const result = (await originalGraphql(query, variables)) as {\n repository: { issue: { parent: unknown; blockedBy: { nodes: { number: number; state: string }[] } } };\n node: { projectItems: { nodes: { id: string }[] } };\n };\n if (query.includes('ProjectDeliveryIssueItems') && !recovery.member)\n result.node.projectItems.nodes = result.node.projectItems.nodes.filter((row) => row.id !== 'ITEM20');\n if (query.includes('blockedBy(first:'))\n for (const blocker of result.repository.issue.blockedBy.nodes)\n blocker.state = f.rows.get(blocker.number)!.state.toUpperCase();\n if (query.includes('blockedBy(first:') && variables.number === 20 && parent !== null)\n result.repository.issue.parent = {\n id: 'ISSUE19',\n number: parent,\n repository: { nameWithOwner: 'example/widget' },\n };\n return result;\n }) as typeof originalGraphql;\n const originalCreate = rest.issues.create.bind(rest.issues);\n rest.issues.create = (async (input: Parameters<typeof originalCreate>[0]) => {\n const result = await originalCreate(input);\n Object.assign(f.rows.get(result.data.number)!, { user: { login: 'operator' } });\n nativeValues.set(result.data.number, {});\n if (recovery.lostCreateResponse) throw new Error('Synthetic lost creation response');\n return result;\n }) as typeof rest.issues.create;\n return { ...f, recovery, nativeValues, parent: () => parent };\n}\n\nconst intent = { opId: 'synthetic-187', parentIssueNumber: 19, blockedBy: [18] };\n\ntest('create establishes Project status before parent and blockers and reuses completed opId', async () => {\n const f = fixture();\n const input = { ...f.ready, ...intent };\n const result = await createIssue(f.context, input);\n assert.equal(result.created.number, 20);\n assert.equal(f.parent(), 19);\n assert.deepEqual([...f.edges.get(20)!], [18]);\n assert.ok(f.writes.indexOf('membership') < f.writes.indexOf('status'));\n assert.ok(f.writes.indexOf('status') < f.writes.indexOf('parent'));\n const writes = [...f.writes];\n await createIssue(f.context, input);\n assert.equal(f.writes.filter((x) => x === 'create').length, 1);\n assert.deepEqual(f.writes, writes, 'a completed retry must not repeat native writes');\n});\n\ntest('same opId completes a failed dependency step once and identifies remaining work', async () => {\n const f = fixture();\n f.controls.failAdd = true;\n const input = { ...f.ready, ...intent };\n await assert.rejects(createIssue(f.context, input), (error) => {\n assert.ok(error instanceof CreatedTrackingIssueError);\n assert.equal(error.created.number, 20);\n assert.match(error.message, /blockers/u);\n assert.match(error.message, /opId/u);\n return true;\n });\n f.controls.failAdd = false;\n await createIssue(f.context, input);\n assert.equal(f.writes.filter((x) => x === 'create').length, 1);\n assert.equal(f.writes.filter((x) => x === 'parent').length, 1);\n assert.equal(f.writes.filter((x) => x === 'add').length, 1);\n});\n\ntest('opId refuses changed intent, duplicate markers and foreign authors without writes', async () => {\n for (const mode of ['intent', 'duplicate', 'author'] as const) {\n const f = fixture();\n const input = { ...f.ready, ...intent };\n await createIssue(f.context, input);\n if (mode === 'duplicate') f.rows.set(21, { ...f.rows.get(20)!, number: 21 });\n if (mode === 'author') Object.assign(f.rows.get(20)!, { user: { login: 'someone-else' } });\n const writes = [...f.writes];\n await assert.rejects(\n createIssue(f.context, { ...input, ...(mode === 'intent' ? { priority: 'High' } : {}) }),\n /conflict|author/iu,\n );\n assert.deepEqual(f.writes, writes);\n }\n});\n\ntest('epic true is an unsized Ready contract and survives canonical roundtrip', () => {\n const f = fixture();\n const { points: _points, ...ready } = f.ready;\n const result = validateIssue({ ...ready, issueType: 'Feature', epic: true }, true);\n assert.equal(result.failures.length, 0, JSON.stringify(result.failures));\n assert.ok(result.issue);\n // Canonical body generation must not force an epic to become a parked draft.\n const input = { ...ready, issueType: 'Feature', epic: true as const };\n const body = canonicalIssueBody(input);\n assert.match(body, /## Status\\n\\nReady/u);\n assert.doesNotMatch(body, /Draft \u2014 parked/u);\n assert.equal(Reflect.get(parseIssueBody(body, { title: ready.title }).issue, 'epic'), true);\n assert.equal(\n validateIssue(ready, true).failures.some((x) => x.code === 'points'),\n true,\n );\n});\n\ntest.each(['project', 'acknowledgement'] as const)(\n 'same opId resumes after %s failure without another issue',\n async (stage) => {\n const f = fixture();\n const input = { ...f.ready, ...intent };\n f.recovery.failProject = stage === 'project';\n f.recovery.lostCreateResponse = stage === 'acknowledgement';\n await assert.rejects(\n createIssue(f.context, input),\n stage === 'project' ? /Failed step: project/u : /lost creation response/u,\n );\n f.recovery.failProject = false;\n f.recovery.lostCreateResponse = false;\n await createIssue(f.context, input);\n assert.equal(f.writes.filter((x) => x === 'create').length, 1);\n assert.equal(f.writes.filter((x) => x === 'membership').length, 1);\n assert.equal(f.parent(), 19);\n assert.deepEqual([...f.edges.get(20)!], [18]);\n },\n);\n\ntest.each(['completed', 'partial'] as const)(\n 'create retry preserves independently changed native values after %s operation',\n async (stage) => {\n for (const [field, value] of [\n ['101', '4'],\n ['102', 'Low'],\n ['103', '2026-02-02'],\n ] as const) {\n const f = fixture();\n const input = { ...f.ready, ...intent, priority: 'High', startDate: '2026-01-01' };\n f.controls.failAdd = stage === 'partial';\n if (stage === 'partial') await assert.rejects(createIssue(f.context, input));\n else await createIssue(f.context, input);\n f.controls.failAdd = false;\n f.nativeValues.get(20)![field] = value;\n const writes = [...f.writes];\n await assert.rejects(createIssue(f.context, input), /conflict/iu);\n assert.equal(f.nativeValues.get(20)![field], value);\n assert.deepEqual(f.writes, writes);\n }\n },\n);\n\ntest('partial create reports only the requested remaining operations', async () => {\n const f = fixture();\n f.recovery.failProject = true;\n await assert.rejects(createIssue(f.context, { ...f.ready, opId: 'synthetic-simple' }), (error) => {\n assert.ok(error instanceof CreatedTrackingIssueError);\n assert.deepEqual(error.remainingSteps, ['project', 'readback']);\n return true;\n });\n});\n\ntest('same opId preserves independently added closed blocker relationships', async () => {\n const f = fixture();\n const input = { ...f.ready, ...intent };\n await createIssue(f.context, input);\n f.rows.get(19)!.state = 'closed';\n f.edges.get(20)!.add(19);\n const writes = [...f.writes];\n await assert.rejects(createIssue(f.context, input), /conflict/iu);\n assert.deepEqual([...f.edges.get(20)!], [18, 19]);\n assert.deepEqual(f.writes, writes);\n});\n\nfor (const mode of ['partial', 'epic'] as const) {\n test(`MCP ${mode} create retains retry identity across compact and verbose output`, async ({ signal }) => {\n const f = inertTarget(signal);\n const originalGet = f.rest.issues.get;\n f.rest.issues.get = async (input) => ({\n data: { ...(await originalGet(input)).data, user: { login: 'operator' } },\n });\n const originalList = f.rest.issues.listForRepo;\n f.rest.issues.listForRepo = async (input) => ({\n data: (await originalList(input)).data.map((row) => ({ ...row, user: { login: 'operator' } })),\n });\n const originalRequest = f.rest.request;\n let fail = mode === 'partial';\n f.rest.request = async (route, args) => {\n const result = await originalRequest(route, args);\n if (fail && route.startsWith('POST') && route.includes('/issue-field-values')) {\n fail = false;\n throw new Error('Synthetic metadata acknowledgement lost');\n }\n return result;\n };\n const { points: _points, ...unsized } = fixtureFields;\n const input = { ...(mode === 'epic' ? { ...unsized, epic: true } : fixtureFields), opId: `synthetic-mcp-${mode}` };\n const connection = await f.connect();\n try {\n if (mode === 'partial') {\n const partial = await connection.call('issue_create', input);\n assert.equal(partial.response.isError, true);\n assert.match(partial.text, /Issue #17.*Failed step: metadata.*same opId/u);\n }\n const compact = await connection.call('issue_create', input);\n assert.notEqual(compact.response.isError, true, compact.text);\n assert.deepEqual(compact.value?.created, {\n number: 17,\n title: fixtureFields.title,\n url: 'https://github.com/example/widget/issues/17',\n });\n assert.equal(Object.hasOwn(compact.value!, 'body'), false);\n assert.ok(Array.isArray(compact.value?.warnings));\n const verbose = await connection.call('issue_create', { ...input, verbose: true });\n assert.notEqual(verbose.response.isError, true, verbose.text);\n assert.match(String(verbose.value?.body), /State:\\*\\* Ready/u);\n if (mode === 'epic')\n assert.equal(parseIssueBody(String(verbose.value?.body), { title: fixtureFields.title }).issue.epic, true);\n assert.equal(f.calls.filter((call) => call.name === 'issues.create').length, 1);\n assert.equal(\n f.calls.filter((call) => call.name.startsWith('POST') && call.name.includes('/issue-field-values')).length,\n mode === 'partial' ? 1 : 0,\n );\n } finally {\n await f.dispose(connection);\n }\n });\n}\n\n// Nov 1 2026 (#277): aviaratech/ai has about 3,900 issues and PRs, so the retry search never reached a short page.\ntest('MCP create with a fresh opId on a busy repository creates, and a same-opId retry reuses it', async ({\n signal,\n}) => {\n const f = inertTarget(signal);\n const originalList = f.rest.issues.listForRepo;\n const filler = (page: number, size: number) =>\n Array.from({ length: size }, (_, index) => ({\n number: 1000 + page * 100 + index,\n title: 'Unrelated work',\n body: 'No create marker.',\n state: 'open',\n user: { login: 'operator' },\n ...(index % 2 === 0 ? { pull_request: {} } : {}),\n }));\n f.rest.issues.listForRepo = async (input) => {\n const page = input.page ?? 1;\n const head = page === 1 ? (await originalList(input)).data.filter((row) => row.number === 17) : [];\n return {\n data: [...head.map((row) => ({ ...row, user: { login: 'operator' } })), ...filler(page, 100 - head.length)],\n } as Awaited<ReturnType<typeof originalList>>;\n };\n const originalGet = f.rest.issues.get;\n f.rest.issues.get = async (input) => ({ data: { ...(await originalGet(input)).data, user: { login: 'operator' } } });\n const input = { ...fixtureFields, opId: 'synthetic-busy-repo' };\n const connection = await f.connect();\n try {\n const first = await connection.call('issue_create', input);\n assert.notEqual(first.response.isError, true, first.text);\n assert.equal(first.value?.created && (first.value.created as { number: number }).number, 17);\n const retry = await connection.call('issue_create', input);\n assert.notEqual(retry.response.isError, true, retry.text);\n assert.equal(f.calls.filter((call) => call.name === 'issues.create').length, 1);\n } finally {\n await f.dispose(connection);\n }\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,aAAa,2BAA2B,0BAA0B;AAC3E,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,qBAAqB;AAC9C,SAAS,aAAa,
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { test } from 'vitest';\nimport { createIssue, CreatedTrackingIssueError, canonicalIssueBody } from './issue.js';\nimport { issue63Fixture } from './fixtures/issue63.js';\nimport { parseIssueBody, validateIssue } from './issueContract.js';\nimport { inertTarget, fixtureFields, createFields } from './fixtures/inertTarget.js';\n\nfunction fixture() {\n const f = issue63Fixture();\n let parent: number | null = null;\n let parentCleared = false;\n const nativeValues = new Map<number, Record<string, string>>();\n const rest = f.context.clients.rest;\n const originalRequest = rest.request.bind(rest);\n const originalGraphql = f.context.clients.graphql;\n const recovery = { member: false, failProject: false, lostCreateResponse: false };\n rest.paginate = (async () => (parent === 19 ? [f.rows.get(20)!] : [])) as unknown as typeof rest.paginate;\n rest.issues.addSubIssue = (async () => {\n f.writes.push('parent');\n parent = 19;\n return { data: {} };\n }) as unknown as typeof rest.issues.addSubIssue;\n rest.request = (async (\n route: string,\n args: { issue_number?: number; issue_field_values?: { field_id: number; value: string }[] },\n ) => {\n if (route.includes('/orgs/')) {\n const result = await originalRequest(route, args);\n return { data: [...(result.data as unknown[]), { id: 103, name: 'Start date', data_type: 'date' }] };\n }\n if (args.issue_number === 20) {\n const values = nativeValues.get(20)!;\n if (route.startsWith('POST')) {\n f.writes.push('metadata');\n for (const field of args.issue_field_values ?? []) values[String(field.field_id)] = field.value;\n }\n return {\n data: Object.entries(values).map(([id, value]) => ({\n issue_field_id: Number(id),\n issue_field_name: id === '101' ? 'Estimate' : id === '102' ? 'Urgency' : 'Start date',\n data_type: id === '103' ? 'date' : 'single_select',\n value,\n })),\n };\n }\n if (route.startsWith('DELETE')) {\n parentCleared = true;\n return { data: [] };\n }\n if (parentCleared && args.issue_number === 19) return { data: [] };\n return originalRequest(route, args);\n }) as typeof rest.request;\n f.context.clients.graphql = (async (query: string, variables: Record<string, unknown>) => {\n if (query.includes('AddProjectDeliveryItem')) {\n recovery.member = true;\n f.writes.push('membership');\n return { addProjectV2ItemById: { item: { id: 'ITEM20' } } };\n }\n if (query.includes('UpdateProjectDeliveryStatus') && recovery.failProject)\n throw new Error('Synthetic Project write failure');\n const result = (await originalGraphql(query, variables)) as {\n repository: { issue: { parent: unknown; blockedBy: { nodes: { number: number; state: string }[] } } };\n node: { projectItems: { nodes: { id: string }[] } };\n };\n if (query.includes('ProjectDeliveryIssueItems') && !recovery.member)\n result.node.projectItems.nodes = result.node.projectItems.nodes.filter((row) => row.id !== 'ITEM20');\n if (query.includes('blockedBy(first:'))\n for (const blocker of result.repository.issue.blockedBy.nodes)\n blocker.state = f.rows.get(blocker.number)!.state.toUpperCase();\n if (query.includes('blockedBy(first:') && variables.number === 20 && parent !== null)\n result.repository.issue.parent = {\n id: 'ISSUE19',\n number: parent,\n repository: { nameWithOwner: 'example/widget' },\n };\n return result;\n }) as typeof originalGraphql;\n const originalCreate = rest.issues.create.bind(rest.issues);\n rest.issues.create = (async (input: Parameters<typeof originalCreate>[0]) => {\n const result = await originalCreate(input);\n Object.assign(f.rows.get(result.data.number)!, { user: { login: 'operator' } });\n nativeValues.set(result.data.number, {});\n if (recovery.lostCreateResponse) throw new Error('Synthetic lost creation response');\n return result;\n }) as typeof rest.issues.create;\n return { ...f, recovery, nativeValues, parent: () => parent };\n}\n\nconst intent = { opId: 'synthetic-187', parentIssueNumber: 19, blockedBy: [18] };\n\ntest('create establishes Project status before parent and blockers and reuses completed opId', async () => {\n const f = fixture();\n const input = { ...f.createInput, ...intent };\n const result = await createIssue(f.context, input);\n assert.equal(result.created.number, 20);\n assert.equal(f.parent(), 19);\n assert.deepEqual([...f.edges.get(20)!], [18]);\n assert.ok(f.writes.indexOf('membership') < f.writes.indexOf('status'));\n assert.ok(f.writes.indexOf('status') < f.writes.indexOf('parent'));\n const writes = [...f.writes];\n await createIssue(f.context, input);\n assert.equal(f.writes.filter((x) => x === 'create').length, 1);\n assert.deepEqual(f.writes, writes, 'a completed retry must not repeat native writes');\n});\n\ntest('same opId completes a failed dependency step once and identifies remaining work', async () => {\n const f = fixture();\n f.controls.failAdd = true;\n const input = { ...f.createInput, ...intent };\n await assert.rejects(createIssue(f.context, input), (error) => {\n assert.ok(error instanceof CreatedTrackingIssueError);\n assert.equal(error.created.number, 20);\n assert.match(error.message, /blockers/u);\n assert.match(error.message, /opId/u);\n return true;\n });\n f.controls.failAdd = false;\n await createIssue(f.context, input);\n assert.equal(f.writes.filter((x) => x === 'create').length, 1);\n assert.equal(f.writes.filter((x) => x === 'parent').length, 1);\n assert.equal(f.writes.filter((x) => x === 'add').length, 1);\n});\n\ntest('opId refuses changed intent, duplicate markers and foreign authors without writes', async () => {\n for (const mode of ['intent', 'duplicate', 'author'] as const) {\n const f = fixture();\n const input = { ...f.createInput, ...intent };\n await createIssue(f.context, input);\n if (mode === 'duplicate') f.rows.set(21, { ...f.rows.get(20)!, number: 21 });\n if (mode === 'author') Object.assign(f.rows.get(20)!, { user: { login: 'someone-else' } });\n const writes = [...f.writes];\n await assert.rejects(\n createIssue(f.context, { ...input, ...(mode === 'intent' ? { priority: 'Low' } : {}) }),\n /conflict|author/iu,\n );\n assert.deepEqual(f.writes, writes);\n }\n});\n\ntest('epic true is an unsized Ready contract and survives canonical roundtrip', () => {\n const f = fixture();\n const { points: _points, ...ready } = f.ready;\n const result = validateIssue({ ...ready, issueType: 'Feature', epic: true }, true);\n assert.equal(result.failures.length, 0, JSON.stringify(result.failures));\n assert.ok(result.issue);\n // Canonical body generation must not force an epic to become a parked draft.\n const input = { ...ready, issueType: 'Feature', epic: true as const };\n const body = canonicalIssueBody(input);\n assert.match(body, /## Status\\n\\nReady/u);\n assert.doesNotMatch(body, /Draft \u2014 parked/u);\n assert.equal(Reflect.get(parseIssueBody(body, { title: ready.title }).issue, 'epic'), true);\n assert.equal(\n validateIssue(ready, true).failures.some((x) => x.code === 'points'),\n true,\n );\n});\n\ntest.each(['project', 'acknowledgement'] as const)(\n 'same opId resumes after %s failure without another issue',\n async (stage) => {\n const f = fixture();\n const input = { ...f.createInput, ...intent };\n f.recovery.failProject = stage === 'project';\n f.recovery.lostCreateResponse = stage === 'acknowledgement';\n await assert.rejects(\n createIssue(f.context, input),\n stage === 'project' ? /Failed step: project/u : /lost creation response/u,\n );\n f.recovery.failProject = false;\n f.recovery.lostCreateResponse = false;\n await createIssue(f.context, input);\n assert.equal(f.writes.filter((x) => x === 'create').length, 1);\n assert.equal(f.writes.filter((x) => x === 'membership').length, 1);\n assert.equal(f.parent(), 19);\n assert.deepEqual([...f.edges.get(20)!], [18]);\n },\n);\n\ntest.each(['completed', 'partial'] as const)(\n 'create retry preserves independently changed native values after %s operation',\n async (stage) => {\n for (const [field, value] of [\n ['101', '4'],\n ['102', 'Low'],\n ['103', '2026-02-02'],\n ] as const) {\n const f = fixture();\n const input = { ...f.createInput, ...intent, priority: 'High', startDate: '2026-01-01' };\n f.controls.failAdd = stage === 'partial';\n if (stage === 'partial') await assert.rejects(createIssue(f.context, input));\n else await createIssue(f.context, input);\n f.controls.failAdd = false;\n f.nativeValues.get(20)![field] = value;\n const writes = [...f.writes];\n await assert.rejects(createIssue(f.context, input), /conflict/iu);\n assert.equal(f.nativeValues.get(20)![field], value);\n assert.deepEqual(f.writes, writes);\n }\n },\n);\n\ntest('partial create reports only the requested remaining operations', async () => {\n const f = fixture();\n f.recovery.failProject = true;\n await assert.rejects(createIssue(f.context, { ...f.createInput, opId: 'synthetic-simple' }), (error) => {\n assert.ok(error instanceof CreatedTrackingIssueError);\n assert.deepEqual(error.remainingSteps, ['project', 'readback']);\n return true;\n });\n});\n\ntest('same opId preserves independently added closed blocker relationships', async () => {\n const f = fixture();\n const input = { ...f.createInput, ...intent };\n await createIssue(f.context, input);\n f.rows.get(19)!.state = 'closed';\n f.edges.get(20)!.add(19);\n const writes = [...f.writes];\n await assert.rejects(createIssue(f.context, input), /conflict/iu);\n assert.deepEqual([...f.edges.get(20)!], [18, 19]);\n assert.deepEqual(f.writes, writes);\n});\n\nfor (const mode of ['partial', 'epic'] as const) {\n test(`MCP ${mode} create retains retry identity across compact and verbose output`, async ({ signal }) => {\n const f = inertTarget(signal);\n const originalGet = f.rest.issues.get;\n f.rest.issues.get = async (input) => ({\n data: { ...(await originalGet(input)).data, user: { login: 'operator' } },\n });\n const originalList = f.rest.issues.listForRepo;\n f.rest.issues.listForRepo = async (input) => ({\n data: (await originalList(input)).data.map((row) => ({ ...row, user: { login: 'operator' } })),\n });\n const originalRequest = f.rest.request;\n let fail = mode === 'partial';\n f.rest.request = async (route, args) => {\n const result = await originalRequest(route, args);\n if (fail && route.startsWith('POST') && route.includes('/issue-field-values')) {\n fail = false;\n throw new Error('Synthetic metadata acknowledgement lost');\n }\n return result;\n };\n const { points: _points, priority: _priority, ...unsized } = createFields;\n const input = { ...(mode === 'epic' ? { ...unsized, epic: true } : createFields), opId: `synthetic-mcp-${mode}` };\n const connection = await f.connect();\n try {\n if (mode === 'partial') {\n const partial = await connection.call('issue_create', input);\n assert.equal(partial.response.isError, true);\n assert.match(partial.text, /Issue #17.*Failed step: metadata.*same opId/u);\n }\n const compact = await connection.call('issue_create', input);\n assert.notEqual(compact.response.isError, true, compact.text);\n assert.deepEqual(compact.value?.created, {\n number: 17,\n title: fixtureFields.title,\n url: 'https://github.com/example/widget/issues/17',\n });\n assert.equal(Object.hasOwn(compact.value!, 'body'), false);\n assert.ok(Array.isArray(compact.value?.warnings));\n const verbose = await connection.call('issue_create', { ...input, verbose: true });\n assert.notEqual(verbose.response.isError, true, verbose.text);\n assert.match(String(verbose.value?.body), /State:\\*\\* Ready/u);\n if (mode === 'epic')\n assert.equal(parseIssueBody(String(verbose.value?.body), { title: fixtureFields.title }).issue.epic, true);\n assert.equal(f.calls.filter((call) => call.name === 'issues.create').length, 1);\n assert.equal(\n f.calls.filter((call) => call.name.startsWith('POST') && call.name.includes('/issue-field-values')).length,\n mode === 'partial' ? 1 : 0,\n );\n } finally {\n await f.dispose(connection);\n }\n });\n}\n\n// Nov 1 2026 (#277): aviaratech/ai has about 3,900 issues and PRs, so the retry search never reached a short page.\ntest('MCP create with a fresh opId on a busy repository creates, and a same-opId retry reuses it', async ({\n signal,\n}) => {\n const f = inertTarget(signal);\n const originalList = f.rest.issues.listForRepo;\n const filler = (page: number, size: number) =>\n Array.from({ length: size }, (_, index) => ({\n number: 1000 + page * 100 + index,\n title: 'Unrelated work',\n body: 'No create marker.',\n state: 'open',\n user: { login: 'operator' },\n ...(index % 2 === 0 ? { pull_request: {} } : {}),\n }));\n f.rest.issues.listForRepo = async (input) => {\n const page = input.page ?? 1;\n const head = page === 1 ? (await originalList(input)).data.filter((row) => row.number === 17) : [];\n return {\n data: [...head.map((row) => ({ ...row, user: { login: 'operator' } })), ...filler(page, 100 - head.length)],\n } as Awaited<ReturnType<typeof originalList>>;\n };\n const originalGet = f.rest.issues.get;\n f.rest.issues.get = async (input) => ({ data: { ...(await originalGet(input)).data, user: { login: 'operator' } } });\n const input = { ...createFields, opId: 'synthetic-busy-repo' };\n const connection = await f.connect();\n try {\n const first = await connection.call('issue_create', input);\n assert.notEqual(first.response.isError, true, first.text);\n assert.equal(first.value?.created && (first.value.created as { number: number }).number, 17);\n const retry = await connection.call('issue_create', input);\n assert.notEqual(retry.response.isError, true, retry.text);\n assert.equal(f.calls.filter((call) => call.name === 'issues.create').length, 1);\n } finally {\n await f.dispose(connection);\n }\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,aAAa,2BAA2B,0BAA0B;AAC3E,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,qBAAqB;AAC9C,SAAS,aAAa,eAAe,oBAAoB;AAEzD,SAAS,UAAU;AACjB,QAAM,IAAI,eAAe;AACzB,MAAI,SAAwB;AAC5B,MAAI,gBAAgB;AACpB,QAAM,eAAe,oBAAI,IAAoC;AAC7D,QAA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,MAAM,SAAS,SAAS,MAAM,MAAM,IAAI;AACxD,WAAO,MAAM,MAAM,OAAO,WAAY,MAAM,MAAM,QAA+B,QAAQ,EAAE;AAC3F,UAAM,QAAQ,MAAM,WAAW,KAAK,gBAAgB,KAAK;AACzD,WAAO,SAAS,MAAM,SAAS,SAAS,MAAM,MAAM,IAAI;AACxD,WAAO,MAAM,EAAE,MAAM,OAAO,CAAC,SAAS,KAAK,SAAS,eAAe,EAAE,QAAQ,CAAC;AAAA,EAChF,UAAE;AACA,UAAM,EAAE,QAAQ,UAAU;AAAA,EAC5B;AACF,CAAC;",
|
|
6
6
|
"names": ["input"]
|
|
7
7
|
}
|
package/dist/mcp/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
import { executeTool } from "../dispatch.js";
|
|
5
5
|
import { setLogsSuppressed } from "../logger.js";
|
|
6
6
|
import { PACKAGE_VERSION } from "../version.js";
|
|
7
|
+
import { acceptedKeysError } from "../issueContract.js";
|
|
7
8
|
import { JOURNAL_SCHEMA_METADATA, missingJournalFields } from "../issueJournal.js";
|
|
8
9
|
import { getIncompleteIssueUpdate } from "../issue.js";
|
|
9
10
|
import { projectToolOutput } from "../toolOutput.js";
|
|
@@ -21,12 +22,11 @@ function createAiDeliveryMcpServer(context, activeCalls) {
|
|
|
21
22
|
tool.name,
|
|
22
23
|
{
|
|
23
24
|
description: tool.description,
|
|
25
|
+
...tool.readOnly ? { annotations: { readOnlyHint: true } } : {},
|
|
24
26
|
// The SDK must leave journal kind refinements to the handler so missing
|
|
25
27
|
// conditional fields receive a safe, actionable contract refusal. Unknown
|
|
26
28
|
// property names stay private through a schema-local error message.
|
|
27
|
-
inputSchema: tool.name === "issue_comment" ? z.strictObject(tool.inputSchema.shape, {
|
|
28
|
-
error: "Invalid journal object. Provide only the advertised fields."
|
|
29
|
-
}).partial().meta(JOURNAL_SCHEMA_METADATA) : tool.inputSchema
|
|
29
|
+
inputSchema: tool.name === "issue_comment" ? z.strictObject(tool.inputSchema.shape, { error: acceptedKeysError }).partial().meta(JOURNAL_SCHEMA_METADATA) : tool.inputSchema
|
|
30
30
|
},
|
|
31
31
|
async (args, extra) => {
|
|
32
32
|
const parsed = tool.inputSchema.safeParse(args);
|
package/dist/mcp/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mcp/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\n\nimport { executeTool, type ExecutionContext } from '../dispatch.js';\nimport { setLogsSuppressed } from '../logger.js';\nimport { PACKAGE_VERSION } from '../version.js';\nimport { JOURNAL_SCHEMA_METADATA, missingJournalFields } from '../issueJournal.js';\nimport { getIncompleteIssueUpdate } from '../issue.js';\nimport { projectToolOutput } from '../toolOutput.js';\nimport { AI_DELIVERY_MCP_TOOLS, type AiDeliveryMcpToolName } from './tools.js';\n\nexport { AI_DELIVERY_MCP_CONTRACT_VERSION, AI_DELIVERY_MCP_TOOLS } from './tools.js';\n\nconst SERVER_INSTRUCTIONS =\n 'Use issue_info with an explicit repo; follow repository policy for checks and authorization, and respect requested providers and read-only intent.';\n\nexport function createAiDeliveryMcpServer(context: ExecutionContext, activeCalls?: Set<Promise<unknown>>): McpServer {\n const server = new McpServer(\n { name: 'ai-delivery', version: PACKAGE_VERSION },\n { instructions: SERVER_INSTRUCTIONS },\n );\n const tools: readonly {
|
|
5
|
-
"mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAElB,SAAS,mBAA0C;AACnD,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAChC,SAAS,yBAAyB,4BAA4B;AAC9D,SAAS,gCAAgC;AACzC,SAAS,yBAAyB;AAClC,SAAS,6BAAyD;AAElE,SAAS,kCAAkC,yBAAAA,8BAA6B;AAExE,MAAM,sBACJ;AAEK,SAAS,0BAA0B,SAA2B,aAAgD;AACnH,QAAM,SAAS,IAAI;AAAA,IACjB,EAAE,MAAM,eAAe,SAAS,gBAAgB;AAAA,IAChD,EAAE,cAAc,oBAAoB;AAAA,EACtC;AACA,QAAM,
|
|
4
|
+
"sourcesContent": ["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\n\nimport { executeTool, type ExecutionContext } from '../dispatch.js';\nimport { setLogsSuppressed } from '../logger.js';\nimport { PACKAGE_VERSION } from '../version.js';\nimport { acceptedKeysError } from '../issueContract.js';\nimport { JOURNAL_SCHEMA_METADATA, missingJournalFields } from '../issueJournal.js';\nimport { getIncompleteIssueUpdate } from '../issue.js';\nimport { projectToolOutput } from '../toolOutput.js';\nimport { AI_DELIVERY_MCP_TOOLS, type AiDeliveryMcpToolName } from './tools.js';\n\nexport { AI_DELIVERY_MCP_CONTRACT_VERSION, AI_DELIVERY_MCP_TOOLS } from './tools.js';\n\nconst SERVER_INSTRUCTIONS =\n 'Use issue_info with an explicit repo; follow repository policy for checks and authorization, and respect requested providers and read-only intent.';\n\nexport function createAiDeliveryMcpServer(context: ExecutionContext, activeCalls?: Set<Promise<unknown>>): McpServer {\n const server = new McpServer(\n { name: 'ai-delivery', version: PACKAGE_VERSION },\n { instructions: SERVER_INSTRUCTIONS },\n );\n const tools: readonly {\n name: string;\n description: string;\n inputSchema: z.ZodObject<z.ZodRawShape>;\n readOnly?: true;\n }[] = AI_DELIVERY_MCP_TOOLS;\n for (const tool of tools) {\n server.registerTool(\n tool.name,\n {\n description: tool.description,\n ...(tool.readOnly ? { annotations: { readOnlyHint: true } } : {}),\n // The SDK must leave journal kind refinements to the handler so missing\n // conditional fields receive a safe, actionable contract refusal. Unknown\n // property names stay private through a schema-local error message.\n inputSchema:\n tool.name === 'issue_comment'\n ? z\n .strictObject(tool.inputSchema.shape, { error: acceptedKeysError })\n .partial()\n .meta(JOURNAL_SCHEMA_METADATA)\n : tool.inputSchema,\n },\n async (args, extra) => {\n const parsed = tool.inputSchema.safeParse(args);\n if (!parsed.success) {\n const missing = tool.name === 'issue_comment' ? missingJournalFields(args) : [];\n return {\n content: [\n {\n type: 'text' as const,\n text: `Invalid arguments for ${tool.name}.${missing.length ? ` Missing required fields: ${missing.join(', ')}. Provide every missing field.` : tool.name === 'issue_comment' ? ` ${tool.description}` : ''}`,\n },\n ],\n isError: true,\n };\n }\n try {\n const signal = context.signal === undefined ? extra.signal : AbortSignal.any([context.signal, extra.signal]);\n const { verbose, ...input } = parsed.data;\n const pending = executeTool(tool.name as AiDeliveryMcpToolName, input, {\n ...context,\n signal,\n ...(verbose === true ? { verbose } : {}),\n });\n activeCalls?.add(pending);\n let value: unknown;\n try {\n value = await pending;\n } finally {\n activeCalls?.delete(pending);\n }\n return {\n content: [\n { type: 'text' as const, text: JSON.stringify(projectToolOutput(tool.name, value, verbose === true)) },\n ],\n };\n } catch (error) {\n const incomplete = getIncompleteIssueUpdate(error);\n if (incomplete !== undefined)\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(\n projectToolOutput(tool.name, incomplete, 'verbose' in args && args.verbose === true),\n ),\n },\n ],\n isError: true,\n };\n const message = error instanceof Error ? error.message : String(error);\n return { content: [{ type: 'text' as const, text: message }], isError: true };\n }\n },\n );\n }\n return server;\n}\n\nexport async function serveAiDeliveryMcp(context: ExecutionContext): Promise<void> {\n setLogsSuppressed(true);\n const shutdown = new AbortController();\n const activeCalls = new Set<Promise<unknown>>();\n const server = createAiDeliveryMcpServer({ ...context, signal: shutdown.signal }, activeCalls);\n let closing: Promise<void> | undefined;\n const close = (): Promise<void> => {\n closing ??= (async () => {\n shutdown.abort();\n await Promise.allSettled(activeCalls);\n await server.close();\n process.exit(0);\n })();\n return closing;\n };\n process.once('SIGINT', () => {\n void close();\n });\n process.once('SIGTERM', () => {\n void close();\n });\n await server.connect(new StdioServerTransport());\n process.stderr.write('ai-delivery MCP server started\\n');\n await new Promise<void>(() => {});\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAElB,SAAS,mBAA0C;AACnD,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,yBAAyB,4BAA4B;AAC9D,SAAS,gCAAgC;AACzC,SAAS,yBAAyB;AAClC,SAAS,6BAAyD;AAElE,SAAS,kCAAkC,yBAAAA,8BAA6B;AAExE,MAAM,sBACJ;AAEK,SAAS,0BAA0B,SAA2B,aAAgD;AACnH,QAAM,SAAS,IAAI;AAAA,IACjB,EAAE,MAAM,eAAe,SAAS,gBAAgB;AAAA,IAChD,EAAE,cAAc,oBAAoB;AAAA,EACtC;AACA,QAAM,QAKA;AACN,aAAW,QAAQ,OAAO;AACxB,WAAO;AAAA,MACL,KAAK;AAAA,MACL;AAAA,QACE,aAAa,KAAK;AAAA,QAClB,GAAI,KAAK,WAAW,EAAE,aAAa,EAAE,cAAc,KAAK,EAAE,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,QAI/D,aACE,KAAK,SAAS,kBACV,EACG,aAAa,KAAK,YAAY,OAAO,EAAE,OAAO,kBAAkB,CAAC,EACjE,QAAQ,EACR,KAAK,uBAAuB,IAC/B,KAAK;AAAA,MACb;AAAA,MACA,OAAO,MAAM,UAAU;AACrB,cAAM,SAAS,KAAK,YAAY,UAAU,IAAI;AAC9C,YAAI,CAAC,OAAO,SAAS;AACnB,gBAAM,UAAU,KAAK,SAAS,kBAAkB,qBAAqB,IAAI,IAAI,CAAC;AAC9E,iBAAO;AAAA,YACL,SAAS;AAAA,cACP;AAAA,gBACE,MAAM;AAAA,gBACN,MAAM,yBAAyB,KAAK,IAAI,IAAI,QAAQ,SAAS,6BAA6B,QAAQ,KAAK,IAAI,CAAC,mCAAmC,KAAK,SAAS,k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,QAAM,WAAW,IAAI,gBAAgB;AACrC,QAAM,cAAc,oBAAI,IAAsB;AAC9C,QAAM,SAAS,0BAA0B,EAAE,GAAG,SAAS,QAAQ,SAAS,OAAO,GAAG,WAAW;AAC7F,MAAI;AACJ,QAAM,QAAQ,MAAqB;AACjC,iBAAa,YAAY;AACvB,eAAS,MAAM;AACf,YAAM,QAAQ,WAAW,WAAW;AACpC,YAAM,OAAO,MAAM;AACnB,cAAQ,KAAK,CAAC;AAAA,IAChB,GAAG;AACH,WAAO;AAAA,EACT;AACA,UAAQ,KAAK,UAAU,MAAM;AAC3B,SAAK,MAAM;AAAA,EACb,CAAC;AACD,UAAQ,KAAK,WAAW,MAAM;AAC5B,SAAK,MAAM;AAAA,EACb,CAAC;AACD,QAAM,OAAO,QAAQ,IAAI,qBAAqB,CAAC;AAC/C,UAAQ,OAAO,MAAM,kCAAkC;AACvD,QAAM,IAAI,QAAc,MAAM;AAAA,EAAC,CAAC;AAClC;",
|
|
6
6
|
"names": ["AI_DELIVERY_MCP_TOOLS"]
|
|
7
7
|
}
|
package/dist/mcp/tools.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
39
39
|
}, {
|
|
40
40
|
readonly name: 'issue_create';
|
|
41
41
|
readonly commandName: 'create';
|
|
42
|
-
readonly description: 'Create a native GitHub tracking issue with configured metadata and relationships';
|
|
42
|
+
readonly description: 'Create a native GitHub tracking issue with configured metadata and relationships. A non-draft issue needs issueType, and a non-epic also needs priority.';
|
|
43
43
|
readonly issueContract: {
|
|
44
44
|
version: "ai-delivery.issue@1";
|
|
45
45
|
draft: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
@@ -52,6 +52,11 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
52
52
|
acceptanceCriteria: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
53
53
|
behavior: z.ZodString;
|
|
54
54
|
verifiedBy: z.ZodString;
|
|
55
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
56
|
+
input: z.ZodString;
|
|
57
|
+
expected: z.ZodString;
|
|
58
|
+
failure: z.ZodOptional<z.ZodLiteral<true>>;
|
|
59
|
+
}, z.core.$strict>>>;
|
|
55
60
|
}, z.core.$strict>>>;
|
|
56
61
|
outOfScope: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
57
62
|
openQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -72,6 +77,30 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
72
77
|
until: z.ZodOptional<z.ZodISODate>;
|
|
73
78
|
trigger: z.ZodOptional<z.ZodString>;
|
|
74
79
|
}, z.core.$strict>>;
|
|
80
|
+
builder: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
81
|
+
tier: z.ZodLiteral<"standard">;
|
|
82
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
83
|
+
tier: z.ZodLiteral<"frontier">;
|
|
84
|
+
reason: z.ZodEnum<{
|
|
85
|
+
"concurrency-recovery": "concurrency-recovery";
|
|
86
|
+
"risk-semantics": "risk-semantics";
|
|
87
|
+
"state-machine": "state-machine";
|
|
88
|
+
"unprovable-refactor": "unprovable-refactor";
|
|
89
|
+
}>;
|
|
90
|
+
}, z.core.$strict>], "tier">>;
|
|
91
|
+
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
92
|
+
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
|
+
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
94
|
+
path: z.ZodString;
|
|
95
|
+
change: z.ZodEnum<{
|
|
96
|
+
add: "add";
|
|
97
|
+
delete: "delete";
|
|
98
|
+
edit: "edit";
|
|
99
|
+
}>;
|
|
100
|
+
signatures: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
101
|
+
}, z.core.$strict>>>;
|
|
102
|
+
fences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
proof: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
104
|
legacyBody: z.ZodOptional<z.ZodString>;
|
|
76
105
|
retainLegacyBody: z.ZodOptional<z.ZodBoolean>;
|
|
77
106
|
}, z.core.$strict>>;
|
|
@@ -94,6 +123,30 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
94
123
|
until: z.ZodOptional<z.ZodISODate>;
|
|
95
124
|
trigger: z.ZodOptional<z.ZodString>;
|
|
96
125
|
}, z.core.$strict>>;
|
|
126
|
+
builder: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
127
|
+
tier: z.ZodLiteral<"standard">;
|
|
128
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
129
|
+
tier: z.ZodLiteral<"frontier">;
|
|
130
|
+
reason: z.ZodEnum<{
|
|
131
|
+
"concurrency-recovery": "concurrency-recovery";
|
|
132
|
+
"risk-semantics": "risk-semantics";
|
|
133
|
+
"state-machine": "state-machine";
|
|
134
|
+
"unprovable-refactor": "unprovable-refactor";
|
|
135
|
+
}>;
|
|
136
|
+
}, z.core.$strict>], "tier">>;
|
|
137
|
+
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
138
|
+
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
139
|
+
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
140
|
+
path: z.ZodString;
|
|
141
|
+
change: z.ZodEnum<{
|
|
142
|
+
add: "add";
|
|
143
|
+
delete: "delete";
|
|
144
|
+
edit: "edit";
|
|
145
|
+
}>;
|
|
146
|
+
signatures: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
147
|
+
}, z.core.$strict>>>;
|
|
148
|
+
fences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
149
|
+
proof: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
97
150
|
legacyBody: z.ZodOptional<z.ZodString>;
|
|
98
151
|
retainLegacyBody: z.ZodOptional<z.ZodBoolean>;
|
|
99
152
|
title: z.ZodString;
|
|
@@ -103,6 +156,11 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
103
156
|
acceptanceCriteria: z.ZodArray<z.ZodObject<{
|
|
104
157
|
behavior: z.ZodString;
|
|
105
158
|
verifiedBy: z.ZodString;
|
|
159
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
160
|
+
input: z.ZodString;
|
|
161
|
+
expected: z.ZodString;
|
|
162
|
+
failure: z.ZodOptional<z.ZodLiteral<true>>;
|
|
163
|
+
}, z.core.$strict>>>;
|
|
106
164
|
}, z.core.$strict>>;
|
|
107
165
|
outOfScope: z.ZodArray<z.ZodString>;
|
|
108
166
|
openQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -120,6 +178,11 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
120
178
|
acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
121
179
|
behavior: z.ZodString;
|
|
122
180
|
verifiedBy: z.ZodString;
|
|
181
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
182
|
+
input: z.ZodString;
|
|
183
|
+
expected: z.ZodString;
|
|
184
|
+
failure: z.ZodOptional<z.ZodLiteral<true>>;
|
|
185
|
+
}, z.core.$strict>>>;
|
|
123
186
|
}, z.core.$strict>>>;
|
|
124
187
|
outOfScope: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
125
188
|
openQuestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -135,6 +198,30 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
135
198
|
reproducibility: z.ZodString;
|
|
136
199
|
environment: z.ZodString;
|
|
137
200
|
}, z.core.$strict>>;
|
|
201
|
+
builder: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
202
|
+
tier: z.ZodLiteral<"standard">;
|
|
203
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
204
|
+
tier: z.ZodLiteral<"frontier">;
|
|
205
|
+
reason: z.ZodEnum<{
|
|
206
|
+
"concurrency-recovery": "concurrency-recovery";
|
|
207
|
+
"risk-semantics": "risk-semantics";
|
|
208
|
+
"state-machine": "state-machine";
|
|
209
|
+
"unprovable-refactor": "unprovable-refactor";
|
|
210
|
+
}>;
|
|
211
|
+
}, z.core.$strict>], "tier">>;
|
|
212
|
+
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
213
|
+
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
214
|
+
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
215
|
+
path: z.ZodString;
|
|
216
|
+
change: z.ZodEnum<{
|
|
217
|
+
add: "add";
|
|
218
|
+
delete: "delete";
|
|
219
|
+
edit: "edit";
|
|
220
|
+
}>;
|
|
221
|
+
signatures: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
222
|
+
}, z.core.$strict>>>;
|
|
223
|
+
fences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
224
|
+
proof: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
138
225
|
draft: z.ZodOptional<z.ZodBoolean>;
|
|
139
226
|
retainLegacyBody: z.ZodOptional<z.ZodBoolean>;
|
|
140
227
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -156,7 +243,7 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
156
243
|
}, {
|
|
157
244
|
readonly name: 'issue_start';
|
|
158
245
|
readonly commandName: 'start';
|
|
159
|
-
readonly description: 'Start a linked issue. Prefer issueNumber of an open issue that already meets the ready contract: title, Points and, for Bug issues, the bug fields (see issue_create). A new issue from title or request cannot carry bug fields.';
|
|
246
|
+
readonly description: 'Start a linked issue. Prefer issueNumber of an open issue that already meets the ready contract: title, Issue Type, Priority (not for epics), Points and, for Bug issues, the bug fields (see issue_create). A new issue from title or request cannot carry bug fields.';
|
|
160
247
|
readonly inputSchema: z.ZodObject<{
|
|
161
248
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
162
249
|
blockedBy: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
@@ -179,6 +266,7 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
179
266
|
}, z.core.$strict>;
|
|
180
267
|
}, {
|
|
181
268
|
readonly name: 'issue_list';
|
|
269
|
+
readonly readOnly: true;
|
|
182
270
|
readonly commandName: 'list';
|
|
183
271
|
readonly description: 'List repository issues with native filters, named organization fields and pagination';
|
|
184
272
|
readonly inputSchema: z.ZodObject<{
|
|
@@ -205,6 +293,7 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
205
293
|
}, z.core.$strict>;
|
|
206
294
|
}, {
|
|
207
295
|
readonly name: 'issue_search';
|
|
296
|
+
readonly readOnly: true;
|
|
208
297
|
readonly commandName: 'search';
|
|
209
298
|
readonly description: 'Search literal issue text in the selected repository with native filters and pagination';
|
|
210
299
|
readonly inputSchema: z.ZodObject<{
|
|
@@ -249,6 +338,11 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
249
338
|
acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
250
339
|
behavior: z.ZodString;
|
|
251
340
|
verifiedBy: z.ZodString;
|
|
341
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
342
|
+
input: z.ZodString;
|
|
343
|
+
expected: z.ZodString;
|
|
344
|
+
failure: z.ZodOptional<z.ZodLiteral<true>>;
|
|
345
|
+
}, z.core.$strict>>>;
|
|
252
346
|
}, z.core.$strict>>>;
|
|
253
347
|
outOfScope: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
254
348
|
openQuestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -264,6 +358,30 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
264
358
|
reproducibility: z.ZodString;
|
|
265
359
|
environment: z.ZodString;
|
|
266
360
|
}, z.core.$strict>>;
|
|
361
|
+
builder: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
362
|
+
tier: z.ZodLiteral<"standard">;
|
|
363
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
364
|
+
tier: z.ZodLiteral<"frontier">;
|
|
365
|
+
reason: z.ZodEnum<{
|
|
366
|
+
"concurrency-recovery": "concurrency-recovery";
|
|
367
|
+
"risk-semantics": "risk-semantics";
|
|
368
|
+
"state-machine": "state-machine";
|
|
369
|
+
"unprovable-refactor": "unprovable-refactor";
|
|
370
|
+
}>;
|
|
371
|
+
}, z.core.$strict>], "tier">>;
|
|
372
|
+
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
373
|
+
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
374
|
+
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
375
|
+
path: z.ZodString;
|
|
376
|
+
change: z.ZodEnum<{
|
|
377
|
+
add: "add";
|
|
378
|
+
delete: "delete";
|
|
379
|
+
edit: "edit";
|
|
380
|
+
}>;
|
|
381
|
+
signatures: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
382
|
+
}, z.core.$strict>>>;
|
|
383
|
+
fences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
384
|
+
proof: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
267
385
|
draft: z.ZodOptional<z.ZodBoolean>;
|
|
268
386
|
retainLegacyBody: z.ZodOptional<z.ZodBoolean>;
|
|
269
387
|
status: z.ZodOptional<z.ZodObject<{
|
|
@@ -328,6 +446,11 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
328
446
|
acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
329
447
|
behavior: z.ZodString;
|
|
330
448
|
verifiedBy: z.ZodString;
|
|
449
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
450
|
+
input: z.ZodString;
|
|
451
|
+
expected: z.ZodString;
|
|
452
|
+
failure: z.ZodOptional<z.ZodLiteral<true>>;
|
|
453
|
+
}, z.core.$strict>>>;
|
|
331
454
|
}, z.core.$strict>>>;
|
|
332
455
|
outOfScope: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
333
456
|
openQuestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -343,6 +466,30 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
343
466
|
reproducibility: z.ZodString;
|
|
344
467
|
environment: z.ZodString;
|
|
345
468
|
}, z.core.$strict>>;
|
|
469
|
+
builder: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
470
|
+
tier: z.ZodLiteral<"standard">;
|
|
471
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
472
|
+
tier: z.ZodLiteral<"frontier">;
|
|
473
|
+
reason: z.ZodEnum<{
|
|
474
|
+
"concurrency-recovery": "concurrency-recovery";
|
|
475
|
+
"risk-semantics": "risk-semantics";
|
|
476
|
+
"state-machine": "state-machine";
|
|
477
|
+
"unprovable-refactor": "unprovable-refactor";
|
|
478
|
+
}>;
|
|
479
|
+
}, z.core.$strict>], "tier">>;
|
|
480
|
+
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
481
|
+
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
482
|
+
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
483
|
+
path: z.ZodString;
|
|
484
|
+
change: z.ZodEnum<{
|
|
485
|
+
add: "add";
|
|
486
|
+
delete: "delete";
|
|
487
|
+
edit: "edit";
|
|
488
|
+
}>;
|
|
489
|
+
signatures: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
490
|
+
}, z.core.$strict>>>;
|
|
491
|
+
fences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
492
|
+
proof: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
346
493
|
draft: z.ZodOptional<z.ZodBoolean>;
|
|
347
494
|
retainLegacyBody: z.ZodOptional<z.ZodBoolean>;
|
|
348
495
|
status: z.ZodOptional<z.ZodObject<{
|
|
@@ -389,8 +536,9 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
389
536
|
}, z.core.$strict>;
|
|
390
537
|
}, {
|
|
391
538
|
readonly name: 'issue_info';
|
|
539
|
+
readonly readOnly: true;
|
|
392
540
|
readonly commandName: 'info';
|
|
393
|
-
readonly description: '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.';
|
|
541
|
+
readonly description: 'Read live GitHub issue metadata, relationships, Project status, linked PRs (state, merge commit, checks, reviews) and the latest journal in one call. Child counts by default; verbose adds the body, every journal in full, 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.';
|
|
394
542
|
readonly inputSchema: z.ZodObject<{
|
|
395
543
|
issueNumber: z.ZodNumber;
|
|
396
544
|
repo: z.ZodOptional<z.ZodString>;
|
|
@@ -398,6 +546,7 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
398
546
|
}, z.core.$strict>;
|
|
399
547
|
}, {
|
|
400
548
|
readonly name: 'issue_ready_check';
|
|
549
|
+
readonly readOnly: true;
|
|
401
550
|
readonly commandName: 'ready:check';
|
|
402
551
|
readonly description: 'Evaluate deterministic readiness from live native issue state';
|
|
403
552
|
readonly inputSchema: z.ZodObject<{
|
|
@@ -408,7 +557,7 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
408
557
|
}, {
|
|
409
558
|
readonly name: 'issue_pr_create';
|
|
410
559
|
readonly commandName: 'pr:create';
|
|
411
|
-
readonly description: 'Create or reuse a PR from any directory using repo, issueNumber and a pushed head. By default it closes the issue and restores a missing closing link on reuse. nonClosing opens a draft that references the issue and leaves it open. expectedHeadSha refuses a different pushed head.';
|
|
560
|
+
readonly description: 'Create or reuse a PR from any directory using repo, issueNumber and a pushed head. By default it closes the issue and restores a missing closing link on reuse. On an existing closing PR, a new title or body edits it and draft: false marks it ready. nonClosing opens a draft that references the issue and leaves it open. expectedHeadSha refuses a different pushed head.';
|
|
412
561
|
readonly inputSchema: z.ZodObject<{
|
|
413
562
|
repo: z.ZodOptional<z.ZodString>;
|
|
414
563
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -426,8 +575,9 @@ export declare const AI_DELIVERY_MCP_TOOLS: readonly [{
|
|
|
426
575
|
}, z.core.$strict>;
|
|
427
576
|
}, {
|
|
428
577
|
readonly name: 'issue_pr_info';
|
|
578
|
+
readonly readOnly: true;
|
|
429
579
|
readonly commandName: 'pr:info';
|
|
430
|
-
readonly description: "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";
|
|
580
|
+
readonly description: "Inspect a PR by number or its GitHub-linked issue branch: state, merge state, merge commit, checks, reviews and each linked issue's state, Project status and latest journal, in one call";
|
|
431
581
|
readonly inputSchema: z.ZodObject<{
|
|
432
582
|
repo: z.ZodOptional<z.ZodString>;
|
|
433
583
|
verbose: z.ZodOptional<z.ZodBoolean>;
|