@agent-plan/core 0.2.28 → 0.3.0
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/dist/accepted-decision-guard.d.ts +94 -0
- package/dist/accepted-decision-guard.d.ts.map +1 -0
- package/dist/accepted-decision-guard.js +110 -0
- package/dist/checklist.d.ts +28 -0
- package/dist/checklist.d.ts.map +1 -1
- package/dist/checklist.js +59 -0
- package/dist/feature-delete.d.ts +62 -0
- package/dist/feature-delete.d.ts.map +1 -0
- package/dist/feature-delete.js +49 -0
- package/dist/guard-decision.d.ts +118 -0
- package/dist/guard-decision.d.ts.map +1 -0
- package/dist/guard-decision.js +203 -0
- package/dist/handoff-context.d.ts +130 -1
- package/dist/handoff-context.d.ts.map +1 -1
- package/dist/handoff-context.js +167 -9
- package/dist/handoff-reply.d.ts +108 -0
- package/dist/handoff-reply.d.ts.map +1 -0
- package/dist/handoff-reply.js +279 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/mutation-reply.d.ts +105 -0
- package/dist/mutation-reply.d.ts.map +1 -0
- package/dist/mutation-reply.js +203 -0
- package/dist/naming.d.ts +1 -1
- package/dist/naming.d.ts.map +1 -1
- package/dist/naming.js +1 -1
- package/dist/pagination.d.ts +19 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +15 -0
- package/dist/payload-fallback.js +1 -1
- package/dist/plan-store.d.ts +141 -8
- package/dist/plan-store.d.ts.map +1 -1
- package/dist/plan-store.js +459 -87
- package/dist/project-context-migration.d.ts +5 -0
- package/dist/project-context-migration.d.ts.map +1 -1
- package/dist/project-context-migration.js +13 -0
- package/dist/project-context.d.ts +395 -0
- package/dist/project-context.d.ts.map +1 -0
- package/dist/project-context.js +295 -0
- package/dist/recap.d.ts.map +1 -1
- package/dist/recap.js +27 -0
- package/dist/recommend-reply.d.ts +51 -0
- package/dist/recommend-reply.d.ts.map +1 -0
- package/dist/recommend-reply.js +84 -0
- package/dist/refs.d.ts +16 -0
- package/dist/refs.d.ts.map +1 -1
- package/dist/refs.js +38 -0
- package/dist/renderer.d.ts.map +1 -1
- package/dist/schema.d.ts +7 -2
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +8 -3
- package/dist/stranded-phase.d.ts +73 -0
- package/dist/stranded-phase.d.ts.map +1 -0
- package/dist/stranded-phase.js +93 -0
- package/dist/task-completion-gate.d.ts +84 -0
- package/dist/task-completion-gate.d.ts.map +1 -0
- package/dist/task-completion-gate.js +72 -0
- package/dist/task-context.d.ts +1 -0
- package/dist/task-context.d.ts.map +1 -1
- package/dist/task-context.js +31 -13
- package/dist/task-lifecycle.d.ts +12 -0
- package/dist/task-lifecycle.d.ts.map +1 -0
- package/dist/task-lifecycle.js +23 -0
- package/dist/task-order-context.d.ts +72 -0
- package/dist/task-order-context.d.ts.map +1 -0
- package/dist/task-order-context.js +82 -0
- package/dist/task-selection.d.ts.map +1 -1
- package/dist/task-selection.js +14 -12
- package/dist/task-start-outcome.d.ts +26 -0
- package/dist/task-start-outcome.d.ts.map +1 -1
- package/dist/task-start-outcome.js +23 -0
- package/dist/text-bounds.d.ts +32 -0
- package/dist/text-bounds.d.ts.map +1 -0
- package/dist/text-bounds.js +43 -0
- package/dist/write-coordination.d.ts +2 -2
- package/dist/write-coordination.js +2 -2
- package/package.json +1 -1
- package/planner-skill.md +30 -12
|
@@ -44,4 +44,9 @@ export interface PlannerSessionPreparationResult {
|
|
|
44
44
|
export declare function plannerSessionPreparationResult(result: LegacyProjectContextMigrationResult): PlannerSessionPreparationResult;
|
|
45
45
|
export declare function previewLegacyProjectContextMigration(project: Project): LegacyProjectContextMigrationPreview;
|
|
46
46
|
export declare function applyLegacyProjectContextMigration(project: Project, acceptedAt: string): LegacyProjectContextMigrationResult;
|
|
47
|
+
/** Render a legacy-context migration preview/result as plain text. Both
|
|
48
|
+
* adapters carried a byte-identical copy for the migrate-context preview
|
|
49
|
+
* and apply replies; kept here because the rendering has no adapter shape
|
|
50
|
+
* to speak of — it is the same text on every surface. */
|
|
51
|
+
export declare function legacyContextMigrationSummary(preview: LegacyProjectContextMigrationPreview): string;
|
|
47
52
|
//# sourceMappingURL=project-context-migration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-context-migration.d.ts","sourceRoot":"","sources":["../src/project-context-migration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AAE5E,eAAO,MAAM,wCAAwC,IAAI,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAC7B,cAAc,GACd,oBAAoB,GACpB,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAE1E,MAAM,WAAW,oCAAoC;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,wBAAwB,EAAE,OAAO,CAAC;IAClC,kBAAkB,EAAE,uBAAuB,EAAE,CAAC;IAC9C,yBAAyB,EAAE,sBAAsB,EAAE,CAAC;IACpD,0BAA0B,EAAE,MAAM,CAAC;IACnC,yBAAyB,EAAE,MAAM,CAAC;IAClC,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,oBAAoB,EAAE,KAAK,CAAC,aAAa,GAAG,eAAe,GAAG,WAAW,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,mCAAmC;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,oCAAoC,CAAC;IAC9C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE;QACpB,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,eAAe,EAAE,MAAM,CAAC;QACxB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa,GAAG,eAAe,GAAG,WAAW,CAAC,CAAC;QACpE,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,mCAAmC,GAC1C,+BAA+B,CAoBjC;AA0DD,wBAAgB,oCAAoC,CAAC,OAAO,EAAE,OAAO,GAAG,oCAAoC,CAiE3G;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,GACjB,mCAAmC,CA0BrC"}
|
|
1
|
+
{"version":3,"file":"project-context-migration.d.ts","sourceRoot":"","sources":["../src/project-context-migration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AAE5E,eAAO,MAAM,wCAAwC,IAAI,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAC7B,cAAc,GACd,oBAAoB,GACpB,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAE1E,MAAM,WAAW,oCAAoC;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC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A6B,CAAC,OAAO,EAAE,oCAAoC,GAAG,MAAM,CAQnG"}
|
|
@@ -166,3 +166,16 @@ export function applyLegacyProjectContextMigration(project, acceptedAt) {
|
|
|
166
166
|
},
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
+
/** Render a legacy-context migration preview/result as plain text. Both
|
|
170
|
+
* adapters carried a byte-identical copy for the migrate-context preview
|
|
171
|
+
* and apply replies; kept here because the rendering has no adapter shape
|
|
172
|
+
* to speak of — it is the same text on every surface. */
|
|
173
|
+
export function legacyContextMigrationSummary(preview) {
|
|
174
|
+
return [
|
|
175
|
+
`Legacy context present: ${preview.hasLegacyContext ? "yes" : "no"}`,
|
|
176
|
+
`Guideline additions: ${preview.guidelineAdditions.length} (${preview.skippedGuidelineDuplicates} duplicate(s) skipped)`,
|
|
177
|
+
`Accepted decision additions: ${preview.acceptedDecisionAdditions.length} (${preview.skippedDecisionDuplicates} duplicate(s) skipped)`,
|
|
178
|
+
`Legacy counts: globalRules=${preview.legacyCounts.globalRules}, workflowRules=${preview.legacyCounts.workflowRules}, decisions=${preview.legacyCounts.decisions}`,
|
|
179
|
+
`Fields cleared on apply: ${preview.fieldsClearedOnApply.join(", ") || "none"}`,
|
|
180
|
+
].join("\n");
|
|
181
|
+
}
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type Project, type RequirementsDocument } from "./schema.js";
|
|
3
|
+
export declare const PROJECT_CONTEXT_DELIVERY_VERSION = 1;
|
|
4
|
+
export declare const DEFAULT_PROJECT_CONTEXT_CHUNK_CHARS = 16000;
|
|
5
|
+
export declare const ProjectContextReadAttestationSchema: z.ZodObject<{
|
|
6
|
+
sessionId: z.ZodString;
|
|
7
|
+
createdAt: z.ZodString;
|
|
8
|
+
fingerprint: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
createdAt: string;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
fingerprint: string;
|
|
13
|
+
}, {
|
|
14
|
+
createdAt: string;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
fingerprint: string;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const ProjectContextReadStateDocumentSchema: z.ZodObject<{
|
|
19
|
+
version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
20
|
+
sessionInfo: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
21
|
+
sessionId: z.ZodString;
|
|
22
|
+
createdAt: z.ZodString;
|
|
23
|
+
fingerprint: z.ZodString;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
createdAt: string;
|
|
26
|
+
sessionId: string;
|
|
27
|
+
fingerprint: string;
|
|
28
|
+
}, {
|
|
29
|
+
createdAt: string;
|
|
30
|
+
sessionId: string;
|
|
31
|
+
fingerprint: string;
|
|
32
|
+
}>, "many">>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
sessionInfo: {
|
|
35
|
+
createdAt: string;
|
|
36
|
+
sessionId: string;
|
|
37
|
+
fingerprint: string;
|
|
38
|
+
}[];
|
|
39
|
+
version: 1;
|
|
40
|
+
}, {
|
|
41
|
+
sessionInfo?: {
|
|
42
|
+
createdAt: string;
|
|
43
|
+
sessionId: string;
|
|
44
|
+
fingerprint: string;
|
|
45
|
+
}[] | undefined;
|
|
46
|
+
version?: 1 | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export type ProjectContextReadAttestation = z.infer<typeof ProjectContextReadAttestationSchema>;
|
|
49
|
+
export type ProjectContextReadStateDocument = z.infer<typeof ProjectContextReadStateDocumentSchema>;
|
|
50
|
+
export declare const ProjectContextSnapshotSchema: z.ZodObject<{
|
|
51
|
+
version: z.ZodLiteral<1>;
|
|
52
|
+
project: z.ZodObject<{
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
goal: z.ZodString;
|
|
55
|
+
description: z.ZodString;
|
|
56
|
+
descriptionRef: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
57
|
+
scope: z.ZodArray<z.ZodString, "many">;
|
|
58
|
+
outOfScope: z.ZodArray<z.ZodString, "many">;
|
|
59
|
+
technologies: z.ZodArray<z.ZodString, "many">;
|
|
60
|
+
tools: z.ZodArray<z.ZodString, "many">;
|
|
61
|
+
contentLanguage: z.ZodString;
|
|
62
|
+
chatLanguage: z.ZodString;
|
|
63
|
+
projectGuidelines: z.ZodObject<{
|
|
64
|
+
content: z.ZodString;
|
|
65
|
+
updatedAt: z.ZodString;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
content: string;
|
|
69
|
+
}, {
|
|
70
|
+
updatedAt: string;
|
|
71
|
+
content: string;
|
|
72
|
+
}>;
|
|
73
|
+
acceptedDecisions: z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
title: z.ZodString;
|
|
76
|
+
decision: z.ZodDefault<z.ZodString>;
|
|
77
|
+
rationale: z.ZodDefault<z.ZodString>;
|
|
78
|
+
implementationNotes: z.ZodDefault<z.ZodString>;
|
|
79
|
+
acceptedAt: z.ZodString;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
id: string;
|
|
82
|
+
title: string;
|
|
83
|
+
decision: string;
|
|
84
|
+
rationale: string;
|
|
85
|
+
implementationNotes: string;
|
|
86
|
+
acceptedAt: string;
|
|
87
|
+
}, {
|
|
88
|
+
id: string;
|
|
89
|
+
title: string;
|
|
90
|
+
acceptedAt: string;
|
|
91
|
+
decision?: string | undefined;
|
|
92
|
+
rationale?: string | undefined;
|
|
93
|
+
implementationNotes?: string | undefined;
|
|
94
|
+
}>, "many">;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
name: string;
|
|
97
|
+
goal: string;
|
|
98
|
+
description: string;
|
|
99
|
+
projectGuidelines: {
|
|
100
|
+
updatedAt: string;
|
|
101
|
+
content: string;
|
|
102
|
+
};
|
|
103
|
+
scope: string[];
|
|
104
|
+
outOfScope: string[];
|
|
105
|
+
technologies: string[];
|
|
106
|
+
tools: string[];
|
|
107
|
+
contentLanguage: string;
|
|
108
|
+
chatLanguage: string;
|
|
109
|
+
acceptedDecisions: {
|
|
110
|
+
id: string;
|
|
111
|
+
title: string;
|
|
112
|
+
decision: string;
|
|
113
|
+
rationale: string;
|
|
114
|
+
implementationNotes: string;
|
|
115
|
+
acceptedAt: string;
|
|
116
|
+
}[];
|
|
117
|
+
descriptionRef?: string | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
name: string;
|
|
120
|
+
goal: string;
|
|
121
|
+
description: string;
|
|
122
|
+
projectGuidelines: {
|
|
123
|
+
updatedAt: string;
|
|
124
|
+
content: string;
|
|
125
|
+
};
|
|
126
|
+
scope: string[];
|
|
127
|
+
outOfScope: string[];
|
|
128
|
+
technologies: string[];
|
|
129
|
+
tools: string[];
|
|
130
|
+
contentLanguage: string;
|
|
131
|
+
chatLanguage: string;
|
|
132
|
+
acceptedDecisions: {
|
|
133
|
+
id: string;
|
|
134
|
+
title: string;
|
|
135
|
+
acceptedAt: string;
|
|
136
|
+
decision?: string | undefined;
|
|
137
|
+
rationale?: string | undefined;
|
|
138
|
+
implementationNotes?: string | undefined;
|
|
139
|
+
}[];
|
|
140
|
+
descriptionRef?: string | undefined;
|
|
141
|
+
}>;
|
|
142
|
+
requirements: z.ZodArray<z.ZodObject<{
|
|
143
|
+
id: z.ZodString;
|
|
144
|
+
title: z.ZodString;
|
|
145
|
+
description: z.ZodDefault<z.ZodString>;
|
|
146
|
+
macroTasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
title: z.ZodString;
|
|
149
|
+
description: z.ZodDefault<z.ZodString>;
|
|
150
|
+
status: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
|
|
151
|
+
createdAt: z.ZodString;
|
|
152
|
+
updatedAt: z.ZodString;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
|
|
155
|
+
updatedAt: string;
|
|
156
|
+
id: string;
|
|
157
|
+
createdAt: string;
|
|
158
|
+
title: string;
|
|
159
|
+
description: string;
|
|
160
|
+
}, {
|
|
161
|
+
status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
|
|
162
|
+
updatedAt: string;
|
|
163
|
+
id: string;
|
|
164
|
+
createdAt: string;
|
|
165
|
+
title: string;
|
|
166
|
+
description?: string | undefined;
|
|
167
|
+
}>, "many">>;
|
|
168
|
+
linkedPhaseIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
169
|
+
createdAt: z.ZodString;
|
|
170
|
+
updatedAt: z.ZodString;
|
|
171
|
+
}, "strip", z.ZodTypeAny, {
|
|
172
|
+
updatedAt: string;
|
|
173
|
+
id: string;
|
|
174
|
+
createdAt: string;
|
|
175
|
+
title: string;
|
|
176
|
+
description: string;
|
|
177
|
+
macroTasks: {
|
|
178
|
+
status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
|
|
179
|
+
updatedAt: string;
|
|
180
|
+
id: string;
|
|
181
|
+
createdAt: string;
|
|
182
|
+
title: string;
|
|
183
|
+
description: string;
|
|
184
|
+
}[];
|
|
185
|
+
linkedPhaseIds: string[];
|
|
186
|
+
}, {
|
|
187
|
+
updatedAt: string;
|
|
188
|
+
id: string;
|
|
189
|
+
createdAt: string;
|
|
190
|
+
title: string;
|
|
191
|
+
description?: string | undefined;
|
|
192
|
+
macroTasks?: {
|
|
193
|
+
status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
|
|
194
|
+
updatedAt: string;
|
|
195
|
+
id: string;
|
|
196
|
+
createdAt: string;
|
|
197
|
+
title: string;
|
|
198
|
+
description?: string | undefined;
|
|
199
|
+
}[] | undefined;
|
|
200
|
+
linkedPhaseIds?: string[] | undefined;
|
|
201
|
+
}>, "many">;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
project: {
|
|
204
|
+
name: string;
|
|
205
|
+
goal: string;
|
|
206
|
+
description: string;
|
|
207
|
+
projectGuidelines: {
|
|
208
|
+
updatedAt: string;
|
|
209
|
+
content: string;
|
|
210
|
+
};
|
|
211
|
+
scope: string[];
|
|
212
|
+
outOfScope: string[];
|
|
213
|
+
technologies: string[];
|
|
214
|
+
tools: string[];
|
|
215
|
+
contentLanguage: string;
|
|
216
|
+
chatLanguage: string;
|
|
217
|
+
acceptedDecisions: {
|
|
218
|
+
id: string;
|
|
219
|
+
title: string;
|
|
220
|
+
decision: string;
|
|
221
|
+
rationale: string;
|
|
222
|
+
implementationNotes: string;
|
|
223
|
+
acceptedAt: string;
|
|
224
|
+
}[];
|
|
225
|
+
descriptionRef?: string | undefined;
|
|
226
|
+
};
|
|
227
|
+
version: 1;
|
|
228
|
+
requirements: {
|
|
229
|
+
updatedAt: string;
|
|
230
|
+
id: string;
|
|
231
|
+
createdAt: string;
|
|
232
|
+
title: string;
|
|
233
|
+
description: string;
|
|
234
|
+
macroTasks: {
|
|
235
|
+
status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
|
|
236
|
+
updatedAt: string;
|
|
237
|
+
id: string;
|
|
238
|
+
createdAt: string;
|
|
239
|
+
title: string;
|
|
240
|
+
description: string;
|
|
241
|
+
}[];
|
|
242
|
+
linkedPhaseIds: string[];
|
|
243
|
+
}[];
|
|
244
|
+
}, {
|
|
245
|
+
project: {
|
|
246
|
+
name: string;
|
|
247
|
+
goal: string;
|
|
248
|
+
description: string;
|
|
249
|
+
projectGuidelines: {
|
|
250
|
+
updatedAt: string;
|
|
251
|
+
content: string;
|
|
252
|
+
};
|
|
253
|
+
scope: string[];
|
|
254
|
+
outOfScope: string[];
|
|
255
|
+
technologies: string[];
|
|
256
|
+
tools: string[];
|
|
257
|
+
contentLanguage: string;
|
|
258
|
+
chatLanguage: string;
|
|
259
|
+
acceptedDecisions: {
|
|
260
|
+
id: string;
|
|
261
|
+
title: string;
|
|
262
|
+
acceptedAt: string;
|
|
263
|
+
decision?: string | undefined;
|
|
264
|
+
rationale?: string | undefined;
|
|
265
|
+
implementationNotes?: string | undefined;
|
|
266
|
+
}[];
|
|
267
|
+
descriptionRef?: string | undefined;
|
|
268
|
+
};
|
|
269
|
+
version: 1;
|
|
270
|
+
requirements: {
|
|
271
|
+
updatedAt: string;
|
|
272
|
+
id: string;
|
|
273
|
+
createdAt: string;
|
|
274
|
+
title: string;
|
|
275
|
+
description?: string | undefined;
|
|
276
|
+
macroTasks?: {
|
|
277
|
+
status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
|
|
278
|
+
updatedAt: string;
|
|
279
|
+
id: string;
|
|
280
|
+
createdAt: string;
|
|
281
|
+
title: string;
|
|
282
|
+
description?: string | undefined;
|
|
283
|
+
}[] | undefined;
|
|
284
|
+
linkedPhaseIds?: string[] | undefined;
|
|
285
|
+
}[];
|
|
286
|
+
}>;
|
|
287
|
+
export type ProjectContextSnapshot = z.infer<typeof ProjectContextSnapshotSchema>;
|
|
288
|
+
export declare const ProjectContextChunkSchema: z.ZodObject<{
|
|
289
|
+
version: z.ZodLiteral<1>;
|
|
290
|
+
fingerprint: z.ZodString;
|
|
291
|
+
status: z.ZodLiteral<"partial">;
|
|
292
|
+
complete: z.ZodLiteral<false>;
|
|
293
|
+
truncated: z.ZodBoolean;
|
|
294
|
+
deliveredChunks: z.ZodLiteral<1>;
|
|
295
|
+
index: z.ZodNumber;
|
|
296
|
+
totalChunks: z.ZodNumber;
|
|
297
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
298
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
299
|
+
content: z.ZodString;
|
|
300
|
+
}, "strip", z.ZodTypeAny, {
|
|
301
|
+
status: "partial";
|
|
302
|
+
content: string;
|
|
303
|
+
version: 1;
|
|
304
|
+
fingerprint: string;
|
|
305
|
+
complete: false;
|
|
306
|
+
truncated: boolean;
|
|
307
|
+
deliveredChunks: 1;
|
|
308
|
+
index: number;
|
|
309
|
+
totalChunks: number;
|
|
310
|
+
cursor?: string | undefined;
|
|
311
|
+
nextCursor?: string | undefined;
|
|
312
|
+
}, {
|
|
313
|
+
status: "partial";
|
|
314
|
+
content: string;
|
|
315
|
+
version: 1;
|
|
316
|
+
fingerprint: string;
|
|
317
|
+
complete: false;
|
|
318
|
+
truncated: boolean;
|
|
319
|
+
deliveredChunks: 1;
|
|
320
|
+
index: number;
|
|
321
|
+
totalChunks: number;
|
|
322
|
+
cursor?: string | undefined;
|
|
323
|
+
nextCursor?: string | undefined;
|
|
324
|
+
}>;
|
|
325
|
+
export type ProjectContextChunk = z.infer<typeof ProjectContextChunkSchema>;
|
|
326
|
+
export interface ProjectContextDeliveryEvidence {
|
|
327
|
+
version: typeof PROJECT_CONTEXT_DELIVERY_VERSION;
|
|
328
|
+
fingerprint: string;
|
|
329
|
+
status: "complete";
|
|
330
|
+
complete: true;
|
|
331
|
+
truncated: false;
|
|
332
|
+
chunked: boolean;
|
|
333
|
+
deliveredChunks: number;
|
|
334
|
+
totalChunks: number;
|
|
335
|
+
serializedChars: number;
|
|
336
|
+
}
|
|
337
|
+
export interface CompleteProjectContextDelivery {
|
|
338
|
+
snapshot: ProjectContextSnapshot;
|
|
339
|
+
chunks: ProjectContextChunk[];
|
|
340
|
+
evidence: ProjectContextDeliveryEvidence;
|
|
341
|
+
}
|
|
342
|
+
export type ProjectContextReadState = "missing" | "stale" | "valid";
|
|
343
|
+
export type ProjectContextDeliveryErrorCode = "PROJECT_CONTEXT_DELIVERY_INCOMPLETE" | "PROJECT_CONTEXT_DELIVERY_INVALID" | "PROJECT_CONTEXT_DELIVERY_STALE";
|
|
344
|
+
export declare class ProjectContextDeliveryError extends Error {
|
|
345
|
+
readonly code: ProjectContextDeliveryErrorCode;
|
|
346
|
+
constructor(code: ProjectContextDeliveryErrorCode, message: string);
|
|
347
|
+
}
|
|
348
|
+
/** Build the content-only project snapshot used by every harness. */
|
|
349
|
+
export declare function createProjectContextSnapshot(project: Project, requirements: RequirementsDocument): ProjectContextSnapshot;
|
|
350
|
+
export declare function serializeProjectContext(snapshot: ProjectContextSnapshot): string;
|
|
351
|
+
export declare function projectContextFingerprint(snapshot: ProjectContextSnapshot): string;
|
|
352
|
+
/**
|
|
353
|
+
* Split canonical JSON without dropping data. Individual chunks never assert
|
|
354
|
+
* completeness; only verifyProjectContextChunks can produce complete evidence.
|
|
355
|
+
*/
|
|
356
|
+
export declare function createProjectContextChunks(snapshot: ProjectContextSnapshot, maxChars?: number): ProjectContextChunk[];
|
|
357
|
+
/** Verify an exact, ordered, complete chunk sequence and reconstruct its DTO. */
|
|
358
|
+
export declare function verifyProjectContextChunks(chunks: ProjectContextChunk[]): CompleteProjectContextDelivery;
|
|
359
|
+
export declare function createCompleteProjectContextDelivery(project: Project, requirements: RequirementsDocument, maxChars?: number): CompleteProjectContextDelivery;
|
|
360
|
+
export declare function projectContextReadState(snapshot: ProjectContextSnapshot, attestations: ProjectContextReadAttestation[] | undefined, sessionId: string): ProjectContextReadState;
|
|
361
|
+
/**
|
|
362
|
+
* Non-blocking task-start advisory for when project-level context (delivered
|
|
363
|
+
* through explicit planner load) has drifted since this session's last
|
|
364
|
+
* attested read. Task-start's own gates stay scoped to feature/phase/task
|
|
365
|
+
* context (P102(F005)/T404 keeps that delivery separate and un-duplicated);
|
|
366
|
+
* this only signals that a targeted planner-load refresh is due, without
|
|
367
|
+
* blocking the task from starting.
|
|
368
|
+
*/
|
|
369
|
+
export declare function projectContextStaleAdvisory(state: ProjectContextReadState): string;
|
|
370
|
+
/** Render the complete snapshot without applying a transport truncation policy. */
|
|
371
|
+
export declare function renderProjectContext(snapshot: ProjectContextSnapshot): string;
|
|
372
|
+
/**
|
|
373
|
+
* Reply shaping for explicit planner load's project-context delivery.
|
|
374
|
+
*
|
|
375
|
+
* Every adapter (Pi, MCP, and any future harness) must deliver the same
|
|
376
|
+
* complete project-level context, so the reply is shaped once here instead
|
|
377
|
+
* of once per adapter — the same placement rule as handoff-reply.ts (AGENTS.md
|
|
378
|
+
* rule 4). Both channels carry the full snapshot on a complete delivery:
|
|
379
|
+
* some hosts surface only `text` to the agent, others only structuredContent
|
|
380
|
+
* ("structuredContent-only host compatibility"), so neither is optional.
|
|
381
|
+
*/
|
|
382
|
+
export interface ProjectContextReply {
|
|
383
|
+
text: string;
|
|
384
|
+
structured: Record<string, unknown>;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Build the reply for an explicit planner-load project-context delivery.
|
|
388
|
+
* `delivery` must come straight from `PlanStore.loadProjectContextDelivery`.
|
|
389
|
+
* This function only shapes the reply and never mutates; the caller is
|
|
390
|
+
* responsible for calling `PlanStore.recordProjectContextRead` with
|
|
391
|
+
* `delivery.chunks` immediately afterward, and only when, this returns
|
|
392
|
+
* `structured.contextComplete === true`.
|
|
393
|
+
*/
|
|
394
|
+
export declare function buildProjectContextLoadReply(delivery: CompleteProjectContextDelivery, maxChars: number): ProjectContextReply;
|
|
395
|
+
//# sourceMappingURL=project-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-context.d.ts","sourceRoot":"","sources":["../src/project-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAE1B,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,mCAAmC,QAAS,CAAC;AAE1D,eAAO,MAAM,mCAAmC;;;;;;;;;;;;EAI9C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGhD,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,C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