@henryqw/pi-subagent 18.0.1 → 22.0.1

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.
Files changed (47) hide show
  1. package/CONTEXT.md +76 -24
  2. package/README.md +116 -142
  3. package/dist/composition.d.ts +11 -0
  4. package/dist/composition.js +107 -0
  5. package/dist/direct-herdr.d.ts +17 -0
  6. package/dist/direct-herdr.js +219 -0
  7. package/dist/ephemeral.d.ts +2 -2
  8. package/dist/ephemeral.js +7 -7
  9. package/dist/git-runtime.d.ts +110 -0
  10. package/dist/git-runtime.js +472 -0
  11. package/dist/herdr-runtime.d.ts +137 -0
  12. package/dist/herdr-runtime.js +1228 -0
  13. package/dist/index.d.ts +11 -5
  14. package/dist/index.js +20 -16
  15. package/dist/integration-git.d.ts +59 -0
  16. package/dist/integration-git.js +484 -0
  17. package/dist/launch-runtime.d.ts +54 -0
  18. package/dist/launch-runtime.js +195 -0
  19. package/dist/process.d.ts +9 -0
  20. package/dist/process.js +11 -0
  21. package/dist/runner.d.ts +356 -0
  22. package/dist/runner.js +2710 -0
  23. package/dist/schema.d.ts +2234 -0
  24. package/dist/schema.js +1236 -0
  25. package/dist/store.d.ts +50 -0
  26. package/dist/store.js +288 -0
  27. package/dist/working-evidence.d.ts +25 -0
  28. package/dist/working-evidence.js +261 -0
  29. package/docs/adr/001-composable-ephemeral-execution.md +3 -3
  30. package/docs/delegation-routing.html +89 -0
  31. package/docs/delegation-routing.svg +78 -0
  32. package/docs/orchestration-architecture.html +238 -0
  33. package/docs/orchestration-architecture.svg +189 -0
  34. package/docs/orchestration.md +122 -331
  35. package/example.png +0 -0
  36. package/examples/roles/implementer.md +2 -3
  37. package/extensions/admission.ts +66 -0
  38. package/extensions/config.ts +51 -37
  39. package/extensions/isolated.ts +638 -0
  40. package/extensions/result-transport.ts +13 -103
  41. package/extensions/role-tools.ts +11 -11
  42. package/extensions/subagent-command.ts +167 -0
  43. package/extensions/subagent.ts +264 -540
  44. package/extensions/task-name.ts +1 -2
  45. package/extensions/workflow.ts +60 -96
  46. package/package.json +14 -6
  47. package/skills/pi-subagent/SKILL.md +35 -0
