@maycombhq/sdk 2.0.0-beta.1 → 2.0.0-beta.11
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 → npm}/cache.d.ts +1 -1
- package/npm/core/api.d.ts +7964 -0
- package/npm/core/assistant-actor.d.ts +15 -0
- package/npm/core/audit.d.ts +153 -0
- package/npm/core/branches.d.ts +21 -0
- package/npm/core/cancel.d.ts +9 -0
- package/npm/core/catalog.d.ts +4735 -0
- package/npm/core/change-types-migrate.d.ts +10 -0
- package/npm/core/cite.d.ts +54 -0
- package/npm/core/contract-check.d.ts +251 -0
- package/npm/core/curated.d.ts +37 -0
- package/npm/core/fact-paths.d.ts +14 -0
- package/npm/core/facts-callers.d.ts +152 -0
- package/npm/core/facts-carry.d.ts +36 -0
- package/npm/core/facts-join-prototype.d.ts +239 -0
- package/npm/core/facts-join-vendor.d.ts +110 -0
- package/npm/core/facts-join.d.ts +482 -0
- package/npm/core/facts-terms.d.ts +108 -0
- package/npm/core/facts.d.ts +94 -0
- package/npm/core/fs.d.ts +47 -0
- package/npm/core/gates-migrate.d.ts +10 -0
- package/npm/core/host-questions.d.ts +111 -0
- package/npm/core/identity.d.ts +17 -0
- package/npm/core/index.d.ts +77 -0
- package/npm/core/json-schema.d.ts +20 -0
- package/npm/core/judgments.d.ts +63 -0
- package/npm/core/light.d.ts +8 -0
- package/npm/core/link-evidence.d.ts +212 -0
- package/npm/core/log.d.ts +49 -0
- package/npm/core/manifest-edit.d.ts +57 -0
- package/npm/core/merge.d.ts +85 -0
- package/npm/core/metarepo.d.ts +91 -0
- package/npm/core/migrate.d.ts +32 -0
- package/npm/core/migration-files.d.ts +13 -0
- package/npm/core/org-notes.d.ts +180 -0
- package/npm/core/orgpack-defaults.d.ts +199 -0
- package/npm/core/orgpack-load.d.ts +102 -0
- package/npm/core/profile-migrate.d.ts +11 -0
- package/npm/core/question-order.d.ts +23 -0
- package/npm/core/question-owners.d.ts +53 -0
- package/npm/core/question-proposals.d.ts +77 -0
- package/npm/core/questions.d.ts +312 -0
- package/npm/core/record-cache.d.ts +52 -0
- package/npm/core/refs.d.ts +9 -0
- package/npm/core/repo-description.d.ts +44 -0
- package/npm/core/repo-reads.d.ts +44 -0
- package/npm/core/roles-migrate.d.ts +9 -0
- package/npm/core/runtime-migrate.d.ts +11 -0
- package/npm/core/schema/ai.d.ts +397 -0
- package/npm/core/schema/change.d.ts +244 -0
- package/npm/core/schema/common.d.ts +135 -0
- package/npm/core/schema/conventions.d.ts +80 -0
- package/npm/core/schema/dialect.d.ts +801 -0
- package/npm/core/schema/executors.d.ts +396 -0
- package/npm/core/schema/fact-corrections.d.ts +56 -0
- package/npm/core/schema/facts.d.ts +1773 -0
- package/npm/core/schema/frameworks.d.ts +371 -0
- package/npm/core/schema/judgment.d.ts +77 -0
- package/npm/core/schema/kinds.d.ts +5168 -0
- package/npm/core/schema/layout.d.ts +25 -0
- package/npm/core/schema/orgpack.d.ts +1193 -0
- package/npm/core/schema/plugin.d.ts +73 -0
- package/npm/core/schema/question.d.ts +230 -0
- package/npm/core/schema/repo-type.d.ts +127 -0
- package/npm/core/schema/review.d.ts +558 -0
- package/npm/core/schema/scan-settings.d.ts +34 -0
- package/npm/core/schema/scan-verify.d.ts +535 -0
- package/npm/core/schema/spec.d.ts +269 -0
- package/npm/core/schema/version.d.ts +10 -0
- package/npm/core/schema/workspace.d.ts +330 -0
- package/npm/core/serialize.d.ts +17 -0
- package/npm/core/shared-maps.d.ts +146 -0
- package/npm/core/sources-migrate.d.ts +15 -0
- package/npm/core/specs.d.ts +66 -0
- package/npm/core/stack-helpers.d.ts +32 -0
- package/npm/core/tar-read.d.ts +13 -0
- package/npm/core/template.d.ts +101 -0
- package/npm/core/words.d.ts +13 -0
- package/npm/core/zip-read.d.ts +37 -0
- package/npm/core/zip.d.ts +13 -0
- package/npm/index.js +10097 -0
- package/{dist → npm}/plugin.d.ts +1 -1
- package/{dist → npm}/runner.d.ts +1 -1
- package/package.json +10 -11
- package/dist/cache.js +0 -115
- package/dist/cache.js.map +0 -1
- package/dist/fs-repo.js +0 -120
- package/dist/fs-repo.js.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/parse-cache.js +0 -275
- package/dist/parse-cache.js.map +0 -1
- package/dist/plugin.js +0 -85
- package/dist/plugin.js.map +0 -1
- package/dist/runner.js +0 -209
- package/dist/runner.js.map +0 -1
- package/dist/sandbox.js +0 -443
- package/dist/sandbox.js.map +0 -1
- /package/{dist → npm}/fs-repo.d.ts +0 -0
- /package/{dist → npm}/index.d.ts +0 -0
- /package/{dist → npm}/parse-cache.d.ts +0 -0
- /package/{dist → npm}/sandbox.d.ts +0 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Contract C5: the AI runtime's files. Agent definitions live in org-pack/agents/<id>.yaml;
|
|
4
|
+
* context-pack manifests and run summaries are written per run. See ADR 0014.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AI_SCHEMA_VERSION: 1;
|
|
7
|
+
export declare const RuntimeKind: z.ZodEnum<{
|
|
8
|
+
model: "model";
|
|
9
|
+
"hand-off": "hand-off";
|
|
10
|
+
"headless-claude-code": "headless-claude-code";
|
|
11
|
+
mock: "mock";
|
|
12
|
+
replay: "replay";
|
|
13
|
+
}>;
|
|
14
|
+
export type RuntimeKind = z.infer<typeof RuntimeKind>;
|
|
15
|
+
/** What an agent may be given as input. */
|
|
16
|
+
export declare const AgentInput: z.ZodUnion<readonly [z.ZodEnum<{
|
|
17
|
+
interfaces: "interfaces";
|
|
18
|
+
data: "data";
|
|
19
|
+
ux: "ux";
|
|
20
|
+
brief: "brief";
|
|
21
|
+
proposal: "proposal";
|
|
22
|
+
specs: "specs";
|
|
23
|
+
mappings: "mappings";
|
|
24
|
+
design: "design";
|
|
25
|
+
stories: "stories";
|
|
26
|
+
tasks: "tasks";
|
|
27
|
+
snow: "snow";
|
|
28
|
+
}>, z.ZodEnum<{
|
|
29
|
+
patterns: "patterns";
|
|
30
|
+
checklist: "checklist";
|
|
31
|
+
skills: "skills";
|
|
32
|
+
"catalog-slice": "catalog-slice";
|
|
33
|
+
glossary: "glossary";
|
|
34
|
+
"repo-code": "repo-code";
|
|
35
|
+
documents: "documents";
|
|
36
|
+
}>]>;
|
|
37
|
+
export declare const AgentDefinition: z.ZodObject<{
|
|
38
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
role: z.ZodUnion<readonly [z.ZodEnum<{
|
|
41
|
+
"product-owner": "product-owner";
|
|
42
|
+
"business-analyst": "business-analyst";
|
|
43
|
+
architect: "architect";
|
|
44
|
+
"team-lead": "team-lead";
|
|
45
|
+
developer: "developer";
|
|
46
|
+
qa: "qa";
|
|
47
|
+
"delivery-lead": "delivery-lead";
|
|
48
|
+
"platform-lead": "platform-lead";
|
|
49
|
+
designer: "designer";
|
|
50
|
+
"process-owner": "process-owner";
|
|
51
|
+
"data-architect": "data-architect";
|
|
52
|
+
sre: "sre";
|
|
53
|
+
"security-reviewer": "security-reviewer";
|
|
54
|
+
}>, z.ZodString]>;
|
|
55
|
+
description: z.ZodString;
|
|
56
|
+
inputs: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
57
|
+
interfaces: "interfaces";
|
|
58
|
+
data: "data";
|
|
59
|
+
ux: "ux";
|
|
60
|
+
brief: "brief";
|
|
61
|
+
proposal: "proposal";
|
|
62
|
+
specs: "specs";
|
|
63
|
+
mappings: "mappings";
|
|
64
|
+
design: "design";
|
|
65
|
+
stories: "stories";
|
|
66
|
+
tasks: "tasks";
|
|
67
|
+
snow: "snow";
|
|
68
|
+
}>, z.ZodEnum<{
|
|
69
|
+
patterns: "patterns";
|
|
70
|
+
checklist: "checklist";
|
|
71
|
+
skills: "skills";
|
|
72
|
+
"catalog-slice": "catalog-slice";
|
|
73
|
+
glossary: "glossary";
|
|
74
|
+
"repo-code": "repo-code";
|
|
75
|
+
documents: "documents";
|
|
76
|
+
}>]>>;
|
|
77
|
+
outputArtifact: z.ZodUnion<readonly [z.ZodEnum<{
|
|
78
|
+
interfaces: "interfaces";
|
|
79
|
+
data: "data";
|
|
80
|
+
ux: "ux";
|
|
81
|
+
brief: "brief";
|
|
82
|
+
proposal: "proposal";
|
|
83
|
+
specs: "specs";
|
|
84
|
+
mappings: "mappings";
|
|
85
|
+
design: "design";
|
|
86
|
+
stories: "stories";
|
|
87
|
+
tasks: "tasks";
|
|
88
|
+
snow: "snow";
|
|
89
|
+
}>, z.ZodLiteral<"findings">, z.ZodLiteral<"code">]>;
|
|
90
|
+
checklist: z.ZodOptional<z.ZodString>;
|
|
91
|
+
tokenBudget: z.ZodNumber;
|
|
92
|
+
allowedRuntimes: z.ZodArray<z.ZodEnum<{
|
|
93
|
+
model: "model";
|
|
94
|
+
"hand-off": "hand-off";
|
|
95
|
+
"headless-claude-code": "headless-claude-code";
|
|
96
|
+
mock: "mock";
|
|
97
|
+
replay: "replay";
|
|
98
|
+
}>>;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
export type AgentDefinition = z.infer<typeof AgentDefinition>;
|
|
101
|
+
/** One source in a context pack. Ingested text is wrapped as quoted data in the prompt. */
|
|
102
|
+
export declare const ContextSource: z.ZodObject<{
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
kind: z.ZodEnum<{
|
|
105
|
+
pattern: "pattern";
|
|
106
|
+
code: "code";
|
|
107
|
+
document: "document";
|
|
108
|
+
catalog: "catalog";
|
|
109
|
+
artifact: "artifact";
|
|
110
|
+
checklist: "checklist";
|
|
111
|
+
skill: "skill";
|
|
112
|
+
instruction: "instruction";
|
|
113
|
+
}>;
|
|
114
|
+
origin: z.ZodString;
|
|
115
|
+
bytes: z.ZodNumber;
|
|
116
|
+
tokens: z.ZodNumber;
|
|
117
|
+
classification: z.ZodString;
|
|
118
|
+
sha256: z.ZodString;
|
|
119
|
+
trusted: z.ZodBoolean;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
export declare const ContextPackManifest: z.ZodObject<{
|
|
122
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
123
|
+
change: z.ZodString;
|
|
124
|
+
agent: z.ZodString;
|
|
125
|
+
createdAt: z.ZodISODateTime;
|
|
126
|
+
budget: z.ZodNumber;
|
|
127
|
+
totalTokens: z.ZodNumber;
|
|
128
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
129
|
+
id: z.ZodString;
|
|
130
|
+
kind: z.ZodEnum<{
|
|
131
|
+
pattern: "pattern";
|
|
132
|
+
code: "code";
|
|
133
|
+
document: "document";
|
|
134
|
+
catalog: "catalog";
|
|
135
|
+
artifact: "artifact";
|
|
136
|
+
checklist: "checklist";
|
|
137
|
+
skill: "skill";
|
|
138
|
+
instruction: "instruction";
|
|
139
|
+
}>;
|
|
140
|
+
origin: z.ZodString;
|
|
141
|
+
bytes: z.ZodNumber;
|
|
142
|
+
tokens: z.ZodNumber;
|
|
143
|
+
classification: z.ZodString;
|
|
144
|
+
sha256: z.ZodString;
|
|
145
|
+
trusted: z.ZodBoolean;
|
|
146
|
+
}, z.core.$strict>>;
|
|
147
|
+
dropped: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
148
|
+
id: z.ZodString;
|
|
149
|
+
reason: z.ZodString;
|
|
150
|
+
}, z.core.$strict>>>;
|
|
151
|
+
promptSha256: z.ZodString;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
export type ContextPackManifest = z.infer<typeof ContextPackManifest>;
|
|
154
|
+
/** Hand-off steps: prepared → waiting → produced → validated, or failed (then Retry). */
|
|
155
|
+
export declare const RunState: z.ZodEnum<{
|
|
156
|
+
failed: "failed";
|
|
157
|
+
prepared: "prepared";
|
|
158
|
+
waiting: "waiting";
|
|
159
|
+
produced: "produced";
|
|
160
|
+
validated: "validated";
|
|
161
|
+
cancelled: "cancelled";
|
|
162
|
+
}>;
|
|
163
|
+
export type RunState = z.infer<typeof RunState>;
|
|
164
|
+
/**
|
|
165
|
+
* The run record's own version: 2 adds the tools a run's model called (ADR 0107 addendum); 3 how
|
|
166
|
+
* its context was retrieved (ADR 0116): the model's expansion of the input and its order of the
|
|
167
|
+
* candidates; 4 the step's class and the model that ran it (ADR 0121 addendum, per-step models).
|
|
168
|
+
* A version 1, 2 or 3 record is read through `migrateRunSummary`, without what came later.
|
|
169
|
+
*/
|
|
170
|
+
export declare const RUN_SCHEMA_VERSION: 4;
|
|
171
|
+
/**
|
|
172
|
+
* How a run's context was retrieved (ADR 0116), when a model helped: what it read the input as
|
|
173
|
+
* (search terms, the names it found, each mapped to an id the index has or said new, with the
|
|
174
|
+
* input's words it took each from, and what the checks dropped) and its order of the candidates
|
|
175
|
+
* (the ones it was shown, the ones it kept in its order, the ones it dropped). Each names the run
|
|
176
|
+
* that answered, or says it came from the store of earlier answers. Data, never instructions.
|
|
177
|
+
*/
|
|
178
|
+
export declare const RunRetrieval: z.ZodObject<{
|
|
179
|
+
expansion: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
run: z.ZodOptional<z.ZodString>;
|
|
181
|
+
cached: z.ZodBoolean;
|
|
182
|
+
terms: z.ZodArray<z.ZodString>;
|
|
183
|
+
names: z.ZodArray<z.ZodObject<{
|
|
184
|
+
name: z.ZodString;
|
|
185
|
+
id: z.ZodOptional<z.ZodString>;
|
|
186
|
+
new: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
quote: z.ZodString;
|
|
188
|
+
}, z.core.$strict>>;
|
|
189
|
+
dropped: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
190
|
+
name: z.ZodString;
|
|
191
|
+
why: z.ZodString;
|
|
192
|
+
}, z.core.$strict>>>;
|
|
193
|
+
}, z.core.$strict>>;
|
|
194
|
+
rerank: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
run: z.ZodOptional<z.ZodString>;
|
|
196
|
+
cached: z.ZodBoolean;
|
|
197
|
+
shown: z.ZodNumber;
|
|
198
|
+
order: z.ZodArray<z.ZodString>;
|
|
199
|
+
dropped: z.ZodArray<z.ZodString>;
|
|
200
|
+
used: z.ZodBoolean;
|
|
201
|
+
}, z.core.$strict>>;
|
|
202
|
+
meaning: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
export type RunRetrieval = z.infer<typeof RunRetrieval>;
|
|
205
|
+
/** A read-only tool a step's model may call beside its pack (ADR 0107 point 4). */
|
|
206
|
+
export declare const ToolDefinition: z.ZodObject<{
|
|
207
|
+
name: z.ZodString;
|
|
208
|
+
description: z.ZodString;
|
|
209
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
210
|
+
}, z.core.$strict>;
|
|
211
|
+
export type ToolDefinition = z.infer<typeof ToolDefinition>;
|
|
212
|
+
/** One tool call a model made, and what it was given back, as kept in the run record. */
|
|
213
|
+
export declare const ToolCallRecord: z.ZodObject<{
|
|
214
|
+
round: z.ZodNumber;
|
|
215
|
+
id: z.ZodOptional<z.ZodString>;
|
|
216
|
+
name: z.ZodString;
|
|
217
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
218
|
+
output: z.ZodString;
|
|
219
|
+
tokens: z.ZodNumber;
|
|
220
|
+
error: z.ZodOptional<z.ZodBoolean>;
|
|
221
|
+
}, z.core.$strict>;
|
|
222
|
+
export type ToolCallRecord = z.infer<typeof ToolCallRecord>;
|
|
223
|
+
/** The tools a run offered and how its model used them. */
|
|
224
|
+
export declare const RunTools: z.ZodObject<{
|
|
225
|
+
offered: z.ZodArray<z.ZodString>;
|
|
226
|
+
calls: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
227
|
+
round: z.ZodNumber;
|
|
228
|
+
id: z.ZodOptional<z.ZodString>;
|
|
229
|
+
name: z.ZodString;
|
|
230
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
231
|
+
output: z.ZodString;
|
|
232
|
+
tokens: z.ZodNumber;
|
|
233
|
+
error: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
}, z.core.$strict>>>;
|
|
235
|
+
stopped: z.ZodOptional<z.ZodString>;
|
|
236
|
+
}, z.core.$strict>;
|
|
237
|
+
export type RunTools = z.infer<typeof RunTools>;
|
|
238
|
+
/** What goes into review/ for every run; full packs and transcripts stay in git-ignored .runs/. */
|
|
239
|
+
export declare const RunSummary: z.ZodObject<{
|
|
240
|
+
schemaVersion: z.ZodLiteral<4>;
|
|
241
|
+
runId: z.ZodString;
|
|
242
|
+
change: z.ZodString;
|
|
243
|
+
agent: z.ZodString;
|
|
244
|
+
runtime: z.ZodEnum<{
|
|
245
|
+
model: "model";
|
|
246
|
+
"hand-off": "hand-off";
|
|
247
|
+
"headless-claude-code": "headless-claude-code";
|
|
248
|
+
mock: "mock";
|
|
249
|
+
replay: "replay";
|
|
250
|
+
}>;
|
|
251
|
+
state: z.ZodEnum<{
|
|
252
|
+
failed: "failed";
|
|
253
|
+
prepared: "prepared";
|
|
254
|
+
waiting: "waiting";
|
|
255
|
+
produced: "produced";
|
|
256
|
+
validated: "validated";
|
|
257
|
+
cancelled: "cancelled";
|
|
258
|
+
}>;
|
|
259
|
+
startedAt: z.ZodISODateTime;
|
|
260
|
+
finishedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
261
|
+
output: z.ZodOptional<z.ZodString>;
|
|
262
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
263
|
+
inputTokens: z.ZodNumber;
|
|
264
|
+
outputTokens: z.ZodNumber;
|
|
265
|
+
}, z.core.$strict>>;
|
|
266
|
+
contextManifestSha256: z.ZodString;
|
|
267
|
+
errors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
268
|
+
attempt: z.ZodDefault<z.ZodNumber>;
|
|
269
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
270
|
+
offered: z.ZodArray<z.ZodString>;
|
|
271
|
+
calls: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
272
|
+
round: z.ZodNumber;
|
|
273
|
+
id: z.ZodOptional<z.ZodString>;
|
|
274
|
+
name: z.ZodString;
|
|
275
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
276
|
+
output: z.ZodString;
|
|
277
|
+
tokens: z.ZodNumber;
|
|
278
|
+
error: z.ZodOptional<z.ZodBoolean>;
|
|
279
|
+
}, z.core.$strict>>>;
|
|
280
|
+
stopped: z.ZodOptional<z.ZodString>;
|
|
281
|
+
}, z.core.$strict>>;
|
|
282
|
+
retrieval: z.ZodOptional<z.ZodObject<{
|
|
283
|
+
expansion: z.ZodOptional<z.ZodObject<{
|
|
284
|
+
run: z.ZodOptional<z.ZodString>;
|
|
285
|
+
cached: z.ZodBoolean;
|
|
286
|
+
terms: z.ZodArray<z.ZodString>;
|
|
287
|
+
names: z.ZodArray<z.ZodObject<{
|
|
288
|
+
name: z.ZodString;
|
|
289
|
+
id: z.ZodOptional<z.ZodString>;
|
|
290
|
+
new: z.ZodOptional<z.ZodBoolean>;
|
|
291
|
+
quote: z.ZodString;
|
|
292
|
+
}, z.core.$strict>>;
|
|
293
|
+
dropped: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
294
|
+
name: z.ZodString;
|
|
295
|
+
why: z.ZodString;
|
|
296
|
+
}, z.core.$strict>>>;
|
|
297
|
+
}, z.core.$strict>>;
|
|
298
|
+
rerank: z.ZodOptional<z.ZodObject<{
|
|
299
|
+
run: z.ZodOptional<z.ZodString>;
|
|
300
|
+
cached: z.ZodBoolean;
|
|
301
|
+
shown: z.ZodNumber;
|
|
302
|
+
order: z.ZodArray<z.ZodString>;
|
|
303
|
+
dropped: z.ZodArray<z.ZodString>;
|
|
304
|
+
used: z.ZodBoolean;
|
|
305
|
+
}, z.core.$strict>>;
|
|
306
|
+
meaning: z.ZodOptional<z.ZodString>;
|
|
307
|
+
}, z.core.$strict>>;
|
|
308
|
+
stepClass: z.ZodOptional<z.ZodEnum<{
|
|
309
|
+
read: "read";
|
|
310
|
+
draft: "draft";
|
|
311
|
+
critic: "critic";
|
|
312
|
+
knowledge: "knowledge";
|
|
313
|
+
quick: "quick";
|
|
314
|
+
}>>;
|
|
315
|
+
model: z.ZodOptional<z.ZodString>;
|
|
316
|
+
}, z.core.$strict>;
|
|
317
|
+
export type RunSummary = z.infer<typeof RunSummary>;
|
|
318
|
+
/**
|
|
319
|
+
* A stored run record at the current version: version 1 (before tools), 2 (before retrieval) and
|
|
320
|
+
* 3 (before the step's class and model) read as version 4 without them; anything else is
|
|
321
|
+
* returned as it is, for the schema to judge.
|
|
322
|
+
*/
|
|
323
|
+
export declare function migrateRunSummary(raw: unknown): unknown;
|
|
324
|
+
/** Read a stored run record of any version (ADR 0107 addendum). */
|
|
325
|
+
export declare const readRunSummary: (raw: unknown) => z.ZodSafeParseResult<{
|
|
326
|
+
schemaVersion: 4;
|
|
327
|
+
runId: string;
|
|
328
|
+
change: string;
|
|
329
|
+
agent: string;
|
|
330
|
+
runtime: "model" | "hand-off" | "headless-claude-code" | "mock" | "replay";
|
|
331
|
+
state: "failed" | "prepared" | "waiting" | "produced" | "validated" | "cancelled";
|
|
332
|
+
startedAt: string;
|
|
333
|
+
contextManifestSha256: string;
|
|
334
|
+
errors: string[];
|
|
335
|
+
attempt: number;
|
|
336
|
+
finishedAt?: string | undefined;
|
|
337
|
+
output?: string | undefined;
|
|
338
|
+
usage?: {
|
|
339
|
+
inputTokens: number;
|
|
340
|
+
outputTokens: number;
|
|
341
|
+
} | undefined;
|
|
342
|
+
tools?: {
|
|
343
|
+
offered: string[];
|
|
344
|
+
calls: {
|
|
345
|
+
round: number;
|
|
346
|
+
name: string;
|
|
347
|
+
input: Record<string, unknown>;
|
|
348
|
+
output: string;
|
|
349
|
+
tokens: number;
|
|
350
|
+
id?: string | undefined;
|
|
351
|
+
error?: boolean | undefined;
|
|
352
|
+
}[];
|
|
353
|
+
stopped?: string | undefined;
|
|
354
|
+
} | undefined;
|
|
355
|
+
retrieval?: {
|
|
356
|
+
expansion?: {
|
|
357
|
+
cached: boolean;
|
|
358
|
+
terms: string[];
|
|
359
|
+
names: {
|
|
360
|
+
name: string;
|
|
361
|
+
quote: string;
|
|
362
|
+
id?: string | undefined;
|
|
363
|
+
new?: boolean | undefined;
|
|
364
|
+
}[];
|
|
365
|
+
dropped: {
|
|
366
|
+
name: string;
|
|
367
|
+
why: string;
|
|
368
|
+
}[];
|
|
369
|
+
run?: string | undefined;
|
|
370
|
+
} | undefined;
|
|
371
|
+
rerank?: {
|
|
372
|
+
cached: boolean;
|
|
373
|
+
shown: number;
|
|
374
|
+
order: string[];
|
|
375
|
+
dropped: string[];
|
|
376
|
+
used: boolean;
|
|
377
|
+
run?: string | undefined;
|
|
378
|
+
} | undefined;
|
|
379
|
+
meaning?: string | undefined;
|
|
380
|
+
} | undefined;
|
|
381
|
+
stepClass?: "read" | "draft" | "critic" | "knowledge" | "quick" | undefined;
|
|
382
|
+
model?: string | undefined;
|
|
383
|
+
}>;
|
|
384
|
+
/** A recorded model output for the replay runtime, keyed by agent and prompt hash. */
|
|
385
|
+
export declare const Recording: z.ZodObject<{
|
|
386
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
387
|
+
agent: z.ZodString;
|
|
388
|
+
promptSha256: z.ZodString;
|
|
389
|
+
output: z.ZodString;
|
|
390
|
+
usage: z.ZodObject<{
|
|
391
|
+
inputTokens: z.ZodNumber;
|
|
392
|
+
outputTokens: z.ZodNumber;
|
|
393
|
+
}, z.core.$strict>;
|
|
394
|
+
model: z.ZodString;
|
|
395
|
+
recordedAt: z.ZodISODateTime;
|
|
396
|
+
}, z.core.$strict>;
|
|
397
|
+
export type Recording = z.infer<typeof Recording>;
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* A change's state file: `openspec/changes/<change-id>/change.yaml` in the metarepo.
|
|
4
|
+
*
|
|
5
|
+
* OpenSpec knows a change's artifacts but not who owns it, which phase it is in, which
|
|
6
|
+
* hand-off PRs it went through or who approved them, so Atticus keeps that here, beside
|
|
7
|
+
* the artifacts, archived with the change. The file is canonical YAML written by
|
|
8
|
+
* `@maycombhq/changes`; people read it but change it only through Atticus, because every
|
|
9
|
+
* transition is checked (artifacts, blocking findings, approvals) and recorded in `history`.
|
|
10
|
+
*
|
|
11
|
+
* A contract file at version 1 (see the change-lifecycle ADR). Changing it needs an ADR and
|
|
12
|
+
* a version bump with a migration, like every other contract.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CHANGE_SCHEMA_VERSION: 1;
|
|
15
|
+
/**
|
|
16
|
+
* Where a change is. The phase states share their phase's name, except release, whose
|
|
17
|
+
* state is `release-ready` (waiting for go/no-go). `returned` means the product owner has
|
|
18
|
+
* it back; `post-release-review` is for types that release first (emergency fixes) and
|
|
19
|
+
* run the skipped lenses afterwards.
|
|
20
|
+
*/
|
|
21
|
+
export declare const LIFECYCLE_STATES: readonly ["draft", "define", "design", "plan", "build", "qa", "release-ready", "released", "post-release-review", "returned", "archived"];
|
|
22
|
+
export declare const LifecycleState: z.ZodEnum<{
|
|
23
|
+
design: "design";
|
|
24
|
+
draft: "draft";
|
|
25
|
+
qa: "qa";
|
|
26
|
+
define: "define";
|
|
27
|
+
plan: "plan";
|
|
28
|
+
build: "build";
|
|
29
|
+
archived: "archived";
|
|
30
|
+
"release-ready": "release-ready";
|
|
31
|
+
released: "released";
|
|
32
|
+
returned: "returned";
|
|
33
|
+
"post-release-review": "post-release-review";
|
|
34
|
+
}>;
|
|
35
|
+
export type LifecycleState = z.infer<typeof LifecycleState>;
|
|
36
|
+
export declare const ChangeHistoryEntry: z.ZodObject<{
|
|
37
|
+
from: z.ZodEnum<{
|
|
38
|
+
design: "design";
|
|
39
|
+
draft: "draft";
|
|
40
|
+
qa: "qa";
|
|
41
|
+
define: "define";
|
|
42
|
+
plan: "plan";
|
|
43
|
+
build: "build";
|
|
44
|
+
archived: "archived";
|
|
45
|
+
"release-ready": "release-ready";
|
|
46
|
+
released: "released";
|
|
47
|
+
returned: "returned";
|
|
48
|
+
"post-release-review": "post-release-review";
|
|
49
|
+
}>;
|
|
50
|
+
to: z.ZodEnum<{
|
|
51
|
+
design: "design";
|
|
52
|
+
draft: "draft";
|
|
53
|
+
qa: "qa";
|
|
54
|
+
define: "define";
|
|
55
|
+
plan: "plan";
|
|
56
|
+
build: "build";
|
|
57
|
+
archived: "archived";
|
|
58
|
+
"release-ready": "release-ready";
|
|
59
|
+
released: "released";
|
|
60
|
+
returned: "returned";
|
|
61
|
+
"post-release-review": "post-release-review";
|
|
62
|
+
}>;
|
|
63
|
+
at: z.ZodISODateTime;
|
|
64
|
+
by: z.ZodString;
|
|
65
|
+
pr: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
export type ChangeHistoryEntry = z.infer<typeof ChangeHistoryEntry>;
|
|
69
|
+
export declare const HandoffState: z.ZodEnum<{
|
|
70
|
+
open: "open";
|
|
71
|
+
merged: "merged";
|
|
72
|
+
closed: "closed";
|
|
73
|
+
"changes-requested": "changes-requested";
|
|
74
|
+
}>;
|
|
75
|
+
export declare const ChangeHandoff: z.ZodObject<{
|
|
76
|
+
phase: z.ZodEnum<{
|
|
77
|
+
release: "release";
|
|
78
|
+
design: "design";
|
|
79
|
+
qa: "qa";
|
|
80
|
+
define: "define";
|
|
81
|
+
plan: "plan";
|
|
82
|
+
build: "build";
|
|
83
|
+
}>;
|
|
84
|
+
branch: z.ZodString;
|
|
85
|
+
pr: z.ZodObject<{
|
|
86
|
+
number: z.ZodNumber;
|
|
87
|
+
url: z.ZodURL;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
state: z.ZodEnum<{
|
|
90
|
+
open: "open";
|
|
91
|
+
merged: "merged";
|
|
92
|
+
closed: "closed";
|
|
93
|
+
"changes-requested": "changes-requested";
|
|
94
|
+
}>;
|
|
95
|
+
by: z.ZodString;
|
|
96
|
+
openedAt: z.ZodISODateTime;
|
|
97
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
98
|
+
reviewers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
99
|
+
approvals: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
100
|
+
by: z.ZodString;
|
|
101
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
at: z.ZodISODateTime;
|
|
103
|
+
}, z.core.$strict>>>;
|
|
104
|
+
artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
105
|
+
path: z.ZodString;
|
|
106
|
+
sha256: z.ZodString;
|
|
107
|
+
}, z.core.$strict>>>;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
export type ChangeHandoff = z.infer<typeof ChangeHandoff>;
|
|
110
|
+
/** Catalog records and repos the change declares it touches, beyond what its artifacts say. */
|
|
111
|
+
export declare const ChangeTouches: z.ZodObject<{
|
|
112
|
+
interfaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
status: z.ZodEnum<{
|
|
115
|
+
"planned-new": "planned-new";
|
|
116
|
+
"planned-modify": "planned-modify";
|
|
117
|
+
"planned-retire": "planned-retire";
|
|
118
|
+
}>;
|
|
119
|
+
}, z.core.$strict>>>;
|
|
120
|
+
dataStores: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
121
|
+
tables: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
122
|
+
records: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
123
|
+
repos: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
export type ChangeTouches = z.infer<typeof ChangeTouches>;
|
|
126
|
+
export declare const ChangeLifecycle: z.ZodObject<{
|
|
127
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
128
|
+
id: z.ZodString;
|
|
129
|
+
title: z.ZodString;
|
|
130
|
+
type: z.ZodString;
|
|
131
|
+
template: z.ZodOptional<z.ZodString>;
|
|
132
|
+
state: z.ZodEnum<{
|
|
133
|
+
design: "design";
|
|
134
|
+
draft: "draft";
|
|
135
|
+
qa: "qa";
|
|
136
|
+
define: "define";
|
|
137
|
+
plan: "plan";
|
|
138
|
+
build: "build";
|
|
139
|
+
archived: "archived";
|
|
140
|
+
"release-ready": "release-ready";
|
|
141
|
+
released: "released";
|
|
142
|
+
returned: "returned";
|
|
143
|
+
"post-release-review": "post-release-review";
|
|
144
|
+
}>;
|
|
145
|
+
owners: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
146
|
+
systems: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
147
|
+
touches: z.ZodDefault<z.ZodObject<{
|
|
148
|
+
interfaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
status: z.ZodEnum<{
|
|
151
|
+
"planned-new": "planned-new";
|
|
152
|
+
"planned-modify": "planned-modify";
|
|
153
|
+
"planned-retire": "planned-retire";
|
|
154
|
+
}>;
|
|
155
|
+
}, z.core.$strict>>>;
|
|
156
|
+
dataStores: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
157
|
+
tables: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
158
|
+
records: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
159
|
+
repos: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
160
|
+
}, z.core.$strict>>;
|
|
161
|
+
authors: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
162
|
+
interfaces: "interfaces";
|
|
163
|
+
data: "data";
|
|
164
|
+
ux: "ux";
|
|
165
|
+
brief: "brief";
|
|
166
|
+
proposal: "proposal";
|
|
167
|
+
specs: "specs";
|
|
168
|
+
mappings: "mappings";
|
|
169
|
+
design: "design";
|
|
170
|
+
stories: "stories";
|
|
171
|
+
tasks: "tasks";
|
|
172
|
+
snow: "snow";
|
|
173
|
+
}> & z.core.$partial, z.ZodArray<z.ZodString>>>;
|
|
174
|
+
createdAt: z.ZodISODateTime;
|
|
175
|
+
createdBy: z.ZodString;
|
|
176
|
+
history: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
177
|
+
from: z.ZodEnum<{
|
|
178
|
+
design: "design";
|
|
179
|
+
draft: "draft";
|
|
180
|
+
qa: "qa";
|
|
181
|
+
define: "define";
|
|
182
|
+
plan: "plan";
|
|
183
|
+
build: "build";
|
|
184
|
+
archived: "archived";
|
|
185
|
+
"release-ready": "release-ready";
|
|
186
|
+
released: "released";
|
|
187
|
+
returned: "returned";
|
|
188
|
+
"post-release-review": "post-release-review";
|
|
189
|
+
}>;
|
|
190
|
+
to: z.ZodEnum<{
|
|
191
|
+
design: "design";
|
|
192
|
+
draft: "draft";
|
|
193
|
+
qa: "qa";
|
|
194
|
+
define: "define";
|
|
195
|
+
plan: "plan";
|
|
196
|
+
build: "build";
|
|
197
|
+
archived: "archived";
|
|
198
|
+
"release-ready": "release-ready";
|
|
199
|
+
released: "released";
|
|
200
|
+
returned: "returned";
|
|
201
|
+
"post-release-review": "post-release-review";
|
|
202
|
+
}>;
|
|
203
|
+
at: z.ZodISODateTime;
|
|
204
|
+
by: z.ZodString;
|
|
205
|
+
pr: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strict>>>;
|
|
208
|
+
handoffs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
209
|
+
phase: z.ZodEnum<{
|
|
210
|
+
release: "release";
|
|
211
|
+
design: "design";
|
|
212
|
+
qa: "qa";
|
|
213
|
+
define: "define";
|
|
214
|
+
plan: "plan";
|
|
215
|
+
build: "build";
|
|
216
|
+
}>;
|
|
217
|
+
branch: z.ZodString;
|
|
218
|
+
pr: z.ZodObject<{
|
|
219
|
+
number: z.ZodNumber;
|
|
220
|
+
url: z.ZodURL;
|
|
221
|
+
}, z.core.$strict>;
|
|
222
|
+
state: z.ZodEnum<{
|
|
223
|
+
open: "open";
|
|
224
|
+
merged: "merged";
|
|
225
|
+
closed: "closed";
|
|
226
|
+
"changes-requested": "changes-requested";
|
|
227
|
+
}>;
|
|
228
|
+
by: z.ZodString;
|
|
229
|
+
openedAt: z.ZodISODateTime;
|
|
230
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
231
|
+
reviewers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
232
|
+
approvals: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
233
|
+
by: z.ZodString;
|
|
234
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
235
|
+
at: z.ZodISODateTime;
|
|
236
|
+
}, z.core.$strict>>>;
|
|
237
|
+
artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
238
|
+
path: z.ZodString;
|
|
239
|
+
sha256: z.ZodString;
|
|
240
|
+
}, z.core.$strict>>>;
|
|
241
|
+
}, z.core.$strict>>>;
|
|
242
|
+
}, z.core.$strict>;
|
|
243
|
+
export type ChangeLifecycle = z.infer<typeof ChangeLifecycle>;
|
|
244
|
+
export type ChangeLifecycleInput = z.input<typeof ChangeLifecycle>;
|