@aviaratech/ai-delivery 0.3.34 → 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 -506
- 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 +1746 -0
- package/dist/boardReconcile.test.js.map +7 -0
- 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 +406 -485
- package/dist/cli.js.map +7 -1
- package/dist/cliResult.d.ts +2 -2
- package/dist/cliResult.js +42 -25
- package/dist/cliResult.js.map +7 -1
- package/dist/cliResult.test.js +434 -297
- package/dist/cliResult.test.js.map +7 -1
- package/dist/config/deliveryConfig.d.ts +320 -14
- package/dist/config/deliveryConfig.js +472 -385
- package/dist/config/deliveryConfig.js.map +7 -1
- package/dist/config/deliveryConfig.test.js +775 -584
- 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 -477
- 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.d.ts +1 -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 +17 -12
- package/dist/dispatch.js +330 -322
- package/dist/dispatch.js.map +7 -1
- package/dist/errors.d.ts +16 -3
- package/dist/errors.js +104 -82
- 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 -51
- package/dist/github/commandIdentityPolicy.js.map +7 -1
- package/dist/github/discovery.d.ts +3 -0
- package/dist/github/discovery.js +197 -201
- 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 +53 -1
- package/dist/github/projectDelivery.js +623 -460
- package/dist/github/projectDelivery.js.map +7 -1
- package/dist/github/relationships.d.ts +5 -2
- package/dist/github/relationships.js +434 -333
- 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 +103 -7
- package/dist/issue.js +2104 -1547
- 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 +1004 -683
- 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 +1088 -593
- 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 -90
- package/dist/mcp/index.js.map +7 -1
- package/dist/mcp/tools.d.ts +790 -220
- package/dist/mcp/tools.js +267 -333
- 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 -1231
- package/dist/pluginInstaller.js.map +7 -1
- package/dist/pluginInstaller.test.js +1822 -1283
- package/dist/pluginInstaller.test.js.map +7 -1
- package/dist/pluginPackaging.test.js +485 -305
- 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 +1204 -0
- package/dist/services/boardReconcileService.js +1445 -0
- package/dist/services/boardReconcileService.js.map +7 -0
- package/dist/services/deliveryAdmission.d.ts +2 -0
- package/dist/services/deliveryAdmission.js +129 -152
- 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 +354 -350
- 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 -1929
- 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.d.ts +6 -0
- package/dist/version.js +24 -10
- 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 +10 -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 +261 -43
- package/plugins/ai-delivery/runtime/dist/cli.js +369 -125
- 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 -3058
- 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 → boardReconcile.test.d.ts} +0 -0
- /package/dist/{setup.test.d.ts → build.test.d.ts} +0 -0
- /package/dist/{worktreeTransition.test.d.ts → callerErrors.test.d.ts} +0 -0
package/dist/mcp/tools.js
CHANGED
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { NativeIssueDateFields } from
|
|
3
|
-
import { DeliveryHealthInput } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { NativeIssueDateFields } from "../github/nativeIssueMetadata.js";
|
|
3
|
+
import { DeliveryHealthInput } from "../services/deliveryHealthService.js";
|
|
4
|
+
import { BoardReconcileInput } from "../services/boardReconcileService.js";
|
|
5
|
+
import { OverrideReason } from "../services/blockerGuardService.js";
|
|
6
|
+
import { JournalInputSchema, JOURNAL_SCHEMA_METADATA } from "../issueJournal.js";
|
|
7
|
+
import {
|
|
8
|
+
IssueFields,
|
|
9
|
+
IssueWriteFields,
|
|
10
|
+
ISSUE_JSON_SCHEMAS,
|
|
11
|
+
issueInputSchema,
|
|
12
|
+
CreateIssueStatus,
|
|
13
|
+
IssueStatusPatch,
|
|
14
|
+
ProjectStatusPatch,
|
|
15
|
+
IssueDeferralPatch
|
|
16
|
+
} from "../issueContract.js";
|
|
17
|
+
const Verbose = z.boolean().optional().describe("Return the full payload, including bodies, diffs and routing.");
|
|
7
18
|
const Positive = z.number().int().positive();
|
|
8
19
|
const Labels = z.array(z.string().trim().min(1));
|
|
9
|
-
const REPO_HELP =
|
|
10
|
-
const Repo = z
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.describe(REPO_HELP);
|
|
15
|
-
export const AI_DELIVERY_MCP_CONTRACT_VERSION = 'ai-delivery.mcp@2';
|
|
16
|
-
const IssueUpdateInput = issueInputSchema(z
|
|
17
|
-
.strictObject({
|
|
20
|
+
const REPO_HELP = "GitHub owner/name. Pass the repository named by the user. An explicit repo avoids launch-directory Git for ordinary remote issue/PR work; retained local modes keep their own checkout requirements.";
|
|
21
|
+
const Repo = z.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u).optional().describe(REPO_HELP);
|
|
22
|
+
const AI_DELIVERY_MCP_CONTRACT_VERSION = "ai-delivery.mcp@2";
|
|
23
|
+
const IssueUpdateInput = issueInputSchema(
|
|
24
|
+
z.strictObject({
|
|
18
25
|
...IssueWriteFields,
|
|
19
26
|
...NativeIssueDateFields,
|
|
20
27
|
status: IssueStatusPatch.optional(),
|
|
28
|
+
projectStatus: ProjectStatusPatch.optional(),
|
|
21
29
|
repo: Repo,
|
|
22
30
|
blockedBy: z.array(Positive).optional(),
|
|
23
31
|
blocks: z.array(Positive).optional(),
|
|
@@ -32,333 +40,259 @@ const IssueUpdateInput = issueInputSchema(z
|
|
|
32
40
|
...IssueDeferralPatch,
|
|
33
41
|
points: IssueWriteFields.points,
|
|
34
42
|
priority: z.string().min(1).optional(),
|
|
35
|
-
state: z.enum([
|
|
43
|
+
state: z.enum(["open", "closed"]).optional(),
|
|
36
44
|
preserveHistory: z.boolean().optional(),
|
|
37
|
-
closeReason: z.enum([
|
|
45
|
+
closeReason: z.enum(["completed", "not_planned", "duplicate"]).optional(),
|
|
38
46
|
supersededBy: Positive.optional(),
|
|
39
|
-
title: IssueWriteFields.title
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
title: IssueWriteFields.title
|
|
48
|
+
}).superRefine((input, ctx) => {
|
|
49
|
+
if (input.defer !== void 0 && input.undefer !== void 0)
|
|
50
|
+
ctx.addIssue({ code: "custom", message: "Choose defer or undefer, never both.", path: ["defer"] });
|
|
51
|
+
if ((input.closeReason !== void 0 || input.supersededBy !== void 0) && input.state !== "closed")
|
|
52
|
+
ctx.addIssue({
|
|
53
|
+
code: "custom",
|
|
54
|
+
path: ["state"],
|
|
55
|
+
message: "Closure details require a closed issue; set state to closed.",
|
|
56
|
+
params: { issueCode: "closure.state" }
|
|
57
|
+
});
|
|
58
|
+
})
|
|
59
|
+
);
|
|
52
60
|
const Tracking = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.optional()
|
|
67
|
-
.describe(REPO_HELP),
|
|
68
|
-
title: z.string().trim().min(1).max(256),
|
|
61
|
+
verbose: Verbose,
|
|
62
|
+
blockedBy: z.array(Positive).optional(),
|
|
63
|
+
blocks: z.array(Positive).optional(),
|
|
64
|
+
overrideReason: OverrideReason.optional(),
|
|
65
|
+
body: z.string().optional(),
|
|
66
|
+
issueType: z.string().min(1).optional(),
|
|
67
|
+
labels: Labels.optional(),
|
|
68
|
+
milestone: Positive.optional(),
|
|
69
|
+
parentIssueNumber: Positive.optional(),
|
|
70
|
+
points: Positive.optional(),
|
|
71
|
+
priority: z.string().min(1).optional(),
|
|
72
|
+
repo: z.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u).optional().describe(REPO_HELP),
|
|
73
|
+
title: z.string().trim().min(1, "Issue title is empty; enter a title.").max(256, "Issue title exceeds 256 characters; shorten the title.")
|
|
69
74
|
};
|
|
70
|
-
const InvestigationStart = z.strictObject({
|
|
71
|
-
repo: Repo,
|
|
72
|
-
issueNumber: Positive,
|
|
73
|
-
investigationWorktree: z.string().min(1),
|
|
74
|
-
expectedHeadSha: z.string().regex(/^[a-f0-9]{40}$/u),
|
|
75
|
-
});
|
|
76
75
|
const NormalStart = z.strictObject({
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
...Tracking,
|
|
77
|
+
title: Tracking.title.optional(),
|
|
78
|
+
issueNumber: Positive.optional(),
|
|
79
|
+
request: z.string().min(1).optional(),
|
|
80
|
+
requestId: z.string().trim().min(1).max(256).optional(),
|
|
81
|
+
resumeCreated: z.boolean().optional(),
|
|
82
|
+
branch: z.string().min(1).optional()
|
|
84
83
|
});
|
|
85
84
|
const NormalFinish = z.strictObject({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
strategy: z.enum(['merge', 'squash', 'rebase']).optional(),
|
|
95
|
-
dryRun: z.boolean().optional(),
|
|
85
|
+
repo: Repo,
|
|
86
|
+
verbose: Verbose,
|
|
87
|
+
issueNumber: Positive,
|
|
88
|
+
prNumber: Positive,
|
|
89
|
+
nonClosing: z.boolean().optional(),
|
|
90
|
+
reviewedHeadSha: z.string().regex(/^[a-f0-9]{40}$/u).optional(),
|
|
91
|
+
strategy: z.enum(["merge", "squash", "rebase"]).optional(),
|
|
92
|
+
dryRun: z.boolean().optional()
|
|
96
93
|
});
|
|
97
|
-
const InvestigationFinish = z.strictObject({
|
|
98
|
-
repo: Repo,
|
|
99
|
-
issueNumber: Positive,
|
|
100
|
-
investigation: z.literal(true),
|
|
101
|
-
resultPath: z.string().min(1),
|
|
102
|
-
authorityCommentId: Positive.optional(),
|
|
103
|
-
acceptanceCommentId: Positive.optional(),
|
|
104
|
-
dryRun: z.boolean().optional(),
|
|
105
|
-
});
|
|
106
|
-
function validateMode(schema, input, context) {
|
|
107
|
-
const result = schema.safeParse(input);
|
|
108
|
-
if (!result.success)
|
|
109
|
-
context.addIssue({ code: 'custom', message: result.error.message });
|
|
110
|
-
}
|
|
111
94
|
const IssueListing = {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
page: Positive.optional(),
|
|
125
|
-
perPage: Positive.max(100).optional(),
|
|
95
|
+
repo: Repo,
|
|
96
|
+
verbose: Verbose,
|
|
97
|
+
state: z.enum(["open", "closed", "all"]).optional(),
|
|
98
|
+
labels: z.array(
|
|
99
|
+
z.string().min(1).regex(/^[^"\\\r\n]+$/u)
|
|
100
|
+
).optional(),
|
|
101
|
+
parentIssueNumber: Positive.nullable().optional(),
|
|
102
|
+
issueType: z.string().min(1).optional(),
|
|
103
|
+
projectStatus: z.enum(["Todo", "In Progress", "Blocked", "Done"]).nullable().optional(),
|
|
104
|
+
updatedSince: z.iso.datetime({ offset: true }).optional(),
|
|
105
|
+
page: Positive.optional(),
|
|
106
|
+
perPage: Positive.max(100).optional()
|
|
126
107
|
};
|
|
127
|
-
const SearchText = z
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
{
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
repo: Repo,
|
|
309
|
-
issueNumber: Positive,
|
|
310
|
-
prNumber: Positive,
|
|
311
|
-
nonClosing: z.boolean().optional(),
|
|
312
|
-
reviewedHeadSha: z
|
|
313
|
-
.string()
|
|
314
|
-
.regex(/^[a-f0-9]{40}$/u)
|
|
315
|
-
.optional(),
|
|
316
|
-
strategy: z.enum(['merge', 'squash', 'rebase']).optional(),
|
|
317
|
-
dryRun: z.boolean().optional(),
|
|
318
|
-
}),
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
name: 'issue_finish',
|
|
322
|
-
commandName: 'finish',
|
|
323
|
-
description: 'Finish merged delivery, or remove a prospectively registered unchanged investigation with native acceptance',
|
|
324
|
-
inputSchema: NormalFinish.extend({
|
|
325
|
-
prNumber: Positive.optional(),
|
|
326
|
-
investigation: z.literal(true).optional(),
|
|
327
|
-
resultPath: z.string().optional(),
|
|
328
|
-
authorityCommentId: Positive.optional(),
|
|
329
|
-
acceptanceCommentId: Positive.optional(),
|
|
330
|
-
}).superRefine((input, context) => validateMode(input.investigation === true ? InvestigationFinish : NormalFinish, input, context)),
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
name: 'issue_worktree_transition_inspect',
|
|
334
|
-
commandName: 'worktree:transition:inspect',
|
|
335
|
-
description: 'Read a legacy issue row, original evidence and exact closure gaps without changing ownership',
|
|
336
|
-
inputSchema: z.strictObject({
|
|
337
|
-
repo: Repo,
|
|
338
|
-
issueNumber: Positive,
|
|
339
|
-
purpose: z.enum(['active-resume', 'merged-cleanup']),
|
|
340
|
-
disposition: z.enum(['retain', 'remove']).optional(),
|
|
341
|
-
terminalPrNumber: Positive.optional(),
|
|
342
|
-
retainedHoldCommentIds: z.array(Positive).optional(),
|
|
343
|
-
retainedAdmissionPath: z.string().min(1).optional(),
|
|
344
|
-
retainedArchivePath: z.string().min(1).optional(),
|
|
345
|
-
}),
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
name: 'issue_worktree_transition_apply',
|
|
349
|
-
commandName: 'worktree:transition:apply',
|
|
350
|
-
description: 'Apply or resume one exact independently accepted transition with immutable preservation and closure proof',
|
|
351
|
-
inputSchema: z.strictObject({
|
|
352
|
-
repo: Repo,
|
|
353
|
-
authority: z.literal('worktree:transition'),
|
|
354
|
-
planPath: z.string().min(1),
|
|
355
|
-
expectedPlanId: z.string().regex(/^sha256:[a-f0-9]{64}$/u),
|
|
356
|
-
relinquishmentCommentId: Positive,
|
|
357
|
-
acceptanceCommentId: Positive,
|
|
358
|
-
}),
|
|
359
|
-
},
|
|
108
|
+
const SearchText = z.string().trim().min(1).max(256).regex(/^[^"\\\r\n]+$/u);
|
|
109
|
+
const AI_DELIVERY_MCP_TOOLS = [
|
|
110
|
+
{
|
|
111
|
+
name: "delivery_board",
|
|
112
|
+
commandName: "board",
|
|
113
|
+
description: "Read human attention, native PR readiness, stale In Progress issues and seven-day delivery marker fractions for explicit repositories. Partial observations are data, never merge authority.",
|
|
114
|
+
inputSchema: z.strictObject({
|
|
115
|
+
repos: z.array(Repo.unwrap()).min(1),
|
|
116
|
+
decisionLabels: z.array(z.string().min(1)).optional(),
|
|
117
|
+
verbose: Verbose
|
|
118
|
+
})
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "board_reconcile",
|
|
122
|
+
commandName: "board:reconcile",
|
|
123
|
+
description: "Plan or apply bounded Project membership and proven Status reconciliation for 1\u201310 explicit repositories. Retain the original plan and optional prior result for recovery; unknown activity and metadata suggestions never authorize writes.",
|
|
124
|
+
inputSchema: BoardReconcileInput
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "delivery_health",
|
|
128
|
+
commandName: "health",
|
|
129
|
+
description: "Read bounded native delivery health for an explicit repository and UTC window",
|
|
130
|
+
inputSchema: DeliveryHealthInput
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "issue_comment",
|
|
134
|
+
commandName: "comment",
|
|
135
|
+
description: "Post a typed issue journal with authoritative comment readback. Provide the fields required by kind: start: outcome; progress: done, decisionNeeded and non-empty evidence; decision: non-empty decision and rationale; blocker: blocker and resolution; closeout: acceptance and followUps. Omit fields belonging to other kinds.",
|
|
136
|
+
inputSchema: z.strictObject({ ...JournalInputSchema.shape, repo: Repo, verbose: Verbose }).superRefine(({ repo: _repo, verbose: _verbose, ...journal }, ctx) => {
|
|
137
|
+
const parsed = JournalInputSchema.safeParse(journal);
|
|
138
|
+
if (!parsed.success)
|
|
139
|
+
for (const issue of parsed.error.issues)
|
|
140
|
+
ctx.addIssue({ code: "custom", path: issue.path, message: issue.message });
|
|
141
|
+
}).meta(JOURNAL_SCHEMA_METADATA)
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "issue_create",
|
|
145
|
+
commandName: "create",
|
|
146
|
+
description: "Create a native GitHub tracking issue with configured metadata and relationships",
|
|
147
|
+
issueContract: ISSUE_JSON_SCHEMAS,
|
|
148
|
+
inputSchema: issueInputSchema(
|
|
149
|
+
z.strictObject({
|
|
150
|
+
...Tracking,
|
|
151
|
+
...NativeIssueDateFields,
|
|
152
|
+
...IssueWriteFields,
|
|
153
|
+
title: IssueFields.shape.title,
|
|
154
|
+
opId: z.string().trim().min(1).max(256).optional().describe(
|
|
155
|
+
"Stable retry identity: repeat the same original arguments to complete a partial create without another issue."
|
|
156
|
+
),
|
|
157
|
+
status: CreateIssueStatus.optional()
|
|
158
|
+
})
|
|
159
|
+
)
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "issue_start",
|
|
163
|
+
commandName: "start",
|
|
164
|
+
description: "Start a linked issue",
|
|
165
|
+
inputSchema: NormalStart
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "issue_list",
|
|
169
|
+
commandName: "list",
|
|
170
|
+
description: "List repository issues with native filters, named organization fields and pagination",
|
|
171
|
+
inputSchema: z.strictObject({ ...IssueListing, query: SearchText.optional() })
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "issue_search",
|
|
175
|
+
commandName: "search",
|
|
176
|
+
description: "Search literal issue text in the selected repository with native filters and pagination",
|
|
177
|
+
inputSchema: z.strictObject({ ...IssueListing, query: SearchText })
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "issue_update",
|
|
181
|
+
commandName: "update",
|
|
182
|
+
description: "Update native issue fields and exact relationship sets with readback",
|
|
183
|
+
inputSchema: IssueUpdateInput.safeExtend({ verbose: Verbose })
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "issue_batch_update",
|
|
187
|
+
commandName: "batch:update",
|
|
188
|
+
description: "Plan or apply 1\u201350 issue updates in one repository, with ordered partial results and readback",
|
|
189
|
+
inputSchema: issueInputSchema(
|
|
190
|
+
z.strictObject({
|
|
191
|
+
repo: Repo,
|
|
192
|
+
verbose: Verbose,
|
|
193
|
+
items: z.array(IssueUpdateInput).min(1).max(50),
|
|
194
|
+
dryRun: z.boolean().optional()
|
|
195
|
+
})
|
|
196
|
+
)
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "issue_info",
|
|
200
|
+
commandName: "info",
|
|
201
|
+
description: "Read live GitHub issue metadata, relationships, Project status, linked PRs (state, checks, reviews) and the latest journal in one call. Child counts by default; verbose adds the body, routing and full child progress. Pass the requested owner/name as repo; an explicit repo works outside Git without a checkout. This read does not start or update the issue.",
|
|
202
|
+
inputSchema: z.strictObject({ issueNumber: Positive, repo: Repo, verbose: Verbose })
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "issue_ready_check",
|
|
206
|
+
commandName: "ready:check",
|
|
207
|
+
description: "Evaluate deterministic readiness from live native issue state",
|
|
208
|
+
inputSchema: z.strictObject({ issueNumber: Positive, repo: Tracking.repo, verbose: Verbose })
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "issue_pr_create",
|
|
212
|
+
commandName: "pr:create",
|
|
213
|
+
description: "Create or reuse an issue-closing PR from any directory using repo, issueNumber and a pushed head. Restore a missing closing link on reuse.",
|
|
214
|
+
inputSchema: z.strictObject({
|
|
215
|
+
repo: Repo,
|
|
216
|
+
verbose: Verbose,
|
|
217
|
+
issueNumber: Positive,
|
|
218
|
+
prNumber: Positive.optional(),
|
|
219
|
+
nonClosing: z.boolean().optional(),
|
|
220
|
+
reconcileNonClosingReference: z.boolean().optional(),
|
|
221
|
+
expectedHeadSha: z.string().regex(/^[a-f0-9]{40}$/u).optional(),
|
|
222
|
+
expectedBaseSha: z.string().regex(/^[a-f0-9]{40}$/u).optional(),
|
|
223
|
+
body: z.string().min(1, "PR body is empty; enter a body or omit it to use the default body.").optional(),
|
|
224
|
+
draft: z.boolean().optional(),
|
|
225
|
+
dryRun: z.boolean().optional(),
|
|
226
|
+
title: z.string().min(1, "PR title is empty; enter a title or omit it to use the issue title.").optional(),
|
|
227
|
+
headBranch: z.string().min(1).optional(),
|
|
228
|
+
head: z.string().min(1).optional(),
|
|
229
|
+
base: z.string().min(1).optional()
|
|
230
|
+
}).refine(
|
|
231
|
+
(input) => input.head === void 0 || input.headBranch === void 0 || input.head === input.headBranch,
|
|
232
|
+
"PR head selectors disagree; use the same branch for head and headBranch."
|
|
233
|
+
).refine(
|
|
234
|
+
(input) => input.reconcileNonClosingReference === true ? input.nonClosing === true && input.draft !== false && input.body !== void 0 && input.expectedHeadSha !== void 0 && input.expectedBaseSha !== void 0 : input.expectedHeadSha === void 0 && input.expectedBaseSha === void 0,
|
|
235
|
+
"Reference reconciliation requires explicit nonClosing, DRAFT, body and exact head/base; SHA inputs require the action."
|
|
236
|
+
)
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "issue_pr_info",
|
|
240
|
+
commandName: "pr:info",
|
|
241
|
+
description: "Inspect a PR by number or its GitHub-linked issue branch: state, merge state, checks, reviews and each linked issue's state, Project status and latest journal, in one call",
|
|
242
|
+
inputSchema: z.strictObject({
|
|
243
|
+
repo: Repo,
|
|
244
|
+
verbose: Verbose,
|
|
245
|
+
issueNumber: Positive.optional(),
|
|
246
|
+
prNumber: Positive.optional(),
|
|
247
|
+
nonClosing: z.boolean().optional()
|
|
248
|
+
})
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: "issue_pr_review",
|
|
252
|
+
commandName: "pr:review",
|
|
253
|
+
description: "Submit one existing exact-head independent review with the reviewer App role",
|
|
254
|
+
inputSchema: z.strictObject({
|
|
255
|
+
repo: Repo,
|
|
256
|
+
verbose: Verbose,
|
|
257
|
+
issueNumber: Positive,
|
|
258
|
+
prNumber: Positive,
|
|
259
|
+
nonClosing: z.boolean().optional(),
|
|
260
|
+
artifact: z.string().min(1, "Review artifact is empty; provide the independent review artifact JSON."),
|
|
261
|
+
identity: z.string().min(1).optional(),
|
|
262
|
+
dryRun: z.boolean().optional()
|
|
263
|
+
})
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: "issue_pr_merge",
|
|
267
|
+
commandName: "pr:merge",
|
|
268
|
+
description: "Guarded exact-head merge",
|
|
269
|
+
inputSchema: z.strictObject({
|
|
270
|
+
repo: Repo,
|
|
271
|
+
verbose: Verbose,
|
|
272
|
+
issueNumber: Positive.optional(),
|
|
273
|
+
prNumber: Positive,
|
|
274
|
+
nonClosing: z.boolean().optional(),
|
|
275
|
+
reviewedHeadSha: z.string().regex(/^[a-f0-9]{40}$/u, "Reviewed head is invalid; provide the exact 40-character lowercase commit SHA.").optional(),
|
|
276
|
+
strategy: z.enum(["merge", "squash", "rebase"]).optional(),
|
|
277
|
+
dryRun: z.boolean().optional()
|
|
278
|
+
}).refine((input) => input.issueNumber !== void 0, {
|
|
279
|
+
path: ["issueNumber"],
|
|
280
|
+
message: "Direct merge is missing its issue number; provide issueNumber."
|
|
281
|
+
})
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: "issue_finish",
|
|
285
|
+
commandName: "finish",
|
|
286
|
+
description: "Finish merged delivery",
|
|
287
|
+
inputSchema: NormalFinish
|
|
288
|
+
}
|
|
360
289
|
];
|
|
361
|
-
|
|
362
|
-
|
|
290
|
+
function getAiDeliveryMcpTool(name) {
|
|
291
|
+
return AI_DELIVERY_MCP_TOOLS.find((tool) => tool.name === name) ?? null;
|
|
363
292
|
}
|
|
364
|
-
|
|
293
|
+
export {
|
|
294
|
+
AI_DELIVERY_MCP_CONTRACT_VERSION,
|
|
295
|
+
AI_DELIVERY_MCP_TOOLS,
|
|
296
|
+
getAiDeliveryMcpTool
|
|
297
|
+
};
|
|
298
|
+
//# sourceMappingURL=tools.js.map
|