@aviaratech/ai-delivery 0.3.35 → 0.3.36
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/CONTRIBUTING.md +12 -206
- package/README.md +57 -554
- package/dist/agent.d.ts +0 -2
- package/dist/agent.js +76 -16
- package/dist/agent.js.map +7 -1
- package/dist/agentReadiness.test.js +73 -67
- package/dist/agentReadiness.test.js.map +7 -1
- package/dist/boardReconcile.test.js +1651 -1590
- package/dist/boardReconcile.test.js.map +7 -1
- package/dist/build.test.js +130 -0
- package/dist/build.test.js.map +7 -0
- package/dist/callerErrors.test.js +105 -0
- package/dist/callerErrors.test.js.map +7 -0
- package/dist/cli.js +402 -515
- package/dist/cli.js.map +7 -1
- package/dist/cliResult.d.ts +2 -2
- package/dist/cliResult.js +42 -45
- package/dist/cliResult.js.map +7 -1
- package/dist/cliResult.test.js +424 -369
- package/dist/cliResult.test.js.map +7 -1
- package/dist/config/deliveryConfig.d.ts +288 -14
- package/dist/config/deliveryConfig.js +472 -390
- package/dist/config/deliveryConfig.js.map +7 -1
- package/dist/config/deliveryConfig.test.js +773 -649
- package/dist/config/deliveryConfig.test.js.map +7 -1
- package/dist/contributorChecks.test.js +1694 -916
- package/dist/contributorChecks.test.js.map +7 -1
- package/dist/currentConsumer.test.js +819 -737
- package/dist/currentConsumer.test.js.map +7 -1
- package/dist/currentTrackingScenario.test.js +499 -479
- package/dist/currentTrackingScenario.test.js.map +7 -1
- package/dist/delivery/common.js +160 -172
- package/dist/delivery/common.js.map +7 -1
- package/dist/delivery/delivery.test.js +509 -431
- package/dist/delivery/delivery.test.js.map +7 -1
- package/dist/delivery/evidence.d.ts +2 -2
- package/dist/delivery/evidence.js +133 -120
- package/dist/delivery/evidence.js.map +7 -1
- package/dist/delivery/index.js +7 -2
- package/dist/delivery/index.js.map +7 -1
- package/dist/delivery/legacy.js +65 -5
- package/dist/delivery/legacy.js.map +7 -1
- package/dist/delivery/policy.d.ts +10 -10
- package/dist/delivery/policy.js +211 -238
- package/dist/delivery/policy.js.map +7 -1
- package/dist/delivery/stage.d.ts +18 -18
- package/dist/delivery/stage.js +220 -235
- package/dist/delivery/stage.js.map +7 -1
- package/dist/deliveryBoard.d.ts +74 -0
- package/dist/deliveryBoard.js +644 -0
- package/dist/deliveryBoard.js.map +7 -0
- package/dist/deliveryBoard.test.js +649 -0
- package/dist/deliveryBoard.test.js.map +7 -0
- package/dist/deliveryHealth.test.js +179 -155
- package/dist/deliveryHealth.test.js.map +7 -1
- package/dist/dependencyCompatibility.test.js +154 -140
- package/dist/dependencyCompatibility.test.js.map +7 -1
- package/dist/directoryIndependent.test.js +417 -383
- package/dist/directoryIndependent.test.js.map +7 -1
- package/dist/dispatch.d.ts +16 -11
- package/dist/dispatch.js +329 -353
- package/dist/dispatch.js.map +7 -1
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +103 -96
- package/dist/errors.js.map +7 -1
- package/dist/fixtures/deliveryBoardReplay.d.ts +56 -0
- package/dist/fixtures/deliveryBoardReplay.js +617 -0
- package/dist/fixtures/deliveryBoardReplay.js.map +7 -0
- package/dist/fixtures/discovery.d.ts +59 -19
- package/dist/fixtures/discovery.js +96 -90
- package/dist/fixtures/discovery.js.map +7 -1
- package/dist/fixtures/inertEntrypointChild.js +57 -56
- package/dist/fixtures/inertEntrypointChild.js.map +7 -1
- package/dist/fixtures/inertEntrypoints.d.ts +1 -1
- package/dist/fixtures/inertEntrypoints.js +321 -276
- package/dist/fixtures/inertEntrypoints.js.map +7 -1
- package/dist/fixtures/inertTarget.d.ts +78 -7
- package/dist/fixtures/inertTarget.js +769 -691
- package/dist/fixtures/inertTarget.js.map +7 -1
- package/dist/fixtures/issue63.d.ts +4 -3
- package/dist/fixtures/issue63.js +260 -274
- package/dist/fixtures/issue63.js.map +7 -1
- package/dist/fixtures/issueProjectItems.d.ts +20 -0
- package/dist/fixtures/issueProjectItems.js +15 -0
- package/dist/fixtures/issueProjectItems.js.map +7 -0
- package/dist/fixtures/readView.d.ts +120 -0
- package/dist/fixtures/readView.js +172 -0
- package/dist/fixtures/readView.js.map +7 -0
- package/dist/fixtures/recordedGitHubFlows.d.ts +120 -0
- package/dist/fixtures/recordedGitHubFlows.js +109 -0
- package/dist/fixtures/recordedGitHubFlows.js.map +7 -0
- package/dist/genericCompatibility.test.js +64 -55
- package/dist/genericCompatibility.test.js.map +7 -1
- package/dist/git.js +73 -67
- package/dist/git.js.map +7 -1
- package/dist/gitProcess.d.ts +1 -1
- package/dist/gitProcess.js +58 -53
- package/dist/gitProcess.js.map +7 -1
- package/dist/github/client.d.ts +2 -2
- package/dist/github/client.js +484 -379
- package/dist/github/client.js.map +7 -1
- package/dist/github/commandIdentityPolicy.js +44 -52
- package/dist/github/commandIdentityPolicy.js.map +7 -1
- package/dist/github/discovery.d.ts +1 -0
- package/dist/github/discovery.js +197 -215
- package/dist/github/discovery.js.map +7 -1
- package/dist/github/discovery.test.js +223 -177
- package/dist/github/discovery.test.js.map +7 -1
- package/dist/github/issueHistory.d.ts +2 -2
- package/dist/github/issueHistory.js +117 -125
- package/dist/github/issueHistory.js.map +7 -1
- package/dist/github/machineAuth.d.ts +1 -1
- package/dist/github/machineAuth.js +126 -117
- package/dist/github/machineAuth.js.map +7 -1
- package/dist/github/machineAuth.test.js +755 -639
- package/dist/github/machineAuth.test.js.map +7 -1
- package/dist/github/nativeIssueMetadata.js +286 -273
- package/dist/github/nativeIssueMetadata.js.map +7 -1
- package/dist/github/projectDelivery.d.ts +18 -2
- package/dist/github/projectDelivery.js +615 -557
- package/dist/github/projectDelivery.js.map +7 -1
- package/dist/github/relationships.js +433 -389
- package/dist/github/relationships.js.map +7 -1
- package/dist/github/repo.d.ts +1 -0
- package/dist/github/repo.js +123 -96
- package/dist/github/repo.js.map +7 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +7 -1
- package/dist/issue.d.ts +40 -9
- package/dist/issue.js +2102 -1742
- package/dist/issue.js.map +7 -1
- package/dist/issue63History.test.js +40 -42
- package/dist/issue63History.test.js.map +7 -1
- package/dist/issue63Routes.test.js +154 -143
- package/dist/issue63Routes.test.js.map +7 -1
- package/dist/issueBatchUpdate.test.js +989 -885
- package/dist/issueBatchUpdate.test.js.map +7 -1
- package/dist/issueBlockerGuard.test.js +262 -226
- package/dist/issueBlockerGuard.test.js.map +7 -1
- package/dist/issueContract.d.ts +23 -4
- package/dist/issueContract.js +416 -395
- package/dist/issueContract.js.map +7 -1
- package/dist/issueContract.test.d.ts +4 -3
- package/dist/issueContract.test.js +358 -321
- package/dist/issueContract.test.js.map +7 -1
- package/dist/issueDates.test.js +235 -233
- package/dist/issueDates.test.js.map +7 -1
- package/dist/issueInfoReadback.test.js +304 -190
- package/dist/issueInfoReadback.test.js.map +7 -1
- package/dist/issueIntake.test.js +1945 -1732
- package/dist/issueIntake.test.js.map +7 -1
- package/dist/issueJournal.d.ts +40 -19
- package/dist/issueJournal.js +229 -138
- package/dist/issueJournal.js.map +7 -1
- package/dist/issueJournal.test.js +605 -422
- package/dist/issueJournal.test.js.map +7 -1
- package/dist/issueRollup.test.d.ts +1 -0
- package/dist/issueRollup.test.js +476 -0
- package/dist/issueRollup.test.js.map +7 -0
- package/dist/issueTracking.test.js +1059 -989
- package/dist/issueTracking.test.js.map +7 -1
- package/dist/issueWriteRecovery.test.d.ts +1 -0
- package/dist/issueWriteRecovery.test.js +260 -0
- package/dist/issueWriteRecovery.test.js.map +7 -0
- package/dist/lifecycle.test.js +112 -441
- package/dist/lifecycle.test.js.map +7 -1
- package/dist/logger.js +80 -74
- package/dist/logger.js.map +7 -1
- package/dist/mcp/index.js +116 -94
- package/dist/mcp/index.js.map +7 -1
- package/dist/mcp/tools.d.ts +264 -286
- package/dist/mcp/tools.js +267 -340
- package/dist/mcp/tools.js.map +7 -1
- package/dist/pluginAuthProbe.js +63 -52
- package/dist/pluginAuthProbe.js.map +7 -1
- package/dist/pluginAuthProbe.test.js +85 -62
- package/dist/pluginAuthProbe.test.js.map +7 -1
- package/dist/pluginCredentials.test.js +282 -259
- package/dist/pluginCredentials.test.js.map +7 -1
- package/dist/pluginDoctor.test.js +653 -588
- package/dist/pluginDoctor.test.js.map +7 -1
- package/dist/pluginInstaller.d.ts +7 -5
- package/dist/pluginInstaller.js +1173 -1229
- package/dist/pluginInstaller.js.map +7 -1
- package/dist/pluginInstaller.test.js +1842 -1423
- package/dist/pluginInstaller.test.js.map +7 -1
- package/dist/pluginPackaging.test.js +460 -409
- package/dist/pluginPackaging.test.js.map +7 -1
- package/dist/pr.d.ts +132 -94
- package/dist/pr.js +1521 -1323
- package/dist/pr.js.map +7 -1
- package/dist/pr.test.js +1678 -632
- package/dist/pr.test.js.map +7 -1
- package/dist/prAssociation.test.js +2419 -1788
- package/dist/prAssociation.test.js.map +7 -1
- package/dist/prDispatch.test.js +150 -89
- package/dist/prDispatch.test.js.map +7 -1
- package/dist/readView.d.ts +183 -0
- package/dist/readView.js +217 -0
- package/dist/readView.js.map +7 -0
- package/dist/readView.test.d.ts +1 -0
- package/dist/readView.test.js +119 -0
- package/dist/readView.test.js.map +7 -0
- package/dist/releaseReconciliation.test.js +267 -288
- package/dist/releaseReconciliation.test.js.map +7 -1
- package/dist/releaseWorkflow.test.js +2493 -422
- package/dist/releaseWorkflow.test.js.map +7 -1
- package/dist/review.d.ts +738 -2
- package/dist/review.js +601 -348
- package/dist/review.js.map +7 -1
- package/dist/review.test.js +1218 -812
- package/dist/review.test.js.map +7 -1
- package/dist/reviewSubmit.test.d.ts +1 -0
- package/dist/reviewSubmit.test.js +747 -0
- package/dist/reviewSubmit.test.js.map +7 -0
- package/dist/services/agentReadinessService.js +42 -37
- package/dist/services/agentReadinessService.js.map +7 -1
- package/dist/services/blockerGuardService.js +188 -188
- package/dist/services/blockerGuardService.js.map +7 -1
- package/dist/services/boardReconcileService.d.ts +125 -125
- package/dist/services/boardReconcileService.js +1295 -1421
- package/dist/services/boardReconcileService.js.map +7 -1
- package/dist/services/deliveryAdmission.js +131 -154
- package/dist/services/deliveryAdmission.js.map +7 -1
- package/dist/services/deliveryHealthService.js +197 -199
- package/dist/services/deliveryHealthService.js.map +7 -1
- package/dist/services/legacyIssueMigration.js +263 -277
- package/dist/services/legacyIssueMigration.js.map +7 -1
- package/dist/services/worktreeRegistry.d.ts +27 -119
- package/dist/services/worktreeRegistry.js +765 -1182
- package/dist/services/worktreeRegistry.js.map +7 -1
- package/dist/stagedChecks.test.js +396 -194
- package/dist/stagedChecks.test.js.map +7 -1
- package/dist/start.test.js +99 -95
- package/dist/start.test.js.map +7 -1
- package/dist/stdoutRegression.test.js +353 -352
- package/dist/stdoutRegression.test.js.map +7 -1
- package/dist/targetPolicyDiscovery.test.js +141 -143
- package/dist/targetPolicyDiscovery.test.js.map +7 -1
- package/dist/targetPolicyEntrypoints.test.js +308 -269
- package/dist/targetPolicyEntrypoints.test.js.map +7 -1
- package/dist/targetPolicyLocal.test.js +580 -1051
- package/dist/targetPolicyLocal.test.js.map +7 -1
- package/dist/targetPolicyRoutes.test.js +305 -281
- package/dist/targetPolicyRoutes.test.js.map +7 -1
- package/dist/targetRepositoryExecution.test.d.ts +1 -0
- package/dist/targetRepositoryExecution.test.js +463 -0
- package/dist/targetRepositoryExecution.test.js.map +7 -0
- package/dist/terminalMessages.js +41 -35
- package/dist/terminalMessages.js.map +7 -1
- package/dist/toolOutput.d.ts +2 -0
- package/dist/toolOutput.js +36 -0
- package/dist/toolOutput.js.map +7 -0
- package/dist/toolOutput.test.d.ts +1 -0
- package/dist/toolOutput.test.js +240 -0
- package/dist/toolOutput.test.js.map +7 -0
- package/dist/utils/atomicJson.js +84 -76
- package/dist/utils/atomicJson.js.map +7 -1
- package/dist/utils/filesystem.js +15 -18
- package/dist/utils/filesystem.js.map +7 -1
- package/dist/utils/lockfile.js +68 -71
- package/dist/utils/lockfile.js.map +7 -1
- package/dist/verification.d.ts +1 -19
- package/dist/verification.js +1020 -1939
- package/dist/verification.js.map +7 -1
- package/dist/verificationGate.test.js +127 -117
- package/dist/verificationGate.test.js.map +7 -1
- package/dist/version.js +23 -24
- package/dist/version.js.map +7 -1
- package/dist/worktree.d.ts +3 -15
- package/dist/worktree.js +97 -177
- package/dist/worktree.js.map +7 -1
- package/package.json +9 -8
- package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
- package/plugins/ai-delivery/README.md +47 -156
- package/plugins/ai-delivery/plugin.json +1 -1
- package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +238 -44
- package/plugins/ai-delivery/runtime/dist/cli.js +358 -115
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/intake-create/SKILL.md +14 -78
- package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +35 -36
- package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +14 -15
- package/dist/investigationCompletion.test.js +0 -728
- package/dist/investigationCompletion.test.js.map +0 -1
- package/dist/setup.d.ts +0 -60
- package/dist/setup.js +0 -585
- package/dist/setup.js.map +0 -1
- package/dist/setup.test.js +0 -3329
- package/dist/setup.test.js.map +0 -1
- package/dist/worktreeTransition.d.ts +0 -211
- package/dist/worktreeTransition.js +0 -1037
- package/dist/worktreeTransition.js.map +0 -1
- package/dist/worktreeTransition.test.js +0 -1191
- package/dist/worktreeTransition.test.js.map +0 -1
- /package/dist/{investigationCompletion.test.d.ts → build.test.d.ts} +0 -0
- /package/dist/{setup.test.d.ts → callerErrors.test.d.ts} +0 -0
- /package/dist/{worktreeTransition.test.d.ts → deliveryBoard.test.d.ts} +0 -0
package/dist/cli.js
CHANGED
|
@@ -1,217 +1,186 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync, statSync } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { closeSync, constants, fstatSync, openSync, readFileSync, readSync, statSync } from "node:fs";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { createDeliveryGitHubClients } from "./github/client.js";
|
|
5
|
+
import { appCredentialSource, loadDeliverySettings } from "./config/deliveryConfig.js";
|
|
6
|
+
import { Command } from "commander";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { printCommandError, printCommandResult } from "./cliResult.js";
|
|
9
|
+
import { contextFor, executeTool } from "./dispatch.js";
|
|
10
|
+
import { listIssueSubissues } from "./issue.js";
|
|
11
|
+
import { listPrs, preflightReviewRoute, prChecks, submitFormalReview } from "./pr.js";
|
|
12
|
+
import {
|
|
13
|
+
assertReviewVerdictTarget,
|
|
14
|
+
buildReviewArtifact,
|
|
15
|
+
parseReviewVerdict,
|
|
16
|
+
readGitHubReviewBase,
|
|
17
|
+
ReviewSubmissionError,
|
|
18
|
+
validateReviewTarget
|
|
19
|
+
} from "./review.js";
|
|
20
|
+
import { serveAiDeliveryMcp } from "./mcp/index.js";
|
|
21
|
+
import { planOfflineLegacyIssueMigration } from "./services/legacyIssueMigration.js";
|
|
22
|
+
import { PACKAGE_VERSION } from "./version.js";
|
|
23
|
+
import { managePlugin } from "./pluginInstaller.js";
|
|
24
|
+
import { IssueWriteSchema, IssueStatusPatch, IssueDeferralPatch, ProjectStatusPatch } from "./issueContract.js";
|
|
25
|
+
import { NativeIssueDateFields } from "./github/nativeIssueMetadata.js";
|
|
26
|
+
import { DeliveryError } from "./errors.js";
|
|
27
|
+
import { parseBoardReconcileRequest } from "./services/boardReconcileService.js";
|
|
28
|
+
import { renderDeliveryBoard } from "./deliveryBoard.js";
|
|
17
29
|
const program = new Command();
|
|
18
|
-
program
|
|
19
|
-
.name('ai-delivery')
|
|
20
|
-
.description('Generic GitHub issue and pull request delivery')
|
|
21
|
-
.version(PACKAGE_VERSION)
|
|
22
|
-
.option('--identity <name>', 'Configured author or reviewer identity')
|
|
23
|
-
.option('--personal-auth', 'Explicit legacy personal-token author override')
|
|
24
|
-
.option('--repo <owner/name>', 'GitHub repository owner/name; works from any directory')
|
|
25
|
-
.option('--repo-root <path>', 'Launch directory or explicit clone for local operations', process.cwd());
|
|
26
|
-
// Only the plugin command group owns a local --version input. Skip global option
|
|
27
|
-
// values when selecting its parser so an unrelated argument named plugin has no effect.
|
|
30
|
+
program.name("ai-delivery").description("Generic GitHub issue and pull request delivery").version(PACKAGE_VERSION).option("--identity <name>", "Configured author or reviewer identity").option("--personal-auth", "Explicit legacy personal-token author override").option("--json", "Print JSON output").option("--verbose", "Include full bodies, diffs and routing with --json").option("--repo <owner/name>", "GitHub repository owner/name; works from any directory").option("--repo-root <path>", "Launch directory or explicit clone for local operations", process.cwd());
|
|
28
31
|
for (let index = 2; index < process.argv.length; index++) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
program.enablePositionalOptions();
|
|
38
|
-
break;
|
|
32
|
+
const argument = process.argv[index];
|
|
33
|
+
const option = program.options.find((value) => value.long === argument.split("=")[0] || value.short === argument);
|
|
34
|
+
if (option) {
|
|
35
|
+
if (option.required && !argument.includes("=")) index++;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (argument === "plugin") program.enablePositionalOptions();
|
|
39
|
+
break;
|
|
39
40
|
}
|
|
40
41
|
function execution() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
42
|
+
const options = program.opts();
|
|
43
|
+
const identity = (options.identity ?? process.env.AI_DELIVERY_IDENTITY)?.trim() || void 0;
|
|
44
|
+
return {
|
|
45
|
+
repoRoot: options.repoRoot,
|
|
46
|
+
...options.verbose === true ? { verbose: true } : {},
|
|
47
|
+
...identity === void 0 ? {} : { identity },
|
|
48
|
+
personalAuth: options.personalAuth === true,
|
|
49
|
+
...options.repo === void 0 ? {} : { repo: options.repo }
|
|
50
|
+
};
|
|
49
51
|
}
|
|
50
52
|
function int(value) {
|
|
51
|
-
|
|
53
|
+
return value === void 0 ? void 0 : Number(value);
|
|
52
54
|
}
|
|
53
55
|
function list(value) {
|
|
54
|
-
|
|
55
|
-
? undefined
|
|
56
|
-
: value
|
|
57
|
-
.split(',')
|
|
58
|
-
.map((part) => part.trim())
|
|
59
|
-
.filter(Boolean);
|
|
56
|
+
return value === void 0 ? void 0 : value.split(",").map((part) => part.trim()).filter(Boolean);
|
|
60
57
|
}
|
|
61
58
|
function ints(value) {
|
|
62
|
-
|
|
59
|
+
return list(value)?.map(Number);
|
|
63
60
|
}
|
|
64
61
|
function body(value, file) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return file === undefined ? value : readFileSync(file, 'utf8');
|
|
62
|
+
if (value !== void 0 && file !== void 0) throw new Error("Pass either --body or --body-file.");
|
|
63
|
+
return file === void 0 ? value : readFileSync(file, "utf8");
|
|
68
64
|
}
|
|
69
|
-
function fields(file, overrides) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
65
|
+
function fields(file, overrides, update = false) {
|
|
66
|
+
const value = file === void 0 ? {} : JSON.parse(readFileSync(file, "utf8"));
|
|
67
|
+
return {
|
|
68
|
+
...IssueWriteSchema.extend({
|
|
69
|
+
...NativeIssueDateFields,
|
|
70
|
+
...IssueDeferralPatch,
|
|
71
|
+
status: IssueStatusPatch.optional(),
|
|
72
|
+
...update ? { projectStatus: ProjectStatusPatch.optional() } : {},
|
|
73
|
+
preserveHistory: z.boolean().optional()
|
|
74
|
+
}).parse(value),
|
|
75
|
+
...Object.fromEntries(Object.entries(overrides).filter(([, item]) => item !== void 0))
|
|
76
|
+
};
|
|
80
77
|
}
|
|
81
78
|
function run(name, input) {
|
|
82
|
-
|
|
79
|
+
const options = program.opts();
|
|
80
|
+
return executeTool(name, input, execution()).then(
|
|
81
|
+
(value) => printCommandResult(name, value, options.json === true && options.verbose === true)
|
|
82
|
+
);
|
|
83
83
|
}
|
|
84
84
|
function print(value) {
|
|
85
|
-
|
|
85
|
+
process.stdout.write(`${JSON.stringify(value, null, 2)}
|
|
86
|
+
`);
|
|
86
87
|
}
|
|
87
88
|
function reconciliationFile(path) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));
|
|
89
|
+
const limit = 16 * 1024 * 1024;
|
|
90
|
+
const stat = statSync(path);
|
|
91
|
+
if (!stat.isFile() || stat.size > limit)
|
|
92
|
+
throw new DeliveryError("Reconciliation files must be regular UTF-8 JSON files of at most 16 MiB.");
|
|
93
|
+
const bytes = readFileSync(path);
|
|
94
|
+
if (bytes.byteLength > limit) throw new DeliveryError("Reconciliation files exceed 16 MiB.");
|
|
95
|
+
return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
96
96
|
}
|
|
97
|
-
const plugin = program.command(
|
|
98
|
-
for (const action of [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
97
|
+
const plugin = program.command("plugin").description("Manage the ai-delivery native plugin");
|
|
98
|
+
for (const action of ["install", "doctor", "preview", "update", "rollback", "remove"]) {
|
|
99
|
+
const command = plugin.command(action).requiredOption("--host <host>", "Native host: codex or claude-code").option("--scope <scope>", "Native scope: user, project, or local; Codex supports user", "user").option("--dry-run", "Describe the selected target without changing files or contacting native tools").option("--json", "Print the result as JSON");
|
|
100
|
+
if (action === "install" || action === "update")
|
|
101
|
+
command.requiredOption("--version <version>", "Explicit published package version");
|
|
102
|
+
if (action === "doctor")
|
|
103
|
+
command.option("--check-auth", "Read configured role identities and repository access; requires explicit --repo");
|
|
104
|
+
command.action(
|
|
105
|
+
async (options) => {
|
|
106
|
+
const result = await managePlugin({
|
|
107
|
+
action,
|
|
108
|
+
host: options.host,
|
|
109
|
+
scope: options.scope,
|
|
110
|
+
...options.version === void 0 ? {} : { version: options.version },
|
|
111
|
+
dryRun: options.dryRun === true,
|
|
112
|
+
checkAuth: options.checkAuth === true,
|
|
113
|
+
...options.checkAuth && execution().repo ? { repo: execution().repo } : {},
|
|
114
|
+
repoRoot: execution().repoRoot
|
|
115
|
+
});
|
|
116
|
+
if (options.json) {
|
|
117
|
+
print(result);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
process.stdout.write(
|
|
121
|
+
`${result.dryRun ? "Dry run: " : ""}${result.host} ${result.scope}: ${action}; version ${result.version ?? "none"}; installed ${result.installed}; changed ${result.changed}
|
|
122
|
+
`
|
|
123
|
+
);
|
|
124
|
+
if (result.mcp)
|
|
125
|
+
process.stdout.write(
|
|
126
|
+
`Bundled MCP startup: ${result.mcp.startup}${result.mcp.error ? ` (${result.mcp.error})` : ""}
|
|
127
|
+
`
|
|
128
|
+
);
|
|
129
|
+
if (result.diagnostics) {
|
|
130
|
+
process.stdout.write(
|
|
131
|
+
`Registration observations: ${result.diagnostics.registrations.length}; completeness ${result.diagnostics.completeness}; migration ${result.diagnostics.migration}; planned changes ${result.diagnostics.plannedChanges.length}
|
|
132
|
+
`
|
|
133
|
+
);
|
|
134
|
+
for (const entry of result.diagnostics.registrations)
|
|
135
|
+
process.stdout.write(
|
|
136
|
+
`${entry.kind} ${entry.scope}: ownership ${entry.ownership}; source ${entry.source}; version ${entry.version ?? "unknown"}
|
|
137
|
+
`
|
|
138
|
+
);
|
|
139
|
+
process.stdout.write(`Unverified conditions: ${result.diagnostics.findings.join(", ")}
|
|
140
|
+
`);
|
|
141
|
+
}
|
|
142
|
+
if (result.activation)
|
|
143
|
+
process.stdout.write(
|
|
144
|
+
`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.
|
|
145
|
+
`
|
|
146
|
+
);
|
|
147
|
+
if (result.recoveryRequired)
|
|
148
|
+
process.stdout.write("Resume the interrupted original plugin command to recover this target.\n");
|
|
149
|
+
if (result.authProbe)
|
|
150
|
+
process.stdout.write(
|
|
151
|
+
`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})` : ""}
|
|
152
|
+
Native GUI credential propagation and counted exact-head approval remain unverified.
|
|
153
|
+
`
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
);
|
|
140
157
|
}
|
|
141
|
-
program
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
resourceBounds: {
|
|
168
|
-
maxAggregateRssBytes: Number(o.maxAggregateRssBytes ?? 1024 ** 3),
|
|
169
|
-
minFreeDiskBytes: Number(o.minFreeDiskBytes ?? 256 * 1024 ** 2),
|
|
170
|
-
maxNewOutputBytes: Number(o.maxNewOutputBytes ?? 512 * 1024 ** 2),
|
|
171
|
-
maxCapturedOutputBytes: Number(o.maxCapturedOutputBytes ?? 1024 ** 2),
|
|
172
|
-
},
|
|
173
|
-
}
|
|
174
|
-
: {}),
|
|
175
|
-
}));
|
|
176
|
-
program
|
|
177
|
-
.command('runtime:admit')
|
|
178
|
-
.description('Explicitly publish the existing admission for an exact completed stage')
|
|
179
|
-
.requiredOption('--stage-id <digest>')
|
|
180
|
-
.requiredOption('--source-commit <sha>')
|
|
181
|
-
.requiredOption('--config-digest <digest>')
|
|
182
|
-
.requiredOption('--runtime-directory <path>')
|
|
183
|
-
.option('--expected-prior <digest>', 'SHA-256 of the exact current private admission bytes')
|
|
184
|
-
.option('--expected-absent', 'Explicitly require no current admission')
|
|
185
|
-
.option('--authorize-admit', 'Explicit authority for the final admission write')
|
|
186
|
-
.action(async (o) => {
|
|
187
|
-
if ((o.expectedPrior === undefined) === (o.expectedAbsent !== true))
|
|
188
|
-
throw new Error('Choose exactly one of --expected-prior or --expected-absent.');
|
|
189
|
-
return run('runtime_admit', {
|
|
190
|
-
authority: o.authorizeAdmit === true ? 'runtime:admit' : '',
|
|
191
|
-
stageId: o.stageId,
|
|
192
|
-
expectedSourceCommit: o.sourceCommit,
|
|
193
|
-
expectedConfigDigest: o.configDigest,
|
|
194
|
-
runtimeDirectory: o.runtimeDirectory,
|
|
195
|
-
expectedPriorAdmissionSha256: o.expectedAbsent === true ? null : o.expectedPrior,
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
program
|
|
199
|
-
.command('create')
|
|
200
|
-
.requiredOption('--title <title>')
|
|
201
|
-
.option('--fields-file <path>', 'UTF-8 JSON typed fields; explicit CLI fields take precedence')
|
|
202
|
-
.option('--draft', 'Explicitly write an incomplete parked draft')
|
|
203
|
-
.option('--body <markdown>')
|
|
204
|
-
.option('--body-file <path>')
|
|
205
|
-
.option('--type <type>')
|
|
206
|
-
.option('--points <number>')
|
|
207
|
-
.option('--priority <priority>')
|
|
208
|
-
.option('--labels <labels>')
|
|
209
|
-
.option('--blocked-by <numbers>')
|
|
210
|
-
.option('--blocks <numbers>', 'Add this issue as a blocker of these dependents')
|
|
211
|
-
.option('--override-reason <reason>', 'Required explanation when adding a blocker to active work')
|
|
212
|
-
.option('--milestone <number>')
|
|
213
|
-
.option('--parent <number>')
|
|
214
|
-
.action(async (o) => run('issue_create', fields(o.fieldsFile, {
|
|
158
|
+
program.command("create").requiredOption("--title <title>").option("--fields-file <path>", "UTF-8 JSON typed fields; explicit CLI fields take precedence").option("--epic", "Create an active unsized parent issue").option("--op-id <id>", "Stable identity for retrying the same create").option("--draft", "Explicitly write an incomplete parked draft").option("--body <markdown>").option("--body-file <path>").option("--type <type>").option("--points <number>").option("--priority <priority>").option("--labels <labels>").option("--blocked-by <numbers>").option("--blocks <numbers>", "Add this issue as a blocker of these dependents").option("--override-reason <reason>", "Required explanation when adding a blocker to active work").option("--milestone <number>").option("--parent <number>").action(
|
|
159
|
+
async (o) => run(
|
|
160
|
+
"issue_create",
|
|
161
|
+
fields(o.fieldsFile, {
|
|
162
|
+
title: o.title,
|
|
163
|
+
epic: o.epic,
|
|
164
|
+
opId: o.opId,
|
|
165
|
+
body: body(o.body, o.bodyFile),
|
|
166
|
+
issueType: o.type,
|
|
167
|
+
points: int(o.points),
|
|
168
|
+
priority: o.priority,
|
|
169
|
+
labels: list(o.labels),
|
|
170
|
+
blockedBy: ints(o.blockedBy),
|
|
171
|
+
blocks: ints(o.blocks),
|
|
172
|
+
overrideReason: o.overrideReason,
|
|
173
|
+
milestone: int(o.milestone),
|
|
174
|
+
parentIssueNumber: int(o.parent),
|
|
175
|
+
...o.draft === true ? { draft: true } : {}
|
|
176
|
+
})
|
|
177
|
+
)
|
|
178
|
+
);
|
|
179
|
+
program.command("start").option("--issue <number>").option("--request <text>").option("--request-id <id>", "Stable retry identity for a new issue start").option("--title <title>").option("--body <markdown>").option("--body-file <path>").option("--type <type>").option("--points <number>").option("--priority <priority>").option("--labels <labels>").option("--blocked-by <numbers>").option("--blocks <numbers>", "Add this issue as a blocker of these dependents").option("--override-reason <reason>", "Capacity override reason, or explanation when adding a blocker to active work").option("--milestone <number>").option("--parent <number>").option("--branch <branch>").option("--resume-created").action(
|
|
180
|
+
async (o) => run("issue_start", {
|
|
181
|
+
issueNumber: int(o.issue),
|
|
182
|
+
request: o.request,
|
|
183
|
+
requestId: o.requestId,
|
|
215
184
|
title: o.title,
|
|
216
185
|
body: body(o.body, o.bodyFile),
|
|
217
186
|
issueType: o.type,
|
|
@@ -223,44 +192,34 @@ program
|
|
|
223
192
|
overrideReason: o.overrideReason,
|
|
224
193
|
milestone: int(o.milestone),
|
|
225
194
|
parentIssueNumber: int(o.parent),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (Object.keys(o).some((key) => !['issue', 'investigationWorktree', 'expectedHead'].includes(key)))
|
|
252
|
-
throw new Error('Investigation registration cannot create or change issue/branch metadata.');
|
|
253
|
-
return run('issue_start', {
|
|
254
|
-
issueNumber: int(o.issue),
|
|
255
|
-
investigationWorktree: o.investigationWorktree,
|
|
256
|
-
expectedHeadSha: o.expectedHead,
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
return run('issue_start', {
|
|
195
|
+
branch: o.branch,
|
|
196
|
+
resumeCreated: o.resumeCreated === true
|
|
197
|
+
})
|
|
198
|
+
);
|
|
199
|
+
for (const name of ["list", "search"]) {
|
|
200
|
+
program.command(name).option("--query <text>", "Literal text to search in the selected repository").option("--state <state>").option("--labels <labels>").option("--parent <number>").option("--type <type>").option("--project-status <status>").option("--updated-since <timestamp>").option("--page <number>").option("--per-page <number>").action(
|
|
201
|
+
async (o) => run(name === "list" ? "issue_list" : "issue_search", {
|
|
202
|
+
query: o.query,
|
|
203
|
+
state: o.state,
|
|
204
|
+
labels: list(o.labels),
|
|
205
|
+
parentIssueNumber: int(o.parent),
|
|
206
|
+
issueType: o.type,
|
|
207
|
+
projectStatus: o.projectStatus,
|
|
208
|
+
updatedSince: o.updatedSince,
|
|
209
|
+
page: int(o.page),
|
|
210
|
+
perPage: int(o.perPage)
|
|
211
|
+
})
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
program.command("update").requiredOption("--issue <number>").option("--fields-file <path>", "UTF-8 JSON typed issue field patch").option("--draft", "Explicitly write an incomplete parked draft").option("--title <title>").option("--body <markdown>").option("--body-file <path>").option("--type <type>").option("--points <number>").option("--priority <priority>").option("--labels <labels>").option("--blocked-by <numbers>").option("--blocks <numbers>", "Add this issue as a blocker of these dependents").option("--override-reason <reason>", "Required explanation when adding a blocker to active work").option("--milestone <number>").option("--parent <number>").option("--state <state>").option("--project-status <status>", "Set Todo, In Progress, Blocked or Done with a public reason").option("--project-status-reason <reason>", "Required public reason for an explicit Project Status").option("--preserve-history", "Preserve the previous title and body before a rewrite").option("--close-reason <reason>").option("--superseded-by <number>").option("--park", "Park execution while retaining the issue worktree").option("--defer", "Defer until an explicit undefer").option("--defer-until <date>", "Record an ISO date condition without automatic undeferral").option("--defer-trigger <text>", "Record the condition for reconsidering deferred work").option("--undefer", "Explicitly clear deferral; draft and park remain unchanged").action(
|
|
215
|
+
async (o) => run(
|
|
216
|
+
"issue_update",
|
|
217
|
+
fields(
|
|
218
|
+
o.fieldsFile,
|
|
219
|
+
{
|
|
260
220
|
issueNumber: int(o.issue),
|
|
261
|
-
request: o.request,
|
|
262
|
-
requestId: o.requestId,
|
|
263
221
|
title: o.title,
|
|
222
|
+
...o.draft === true ? { draft: true } : {},
|
|
264
223
|
body: body(o.body, o.bodyFile),
|
|
265
224
|
issueType: o.type,
|
|
266
225
|
points: int(o.points),
|
|
@@ -271,317 +230,245 @@ program
|
|
|
271
230
|
overrideReason: o.overrideReason,
|
|
272
231
|
milestone: int(o.milestone),
|
|
273
232
|
parentIssueNumber: int(o.parent),
|
|
274
|
-
branch: o.branch,
|
|
275
|
-
resumeCreated: o.resumeCreated === true,
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
for (const name of ['list', 'search']) {
|
|
279
|
-
program
|
|
280
|
-
.command(name)
|
|
281
|
-
.option('--query <text>', 'Literal text to search in the selected repository')
|
|
282
|
-
.option('--state <state>')
|
|
283
|
-
.option('--labels <labels>')
|
|
284
|
-
.option('--parent <number>')
|
|
285
|
-
.option('--type <type>')
|
|
286
|
-
.option('--project-status <status>')
|
|
287
|
-
.option('--updated-since <timestamp>')
|
|
288
|
-
.option('--page <number>')
|
|
289
|
-
.option('--per-page <number>')
|
|
290
|
-
.action(async (o) => run(name === 'list' ? 'issue_list' : 'issue_search', {
|
|
291
|
-
query: o.query,
|
|
292
233
|
state: o.state,
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
.
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
.
|
|
321
|
-
.option('--close-reason <reason>')
|
|
322
|
-
.option('--superseded-by <number>')
|
|
323
|
-
.option('--park', 'Park execution while retaining the issue worktree')
|
|
324
|
-
.option('--defer', 'Defer until an explicit undefer')
|
|
325
|
-
.option('--defer-until <date>', 'Record an ISO date condition without automatic undeferral')
|
|
326
|
-
.option('--defer-trigger <text>', 'Record the condition for reconsidering deferred work')
|
|
327
|
-
.option('--undefer', 'Explicitly clear deferral; draft and park remain unchanged')
|
|
328
|
-
.action(async (o) => run('issue_update', fields(o.fieldsFile, {
|
|
329
|
-
issueNumber: int(o.issue),
|
|
330
|
-
title: o.title,
|
|
331
|
-
...(o.draft === true ? { draft: true } : {}),
|
|
332
|
-
body: body(o.body, o.bodyFile),
|
|
333
|
-
issueType: o.type,
|
|
334
|
-
points: int(o.points),
|
|
335
|
-
priority: o.priority,
|
|
336
|
-
labels: list(o.labels),
|
|
337
|
-
blockedBy: ints(o.blockedBy),
|
|
338
|
-
blocks: ints(o.blocks),
|
|
339
|
-
overrideReason: o.overrideReason,
|
|
340
|
-
milestone: int(o.milestone),
|
|
341
|
-
parentIssueNumber: int(o.parent),
|
|
342
|
-
state: o.state,
|
|
343
|
-
preserveHistory: o.preserveHistory === true ? true : undefined,
|
|
344
|
-
closeReason: o.closeReason,
|
|
345
|
-
supersededBy: int(o.supersededBy),
|
|
346
|
-
park: o.park === true ? true : undefined,
|
|
347
|
-
defer: o.defer === true || o.deferUntil !== undefined || o.deferTrigger !== undefined
|
|
348
|
-
? {
|
|
349
|
-
...(o.deferUntil === undefined ? {} : { until: o.deferUntil }),
|
|
350
|
-
...(o.deferTrigger === undefined ? {} : { trigger: o.deferTrigger }),
|
|
351
|
-
}
|
|
352
|
-
: undefined,
|
|
353
|
-
undefer: o.undefer === true ? true : undefined,
|
|
354
|
-
})));
|
|
355
|
-
program
|
|
356
|
-
.command('board:reconcile')
|
|
357
|
-
.description('Plan or apply bounded Project reconciliation for explicit repositories')
|
|
358
|
-
.requiredOption('--repositories <owner/repo...>', '1–10 explicit GitHub repositories')
|
|
359
|
-
.option('--checkouts-file <path>', 'UTF-8 JSON checkout selectors for dry-run')
|
|
360
|
-
.option('--dry-run', 'Collect a plan without writes (default)')
|
|
361
|
-
.option('--apply', 'Apply the retained original plan')
|
|
362
|
-
.option('--plan-file <path>', 'Original complete reconciliation plan JSON')
|
|
363
|
-
.option('--prior-result-file <path>', 'Optional prior result JSON for the exact original plan')
|
|
364
|
-
.action(async (options) => {
|
|
365
|
-
if (options.dryRun && options.apply)
|
|
366
|
-
throw new DeliveryError('Choose either --dry-run or --apply.');
|
|
234
|
+
projectStatus: o.projectStatus === void 0 && o.projectStatusReason === void 0 ? void 0 : ProjectStatusPatch.parse({ status: o.projectStatus, reason: o.projectStatusReason }),
|
|
235
|
+
preserveHistory: o.preserveHistory === true ? true : void 0,
|
|
236
|
+
closeReason: o.closeReason,
|
|
237
|
+
supersededBy: int(o.supersededBy),
|
|
238
|
+
park: o.park === true ? true : void 0,
|
|
239
|
+
defer: o.defer === true || o.deferUntil !== void 0 || o.deferTrigger !== void 0 ? {
|
|
240
|
+
...o.deferUntil === void 0 ? {} : { until: o.deferUntil },
|
|
241
|
+
...o.deferTrigger === void 0 ? {} : { trigger: o.deferTrigger }
|
|
242
|
+
} : void 0,
|
|
243
|
+
undefer: o.undefer === true ? true : void 0
|
|
244
|
+
},
|
|
245
|
+
true
|
|
246
|
+
)
|
|
247
|
+
)
|
|
248
|
+
);
|
|
249
|
+
program.command("board").description("Read delivery attention and readiness for explicit repositories").requiredOption("--repos <owner/repo,...>", "Explicit GitHub repositories, separated by commas").option("--decision-labels <label,...>", "Additional labels that signal human attention").option("--json", "Print the complete board as JSON").action(async (options) => {
|
|
250
|
+
const result = await executeTool(
|
|
251
|
+
"delivery_board",
|
|
252
|
+
{ repos: options.repos.split(","), decisionLabels: options.decisionLabels?.split(",") },
|
|
253
|
+
execution()
|
|
254
|
+
);
|
|
255
|
+
if (options.json || program.opts().json) print(result);
|
|
256
|
+
else process.stdout.write(`${renderDeliveryBoard(result)}
|
|
257
|
+
`);
|
|
258
|
+
});
|
|
259
|
+
program.command("board:reconcile").description("Plan or apply bounded Project reconciliation for explicit repositories").requiredOption("--repositories <owner/repo...>", "1\u201310 explicit GitHub repositories").option("--checkouts-file <path>", "UTF-8 JSON checkout selectors for dry-run").option("--dry-run", "Collect a plan without writes (default)").option("--apply", "Apply the retained original plan").option("--plan-file <path>", "Original complete reconciliation plan JSON").option("--prior-result-file <path>", "Optional prior result JSON for the exact original plan").action(
|
|
260
|
+
async (options) => {
|
|
261
|
+
if (options.dryRun && options.apply) throw new DeliveryError("Choose either --dry-run or --apply.");
|
|
367
262
|
const request = parseBoardReconcileRequest({
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
263
|
+
repositories: options.repositories,
|
|
264
|
+
...execution().repo === void 0 ? {} : { repo: execution().repo },
|
|
265
|
+
mode: options.apply ? "apply" : "dry-run",
|
|
266
|
+
...options.checkoutsFile === void 0 ? {} : { checkouts: reconciliationFile(options.checkoutsFile) },
|
|
267
|
+
...options.planFile === void 0 ? {} : { plan: reconciliationFile(options.planFile) },
|
|
268
|
+
...options.priorResultFile === void 0 ? {} : { priorResult: reconciliationFile(options.priorResultFile) }
|
|
374
269
|
});
|
|
375
|
-
return run(
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
.
|
|
381
|
-
.
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
program
|
|
387
|
-
.command('health')
|
|
388
|
-
.requiredOption('--from <utc>', 'Inclusive UTC ISO timestamp')
|
|
389
|
-
.requiredOption('--to <utc>', 'Exclusive UTC ISO timestamp')
|
|
390
|
-
.option('--max-issues <number>')
|
|
391
|
-
.option('--max-timeline-pages <number>')
|
|
392
|
-
.option('--max-project-pages <number>')
|
|
393
|
-
.option('--oldest-limit <number>')
|
|
394
|
-
.action(async (o) => run('delivery_health', {
|
|
270
|
+
return run("board_reconcile", request);
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
program.command("batch:update").description("Plan or apply 1\u201350 current-repository issue updates with ordered readback").requiredOption("--items-file <path>", "UTF-8 JSON array of complete issue_update inputs").option("--dry-run", "Return plans and readback without any native writes").action(
|
|
274
|
+
async (o) => run("issue_batch_update", {
|
|
275
|
+
items: JSON.parse(readFileSync(o.itemsFile, "utf8")),
|
|
276
|
+
dryRun: o.dryRun === true
|
|
277
|
+
})
|
|
278
|
+
);
|
|
279
|
+
program.command("health").requiredOption("--from <utc>", "Inclusive UTC ISO timestamp").requiredOption("--to <utc>", "Exclusive UTC ISO timestamp").option("--max-issues <number>").option("--max-timeline-pages <number>").option("--max-project-pages <number>").option("--oldest-limit <number>").action(
|
|
280
|
+
async (o) => run("delivery_health", {
|
|
395
281
|
repo: execution().repo,
|
|
396
282
|
from: o.from,
|
|
397
283
|
to: o.to,
|
|
398
284
|
maxIssues: int(o.maxIssues),
|
|
399
285
|
maxTimelinePages: int(o.maxTimelinePages),
|
|
400
286
|
maxProjectPages: int(o.maxProjectPages),
|
|
401
|
-
oldestLimit: int(o.oldestLimit)
|
|
402
|
-
})
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
program
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
.command(field)
|
|
414
|
-
.requiredOption('--issue <number>')
|
|
415
|
-
.action(async (o) => {
|
|
416
|
-
const info = (await executeTool('issue_info', { issueNumber: int(o.issue) }, execution()));
|
|
417
|
-
print(field === 'parent'
|
|
418
|
-
? { issueNumber: int(o.issue), parentIssueNumber: info.parentIssueNumber }
|
|
419
|
-
: { issueNumber: int(o.issue), blockedBy: info.blockedBy });
|
|
420
|
-
});
|
|
287
|
+
oldestLimit: int(o.oldestLimit)
|
|
288
|
+
})
|
|
289
|
+
);
|
|
290
|
+
program.command("info").requiredOption("--issue <number>").action(async (o) => run("issue_info", { issueNumber: int(o.issue) }));
|
|
291
|
+
program.command("ready:check").requiredOption("--issue <number>").action(async (o) => run("issue_ready_check", { issueNumber: int(o.issue) }));
|
|
292
|
+
for (const field of ["parent", "blockers"]) {
|
|
293
|
+
program.command(field).requiredOption("--issue <number>").action(async (o) => {
|
|
294
|
+
const info = await executeTool("issue_info", { issueNumber: int(o.issue) }, execution());
|
|
295
|
+
print(
|
|
296
|
+
field === "parent" ? { issueNumber: int(o.issue), parentIssueNumber: info.parentIssueNumber } : { issueNumber: int(o.issue), blockedBy: info.blockedBy }
|
|
297
|
+
);
|
|
298
|
+
});
|
|
421
299
|
}
|
|
422
|
-
program
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
.action(async (o) => {
|
|
426
|
-
const context = await contextFor(execution(), 'subissues');
|
|
427
|
-
print({ issueNumber: int(o.issue), subissues: await listIssueSubissues(context, Number(o.issue)) });
|
|
300
|
+
program.command("subissues").requiredOption("--issue <number>").action(async (o) => {
|
|
301
|
+
const context = await contextFor(execution(), "subissues");
|
|
302
|
+
print({ issueNumber: int(o.issue), subissues: await listIssueSubissues(context, Number(o.issue)) });
|
|
428
303
|
});
|
|
429
|
-
program
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
.option('--non-closing', 'Retain the issue OPEN using native non-closing reference proof')
|
|
435
|
-
.option('--title <title>')
|
|
436
|
-
.option('--body-file <path>')
|
|
437
|
-
.option('--head <branch>', 'Explicit remote head; existing PR promotion verifies its native issue association')
|
|
438
|
-
.option('--ready', 'Publish ready, or promote the author-owned PR selected by --head')
|
|
439
|
-
.option('--dry-run')
|
|
440
|
-
.action(async (o) => run('issue_pr_create', {
|
|
304
|
+
program.command("pr:create").description("Create or reuse an issue-closing PR from a pushed --head, from any directory.").requiredOption("--issue <number>").option("--pr <number>", "Exact existing PR selector; never creates a replacement").option("--non-closing", "Retain the issue OPEN using native non-closing reference proof").option(
|
|
305
|
+
"--reconcile-non-closing-reference",
|
|
306
|
+
"Explicit native closing-pair removal request; caller must hold exact authority and reconcile prior attempts"
|
|
307
|
+
).option("--expected-head <sha>", "Exact source SHA for the explicit reference action").option("--expected-base <sha>", "Exact default-base SHA for the explicit reference action").option("--title <title>").option("--body-file <path>").option("--head <branch>", "Pushed remote head; no ai-delivery branch or worktree setup required").option("--base <branch>", "Repository default branch (inferred when omitted)").option("--ready", "Publish ready, or promote the author-owned PR selected by --head").option("--dry-run").action(
|
|
308
|
+
async (o) => run("issue_pr_create", {
|
|
441
309
|
issueNumber: int(o.issue),
|
|
442
310
|
prNumber: int(o.pr),
|
|
443
311
|
nonClosing: o.nonClosing,
|
|
312
|
+
reconcileNonClosingReference: o.reconcileNonClosingReference,
|
|
313
|
+
expectedHeadSha: o.expectedHead,
|
|
314
|
+
expectedBaseSha: o.expectedBase,
|
|
444
315
|
title: o.title,
|
|
445
|
-
body: body(
|
|
316
|
+
body: body(void 0, o.bodyFile),
|
|
446
317
|
headBranch: o.head,
|
|
318
|
+
base: o.base,
|
|
447
319
|
draft: o.ready !== true,
|
|
448
|
-
dryRun: o.dryRun === true
|
|
449
|
-
})
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
.command('pr:list')
|
|
459
|
-
.option('--state <state>', 'open, closed or all', 'open')
|
|
460
|
-
.action(async (o) => {
|
|
461
|
-
if (!['open', 'closed', 'all'].includes(o.state))
|
|
462
|
-
throw new Error('Invalid PR state.');
|
|
463
|
-
const context = await contextFor(execution(), 'pr:list');
|
|
464
|
-
print(await listPrs(context, o.state));
|
|
320
|
+
dryRun: o.dryRun === true
|
|
321
|
+
})
|
|
322
|
+
);
|
|
323
|
+
program.command("pr:info").description("Inspect an exact PR; combine --issue and --pr to verify its native closing-issue association.").option("--non-closing", "Verify an exact native non-closing PR-to-issue reference").option("--issue <number>", "Issue to verify; issue-only lookup requires a GitHub-linked branch").option("--pr <number>", "Exact PR number; include --issue after issue branch links are replaced on publication").action(
|
|
324
|
+
async (o) => run("issue_pr_info", { issueNumber: int(o.issue), prNumber: int(o.pr), nonClosing: o.nonClosing })
|
|
325
|
+
);
|
|
326
|
+
program.command("pr:list").option("--state <state>", "open, closed or all", "open").action(async (o) => {
|
|
327
|
+
if (!["open", "closed", "all"].includes(o.state)) throw new Error("Invalid PR state.");
|
|
328
|
+
const context = await contextFor(execution(), "pr:list");
|
|
329
|
+
print(await listPrs(context, o.state));
|
|
465
330
|
});
|
|
466
|
-
program
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
.action(async (o) => {
|
|
470
|
-
const context = await contextFor(execution(), 'pr:checks');
|
|
471
|
-
print(await prChecks(context, Number(o.pr)));
|
|
331
|
+
program.command("pr:checks").requiredOption("--pr <number>").action(async (o) => {
|
|
332
|
+
const context = await contextFor(execution(), "pr:checks");
|
|
333
|
+
print(await prChecks(context, Number(o.pr)));
|
|
472
334
|
});
|
|
473
|
-
program
|
|
474
|
-
|
|
475
|
-
.requiredOption('--issue <number>')
|
|
476
|
-
.requiredOption('--pr <number>')
|
|
477
|
-
.requiredOption('--artifact <path>', 'Path to a UTF-8 JSON review artifact file (not inline JSON)')
|
|
478
|
-
.option('--non-closing', 'Retain the referenced issue OPEN; finish refuses this mode')
|
|
479
|
-
.option('--dry-run')
|
|
480
|
-
.action(async (o) => run('issue_pr_review', {
|
|
335
|
+
program.command("pr:review").requiredOption("--issue <number>").requiredOption("--pr <number>").requiredOption("--artifact <path>", "Path to a UTF-8 JSON review artifact file (not inline JSON)").option("--non-closing", "Retain the referenced issue OPEN; finish refuses this mode").option("--dry-run").action(
|
|
336
|
+
async (o) => run("issue_pr_review", {
|
|
481
337
|
issueNumber: int(o.issue),
|
|
482
338
|
prNumber: int(o.pr),
|
|
483
|
-
artifact: readFileSync(o.artifact,
|
|
339
|
+
artifact: readFileSync(o.artifact, "utf8"),
|
|
484
340
|
dryRun: o.dryRun === true,
|
|
485
|
-
nonClosing: o.nonClosing
|
|
486
|
-
})
|
|
341
|
+
nonClosing: o.nonClosing
|
|
342
|
+
})
|
|
343
|
+
);
|
|
344
|
+
program.command("review").argument("<action>", "submit or doctor").description("Submit an independent verdict or check its configured App").option("--pr <number>", "Required for submit").option("--head <sha>", "Required exact head for submit").option("--identity <name>", "Required configured reviewer profile").option("--verdict <path>", "Required for submit: UTF-8 JSON verdict, at most 64 KiB").action(async (action, o) => {
|
|
345
|
+
if (!["submit", "doctor"].includes(action)) throw new DeliveryError("review action must be submit or doctor.");
|
|
346
|
+
const identity = o.identity ?? execution().identity ?? "";
|
|
347
|
+
const settings = await loadDeliverySettings(void 0, { reviewerIdentity: identity, prepareEnvironment: true });
|
|
348
|
+
const profile = settings.roles.reviewer;
|
|
349
|
+
if (!("appId" in profile))
|
|
350
|
+
throw new DeliveryError("identity: Select a reviewer profile with explicit App/provider binding.");
|
|
351
|
+
if (action === "doctor") {
|
|
352
|
+
if (o.pr !== void 0 || o.head !== void 0 || o.verdict !== void 0)
|
|
353
|
+
throw new DeliveryError("review doctor does not accept submission inputs.");
|
|
354
|
+
const clients2 = await createDeliveryGitHubClients({
|
|
355
|
+
config: settings,
|
|
356
|
+
identity,
|
|
357
|
+
role: "reviewer",
|
|
358
|
+
env: settings.environment
|
|
359
|
+
});
|
|
360
|
+
const actorLogin = await clients2.appActorLogin();
|
|
361
|
+
printCommandResult("review:doctor", {
|
|
362
|
+
status: "authenticated",
|
|
363
|
+
identity,
|
|
364
|
+
provider: profile.provider,
|
|
365
|
+
appId: profile.appId,
|
|
366
|
+
installationId: profile.installationId,
|
|
367
|
+
actorLogin,
|
|
368
|
+
source: appCredentialSource(profile).type
|
|
369
|
+
});
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (o.pr === void 0 || o.head === void 0 || o.verdict === void 0)
|
|
373
|
+
throw new DeliveryError("review submit requires --pr, --head and --verdict.");
|
|
374
|
+
const fd = openSync(o.verdict, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
375
|
+
let raw;
|
|
376
|
+
let verdictFileSha256;
|
|
377
|
+
try {
|
|
378
|
+
if (!fstatSync(fd).isFile()) throw new DeliveryError("verdict: Expected a regular file.");
|
|
379
|
+
const bytes = Buffer.alloc(64 * 1024 + 1);
|
|
380
|
+
let size = 0;
|
|
381
|
+
while (size < bytes.length) {
|
|
382
|
+
const count = readSync(fd, bytes, size, bytes.length - size, null);
|
|
383
|
+
if (count === 0) break;
|
|
384
|
+
size += count;
|
|
385
|
+
}
|
|
386
|
+
if (size > 64 * 1024) throw new DeliveryError("verdict: File exceeds 64 KiB.");
|
|
387
|
+
const content = bytes.subarray(0, size);
|
|
388
|
+
raw = content.toString("utf8");
|
|
389
|
+
if (!Buffer.from(raw, "utf8").equals(content)) throw new DeliveryError("verdict: Expected valid UTF-8.");
|
|
390
|
+
verdictFileSha256 = `sha256:${createHash("sha256").update(content).digest("hex")}`;
|
|
391
|
+
} finally {
|
|
392
|
+
closeSync(fd);
|
|
393
|
+
}
|
|
394
|
+
const verdict = parseReviewVerdict(raw);
|
|
395
|
+
assertReviewVerdictTarget(verdict, profile.provider, o.head);
|
|
396
|
+
const prNumber = z.number().int().positive().parse(Number(o.pr));
|
|
397
|
+
const authorContext = await contextFor(
|
|
398
|
+
{ ...execution(), settings, identity, reviewSubmission: true },
|
|
399
|
+
"pr:info",
|
|
400
|
+
"author"
|
|
401
|
+
);
|
|
402
|
+
const reviewBase = await readGitHubReviewBase(authorContext, prNumber, o.head);
|
|
403
|
+
const artifact = buildReviewArtifact({
|
|
404
|
+
verdict,
|
|
405
|
+
verdictFileSha256,
|
|
406
|
+
identity,
|
|
407
|
+
provider: profile.provider,
|
|
408
|
+
expectedHead: o.head,
|
|
409
|
+
prNumber,
|
|
410
|
+
authorIdentity: settings.roles.author.identity,
|
|
411
|
+
reviewBase
|
|
412
|
+
});
|
|
413
|
+
await validateReviewTarget(authorContext, artifact, prNumber);
|
|
414
|
+
const clients = await createDeliveryGitHubClients({
|
|
415
|
+
config: authorContext.config,
|
|
416
|
+
identity,
|
|
417
|
+
role: "reviewer",
|
|
418
|
+
selectedAuthor: authorContext.clients,
|
|
419
|
+
...authorContext.credentialEnvironment === void 0 ? {} : { env: authorContext.credentialEnvironment }
|
|
420
|
+
});
|
|
421
|
+
const context = { ...authorContext, clients };
|
|
422
|
+
try {
|
|
423
|
+
printCommandResult(
|
|
424
|
+
"review:submit",
|
|
425
|
+
await submitFormalReview(context, {
|
|
426
|
+
artifact: JSON.stringify(artifact),
|
|
427
|
+
issueNumber: verdict.issueNumber,
|
|
428
|
+
prNumber,
|
|
429
|
+
...verdict.nonClosing === void 0 ? {} : { nonClosing: verdict.nonClosing }
|
|
430
|
+
})
|
|
431
|
+
);
|
|
432
|
+
} catch (error) {
|
|
433
|
+
if (!(error instanceof ReviewSubmissionError)) throw error;
|
|
434
|
+
process.stdout.write(
|
|
435
|
+
`${JSON.stringify({ status: "submission-unverified", submission: error.submission, nextAction: error.message })}
|
|
436
|
+
`
|
|
437
|
+
);
|
|
438
|
+
process.exitCode = 1;
|
|
439
|
+
}
|
|
440
|
+
});
|
|
487
441
|
for (const [command, tool] of [
|
|
488
|
-
|
|
489
|
-
|
|
442
|
+
["pr:merge", "issue_pr_merge"],
|
|
443
|
+
["finish", "issue_finish"]
|
|
490
444
|
]) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
if (command === 'finish')
|
|
502
|
-
mergeCommand
|
|
503
|
-
.option('--investigation', 'Complete an unchanged prospectively registered investigation')
|
|
504
|
-
.option('--result <path>', 'Durable independently reviewed result outside the removable worktree')
|
|
505
|
-
.option('--authority-comment <number>', 'Exact native operator removal authority comment')
|
|
506
|
-
.option('--acceptance-comment <number>', 'Exact configured-App result acceptance comment');
|
|
507
|
-
mergeCommand.action(async (o) => {
|
|
508
|
-
if (o.investigation === true) {
|
|
509
|
-
if (o.pr !== undefined ||
|
|
510
|
-
o.strategy !== undefined ||
|
|
511
|
-
o.reviewedHead !== undefined ||
|
|
512
|
-
o.nonClosing !== undefined)
|
|
513
|
-
throw new Error('Investigation completion cannot accept PR or merge options.');
|
|
514
|
-
return run(tool, {
|
|
515
|
-
issueNumber: int(o.issue),
|
|
516
|
-
investigation: true,
|
|
517
|
-
resultPath: o.result,
|
|
518
|
-
authorityCommentId: int(o.authorityComment),
|
|
519
|
-
acceptanceCommentId: int(o.acceptanceComment),
|
|
520
|
-
dryRun: o.dryRun === true,
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
if (o.result !== undefined || o.authorityComment !== undefined || o.acceptanceComment !== undefined)
|
|
524
|
-
throw new Error('Investigation evidence requires --investigation.');
|
|
525
|
-
return run(tool, {
|
|
526
|
-
issueNumber: int(o.issue),
|
|
527
|
-
prNumber: int(o.pr),
|
|
528
|
-
strategy: o.strategy,
|
|
529
|
-
reviewedHeadSha: o.reviewedHead,
|
|
530
|
-
dryRun: o.dryRun === true,
|
|
531
|
-
nonClosing: o.nonClosing,
|
|
532
|
-
});
|
|
533
|
-
});
|
|
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
|
+
);
|
|
534
455
|
}
|
|
535
|
-
program
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
.option('--disposition <disposition>', 'retain (default) or explicitly unheld remove')
|
|
540
|
-
.option('--terminal-pr <number>')
|
|
541
|
-
.option('--retained-holds <comment-ids>', 'Comma-separated native retained-hold comment IDs')
|
|
542
|
-
.option('--retained-admission <path>')
|
|
543
|
-
.option('--retained-archive <path>')
|
|
544
|
-
.action(async (o) => run('issue_worktree_transition_inspect', {
|
|
545
|
-
issueNumber: int(o.issue),
|
|
546
|
-
purpose: o.purpose,
|
|
547
|
-
...(o.disposition === undefined ? {} : { disposition: o.disposition }),
|
|
548
|
-
...(o.terminalPr === undefined ? {} : { terminalPrNumber: int(o.terminalPr) }),
|
|
549
|
-
...(o.retainedHolds === undefined ? {} : { retainedHoldCommentIds: ints(o.retainedHolds) }),
|
|
550
|
-
...(o.retainedAdmission === undefined ? {} : { retainedAdmissionPath: o.retainedAdmission }),
|
|
551
|
-
...(o.retainedArchive === undefined ? {} : { retainedArchivePath: o.retainedArchive }),
|
|
552
|
-
}));
|
|
553
|
-
program
|
|
554
|
-
.command('worktree:transition:apply')
|
|
555
|
-
.requiredOption('--plan <path>')
|
|
556
|
-
.requiredOption('--plan-id <digest>')
|
|
557
|
-
.requiredOption('--relinquishment-comment <id>')
|
|
558
|
-
.requiredOption('--acceptance-comment <id>')
|
|
559
|
-
.option('--authorize-transition', 'Explicit authority for this exact independently accepted plan')
|
|
560
|
-
.action(async (o) => run('issue_worktree_transition_apply', {
|
|
561
|
-
authority: o.authorizeTransition === true ? 'worktree:transition' : '',
|
|
562
|
-
planPath: o.plan,
|
|
563
|
-
expectedPlanId: o.planId,
|
|
564
|
-
relinquishmentCommentId: Number(o.relinquishmentComment),
|
|
565
|
-
acceptanceCommentId: Number(o.acceptanceComment),
|
|
566
|
-
}));
|
|
567
|
-
program
|
|
568
|
-
.command('migrate:legacy-issues')
|
|
569
|
-
.requiredOption('--input-file <path>', 'Offline legacy issue inventory JSON')
|
|
570
|
-
.action((o) => {
|
|
571
|
-
const report = planOfflineLegacyIssueMigration(JSON.parse(readFileSync(o.inputFile, 'utf8')));
|
|
572
|
-
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
456
|
+
program.command("migrate:legacy-issues").requiredOption("--input-file <path>", "Offline legacy issue inventory JSON").action((o) => {
|
|
457
|
+
const report = planOfflineLegacyIssueMigration(JSON.parse(readFileSync(o.inputFile, "utf8")));
|
|
458
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}
|
|
459
|
+
`);
|
|
573
460
|
});
|
|
574
|
-
program
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
.
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
461
|
+
program.command("config:resolve").description("Read the effective GitHub destination and admission digest").action(async () => {
|
|
462
|
+
const context = await contextFor(execution(), "config:resolve");
|
|
463
|
+
print({
|
|
464
|
+
configDigest: context.configuration?.configDigest,
|
|
465
|
+
routing: context.configuration?.routing,
|
|
466
|
+
reviewRoute: await preflightReviewRoute(context, void 0, void 0, "development")
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
program.command("mcp:serve").action(async () => serveAiDeliveryMcp(execution()));
|
|
470
|
+
program.parseAsync(process.argv).catch((error) => {
|
|
471
|
+
const options = program.opts();
|
|
472
|
+
printCommandError(error, options.json === true && options.verbose === true);
|
|
584
473
|
});
|
|
585
|
-
|
|
586
|
-
program.parseAsync(process.argv).catch(printCommandError);
|
|
587
|
-
//# sourceMappingURL=cli.js.map
|
|
474
|
+
//# sourceMappingURL=cli.js.map
|