@aviaratech/ai-delivery 0.3.36 → 0.3.37
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/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/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 +108 -115
- 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/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ai-delivery
|
|
2
2
|
|
|
3
|
-
ai-delivery handles **GitHub issues, pull requests
|
|
3
|
+
ai-delivery handles **GitHub issues, pull requests and independent reviews** through a CLI, stdio MCP server and Codex/Claude Code plugin. GitHub owns relationships, Project tracking, checks and review eligibility. Hosts prepare worktrees, run checks, commit, push and clean up.
|
|
4
4
|
|
|
5
5
|
Explicit `--repo owner/name` or MCP `repo: "owner/name"` works outside Git. Without it, the checkout's `origin` selects the repository. Only `github.com` is supported. The runtime reads operator-owned JSON; it never executes a consuming repository's policy or checks.
|
|
6
6
|
|
|
@@ -65,14 +65,14 @@ ai-delivery --repo example/widget pr:create --issue 17 --body-file pr-body.md
|
|
|
65
65
|
# Independent reviewer submits its own exact-head verdict/artifact.
|
|
66
66
|
ai-delivery --repo example/widget pr:create --issue 17 --ready
|
|
67
67
|
ai-delivery --repo example/widget pr:checks --pr 23
|
|
68
|
-
|
|
68
|
+
gh pr merge 23 --repo example/widget --squash --match-head-commit <sha>
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
GitHub's current required checks, counted reviews, blockers and merge eligibility govern the exact head/current base. The builder never approves its own work. Read back uncertain writes before retrying; a dry run grants no authority. Respect explicit provider/read-only requests and actual host refusals.
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
GitHub deletes the merged head branch; the host removes its own worktree.
|
|
74
74
|
|
|
75
|
-
For partial delivery, `--non-closing` requires a canonical `References owner/repo#number` body and complete native evidence; a new linked-branch draft requires a separately authorized exact reference action.
|
|
75
|
+
For partial delivery, `--non-closing` requires a canonical `References owner/repo#number` body and complete native evidence; a new linked-branch draft requires a separately authorized exact reference action. A complete executable child can close normally while its parent stays open.
|
|
76
76
|
|
|
77
77
|
## Command and tool map
|
|
78
78
|
|
|
@@ -91,7 +91,6 @@ These are all executable routes; groups/help flags are omitted. A dash means no
|
|
|
91
91
|
| Pull requests: observations | `pr:list`, `pr:checks` | — |
|
|
92
92
|
| Reviews: artifact | `pr:review` | `issue_pr_review` |
|
|
93
93
|
| Reviews: profile/verdict | `review doctor`, `review submit` | — |
|
|
94
|
-
| Merges/completion | `pr:merge`, `finish` | `issue_pr_merge`, `issue_finish` |
|
|
95
94
|
| Delivery support: plugin | `plugin install`, `plugin doctor`, `plugin preview`, `plugin update`, `plugin rollback`, `plugin remove` | — |
|
|
96
95
|
| Issues: offline migration plan | `migrate:legacy-issues` | — |
|
|
97
96
|
| All: setup/transport | `config:resolve`, `mcp:serve` | — |
|
|
@@ -116,4 +115,4 @@ Release still requires the exact mandatory archive inventory, complete release/c
|
|
|
116
115
|
|
|
117
116
|
Release is manual, main-only and uses npm trusted publishing. A packaged README edit changes the release candidate: retain accepted archives and independently qualify the new exact source/archive before dispatching.
|
|
118
117
|
|
|
119
|
-
Source version **0.3.
|
|
118
|
+
Source version **0.3.37** and green PR checks do not establish its qualification; see [#199](https://github.com/aviaratech/ai-delivery/issues/199). Wrappers and workflow definitions do not prove [#200](https://github.com/aviaratech/ai-delivery/issues/200)'s **under-60-second regular checks / under-five-minute qualification** targets. Functional removals and remaining documentation obligations stay with [#201](https://github.com/aviaratech/ai-delivery/issues/201).
|
package/dist/agent.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { ISSUE_COMMENT_BODY_LIMIT } from './issue.js';
|
|
|
10
10
|
export type { IssueCommentInput, IssueCommentReadback } from './issue.js';
|
|
11
11
|
export type { ListIssuesInput, UpdateIssueInput, UpdateIssueResult, IssueClosureReadback } from './issue.js';
|
|
12
12
|
export type { JournalInput } from './issueJournal.js';
|
|
13
|
-
export { prInfo, listPrs, prChecks, publishPr, submitFormalReview
|
|
13
|
+
export { prInfo, listPrs, prChecks, publishPr, submitFormalReview } from './pr.js';
|
|
14
14
|
export { getNativeBlockerRelationships, getNativeBlockingRelationships, replaceBlockedBy, replaceParentIssue, hasNativeSubIssues, } from './github/relationships.js';
|
|
15
15
|
export { normalizeLegacyIssue, planOfflineLegacyIssueMigration } from './services/legacyIssueMigration.js';
|
|
16
16
|
export { withVerificationFilesystemFixture } from './verification.js';
|
package/dist/agent.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
commentIssue
|
|
22
22
|
} from "./issue.js";
|
|
23
23
|
import { ISSUE_COMMENT_BODY_LIMIT } from "./issue.js";
|
|
24
|
-
import { prInfo, listPrs, prChecks, publishPr, submitFormalReview
|
|
24
|
+
import { prInfo, listPrs, prChecks, publishPr, submitFormalReview } from "./pr.js";
|
|
25
25
|
import {
|
|
26
26
|
getNativeBlockerRelationships,
|
|
27
27
|
getNativeBlockingRelationships,
|
|
@@ -45,7 +45,6 @@ export {
|
|
|
45
45
|
discoverDeliveryRouting,
|
|
46
46
|
evaluateAgentReadiness,
|
|
47
47
|
executeTool,
|
|
48
|
-
finishIssue,
|
|
49
48
|
getNativeBlockerRelationships,
|
|
50
49
|
getNativeBlockingRelationships,
|
|
51
50
|
hasNativeSubIssues,
|
|
@@ -56,7 +55,6 @@ export {
|
|
|
56
55
|
listPrs,
|
|
57
56
|
loadDeliveryConfig,
|
|
58
57
|
loadDeliverySettings,
|
|
59
|
-
mergePr,
|
|
60
58
|
normalizeLegacyIssue,
|
|
61
59
|
parseDeliveryConfig,
|
|
62
60
|
planOfflineLegacyIssueMigration,
|
package/dist/agent.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/agent.ts"],
|
|
4
|
-
"sourcesContent": ["export {\n loadDeliveryConfig,\n loadDeliverySettings,\n parseDeliveryConfig,\n resolveDeliveryRoleCredentials,\n} from './config/deliveryConfig.js';\nexport type {\n DeliveryConfig,\n DeliveryRole,\n LoadedDeliveryConfig,\n GitHubDeliveryConfig,\n LoadedGitHubConfig,\n} from './config/deliveryConfig.js';\nexport { createDeliveryGitHubClients } from './github/client.js';\nexport { resolveDeliveryRepo } from './github/repo.js';\nexport { AI_DELIVERY_MCP_CONTRACT_VERSION, AI_DELIVERY_MCP_TOOLS, createAiDeliveryMcpServer } from './mcp/index.js';\nexport { executeTool } from './dispatch.js';\nexport { evaluateAgentReadiness } from './services/agentReadinessService.js';\nexport {\n createIssue,\n updateIssue,\n issueInfo,\n readyCheck,\n issueBranch,\n startIssueBranch,\n listIssueSubissues,\n listIssues,\n commentIssue,\n} from './issue.js';\nexport { ISSUE_COMMENT_BODY_LIMIT } from './issue.js';\nexport type { IssueCommentInput, IssueCommentReadback } from './issue.js';\nexport type { ListIssuesInput, UpdateIssueInput, UpdateIssueResult, IssueClosureReadback } from './issue.js';\nexport type { JournalInput } from './issueJournal.js';\nexport { prInfo, listPrs, prChecks, publishPr, submitFormalReview
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,SAAS,mCAAmC;AAC5C,SAAS,2BAA2B;AACpC,SAAS,kCAAkC,uBAAuB,iCAAiC;AACnG,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gCAAgC;AAIzC,SAAS,QAAQ,SAAS,UAAU,WAAW,
|
|
4
|
+
"sourcesContent": ["export {\n loadDeliveryConfig,\n loadDeliverySettings,\n parseDeliveryConfig,\n resolveDeliveryRoleCredentials,\n} from './config/deliveryConfig.js';\nexport type {\n DeliveryConfig,\n DeliveryRole,\n LoadedDeliveryConfig,\n GitHubDeliveryConfig,\n LoadedGitHubConfig,\n} from './config/deliveryConfig.js';\nexport { createDeliveryGitHubClients } from './github/client.js';\nexport { resolveDeliveryRepo } from './github/repo.js';\nexport { AI_DELIVERY_MCP_CONTRACT_VERSION, AI_DELIVERY_MCP_TOOLS, createAiDeliveryMcpServer } from './mcp/index.js';\nexport { executeTool } from './dispatch.js';\nexport { evaluateAgentReadiness } from './services/agentReadinessService.js';\nexport {\n createIssue,\n updateIssue,\n issueInfo,\n readyCheck,\n issueBranch,\n startIssueBranch,\n listIssueSubissues,\n listIssues,\n commentIssue,\n} from './issue.js';\nexport { ISSUE_COMMENT_BODY_LIMIT } from './issue.js';\nexport type { IssueCommentInput, IssueCommentReadback } from './issue.js';\nexport type { ListIssuesInput, UpdateIssueInput, UpdateIssueResult, IssueClosureReadback } from './issue.js';\nexport type { JournalInput } from './issueJournal.js';\nexport { prInfo, listPrs, prChecks, publishPr, submitFormalReview } from './pr.js';\nexport {\n getNativeBlockerRelationships,\n getNativeBlockingRelationships,\n replaceBlockedBy,\n replaceParentIssue,\n hasNativeSubIssues,\n} from './github/relationships.js';\nexport { normalizeLegacyIssue, planOfflineLegacyIssueMigration } from './services/legacyIssueMigration.js';\nexport { withVerificationFilesystemFixture } from './verification.js';\n\nexport { discoverDeliveryRouting } from './github/discovery.js';\nexport type { DeliveryRouting, DiscoveryClients } from './github/discovery.js';\nexport type { DeliveryOverrides, DeliveryPolicySettings, LoadedDeliverySettings } from './config/deliveryConfig.js';\n\nexport { deliveryHealth } from './services/deliveryHealthService.js';\nexport type { DeliveryHealthRequest } from './services/deliveryHealthService.js';\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,SAAS,mCAAmC;AAC5C,SAAS,2BAA2B;AACpC,SAAS,kCAAkC,uBAAuB,iCAAiC;AACnG,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gCAAgC;AAIzC,SAAS,QAAQ,SAAS,UAAU,WAAW,0BAA0B;AACzE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB,uCAAuC;AACtE,SAAS,yCAAyC;AAElD,SAAS,+BAA+B;AAIxC,SAAS,sBAAsB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -50,20 +50,6 @@ const cases = [
|
|
|
50
50
|
"Review artifact is empty; provide the independent review artifact JSON.",
|
|
51
51
|
"too_small",
|
|
52
52
|
["artifact"]
|
|
53
|
-
],
|
|
54
|
-
[
|
|
55
|
-
"issue_pr_merge",
|
|
56
|
-
{ issueNumber: 17, prNumber: 23, reviewedHeadSha: "bad" },
|
|
57
|
-
"Reviewed head is invalid; provide the exact 40-character lowercase commit SHA.",
|
|
58
|
-
"invalid_format",
|
|
59
|
-
["reviewedHeadSha"]
|
|
60
|
-
],
|
|
61
|
-
[
|
|
62
|
-
"issue_pr_merge",
|
|
63
|
-
{ prNumber: 23 },
|
|
64
|
-
"Direct merge is missing its issue number; provide issueNumber.",
|
|
65
|
-
"custom",
|
|
66
|
-
["issueNumber"]
|
|
67
53
|
]
|
|
68
54
|
];
|
|
69
55
|
afterEach(() => vi.restoreAllMocks());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/callerErrors.test.ts"],
|
|
4
|
-
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';\nimport { afterEach, test, vi } from 'vitest';\nimport { z } from 'zod';\nimport { IssueValidationError } from './issueContract.js';\nimport { executeTool } from './dispatch.js';\nimport * as issues from './issue.js';\nimport { createAiDeliveryMcpServer } from './mcp/index.js';\nimport type { AiDeliveryMcpToolName } from './mcp/tools.js';\n\nconst cases: [AiDeliveryMcpToolName, Record<string, unknown>, string, string, string[]][] = [\n ['issue_start', { title: '' }, 'Issue title is empty; enter a title.', 'too_small', ['title']],\n [\n 'issue_start',\n { title: 'x'.repeat(257) },\n 'Issue title exceeds 256 characters; shorten the title.',\n 'too_big',\n ['title'],\n ],\n [\n 'issue_update',\n { issueNumber: 17, closeReason: 'completed' },\n 'Closure details require a closed issue; set state to closed.',\n 'closure.state',\n ['state'],\n ],\n [\n 'issue_pr_create',\n { issueNumber: 17, head: 'one', headBranch: 'two' },\n 'PR head selectors disagree; use the same branch for head and headBranch.',\n 'custom',\n [],\n ],\n [\n 'issue_pr_create',\n { issueNumber: 17, title: '' },\n 'PR title is empty; enter a title or omit it to use the issue title.',\n 'too_small',\n ['title'],\n ],\n [\n 'issue_pr_create',\n { issueNumber: 17, body: '' },\n 'PR body is empty; enter a body or omit it to use the default body.',\n 'too_small',\n ['body'],\n ],\n [\n 'issue_pr_review',\n { issueNumber: 17, prNumber: 23, artifact: '' },\n 'Review artifact is empty; provide the independent review artifact JSON.',\n 'too_small',\n ['artifact'],\n ],\n
|
|
5
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAClC,SAAS,WAAW,MAAM,UAAU;AACpC,SAAS,SAAS;AAClB,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,YAAY,YAAY;AACxB,SAAS,iCAAiC;AAG1C,MAAM,QAAsF;AAAA,EAC1F,CAAC,eAAe,EAAE,OAAO,GAAG,GAAG,wCAAwC,aAAa,CAAC,OAAO,CAAC;AAAA,EAC7F;AAAA,IACE;AAAA,IACA,EAAE,OAAO,IAAI,OAAO,GAAG,EAAE;AAAA,IACzB;AAAA,IACA;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAAA,EACA;AAAA,IACE;AAAA,IACA,EAAE,aAAa,IAAI,aAAa,YAAY;AAAA,IAC5C;AAAA,IACA;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAAA,EACA;AAAA,IACE;AAAA,IACA,EAAE,aAAa,IAAI,MAAM,OAAO,YAAY,MAAM;AAAA,IAClD;AAAA,IACA;AAAA,IACA,CAAC;AAAA,EACH;AAAA,EACA;AAAA,IACE;AAAA,IACA,EAAE,aAAa,IAAI,OAAO,GAAG;AAAA,IAC7B;AAAA,IACA;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAAA,EACA;AAAA,IACE;AAAA,IACA,EAAE,aAAa,IAAI,MAAM,GAAG;AAAA,IAC5B;AAAA,IACA;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAAA,EACA;AAAA,IACE;AAAA,IACA,EAAE,aAAa,IAAI,UAAU,IAAI,UAAU,GAAG;AAAA,IAC9C;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AAAA,EACb;
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';\nimport { afterEach, test, vi } from 'vitest';\nimport { z } from 'zod';\nimport { IssueValidationError } from './issueContract.js';\nimport { executeTool } from './dispatch.js';\nimport * as issues from './issue.js';\nimport { createAiDeliveryMcpServer } from './mcp/index.js';\nimport type { AiDeliveryMcpToolName } from './mcp/tools.js';\n\nconst cases: [AiDeliveryMcpToolName, Record<string, unknown>, string, string, string[]][] = [\n ['issue_start', { title: '' }, 'Issue title is empty; enter a title.', 'too_small', ['title']],\n [\n 'issue_start',\n { title: 'x'.repeat(257) },\n 'Issue title exceeds 256 characters; shorten the title.',\n 'too_big',\n ['title'],\n ],\n [\n 'issue_update',\n { issueNumber: 17, closeReason: 'completed' },\n 'Closure details require a closed issue; set state to closed.',\n 'closure.state',\n ['state'],\n ],\n [\n 'issue_pr_create',\n { issueNumber: 17, head: 'one', headBranch: 'two' },\n 'PR head selectors disagree; use the same branch for head and headBranch.',\n 'custom',\n [],\n ],\n [\n 'issue_pr_create',\n { issueNumber: 17, title: '' },\n 'PR title is empty; enter a title or omit it to use the issue title.',\n 'too_small',\n ['title'],\n ],\n [\n 'issue_pr_create',\n { issueNumber: 17, body: '' },\n 'PR body is empty; enter a body or omit it to use the default body.',\n 'too_small',\n ['body'],\n ],\n [\n 'issue_pr_review',\n { issueNumber: 17, prNumber: 23, artifact: '' },\n 'Review artifact is empty; provide the independent review artifact JSON.',\n 'too_small',\n ['artifact'],\n ],\n];\nafterEach(() => vi.restoreAllMocks());\n\nfor (const [tool, input, message, code, path] of cases) {\n test(`${tool}: ${message}`, async () => {\n const load = vi.spyOn(issues, 'loadDeliveryContext');\n await assert.rejects(executeTool(tool, input, { repoRoot: '/unrelated', repo: 'example/widget' }), (error) => {\n if (error instanceof IssueValidationError) {\n assert.deepEqual(\n error.failures.map(({ message, code, field }) => ({ message, code, path: [field] })),\n [{ message, code, path }],\n );\n return true;\n }\n assert.ok(error instanceof z.ZodError);\n assert.deepEqual(\n error.issues.slice(0, 1).map(({ message, code, path }) => ({ message, code, path })),\n [{ message, code, path }],\n );\n assert.deepEqual(error.issues.slice(1), []);\n return true;\n });\n const server = createAiDeliveryMcpServer({ repoRoot: '/unrelated', repo: 'example/widget' });\n const client = new Client({ name: 'caller-errors', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n const reply = await client.callTool({ name: tool, arguments: input });\n assert.equal(reply.isError, true);\n assert.ok(JSON.stringify(reply.content).includes(message));\n assert.equal(load.mock.calls.length, 0);\n } finally {\n await client.close();\n await server.close();\n }\n });\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAClC,SAAS,WAAW,MAAM,UAAU;AACpC,SAAS,SAAS;AAClB,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,YAAY,YAAY;AACxB,SAAS,iCAAiC;AAG1C,MAAM,QAAsF;AAAA,EAC1F,CAAC,eAAe,EAAE,OAAO,GAAG,GAAG,wCAAwC,aAAa,CAAC,OAAO,CAAC;AAAA,EAC7F;AAAA,IACE;AAAA,IACA,EAAE,OAAO,IAAI,OAAO,GAAG,EAAE;AAAA,IACzB;AAAA,IACA;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAAA,EACA;AAAA,IACE;AAAA,IACA,EAAE,aAAa,IAAI,aAAa,YAAY;AAAA,IAC5C;AAAA,IACA;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAAA,EACA;AAAA,IACE;AAAA,IACA,EAAE,aAAa,IAAI,MAAM,OAAO,YAAY,MAAM;AAAA,IAClD;AAAA,IACA;AAAA,IACA,CAAC;AAAA,EACH;AAAA,EACA;AAAA,IACE;AAAA,IACA,EAAE,aAAa,IAAI,OAAO,GAAG;AAAA,IAC7B;AAAA,IACA;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAAA,EACA;AAAA,IACE;AAAA,IACA,EAAE,aAAa,IAAI,MAAM,GAAG;AAAA,IAC5B;AAAA,IACA;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAAA,EACA;AAAA,IAC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C9E,QAAI;AACF,YAAM,OAAO,QAAQ,eAAe;AACpC,YAAM,OAAO,QAAQ,eAAe;AACpC,YAAM,QAAQ,MAAM,OAAO,SAAS,EAAE,MAAM,MAAM,WAAW,MAAM,CAAC;AACpE,aAAO,MAAM,MAAM,SAAS,IAAI;AAChC,aAAO,GAAG,KAAK,UAAU,MAAM,OAAO,EAAE,SAAS,OAAO,CAAC;AACzD,aAAO,MAAM,KAAK,KAAK,MAAM,QAAQ,CAAC;AAAA,IACxC,UAAE;AACA,YAAM,OAAO,MAAM;AACnB,YAAM,OAAO,MAAM;AAAA,IACrB;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": ["message", "code", "path"]
|
|
7
7
|
}
|
package/dist/cli.js
CHANGED
|
@@ -438,21 +438,6 @@ program.command("review").argument("<action>", "submit or doctor").description("
|
|
|
438
438
|
process.exitCode = 1;
|
|
439
439
|
}
|
|
440
440
|
});
|
|
441
|
-
for (const [command, tool] of [
|
|
442
|
-
["pr:merge", "issue_pr_merge"],
|
|
443
|
-
["finish", "issue_finish"]
|
|
444
|
-
]) {
|
|
445
|
-
program.command(command).requiredOption("--issue <number>").requiredOption("--pr <number>").option("--strategy <method>").option("--reviewed-head <sha>").option("--non-closing", "Retain the referenced issue OPEN; finish refuses this mode").option("--dry-run").action(
|
|
446
|
-
async (o) => run(tool, {
|
|
447
|
-
issueNumber: int(o.issue),
|
|
448
|
-
prNumber: int(o.pr),
|
|
449
|
-
strategy: o.strategy,
|
|
450
|
-
reviewedHeadSha: o.reviewedHead,
|
|
451
|
-
dryRun: o.dryRun === true,
|
|
452
|
-
nonClosing: o.nonClosing
|
|
453
|
-
})
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
441
|
program.command("migrate:legacy-issues").requiredOption("--input-file <path>", "Offline legacy issue inventory JSON").action((o) => {
|
|
457
442
|
const report = planOfflineLegacyIssueMigration(JSON.parse(readFileSync(o.inputFile, "utf8")));
|
|
458
443
|
process.stdout.write(`${JSON.stringify(report, null, 2)}
|
package/dist/cli.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli.ts"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\nimport { closeSync, constants, fstatSync, openSync, readFileSync, readSync, statSync } from 'node:fs';\nimport { createHash } from 'node:crypto';\nimport { createDeliveryGitHubClients } from './github/client.js';\nimport { appCredentialSource, loadDeliverySettings } from './config/deliveryConfig.js';\nimport { Command } from 'commander';\nimport { z } from 'zod';\n\nimport { printCommandError, printCommandResult } from './cliResult.js';\nimport { contextFor, executeTool, type ExecutionContext } from './dispatch.js';\nimport { listIssueSubissues } from './issue.js';\nimport { listPrs, preflightReviewRoute, prChecks, submitFormalReview } from './pr.js';\nimport {\n assertReviewVerdictTarget,\n buildReviewArtifact,\n parseReviewVerdict,\n readGitHubReviewBase,\n ReviewSubmissionError,\n validateReviewTarget,\n} from './review.js';\nimport { serveAiDeliveryMcp } from './mcp/index.js';\nimport type { AiDeliveryMcpToolName } from './mcp/tools.js';\nimport { planOfflineLegacyIssueMigration } from './services/legacyIssueMigration.js';\nimport { PACKAGE_VERSION } from './version.js';\nimport { managePlugin } from './pluginInstaller.js';\nimport { IssueWriteSchema, IssueStatusPatch, IssueDeferralPatch, ProjectStatusPatch } from './issueContract.js';\nimport { NativeIssueDateFields } from './github/nativeIssueMetadata.js';\nimport { DeliveryError } from './errors.js';\nimport { parseBoardReconcileRequest } from './services/boardReconcileService.js';\nimport { renderDeliveryBoard, type DeliveryBoardResult } from './deliveryBoard.js';\n\nconst program = new Command();\nprogram\n .name('ai-delivery')\n .description('Generic GitHub issue and pull request delivery')\n .version(PACKAGE_VERSION)\n .option('--identity <name>', 'Configured author or reviewer identity')\n .option('--personal-auth', 'Explicit legacy personal-token author override')\n .option('--json', 'Print JSON output')\n .option('--verbose', 'Include full bodies, diffs and routing with --json')\n .option('--repo <owner/name>', 'GitHub repository owner/name; works from any directory')\n .option('--repo-root <path>', 'Launch directory or explicit clone for local operations', process.cwd());\n\n// Only the plugin command group owns a local --version input. Skip global option\n// values when selecting its parser so an unrelated argument named plugin has no effect.\nfor (let index = 2; index < process.argv.length; index++) {\n const argument = process.argv[index]!;\n const option = program.options.find((value) => value.long === argument.split('=')[0] || value.short === argument);\n if (option) {\n if (option.required && !argument.includes('=')) index++;\n continue;\n }\n if (argument === 'plugin') program.enablePositionalOptions();\n break;\n}\n\nfunction execution(): ExecutionContext {\n const options = program.opts<{\n identity?: string;\n personalAuth?: boolean;\n repo?: string;\n repoRoot: string;\n verbose?: boolean;\n }>();\n const identity = (options.identity ?? process.env.AI_DELIVERY_IDENTITY)?.trim() || undefined;\n return {\n repoRoot: options.repoRoot,\n ...(options.verbose === true ? { verbose: true } : {}),\n ...(identity === undefined ? {} : { identity }),\n personalAuth: options.personalAuth === true,\n ...(options.repo === undefined ? {} : { repo: options.repo }),\n };\n}\nfunction int(value: string | undefined): number | undefined {\n return value === undefined ? undefined : Number(value);\n}\nfunction list(value: string | undefined): string[] | undefined {\n return value === undefined\n ? undefined\n : value\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean);\n}\nfunction ints(value: string | undefined): number[] | undefined {\n return list(value)?.map(Number);\n}\nfunction body(value: string | undefined, file: string | undefined): string | undefined {\n if (value !== undefined && file !== undefined) throw new Error('Pass either --body or --body-file.');\n return file === undefined ? value : readFileSync(file, 'utf8');\n}\nfunction fields(file: string | undefined, overrides: Record<string, unknown>, update = false): Record<string, unknown> {\n const value: unknown = file === undefined ? {} : JSON.parse(readFileSync(file, 'utf8'));\n return {\n ...IssueWriteSchema.extend({\n ...NativeIssueDateFields,\n ...IssueDeferralPatch,\n status: IssueStatusPatch.optional(),\n ...(update ? { projectStatus: ProjectStatusPatch.optional() } : {}),\n preserveHistory: z.boolean().optional(),\n }).parse(value),\n ...Object.fromEntries(Object.entries(overrides).filter(([, item]) => item !== undefined)),\n };\n}\nfunction run(name: AiDeliveryMcpToolName, input: Record<string, unknown>): Promise<void> {\n const options = program.opts<{ json?: boolean; verbose?: boolean }>();\n return executeTool(name, input, execution()).then((value) =>\n printCommandResult(name, value, options.json === true && options.verbose === true),\n );\n}\nfunction print(value: unknown): void {\n process.stdout.write(`${JSON.stringify(value, null, 2)}\\n`);\n}\nfunction reconciliationFile(path: string): unknown {\n const limit = 16 * 1024 * 1024;\n const stat = statSync(path);\n if (!stat.isFile() || stat.size > limit)\n throw new DeliveryError('Reconciliation files must be regular UTF-8 JSON files of at most 16 MiB.');\n const bytes = readFileSync(path);\n if (bytes.byteLength > limit) throw new DeliveryError('Reconciliation files exceed 16 MiB.');\n return JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes)) as unknown;\n}\n\nconst plugin = program.command('plugin').description('Manage the ai-delivery native plugin');\nfor (const action of ['install', 'doctor', 'preview', 'update', 'rollback', 'remove'] as const) {\n const command = plugin\n .command(action)\n .requiredOption('--host <host>', 'Native host: codex or claude-code')\n .option('--scope <scope>', 'Native scope: user, project, or local; Codex supports user', 'user')\n .option('--dry-run', 'Describe the selected target without changing files or contacting native tools')\n .option('--json', 'Print the result as JSON');\n if (action === 'install' || action === 'update')\n command.requiredOption('--version <version>', 'Explicit published package version');\n if (action === 'doctor')\n command.option('--check-auth', 'Read configured role identities and repository access; requires explicit --repo');\n command.action(\n async (options: {\n host: string;\n scope: string;\n version?: string;\n dryRun?: boolean;\n json?: boolean;\n checkAuth?: boolean;\n }) => {\n const result = await managePlugin({\n action,\n host: options.host,\n scope: options.scope,\n ...(options.version === undefined ? {} : { version: options.version }),\n dryRun: options.dryRun === true,\n checkAuth: options.checkAuth === true,\n ...(options.checkAuth && execution().repo ? { repo: execution().repo } : {}),\n repoRoot: execution().repoRoot,\n });\n if (options.json) {\n print(result);\n return;\n }\n process.stdout.write(\n `${result.dryRun ? 'Dry run: ' : ''}${result.host} ${result.scope}: ${action}; version ${result.version ?? 'none'}; installed ${result.installed}; changed ${result.changed}\\n`,\n );\n if (result.mcp)\n process.stdout.write(\n `Bundled MCP startup: ${result.mcp.startup}${result.mcp.error ? ` (${result.mcp.error})` : ''}\\n`,\n );\n if (result.diagnostics) {\n process.stdout.write(\n `Registration observations: ${result.diagnostics.registrations.length}; completeness ${result.diagnostics.completeness}; migration ${result.diagnostics.migration}; planned changes ${result.diagnostics.plannedChanges.length}\\n`,\n );\n for (const entry of result.diagnostics.registrations)\n process.stdout.write(\n `${entry.kind} ${entry.scope}: ownership ${entry.ownership}; source ${entry.source}; version ${entry.version ?? 'unknown'}\\n`,\n );\n process.stdout.write(`Unverified conditions: ${result.diagnostics.findings.join(', ')}\\n`);\n }\n if (result.activation)\n process.stdout.write(\n `Native session loaded version: unverified. Installed observation: ${result.activation.installedVersion ?? 'unknown'}; separate startup: ${result.activation.startupVersion ?? 'not checked'}. Use the host's surface-specific activation guidance.\\n`,\n );\n if (result.recoveryRequired)\n process.stdout.write('Resume the interrupted original plugin command to recover this target.\\n');\n if (result.authProbe)\n process.stdout.write(\n `Selected-runtime CLI auth probe: ${result.authProbe.outcome}; settings ${result.authProbe.settings}; process references ${result.authProbe.processReferences.status}; authentication ${result.authProbe.authentication.status}; repository access ${result.authProbe.repositoryAccess.status}${result.authProbe.reason ? ` (${result.authProbe.reason})` : ''}\\nNative GUI credential propagation and counted exact-head approval remain unverified.\\n`,\n );\n },\n );\n}\n\nprogram\n .command('create')\n .requiredOption('--title <title>')\n .option('--fields-file <path>', 'UTF-8 JSON typed fields; explicit CLI fields take precedence')\n .option('--epic', 'Create an active unsized parent issue')\n .option('--op-id <id>', 'Stable identity for retrying the same create')\n .option('--draft', 'Explicitly write an incomplete parked draft')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Required explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .action(async (o: Record<string, string> & { draft?: boolean; epic?: boolean }) =>\n run(\n 'issue_create',\n fields(o.fieldsFile, {\n title: o.title,\n epic: o.epic,\n opId: o.opId,\n body: body(o.body, o.bodyFile),\n issueType: o.type,\n points: int(o.points),\n priority: o.priority,\n labels: list(o.labels),\n blockedBy: ints(o.blockedBy),\n blocks: ints(o.blocks),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone),\n parentIssueNumber: int(o.parent),\n ...(o.draft === true ? { draft: true } : {}),\n }),\n ),\n );\n\nprogram\n .command('start')\n .option('--issue <number>')\n .option('--request <text>')\n .option('--request-id <id>', 'Stable retry identity for a new issue start')\n .option('--title <title>')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Capacity override reason, or explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .option('--branch <branch>')\n .option('--resume-created')\n .action(async (o: Record<string, string | boolean>) =>\n run('issue_start', {\n issueNumber: int(o.issue as string),\n request: o.request,\n requestId: o.requestId,\n title: o.title,\n body: body(o.body as string, o.bodyFile as string),\n issueType: o.type,\n points: int(o.points as string),\n priority: o.priority,\n labels: list(o.labels as string),\n blockedBy: ints(o.blockedBy as string),\n blocks: ints(o.blocks as string),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone as string),\n parentIssueNumber: int(o.parent as string),\n branch: o.branch,\n resumeCreated: o.resumeCreated === true,\n }),\n );\n\nfor (const name of ['list', 'search'] as const) {\n program\n .command(name)\n .option('--query <text>', 'Literal text to search in the selected repository')\n .option('--state <state>')\n .option('--labels <labels>')\n .option('--parent <number>')\n .option('--type <type>')\n .option('--project-status <status>')\n .option('--updated-since <timestamp>')\n .option('--page <number>')\n .option('--per-page <number>')\n .action(async (o: Record<string, string>) =>\n run(name === 'list' ? 'issue_list' : 'issue_search', {\n query: o.query,\n state: o.state,\n labels: list(o.labels),\n parentIssueNumber: int(o.parent),\n issueType: o.type,\n projectStatus: o.projectStatus,\n updatedSince: o.updatedSince,\n page: int(o.page),\n perPage: int(o.perPage),\n }),\n );\n}\n\nprogram\n .command('update')\n .requiredOption('--issue <number>')\n .option('--fields-file <path>', 'UTF-8 JSON typed issue field patch')\n .option('--draft', 'Explicitly write an incomplete parked draft')\n .option('--title <title>')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Required explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .option('--state <state>')\n .option('--project-status <status>', 'Set Todo, In Progress, Blocked or Done with a public reason')\n .option('--project-status-reason <reason>', 'Required public reason for an explicit Project Status')\n .option('--preserve-history', 'Preserve the previous title and body before a rewrite')\n .option('--close-reason <reason>')\n .option('--superseded-by <number>')\n .option('--park', 'Park execution while retaining the issue worktree')\n .option('--defer', 'Defer until an explicit undefer')\n .option('--defer-until <date>', 'Record an ISO date condition without automatic undeferral')\n .option('--defer-trigger <text>', 'Record the condition for reconsidering deferred work')\n .option('--undefer', 'Explicitly clear deferral; draft and park remain unchanged')\n .action(\n async (\n o: Record<string, string> & {\n park?: boolean;\n preserveHistory?: boolean;\n draft?: boolean;\n defer?: boolean;\n undefer?: boolean;\n },\n ) =>\n run(\n 'issue_update',\n fields(\n o.fieldsFile,\n {\n issueNumber: int(o.issue),\n title: o.title,\n ...(o.draft === true ? { draft: true } : {}),\n body: body(o.body, o.bodyFile),\n issueType: o.type,\n points: int(o.points),\n priority: o.priority,\n labels: list(o.labels),\n blockedBy: ints(o.blockedBy),\n blocks: ints(o.blocks),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone),\n parentIssueNumber: int(o.parent),\n state: o.state,\n projectStatus:\n o.projectStatus === undefined && o.projectStatusReason === undefined\n ? undefined\n : ProjectStatusPatch.parse({ status: o.projectStatus, reason: o.projectStatusReason }),\n preserveHistory: o.preserveHistory === true ? true : undefined,\n closeReason: o.closeReason,\n supersededBy: int(o.supersededBy),\n park: o.park === true ? true : undefined,\n defer:\n o.defer === true || o.deferUntil !== undefined || o.deferTrigger !== undefined\n ? {\n ...(o.deferUntil === undefined ? {} : { until: o.deferUntil }),\n ...(o.deferTrigger === undefined ? {} : { trigger: o.deferTrigger }),\n }\n : undefined,\n undefer: o.undefer === true ? true : undefined,\n },\n true,\n ),\n ),\n );\n\nprogram\n .command('board')\n .description('Read delivery attention and readiness for explicit repositories')\n .requiredOption('--repos <owner/repo,...>', 'Explicit GitHub repositories, separated by commas')\n .option('--decision-labels <label,...>', 'Additional labels that signal human attention')\n .option('--json', 'Print the complete board as JSON')\n .action(async (options: { repos: string; decisionLabels?: string; json?: boolean }) => {\n // Preserve empty selectors and control characters for the common validator.\n const result = (await executeTool(\n 'delivery_board',\n { repos: options.repos.split(','), decisionLabels: options.decisionLabels?.split(',') },\n execution(),\n )) as DeliveryBoardResult;\n if (options.json || program.opts<{ json?: boolean }>().json) print(result);\n else process.stdout.write(`${renderDeliveryBoard(result)}\\n`);\n });\n\nprogram\n .command('board:reconcile')\n .description('Plan or apply bounded Project reconciliation for explicit repositories')\n .requiredOption('--repositories <owner/repo...>', '1\u201310 explicit GitHub repositories')\n .option('--checkouts-file <path>', 'UTF-8 JSON checkout selectors for dry-run')\n .option('--dry-run', 'Collect a plan without writes (default)')\n .option('--apply', 'Apply the retained original plan')\n .option('--plan-file <path>', 'Original complete reconciliation plan JSON')\n .option('--prior-result-file <path>', 'Optional prior result JSON for the exact original plan')\n .action(\n async (options: {\n repositories: string[];\n checkoutsFile?: string;\n dryRun?: boolean;\n apply?: boolean;\n planFile?: string;\n priorResultFile?: string;\n }) => {\n if (options.dryRun && options.apply) throw new DeliveryError('Choose either --dry-run or --apply.');\n const request = parseBoardReconcileRequest({\n repositories: options.repositories,\n ...(execution().repo === undefined ? {} : { repo: execution().repo }),\n mode: options.apply ? 'apply' : 'dry-run',\n ...(options.checkoutsFile === undefined ? {} : { checkouts: reconciliationFile(options.checkoutsFile) }),\n ...(options.planFile === undefined ? {} : { plan: reconciliationFile(options.planFile) }),\n ...(options.priorResultFile === undefined ? {} : { priorResult: reconciliationFile(options.priorResultFile) }),\n });\n return run('board_reconcile', request);\n },\n );\n\nprogram\n .command('batch:update')\n .description('Plan or apply 1\u201350 current-repository issue updates with ordered readback')\n .requiredOption('--items-file <path>', 'UTF-8 JSON array of complete issue_update inputs')\n .option('--dry-run', 'Return plans and readback without any native writes')\n .action(async (o: { itemsFile: string; dryRun?: boolean }) =>\n run('issue_batch_update', {\n items: JSON.parse(readFileSync(o.itemsFile, 'utf8')) as unknown,\n dryRun: o.dryRun === true,\n }),\n );\n\nprogram\n .command('health')\n .requiredOption('--from <utc>', 'Inclusive UTC ISO timestamp')\n .requiredOption('--to <utc>', 'Exclusive UTC ISO timestamp')\n .option('--max-issues <number>')\n .option('--max-timeline-pages <number>')\n .option('--max-project-pages <number>')\n .option('--oldest-limit <number>')\n .action(async (o: Record<string, string>) =>\n run('delivery_health', {\n repo: execution().repo,\n from: o.from,\n to: o.to,\n maxIssues: int(o.maxIssues),\n maxTimelinePages: int(o.maxTimelinePages),\n maxProjectPages: int(o.maxProjectPages),\n oldestLimit: int(o.oldestLimit),\n }),\n );\nprogram\n .command('info')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => run('issue_info', { issueNumber: int(o.issue) }));\nprogram\n .command('ready:check')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => run('issue_ready_check', { issueNumber: int(o.issue) }));\nfor (const field of ['parent', 'blockers'] as const) {\n program\n .command(field)\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => {\n const info = (await executeTool('issue_info', { issueNumber: int(o.issue) }, execution())) as {\n parentIssueNumber: number | null;\n blockedBy: number[];\n };\n print(\n field === 'parent'\n ? { issueNumber: int(o.issue), parentIssueNumber: info.parentIssueNumber }\n : { issueNumber: int(o.issue), blockedBy: info.blockedBy },\n );\n });\n}\nprogram\n .command('subissues')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => {\n const context = await contextFor(execution(), 'subissues');\n print({ issueNumber: int(o.issue), subissues: await listIssueSubissues(context, Number(o.issue)) });\n });\nprogram\n .command('pr:create')\n .description('Create or reuse an issue-closing PR from a pushed --head, from any directory.')\n .requiredOption('--issue <number>')\n .option('--pr <number>', 'Exact existing PR selector; never creates a replacement')\n .option('--non-closing', 'Retain the issue OPEN using native non-closing reference proof')\n .option(\n '--reconcile-non-closing-reference',\n 'Explicit native closing-pair removal request; caller must hold exact authority and reconcile prior attempts',\n )\n .option('--expected-head <sha>', 'Exact source SHA for the explicit reference action')\n .option('--expected-base <sha>', 'Exact default-base SHA for the explicit reference action')\n .option('--title <title>')\n .option('--body-file <path>')\n .option('--head <branch>', 'Pushed remote head; no ai-delivery branch or worktree setup required')\n .option('--base <branch>', 'Repository default branch (inferred when omitted)')\n .option('--ready', 'Publish ready, or promote the author-owned PR selected by --head')\n .option('--dry-run')\n .action(\n async (o: {\n issue: string;\n pr?: string;\n nonClosing?: boolean;\n reconcileNonClosingReference?: boolean;\n expectedHead?: string;\n expectedBase?: string;\n title?: string;\n bodyFile?: string;\n head?: string;\n base?: string;\n ready?: boolean;\n dryRun?: boolean;\n }) =>\n run('issue_pr_create', {\n issueNumber: int(o.issue),\n prNumber: int(o.pr),\n nonClosing: o.nonClosing,\n reconcileNonClosingReference: o.reconcileNonClosingReference,\n expectedHeadSha: o.expectedHead,\n expectedBaseSha: o.expectedBase,\n title: o.title,\n body: body(undefined, o.bodyFile),\n headBranch: o.head,\n base: o.base,\n draft: o.ready !== true,\n dryRun: o.dryRun === true,\n }),\n );\nprogram\n .command('pr:info')\n .description('Inspect an exact PR; combine --issue and --pr to verify its native closing-issue association.')\n .option('--non-closing', 'Verify an exact native non-closing PR-to-issue reference')\n .option('--issue <number>', 'Issue to verify; issue-only lookup requires a GitHub-linked branch')\n .option('--pr <number>', 'Exact PR number; include --issue after issue branch links are replaced on publication')\n .action(async (o: { issue?: string; pr?: string; nonClosing?: boolean }) =>\n run('issue_pr_info', { issueNumber: int(o.issue), prNumber: int(o.pr), nonClosing: o.nonClosing }),\n );\nprogram\n .command('pr:list')\n .option('--state <state>', 'open, closed or all', 'open')\n .action(async (o: { state: string }) => {\n if (!['open', 'closed', 'all'].includes(o.state)) throw new Error('Invalid PR state.');\n const context = await contextFor(execution(), 'pr:list');\n print(await listPrs(context, o.state as 'open' | 'closed' | 'all'));\n });\nprogram\n .command('pr:checks')\n .requiredOption('--pr <number>')\n .action(async (o: { pr: string }) => {\n const context = await contextFor(execution(), 'pr:checks');\n print(await prChecks(context, Number(o.pr)));\n });\nprogram\n .command('pr:review')\n .requiredOption('--issue <number>')\n .requiredOption('--pr <number>')\n .requiredOption('--artifact <path>', 'Path to a UTF-8 JSON review artifact file (not inline JSON)')\n .option('--non-closing', 'Retain the referenced issue OPEN; finish refuses this mode')\n .option('--dry-run')\n .action(async (o: { issue: string; pr: string; artifact: string; dryRun?: boolean; nonClosing?: boolean }) =>\n run('issue_pr_review', {\n issueNumber: int(o.issue),\n prNumber: int(o.pr),\n artifact: readFileSync(o.artifact, 'utf8'),\n dryRun: o.dryRun === true,\n nonClosing: o.nonClosing,\n }),\n );\nprogram\n .command('review')\n .argument('<action>', 'submit or doctor')\n .description('Submit an independent verdict or check its configured App')\n .option('--pr <number>', 'Required for submit')\n .option('--head <sha>', 'Required exact head for submit')\n .option('--identity <name>', 'Required configured reviewer profile')\n .option('--verdict <path>', 'Required for submit: UTF-8 JSON verdict, at most 64 KiB')\n .action(async (action: string, o: { pr?: string; head?: string; identity?: string; verdict?: string }) => {\n if (!['submit', 'doctor'].includes(action)) throw new DeliveryError('review action must be submit or doctor.');\n const identity = o.identity ?? execution().identity ?? '';\n const settings = await loadDeliverySettings(undefined, { reviewerIdentity: identity, prepareEnvironment: true });\n const profile = settings.roles.reviewer;\n if (!('appId' in profile))\n throw new DeliveryError('identity: Select a reviewer profile with explicit App/provider binding.');\n if (action === 'doctor') {\n if (o.pr !== undefined || o.head !== undefined || o.verdict !== undefined)\n throw new DeliveryError('review doctor does not accept submission inputs.');\n const clients = await createDeliveryGitHubClients({\n config: settings,\n identity,\n role: 'reviewer',\n env: settings.environment!,\n });\n const actorLogin = await clients.appActorLogin!();\n printCommandResult('review:doctor', {\n status: 'authenticated',\n identity,\n provider: profile.provider,\n appId: profile.appId,\n installationId: profile.installationId,\n actorLogin,\n source: appCredentialSource(profile).type,\n });\n return;\n }\n if (o.pr === undefined || o.head === undefined || o.verdict === undefined)\n throw new DeliveryError('review submit requires --pr, --head and --verdict.');\n const fd = openSync(o.verdict, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);\n let raw: string;\n let verdictFileSha256: string;\n try {\n if (!fstatSync(fd).isFile()) throw new DeliveryError('verdict: Expected a regular file.');\n const bytes = Buffer.alloc(64 * 1024 + 1);\n let size = 0;\n while (size < bytes.length) {\n const count = readSync(fd, bytes, size, bytes.length - size, null);\n if (count === 0) break;\n size += count;\n }\n if (size > 64 * 1024) throw new DeliveryError('verdict: File exceeds 64 KiB.');\n const content = bytes.subarray(0, size);\n raw = content.toString('utf8');\n if (!Buffer.from(raw, 'utf8').equals(content)) throw new DeliveryError('verdict: Expected valid UTF-8.');\n verdictFileSha256 = `sha256:${createHash('sha256').update(content).digest('hex')}`;\n } finally {\n closeSync(fd);\n }\n const verdict = parseReviewVerdict(raw);\n assertReviewVerdictTarget(verdict, profile.provider, o.head);\n const prNumber = z.number().int().positive().parse(Number(o.pr));\n const authorContext = await contextFor(\n { ...execution(), settings, identity, reviewSubmission: true },\n 'pr:info',\n 'author',\n );\n const reviewBase = await readGitHubReviewBase(authorContext, prNumber, o.head);\n const artifact = buildReviewArtifact({\n verdict,\n verdictFileSha256,\n identity,\n provider: profile.provider,\n expectedHead: o.head,\n prNumber,\n authorIdentity: settings.roles.author.identity,\n reviewBase,\n });\n await validateReviewTarget(authorContext, artifact, prNumber);\n const clients = await createDeliveryGitHubClients({\n config: authorContext.config,\n identity,\n role: 'reviewer',\n selectedAuthor: authorContext.clients,\n ...(authorContext.credentialEnvironment === undefined ? {} : { env: authorContext.credentialEnvironment }),\n });\n const context = { ...authorContext, clients };\n try {\n printCommandResult(\n 'review:submit',\n await submitFormalReview(context, {\n artifact: JSON.stringify(artifact),\n issueNumber: verdict.issueNumber,\n prNumber,\n ...(verdict.nonClosing === undefined ? {} : { nonClosing: verdict.nonClosing }),\n }),\n );\n } catch (error) {\n if (!(error instanceof ReviewSubmissionError)) throw error;\n process.stdout.write(\n `${JSON.stringify({ status: 'submission-unverified', submission: error.submission, nextAction: error.message })}\\n`,\n );\n process.exitCode = 1;\n }\n });\n\nfor (const [command, tool] of [\n ['pr:merge', 'issue_pr_merge'],\n ['finish', 'issue_finish'],\n] as const) {\n program\n .command(command)\n .requiredOption('--issue <number>')\n .requiredOption('--pr <number>')\n .option('--strategy <method>')\n .option('--reviewed-head <sha>')\n .option('--non-closing', 'Retain the referenced issue OPEN; finish refuses this mode')\n .option('--dry-run')\n .action(\n async (o: {\n issue: string;\n pr: string;\n strategy?: string;\n reviewedHead?: string;\n dryRun?: boolean;\n nonClosing?: boolean;\n }) =>\n run(tool, {\n issueNumber: int(o.issue),\n prNumber: int(o.pr),\n strategy: o.strategy,\n reviewedHeadSha: o.reviewedHead,\n dryRun: o.dryRun === true,\n nonClosing: o.nonClosing,\n }),\n );\n}\nprogram\n .command('migrate:legacy-issues')\n .requiredOption('--input-file <path>', 'Offline legacy issue inventory JSON')\n .action((o: { inputFile: string }) => {\n const report = planOfflineLegacyIssueMigration(JSON.parse(readFileSync(o.inputFile, 'utf8')) as unknown);\n process.stdout.write(`${JSON.stringify(report, null, 2)}\\n`);\n });\nprogram\n .command('config:resolve')\n .description('Read the effective GitHub destination and admission digest')\n .action(async () => {\n const context = await contextFor(execution(), 'config:resolve');\n print({\n configDigest: context.configuration?.configDigest,\n routing: context.configuration?.routing,\n reviewRoute: await preflightReviewRoute(context, undefined, undefined, 'development'),\n });\n });\nprogram.command('mcp:serve').action(async () => serveAiDeliveryMcp(execution()));\n\nprogram.parseAsync(process.argv).catch((error: unknown) => {\n const options = program.opts<{ json?: boolean; verbose?: boolean }>();\n printCommandError(error, options.json === true && options.verbose === true);\n});\n"],
|
|
5
|
-
"mappings": ";AACA,SAAS,WAAW,WAAW,WAAW,UAAU,cAAc,UAAU,gBAAgB;AAC5F,SAAS,kBAAkB;AAC3B,SAAS,mCAAmC;AAC5C,SAAS,qBAAqB,4BAA4B;AAC1D,SAAS,eAAe;AACxB,SAAS,SAAS;AAElB,SAAS,mBAAmB,0BAA0B;AACtD,SAAS,YAAY,mBAA0C;AAC/D,SAAS,0BAA0B;AACnC,SAAS,SAAS,sBAAsB,UAAU,0BAA0B;AAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAEnC,SAAS,uCAAuC;AAChD,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,kBAAkB,oBAAoB,0BAA0B;AAC3F,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,2BAAqD;AAE9D,MAAM,UAAU,IAAI,QAAQ;AAC5B,QACG,KAAK,aAAa,EAClB,YAAY,gDAAgD,EAC5D,QAAQ,eAAe,EACvB,OAAO,qBAAqB,wCAAwC,EACpE,OAAO,mBAAmB,gDAAgD,EAC1E,OAAO,UAAU,mBAAmB,EACpC,OAAO,aAAa,oDAAoD,EACxE,OAAO,uBAAuB,wDAAwD,EACtF,OAAO,sBAAsB,2DAA2D,QAAQ,IAAI,CAAC;AAIxG,SAAS,QAAQ,GAAG,QAAQ,QAAQ,KAAK,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AAE,KAAK;AAAA,MACxB,UAAU,IAAI,EAAE,EAAE;AAAA,MAClB,UAAU,EAAE;AAAA,MACZ,iBAAiB,EAAE;AAAA,MACnB,QAAQ,EAAE,WAAW;AAAA,MACrB,YAAY,EAAE;AAAA,IAChB,CAAC;AAAA,EACL;AACJ;AACA,QACG,QAAQ,uBAAuB,EAC/B,eAAe,uBAAuB,qCAAqC,EAC3E,OAAO,CAAC,MAA6B;AACpC,QAAM,SAAS,gCAAgC,KAAK,MAAM,aAAa,EAAE,WAAW,MAAM,CAAC,CAAY;AACvG,UAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAAA,CAAI;AAC7D,CAAC;AACH,QACG,QAAQ,gBAAgB,EACxB,YAAY,4DAA4D,EACxE,OAAO,YAAY;AAClB,QAAM,UAAU,MAAM,WAAW,UAAU,GAAG,gBAAgB;AAC9D,QAAM;AAAA,IACJ,cAAc,QAAQ,eAAe;AAAA,IACrC,SAAS,QAAQ,eAAe;AAAA,IAChC,aAAa,MAAM,qBAAqB,SAAS,QAAW,QAAW,aAAa;AAAA,EACtF,CAAC;AACH,CAAC;AACH,QAAQ,QAAQ,WAAW,EAAE,OAAO,YAAY,mBAAmB,UAAU,CAAC,CAAC;AAE/E,QAAQ,WAAW,QAAQ,IAAI,EAAE,MAAM,CAAC,UAAmB;AACzD,QAAM,UAAU,QAAQ,KAA4C;AACpE,oBAAkB,OAAO,QAAQ,SAAS,QAAQ,QAAQ,YAAY,IAAI;AAC5E,CAAC;",
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\nimport { closeSync, constants, fstatSync, openSync, readFileSync, readSync, statSync } from 'node:fs';\nimport { createHash } from 'node:crypto';\nimport { createDeliveryGitHubClients } from './github/client.js';\nimport { appCredentialSource, loadDeliverySettings } from './config/deliveryConfig.js';\nimport { Command } from 'commander';\nimport { z } from 'zod';\n\nimport { printCommandError, printCommandResult } from './cliResult.js';\nimport { contextFor, executeTool, type ExecutionContext } from './dispatch.js';\nimport { listIssueSubissues } from './issue.js';\nimport { listPrs, preflightReviewRoute, prChecks, submitFormalReview } from './pr.js';\nimport {\n assertReviewVerdictTarget,\n buildReviewArtifact,\n parseReviewVerdict,\n readGitHubReviewBase,\n ReviewSubmissionError,\n validateReviewTarget,\n} from './review.js';\nimport { serveAiDeliveryMcp } from './mcp/index.js';\nimport type { AiDeliveryMcpToolName } from './mcp/tools.js';\nimport { planOfflineLegacyIssueMigration } from './services/legacyIssueMigration.js';\nimport { PACKAGE_VERSION } from './version.js';\nimport { managePlugin } from './pluginInstaller.js';\nimport { IssueWriteSchema, IssueStatusPatch, IssueDeferralPatch, ProjectStatusPatch } from './issueContract.js';\nimport { NativeIssueDateFields } from './github/nativeIssueMetadata.js';\nimport { DeliveryError } from './errors.js';\nimport { parseBoardReconcileRequest } from './services/boardReconcileService.js';\nimport { renderDeliveryBoard, type DeliveryBoardResult } from './deliveryBoard.js';\n\nconst program = new Command();\nprogram\n .name('ai-delivery')\n .description('Generic GitHub issue and pull request delivery')\n .version(PACKAGE_VERSION)\n .option('--identity <name>', 'Configured author or reviewer identity')\n .option('--personal-auth', 'Explicit legacy personal-token author override')\n .option('--json', 'Print JSON output')\n .option('--verbose', 'Include full bodies, diffs and routing with --json')\n .option('--repo <owner/name>', 'GitHub repository owner/name; works from any directory')\n .option('--repo-root <path>', 'Launch directory or explicit clone for local operations', process.cwd());\n\n// Only the plugin command group owns a local --version input. Skip global option\n// values when selecting its parser so an unrelated argument named plugin has no effect.\nfor (let index = 2; index < process.argv.length; index++) {\n const argument = process.argv[index]!;\n const option = program.options.find((value) => value.long === argument.split('=')[0] || value.short === argument);\n if (option) {\n if (option.required && !argument.includes('=')) index++;\n continue;\n }\n if (argument === 'plugin') program.enablePositionalOptions();\n break;\n}\n\nfunction execution(): ExecutionContext {\n const options = program.opts<{\n identity?: string;\n personalAuth?: boolean;\n repo?: string;\n repoRoot: string;\n verbose?: boolean;\n }>();\n const identity = (options.identity ?? process.env.AI_DELIVERY_IDENTITY)?.trim() || undefined;\n return {\n repoRoot: options.repoRoot,\n ...(options.verbose === true ? { verbose: true } : {}),\n ...(identity === undefined ? {} : { identity }),\n personalAuth: options.personalAuth === true,\n ...(options.repo === undefined ? {} : { repo: options.repo }),\n };\n}\nfunction int(value: string | undefined): number | undefined {\n return value === undefined ? undefined : Number(value);\n}\nfunction list(value: string | undefined): string[] | undefined {\n return value === undefined\n ? undefined\n : value\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean);\n}\nfunction ints(value: string | undefined): number[] | undefined {\n return list(value)?.map(Number);\n}\nfunction body(value: string | undefined, file: string | undefined): string | undefined {\n if (value !== undefined && file !== undefined) throw new Error('Pass either --body or --body-file.');\n return file === undefined ? value : readFileSync(file, 'utf8');\n}\nfunction fields(file: string | undefined, overrides: Record<string, unknown>, update = false): Record<string, unknown> {\n const value: unknown = file === undefined ? {} : JSON.parse(readFileSync(file, 'utf8'));\n return {\n ...IssueWriteSchema.extend({\n ...NativeIssueDateFields,\n ...IssueDeferralPatch,\n status: IssueStatusPatch.optional(),\n ...(update ? { projectStatus: ProjectStatusPatch.optional() } : {}),\n preserveHistory: z.boolean().optional(),\n }).parse(value),\n ...Object.fromEntries(Object.entries(overrides).filter(([, item]) => item !== undefined)),\n };\n}\nfunction run(name: AiDeliveryMcpToolName, input: Record<string, unknown>): Promise<void> {\n const options = program.opts<{ json?: boolean; verbose?: boolean }>();\n return executeTool(name, input, execution()).then((value) =>\n printCommandResult(name, value, options.json === true && options.verbose === true),\n );\n}\nfunction print(value: unknown): void {\n process.stdout.write(`${JSON.stringify(value, null, 2)}\\n`);\n}\nfunction reconciliationFile(path: string): unknown {\n const limit = 16 * 1024 * 1024;\n const stat = statSync(path);\n if (!stat.isFile() || stat.size > limit)\n throw new DeliveryError('Reconciliation files must be regular UTF-8 JSON files of at most 16 MiB.');\n const bytes = readFileSync(path);\n if (bytes.byteLength > limit) throw new DeliveryError('Reconciliation files exceed 16 MiB.');\n return JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes)) as unknown;\n}\n\nconst plugin = program.command('plugin').description('Manage the ai-delivery native plugin');\nfor (const action of ['install', 'doctor', 'preview', 'update', 'rollback', 'remove'] as const) {\n const command = plugin\n .command(action)\n .requiredOption('--host <host>', 'Native host: codex or claude-code')\n .option('--scope <scope>', 'Native scope: user, project, or local; Codex supports user', 'user')\n .option('--dry-run', 'Describe the selected target without changing files or contacting native tools')\n .option('--json', 'Print the result as JSON');\n if (action === 'install' || action === 'update')\n command.requiredOption('--version <version>', 'Explicit published package version');\n if (action === 'doctor')\n command.option('--check-auth', 'Read configured role identities and repository access; requires explicit --repo');\n command.action(\n async (options: {\n host: string;\n scope: string;\n version?: string;\n dryRun?: boolean;\n json?: boolean;\n checkAuth?: boolean;\n }) => {\n const result = await managePlugin({\n action,\n host: options.host,\n scope: options.scope,\n ...(options.version === undefined ? {} : { version: options.version }),\n dryRun: options.dryRun === true,\n checkAuth: options.checkAuth === true,\n ...(options.checkAuth && execution().repo ? { repo: execution().repo } : {}),\n repoRoot: execution().repoRoot,\n });\n if (options.json) {\n print(result);\n return;\n }\n process.stdout.write(\n `${result.dryRun ? 'Dry run: ' : ''}${result.host} ${result.scope}: ${action}; version ${result.version ?? 'none'}; installed ${result.installed}; changed ${result.changed}\\n`,\n );\n if (result.mcp)\n process.stdout.write(\n `Bundled MCP startup: ${result.mcp.startup}${result.mcp.error ? ` (${result.mcp.error})` : ''}\\n`,\n );\n if (result.diagnostics) {\n process.stdout.write(\n `Registration observations: ${result.diagnostics.registrations.length}; completeness ${result.diagnostics.completeness}; migration ${result.diagnostics.migration}; planned changes ${result.diagnostics.plannedChanges.length}\\n`,\n );\n for (const entry of result.diagnostics.registrations)\n process.stdout.write(\n `${entry.kind} ${entry.scope}: ownership ${entry.ownership}; source ${entry.source}; version ${entry.version ?? 'unknown'}\\n`,\n );\n process.stdout.write(`Unverified conditions: ${result.diagnostics.findings.join(', ')}\\n`);\n }\n if (result.activation)\n process.stdout.write(\n `Native session loaded version: unverified. Installed observation: ${result.activation.installedVersion ?? 'unknown'}; separate startup: ${result.activation.startupVersion ?? 'not checked'}. Use the host's surface-specific activation guidance.\\n`,\n );\n if (result.recoveryRequired)\n process.stdout.write('Resume the interrupted original plugin command to recover this target.\\n');\n if (result.authProbe)\n process.stdout.write(\n `Selected-runtime CLI auth probe: ${result.authProbe.outcome}; settings ${result.authProbe.settings}; process references ${result.authProbe.processReferences.status}; authentication ${result.authProbe.authentication.status}; repository access ${result.authProbe.repositoryAccess.status}${result.authProbe.reason ? ` (${result.authProbe.reason})` : ''}\\nNative GUI credential propagation and counted exact-head approval remain unverified.\\n`,\n );\n },\n );\n}\n\nprogram\n .command('create')\n .requiredOption('--title <title>')\n .option('--fields-file <path>', 'UTF-8 JSON typed fields; explicit CLI fields take precedence')\n .option('--epic', 'Create an active unsized parent issue')\n .option('--op-id <id>', 'Stable identity for retrying the same create')\n .option('--draft', 'Explicitly write an incomplete parked draft')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Required explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .action(async (o: Record<string, string> & { draft?: boolean; epic?: boolean }) =>\n run(\n 'issue_create',\n fields(o.fieldsFile, {\n title: o.title,\n epic: o.epic,\n opId: o.opId,\n body: body(o.body, o.bodyFile),\n issueType: o.type,\n points: int(o.points),\n priority: o.priority,\n labels: list(o.labels),\n blockedBy: ints(o.blockedBy),\n blocks: ints(o.blocks),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone),\n parentIssueNumber: int(o.parent),\n ...(o.draft === true ? { draft: true } : {}),\n }),\n ),\n );\n\nprogram\n .command('start')\n .option('--issue <number>')\n .option('--request <text>')\n .option('--request-id <id>', 'Stable retry identity for a new issue start')\n .option('--title <title>')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Capacity override reason, or explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .option('--branch <branch>')\n .option('--resume-created')\n .action(async (o: Record<string, string | boolean>) =>\n run('issue_start', {\n issueNumber: int(o.issue as string),\n request: o.request,\n requestId: o.requestId,\n title: o.title,\n body: body(o.body as string, o.bodyFile as string),\n issueType: o.type,\n points: int(o.points as string),\n priority: o.priority,\n labels: list(o.labels as string),\n blockedBy: ints(o.blockedBy as string),\n blocks: ints(o.blocks as string),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone as string),\n parentIssueNumber: int(o.parent as string),\n branch: o.branch,\n resumeCreated: o.resumeCreated === true,\n }),\n );\n\nfor (const name of ['list', 'search'] as const) {\n program\n .command(name)\n .option('--query <text>', 'Literal text to search in the selected repository')\n .option('--state <state>')\n .option('--labels <labels>')\n .option('--parent <number>')\n .option('--type <type>')\n .option('--project-status <status>')\n .option('--updated-since <timestamp>')\n .option('--page <number>')\n .option('--per-page <number>')\n .action(async (o: Record<string, string>) =>\n run(name === 'list' ? 'issue_list' : 'issue_search', {\n query: o.query,\n state: o.state,\n labels: list(o.labels),\n parentIssueNumber: int(o.parent),\n issueType: o.type,\n projectStatus: o.projectStatus,\n updatedSince: o.updatedSince,\n page: int(o.page),\n perPage: int(o.perPage),\n }),\n );\n}\n\nprogram\n .command('update')\n .requiredOption('--issue <number>')\n .option('--fields-file <path>', 'UTF-8 JSON typed issue field patch')\n .option('--draft', 'Explicitly write an incomplete parked draft')\n .option('--title <title>')\n .option('--body <markdown>')\n .option('--body-file <path>')\n .option('--type <type>')\n .option('--points <number>')\n .option('--priority <priority>')\n .option('--labels <labels>')\n .option('--blocked-by <numbers>')\n .option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')\n .option('--override-reason <reason>', 'Required explanation when adding a blocker to active work')\n .option('--milestone <number>')\n .option('--parent <number>')\n .option('--state <state>')\n .option('--project-status <status>', 'Set Todo, In Progress, Blocked or Done with a public reason')\n .option('--project-status-reason <reason>', 'Required public reason for an explicit Project Status')\n .option('--preserve-history', 'Preserve the previous title and body before a rewrite')\n .option('--close-reason <reason>')\n .option('--superseded-by <number>')\n .option('--park', 'Park execution while retaining the issue worktree')\n .option('--defer', 'Defer until an explicit undefer')\n .option('--defer-until <date>', 'Record an ISO date condition without automatic undeferral')\n .option('--defer-trigger <text>', 'Record the condition for reconsidering deferred work')\n .option('--undefer', 'Explicitly clear deferral; draft and park remain unchanged')\n .action(\n async (\n o: Record<string, string> & {\n park?: boolean;\n preserveHistory?: boolean;\n draft?: boolean;\n defer?: boolean;\n undefer?: boolean;\n },\n ) =>\n run(\n 'issue_update',\n fields(\n o.fieldsFile,\n {\n issueNumber: int(o.issue),\n title: o.title,\n ...(o.draft === true ? { draft: true } : {}),\n body: body(o.body, o.bodyFile),\n issueType: o.type,\n points: int(o.points),\n priority: o.priority,\n labels: list(o.labels),\n blockedBy: ints(o.blockedBy),\n blocks: ints(o.blocks),\n overrideReason: o.overrideReason,\n milestone: int(o.milestone),\n parentIssueNumber: int(o.parent),\n state: o.state,\n projectStatus:\n o.projectStatus === undefined && o.projectStatusReason === undefined\n ? undefined\n : ProjectStatusPatch.parse({ status: o.projectStatus, reason: o.projectStatusReason }),\n preserveHistory: o.preserveHistory === true ? true : undefined,\n closeReason: o.closeReason,\n supersededBy: int(o.supersededBy),\n park: o.park === true ? true : undefined,\n defer:\n o.defer === true || o.deferUntil !== undefined || o.deferTrigger !== undefined\n ? {\n ...(o.deferUntil === undefined ? {} : { until: o.deferUntil }),\n ...(o.deferTrigger === undefined ? {} : { trigger: o.deferTrigger }),\n }\n : undefined,\n undefer: o.undefer === true ? true : undefined,\n },\n true,\n ),\n ),\n );\n\nprogram\n .command('board')\n .description('Read delivery attention and readiness for explicit repositories')\n .requiredOption('--repos <owner/repo,...>', 'Explicit GitHub repositories, separated by commas')\n .option('--decision-labels <label,...>', 'Additional labels that signal human attention')\n .option('--json', 'Print the complete board as JSON')\n .action(async (options: { repos: string; decisionLabels?: string; json?: boolean }) => {\n // Preserve empty selectors and control characters for the common validator.\n const result = (await executeTool(\n 'delivery_board',\n { repos: options.repos.split(','), decisionLabels: options.decisionLabels?.split(',') },\n execution(),\n )) as DeliveryBoardResult;\n if (options.json || program.opts<{ json?: boolean }>().json) print(result);\n else process.stdout.write(`${renderDeliveryBoard(result)}\\n`);\n });\n\nprogram\n .command('board:reconcile')\n .description('Plan or apply bounded Project reconciliation for explicit repositories')\n .requiredOption('--repositories <owner/repo...>', '1\u201310 explicit GitHub repositories')\n .option('--checkouts-file <path>', 'UTF-8 JSON checkout selectors for dry-run')\n .option('--dry-run', 'Collect a plan without writes (default)')\n .option('--apply', 'Apply the retained original plan')\n .option('--plan-file <path>', 'Original complete reconciliation plan JSON')\n .option('--prior-result-file <path>', 'Optional prior result JSON for the exact original plan')\n .action(\n async (options: {\n repositories: string[];\n checkoutsFile?: string;\n dryRun?: boolean;\n apply?: boolean;\n planFile?: string;\n priorResultFile?: string;\n }) => {\n if (options.dryRun && options.apply) throw new DeliveryError('Choose either --dry-run or --apply.');\n const request = parseBoardReconcileRequest({\n repositories: options.repositories,\n ...(execution().repo === undefined ? {} : { repo: execution().repo }),\n mode: options.apply ? 'apply' : 'dry-run',\n ...(options.checkoutsFile === undefined ? {} : { checkouts: reconciliationFile(options.checkoutsFile) }),\n ...(options.planFile === undefined ? {} : { plan: reconciliationFile(options.planFile) }),\n ...(options.priorResultFile === undefined ? {} : { priorResult: reconciliationFile(options.priorResultFile) }),\n });\n return run('board_reconcile', request);\n },\n );\n\nprogram\n .command('batch:update')\n .description('Plan or apply 1\u201350 current-repository issue updates with ordered readback')\n .requiredOption('--items-file <path>', 'UTF-8 JSON array of complete issue_update inputs')\n .option('--dry-run', 'Return plans and readback without any native writes')\n .action(async (o: { itemsFile: string; dryRun?: boolean }) =>\n run('issue_batch_update', {\n items: JSON.parse(readFileSync(o.itemsFile, 'utf8')) as unknown,\n dryRun: o.dryRun === true,\n }),\n );\n\nprogram\n .command('health')\n .requiredOption('--from <utc>', 'Inclusive UTC ISO timestamp')\n .requiredOption('--to <utc>', 'Exclusive UTC ISO timestamp')\n .option('--max-issues <number>')\n .option('--max-timeline-pages <number>')\n .option('--max-project-pages <number>')\n .option('--oldest-limit <number>')\n .action(async (o: Record<string, string>) =>\n run('delivery_health', {\n repo: execution().repo,\n from: o.from,\n to: o.to,\n maxIssues: int(o.maxIssues),\n maxTimelinePages: int(o.maxTimelinePages),\n maxProjectPages: int(o.maxProjectPages),\n oldestLimit: int(o.oldestLimit),\n }),\n );\nprogram\n .command('info')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => run('issue_info', { issueNumber: int(o.issue) }));\nprogram\n .command('ready:check')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => run('issue_ready_check', { issueNumber: int(o.issue) }));\nfor (const field of ['parent', 'blockers'] as const) {\n program\n .command(field)\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => {\n const info = (await executeTool('issue_info', { issueNumber: int(o.issue) }, execution())) as {\n parentIssueNumber: number | null;\n blockedBy: number[];\n };\n print(\n field === 'parent'\n ? { issueNumber: int(o.issue), parentIssueNumber: info.parentIssueNumber }\n : { issueNumber: int(o.issue), blockedBy: info.blockedBy },\n );\n });\n}\nprogram\n .command('subissues')\n .requiredOption('--issue <number>')\n .action(async (o: { issue: string }) => {\n const context = await contextFor(execution(), 'subissues');\n print({ issueNumber: int(o.issue), subissues: await listIssueSubissues(context, Number(o.issue)) });\n });\nprogram\n .command('pr:create')\n .description('Create or reuse an issue-closing PR from a pushed --head, from any directory.')\n .requiredOption('--issue <number>')\n .option('--pr <number>', 'Exact existing PR selector; never creates a replacement')\n .option('--non-closing', 'Retain the issue OPEN using native non-closing reference proof')\n .option(\n '--reconcile-non-closing-reference',\n 'Explicit native closing-pair removal request; caller must hold exact authority and reconcile prior attempts',\n )\n .option('--expected-head <sha>', 'Exact source SHA for the explicit reference action')\n .option('--expected-base <sha>', 'Exact default-base SHA for the explicit reference action')\n .option('--title <title>')\n .option('--body-file <path>')\n .option('--head <branch>', 'Pushed remote head; no ai-delivery branch or worktree setup required')\n .option('--base <branch>', 'Repository default branch (inferred when omitted)')\n .option('--ready', 'Publish ready, or promote the author-owned PR selected by --head')\n .option('--dry-run')\n .action(\n async (o: {\n issue: string;\n pr?: string;\n nonClosing?: boolean;\n reconcileNonClosingReference?: boolean;\n expectedHead?: string;\n expectedBase?: string;\n title?: string;\n bodyFile?: string;\n head?: string;\n base?: string;\n ready?: boolean;\n dryRun?: boolean;\n }) =>\n run('issue_pr_create', {\n issueNumber: int(o.issue),\n prNumber: int(o.pr),\n nonClosing: o.nonClosing,\n reconcileNonClosingReference: o.reconcileNonClosingReference,\n expectedHeadSha: o.expectedHead,\n expectedBaseSha: o.expectedBase,\n title: o.title,\n body: body(undefined, o.bodyFile),\n headBranch: o.head,\n base: o.base,\n draft: o.ready !== true,\n dryRun: o.dryRun === true,\n }),\n );\nprogram\n .command('pr:info')\n .description('Inspect an exact PR; combine --issue and --pr to verify its native closing-issue association.')\n .option('--non-closing', 'Verify an exact native non-closing PR-to-issue reference')\n .option('--issue <number>', 'Issue to verify; issue-only lookup requires a GitHub-linked branch')\n .option('--pr <number>', 'Exact PR number; include --issue after issue branch links are replaced on publication')\n .action(async (o: { issue?: string; pr?: string; nonClosing?: boolean }) =>\n run('issue_pr_info', { issueNumber: int(o.issue), prNumber: int(o.pr), nonClosing: o.nonClosing }),\n );\nprogram\n .command('pr:list')\n .option('--state <state>', 'open, closed or all', 'open')\n .action(async (o: { state: string }) => {\n if (!['open', 'closed', 'all'].includes(o.state)) throw new Error('Invalid PR state.');\n const context = await contextFor(execution(), 'pr:list');\n print(await listPrs(context, o.state as 'open' | 'closed' | 'all'));\n });\nprogram\n .command('pr:checks')\n .requiredOption('--pr <number>')\n .action(async (o: { pr: string }) => {\n const context = await contextFor(execution(), 'pr:checks');\n print(await prChecks(context, Number(o.pr)));\n });\nprogram\n .command('pr:review')\n .requiredOption('--issue <number>')\n .requiredOption('--pr <number>')\n .requiredOption('--artifact <path>', 'Path to a UTF-8 JSON review artifact file (not inline JSON)')\n .option('--non-closing', 'Retain the referenced issue OPEN; finish refuses this mode')\n .option('--dry-run')\n .action(async (o: { issue: string; pr: string; artifact: string; dryRun?: boolean; nonClosing?: boolean }) =>\n run('issue_pr_review', {\n issueNumber: int(o.issue),\n prNumber: int(o.pr),\n artifact: readFileSync(o.artifact, 'utf8'),\n dryRun: o.dryRun === true,\n nonClosing: o.nonClosing,\n }),\n );\nprogram\n .command('review')\n .argument('<action>', 'submit or doctor')\n .description('Submit an independent verdict or check its configured App')\n .option('--pr <number>', 'Required for submit')\n .option('--head <sha>', 'Required exact head for submit')\n .option('--identity <name>', 'Required configured reviewer profile')\n .option('--verdict <path>', 'Required for submit: UTF-8 JSON verdict, at most 64 KiB')\n .action(async (action: string, o: { pr?: string; head?: string; identity?: string; verdict?: string }) => {\n if (!['submit', 'doctor'].includes(action)) throw new DeliveryError('review action must be submit or doctor.');\n const identity = o.identity ?? execution().identity ?? '';\n const settings = await loadDeliverySettings(undefined, { reviewerIdentity: identity, prepareEnvironment: true });\n const profile = settings.roles.reviewer;\n if (!('appId' in profile))\n throw new DeliveryError('identity: Select a reviewer profile with explicit App/provider binding.');\n if (action === 'doctor') {\n if (o.pr !== undefined || o.head !== undefined || o.verdict !== undefined)\n throw new DeliveryError('review doctor does not accept submission inputs.');\n const clients = await createDeliveryGitHubClients({\n config: settings,\n identity,\n role: 'reviewer',\n env: settings.environment!,\n });\n const actorLogin = await clients.appActorLogin!();\n printCommandResult('review:doctor', {\n status: 'authenticated',\n identity,\n provider: profile.provider,\n appId: profile.appId,\n installationId: profile.installationId,\n actorLogin,\n source: appCredentialSource(profile).type,\n });\n return;\n }\n if (o.pr === undefined || o.head === undefined || o.verdict === undefined)\n throw new DeliveryError('review submit requires --pr, --head and --verdict.');\n const fd = openSync(o.verdict, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);\n let raw: string;\n let verdictFileSha256: string;\n try {\n if (!fstatSync(fd).isFile()) throw new DeliveryError('verdict: Expected a regular file.');\n const bytes = Buffer.alloc(64 * 1024 + 1);\n let size = 0;\n while (size < bytes.length) {\n const count = readSync(fd, bytes, size, bytes.length - size, null);\n if (count === 0) break;\n size += count;\n }\n if (size > 64 * 1024) throw new DeliveryError('verdict: File exceeds 64 KiB.');\n const content = bytes.subarray(0, size);\n raw = content.toString('utf8');\n if (!Buffer.from(raw, 'utf8').equals(content)) throw new DeliveryError('verdict: Expected valid UTF-8.');\n verdictFileSha256 = `sha256:${createHash('sha256').update(content).digest('hex')}`;\n } finally {\n closeSync(fd);\n }\n const verdict = parseReviewVerdict(raw);\n assertReviewVerdictTarget(verdict, profile.provider, o.head);\n const prNumber = z.number().int().positive().parse(Number(o.pr));\n const authorContext = await contextFor(\n { ...execution(), settings, identity, reviewSubmission: true },\n 'pr:info',\n 'author',\n );\n const reviewBase = await readGitHubReviewBase(authorContext, prNumber, o.head);\n const artifact = buildReviewArtifact({\n verdict,\n verdictFileSha256,\n identity,\n provider: profile.provider,\n expectedHead: o.head,\n prNumber,\n authorIdentity: settings.roles.author.identity,\n reviewBase,\n });\n await validateReviewTarget(authorContext, artifact, prNumber);\n const clients = await createDeliveryGitHubClients({\n config: authorContext.config,\n identity,\n role: 'reviewer',\n selectedAuthor: authorContext.clients,\n ...(authorContext.credentialEnvironment === undefined ? {} : { env: authorContext.credentialEnvironment }),\n });\n const context = { ...authorContext, clients };\n try {\n printCommandResult(\n 'review:submit',\n await submitFormalReview(context, {\n artifact: JSON.stringify(artifact),\n issueNumber: verdict.issueNumber,\n prNumber,\n ...(verdict.nonClosing === undefined ? {} : { nonClosing: verdict.nonClosing }),\n }),\n );\n } catch (error) {\n if (!(error instanceof ReviewSubmissionError)) throw error;\n process.stdout.write(\n `${JSON.stringify({ status: 'submission-unverified', submission: error.submission, nextAction: error.message })}\\n`,\n );\n process.exitCode = 1;\n }\n });\n\nprogram\n .command('migrate:legacy-issues')\n .requiredOption('--input-file <path>', 'Offline legacy issue inventory JSON')\n .action((o: { inputFile: string }) => {\n const report = planOfflineLegacyIssueMigration(JSON.parse(readFileSync(o.inputFile, 'utf8')) as unknown);\n process.stdout.write(`${JSON.stringify(report, null, 2)}\\n`);\n });\nprogram\n .command('config:resolve')\n .description('Read the effective GitHub destination and admission digest')\n .action(async () => {\n const context = await contextFor(execution(), 'config:resolve');\n print({\n configDigest: context.configuration?.configDigest,\n routing: context.configuration?.routing,\n reviewRoute: await preflightReviewRoute(context, undefined, undefined, 'development'),\n });\n });\nprogram.command('mcp:serve').action(async () => serveAiDeliveryMcp(execution()));\n\nprogram.parseAsync(process.argv).catch((error: unknown) => {\n const options = program.opts<{ json?: boolean; verbose?: boolean }>();\n printCommandError(error, options.json === true && options.verbose === true);\n});\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,WAAW,WAAW,WAAW,UAAU,cAAc,UAAU,gBAAgB;AAC5F,SAAS,kBAAkB;AAC3B,SAAS,mCAAmC;AAC5C,SAAS,qBAAqB,4BAA4B;AAC1D,SAAS,eAAe;AACxB,SAAS,SAAS;AAElB,SAAS,mBAAmB,0BAA0B;AACtD,SAAS,YAAY,mBAA0C;AAC/D,SAAS,0BAA0B;AACnC,SAAS,SAAS,sBAAsB,UAAU,0BAA0B;AAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAEnC,SAAS,uCAAuC;AAChD,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,kBAAkB,oBAAoB,0BAA0B;AAC3F,SAAS,6BAA6B;AACtC,SAAS,qB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AAA,IACjH;AACA,YAAQ,WAAW;AAAA,EACrB;AACF,CAAC;AAEH,QACG,QAAQ,uBAAuB,EAC/B,eAAe,uBAAuB,qCAAqC,EAC3E,OAAO,CAAC,MAA6B;AACpC,QAAM,SAAS,gCAAgC,KAAK,MAAM,aAAa,EAAE,WAAW,MAAM,CAAC,CAAY;AACvG,UAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAAA,CAAI;AAC7D,CAAC;AACH,QACG,QAAQ,gBAAgB,EACxB,YAAY,4DAA4D,EACxE,OAAO,YAAY;AAClB,QAAM,UAAU,MAAM,WAAW,UAAU,GAAG,gBAAgB;AAC9D,QAAM;AAAA,IACJ,cAAc,QAAQ,eAAe;AAAA,IACrC,SAAS,QAAQ,eAAe;AAAA,IAChC,aAAa,MAAM,qBAAqB,SAAS,QAAW,QAAW,aAAa;AAAA,EACtF,CAAC;AACH,CAAC;AACH,QAAQ,QAAQ,WAAW,EAAE,OAAO,YAAY,mBAAmB,UAAU,CAAC,CAAC;AAE/E,QAAQ,WAAW,QAAQ,IAAI,EAAE,MAAM,CAAC,UAAmB;AACzD,QAAM,UAAU,QAAQ,KAA4C;AACpE,oBAAkB,OAAO,QAAQ,SAAS,QAAQ,QAAQ,YAAY,IAAI;AAC5E,CAAC;",
|
|
6
6
|
"names": ["clients"]
|
|
7
7
|
}
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -50,9 +50,9 @@ export declare function startTrackedIssue(context: Awaited<ReturnType<typeof loa
|
|
|
50
50
|
failure?: never;
|
|
51
51
|
safeResume?: never;
|
|
52
52
|
} | {
|
|
53
|
-
reused?: never;
|
|
54
53
|
branch?: never;
|
|
55
54
|
headSha?: never;
|
|
55
|
+
reused?: never;
|
|
56
56
|
status: 'start-incomplete';
|
|
57
57
|
issueNumber: number;
|
|
58
58
|
repository: string;
|
package/dist/dispatch.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
updateIssue,
|
|
28
28
|
batchUpdateIssues
|
|
29
29
|
} from "./issue.js";
|
|
30
|
-
import {
|
|
30
|
+
import { publishPr, submitFormalReview } from "./pr.js";
|
|
31
31
|
import { getAiDeliveryMcpTool } from "./mcp/tools.js";
|
|
32
32
|
import { IssueValidationError } from "./issueContract.js";
|
|
33
33
|
function requiredNumber(input, key) {
|
|
@@ -266,8 +266,6 @@ async function executeTool(name, raw, execution) {
|
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
const { repo: selected, verbose: _verbose, ...input } = definition.inputSchema.parse(raw);
|
|
269
|
-
if (name === "issue_finish" && input.nonClosing === true)
|
|
270
|
-
throw new DeliveryError("Non-closing delivery cannot finish or close its retained issue.");
|
|
271
269
|
if (selected !== void 0 && execution.repo !== void 0 && selected !== execution.repo)
|
|
272
270
|
throw new DeliveryError("Tool and execution repository selectors disagree.");
|
|
273
271
|
if (name === "issue_create") canonicalIssueBody(input);
|
|
@@ -324,18 +322,6 @@ async function executeTool(name, raw, execution) {
|
|
|
324
322
|
prNumber: requiredNumber(input, "prNumber"),
|
|
325
323
|
dryRun: input.dryRun === true
|
|
326
324
|
});
|
|
327
|
-
case "issue_pr_merge":
|
|
328
|
-
case "issue_finish": {
|
|
329
|
-
const merge = {
|
|
330
|
-
issueNumber: requiredNumber(input, "issueNumber"),
|
|
331
|
-
...input.nonClosing === void 0 ? {} : { nonClosing: input.nonClosing === true },
|
|
332
|
-
prNumber: requiredNumber(input, "prNumber"),
|
|
333
|
-
...input.strategy === void 0 ? {} : { strategy: input.strategy },
|
|
334
|
-
...input.reviewedHeadSha === void 0 ? {} : { reviewedHeadSha: requireString(input, "reviewedHeadSha") },
|
|
335
|
-
dryRun: input.dryRun === true
|
|
336
|
-
};
|
|
337
|
-
return name === "issue_finish" ? finishIssue({ ...context, root: execution.repoRoot }, merge) : mergePr(context, merge);
|
|
338
|
-
}
|
|
339
325
|
}
|
|
340
326
|
}
|
|
341
327
|
export {
|