@@ -0,0 +1,2234 @@
1
+ import { Type, type Static } from "typebox";
2
+ export declare const RUN_STATE_VERSION = 5;
3
+ export declare const MAX_TASKS = 8;
4
+ export declare const MAX_EXECUTE_REQUEST_BYTES: number;
5
+ export declare const MAX_PERSISTED_RUNTIME_TEXT_BYTES: number;
6
+ export declare const MAX_POSSIBLE_RESOURCES = 32;
7
+ export type ModelClass = Static<typeof ModelClassSchema>;
8
+ declare const ModelClassSchema: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
9
+ export declare const CheckCommandSchema: Type.TObject<{
10
+ command: Type.TString;
11
+ args: Type.TArray<Type.TString>;
12
+ }>;
13
+ export declare const JudgmentSchema: Type.TObject<{
14
+ role: Type.TString;
15
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
16
+ criterion: Type.TString;
17
+ }>;
18
+ declare const TextTaskRequestSchema: Type.TObject<{
19
+ role: Type.TString;
20
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
21
+ requirements: Type.TString;
22
+ deliverable: Type.TString;
23
+ dependsOn: Type.TArray<Type.TString>;
24
+ contextFrom: Type.TArray<Type.TString>;
25
+ id: Type.TString;
26
+ kind: Type.TLiteral<"text">;
27
+ }>;
28
+ declare const ChangesetTaskRequestSchema: Type.TObject<{
29
+ role: Type.TString;
30
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
31
+ requirements: Type.TString;
32
+ deliverable: Type.TString;
33
+ dependsOn: Type.TArray<Type.TString>;
34
+ contextFrom: Type.TArray<Type.TString>;
35
+ id: Type.TString;
36
+ kind: Type.TLiteral<"changeset">;
37
+ checks: Type.TArray<Type.TObject<{
38
+ command: Type.TString;
39
+ args: Type.TArray<Type.TString>;
40
+ }>>;
41
+ judgment: Type.TOptional<Type.TObject<{
42
+ role: Type.TString;
43
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
44
+ criterion: Type.TString;
45
+ }>>;
46
+ }>;
47
+ export declare const TaskRequestSchema: Type.TUnion<[Type.TObject<{
48
+ role: Type.TString;
49
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
50
+ requirements: Type.TString;
51
+ deliverable: Type.TString;
52
+ dependsOn: Type.TArray<Type.TString>;
53
+ contextFrom: Type.TArray<Type.TString>;
54
+ id: Type.TString;
55
+ kind: Type.TLiteral<"text">;
56
+ }>, Type.TObject<{
57
+ role: Type.TString;
58
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
59
+ requirements: Type.TString;
60
+ deliverable: Type.TString;
61
+ dependsOn: Type.TArray<Type.TString>;
62
+ contextFrom: Type.TArray<Type.TString>;
63
+ id: Type.TString;
64
+ kind: Type.TLiteral<"changeset">;
65
+ checks: Type.TArray<Type.TObject<{
66
+ command: Type.TString;
67
+ args: Type.TArray<Type.TString>;
68
+ }>>;
69
+ judgment: Type.TOptional<Type.TObject<{
70
+ role: Type.TString;
71
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
72
+ criterion: Type.TString;
73
+ }>>;
74
+ }>]>;
75
+ export declare const ExecuteRequestSchema: Type.TObject<{
76
+ mode: Type.TLiteral<"isolated">;
77
+ id: Type.TString;
78
+ goal: Type.TString;
79
+ tasks: Type.TArray<Type.TUnion<[Type.TObject<{
80
+ role: Type.TString;
81
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
82
+ requirements: Type.TString;
83
+ deliverable: Type.TString;
84
+ dependsOn: Type.TArray<Type.TString>;
85
+ contextFrom: Type.TArray<Type.TString>;
86
+ id: Type.TString;
87
+ kind: Type.TLiteral<"text">;
88
+ }>, Type.TObject<{
89
+ role: Type.TString;
90
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
91
+ requirements: Type.TString;
92
+ deliverable: Type.TString;
93
+ dependsOn: Type.TArray<Type.TString>;
94
+ contextFrom: Type.TArray<Type.TString>;
95
+ id: Type.TString;
96
+ kind: Type.TLiteral<"changeset">;
97
+ checks: Type.TArray<Type.TObject<{
98
+ command: Type.TString;
99
+ args: Type.TArray<Type.TString>;
100
+ }>>;
101
+ judgment: Type.TOptional<Type.TObject<{
102
+ role: Type.TString;
103
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
104
+ criterion: Type.TString;
105
+ }>>;
106
+ }>]>>;
107
+ finalChecks: Type.TOptional<Type.TArray<Type.TObject<{
108
+ command: Type.TString;
109
+ args: Type.TArray<Type.TString>;
110
+ }>>>;
111
+ finalJudgment: Type.TOptional<Type.TObject<{
112
+ role: Type.TString;
113
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
114
+ criterion: Type.TString;
115
+ }>>;
116
+ }>;
117
+ export declare const IdOnlySchema: Type.TObject<{
118
+ id: Type.TString;
119
+ }>;
120
+ export declare const ResumeRequestSchema: Type.TUnion<[Type.TObject<{
121
+ id: Type.TString;
122
+ action: Type.TLiteral<"retry">;
123
+ taskId: Type.TString;
124
+ }>, Type.TObject<{
125
+ id: Type.TString;
126
+ action: Type.TLiteral<"verify">;
127
+ taskId: Type.TString;
128
+ }>, Type.TObject<{
129
+ id: Type.TString;
130
+ action: Type.TLiteral<"finalize">;
131
+ }>]>;
132
+ export type IdOnly = Static<typeof IdOnlySchema>;
133
+ export type CheckCommand = Static<typeof CheckCommandSchema>;
134
+ export type Judgment = Static<typeof JudgmentSchema>;
135
+ export type TextTaskRequest = Static<typeof TextTaskRequestSchema>;
136
+ export type ChangesetTaskRequest = Static<typeof ChangesetTaskRequestSchema>;
137
+ export type TaskRequest = Static<typeof TaskRequestSchema>;
138
+ type ExecuteRequestInput = Static<typeof ExecuteRequestSchema>;
139
+ export type ExecuteRequest = Omit<ExecuteRequestInput, "finalChecks"> & {
140
+ finalChecks: CheckCommand[];
141
+ };
142
+ export interface ExecutionPolicySnapshot {
143
+ maxSubagents: number;
144
+ maxTurns: number;
145
+ maxTokens?: number;
146
+ childIdleMs: number;
147
+ childMaxMs: number;
148
+ maxCorrections: number;
149
+ }
150
+ export type ResumeRequest = Static<typeof ResumeRequestSchema>;
151
+ export type WorkspaceIdentity = Static<typeof WorkspaceSchema>;
152
+ declare const WorktreeRecordSchema: Type.TObject<{
153
+ path: Type.TString;
154
+ cwd: Type.TString;
155
+ branch: Type.TString;
156
+ repoRoot: Type.TString;
157
+ baseCommit: Type.TString;
158
+ }>;
159
+ declare const WorktreeAllocationIntentSchema: Type.TObject<{
160
+ generation: Type.TInteger;
161
+ token: Type.TString;
162
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
163
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
164
+ failure: Type.TOptional<Type.TString>;
165
+ kind: Type.TLiteral<"worktree">;
166
+ worktree: Type.TOptional<Type.TObject<{
167
+ path: Type.TString;
168
+ cwd: Type.TString;
169
+ branch: Type.TString;
170
+ repoRoot: Type.TString;
171
+ baseCommit: Type.TString;
172
+ }>>;
173
+ }>;
174
+ declare const WorkspaceAllocationIntentSchema: Type.TObject<{
175
+ generation: Type.TInteger;
176
+ token: Type.TString;
177
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
178
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
179
+ failure: Type.TOptional<Type.TString>;
180
+ kind: Type.TLiteral<"workspace">;
181
+ label: Type.TString;
182
+ worktreeCwd: Type.TString;
183
+ mainRoot: Type.TString;
184
+ repoKey: Type.TString;
185
+ herdrRepoRoot: Type.TString;
186
+ workspaceId: Type.TOptional<Type.TString>;
187
+ rootTabId: Type.TOptional<Type.TString>;
188
+ rootPaneId: Type.TOptional<Type.TString>;
189
+ }>;
190
+ declare const WorkerTabAllocationIntentSchema: Type.TObject<{
191
+ generation: Type.TInteger;
192
+ token: Type.TString;
193
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
194
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
195
+ failure: Type.TOptional<Type.TString>;
196
+ kind: Type.TLiteral<"worker_tab">;
197
+ label: Type.TString;
198
+ workspaceId: Type.TString;
199
+ workspaceRootTabId: Type.TString;
200
+ workspaceRootPaneId: Type.TString;
201
+ worktreeCwd: Type.TString;
202
+ leasePath: Type.TString;
203
+ tabId: Type.TOptional<Type.TString>;
204
+ paneId: Type.TOptional<Type.TString>;
205
+ }>;
206
+ declare const AgentAllocationIntentSchema: Type.TObject<{
207
+ generation: Type.TInteger;
208
+ token: Type.TString;
209
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
210
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
211
+ failure: Type.TOptional<Type.TString>;
212
+ kind: Type.TLiteral<"agent">;
213
+ agentName: Type.TString;
214
+ workspaceId: Type.TString;
215
+ tabId: Type.TString;
216
+ paneId: Type.TString;
217
+ worktreeCwd: Type.TString;
218
+ leasePath: Type.TString;
219
+ }>;
220
+ export declare const AllocationIntentSchema: Type.TUnion<[Type.TObject<{
221
+ generation: Type.TInteger;
222
+ token: Type.TString;
223
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
224
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
225
+ failure: Type.TOptional<Type.TString>;
226
+ kind: Type.TLiteral<"worktree">;
227
+ worktree: Type.TOptional<Type.TObject<{
228
+ path: Type.TString;
229
+ cwd: Type.TString;
230
+ branch: Type.TString;
231
+ repoRoot: Type.TString;
232
+ baseCommit: Type.TString;
233
+ }>>;
234
+ }>, Type.TObject<{
235
+ generation: Type.TInteger;
236
+ token: Type.TString;
237
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
238
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
239
+ failure: Type.TOptional<Type.TString>;
240
+ kind: Type.TLiteral<"workspace">;
241
+ label: Type.TString;
242
+ worktreeCwd: Type.TString;
243
+ mainRoot: Type.TString;
244
+ repoKey: Type.TString;
245
+ herdrRepoRoot: Type.TString;
246
+ workspaceId: Type.TOptional<Type.TString>;
247
+ rootTabId: Type.TOptional<Type.TString>;
248
+ rootPaneId: Type.TOptional<Type.TString>;
249
+ }>, Type.TObject<{
250
+ generation: Type.TInteger;
251
+ token: Type.TString;
252
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
253
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
254
+ failure: Type.TOptional<Type.TString>;
255
+ kind: Type.TLiteral<"worker_tab">;
256
+ label: Type.TString;
257
+ workspaceId: Type.TString;
258
+ workspaceRootTabId: Type.TString;
259
+ workspaceRootPaneId: Type.TString;
260
+ worktreeCwd: Type.TString;
261
+ leasePath: Type.TString;
262
+ tabId: Type.TOptional<Type.TString>;
263
+ paneId: Type.TOptional<Type.TString>;
264
+ }>, Type.TObject<{
265
+ generation: Type.TInteger;
266
+ token: Type.TString;
267
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
268
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
269
+ failure: Type.TOptional<Type.TString>;
270
+ kind: Type.TLiteral<"agent">;
271
+ agentName: Type.TString;
272
+ workspaceId: Type.TString;
273
+ tabId: Type.TString;
274
+ paneId: Type.TString;
275
+ worktreeCwd: Type.TString;
276
+ leasePath: Type.TString;
277
+ }>]>;
278
+ export type WorktreeRecord = Static<typeof WorktreeRecordSchema>;
279
+ export type WorktreeAllocationIntent = Static<typeof WorktreeAllocationIntentSchema>;
280
+ export type WorkspaceAllocationIntent = Static<typeof WorkspaceAllocationIntentSchema>;
281
+ export type WorkerTabAllocationIntent = Static<typeof WorkerTabAllocationIntentSchema>;
282
+ export type AgentAllocationIntent = Static<typeof AgentAllocationIntentSchema>;
283
+ export type AllocationIntent = Static<typeof AllocationIntentSchema>;
284
+ export type AllocationKind = AllocationIntent["kind"];
285
+ export type WorktreeAllocationPlan = WorktreeRecord;
286
+ export type WorkspaceAllocationPlan = Pick<WorkspaceAllocationIntent, "kind" | "label" | "worktreeCwd" | "mainRoot" | "repoKey" | "herdrRepoRoot">;
287
+ export type WorkerTabAllocationPlan = Pick<WorkerTabAllocationIntent, "kind" | "label" | "workspaceId" | "workspaceRootTabId" | "workspaceRootPaneId" | "worktreeCwd" | "leasePath">;
288
+ export type AgentAllocationPlan = Pick<AgentAllocationIntent, "kind" | "agentName" | "workspaceId" | "tabId" | "paneId" | "worktreeCwd" | "leasePath">;
289
+ export type HostAllocationIntent = WorkspaceAllocationIntent | WorkerTabAllocationIntent | AgentAllocationIntent;
290
+ export type HostAllocationPlan = WorkspaceAllocationPlan | WorkerTabAllocationPlan | AgentAllocationPlan;
291
+ export type PromptRecord = Static<typeof PromptRecordSchema>;
292
+ export type CommandEvidence = Static<typeof CommandEvidenceSchema>;
293
+ export type CheckBatchEvidence = Static<typeof CheckBatchEvidenceSchema>;
294
+ export type ReviewEvidence = Static<typeof ReviewEvidenceSchema>;
295
+ export type WorkerTermination = Static<typeof WorkerTerminationSchema>;
296
+ export declare const CLEANUP_KINDS: readonly ["worker_tab", "workspace", "worktree", "branch"];
297
+ export type CleanupStep = Static<typeof CleanupStepSchema>;
298
+ export type CleanupKind = CleanupStep["kind"];
299
+ export type ChangesetTaskAttempt = Static<typeof TaskAttemptSchema>;
300
+ export type TaskAttempt = ChangesetTaskAttempt;
301
+ export type TextTaskAttempt = Static<typeof TextTaskAttemptSchema>;
302
+ export type ChangesetTaskState = Static<typeof ChangesetTaskStateSchema>;
303
+ export type TextTaskState = Static<typeof TextTaskStateSchema>;
304
+ export type TaskState = Static<typeof TaskStateSchema>;
305
+ export type WaveState = Static<typeof WaveStateSchema>;
306
+ export type RunState = Static<typeof RunStateSchema>;
307
+ declare const WorkspaceSchema: Type.TObject<{
308
+ branch: Type.TString;
309
+ head: Type.TString;
310
+ index: Type.TString;
311
+ tree: Type.TString;
312
+ }>;
313
+ export declare const StageRequestSchema: Type.TObject<{
314
+ id: Type.TString;
315
+ action: Type.TUnion<[Type.TLiteral<"stage">, Type.TLiteral<"resolve">, Type.TLiteral<"reject">, Type.TLiteral<"revise">]>;
316
+ generation: Type.TInteger;
317
+ taskId: Type.TString;
318
+ attempt: Type.TInteger;
319
+ candidate: Type.TObject<{
320
+ branch: Type.TString;
321
+ head: Type.TString;
322
+ index: Type.TString;
323
+ tree: Type.TString;
324
+ }>;
325
+ expectedTip: Type.TObject<{
326
+ branch: Type.TString;
327
+ head: Type.TString;
328
+ index: Type.TString;
329
+ tree: Type.TString;
330
+ }>;
331
+ instruction: Type.TOptional<Type.TString>;
332
+ }>;
333
+ export type StageRequest = Static<typeof StageRequestSchema>;
334
+ export declare const IntegrationActionSchema: Type.TUnion<[Type.TObject<{
335
+ id: Type.TString;
336
+ generation: Type.TInteger;
337
+ action: Type.TLiteral<"refresh">;
338
+ expectedTip: Type.TObject<{
339
+ branch: Type.TString;
340
+ head: Type.TString;
341
+ index: Type.TString;
342
+ tree: Type.TString;
343
+ }>;
344
+ expectedMain: Type.TObject<{
345
+ branch: Type.TString;
346
+ head: Type.TString;
347
+ index: Type.TString;
348
+ tree: Type.TString;
349
+ }>;
350
+ newMain: Type.TObject<{
351
+ branch: Type.TString;
352
+ head: Type.TString;
353
+ index: Type.TString;
354
+ tree: Type.TString;
355
+ }>;
356
+ }>, Type.TObject<{
357
+ id: Type.TString;
358
+ generation: Type.TInteger;
359
+ action: Type.TUnion<[Type.TLiteral<"advance">, Type.TLiteral<"validate">, Type.TLiteral<"correct">, Type.TLiteral<"promote">, Type.TLiteral<"reconcile">, Type.TLiteral<"cleanup">]>;
360
+ expectedTip: Type.TObject<{
361
+ branch: Type.TString;
362
+ head: Type.TString;
363
+ index: Type.TString;
364
+ tree: Type.TString;
365
+ }>;
366
+ }>, Type.TObject<{
367
+ id: Type.TString;
368
+ generation: Type.TInteger;
369
+ action: Type.TLiteral<"release">;
370
+ expectedTip: Type.TObject<{
371
+ branch: Type.TString;
372
+ head: Type.TString;
373
+ index: Type.TString;
374
+ tree: Type.TString;
375
+ }>;
376
+ taskId: Type.TOptional<Type.TString>;
377
+ attempt: Type.TOptional<Type.TInteger>;
378
+ }>]>;
379
+ export type IntegrationAction = Static<typeof IntegrationActionSchema>;
380
+ export declare function parseIntegrationAction(value: unknown): IntegrationAction;
381
+ export declare function parseStageRequest(value: unknown): StageRequest;
382
+ declare const PromptRecordSchema: Type.TObject<{
383
+ kind: Type.TUnion<[Type.TLiteral<"initial">, Type.TLiteral<"correction">, Type.TLiteral<"followup">]>;
384
+ status: Type.TUnion<[Type.TLiteral<"submitting">, Type.TLiteral<"not_sent">, Type.TLiteral<"settled">, Type.TLiteral<"ambiguous">]>;
385
+ preCandidate: Type.TObject<{
386
+ branch: Type.TString;
387
+ head: Type.TString;
388
+ index: Type.TString;
389
+ tree: Type.TString;
390
+ }>;
391
+ candidate: Type.TOptional<Type.TObject<{
392
+ branch: Type.TString;
393
+ head: Type.TString;
394
+ index: Type.TString;
395
+ tree: Type.TString;
396
+ }>>;
397
+ instruction: Type.TOptional<Type.TString>;
398
+ failure: Type.TOptional<Type.TString>;
399
+ at: Type.TInteger;
400
+ }>;
401
+ declare const CommandEvidenceSchema: Type.TObject<{
402
+ command: Type.TString;
403
+ args: Type.TArray<Type.TString>;
404
+ code: Type.TInteger;
405
+ killed: Type.TBoolean;
406
+ stdout: Type.TString;
407
+ stderr: Type.TString;
408
+ }>;
409
+ declare const CheckBatchEvidenceSchema: Type.TObject<{
410
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
411
+ candidate: Type.TObject<{
412
+ branch: Type.TString;
413
+ head: Type.TString;
414
+ index: Type.TString;
415
+ tree: Type.TString;
416
+ }>;
417
+ identityAfter: Type.TObject<{
418
+ branch: Type.TString;
419
+ head: Type.TString;
420
+ index: Type.TString;
421
+ tree: Type.TString;
422
+ }>;
423
+ results: Type.TArray<Type.TObject<{
424
+ command: Type.TString;
425
+ args: Type.TArray<Type.TString>;
426
+ code: Type.TInteger;
427
+ killed: Type.TBoolean;
428
+ stdout: Type.TString;
429
+ stderr: Type.TString;
430
+ }>>;
431
+ passed: Type.TBoolean;
432
+ at: Type.TInteger;
433
+ }>;
434
+ declare const ReviewEvidenceSchema: Type.TObject<{
435
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
436
+ criterion: Type.TString;
437
+ base: Type.TObject<{
438
+ branch: Type.TString;
439
+ head: Type.TString;
440
+ index: Type.TString;
441
+ tree: Type.TString;
442
+ }>;
443
+ tip: Type.TObject<{
444
+ branch: Type.TString;
445
+ head: Type.TString;
446
+ index: Type.TString;
447
+ tree: Type.TString;
448
+ }>;
449
+ identityAfter: Type.TObject<{
450
+ branch: Type.TString;
451
+ head: Type.TString;
452
+ index: Type.TString;
453
+ tree: Type.TString;
454
+ }>;
455
+ verdict: Type.TString;
456
+ passed: Type.TBoolean;
457
+ at: Type.TInteger;
458
+ }>;
459
+ declare const WorkerTerminationSchema: Type.TObject<{
460
+ status: Type.TUnion<[Type.TLiteral<"terminating">, Type.TLiteral<"terminated">, Type.TLiteral<"unknown">]>;
461
+ workerId: Type.TString;
462
+ candidate: Type.TObject<{
463
+ branch: Type.TString;
464
+ head: Type.TString;
465
+ index: Type.TString;
466
+ tree: Type.TString;
467
+ }>;
468
+ at: Type.TOptional<Type.TInteger>;
469
+ failure: Type.TOptional<Type.TString>;
470
+ }>;
471
+ declare const CleanupStepSchema: Type.TObject<{
472
+ kind: Type.TUnion<[Type.TLiteral<"worker_tab">, Type.TLiteral<"workspace">, Type.TLiteral<"worktree">, Type.TLiteral<"branch">]>;
473
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">]>;
474
+ failure: Type.TOptional<Type.TString>;
475
+ }>;
476
+ declare const TaskAttemptSchema: Type.TObject<{
477
+ number: Type.TInteger;
478
+ waveNumber: Type.TInteger;
479
+ waveBase: Type.TObject<{
480
+ branch: Type.TString;
481
+ head: Type.TString;
482
+ index: Type.TString;
483
+ tree: Type.TString;
484
+ }>;
485
+ correlationToken: Type.TString;
486
+ allocationGeneration: Type.TInteger;
487
+ allocations: Type.TArray<Type.TUnion<[Type.TObject<{
488
+ generation: Type.TInteger;
489
+ token: Type.TString;
490
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
491
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
492
+ failure: Type.TOptional<Type.TString>;
493
+ kind: Type.TLiteral<"worktree">;
494
+ worktree: Type.TOptional<Type.TObject<{
495
+ path: Type.TString;
496
+ cwd: Type.TString;
497
+ branch: Type.TString;
498
+ repoRoot: Type.TString;
499
+ baseCommit: Type.TString;
500
+ }>>;
501
+ }>, Type.TObject<{
502
+ generation: Type.TInteger;
503
+ token: Type.TString;
504
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
505
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
506
+ failure: Type.TOptional<Type.TString>;
507
+ kind: Type.TLiteral<"workspace">;
508
+ label: Type.TString;
509
+ worktreeCwd: Type.TString;
510
+ mainRoot: Type.TString;
511
+ repoKey: Type.TString;
512
+ herdrRepoRoot: Type.TString;
513
+ workspaceId: Type.TOptional<Type.TString>;
514
+ rootTabId: Type.TOptional<Type.TString>;
515
+ rootPaneId: Type.TOptional<Type.TString>;
516
+ }>, Type.TObject<{
517
+ generation: Type.TInteger;
518
+ token: Type.TString;
519
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
520
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
521
+ failure: Type.TOptional<Type.TString>;
522
+ kind: Type.TLiteral<"worker_tab">;
523
+ label: Type.TString;
524
+ workspaceId: Type.TString;
525
+ workspaceRootTabId: Type.TString;
526
+ workspaceRootPaneId: Type.TString;
527
+ worktreeCwd: Type.TString;
528
+ leasePath: Type.TString;
529
+ tabId: Type.TOptional<Type.TString>;
530
+ paneId: Type.TOptional<Type.TString>;
531
+ }>, Type.TObject<{
532
+ generation: Type.TInteger;
533
+ token: Type.TString;
534
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
535
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
536
+ failure: Type.TOptional<Type.TString>;
537
+ kind: Type.TLiteral<"agent">;
538
+ agentName: Type.TString;
539
+ workspaceId: Type.TString;
540
+ tabId: Type.TString;
541
+ paneId: Type.TString;
542
+ worktreeCwd: Type.TString;
543
+ leasePath: Type.TString;
544
+ }>]>>;
545
+ prompts: Type.TArray<Type.TObject<{
546
+ kind: Type.TUnion<[Type.TLiteral<"initial">, Type.TLiteral<"correction">, Type.TLiteral<"followup">]>;
547
+ status: Type.TUnion<[Type.TLiteral<"submitting">, Type.TLiteral<"not_sent">, Type.TLiteral<"settled">, Type.TLiteral<"ambiguous">]>;
548
+ preCandidate: Type.TObject<{
549
+ branch: Type.TString;
550
+ head: Type.TString;
551
+ index: Type.TString;
552
+ tree: Type.TString;
553
+ }>;
554
+ candidate: Type.TOptional<Type.TObject<{
555
+ branch: Type.TString;
556
+ head: Type.TString;
557
+ index: Type.TString;
558
+ tree: Type.TString;
559
+ }>>;
560
+ instruction: Type.TOptional<Type.TString>;
561
+ failure: Type.TOptional<Type.TString>;
562
+ at: Type.TInteger;
563
+ }>>;
564
+ candidate: Type.TOptional<Type.TObject<{
565
+ branch: Type.TString;
566
+ head: Type.TString;
567
+ index: Type.TString;
568
+ tree: Type.TString;
569
+ }>>;
570
+ candidateBase: Type.TOptional<Type.TObject<{
571
+ branch: Type.TString;
572
+ head: Type.TString;
573
+ index: Type.TString;
574
+ tree: Type.TString;
575
+ }>>;
576
+ preliminaryChecks: Type.TOptional<Type.TObject<{
577
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
578
+ candidate: Type.TObject<{
579
+ branch: Type.TString;
580
+ head: Type.TString;
581
+ index: Type.TString;
582
+ tree: Type.TString;
583
+ }>;
584
+ identityAfter: Type.TObject<{
585
+ branch: Type.TString;
586
+ head: Type.TString;
587
+ index: Type.TString;
588
+ tree: Type.TString;
589
+ }>;
590
+ results: Type.TArray<Type.TObject<{
591
+ command: Type.TString;
592
+ args: Type.TArray<Type.TString>;
593
+ code: Type.TInteger;
594
+ killed: Type.TBoolean;
595
+ stdout: Type.TString;
596
+ stderr: Type.TString;
597
+ }>>;
598
+ passed: Type.TBoolean;
599
+ at: Type.TInteger;
600
+ }>>;
601
+ readiness: Type.TOptional<Type.TObject<{
602
+ candidate: Type.TObject<{
603
+ branch: Type.TString;
604
+ head: Type.TString;
605
+ index: Type.TString;
606
+ tree: Type.TString;
607
+ }>;
608
+ base: Type.TObject<{
609
+ branch: Type.TString;
610
+ head: Type.TString;
611
+ index: Type.TString;
612
+ tree: Type.TString;
613
+ }>;
614
+ at: Type.TInteger;
615
+ }>>;
616
+ superseded: Type.TOptional<Type.TLiteral<true>>;
617
+ termination: Type.TOptional<Type.TObject<{
618
+ status: Type.TUnion<[Type.TLiteral<"terminating">, Type.TLiteral<"terminated">, Type.TLiteral<"unknown">]>;
619
+ workerId: Type.TString;
620
+ candidate: Type.TObject<{
621
+ branch: Type.TString;
622
+ head: Type.TString;
623
+ index: Type.TString;
624
+ tree: Type.TString;
625
+ }>;
626
+ at: Type.TOptional<Type.TInteger>;
627
+ failure: Type.TOptional<Type.TString>;
628
+ }>>;
629
+ preliminaryReview: Type.TOptional<Type.TObject<{
630
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
631
+ criterion: Type.TString;
632
+ base: Type.TObject<{
633
+ branch: Type.TString;
634
+ head: Type.TString;
635
+ index: Type.TString;
636
+ tree: Type.TString;
637
+ }>;
638
+ tip: Type.TObject<{
639
+ branch: Type.TString;
640
+ head: Type.TString;
641
+ index: Type.TString;
642
+ tree: Type.TString;
643
+ }>;
644
+ identityAfter: Type.TObject<{
645
+ branch: Type.TString;
646
+ head: Type.TString;
647
+ index: Type.TString;
648
+ tree: Type.TString;
649
+ }>;
650
+ verdict: Type.TString;
651
+ passed: Type.TBoolean;
652
+ at: Type.TInteger;
653
+ }>>;
654
+ cleanup: Type.TArray<Type.TObject<{
655
+ kind: Type.TUnion<[Type.TLiteral<"worker_tab">, Type.TLiteral<"workspace">, Type.TLiteral<"worktree">, Type.TLiteral<"branch">]>;
656
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">]>;
657
+ failure: Type.TOptional<Type.TString>;
658
+ }>>;
659
+ }>;
660
+ declare const ChangesetTaskStateSchema: Type.TObject<{
661
+ taskId: Type.TString;
662
+ kind: Type.TLiteral<"changeset">;
663
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"allocating">, Type.TLiteral<"working">, Type.TLiteral<"ready_to_integrate">, Type.TLiteral<"integrating">, Type.TLiteral<"cleanup">, Type.TLiteral<"completed">, Type.TLiteral<"rejected">, Type.TLiteral<"needs_attention">]>;
664
+ attempts: Type.TArray<Type.TObject<{
665
+ number: Type.TInteger;
666
+ waveNumber: Type.TInteger;
667
+ waveBase: Type.TObject<{
668
+ branch: Type.TString;
669
+ head: Type.TString;
670
+ index: Type.TString;
671
+ tree: Type.TString;
672
+ }>;
673
+ correlationToken: Type.TString;
674
+ allocationGeneration: Type.TInteger;
675
+ allocations: Type.TArray<Type.TUnion<[Type.TObject<{
676
+ generation: Type.TInteger;
677
+ token: Type.TString;
678
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
679
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
680
+ failure: Type.TOptional<Type.TString>;
681
+ kind: Type.TLiteral<"worktree">;
682
+ worktree: Type.TOptional<Type.TObject<{
683
+ path: Type.TString;
684
+ cwd: Type.TString;
685
+ branch: Type.TString;
686
+ repoRoot: Type.TString;
687
+ baseCommit: Type.TString;
688
+ }>>;
689
+ }>, Type.TObject<{
690
+ generation: Type.TInteger;
691
+ token: Type.TString;
692
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
693
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
694
+ failure: Type.TOptional<Type.TString>;
695
+ kind: Type.TLiteral<"workspace">;
696
+ label: Type.TString;
697
+ worktreeCwd: Type.TString;
698
+ mainRoot: Type.TString;
699
+ repoKey: Type.TString;
700
+ herdrRepoRoot: Type.TString;
701
+ workspaceId: Type.TOptional<Type.TString>;
702
+ rootTabId: Type.TOptional<Type.TString>;
703
+ rootPaneId: Type.TOptional<Type.TString>;
704
+ }>, Type.TObject<{
705
+ generation: Type.TInteger;
706
+ token: Type.TString;
707
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
708
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
709
+ failure: Type.TOptional<Type.TString>;
710
+ kind: Type.TLiteral<"worker_tab">;
711
+ label: Type.TString;
712
+ workspaceId: Type.TString;
713
+ workspaceRootTabId: Type.TString;
714
+ workspaceRootPaneId: Type.TString;
715
+ worktreeCwd: Type.TString;
716
+ leasePath: Type.TString;
717
+ tabId: Type.TOptional<Type.TString>;
718
+ paneId: Type.TOptional<Type.TString>;
719
+ }>, Type.TObject<{
720
+ generation: Type.TInteger;
721
+ token: Type.TString;
722
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
723
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
724
+ failure: Type.TOptional<Type.TString>;
725
+ kind: Type.TLiteral<"agent">;
726
+ agentName: Type.TString;
727
+ workspaceId: Type.TString;
728
+ tabId: Type.TString;
729
+ paneId: Type.TString;
730
+ worktreeCwd: Type.TString;
731
+ leasePath: Type.TString;
732
+ }>]>>;
733
+ prompts: Type.TArray<Type.TObject<{
734
+ kind: Type.TUnion<[Type.TLiteral<"initial">, Type.TLiteral<"correction">, Type.TLiteral<"followup">]>;
735
+ status: Type.TUnion<[Type.TLiteral<"submitting">, Type.TLiteral<"not_sent">, Type.TLiteral<"settled">, Type.TLiteral<"ambiguous">]>;
736
+ preCandidate: Type.TObject<{
737
+ branch: Type.TString;
738
+ head: Type.TString;
739
+ index: Type.TString;
740
+ tree: Type.TString;
741
+ }>;
742
+ candidate: Type.TOptional<Type.TObject<{
743
+ branch: Type.TString;
744
+ head: Type.TString;
745
+ index: Type.TString;
746
+ tree: Type.TString;
747
+ }>>;
748
+ instruction: Type.TOptional<Type.TString>;
749
+ failure: Type.TOptional<Type.TString>;
750
+ at: Type.TInteger;
751
+ }>>;
752
+ candidate: Type.TOptional<Type.TObject<{
753
+ branch: Type.TString;
754
+ head: Type.TString;
755
+ index: Type.TString;
756
+ tree: Type.TString;
757
+ }>>;
758
+ candidateBase: Type.TOptional<Type.TObject<{
759
+ branch: Type.TString;
760
+ head: Type.TString;
761
+ index: Type.TString;
762
+ tree: Type.TString;
763
+ }>>;
764
+ preliminaryChecks: Type.TOptional<Type.TObject<{
765
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
766
+ candidate: Type.TObject<{
767
+ branch: Type.TString;
768
+ head: Type.TString;
769
+ index: Type.TString;
770
+ tree: Type.TString;
771
+ }>;
772
+ identityAfter: Type.TObject<{
773
+ branch: Type.TString;
774
+ head: Type.TString;
775
+ index: Type.TString;
776
+ tree: Type.TString;
777
+ }>;
778
+ results: Type.TArray<Type.TObject<{
779
+ command: Type.TString;
780
+ args: Type.TArray<Type.TString>;
781
+ code: Type.TInteger;
782
+ killed: Type.TBoolean;
783
+ stdout: Type.TString;
784
+ stderr: Type.TString;
785
+ }>>;
786
+ passed: Type.TBoolean;
787
+ at: Type.TInteger;
788
+ }>>;
789
+ readiness: Type.TOptional<Type.TObject<{
790
+ candidate: Type.TObject<{
791
+ branch: Type.TString;
792
+ head: Type.TString;
793
+ index: Type.TString;
794
+ tree: Type.TString;
795
+ }>;
796
+ base: Type.TObject<{
797
+ branch: Type.TString;
798
+ head: Type.TString;
799
+ index: Type.TString;
800
+ tree: Type.TString;
801
+ }>;
802
+ at: Type.TInteger;
803
+ }>>;
804
+ superseded: Type.TOptional<Type.TLiteral<true>>;
805
+ termination: Type.TOptional<Type.TObject<{
806
+ status: Type.TUnion<[Type.TLiteral<"terminating">, Type.TLiteral<"terminated">, Type.TLiteral<"unknown">]>;
807
+ workerId: Type.TString;
808
+ candidate: Type.TObject<{
809
+ branch: Type.TString;
810
+ head: Type.TString;
811
+ index: Type.TString;
812
+ tree: Type.TString;
813
+ }>;
814
+ at: Type.TOptional<Type.TInteger>;
815
+ failure: Type.TOptional<Type.TString>;
816
+ }>>;
817
+ preliminaryReview: Type.TOptional<Type.TObject<{
818
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
819
+ criterion: Type.TString;
820
+ base: Type.TObject<{
821
+ branch: Type.TString;
822
+ head: Type.TString;
823
+ index: Type.TString;
824
+ tree: Type.TString;
825
+ }>;
826
+ tip: Type.TObject<{
827
+ branch: Type.TString;
828
+ head: Type.TString;
829
+ index: Type.TString;
830
+ tree: Type.TString;
831
+ }>;
832
+ identityAfter: Type.TObject<{
833
+ branch: Type.TString;
834
+ head: Type.TString;
835
+ index: Type.TString;
836
+ tree: Type.TString;
837
+ }>;
838
+ verdict: Type.TString;
839
+ passed: Type.TBoolean;
840
+ at: Type.TInteger;
841
+ }>>;
842
+ cleanup: Type.TArray<Type.TObject<{
843
+ kind: Type.TUnion<[Type.TLiteral<"worker_tab">, Type.TLiteral<"workspace">, Type.TLiteral<"worktree">, Type.TLiteral<"branch">]>;
844
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">]>;
845
+ failure: Type.TOptional<Type.TString>;
846
+ }>>;
847
+ }>>;
848
+ failure: Type.TOptional<Type.TString>;
849
+ }>;
850
+ declare const TextTaskAttemptSchema: Type.TObject<{
851
+ number: Type.TInteger;
852
+ status: Type.TUnion<[Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"superseded">]>;
853
+ failure: Type.TOptional<Type.TString>;
854
+ output: Type.TOptional<Type.TObject<{
855
+ text: Type.TString;
856
+ }>>;
857
+ }>;
858
+ declare const TextTaskStateSchema: Type.TObject<{
859
+ taskId: Type.TString;
860
+ kind: Type.TLiteral<"text">;
861
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"needs_attention">]>;
862
+ attempts: Type.TArray<Type.TObject<{
863
+ number: Type.TInteger;
864
+ status: Type.TUnion<[Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"superseded">]>;
865
+ failure: Type.TOptional<Type.TString>;
866
+ output: Type.TOptional<Type.TObject<{
867
+ text: Type.TString;
868
+ }>>;
869
+ }>>;
870
+ failure: Type.TOptional<Type.TString>;
871
+ }>;
872
+ declare const TaskStateSchema: Type.TUnion<[Type.TObject<{
873
+ taskId: Type.TString;
874
+ kind: Type.TLiteral<"text">;
875
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"needs_attention">]>;
876
+ attempts: Type.TArray<Type.TObject<{
877
+ number: Type.TInteger;
878
+ status: Type.TUnion<[Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"superseded">]>;
879
+ failure: Type.TOptional<Type.TString>;
880
+ output: Type.TOptional<Type.TObject<{
881
+ text: Type.TString;
882
+ }>>;
883
+ }>>;
884
+ failure: Type.TOptional<Type.TString>;
885
+ }>, Type.TObject<{
886
+ taskId: Type.TString;
887
+ kind: Type.TLiteral<"changeset">;
888
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"allocating">, Type.TLiteral<"working">, Type.TLiteral<"ready_to_integrate">, Type.TLiteral<"integrating">, Type.TLiteral<"cleanup">, Type.TLiteral<"completed">, Type.TLiteral<"rejected">, Type.TLiteral<"needs_attention">]>;
889
+ attempts: Type.TArray<Type.TObject<{
890
+ number: Type.TInteger;
891
+ waveNumber: Type.TInteger;
892
+ waveBase: Type.TObject<{
893
+ branch: Type.TString;
894
+ head: Type.TString;
895
+ index: Type.TString;
896
+ tree: Type.TString;
897
+ }>;
898
+ correlationToken: Type.TString;
899
+ allocationGeneration: Type.TInteger;
900
+ allocations: Type.TArray<Type.TUnion<[Type.TObject<{
901
+ generation: Type.TInteger;
902
+ token: Type.TString;
903
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
904
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
905
+ failure: Type.TOptional<Type.TString>;
906
+ kind: Type.TLiteral<"worktree">;
907
+ worktree: Type.TOptional<Type.TObject<{
908
+ path: Type.TString;
909
+ cwd: Type.TString;
910
+ branch: Type.TString;
911
+ repoRoot: Type.TString;
912
+ baseCommit: Type.TString;
913
+ }>>;
914
+ }>, Type.TObject<{
915
+ generation: Type.TInteger;
916
+ token: Type.TString;
917
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
918
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
919
+ failure: Type.TOptional<Type.TString>;
920
+ kind: Type.TLiteral<"workspace">;
921
+ label: Type.TString;
922
+ worktreeCwd: Type.TString;
923
+ mainRoot: Type.TString;
924
+ repoKey: Type.TString;
925
+ herdrRepoRoot: Type.TString;
926
+ workspaceId: Type.TOptional<Type.TString>;
927
+ rootTabId: Type.TOptional<Type.TString>;
928
+ rootPaneId: Type.TOptional<Type.TString>;
929
+ }>, Type.TObject<{
930
+ generation: Type.TInteger;
931
+ token: Type.TString;
932
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
933
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
934
+ failure: Type.TOptional<Type.TString>;
935
+ kind: Type.TLiteral<"worker_tab">;
936
+ label: Type.TString;
937
+ workspaceId: Type.TString;
938
+ workspaceRootTabId: Type.TString;
939
+ workspaceRootPaneId: Type.TString;
940
+ worktreeCwd: Type.TString;
941
+ leasePath: Type.TString;
942
+ tabId: Type.TOptional<Type.TString>;
943
+ paneId: Type.TOptional<Type.TString>;
944
+ }>, Type.TObject<{
945
+ generation: Type.TInteger;
946
+ token: Type.TString;
947
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
948
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
949
+ failure: Type.TOptional<Type.TString>;
950
+ kind: Type.TLiteral<"agent">;
951
+ agentName: Type.TString;
952
+ workspaceId: Type.TString;
953
+ tabId: Type.TString;
954
+ paneId: Type.TString;
955
+ worktreeCwd: Type.TString;
956
+ leasePath: Type.TString;
957
+ }>]>>;
958
+ prompts: Type.TArray<Type.TObject<{
959
+ kind: Type.TUnion<[Type.TLiteral<"initial">, Type.TLiteral<"correction">, Type.TLiteral<"followup">]>;
960
+ status: Type.TUnion<[Type.TLiteral<"submitting">, Type.TLiteral<"not_sent">, Type.TLiteral<"settled">, Type.TLiteral<"ambiguous">]>;
961
+ preCandidate: Type.TObject<{
962
+ branch: Type.TString;
963
+ head: Type.TString;
964
+ index: Type.TString;
965
+ tree: Type.TString;
966
+ }>;
967
+ candidate: Type.TOptional<Type.TObject<{
968
+ branch: Type.TString;
969
+ head: Type.TString;
970
+ index: Type.TString;
971
+ tree: Type.TString;
972
+ }>>;
973
+ instruction: Type.TOptional<Type.TString>;
974
+ failure: Type.TOptional<Type.TString>;
975
+ at: Type.TInteger;
976
+ }>>;
977
+ candidate: Type.TOptional<Type.TObject<{
978
+ branch: Type.TString;
979
+ head: Type.TString;
980
+ index: Type.TString;
981
+ tree: Type.TString;
982
+ }>>;
983
+ candidateBase: Type.TOptional<Type.TObject<{
984
+ branch: Type.TString;
985
+ head: Type.TString;
986
+ index: Type.TString;
987
+ tree: Type.TString;
988
+ }>>;
989
+ preliminaryChecks: Type.TOptional<Type.TObject<{
990
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
991
+ candidate: Type.TObject<{
992
+ branch: Type.TString;
993
+ head: Type.TString;
994
+ index: Type.TString;
995
+ tree: Type.TString;
996
+ }>;
997
+ identityAfter: Type.TObject<{
998
+ branch: Type.TString;
999
+ head: Type.TString;
1000
+ index: Type.TString;
1001
+ tree: Type.TString;
1002
+ }>;
1003
+ results: Type.TArray<Type.TObject<{
1004
+ command: Type.TString;
1005
+ args: Type.TArray<Type.TString>;
1006
+ code: Type.TInteger;
1007
+ killed: Type.TBoolean;
1008
+ stdout: Type.TString;
1009
+ stderr: Type.TString;
1010
+ }>>;
1011
+ passed: Type.TBoolean;
1012
+ at: Type.TInteger;
1013
+ }>>;
1014
+ readiness: Type.TOptional<Type.TObject<{
1015
+ candidate: Type.TObject<{
1016
+ branch: Type.TString;
1017
+ head: Type.TString;
1018
+ index: Type.TString;
1019
+ tree: Type.TString;
1020
+ }>;
1021
+ base: Type.TObject<{
1022
+ branch: Type.TString;
1023
+ head: Type.TString;
1024
+ index: Type.TString;
1025
+ tree: Type.TString;
1026
+ }>;
1027
+ at: Type.TInteger;
1028
+ }>>;
1029
+ superseded: Type.TOptional<Type.TLiteral<true>>;
1030
+ termination: Type.TOptional<Type.TObject<{
1031
+ status: Type.TUnion<[Type.TLiteral<"terminating">, Type.TLiteral<"terminated">, Type.TLiteral<"unknown">]>;
1032
+ workerId: Type.TString;
1033
+ candidate: Type.TObject<{
1034
+ branch: Type.TString;
1035
+ head: Type.TString;
1036
+ index: Type.TString;
1037
+ tree: Type.TString;
1038
+ }>;
1039
+ at: Type.TOptional<Type.TInteger>;
1040
+ failure: Type.TOptional<Type.TString>;
1041
+ }>>;
1042
+ preliminaryReview: Type.TOptional<Type.TObject<{
1043
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1044
+ criterion: Type.TString;
1045
+ base: Type.TObject<{
1046
+ branch: Type.TString;
1047
+ head: Type.TString;
1048
+ index: Type.TString;
1049
+ tree: Type.TString;
1050
+ }>;
1051
+ tip: Type.TObject<{
1052
+ branch: Type.TString;
1053
+ head: Type.TString;
1054
+ index: Type.TString;
1055
+ tree: Type.TString;
1056
+ }>;
1057
+ identityAfter: Type.TObject<{
1058
+ branch: Type.TString;
1059
+ head: Type.TString;
1060
+ index: Type.TString;
1061
+ tree: Type.TString;
1062
+ }>;
1063
+ verdict: Type.TString;
1064
+ passed: Type.TBoolean;
1065
+ at: Type.TInteger;
1066
+ }>>;
1067
+ cleanup: Type.TArray<Type.TObject<{
1068
+ kind: Type.TUnion<[Type.TLiteral<"worker_tab">, Type.TLiteral<"workspace">, Type.TLiteral<"worktree">, Type.TLiteral<"branch">]>;
1069
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">]>;
1070
+ failure: Type.TOptional<Type.TString>;
1071
+ }>>;
1072
+ }>>;
1073
+ failure: Type.TOptional<Type.TString>;
1074
+ }>]>;
1075
+ declare const WaveStateSchema: Type.TObject<{
1076
+ number: Type.TInteger;
1077
+ base: Type.TObject<{
1078
+ branch: Type.TString;
1079
+ head: Type.TString;
1080
+ index: Type.TString;
1081
+ tree: Type.TString;
1082
+ }>;
1083
+ taskIds: Type.TArray<Type.TString>;
1084
+ status: Type.TUnion<[Type.TLiteral<"dispatching">, Type.TLiteral<"integrating">, Type.TLiteral<"completed">, Type.TLiteral<"needs_attention">]>;
1085
+ }>;
1086
+ declare const IntegrationCandidateSchema: Type.TObject<{
1087
+ taskId: Type.TString;
1088
+ attempt: Type.TInteger;
1089
+ base: Type.TObject<{
1090
+ branch: Type.TString;
1091
+ head: Type.TString;
1092
+ index: Type.TString;
1093
+ tree: Type.TString;
1094
+ }>;
1095
+ tip: Type.TObject<{
1096
+ branch: Type.TString;
1097
+ head: Type.TString;
1098
+ index: Type.TString;
1099
+ tree: Type.TString;
1100
+ }>;
1101
+ checks: Type.TObject<{
1102
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1103
+ candidate: Type.TObject<{
1104
+ branch: Type.TString;
1105
+ head: Type.TString;
1106
+ index: Type.TString;
1107
+ tree: Type.TString;
1108
+ }>;
1109
+ identityAfter: Type.TObject<{
1110
+ branch: Type.TString;
1111
+ head: Type.TString;
1112
+ index: Type.TString;
1113
+ tree: Type.TString;
1114
+ }>;
1115
+ results: Type.TArray<Type.TObject<{
1116
+ command: Type.TString;
1117
+ args: Type.TArray<Type.TString>;
1118
+ code: Type.TInteger;
1119
+ killed: Type.TBoolean;
1120
+ stdout: Type.TString;
1121
+ stderr: Type.TString;
1122
+ }>>;
1123
+ passed: Type.TBoolean;
1124
+ at: Type.TInteger;
1125
+ }>;
1126
+ review: Type.TOptional<Type.TObject<{
1127
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1128
+ criterion: Type.TString;
1129
+ base: Type.TObject<{
1130
+ branch: Type.TString;
1131
+ head: Type.TString;
1132
+ index: Type.TString;
1133
+ tree: Type.TString;
1134
+ }>;
1135
+ tip: Type.TObject<{
1136
+ branch: Type.TString;
1137
+ head: Type.TString;
1138
+ index: Type.TString;
1139
+ tree: Type.TString;
1140
+ }>;
1141
+ identityAfter: Type.TObject<{
1142
+ branch: Type.TString;
1143
+ head: Type.TString;
1144
+ index: Type.TString;
1145
+ tree: Type.TString;
1146
+ }>;
1147
+ verdict: Type.TString;
1148
+ passed: Type.TBoolean;
1149
+ at: Type.TInteger;
1150
+ }>>;
1151
+ worker: Type.TUnion<[Type.TLiteral<"retained">, Type.TLiteral<"release_pending">, Type.TLiteral<"released">]>;
1152
+ decision: Type.TOptional<Type.TLiteral<"rejected">>;
1153
+ }>;
1154
+ declare const IntegrationStageSchema: Type.TObject<{
1155
+ taskId: Type.TString;
1156
+ attempt: Type.TInteger;
1157
+ source: Type.TObject<{
1158
+ branch: Type.TString;
1159
+ head: Type.TString;
1160
+ index: Type.TString;
1161
+ tree: Type.TString;
1162
+ }>;
1163
+ onto: Type.TObject<{
1164
+ branch: Type.TString;
1165
+ head: Type.TString;
1166
+ index: Type.TString;
1167
+ tree: Type.TString;
1168
+ }>;
1169
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"staging">, Type.TLiteral<"staged">, Type.TLiteral<"conflict">]>;
1170
+ tip: Type.TOptional<Type.TObject<{
1171
+ branch: Type.TString;
1172
+ head: Type.TString;
1173
+ index: Type.TString;
1174
+ tree: Type.TString;
1175
+ }>>;
1176
+ failure: Type.TOptional<Type.TString>;
1177
+ }>;
1178
+ declare const IntegrationGenerationSchema: Type.TObject<{
1179
+ number: Type.TInteger;
1180
+ status: Type.TUnion<[Type.TLiteral<"staging">, Type.TLiteral<"conflict">, Type.TLiteral<"validating">, Type.TLiteral<"validation_failed">, Type.TLiteral<"ready">, Type.TLiteral<"promoting">, Type.TLiteral<"promoted">, Type.TLiteral<"promotion_unknown">, Type.TLiteral<"promotion_failed">, Type.TLiteral<"superseded">]>;
1181
+ expectedMain: Type.TObject<{
1182
+ branch: Type.TString;
1183
+ head: Type.TString;
1184
+ index: Type.TString;
1185
+ tree: Type.TString;
1186
+ }>;
1187
+ integrationBase: Type.TObject<{
1188
+ branch: Type.TString;
1189
+ head: Type.TString;
1190
+ index: Type.TString;
1191
+ tree: Type.TString;
1192
+ }>;
1193
+ order: Type.TArray<Type.TString>;
1194
+ stages: Type.TArray<Type.TObject<{
1195
+ taskId: Type.TString;
1196
+ attempt: Type.TInteger;
1197
+ source: Type.TObject<{
1198
+ branch: Type.TString;
1199
+ head: Type.TString;
1200
+ index: Type.TString;
1201
+ tree: Type.TString;
1202
+ }>;
1203
+ onto: Type.TObject<{
1204
+ branch: Type.TString;
1205
+ head: Type.TString;
1206
+ index: Type.TString;
1207
+ tree: Type.TString;
1208
+ }>;
1209
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"staging">, Type.TLiteral<"staged">, Type.TLiteral<"conflict">]>;
1210
+ tip: Type.TOptional<Type.TObject<{
1211
+ branch: Type.TString;
1212
+ head: Type.TString;
1213
+ index: Type.TString;
1214
+ tree: Type.TString;
1215
+ }>>;
1216
+ failure: Type.TOptional<Type.TString>;
1217
+ }>>;
1218
+ worktree: Type.TOptional<Type.TObject<{
1219
+ path: Type.TString;
1220
+ cwd: Type.TString;
1221
+ branch: Type.TString;
1222
+ repoRoot: Type.TString;
1223
+ baseCommit: Type.TString;
1224
+ }>>;
1225
+ combinedTip: Type.TOptional<Type.TObject<{
1226
+ branch: Type.TString;
1227
+ head: Type.TString;
1228
+ index: Type.TString;
1229
+ tree: Type.TString;
1230
+ }>>;
1231
+ correction: Type.TOptional<Type.TObject<{
1232
+ from: Type.TObject<{
1233
+ branch: Type.TString;
1234
+ head: Type.TString;
1235
+ index: Type.TString;
1236
+ tree: Type.TString;
1237
+ }>;
1238
+ to: Type.TObject<{
1239
+ branch: Type.TString;
1240
+ head: Type.TString;
1241
+ index: Type.TString;
1242
+ tree: Type.TString;
1243
+ }>;
1244
+ }>>;
1245
+ checks: Type.TOptional<Type.TObject<{
1246
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1247
+ candidate: Type.TObject<{
1248
+ branch: Type.TString;
1249
+ head: Type.TString;
1250
+ index: Type.TString;
1251
+ tree: Type.TString;
1252
+ }>;
1253
+ identityAfter: Type.TObject<{
1254
+ branch: Type.TString;
1255
+ head: Type.TString;
1256
+ index: Type.TString;
1257
+ tree: Type.TString;
1258
+ }>;
1259
+ results: Type.TArray<Type.TObject<{
1260
+ command: Type.TString;
1261
+ args: Type.TArray<Type.TString>;
1262
+ code: Type.TInteger;
1263
+ killed: Type.TBoolean;
1264
+ stdout: Type.TString;
1265
+ stderr: Type.TString;
1266
+ }>>;
1267
+ passed: Type.TBoolean;
1268
+ at: Type.TInteger;
1269
+ }>>;
1270
+ review: Type.TOptional<Type.TObject<{
1271
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1272
+ criterion: Type.TString;
1273
+ base: Type.TObject<{
1274
+ branch: Type.TString;
1275
+ head: Type.TString;
1276
+ index: Type.TString;
1277
+ tree: Type.TString;
1278
+ }>;
1279
+ tip: Type.TObject<{
1280
+ branch: Type.TString;
1281
+ head: Type.TString;
1282
+ index: Type.TString;
1283
+ tree: Type.TString;
1284
+ }>;
1285
+ identityAfter: Type.TObject<{
1286
+ branch: Type.TString;
1287
+ head: Type.TString;
1288
+ index: Type.TString;
1289
+ tree: Type.TString;
1290
+ }>;
1291
+ verdict: Type.TString;
1292
+ passed: Type.TBoolean;
1293
+ at: Type.TInteger;
1294
+ }>>;
1295
+ promotion: Type.TOptional<Type.TObject<{
1296
+ status: Type.TUnion<[Type.TLiteral<"promoting">, Type.TLiteral<"promoted">, Type.TLiteral<"unknown">, Type.TLiteral<"failed">]>;
1297
+ expectedMain: Type.TObject<{
1298
+ branch: Type.TString;
1299
+ head: Type.TString;
1300
+ index: Type.TString;
1301
+ tree: Type.TString;
1302
+ }>;
1303
+ tip: Type.TObject<{
1304
+ branch: Type.TString;
1305
+ head: Type.TString;
1306
+ index: Type.TString;
1307
+ tree: Type.TString;
1308
+ }>;
1309
+ mainAfter: Type.TOptional<Type.TObject<{
1310
+ branch: Type.TString;
1311
+ head: Type.TString;
1312
+ index: Type.TString;
1313
+ tree: Type.TString;
1314
+ }>>;
1315
+ outcome: Type.TOptional<Type.TLiteral<"drift">>;
1316
+ failure: Type.TOptional<Type.TString>;
1317
+ }>>;
1318
+ supersededPromotion: Type.TOptional<Type.TObject<{
1319
+ status: Type.TUnion<[Type.TLiteral<"promoting">, Type.TLiteral<"promoted">, Type.TLiteral<"unknown">, Type.TLiteral<"failed">]>;
1320
+ expectedMain: Type.TObject<{
1321
+ branch: Type.TString;
1322
+ head: Type.TString;
1323
+ index: Type.TString;
1324
+ tree: Type.TString;
1325
+ }>;
1326
+ tip: Type.TObject<{
1327
+ branch: Type.TString;
1328
+ head: Type.TString;
1329
+ index: Type.TString;
1330
+ tree: Type.TString;
1331
+ }>;
1332
+ mainAfter: Type.TOptional<Type.TObject<{
1333
+ branch: Type.TString;
1334
+ head: Type.TString;
1335
+ index: Type.TString;
1336
+ tree: Type.TString;
1337
+ }>>;
1338
+ outcome: Type.TOptional<Type.TLiteral<"drift">>;
1339
+ failure: Type.TOptional<Type.TString>;
1340
+ }>>;
1341
+ cleanup: Type.TOptional<Type.TArray<Type.TObject<{
1342
+ kind: Type.TUnion<[Type.TLiteral<"worker_tab">, Type.TLiteral<"workspace">, Type.TLiteral<"worktree">, Type.TLiteral<"branch">]>;
1343
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">]>;
1344
+ failure: Type.TOptional<Type.TString>;
1345
+ }>>>;
1346
+ supersededFrom: Type.TOptional<Type.TUnion<[Type.TLiteral<"staging">, Type.TLiteral<"conflict">, Type.TLiteral<"validation_failed">, Type.TLiteral<"ready">, Type.TLiteral<"promotion_failed">]>>;
1347
+ failure: Type.TOptional<Type.TString>;
1348
+ }>;
1349
+ export declare const IntegrationStateSchema: Type.TObject<{
1350
+ candidates: Type.TArray<Type.TObject<{
1351
+ taskId: Type.TString;
1352
+ attempt: Type.TInteger;
1353
+ base: Type.TObject<{
1354
+ branch: Type.TString;
1355
+ head: Type.TString;
1356
+ index: Type.TString;
1357
+ tree: Type.TString;
1358
+ }>;
1359
+ tip: Type.TObject<{
1360
+ branch: Type.TString;
1361
+ head: Type.TString;
1362
+ index: Type.TString;
1363
+ tree: Type.TString;
1364
+ }>;
1365
+ checks: Type.TObject<{
1366
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1367
+ candidate: Type.TObject<{
1368
+ branch: Type.TString;
1369
+ head: Type.TString;
1370
+ index: Type.TString;
1371
+ tree: Type.TString;
1372
+ }>;
1373
+ identityAfter: Type.TObject<{
1374
+ branch: Type.TString;
1375
+ head: Type.TString;
1376
+ index: Type.TString;
1377
+ tree: Type.TString;
1378
+ }>;
1379
+ results: Type.TArray<Type.TObject<{
1380
+ command: Type.TString;
1381
+ args: Type.TArray<Type.TString>;
1382
+ code: Type.TInteger;
1383
+ killed: Type.TBoolean;
1384
+ stdout: Type.TString;
1385
+ stderr: Type.TString;
1386
+ }>>;
1387
+ passed: Type.TBoolean;
1388
+ at: Type.TInteger;
1389
+ }>;
1390
+ review: Type.TOptional<Type.TObject<{
1391
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1392
+ criterion: Type.TString;
1393
+ base: Type.TObject<{
1394
+ branch: Type.TString;
1395
+ head: Type.TString;
1396
+ index: Type.TString;
1397
+ tree: Type.TString;
1398
+ }>;
1399
+ tip: Type.TObject<{
1400
+ branch: Type.TString;
1401
+ head: Type.TString;
1402
+ index: Type.TString;
1403
+ tree: Type.TString;
1404
+ }>;
1405
+ identityAfter: Type.TObject<{
1406
+ branch: Type.TString;
1407
+ head: Type.TString;
1408
+ index: Type.TString;
1409
+ tree: Type.TString;
1410
+ }>;
1411
+ verdict: Type.TString;
1412
+ passed: Type.TBoolean;
1413
+ at: Type.TInteger;
1414
+ }>>;
1415
+ worker: Type.TUnion<[Type.TLiteral<"retained">, Type.TLiteral<"release_pending">, Type.TLiteral<"released">]>;
1416
+ decision: Type.TOptional<Type.TLiteral<"rejected">>;
1417
+ }>>;
1418
+ generations: Type.TArray<Type.TObject<{
1419
+ number: Type.TInteger;
1420
+ status: Type.TUnion<[Type.TLiteral<"staging">, Type.TLiteral<"conflict">, Type.TLiteral<"validating">, Type.TLiteral<"validation_failed">, Type.TLiteral<"ready">, Type.TLiteral<"promoting">, Type.TLiteral<"promoted">, Type.TLiteral<"promotion_unknown">, Type.TLiteral<"promotion_failed">, Type.TLiteral<"superseded">]>;
1421
+ expectedMain: Type.TObject<{
1422
+ branch: Type.TString;
1423
+ head: Type.TString;
1424
+ index: Type.TString;
1425
+ tree: Type.TString;
1426
+ }>;
1427
+ integrationBase: Type.TObject<{
1428
+ branch: Type.TString;
1429
+ head: Type.TString;
1430
+ index: Type.TString;
1431
+ tree: Type.TString;
1432
+ }>;
1433
+ order: Type.TArray<Type.TString>;
1434
+ stages: Type.TArray<Type.TObject<{
1435
+ taskId: Type.TString;
1436
+ attempt: Type.TInteger;
1437
+ source: Type.TObject<{
1438
+ branch: Type.TString;
1439
+ head: Type.TString;
1440
+ index: Type.TString;
1441
+ tree: Type.TString;
1442
+ }>;
1443
+ onto: Type.TObject<{
1444
+ branch: Type.TString;
1445
+ head: Type.TString;
1446
+ index: Type.TString;
1447
+ tree: Type.TString;
1448
+ }>;
1449
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"staging">, Type.TLiteral<"staged">, Type.TLiteral<"conflict">]>;
1450
+ tip: Type.TOptional<Type.TObject<{
1451
+ branch: Type.TString;
1452
+ head: Type.TString;
1453
+ index: Type.TString;
1454
+ tree: Type.TString;
1455
+ }>>;
1456
+ failure: Type.TOptional<Type.TString>;
1457
+ }>>;
1458
+ worktree: Type.TOptional<Type.TObject<{
1459
+ path: Type.TString;
1460
+ cwd: Type.TString;
1461
+ branch: Type.TString;
1462
+ repoRoot: Type.TString;
1463
+ baseCommit: Type.TString;
1464
+ }>>;
1465
+ combinedTip: Type.TOptional<Type.TObject<{
1466
+ branch: Type.TString;
1467
+ head: Type.TString;
1468
+ index: Type.TString;
1469
+ tree: Type.TString;
1470
+ }>>;
1471
+ correction: Type.TOptional<Type.TObject<{
1472
+ from: Type.TObject<{
1473
+ branch: Type.TString;
1474
+ head: Type.TString;
1475
+ index: Type.TString;
1476
+ tree: Type.TString;
1477
+ }>;
1478
+ to: Type.TObject<{
1479
+ branch: Type.TString;
1480
+ head: Type.TString;
1481
+ index: Type.TString;
1482
+ tree: Type.TString;
1483
+ }>;
1484
+ }>>;
1485
+ checks: Type.TOptional<Type.TObject<{
1486
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1487
+ candidate: Type.TObject<{
1488
+ branch: Type.TString;
1489
+ head: Type.TString;
1490
+ index: Type.TString;
1491
+ tree: Type.TString;
1492
+ }>;
1493
+ identityAfter: Type.TObject<{
1494
+ branch: Type.TString;
1495
+ head: Type.TString;
1496
+ index: Type.TString;
1497
+ tree: Type.TString;
1498
+ }>;
1499
+ results: Type.TArray<Type.TObject<{
1500
+ command: Type.TString;
1501
+ args: Type.TArray<Type.TString>;
1502
+ code: Type.TInteger;
1503
+ killed: Type.TBoolean;
1504
+ stdout: Type.TString;
1505
+ stderr: Type.TString;
1506
+ }>>;
1507
+ passed: Type.TBoolean;
1508
+ at: Type.TInteger;
1509
+ }>>;
1510
+ review: Type.TOptional<Type.TObject<{
1511
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1512
+ criterion: Type.TString;
1513
+ base: Type.TObject<{
1514
+ branch: Type.TString;
1515
+ head: Type.TString;
1516
+ index: Type.TString;
1517
+ tree: Type.TString;
1518
+ }>;
1519
+ tip: Type.TObject<{
1520
+ branch: Type.TString;
1521
+ head: Type.TString;
1522
+ index: Type.TString;
1523
+ tree: Type.TString;
1524
+ }>;
1525
+ identityAfter: Type.TObject<{
1526
+ branch: Type.TString;
1527
+ head: Type.TString;
1528
+ index: Type.TString;
1529
+ tree: Type.TString;
1530
+ }>;
1531
+ verdict: Type.TString;
1532
+ passed: Type.TBoolean;
1533
+ at: Type.TInteger;
1534
+ }>>;
1535
+ promotion: Type.TOptional<Type.TObject<{
1536
+ status: Type.TUnion<[Type.TLiteral<"promoting">, Type.TLiteral<"promoted">, Type.TLiteral<"unknown">, Type.TLiteral<"failed">]>;
1537
+ expectedMain: Type.TObject<{
1538
+ branch: Type.TString;
1539
+ head: Type.TString;
1540
+ index: Type.TString;
1541
+ tree: Type.TString;
1542
+ }>;
1543
+ tip: Type.TObject<{
1544
+ branch: Type.TString;
1545
+ head: Type.TString;
1546
+ index: Type.TString;
1547
+ tree: Type.TString;
1548
+ }>;
1549
+ mainAfter: Type.TOptional<Type.TObject<{
1550
+ branch: Type.TString;
1551
+ head: Type.TString;
1552
+ index: Type.TString;
1553
+ tree: Type.TString;
1554
+ }>>;
1555
+ outcome: Type.TOptional<Type.TLiteral<"drift">>;
1556
+ failure: Type.TOptional<Type.TString>;
1557
+ }>>;
1558
+ supersededPromotion: Type.TOptional<Type.TObject<{
1559
+ status: Type.TUnion<[Type.TLiteral<"promoting">, Type.TLiteral<"promoted">, Type.TLiteral<"unknown">, Type.TLiteral<"failed">]>;
1560
+ expectedMain: Type.TObject<{
1561
+ branch: Type.TString;
1562
+ head: Type.TString;
1563
+ index: Type.TString;
1564
+ tree: Type.TString;
1565
+ }>;
1566
+ tip: Type.TObject<{
1567
+ branch: Type.TString;
1568
+ head: Type.TString;
1569
+ index: Type.TString;
1570
+ tree: Type.TString;
1571
+ }>;
1572
+ mainAfter: Type.TOptional<Type.TObject<{
1573
+ branch: Type.TString;
1574
+ head: Type.TString;
1575
+ index: Type.TString;
1576
+ tree: Type.TString;
1577
+ }>>;
1578
+ outcome: Type.TOptional<Type.TLiteral<"drift">>;
1579
+ failure: Type.TOptional<Type.TString>;
1580
+ }>>;
1581
+ cleanup: Type.TOptional<Type.TArray<Type.TObject<{
1582
+ kind: Type.TUnion<[Type.TLiteral<"worker_tab">, Type.TLiteral<"workspace">, Type.TLiteral<"worktree">, Type.TLiteral<"branch">]>;
1583
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">]>;
1584
+ failure: Type.TOptional<Type.TString>;
1585
+ }>>>;
1586
+ supersededFrom: Type.TOptional<Type.TUnion<[Type.TLiteral<"staging">, Type.TLiteral<"conflict">, Type.TLiteral<"validation_failed">, Type.TLiteral<"ready">, Type.TLiteral<"promotion_failed">]>>;
1587
+ failure: Type.TOptional<Type.TString>;
1588
+ }>>;
1589
+ refresh: Type.TOptional<Type.TObject<{
1590
+ from: Type.TObject<{
1591
+ branch: Type.TString;
1592
+ head: Type.TString;
1593
+ index: Type.TString;
1594
+ tree: Type.TString;
1595
+ }>;
1596
+ to: Type.TObject<{
1597
+ branch: Type.TString;
1598
+ head: Type.TString;
1599
+ index: Type.TString;
1600
+ tree: Type.TString;
1601
+ }>;
1602
+ generation: Type.TInteger;
1603
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"ready">, Type.TLiteral<"unknown">]>;
1604
+ failure: Type.TOptional<Type.TString>;
1605
+ }>>;
1606
+ }>;
1607
+ export type IntegrationCandidate = Static<typeof IntegrationCandidateSchema>;
1608
+ export type IntegrationStage = Static<typeof IntegrationStageSchema>;
1609
+ export type IntegrationGeneration = Static<typeof IntegrationGenerationSchema>;
1610
+ export type IntegrationState = Static<typeof IntegrationStateSchema>;
1611
+ declare const RunStateSchema: Type.TObject<{
1612
+ version: Type.TLiteral<5>;
1613
+ request: Type.TObject<{
1614
+ mode: Type.TLiteral<"isolated">;
1615
+ id: Type.TString;
1616
+ goal: Type.TString;
1617
+ tasks: Type.TArray<Type.TUnion<[Type.TObject<{
1618
+ role: Type.TString;
1619
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
1620
+ requirements: Type.TString;
1621
+ deliverable: Type.TString;
1622
+ dependsOn: Type.TArray<Type.TString>;
1623
+ contextFrom: Type.TArray<Type.TString>;
1624
+ id: Type.TString;
1625
+ kind: Type.TLiteral<"text">;
1626
+ }>, Type.TObject<{
1627
+ role: Type.TString;
1628
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
1629
+ requirements: Type.TString;
1630
+ deliverable: Type.TString;
1631
+ dependsOn: Type.TArray<Type.TString>;
1632
+ contextFrom: Type.TArray<Type.TString>;
1633
+ id: Type.TString;
1634
+ kind: Type.TLiteral<"changeset">;
1635
+ checks: Type.TArray<Type.TObject<{
1636
+ command: Type.TString;
1637
+ args: Type.TArray<Type.TString>;
1638
+ }>>;
1639
+ judgment: Type.TOptional<Type.TObject<{
1640
+ role: Type.TString;
1641
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
1642
+ criterion: Type.TString;
1643
+ }>>;
1644
+ }>]>>;
1645
+ finalChecks: Type.TOptional<Type.TArray<Type.TObject<{
1646
+ command: Type.TString;
1647
+ args: Type.TArray<Type.TString>;
1648
+ }>>>;
1649
+ finalJudgment: Type.TOptional<Type.TObject<{
1650
+ role: Type.TString;
1651
+ modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
1652
+ criterion: Type.TString;
1653
+ }>>;
1654
+ }>;
1655
+ policy: Type.TObject<{
1656
+ maxSubagents: Type.TInteger;
1657
+ maxTurns: Type.TInteger;
1658
+ maxTokens: Type.TOptional<Type.TInteger>;
1659
+ childIdleMs: Type.TNumber;
1660
+ childMaxMs: Type.TNumber;
1661
+ maxCorrections: Type.TInteger;
1662
+ }>;
1663
+ correctionCount: Type.TInteger;
1664
+ root: Type.TString;
1665
+ requestStartMain: Type.TObject<{
1666
+ branch: Type.TString;
1667
+ head: Type.TString;
1668
+ index: Type.TString;
1669
+ tree: Type.TString;
1670
+ }>;
1671
+ main: Type.TObject<{
1672
+ branch: Type.TString;
1673
+ head: Type.TString;
1674
+ index: Type.TString;
1675
+ tree: Type.TString;
1676
+ }>;
1677
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"needs_attention">, Type.TLiteral<"completed">, Type.TLiteral<"final_failed">, Type.TLiteral<"superseded">, Type.TLiteral<"aborted">]>;
1678
+ tasks: Type.TArray<Type.TUnion<[Type.TObject<{
1679
+ taskId: Type.TString;
1680
+ kind: Type.TLiteral<"text">;
1681
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"needs_attention">]>;
1682
+ attempts: Type.TArray<Type.TObject<{
1683
+ number: Type.TInteger;
1684
+ status: Type.TUnion<[Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"superseded">]>;
1685
+ failure: Type.TOptional<Type.TString>;
1686
+ output: Type.TOptional<Type.TObject<{
1687
+ text: Type.TString;
1688
+ }>>;
1689
+ }>>;
1690
+ failure: Type.TOptional<Type.TString>;
1691
+ }>, Type.TObject<{
1692
+ taskId: Type.TString;
1693
+ kind: Type.TLiteral<"changeset">;
1694
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"allocating">, Type.TLiteral<"working">, Type.TLiteral<"ready_to_integrate">, Type.TLiteral<"integrating">, Type.TLiteral<"cleanup">, Type.TLiteral<"completed">, Type.TLiteral<"rejected">, Type.TLiteral<"needs_attention">]>;
1695
+ attempts: Type.TArray<Type.TObject<{
1696
+ number: Type.TInteger;
1697
+ waveNumber: Type.TInteger;
1698
+ waveBase: Type.TObject<{
1699
+ branch: Type.TString;
1700
+ head: Type.TString;
1701
+ index: Type.TString;
1702
+ tree: Type.TString;
1703
+ }>;
1704
+ correlationToken: Type.TString;
1705
+ allocationGeneration: Type.TInteger;
1706
+ allocations: Type.TArray<Type.TUnion<[Type.TObject<{
1707
+ generation: Type.TInteger;
1708
+ token: Type.TString;
1709
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
1710
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
1711
+ failure: Type.TOptional<Type.TString>;
1712
+ kind: Type.TLiteral<"worktree">;
1713
+ worktree: Type.TOptional<Type.TObject<{
1714
+ path: Type.TString;
1715
+ cwd: Type.TString;
1716
+ branch: Type.TString;
1717
+ repoRoot: Type.TString;
1718
+ baseCommit: Type.TString;
1719
+ }>>;
1720
+ }>, Type.TObject<{
1721
+ generation: Type.TInteger;
1722
+ token: Type.TString;
1723
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
1724
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
1725
+ failure: Type.TOptional<Type.TString>;
1726
+ kind: Type.TLiteral<"workspace">;
1727
+ label: Type.TString;
1728
+ worktreeCwd: Type.TString;
1729
+ mainRoot: Type.TString;
1730
+ repoKey: Type.TString;
1731
+ herdrRepoRoot: Type.TString;
1732
+ workspaceId: Type.TOptional<Type.TString>;
1733
+ rootTabId: Type.TOptional<Type.TString>;
1734
+ rootPaneId: Type.TOptional<Type.TString>;
1735
+ }>, Type.TObject<{
1736
+ generation: Type.TInteger;
1737
+ token: Type.TString;
1738
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
1739
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
1740
+ failure: Type.TOptional<Type.TString>;
1741
+ kind: Type.TLiteral<"worker_tab">;
1742
+ label: Type.TString;
1743
+ workspaceId: Type.TString;
1744
+ workspaceRootTabId: Type.TString;
1745
+ workspaceRootPaneId: Type.TString;
1746
+ worktreeCwd: Type.TString;
1747
+ leasePath: Type.TString;
1748
+ tabId: Type.TOptional<Type.TString>;
1749
+ paneId: Type.TOptional<Type.TString>;
1750
+ }>, Type.TObject<{
1751
+ generation: Type.TInteger;
1752
+ token: Type.TString;
1753
+ status: Type.TUnion<[Type.TLiteral<"allocating">, Type.TLiteral<"owned">, Type.TLiteral<"absent">, Type.TLiteral<"unknown">]>;
1754
+ possibleResources: Type.TOptional<Type.TArray<Type.TString>>;
1755
+ failure: Type.TOptional<Type.TString>;
1756
+ kind: Type.TLiteral<"agent">;
1757
+ agentName: Type.TString;
1758
+ workspaceId: Type.TString;
1759
+ tabId: Type.TString;
1760
+ paneId: Type.TString;
1761
+ worktreeCwd: Type.TString;
1762
+ leasePath: Type.TString;
1763
+ }>]>>;
1764
+ prompts: Type.TArray<Type.TObject<{
1765
+ kind: Type.TUnion<[Type.TLiteral<"initial">, Type.TLiteral<"correction">, Type.TLiteral<"followup">]>;
1766
+ status: Type.TUnion<[Type.TLiteral<"submitting">, Type.TLiteral<"not_sent">, Type.TLiteral<"settled">, Type.TLiteral<"ambiguous">]>;
1767
+ preCandidate: Type.TObject<{
1768
+ branch: Type.TString;
1769
+ head: Type.TString;
1770
+ index: Type.TString;
1771
+ tree: Type.TString;
1772
+ }>;
1773
+ candidate: Type.TOptional<Type.TObject<{
1774
+ branch: Type.TString;
1775
+ head: Type.TString;
1776
+ index: Type.TString;
1777
+ tree: Type.TString;
1778
+ }>>;
1779
+ instruction: Type.TOptional<Type.TString>;
1780
+ failure: Type.TOptional<Type.TString>;
1781
+ at: Type.TInteger;
1782
+ }>>;
1783
+ candidate: Type.TOptional<Type.TObject<{
1784
+ branch: Type.TString;
1785
+ head: Type.TString;
1786
+ index: Type.TString;
1787
+ tree: Type.TString;
1788
+ }>>;
1789
+ candidateBase: Type.TOptional<Type.TObject<{
1790
+ branch: Type.TString;
1791
+ head: Type.TString;
1792
+ index: Type.TString;
1793
+ tree: Type.TString;
1794
+ }>>;
1795
+ preliminaryChecks: Type.TOptional<Type.TObject<{
1796
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1797
+ candidate: Type.TObject<{
1798
+ branch: Type.TString;
1799
+ head: Type.TString;
1800
+ index: Type.TString;
1801
+ tree: Type.TString;
1802
+ }>;
1803
+ identityAfter: Type.TObject<{
1804
+ branch: Type.TString;
1805
+ head: Type.TString;
1806
+ index: Type.TString;
1807
+ tree: Type.TString;
1808
+ }>;
1809
+ results: Type.TArray<Type.TObject<{
1810
+ command: Type.TString;
1811
+ args: Type.TArray<Type.TString>;
1812
+ code: Type.TInteger;
1813
+ killed: Type.TBoolean;
1814
+ stdout: Type.TString;
1815
+ stderr: Type.TString;
1816
+ }>>;
1817
+ passed: Type.TBoolean;
1818
+ at: Type.TInteger;
1819
+ }>>;
1820
+ readiness: Type.TOptional<Type.TObject<{
1821
+ candidate: Type.TObject<{
1822
+ branch: Type.TString;
1823
+ head: Type.TString;
1824
+ index: Type.TString;
1825
+ tree: Type.TString;
1826
+ }>;
1827
+ base: Type.TObject<{
1828
+ branch: Type.TString;
1829
+ head: Type.TString;
1830
+ index: Type.TString;
1831
+ tree: Type.TString;
1832
+ }>;
1833
+ at: Type.TInteger;
1834
+ }>>;
1835
+ superseded: Type.TOptional<Type.TLiteral<true>>;
1836
+ termination: Type.TOptional<Type.TObject<{
1837
+ status: Type.TUnion<[Type.TLiteral<"terminating">, Type.TLiteral<"terminated">, Type.TLiteral<"unknown">]>;
1838
+ workerId: Type.TString;
1839
+ candidate: Type.TObject<{
1840
+ branch: Type.TString;
1841
+ head: Type.TString;
1842
+ index: Type.TString;
1843
+ tree: Type.TString;
1844
+ }>;
1845
+ at: Type.TOptional<Type.TInteger>;
1846
+ failure: Type.TOptional<Type.TString>;
1847
+ }>>;
1848
+ preliminaryReview: Type.TOptional<Type.TObject<{
1849
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1850
+ criterion: Type.TString;
1851
+ base: Type.TObject<{
1852
+ branch: Type.TString;
1853
+ head: Type.TString;
1854
+ index: Type.TString;
1855
+ tree: Type.TString;
1856
+ }>;
1857
+ tip: Type.TObject<{
1858
+ branch: Type.TString;
1859
+ head: Type.TString;
1860
+ index: Type.TString;
1861
+ tree: Type.TString;
1862
+ }>;
1863
+ identityAfter: Type.TObject<{
1864
+ branch: Type.TString;
1865
+ head: Type.TString;
1866
+ index: Type.TString;
1867
+ tree: Type.TString;
1868
+ }>;
1869
+ verdict: Type.TString;
1870
+ passed: Type.TBoolean;
1871
+ at: Type.TInteger;
1872
+ }>>;
1873
+ cleanup: Type.TArray<Type.TObject<{
1874
+ kind: Type.TUnion<[Type.TLiteral<"worker_tab">, Type.TLiteral<"workspace">, Type.TLiteral<"worktree">, Type.TLiteral<"branch">]>;
1875
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">]>;
1876
+ failure: Type.TOptional<Type.TString>;
1877
+ }>>;
1878
+ }>>;
1879
+ failure: Type.TOptional<Type.TString>;
1880
+ }>]>>;
1881
+ waves: Type.TArray<Type.TObject<{
1882
+ number: Type.TInteger;
1883
+ base: Type.TObject<{
1884
+ branch: Type.TString;
1885
+ head: Type.TString;
1886
+ index: Type.TString;
1887
+ tree: Type.TString;
1888
+ }>;
1889
+ taskIds: Type.TArray<Type.TString>;
1890
+ status: Type.TUnion<[Type.TLiteral<"dispatching">, Type.TLiteral<"integrating">, Type.TLiteral<"completed">, Type.TLiteral<"needs_attention">]>;
1891
+ }>>;
1892
+ integration: Type.TObject<{
1893
+ candidates: Type.TArray<Type.TObject<{
1894
+ taskId: Type.TString;
1895
+ attempt: Type.TInteger;
1896
+ base: Type.TObject<{
1897
+ branch: Type.TString;
1898
+ head: Type.TString;
1899
+ index: Type.TString;
1900
+ tree: Type.TString;
1901
+ }>;
1902
+ tip: Type.TObject<{
1903
+ branch: Type.TString;
1904
+ head: Type.TString;
1905
+ index: Type.TString;
1906
+ tree: Type.TString;
1907
+ }>;
1908
+ checks: Type.TObject<{
1909
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1910
+ candidate: Type.TObject<{
1911
+ branch: Type.TString;
1912
+ head: Type.TString;
1913
+ index: Type.TString;
1914
+ tree: Type.TString;
1915
+ }>;
1916
+ identityAfter: Type.TObject<{
1917
+ branch: Type.TString;
1918
+ head: Type.TString;
1919
+ index: Type.TString;
1920
+ tree: Type.TString;
1921
+ }>;
1922
+ results: Type.TArray<Type.TObject<{
1923
+ command: Type.TString;
1924
+ args: Type.TArray<Type.TString>;
1925
+ code: Type.TInteger;
1926
+ killed: Type.TBoolean;
1927
+ stdout: Type.TString;
1928
+ stderr: Type.TString;
1929
+ }>>;
1930
+ passed: Type.TBoolean;
1931
+ at: Type.TInteger;
1932
+ }>;
1933
+ review: Type.TOptional<Type.TObject<{
1934
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
1935
+ criterion: Type.TString;
1936
+ base: Type.TObject<{
1937
+ branch: Type.TString;
1938
+ head: Type.TString;
1939
+ index: Type.TString;
1940
+ tree: Type.TString;
1941
+ }>;
1942
+ tip: Type.TObject<{
1943
+ branch: Type.TString;
1944
+ head: Type.TString;
1945
+ index: Type.TString;
1946
+ tree: Type.TString;
1947
+ }>;
1948
+ identityAfter: Type.TObject<{
1949
+ branch: Type.TString;
1950
+ head: Type.TString;
1951
+ index: Type.TString;
1952
+ tree: Type.TString;
1953
+ }>;
1954
+ verdict: Type.TString;
1955
+ passed: Type.TBoolean;
1956
+ at: Type.TInteger;
1957
+ }>>;
1958
+ worker: Type.TUnion<[Type.TLiteral<"retained">, Type.TLiteral<"release_pending">, Type.TLiteral<"released">]>;
1959
+ decision: Type.TOptional<Type.TLiteral<"rejected">>;
1960
+ }>>;
1961
+ generations: Type.TArray<Type.TObject<{
1962
+ number: Type.TInteger;
1963
+ status: Type.TUnion<[Type.TLiteral<"staging">, Type.TLiteral<"conflict">, Type.TLiteral<"validating">, Type.TLiteral<"validation_failed">, Type.TLiteral<"ready">, Type.TLiteral<"promoting">, Type.TLiteral<"promoted">, Type.TLiteral<"promotion_unknown">, Type.TLiteral<"promotion_failed">, Type.TLiteral<"superseded">]>;
1964
+ expectedMain: Type.TObject<{
1965
+ branch: Type.TString;
1966
+ head: Type.TString;
1967
+ index: Type.TString;
1968
+ tree: Type.TString;
1969
+ }>;
1970
+ integrationBase: Type.TObject<{
1971
+ branch: Type.TString;
1972
+ head: Type.TString;
1973
+ index: Type.TString;
1974
+ tree: Type.TString;
1975
+ }>;
1976
+ order: Type.TArray<Type.TString>;
1977
+ stages: Type.TArray<Type.TObject<{
1978
+ taskId: Type.TString;
1979
+ attempt: Type.TInteger;
1980
+ source: Type.TObject<{
1981
+ branch: Type.TString;
1982
+ head: Type.TString;
1983
+ index: Type.TString;
1984
+ tree: Type.TString;
1985
+ }>;
1986
+ onto: Type.TObject<{
1987
+ branch: Type.TString;
1988
+ head: Type.TString;
1989
+ index: Type.TString;
1990
+ tree: Type.TString;
1991
+ }>;
1992
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"staging">, Type.TLiteral<"staged">, Type.TLiteral<"conflict">]>;
1993
+ tip: Type.TOptional<Type.TObject<{
1994
+ branch: Type.TString;
1995
+ head: Type.TString;
1996
+ index: Type.TString;
1997
+ tree: Type.TString;
1998
+ }>>;
1999
+ failure: Type.TOptional<Type.TString>;
2000
+ }>>;
2001
+ worktree: Type.TOptional<Type.TObject<{
2002
+ path: Type.TString;
2003
+ cwd: Type.TString;
2004
+ branch: Type.TString;
2005
+ repoRoot: Type.TString;
2006
+ baseCommit: Type.TString;
2007
+ }>>;
2008
+ combinedTip: Type.TOptional<Type.TObject<{
2009
+ branch: Type.TString;
2010
+ head: Type.TString;
2011
+ index: Type.TString;
2012
+ tree: Type.TString;
2013
+ }>>;
2014
+ correction: Type.TOptional<Type.TObject<{
2015
+ from: Type.TObject<{
2016
+ branch: Type.TString;
2017
+ head: Type.TString;
2018
+ index: Type.TString;
2019
+ tree: Type.TString;
2020
+ }>;
2021
+ to: Type.TObject<{
2022
+ branch: Type.TString;
2023
+ head: Type.TString;
2024
+ index: Type.TString;
2025
+ tree: Type.TString;
2026
+ }>;
2027
+ }>>;
2028
+ checks: Type.TOptional<Type.TObject<{
2029
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
2030
+ candidate: Type.TObject<{
2031
+ branch: Type.TString;
2032
+ head: Type.TString;
2033
+ index: Type.TString;
2034
+ tree: Type.TString;
2035
+ }>;
2036
+ identityAfter: Type.TObject<{
2037
+ branch: Type.TString;
2038
+ head: Type.TString;
2039
+ index: Type.TString;
2040
+ tree: Type.TString;
2041
+ }>;
2042
+ results: Type.TArray<Type.TObject<{
2043
+ command: Type.TString;
2044
+ args: Type.TArray<Type.TString>;
2045
+ code: Type.TInteger;
2046
+ killed: Type.TBoolean;
2047
+ stdout: Type.TString;
2048
+ stderr: Type.TString;
2049
+ }>>;
2050
+ passed: Type.TBoolean;
2051
+ at: Type.TInteger;
2052
+ }>>;
2053
+ review: Type.TOptional<Type.TObject<{
2054
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
2055
+ criterion: Type.TString;
2056
+ base: Type.TObject<{
2057
+ branch: Type.TString;
2058
+ head: Type.TString;
2059
+ index: Type.TString;
2060
+ tree: Type.TString;
2061
+ }>;
2062
+ tip: Type.TObject<{
2063
+ branch: Type.TString;
2064
+ head: Type.TString;
2065
+ index: Type.TString;
2066
+ tree: Type.TString;
2067
+ }>;
2068
+ identityAfter: Type.TObject<{
2069
+ branch: Type.TString;
2070
+ head: Type.TString;
2071
+ index: Type.TString;
2072
+ tree: Type.TString;
2073
+ }>;
2074
+ verdict: Type.TString;
2075
+ passed: Type.TBoolean;
2076
+ at: Type.TInteger;
2077
+ }>>;
2078
+ promotion: Type.TOptional<Type.TObject<{
2079
+ status: Type.TUnion<[Type.TLiteral<"promoting">, Type.TLiteral<"promoted">, Type.TLiteral<"unknown">, Type.TLiteral<"failed">]>;
2080
+ expectedMain: Type.TObject<{
2081
+ branch: Type.TString;
2082
+ head: Type.TString;
2083
+ index: Type.TString;
2084
+ tree: Type.TString;
2085
+ }>;
2086
+ tip: Type.TObject<{
2087
+ branch: Type.TString;
2088
+ head: Type.TString;
2089
+ index: Type.TString;
2090
+ tree: Type.TString;
2091
+ }>;
2092
+ mainAfter: Type.TOptional<Type.TObject<{
2093
+ branch: Type.TString;
2094
+ head: Type.TString;
2095
+ index: Type.TString;
2096
+ tree: Type.TString;
2097
+ }>>;
2098
+ outcome: Type.TOptional<Type.TLiteral<"drift">>;
2099
+ failure: Type.TOptional<Type.TString>;
2100
+ }>>;
2101
+ supersededPromotion: Type.TOptional<Type.TObject<{
2102
+ status: Type.TUnion<[Type.TLiteral<"promoting">, Type.TLiteral<"promoted">, Type.TLiteral<"unknown">, Type.TLiteral<"failed">]>;
2103
+ expectedMain: Type.TObject<{
2104
+ branch: Type.TString;
2105
+ head: Type.TString;
2106
+ index: Type.TString;
2107
+ tree: Type.TString;
2108
+ }>;
2109
+ tip: Type.TObject<{
2110
+ branch: Type.TString;
2111
+ head: Type.TString;
2112
+ index: Type.TString;
2113
+ tree: Type.TString;
2114
+ }>;
2115
+ mainAfter: Type.TOptional<Type.TObject<{
2116
+ branch: Type.TString;
2117
+ head: Type.TString;
2118
+ index: Type.TString;
2119
+ tree: Type.TString;
2120
+ }>>;
2121
+ outcome: Type.TOptional<Type.TLiteral<"drift">>;
2122
+ failure: Type.TOptional<Type.TString>;
2123
+ }>>;
2124
+ cleanup: Type.TOptional<Type.TArray<Type.TObject<{
2125
+ kind: Type.TUnion<[Type.TLiteral<"worker_tab">, Type.TLiteral<"workspace">, Type.TLiteral<"worktree">, Type.TLiteral<"branch">]>;
2126
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"completed">]>;
2127
+ failure: Type.TOptional<Type.TString>;
2128
+ }>>>;
2129
+ supersededFrom: Type.TOptional<Type.TUnion<[Type.TLiteral<"staging">, Type.TLiteral<"conflict">, Type.TLiteral<"validation_failed">, Type.TLiteral<"ready">, Type.TLiteral<"promotion_failed">]>>;
2130
+ failure: Type.TOptional<Type.TString>;
2131
+ }>>;
2132
+ refresh: Type.TOptional<Type.TObject<{
2133
+ from: Type.TObject<{
2134
+ branch: Type.TString;
2135
+ head: Type.TString;
2136
+ index: Type.TString;
2137
+ tree: Type.TString;
2138
+ }>;
2139
+ to: Type.TObject<{
2140
+ branch: Type.TString;
2141
+ head: Type.TString;
2142
+ index: Type.TString;
2143
+ tree: Type.TString;
2144
+ }>;
2145
+ generation: Type.TInteger;
2146
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"ready">, Type.TLiteral<"unknown">]>;
2147
+ failure: Type.TOptional<Type.TString>;
2148
+ }>>;
2149
+ }>;
2150
+ final: Type.TObject<{
2151
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"running">, Type.TLiteral<"interrupted">, Type.TLiteral<"passed">, Type.TLiteral<"final_failed">, Type.TLiteral<"superseded">]>;
2152
+ identity: Type.TOptional<Type.TObject<{
2153
+ branch: Type.TString;
2154
+ head: Type.TString;
2155
+ index: Type.TString;
2156
+ tree: Type.TString;
2157
+ }>>;
2158
+ checks: Type.TOptional<Type.TObject<{
2159
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
2160
+ candidate: Type.TObject<{
2161
+ branch: Type.TString;
2162
+ head: Type.TString;
2163
+ index: Type.TString;
2164
+ tree: Type.TString;
2165
+ }>;
2166
+ identityAfter: Type.TObject<{
2167
+ branch: Type.TString;
2168
+ head: Type.TString;
2169
+ index: Type.TString;
2170
+ tree: Type.TString;
2171
+ }>;
2172
+ results: Type.TArray<Type.TObject<{
2173
+ command: Type.TString;
2174
+ args: Type.TArray<Type.TString>;
2175
+ code: Type.TInteger;
2176
+ killed: Type.TBoolean;
2177
+ stdout: Type.TString;
2178
+ stderr: Type.TString;
2179
+ }>>;
2180
+ passed: Type.TBoolean;
2181
+ at: Type.TInteger;
2182
+ }>>;
2183
+ review: Type.TOptional<Type.TObject<{
2184
+ phase: Type.TUnion<[Type.TLiteral<"preliminary">, Type.TLiteral<"final">]>;
2185
+ criterion: Type.TString;
2186
+ base: Type.TObject<{
2187
+ branch: Type.TString;
2188
+ head: Type.TString;
2189
+ index: Type.TString;
2190
+ tree: Type.TString;
2191
+ }>;
2192
+ tip: Type.TObject<{
2193
+ branch: Type.TString;
2194
+ head: Type.TString;
2195
+ index: Type.TString;
2196
+ tree: Type.TString;
2197
+ }>;
2198
+ identityAfter: Type.TObject<{
2199
+ branch: Type.TString;
2200
+ head: Type.TString;
2201
+ index: Type.TString;
2202
+ tree: Type.TString;
2203
+ }>;
2204
+ verdict: Type.TString;
2205
+ passed: Type.TBoolean;
2206
+ at: Type.TInteger;
2207
+ }>>;
2208
+ failure: Type.TOptional<Type.TString>;
2209
+ }>;
2210
+ recovery: Type.TOptional<Type.TObject<{
2211
+ kind: Type.TLiteral<"resume">;
2212
+ action: Type.TUnion<[Type.TLiteral<"retry">, Type.TLiteral<"verify">, Type.TLiteral<"finalize">]>;
2213
+ taskId: Type.TOptional<Type.TString>;
2214
+ }>>;
2215
+ accepted: Type.TBoolean;
2216
+ acceptedAt: Type.TOptional<Type.TInteger>;
2217
+ createdAt: Type.TInteger;
2218
+ updatedAt: Type.TInteger;
2219
+ }>;
2220
+ export declare function taskDependencies(task: TaskRequest): string[];
2221
+ export declare function validateGraph(tasks: readonly TaskRequest[]): void;
2222
+ export declare function parseExecuteRequest(value: unknown): ExecuteRequest;
2223
+ export declare function parseIdOnly(value: unknown): IdOnly;
2224
+ export declare function parseResumeRequest(value: unknown): ResumeRequest;
2225
+ export declare function sameIdentity(left: WorkspaceIdentity, right: WorkspaceIdentity): boolean;
2226
+ export declare function isCleanCommitted(identity: WorkspaceIdentity): boolean;
2227
+ export declare function checkBatchPasses(evidence: CheckBatchEvidence | undefined, checks: readonly CheckCommand[], candidate: WorkspaceIdentity): boolean;
2228
+ export declare function reviewEvidencePasses(evidence: ReviewEvidence | undefined, phase: ReviewEvidence["phase"], criterion: string, base: WorkspaceIdentity, tip: WorkspaceIdentity): boolean;
2229
+ /** Check the persisted integration projection against the request before recovery or promotion. */
2230
+ export declare function parseIntegrationState(value: unknown, request: ExecuteRequest): IntegrationState;
2231
+ /** Passing final evidence is bound to the exact assembled identity, not any worker tip. */
2232
+ export declare function integrationGenerationPasses(generation: IntegrationGeneration, request: ExecuteRequest): boolean;
2233
+ export declare function parseRunState(value: unknown): RunState;
2234
+ export {};