@aviaratech/ai-delivery 0.3.35 → 0.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +12 -206
- package/README.md +56 -554
- package/dist/agent.d.ts +1 -3
- package/dist/agent.js +74 -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 +91 -0
- package/dist/callerErrors.test.js.map +7 -0
- package/dist/cli.js +389 -517
- 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 +316 -354
- 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 +63 -23
- 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.d.ts +0 -3
- package/dist/git.js +59 -76
- 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 +42 -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 +1938 -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 +252 -310
- package/dist/mcp/tools.js +235 -342
- 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 +417 -413
- package/dist/pluginPackaging.test.js.map +7 -1
- package/dist/pr.d.ts +114 -131
- package/dist/pr.js +1314 -1327
- package/dist/pr.js.map +7 -1
- package/dist/pr.test.js +967 -653
- 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 +123 -89
- package/dist/prDispatch.test.js.map +7 -1
- package/dist/readView.d.ts +184 -0
- package/dist/readView.js +218 -0
- package/dist/readView.js.map +7 -0
- package/dist/readView.test.d.ts +1 -0
- package/dist/readView.test.js +146 -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/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/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 +321 -358
- 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 +274 -281
- package/dist/targetPolicyRoutes.test.js.map +7 -1
- package/dist/targetRepositoryExecution.test.d.ts +1 -0
- package/dist/targetRepositoryExecution.test.js +451 -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.d.ts +0 -2
- package/dist/utils/atomicJson.js +81 -77
- package/dist/utils/atomicJson.js.map +7 -1
- package/dist/utils/filesystem.d.ts +0 -8
- package/dist/utils/filesystem.js +5 -19
- 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 -54
- package/dist/verification.js +976 -1941
- 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 +45 -24
- package/dist/version.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 +351 -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/services/deliveryAdmission.d.ts +0 -49
- package/dist/services/deliveryAdmission.js +0 -165
- package/dist/services/deliveryAdmission.js.map +0 -1
- package/dist/services/worktreeRegistry.d.ts +0 -434
- package/dist/services/worktreeRegistry.js +0 -1248
- package/dist/services/worktreeRegistry.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/worktree.d.ts +0 -28
- package/dist/worktree.js +0 -188
- package/dist/worktree.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/issueJournal.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
declare const JournalVariants: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
-
kind: z.ZodLiteral<"start">;
|
|
4
|
-
outcome: z.ZodString;
|
|
5
3
|
issueNumber: z.ZodNumber;
|
|
6
4
|
summary: z.ZodString;
|
|
7
5
|
status: z.ZodString;
|
|
@@ -11,23 +9,35 @@ declare const JournalVariants: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
11
9
|
evidence: z.ZodArray<z.ZodURL>;
|
|
12
10
|
details: z.ZodOptional<z.ZodString>;
|
|
13
11
|
lengthCap: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
kind: z.ZodLiteral<"start">;
|
|
13
|
+
outcome: z.ZodString;
|
|
14
14
|
}, z.core.$strict>, z.ZodObject<{
|
|
15
|
+
issueNumber: z.ZodNumber;
|
|
16
|
+
summary: z.ZodString;
|
|
17
|
+
status: z.ZodString;
|
|
18
|
+
nextStep: z.ZodString;
|
|
19
|
+
nextDate: z.ZodNullable<z.ZodISODate>;
|
|
20
|
+
keyNumbers: z.ZodArray<z.ZodString>;
|
|
21
|
+
details: z.ZodOptional<z.ZodString>;
|
|
22
|
+
lengthCap: z.ZodOptional<z.ZodNumber>;
|
|
15
23
|
kind: z.ZodLiteral<"progress">;
|
|
16
24
|
evidence: z.ZodArray<z.ZodURL>;
|
|
17
25
|
done: z.ZodArray<z.ZodString>;
|
|
18
26
|
decisionNeeded: z.ZodString;
|
|
27
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
19
28
|
issueNumber: z.ZodNumber;
|
|
20
29
|
summary: z.ZodString;
|
|
21
30
|
status: z.ZodString;
|
|
22
31
|
nextStep: z.ZodString;
|
|
23
32
|
nextDate: z.ZodNullable<z.ZodISODate>;
|
|
24
33
|
keyNumbers: z.ZodArray<z.ZodString>;
|
|
34
|
+
evidence: z.ZodArray<z.ZodURL>;
|
|
25
35
|
details: z.ZodOptional<z.ZodString>;
|
|
26
36
|
lengthCap: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
28
37
|
kind: z.ZodLiteral<"decision">;
|
|
29
38
|
decision: z.ZodString;
|
|
30
39
|
rationale: z.ZodString;
|
|
40
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
41
|
issueNumber: z.ZodNumber;
|
|
32
42
|
summary: z.ZodString;
|
|
33
43
|
status: z.ZodString;
|
|
@@ -37,10 +47,10 @@ declare const JournalVariants: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
37
47
|
evidence: z.ZodArray<z.ZodURL>;
|
|
38
48
|
details: z.ZodOptional<z.ZodString>;
|
|
39
49
|
lengthCap: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
41
50
|
kind: z.ZodLiteral<"blocker">;
|
|
42
51
|
blocker: z.ZodString;
|
|
43
52
|
resolution: z.ZodString;
|
|
53
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
44
54
|
issueNumber: z.ZodNumber;
|
|
45
55
|
summary: z.ZodString;
|
|
46
56
|
status: z.ZodString;
|
|
@@ -50,13 +60,28 @@ declare const JournalVariants: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
50
60
|
evidence: z.ZodArray<z.ZodURL>;
|
|
51
61
|
details: z.ZodOptional<z.ZodString>;
|
|
52
62
|
lengthCap: z.ZodOptional<z.ZodNumber>;
|
|
53
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
54
63
|
kind: z.ZodLiteral<"closeout">;
|
|
55
64
|
acceptance: z.ZodArray<z.ZodObject<{
|
|
56
65
|
criterion: z.ZodString;
|
|
57
66
|
evidence: z.ZodURL;
|
|
58
67
|
}, z.core.$strict>>;
|
|
59
68
|
followUps: z.ZodArray<z.ZodString>;
|
|
69
|
+
}, z.core.$strict>], "kind">;
|
|
70
|
+
export type JournalInput = z.infer<typeof JournalVariants>;
|
|
71
|
+
/** Publish the same kind requirements enforced by the canonical variant schemas. */
|
|
72
|
+
export declare const JOURNAL_SCHEMA_METADATA: {
|
|
73
|
+
required: string[];
|
|
74
|
+
anyOf: {
|
|
75
|
+
properties: {
|
|
76
|
+
kind: {
|
|
77
|
+
const: "blocker" | "closeout" | "decision" | "progress" | "start";
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
required: string[];
|
|
81
|
+
}[];
|
|
82
|
+
};
|
|
83
|
+
export declare function missingJournalFields(input: Record<string, unknown>): string[];
|
|
84
|
+
export declare const JournalInputSchema: z.ZodObject<{
|
|
60
85
|
issueNumber: z.ZodNumber;
|
|
61
86
|
summary: z.ZodString;
|
|
62
87
|
status: z.ZodString;
|
|
@@ -66,15 +91,12 @@ declare const JournalVariants: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
66
91
|
evidence: z.ZodArray<z.ZodURL>;
|
|
67
92
|
details: z.ZodOptional<z.ZodString>;
|
|
68
93
|
lengthCap: z.ZodOptional<z.ZodNumber>;
|
|
69
|
-
}, z.core.$strict>], "kind">;
|
|
70
|
-
export type JournalInput = z.infer<typeof JournalVariants>;
|
|
71
|
-
export declare const JournalInputSchema: z.ZodObject<{
|
|
72
94
|
kind: z.ZodEnum<{
|
|
73
95
|
blocker: "blocker";
|
|
96
|
+
closeout: "closeout";
|
|
97
|
+
decision: "decision";
|
|
74
98
|
progress: "progress";
|
|
75
99
|
start: "start";
|
|
76
|
-
decision: "decision";
|
|
77
|
-
closeout: "closeout";
|
|
78
100
|
}>;
|
|
79
101
|
outcome: z.ZodOptional<z.ZodString>;
|
|
80
102
|
done: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -88,17 +110,16 @@ export declare const JournalInputSchema: z.ZodObject<{
|
|
|
88
110
|
evidence: z.ZodURL;
|
|
89
111
|
}, z.core.$strict>>>;
|
|
90
112
|
followUps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
91
|
-
issueNumber: z.ZodNumber;
|
|
92
|
-
summary: z.ZodString;
|
|
93
|
-
status: z.ZodString;
|
|
94
|
-
nextStep: z.ZodString;
|
|
95
|
-
nextDate: z.ZodNullable<z.ZodISODate>;
|
|
96
|
-
keyNumbers: z.ZodArray<z.ZodString>;
|
|
97
|
-
evidence: z.ZodArray<z.ZodURL>;
|
|
98
|
-
details: z.ZodOptional<z.ZodString>;
|
|
99
|
-
lengthCap: z.ZodOptional<z.ZodNumber>;
|
|
100
113
|
}, z.core.$strict>;
|
|
101
114
|
export declare function renderJournal(raw: JournalInput, marker?: string): string;
|
|
115
|
+
export type JournalAttention = {
|
|
116
|
+
kind: JournalInput['kind'] | null;
|
|
117
|
+
state: 'pending' | 'clear' | 'unknown';
|
|
118
|
+
request: string | null;
|
|
119
|
+
reason: string | null;
|
|
120
|
+
};
|
|
121
|
+
/** Read only unambiguous structure emitted by renderJournal; free text is not a second template. */
|
|
122
|
+
export declare function parseJournalAttention(body: string): JournalAttention;
|
|
102
123
|
export declare function acceptanceCriteria(body: string): string[];
|
|
103
124
|
export declare function issueFollowUps(body: string): string[];
|
|
104
125
|
export {};
|
package/dist/issueJournal.js
CHANGED
|
@@ -1,149 +1,240 @@
|
|
|
1
|
-
import { isIP } from
|
|
2
|
-
import { z } from
|
|
3
|
-
const Text = z.string().trim().min(1).max(
|
|
4
|
-
const Summary = Text.max(500).refine((value) => !/[\r\n]/u.test(value),
|
|
1
|
+
import { isIP } from "node:net";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const Text = z.string().trim().min(1).max(1e4);
|
|
4
|
+
const Summary = Text.max(500).refine((value) => !/[\r\n]/u.test(value), "Summary must be one plain-language line.");
|
|
5
5
|
const Date = z.iso.date();
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
hostname !== 'localhost' &&
|
|
20
|
-
!hostname.endsWith('.localhost') &&
|
|
21
|
-
!hostname.endsWith('.local'));
|
|
22
|
-
}, 'Evidence must be an HTTPS link with a public DNS hostname and no credentials or IP literal.');
|
|
6
|
+
const EvidenceUrl = z.url({ protocol: /^https$/u }).refine((value) => {
|
|
7
|
+
let url;
|
|
8
|
+
try {
|
|
9
|
+
url = new URL(value);
|
|
10
|
+
} catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const hostname = url.hostname.replace(/^\[|\]$/gu, "").replace(/\.$/u, "");
|
|
14
|
+
return !url.username && !url.password && isIP(hostname) === 0 && hostname.includes(".") && hostname !== "localhost" && !hostname.endsWith(".localhost") && !hostname.endsWith(".local");
|
|
15
|
+
}, "Evidence must be an HTTPS link with a public DNS hostname and no credentials or IP literal.");
|
|
16
|
+
const Evidence = EvidenceUrl.describe(
|
|
17
|
+
"HTTPS link with a public DNS hostname, such as a GitHub URL; no IP, localhost or credentials."
|
|
18
|
+
);
|
|
23
19
|
const Common = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
issueNumber: z.number().int().positive(),
|
|
21
|
+
summary: Summary,
|
|
22
|
+
status: Text,
|
|
23
|
+
nextStep: Text,
|
|
24
|
+
nextDate: Date.nullable(),
|
|
25
|
+
keyNumbers: z.array(Text),
|
|
26
|
+
evidence: z.array(Evidence),
|
|
27
|
+
details: Text.optional(),
|
|
28
|
+
lengthCap: z.number().int().min(600).max(1e4).optional()
|
|
33
29
|
};
|
|
34
|
-
const JournalVariants = z.discriminatedUnion(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
...Common,
|
|
38
|
-
kind: z.literal('progress'),
|
|
39
|
-
evidence: z.array(Evidence).min(1),
|
|
40
|
-
done: z.array(Text).min(1),
|
|
41
|
-
decisionNeeded: Text,
|
|
42
|
-
}),
|
|
43
|
-
z.strictObject({ ...Common, kind: z.literal('decision'), decision: Text, rationale: Text }),
|
|
44
|
-
z.strictObject({ ...Common, kind: z.literal('blocker'), blocker: Text, resolution: Text }),
|
|
45
|
-
z.strictObject({
|
|
46
|
-
...Common,
|
|
47
|
-
kind: z.literal('closeout'),
|
|
48
|
-
acceptance: z.array(z.strictObject({ criterion: Text, evidence: Evidence })).min(1),
|
|
49
|
-
followUps: z.array(Text),
|
|
50
|
-
}),
|
|
51
|
-
]);
|
|
52
|
-
// MCP requires an object schema; the same variant validator enforces kind-specific fields.
|
|
53
|
-
export const JournalInputSchema = z
|
|
54
|
-
.strictObject({
|
|
30
|
+
const JournalVariants = z.discriminatedUnion("kind", [
|
|
31
|
+
z.strictObject({ ...Common, kind: z.literal("start"), outcome: Text }),
|
|
32
|
+
z.strictObject({
|
|
55
33
|
...Common,
|
|
56
|
-
kind: z
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
acceptance: z
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
34
|
+
kind: z.literal("progress"),
|
|
35
|
+
evidence: z.array(Evidence).min(1),
|
|
36
|
+
done: z.array(Text).min(1),
|
|
37
|
+
decisionNeeded: Text
|
|
38
|
+
}),
|
|
39
|
+
z.strictObject({ ...Common, kind: z.literal("decision"), decision: Text, rationale: Text }),
|
|
40
|
+
z.strictObject({ ...Common, kind: z.literal("blocker"), blocker: Text, resolution: Text }),
|
|
41
|
+
z.strictObject({
|
|
42
|
+
...Common,
|
|
43
|
+
kind: z.literal("closeout"),
|
|
44
|
+
acceptance: z.array(z.strictObject({ criterion: Text, evidence: Evidence })).min(1),
|
|
45
|
+
followUps: z.array(Text)
|
|
46
|
+
})
|
|
47
|
+
]);
|
|
48
|
+
const JOURNAL_SCHEMA_METADATA = {
|
|
49
|
+
required: [
|
|
50
|
+
...Object.entries(Common).filter(([, schema]) => !schema.isOptional()).map(([key]) => key),
|
|
51
|
+
"kind"
|
|
52
|
+
],
|
|
53
|
+
anyOf: JournalVariants.options.map((variant) => ({
|
|
54
|
+
properties: { kind: { const: variant.shape.kind.value } },
|
|
55
|
+
required: Object.entries(variant.shape).filter(([key, schema]) => !(key in Common) && key !== "kind" && !schema.isOptional()).map(([key]) => key)
|
|
56
|
+
}))
|
|
57
|
+
};
|
|
58
|
+
function missingJournalFields(input) {
|
|
59
|
+
const variant = JournalVariants.options.find((option) => option.shape.kind.value === input.kind);
|
|
60
|
+
const shape = variant?.shape ?? { ...Common, kind: z.string() };
|
|
61
|
+
return Object.entries(shape).filter(([key, schema]) => !schema.isOptional() && input[key] === void 0).map(([key]) => key);
|
|
62
|
+
}
|
|
63
|
+
const JournalInputSchema = z.strictObject({
|
|
64
|
+
...Common,
|
|
65
|
+
kind: z.enum(["start", "progress", "decision", "blocker", "closeout"]).describe(
|
|
66
|
+
"Select a journal kind and provide its required fields: start: outcome; progress: done, decisionNeeded and non-empty evidence; decision: decision and rationale; blocker: blocker and resolution; closeout: acceptance and followUps."
|
|
67
|
+
),
|
|
68
|
+
outcome: Text.optional(),
|
|
69
|
+
done: z.array(Text).min(1).optional(),
|
|
70
|
+
decisionNeeded: Text.optional(),
|
|
71
|
+
decision: Text.optional().describe("Required non-empty text when kind is decision; omit for every other kind."),
|
|
72
|
+
rationale: Text.optional().describe("Required non-empty text when kind is decision; omit for every other kind."),
|
|
73
|
+
blocker: Text.optional(),
|
|
74
|
+
resolution: Text.optional(),
|
|
75
|
+
acceptance: z.array(
|
|
76
|
+
z.strictObject(
|
|
77
|
+
{ criterion: Text, evidence: Evidence },
|
|
78
|
+
{ error: "Invalid acceptance entry. Provide only criterion and evidence." }
|
|
79
|
+
)
|
|
80
|
+
).min(1).optional(),
|
|
81
|
+
followUps: z.array(Text).optional()
|
|
82
|
+
}).superRefine((input, ctx) => {
|
|
83
|
+
const parsed = JournalVariants.safeParse(input);
|
|
84
|
+
if (!parsed.success)
|
|
85
|
+
for (const issue of parsed.error.issues)
|
|
86
|
+
ctx.addIssue({ code: "custom", path: issue.path, message: issue.message });
|
|
77
87
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
88
|
+
function renderJournal(raw, marker) {
|
|
89
|
+
const input = JournalVariants.parse(raw);
|
|
90
|
+
const plainPreview = (value) => {
|
|
91
|
+
const plain = value.replace(/!?\[([^\]]+)\]\([^)]*\)/gu, "$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-+*]\s+|\d+[.)]\s+)/gmu, "").replace(/[*_~`<>[\]\\]/gu, "").replace(/\s+/gu, " ").trim();
|
|
92
|
+
const preview = plain.slice(0, 32);
|
|
93
|
+
const last = preview.charCodeAt(preview.length - 1);
|
|
94
|
+
return last >= 55296 && last <= 56319 ? preview.slice(0, -1) : preview;
|
|
95
|
+
};
|
|
96
|
+
const field = (label, value) => `**${label}:**${/\n|^(?:[-*+]\s|\d+[.)]\s)/u.test(value) ? "\n" : " "}${value}`;
|
|
97
|
+
const list = (values) => values.map((value) => "- " + value.replace(/\n/gu, "\n ")).join("\n");
|
|
98
|
+
const sections = [`**Kind:** ${input.kind}. **Status:** ${input.status}`];
|
|
99
|
+
switch (input.kind) {
|
|
100
|
+
case "start":
|
|
101
|
+
sections.push(field("Outcome", input.outcome));
|
|
102
|
+
break;
|
|
103
|
+
case "progress":
|
|
104
|
+
sections.push(`**Done since last:**
|
|
105
|
+
${list(input.done)}`, field("Decision needed", input.decisionNeeded));
|
|
106
|
+
break;
|
|
107
|
+
case "decision":
|
|
108
|
+
sections.push(field("Decision", input.decision), field("Rationale", input.rationale));
|
|
109
|
+
break;
|
|
110
|
+
case "blocker":
|
|
111
|
+
sections.push(field("Blocker", input.blocker), field("Resolution needed", input.resolution));
|
|
112
|
+
break;
|
|
113
|
+
case "closeout":
|
|
114
|
+
sections.push(
|
|
115
|
+
`**Acceptance evidence:**
|
|
116
|
+
${input.acceptance.map((item) => `- ${item.criterion} \u2014 ${item.evidence}`).join("\n")}`,
|
|
117
|
+
`**Follow-ups:** ${input.followUps.length ? input.followUps.join("; ") : "None."}`
|
|
118
|
+
);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
sections.push(
|
|
122
|
+
`**Key numbers:** ${input.keyNumbers.length ? input.keyNumbers.join("; ") : "None reported."}`,
|
|
123
|
+
`**Next:** ${input.nextStep} (${input.nextDate ?? "date not scheduled"}).`,
|
|
124
|
+
`**Evidence:** ${input.evidence.length ? input.evidence.join(" \xB7 ") : "None yet."}`
|
|
125
|
+
);
|
|
126
|
+
if (input.details) sections.push(input.details);
|
|
127
|
+
let body = `Status: ${plainPreview(input.status)}. Next: ${plainPreview(input.nextStep)}.
|
|
128
|
+
|
|
129
|
+
${input.summary}`;
|
|
130
|
+
let overflow = "";
|
|
131
|
+
for (const section of sections) {
|
|
132
|
+
if (overflow || body.length + section.length + 2 > (input.lengthCap ?? 1800)) overflow += `
|
|
133
|
+
|
|
134
|
+
${section}`;
|
|
135
|
+
else body += `
|
|
136
|
+
|
|
137
|
+
${section}`;
|
|
138
|
+
}
|
|
139
|
+
if (overflow) body += `
|
|
140
|
+
|
|
141
|
+
<details>
|
|
142
|
+
<summary>Additional journal detail</summary>${overflow}
|
|
143
|
+
|
|
144
|
+
</details>`;
|
|
145
|
+
return marker === void 0 ? body : `${body}
|
|
146
|
+
|
|
147
|
+
${marker}`;
|
|
148
|
+
}
|
|
149
|
+
function parseJournalAttention(body) {
|
|
150
|
+
const unknown = () => ({
|
|
151
|
+
kind: null,
|
|
152
|
+
state: "unknown",
|
|
153
|
+
request: null,
|
|
154
|
+
reason: "Journal structure is incomplete or ambiguous."
|
|
155
|
+
});
|
|
156
|
+
const preview = /^Status: ([^\r\n]{0,32})\. Next: ([^\r\n]{0,32})\.\n\n(?!\*\*Kind:\*\*)/.exec(body);
|
|
157
|
+
if (preview && preview.slice(1).every((value) => value.length <= 32 && !/[*_~`<>[\]\\]|[^\S ]/u.test(value)))
|
|
158
|
+
body = body.slice(preview[0].length);
|
|
159
|
+
const markers = body.match(/<!--\s*ai-delivery:journal@/gu) ?? [];
|
|
160
|
+
if (markers.length) {
|
|
161
|
+
const suffix = /\n\n<!-- ai-delivery:journal@1:sha256:[a-f0-9]{64} -->$/u.exec(body);
|
|
162
|
+
if (markers.length !== 1 || !suffix) return unknown();
|
|
163
|
+
body = body.slice(0, suffix.index);
|
|
164
|
+
}
|
|
165
|
+
if (/<\/?details>|<\/?summary>/u.test(body)) {
|
|
166
|
+
const opening = "\n\n<details>\n<summary>Additional journal detail</summary>";
|
|
167
|
+
if (body.split("<details>").length !== 2 || body.split("</details>").length !== 2 || body.split("<summary>").length !== 2 || body.split("</summary>").length !== 2 || !body.includes(opening) || !body.endsWith("\n\n</details>"))
|
|
168
|
+
return unknown();
|
|
169
|
+
body = body.replace(opening, "").slice(0, -"\n\n</details>".length);
|
|
170
|
+
}
|
|
171
|
+
const kind = /\*\*Kind:\*\* (start|progress|decision|blocker|closeout)\. \*\*Status:\*\*/u.exec(body)?.[1];
|
|
172
|
+
if (!kind) return unknown();
|
|
173
|
+
const fields = {
|
|
174
|
+
start: ["Outcome"],
|
|
175
|
+
progress: ["Done since last", "Decision needed"],
|
|
176
|
+
decision: ["Decision", "Rationale"],
|
|
177
|
+
blocker: ["Blocker", "Resolution needed"],
|
|
178
|
+
closeout: ["Acceptance evidence", "Follow-ups"]
|
|
179
|
+
};
|
|
180
|
+
const expected = ["Kind", "Status", ...fields[kind], "Key numbers", "Next", "Evidence"];
|
|
181
|
+
const matches = [
|
|
182
|
+
...body.matchAll(
|
|
183
|
+
/\*\*(Kind|Status|Outcome|Done since last|Decision needed|Decision|Rationale|Blocker|Resolution needed|Acceptance evidence|Follow-ups|Key numbers|Next|Evidence):\*\*/gu
|
|
184
|
+
)
|
|
185
|
+
];
|
|
186
|
+
if (matches.length !== expected.length || matches.some((match, i) => match[1] !== expected[i])) return unknown();
|
|
187
|
+
const first = matches[0].index;
|
|
188
|
+
if (!/^[^\r\n]+\n\n$/u.test(body.slice(0, first))) return unknown();
|
|
189
|
+
let request = null;
|
|
190
|
+
for (const [i, match] of matches.entries()) {
|
|
191
|
+
if (i !== 1 && body.slice(match.index - 2, match.index) !== "\n\n") return unknown();
|
|
192
|
+
let fence = null;
|
|
193
|
+
for (const line of body.slice(0, match.index).split("\n")) {
|
|
194
|
+
const edge = /^ {0,3}(`{3,}|~{3,})(.*)$/u.exec(line);
|
|
195
|
+
if (!edge) continue;
|
|
196
|
+
if (fence === null) fence = edge[1];
|
|
197
|
+
else if (edge[1][0] === fence[0] && edge[1].length >= fence.length && !edge[2].trim()) fence = null;
|
|
110
198
|
}
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
|
|
199
|
+
if (fence !== null) return unknown();
|
|
200
|
+
const end = matches[i + 1]?.index ?? body.length;
|
|
201
|
+
const value = body.slice(match.index + match[0].length, end).trim();
|
|
202
|
+
if (!value) return unknown();
|
|
203
|
+
if (match[1] === "Decision needed") request = value;
|
|
204
|
+
}
|
|
205
|
+
if (kind !== "progress") return { kind, state: "clear", request: null, reason: null };
|
|
206
|
+
if (request === null) return unknown();
|
|
207
|
+
return /^(?:none\.?|n\/a|not needed)$/iu.test(request) ? { kind, state: "clear", request: null, reason: null } : { kind, state: "pending", request, reason: null };
|
|
114
208
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
.match(/^[-*+]\s*\[[ xX]\][ \t](.*)$/u)?.[1]
|
|
120
|
-
?.trim() ?? '')
|
|
121
|
-
.filter(Boolean);
|
|
209
|
+
function acceptanceCriteria(body) {
|
|
210
|
+
return journalSection(body, ["acceptance criteria"]).map(
|
|
211
|
+
(line) => line.trimStart().match(/^[-*+]\s*\[[ xX]\][ \t](.*)$/u)?.[1]?.trim() ?? ""
|
|
212
|
+
).filter(Boolean);
|
|
122
213
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
.match(/^[-*+]\s*(?:\[[ xX]\][ \t])?(.*)$/u)?.[1]
|
|
128
|
-
?.trim() ?? '')
|
|
129
|
-
.filter(Boolean);
|
|
214
|
+
function issueFollowUps(body) {
|
|
215
|
+
return journalSection(body, ["follow-ups", "follow ups"]).map(
|
|
216
|
+
(line) => line.trimStart().match(/^[-*+]\s*(?:\[[ xX]\][ \t])?(.*)$/u)?.[1]?.trim() ?? ""
|
|
217
|
+
).filter(Boolean);
|
|
130
218
|
}
|
|
131
|
-
// Match readiness's ATX heading boundaries without changing its separate contract owner.
|
|
132
219
|
function journalSection(body, headings) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (heading(line) !== undefined)
|
|
144
|
-
break;
|
|
145
|
-
section.push(line);
|
|
146
|
-
}
|
|
147
|
-
return section;
|
|
220
|
+
const heading = (line) => line.match(/^ {0,3}#{1,6}[ \t](.*)$/u)?.[1]?.trim().toLowerCase();
|
|
221
|
+
const lines = body.split(/\r?\n/u);
|
|
222
|
+
const start = lines.findIndex((line) => headings.includes(heading(line) ?? ""));
|
|
223
|
+
if (start === -1) return [];
|
|
224
|
+
const section = [];
|
|
225
|
+
for (const line of lines.slice(start + 1)) {
|
|
226
|
+
if (heading(line) !== void 0) break;
|
|
227
|
+
section.push(line);
|
|
228
|
+
}
|
|
229
|
+
return section;
|
|
148
230
|
}
|
|
149
|
-
|
|
231
|
+
export {
|
|
232
|
+
JOURNAL_SCHEMA_METADATA,
|
|
233
|
+
JournalInputSchema,
|
|
234
|
+
acceptanceCriteria,
|
|
235
|
+
issueFollowUps,
|
|
236
|
+
missingJournalFields,
|
|
237
|
+
parseJournalAttention,
|
|
238
|
+
renderJournal
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=issueJournal.js.map
|
package/dist/issueJournal.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/issueJournal.ts"],
|
|
4
|
+
"sourcesContent": ["import { isIP } from 'node:net';\nimport { z } from 'zod';\n\nconst Text = z.string().trim().min(1).max(10000);\nconst Summary = Text.max(500).refine((value) => !/[\\r\\n]/u.test(value), 'Summary must be one plain-language line.');\nconst Date = z.iso.date();\nconst EvidenceUrl = z.url({ protocol: /^https$/u }).refine((value) => {\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n return false;\n }\n const hostname = url.hostname.replace(/^\\[|\\]$/gu, '').replace(/\\.$/u, '');\n return (\n !url.username &&\n !url.password &&\n isIP(hostname) === 0 &&\n hostname.includes('.') &&\n hostname !== 'localhost' &&\n !hostname.endsWith('.localhost') &&\n !hostname.endsWith('.local')\n );\n}, 'Evidence must be an HTTPS link with a public DNS hostname and no credentials or IP literal.');\nconst Evidence = EvidenceUrl.describe(\n 'HTTPS link with a public DNS hostname, such as a GitHub URL; no IP, localhost or credentials.',\n);\nconst Common = {\n issueNumber: z.number().int().positive(),\n summary: Summary,\n status: Text,\n nextStep: Text,\n nextDate: Date.nullable(),\n keyNumbers: z.array(Text),\n evidence: z.array(Evidence),\n details: Text.optional(),\n lengthCap: z.number().int().min(600).max(10000).optional(),\n};\n\nconst JournalVariants = z.discriminatedUnion('kind', [\n z.strictObject({ ...Common, kind: z.literal('start'), outcome: Text }),\n z.strictObject({\n ...Common,\n kind: z.literal('progress'),\n evidence: z.array(Evidence).min(1),\n done: z.array(Text).min(1),\n decisionNeeded: Text,\n }),\n z.strictObject({ ...Common, kind: z.literal('decision'), decision: Text, rationale: Text }),\n z.strictObject({ ...Common, kind: z.literal('blocker'), blocker: Text, resolution: Text }),\n z.strictObject({\n ...Common,\n kind: z.literal('closeout'),\n acceptance: z.array(z.strictObject({ criterion: Text, evidence: Evidence })).min(1),\n followUps: z.array(Text),\n }),\n]);\nexport type JournalInput = z.infer<typeof JournalVariants>;\n/** Publish the same kind requirements enforced by the canonical variant schemas. */\nexport const JOURNAL_SCHEMA_METADATA = {\n required: [\n ...Object.entries(Common)\n .filter(([, schema]) => !schema.isOptional())\n .map(([key]) => key),\n 'kind',\n ],\n anyOf: JournalVariants.options.map((variant) => ({\n properties: { kind: { const: variant.shape.kind.value } },\n required: Object.entries(variant.shape as Record<string, z.ZodType>)\n .filter(([key, schema]) => !(key in Common) && key !== 'kind' && !schema.isOptional())\n .map(([key]) => key),\n })),\n};\nexport function missingJournalFields(input: Record<string, unknown>): string[] {\n const variant = JournalVariants.options.find((option) => option.shape.kind.value === input.kind);\n const shape = variant?.shape ?? { ...Common, kind: z.string() };\n return Object.entries(shape as Record<string, z.ZodType>)\n .filter(([key, schema]) => !schema.isOptional() && input[key] === undefined)\n .map(([key]) => key);\n}\n\n// MCP requires an object schema; the same variant validator enforces kind-specific fields.\nexport const JournalInputSchema = z\n .strictObject({\n ...Common,\n kind: z\n .enum(['start', 'progress', 'decision', 'blocker', 'closeout'])\n .describe(\n 'Select a journal kind and provide its required fields: start: outcome; progress: done, decisionNeeded and non-empty evidence; decision: decision and rationale; blocker: blocker and resolution; closeout: acceptance and followUps.',\n ),\n outcome: Text.optional(),\n done: z.array(Text).min(1).optional(),\n decisionNeeded: Text.optional(),\n decision: Text.optional().describe('Required non-empty text when kind is decision; omit for every other kind.'),\n rationale: Text.optional().describe('Required non-empty text when kind is decision; omit for every other kind.'),\n blocker: Text.optional(),\n resolution: Text.optional(),\n acceptance: z\n .array(\n z.strictObject(\n { criterion: Text, evidence: Evidence },\n { error: 'Invalid acceptance entry. Provide only criterion and evidence.' },\n ),\n )\n .min(1)\n .optional(),\n followUps: z.array(Text).optional(),\n })\n .superRefine((input, ctx) => {\n const parsed = JournalVariants.safeParse(input);\n if (!parsed.success)\n for (const issue of parsed.error.issues)\n ctx.addIssue({ code: 'custom', path: issue.path, message: issue.message });\n });\n\nexport function renderJournal(raw: JournalInput, marker?: string): string {\n const input = JournalVariants.parse(raw);\n const plainPreview = (value: string): string => {\n const plain = value\n .replace(/!?\\[([^\\]]+)\\]\\([^)]*\\)/gu, '$1')\n .replace(/^\\s{0,3}(?:#{1,6}\\s+|>\\s?|[-+*]\\s+|\\d+[.)]\\s+)/gmu, '')\n .replace(/[*_~`<>[\\]\\\\]/gu, '')\n .replace(/\\s+/gu, ' ')\n .trim();\n const preview = plain.slice(0, 32);\n const last = preview.charCodeAt(preview.length - 1);\n return last >= 0xd800 && last <= 0xdbff ? preview.slice(0, -1) : preview;\n };\n const field = (label: string, value: string): string =>\n `**${label}:**${/\\n|^(?:[-*+]\\s|\\d+[.)]\\s)/u.test(value) ? '\\n' : ' '}${value}`;\n const list = (values: string[]): string => values.map((value) => '- ' + value.replace(/\\n/gu, '\\n ')).join('\\n');\n const sections = [`**Kind:** ${input.kind}. **Status:** ${input.status}`];\n switch (input.kind) {\n case 'start':\n sections.push(field('Outcome', input.outcome));\n break;\n case 'progress':\n sections.push(`**Done since last:**\\n${list(input.done)}`, field('Decision needed', input.decisionNeeded));\n break;\n case 'decision':\n sections.push(field('Decision', input.decision), field('Rationale', input.rationale));\n break;\n case 'blocker':\n sections.push(field('Blocker', input.blocker), field('Resolution needed', input.resolution));\n break;\n case 'closeout':\n sections.push(\n `**Acceptance evidence:**\\n${input.acceptance.map((item) => `- ${item.criterion} \u2014 ${item.evidence}`).join('\\n')}`,\n `**Follow-ups:** ${input.followUps.length ? input.followUps.join('; ') : 'None.'}`,\n );\n break;\n }\n sections.push(\n `**Key numbers:** ${input.keyNumbers.length ? input.keyNumbers.join('; ') : 'None reported.'}`,\n `**Next:** ${input.nextStep} (${input.nextDate ?? 'date not scheduled'}).`,\n `**Evidence:** ${input.evidence.length ? input.evidence.join(' \u00B7 ') : 'None yet.'}`,\n );\n if (input.details) sections.push(input.details);\n let body = `Status: ${plainPreview(input.status)}. Next: ${plainPreview(input.nextStep)}.\\n\\n${input.summary}`;\n let overflow = '';\n for (const section of sections) {\n if (overflow || body.length + section.length + 2 > (input.lengthCap ?? 1800)) overflow += `\\n\\n${section}`;\n else body += `\\n\\n${section}`;\n }\n if (overflow) body += `\\n\\n<details>\\n<summary>Additional journal detail</summary>${overflow}\\n\\n</details>`;\n return marker === undefined ? body : `${body}\\n\\n${marker}`;\n}\n\nexport type JournalAttention = {\n kind: JournalInput['kind'] | null;\n state: 'pending' | 'clear' | 'unknown';\n request: string | null;\n reason: string | null;\n};\n\n/** Read only unambiguous structure emitted by renderJournal; free text is not a second template. */\nexport function parseJournalAttention(body: string): JournalAttention {\n const unknown = (): JournalAttention => ({\n kind: null,\n state: 'unknown',\n request: null,\n reason: 'Journal structure is incomplete or ambiguous.',\n });\n // Match the same UTF-16 unit bounds used by plainPreview.\n const preview = /^Status: ([^\\r\\n]{0,32})\\. Next: ([^\\r\\n]{0,32})\\.\\n\\n(?!\\*\\*Kind:\\*\\*)/.exec(body);\n if (preview && preview.slice(1).every((value) => value.length <= 32 && !/[*_~`<>[\\]\\\\]|[^\\S ]/u.test(value)))\n body = body.slice(preview[0].length);\n const markers = body.match(/<!--\\s*ai-delivery:journal@/gu) ?? [];\n if (markers.length) {\n const suffix = /\\n\\n<!-- ai-delivery:journal@1:sha256:[a-f0-9]{64} -->$/u.exec(body);\n if (markers.length !== 1 || !suffix) return unknown();\n body = body.slice(0, suffix.index);\n }\n if (/<\\/?details>|<\\/?summary>/u.test(body)) {\n const opening = '\\n\\n<details>\\n<summary>Additional journal detail</summary>';\n if (\n body.split('<details>').length !== 2 ||\n body.split('</details>').length !== 2 ||\n body.split('<summary>').length !== 2 ||\n body.split('</summary>').length !== 2 ||\n !body.includes(opening) ||\n !body.endsWith('\\n\\n</details>')\n )\n return unknown();\n body = body.replace(opening, '').slice(0, -'\\n\\n</details>'.length);\n }\n const kind = /\\*\\*Kind:\\*\\* (start|progress|decision|blocker|closeout)\\. \\*\\*Status:\\*\\*/u.exec(body)?.[1] as\n | JournalInput['kind']\n | undefined;\n if (!kind) return unknown();\n const fields: Record<JournalInput['kind'], string[]> = {\n start: ['Outcome'],\n progress: ['Done since last', 'Decision needed'],\n decision: ['Decision', 'Rationale'],\n blocker: ['Blocker', 'Resolution needed'],\n closeout: ['Acceptance evidence', 'Follow-ups'],\n };\n const expected = ['Kind', 'Status', ...fields[kind], 'Key numbers', 'Next', 'Evidence'];\n const matches = [\n ...body.matchAll(\n /\\*\\*(Kind|Status|Outcome|Done since last|Decision needed|Decision|Rationale|Blocker|Resolution needed|Acceptance evidence|Follow-ups|Key numbers|Next|Evidence):\\*\\*/gu,\n ),\n ];\n if (matches.length !== expected.length || matches.some((match, i) => match[1] !== expected[i])) return unknown();\n const first = matches[0]!.index;\n if (!/^[^\\r\\n]+\\n\\n$/u.test(body.slice(0, first))) return unknown();\n let request: string | null = null;\n for (const [i, match] of matches.entries()) {\n if (i !== 1 && body.slice(match.index - 2, match.index) !== '\\n\\n') return unknown();\n let fence: string | null = null;\n for (const line of body.slice(0, match.index).split('\\n')) {\n const edge = /^ {0,3}(`{3,}|~{3,})(.*)$/u.exec(line);\n if (!edge) continue;\n if (fence === null) fence = edge[1]!;\n else if (edge[1]![0] === fence[0] && edge[1]!.length >= fence.length && !edge[2]!.trim()) fence = null;\n }\n if (fence !== null) return unknown();\n const end = matches[i + 1]?.index ?? body.length;\n const value = body.slice(match.index + match[0].length, end).trim();\n if (!value) return unknown();\n if (match[1] === 'Decision needed') request = value;\n }\n if (kind !== 'progress') return { kind, state: 'clear', request: null, reason: null };\n if (request === null) return unknown();\n return /^(?:none\\.?|n\\/a|not needed)$/iu.test(request)\n ? { kind, state: 'clear', request: null, reason: null }\n : { kind, state: 'pending', request, reason: null };\n}\n\nexport function acceptanceCriteria(body: string): string[] {\n return journalSection(body, ['acceptance criteria'])\n .map(\n (line) =>\n line\n .trimStart()\n .match(/^[-*+]\\s*\\[[ xX]\\][ \\t](.*)$/u)?.[1]\n ?.trim() ?? '',\n )\n .filter(Boolean);\n}\n\nexport function issueFollowUps(body: string): string[] {\n return journalSection(body, ['follow-ups', 'follow ups'])\n .map(\n (line) =>\n line\n .trimStart()\n .match(/^[-*+]\\s*(?:\\[[ xX]\\][ \\t])?(.*)$/u)?.[1]\n ?.trim() ?? '',\n )\n .filter(Boolean);\n}\n\n// Match readiness's ATX heading boundaries without changing its separate contract owner.\nfunction journalSection(body: string, headings: string[]): string[] {\n const heading = (line: string) =>\n line\n .match(/^ {0,3}#{1,6}[ \\t](.*)$/u)?.[1]\n ?.trim()\n .toLowerCase();\n const lines = body.split(/\\r?\\n/u);\n const start = lines.findIndex((line) => headings.includes(heading(line) ?? ''));\n if (start === -1) return [];\n const section: string[] = [];\n for (const line of lines.slice(start + 1)) {\n if (heading(line) !== undefined) break;\n section.push(line);\n }\n return section;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AACrB,SAAS,SAAS;AAElB,MAAM,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAK;AAC/C,MAAM,UAAU,KAAK,IAAI,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,KAAK,KAAK,GAAG,0CAA0C;AAClH,MAAM,OAAO,EAAE,IAAI,KAAK;AACxB,MAAM,cAAc,EAAE,IAAI,EAAE,UAAU,WAAW,CAAC,EAAE,OAAO,CAAC,UAAU;AACpE,MAAI;AACJ,MAAI;AACF,UAAM,IAAI,IAAI,KAAK;AAAA,EACrB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,QAAM,WAAW,IAAI,SAAS,QAAQ,aAAa,EAAE,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