@hcflabs/pi-subagent 0.0.0-stage → 27.10.8

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