@claudexor/schema 3.3.15 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/apply-eligibility.d.ts +0 -882
  2. package/dist/apply-eligibility.d.ts.map +1 -1
  3. package/dist/apply-eligibility.js +0 -145
  4. package/dist/apply-eligibility.js.map +1 -1
  5. package/dist/control.js +4 -4
  6. package/dist/control.js.map +1 -1
  7. package/dist/harness.d.ts +2 -3
  8. package/dist/harness.d.ts.map +1 -1
  9. package/dist/harness.js +3 -4
  10. package/dist/harness.js.map +1 -1
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/mcp-run-result.d.ts +1932 -0
  16. package/dist/mcp-run-result.d.ts.map +1 -0
  17. package/dist/mcp-run-result.js +155 -0
  18. package/dist/mcp-run-result.js.map +1 -0
  19. package/dist/operation.d.ts +9 -0
  20. package/dist/operation.d.ts.map +1 -1
  21. package/dist/operation.js +10 -0
  22. package/dist/operation.js.map +1 -1
  23. package/dist/primitives.js +1 -1
  24. package/dist/primitives.js.map +1 -1
  25. package/dist/task.d.ts.map +1 -1
  26. package/dist/task.js +1 -1
  27. package/dist/task.js.map +1 -1
  28. package/dist/telemetry.d.ts +8 -8
  29. package/dist/telemetry.d.ts.map +1 -1
  30. package/dist/telemetry.js +8 -8
  31. package/dist/telemetry.js.map +1 -1
  32. package/generated/ControlHandshakeResponse.schema.json +8 -0
  33. package/generated/ControlRunDetail.schema.json +4 -4
  34. package/generated/ControlRunListResponse.schema.json +4 -4
  35. package/generated/ControlRunSummary.schema.json +4 -4
  36. package/generated/HarnessEvent.schema.json +1 -1
  37. package/generated/McpRunHandleResult.schema.json +538 -151
  38. package/generated/McpRunToolResult.schema.json +517 -130
  39. package/generated/RunTelemetry.schema.json +7 -7
  40. package/generated/TaskContract.schema.json +1 -1
  41. package/package.json +2 -2
@@ -0,0 +1,1932 @@
1
+ import { z } from "zod/v3";
2
+ export declare const RunDetailProblem: z.ZodObject<{
3
+ code: z.ZodNullable<z.ZodString>;
4
+ message: z.ZodString;
5
+ retryable: z.ZodNullable<z.ZodBoolean>;
6
+ }, "strict", z.ZodTypeAny, {
7
+ code: string | null;
8
+ message: string;
9
+ retryable: boolean | null;
10
+ }, {
11
+ code: string | null;
12
+ message: string;
13
+ retryable: boolean | null;
14
+ }>;
15
+ export type RunDetailProblem = z.infer<typeof RunDetailProblem>;
16
+ /**
17
+ * The structured result shape MCP run tools return (structuredContent).
18
+ * Text content mirrors it for hosts without structured-output support.
19
+ */
20
+ export declare const McpRunToolResult: z.ZodObject<{
21
+ summary: z.ZodString;
22
+ runId: z.ZodNullable<z.ZodString>;
23
+ runDir: z.ZodNullable<z.ZodString>;
24
+ status: z.ZodNullable<z.ZodString>;
25
+ runFacts: z.ZodDefault<z.ZodNullable<z.ZodObject<{
26
+ schema_version: z.ZodLiteral<2>;
27
+ run_id: z.ZodString;
28
+ task_id: z.ZodString;
29
+ mode: z.ZodEnum<["ask", "plan", "agent"]>;
30
+ outcome: z.ZodObject<{
31
+ lifecycle: z.ZodEnum<["succeeded", "failed", "cancelled", "interrupted"]>;
32
+ noChanges: z.ZodDefault<z.ZodBoolean>;
33
+ checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
34
+ review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
35
+ reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted", "workspace_unavailable", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
36
+ work_state: z.ZodOptional<z.ZodObject<{
37
+ state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
38
+ source: z.ZodEnum<["constrained", "validated", "absent"]>;
39
+ required_inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
+ kind: z.ZodEnum<["file", "context", "credential", "permission", "decision", "external_dependency"]>;
41
+ locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
42
+ description: z.ZodString;
43
+ }, "strip", z.ZodTypeAny, {
44
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
45
+ locator: string | null;
46
+ description: string;
47
+ }, {
48
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
49
+ locator?: string | null | undefined;
50
+ description: string;
51
+ }>, "many">>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
54
+ source: "absent" | "constrained" | "validated";
55
+ required_inputs?: {
56
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
57
+ locator: string | null;
58
+ description: string;
59
+ }[] | undefined;
60
+ }, {
61
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
62
+ source: "absent" | "constrained" | "validated";
63
+ required_inputs?: {
64
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
65
+ locator?: string | null | undefined;
66
+ description: string;
67
+ }[] | undefined;
68
+ }>>;
69
+ }, "strict", z.ZodTypeAny, {
70
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
71
+ noChanges: boolean;
72
+ checks: "failed" | "not_configured" | "passed";
73
+ review: "approved" | "blocked" | "not_run";
74
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
75
+ work_state?: {
76
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
77
+ source: "absent" | "constrained" | "validated";
78
+ required_inputs?: {
79
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
80
+ locator: string | null;
81
+ description: string;
82
+ }[] | undefined;
83
+ } | undefined;
84
+ }, {
85
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
86
+ noChanges?: boolean | undefined;
87
+ checks?: "failed" | "not_configured" | "passed" | undefined;
88
+ review?: "approved" | "blocked" | "not_run" | undefined;
89
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
90
+ work_state?: {
91
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
92
+ source: "absent" | "constrained" | "validated";
93
+ required_inputs?: {
94
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
95
+ locator?: string | null | undefined;
96
+ description: string;
97
+ }[] | undefined;
98
+ } | undefined;
99
+ }>;
100
+ deliverable: z.ZodObject<{
101
+ present: z.ZodBoolean;
102
+ kind: z.ZodNullable<z.ZodEnum<["answer", "report", "plan", "patch", "structured_output"]>>;
103
+ path: z.ZodNullable<z.ZodString>;
104
+ producer_attempt_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
105
+ }, "strict", z.ZodTypeAny, {
106
+ present: boolean;
107
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
108
+ path: string | null;
109
+ producer_attempt_id: string | null;
110
+ }, {
111
+ present: boolean;
112
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
113
+ path: string | null;
114
+ producer_attempt_id?: string | null | undefined;
115
+ }>;
116
+ presentation: z.ZodOptional<z.ZodObject<{
117
+ state: z.ZodEnum<["ready", "diagnostic"]>;
118
+ primary: z.ZodNullable<z.ZodObject<{
119
+ kind: z.ZodEnum<["answer", "report", "plan", "patch", "structured_output", "diagnostic"]>;
120
+ path: z.ZodEffects<z.ZodString, string, string>;
121
+ }, "strict", z.ZodTypeAny, {
122
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
123
+ path: string;
124
+ }, {
125
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
126
+ path: string;
127
+ }>>;
128
+ }, "strict", z.ZodTypeAny, {
129
+ state: "diagnostic" | "ready";
130
+ primary: {
131
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
132
+ path: string;
133
+ } | null;
134
+ }, {
135
+ state: "diagnostic" | "ready";
136
+ primary: {
137
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
138
+ path: string;
139
+ } | null;
140
+ }>>;
141
+ participants: z.ZodObject<{
142
+ planners: z.ZodNumber;
143
+ attempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
144
+ attempt_id: z.ZodNullable<z.ZodString>;
145
+ harness_id: z.ZodString;
146
+ role: z.ZodEnum<["planner", "merge", "candidate", "scout", "reducer", "reviewer"]>;
147
+ deliverable_present: z.ZodDefault<z.ZodBoolean>;
148
+ status: z.ZodDefault<z.ZodNullable<z.ZodEnum<["success", "success_with_warnings", "blocked", "failed"]>>>;
149
+ }, "strict", z.ZodTypeAny, {
150
+ attempt_id: string | null;
151
+ harness_id: string;
152
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
153
+ deliverable_present: boolean;
154
+ status: "blocked" | "failed" | "success" | "success_with_warnings" | null;
155
+ }, {
156
+ attempt_id: string | null;
157
+ harness_id: string;
158
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
159
+ deliverable_present?: boolean | undefined;
160
+ status?: "blocked" | "failed" | "success" | "success_with_warnings" | null | undefined;
161
+ }>, "many">>;
162
+ }, "strict", z.ZodTypeAny, {
163
+ planners: number;
164
+ attempts: {
165
+ attempt_id: string | null;
166
+ harness_id: string;
167
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
168
+ deliverable_present: boolean;
169
+ status: "blocked" | "failed" | "success" | "success_with_warnings" | null;
170
+ }[];
171
+ }, {
172
+ planners: number;
173
+ attempts?: {
174
+ attempt_id: string | null;
175
+ harness_id: string;
176
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
177
+ deliverable_present?: boolean | undefined;
178
+ status?: "blocked" | "failed" | "success" | "success_with_warnings" | null | undefined;
179
+ }[] | undefined;
180
+ }>;
181
+ gates: z.ZodObject<{
182
+ configured: z.ZodBoolean;
183
+ required: z.ZodNumber;
184
+ total: z.ZodNumber;
185
+ executed: z.ZodBoolean;
186
+ state: z.ZodEnum<["not_configured", "passed", "failed", "skipped"]>;
187
+ receipt_attempt_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
188
+ }, "strict", z.ZodTypeAny, {
189
+ configured: boolean;
190
+ required: number;
191
+ total: number;
192
+ executed: boolean;
193
+ state: "failed" | "not_configured" | "passed" | "skipped";
194
+ receipt_attempt_id: string | null;
195
+ }, {
196
+ configured: boolean;
197
+ required: number;
198
+ total: number;
199
+ executed: boolean;
200
+ state: "failed" | "not_configured" | "passed" | "skipped";
201
+ receipt_attempt_id?: string | null | undefined;
202
+ }>;
203
+ review: z.ZodObject<{
204
+ state: z.ZodEnum<["approved", "blocked", "not_run"]>;
205
+ blocker_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
206
+ blockers: z.ZodNumber;
207
+ }, "strict", z.ZodTypeAny, {
208
+ state: "approved" | "blocked" | "not_run";
209
+ blocker_ids: string[];
210
+ blockers: number;
211
+ }, {
212
+ state: "approved" | "blocked" | "not_run";
213
+ blocker_ids?: string[] | undefined;
214
+ blockers: number;
215
+ }>;
216
+ apply: z.ZodObject<{
217
+ eligibility: z.ZodDefault<z.ZodNullable<z.ZodObject<{
218
+ eligible: z.ZodBoolean;
219
+ state: z.ZodNullable<z.ZodString>;
220
+ reason: z.ZodNullable<z.ZodString>;
221
+ requiredAction: z.ZodNullable<z.ZodString>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ eligible: boolean;
224
+ state: string | null;
225
+ reason: string | null;
226
+ requiredAction: string | null;
227
+ }, {
228
+ eligible: boolean;
229
+ state: string | null;
230
+ reason: string | null;
231
+ requiredAction: string | null;
232
+ }>>>;
233
+ operator_decision_present: z.ZodDefault<z.ZodBoolean>;
234
+ }, "strict", z.ZodTypeAny, {
235
+ eligibility: {
236
+ eligible: boolean;
237
+ state: string | null;
238
+ reason: string | null;
239
+ requiredAction: string | null;
240
+ } | null;
241
+ operator_decision_present: boolean;
242
+ }, {
243
+ eligibility?: {
244
+ eligible: boolean;
245
+ state: string | null;
246
+ reason: string | null;
247
+ requiredAction: string | null;
248
+ } | null | undefined;
249
+ operator_decision_present?: boolean | undefined;
250
+ }>;
251
+ required_actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
252
+ id: z.ZodEnum<["provide_required_input", "complete_incomplete_work", "resolve_review_block", "fix_failed_checks", "record_operator_decision"]>;
253
+ detail: z.ZodString;
254
+ }, "strict", z.ZodTypeAny, {
255
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
256
+ detail: string;
257
+ }, {
258
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
259
+ detail: string;
260
+ }>, "many">>;
261
+ generated_at: z.ZodString;
262
+ }, "strict", z.ZodTypeAny, {
263
+ schema_version: 2;
264
+ run_id: string;
265
+ task_id: string;
266
+ mode: "agent" | "ask" | "plan";
267
+ outcome: {
268
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
269
+ noChanges: boolean;
270
+ checks: "failed" | "not_configured" | "passed";
271
+ review: "approved" | "blocked" | "not_run";
272
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
273
+ work_state?: {
274
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
275
+ source: "absent" | "constrained" | "validated";
276
+ required_inputs?: {
277
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
278
+ locator: string | null;
279
+ description: string;
280
+ }[] | undefined;
281
+ } | undefined;
282
+ };
283
+ deliverable: {
284
+ present: boolean;
285
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
286
+ path: string | null;
287
+ producer_attempt_id: string | null;
288
+ };
289
+ presentation?: {
290
+ state: "diagnostic" | "ready";
291
+ primary: {
292
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
293
+ path: string;
294
+ } | null;
295
+ } | undefined;
296
+ participants: {
297
+ planners: number;
298
+ attempts: {
299
+ attempt_id: string | null;
300
+ harness_id: string;
301
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
302
+ deliverable_present: boolean;
303
+ status: "blocked" | "failed" | "success" | "success_with_warnings" | null;
304
+ }[];
305
+ };
306
+ gates: {
307
+ configured: boolean;
308
+ required: number;
309
+ total: number;
310
+ executed: boolean;
311
+ state: "failed" | "not_configured" | "passed" | "skipped";
312
+ receipt_attempt_id: string | null;
313
+ };
314
+ review: {
315
+ state: "approved" | "blocked" | "not_run";
316
+ blocker_ids: string[];
317
+ blockers: number;
318
+ };
319
+ apply: {
320
+ eligibility: {
321
+ eligible: boolean;
322
+ state: string | null;
323
+ reason: string | null;
324
+ requiredAction: string | null;
325
+ } | null;
326
+ operator_decision_present: boolean;
327
+ };
328
+ required_actions: {
329
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
330
+ detail: string;
331
+ }[];
332
+ generated_at: string;
333
+ }, {
334
+ schema_version: 2;
335
+ run_id: string;
336
+ task_id: string;
337
+ mode: "agent" | "ask" | "plan";
338
+ outcome: {
339
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
340
+ noChanges?: boolean | undefined;
341
+ checks?: "failed" | "not_configured" | "passed" | undefined;
342
+ review?: "approved" | "blocked" | "not_run" | undefined;
343
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
344
+ work_state?: {
345
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
346
+ source: "absent" | "constrained" | "validated";
347
+ required_inputs?: {
348
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
349
+ locator?: string | null | undefined;
350
+ description: string;
351
+ }[] | undefined;
352
+ } | undefined;
353
+ };
354
+ deliverable: {
355
+ present: boolean;
356
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
357
+ path: string | null;
358
+ producer_attempt_id?: string | null | undefined;
359
+ };
360
+ presentation?: {
361
+ state: "diagnostic" | "ready";
362
+ primary: {
363
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
364
+ path: string;
365
+ } | null;
366
+ } | undefined;
367
+ participants: {
368
+ planners: number;
369
+ attempts?: {
370
+ attempt_id: string | null;
371
+ harness_id: string;
372
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
373
+ deliverable_present?: boolean | undefined;
374
+ status?: "blocked" | "failed" | "success" | "success_with_warnings" | null | undefined;
375
+ }[] | undefined;
376
+ };
377
+ gates: {
378
+ configured: boolean;
379
+ required: number;
380
+ total: number;
381
+ executed: boolean;
382
+ state: "failed" | "not_configured" | "passed" | "skipped";
383
+ receipt_attempt_id?: string | null | undefined;
384
+ };
385
+ review: {
386
+ state: "approved" | "blocked" | "not_run";
387
+ blocker_ids?: string[] | undefined;
388
+ blockers: number;
389
+ };
390
+ apply: {
391
+ eligibility?: {
392
+ eligible: boolean;
393
+ state: string | null;
394
+ reason: string | null;
395
+ requiredAction: string | null;
396
+ } | null | undefined;
397
+ operator_decision_present?: boolean | undefined;
398
+ };
399
+ required_actions?: {
400
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
401
+ detail: string;
402
+ }[] | undefined;
403
+ generated_at: string;
404
+ }>>>;
405
+ outcomeFacts: z.ZodDefault<z.ZodNullable<z.ZodObject<{
406
+ lifecycle: z.ZodEnum<["succeeded", "failed", "cancelled", "interrupted"]>;
407
+ noChanges: z.ZodDefault<z.ZodBoolean>;
408
+ checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
409
+ review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
410
+ reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted", "workspace_unavailable", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
411
+ work_state: z.ZodOptional<z.ZodObject<{
412
+ state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
413
+ source: z.ZodEnum<["constrained", "validated", "absent"]>;
414
+ required_inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
415
+ kind: z.ZodEnum<["file", "context", "credential", "permission", "decision", "external_dependency"]>;
416
+ locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
417
+ description: z.ZodString;
418
+ }, "strip", z.ZodTypeAny, {
419
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
420
+ locator: string | null;
421
+ description: string;
422
+ }, {
423
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
424
+ locator?: string | null | undefined;
425
+ description: string;
426
+ }>, "many">>;
427
+ }, "strip", z.ZodTypeAny, {
428
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
429
+ source: "absent" | "constrained" | "validated";
430
+ required_inputs?: {
431
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
432
+ locator: string | null;
433
+ description: string;
434
+ }[] | undefined;
435
+ }, {
436
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
437
+ source: "absent" | "constrained" | "validated";
438
+ required_inputs?: {
439
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
440
+ locator?: string | null | undefined;
441
+ description: string;
442
+ }[] | undefined;
443
+ }>>;
444
+ }, "strict", z.ZodTypeAny, {
445
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
446
+ noChanges: boolean;
447
+ checks: "failed" | "not_configured" | "passed";
448
+ review: "approved" | "blocked" | "not_run";
449
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
450
+ work_state?: {
451
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
452
+ source: "absent" | "constrained" | "validated";
453
+ required_inputs?: {
454
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
455
+ locator: string | null;
456
+ description: string;
457
+ }[] | undefined;
458
+ } | undefined;
459
+ }, {
460
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
461
+ noChanges?: boolean | undefined;
462
+ checks?: "failed" | "not_configured" | "passed" | undefined;
463
+ review?: "approved" | "blocked" | "not_run" | undefined;
464
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
465
+ work_state?: {
466
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
467
+ source: "absent" | "constrained" | "validated";
468
+ required_inputs?: {
469
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
470
+ locator?: string | null | undefined;
471
+ description: string;
472
+ }[] | undefined;
473
+ } | undefined;
474
+ }>>>;
475
+ failure: z.ZodDefault<z.ZodNullable<z.ZodObject<{
476
+ phase: z.ZodDefault<z.ZodString>;
477
+ category: z.ZodDefault<z.ZodEnum<["validation", "project", "auth", "harness_unavailable", "harness_error", "config_error", "budget", "policy", "cancelled", "internal", "unknown"]>>;
478
+ code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable", "delegation_child_drain_timeout", "subscription_window_exhausted", "delegated_home_unavailable", "delegated_confinement_unavailable", "delegated_evidence_incomplete"]>>>;
479
+ harnessId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
480
+ attemptId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
481
+ safeMessage: z.ZodString;
482
+ rawDetailRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
483
+ logRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
484
+ eventRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
485
+ runDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
486
+ resetsAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
487
+ nextActions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ phase: string;
490
+ category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
491
+ code: "budget_overshoot" | "cost_unverifiable" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "subscription_window_exhausted" | "unknown_paid_in_flight" | null;
492
+ harnessId: string | null;
493
+ attemptId: string | null;
494
+ safeMessage: string;
495
+ rawDetailRef: string | null;
496
+ logRefs: string[];
497
+ eventRefs: string[];
498
+ runDir: string | null;
499
+ resetsAt: string | null;
500
+ nextActions: string[];
501
+ }, {
502
+ phase?: string | undefined;
503
+ category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
504
+ code?: "budget_overshoot" | "cost_unverifiable" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "subscription_window_exhausted" | "unknown_paid_in_flight" | null | undefined;
505
+ harnessId?: string | null | undefined;
506
+ attemptId?: string | null | undefined;
507
+ safeMessage: string;
508
+ rawDetailRef?: string | null | undefined;
509
+ logRefs?: string[] | undefined;
510
+ eventRefs?: string[] | undefined;
511
+ runDir?: string | null | undefined;
512
+ resetsAt?: string | null | undefined;
513
+ nextActions?: string[] | undefined;
514
+ }>>>;
515
+ applyEligibility: z.ZodNullable<z.ZodObject<{
516
+ eligible: z.ZodBoolean;
517
+ state: z.ZodNullable<z.ZodString>;
518
+ reason: z.ZodNullable<z.ZodString>;
519
+ requiredAction: z.ZodNullable<z.ZodString>;
520
+ }, "strip", z.ZodTypeAny, {
521
+ eligible: boolean;
522
+ state: string | null;
523
+ reason: string | null;
524
+ requiredAction: string | null;
525
+ }, {
526
+ eligible: boolean;
527
+ state: string | null;
528
+ reason: string | null;
529
+ requiredAction: string | null;
530
+ }>>;
531
+ outcomeBanner: z.ZodDefault<z.ZodNullable<z.ZodString>>;
532
+ planReadiness: z.ZodDefault<z.ZodNullable<z.ZodObject<{
533
+ state: z.ZodEnum<["ready", "needs_answers", "unverified"]>;
534
+ questionCount: z.ZodDefault<z.ZodNumber>;
535
+ }, "strict", z.ZodTypeAny, {
536
+ state: "needs_answers" | "ready" | "unverified";
537
+ questionCount: number;
538
+ }, {
539
+ state: "needs_answers" | "ready" | "unverified";
540
+ questionCount?: number | undefined;
541
+ }>>>;
542
+ /** Typed disclosure that the post-terminal detail read DEGRADED: the run
543
+ * finished and its result survived, but the detail projections above are
544
+ * absent for this machine-readable reason (e.g. run_facts_invalid). */
545
+ detailProblem: z.ZodDefault<z.ZodNullable<z.ZodObject<{
546
+ code: z.ZodNullable<z.ZodString>;
547
+ message: z.ZodString;
548
+ retryable: z.ZodNullable<z.ZodBoolean>;
549
+ }, "strict", z.ZodTypeAny, {
550
+ code: string | null;
551
+ message: string;
552
+ retryable: boolean | null;
553
+ }, {
554
+ code: string | null;
555
+ message: string;
556
+ retryable: boolean | null;
557
+ }>>>;
558
+ /** Council membership + merge disclosure (QA-023b) so an MCP host can
559
+ * machine-verify a `--council` plan was really N/N and who merged, without
560
+ * reading local artifacts; null for solo/non-plan tools and deferred handles. */
561
+ council: z.ZodDefault<z.ZodNullable<z.ZodObject<{
562
+ requested: z.ZodNumber;
563
+ drafted: z.ZodNumber;
564
+ degraded: z.ZodDefault<z.ZodBoolean>;
565
+ mergedBy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
566
+ members: z.ZodDefault<z.ZodArray<z.ZodObject<{
567
+ harnessId: z.ZodString;
568
+ role: z.ZodEnum<["primary", "member"]>;
569
+ status: z.ZodEnum<["drafted", "failed", "merged"]>;
570
+ error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
571
+ }, "strict", z.ZodTypeAny, {
572
+ harnessId: string;
573
+ role: "member" | "primary";
574
+ status: "drafted" | "failed" | "merged";
575
+ error: string | null;
576
+ }, {
577
+ harnessId: string;
578
+ role: "member" | "primary";
579
+ status: "drafted" | "failed" | "merged";
580
+ error?: string | null | undefined;
581
+ }>, "many">>;
582
+ }, "strict", z.ZodTypeAny, {
583
+ requested: number;
584
+ drafted: number;
585
+ degraded: boolean;
586
+ mergedBy: string | null;
587
+ members: {
588
+ harnessId: string;
589
+ role: "member" | "primary";
590
+ status: "drafted" | "failed" | "merged";
591
+ error: string | null;
592
+ }[];
593
+ }, {
594
+ requested: number;
595
+ drafted: number;
596
+ degraded?: boolean | undefined;
597
+ mergedBy?: string | null | undefined;
598
+ members?: {
599
+ harnessId: string;
600
+ role: "member" | "primary";
601
+ status: "drafted" | "failed" | "merged";
602
+ error?: string | null | undefined;
603
+ }[] | undefined;
604
+ }>>>;
605
+ parentRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
606
+ delegatedFromRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
607
+ delegation: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodObject<{
608
+ requested: z.ZodDefault<z.ZodBoolean>;
609
+ effective: z.ZodDefault<z.ZodBoolean>;
610
+ used: z.ZodDefault<z.ZodBoolean>;
611
+ reason: z.ZodDefault<z.ZodEnum<["pending", "not_requested", "injected_unused", "used", "runtime_unavailable", "manifest_unsupported", "access_profile_incompatible", "partially_degraded", "startup_failed"]>>;
612
+ remediation: z.ZodDefault<z.ZodNullable<z.ZodString>>;
613
+ }, "strict", z.ZodTypeAny, {
614
+ requested: boolean;
615
+ effective: boolean;
616
+ used: boolean;
617
+ reason: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used";
618
+ remediation: string | null;
619
+ }, {
620
+ requested?: boolean | undefined;
621
+ effective?: boolean | undefined;
622
+ used?: boolean | undefined;
623
+ reason?: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used" | undefined;
624
+ remediation?: string | null | undefined;
625
+ }>, {
626
+ requested: boolean;
627
+ effective: boolean;
628
+ used: boolean;
629
+ reason: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used";
630
+ remediation: string | null;
631
+ }, {
632
+ requested?: boolean | undefined;
633
+ effective?: boolean | undefined;
634
+ used?: boolean | undefined;
635
+ reason?: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used" | undefined;
636
+ remediation?: string | null | undefined;
637
+ }>>>;
638
+ }, "strip", z.ZodTypeAny, {
639
+ summary: string;
640
+ runId: string | null;
641
+ runDir: string | null;
642
+ status: string | null;
643
+ runFacts: {
644
+ schema_version: 2;
645
+ run_id: string;
646
+ task_id: string;
647
+ mode: "agent" | "ask" | "plan";
648
+ outcome: {
649
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
650
+ noChanges: boolean;
651
+ checks: "failed" | "not_configured" | "passed";
652
+ review: "approved" | "blocked" | "not_run";
653
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
654
+ work_state?: {
655
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
656
+ source: "absent" | "constrained" | "validated";
657
+ required_inputs?: {
658
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
659
+ locator: string | null;
660
+ description: string;
661
+ }[] | undefined;
662
+ } | undefined;
663
+ };
664
+ deliverable: {
665
+ present: boolean;
666
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
667
+ path: string | null;
668
+ producer_attempt_id: string | null;
669
+ };
670
+ presentation?: {
671
+ state: "diagnostic" | "ready";
672
+ primary: {
673
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
674
+ path: string;
675
+ } | null;
676
+ } | undefined;
677
+ participants: {
678
+ planners: number;
679
+ attempts: {
680
+ attempt_id: string | null;
681
+ harness_id: string;
682
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
683
+ deliverable_present: boolean;
684
+ status: "blocked" | "failed" | "success" | "success_with_warnings" | null;
685
+ }[];
686
+ };
687
+ gates: {
688
+ configured: boolean;
689
+ required: number;
690
+ total: number;
691
+ executed: boolean;
692
+ state: "failed" | "not_configured" | "passed" | "skipped";
693
+ receipt_attempt_id: string | null;
694
+ };
695
+ review: {
696
+ state: "approved" | "blocked" | "not_run";
697
+ blocker_ids: string[];
698
+ blockers: number;
699
+ };
700
+ apply: {
701
+ eligibility: {
702
+ eligible: boolean;
703
+ state: string | null;
704
+ reason: string | null;
705
+ requiredAction: string | null;
706
+ } | null;
707
+ operator_decision_present: boolean;
708
+ };
709
+ required_actions: {
710
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
711
+ detail: string;
712
+ }[];
713
+ generated_at: string;
714
+ } | null;
715
+ outcomeFacts: {
716
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
717
+ noChanges: boolean;
718
+ checks: "failed" | "not_configured" | "passed";
719
+ review: "approved" | "blocked" | "not_run";
720
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
721
+ work_state?: {
722
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
723
+ source: "absent" | "constrained" | "validated";
724
+ required_inputs?: {
725
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
726
+ locator: string | null;
727
+ description: string;
728
+ }[] | undefined;
729
+ } | undefined;
730
+ } | null;
731
+ failure: {
732
+ phase: string;
733
+ category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
734
+ code: "budget_overshoot" | "cost_unverifiable" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "subscription_window_exhausted" | "unknown_paid_in_flight" | null;
735
+ harnessId: string | null;
736
+ attemptId: string | null;
737
+ safeMessage: string;
738
+ rawDetailRef: string | null;
739
+ logRefs: string[];
740
+ eventRefs: string[];
741
+ runDir: string | null;
742
+ resetsAt: string | null;
743
+ nextActions: string[];
744
+ } | null;
745
+ applyEligibility: {
746
+ eligible: boolean;
747
+ state: string | null;
748
+ reason: string | null;
749
+ requiredAction: string | null;
750
+ } | null;
751
+ outcomeBanner: string | null;
752
+ planReadiness: {
753
+ state: "needs_answers" | "ready" | "unverified";
754
+ questionCount: number;
755
+ } | null;
756
+ detailProblem: {
757
+ code: string | null;
758
+ message: string;
759
+ retryable: boolean | null;
760
+ } | null;
761
+ council: {
762
+ requested: number;
763
+ drafted: number;
764
+ degraded: boolean;
765
+ mergedBy: string | null;
766
+ members: {
767
+ harnessId: string;
768
+ role: "member" | "primary";
769
+ status: "drafted" | "failed" | "merged";
770
+ error: string | null;
771
+ }[];
772
+ } | null;
773
+ parentRunId: string | null;
774
+ delegatedFromRunId: string | null;
775
+ delegation: {
776
+ requested: boolean;
777
+ effective: boolean;
778
+ used: boolean;
779
+ reason: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used";
780
+ remediation: string | null;
781
+ } | null;
782
+ }, {
783
+ summary: string;
784
+ runId: string | null;
785
+ runDir: string | null;
786
+ status: string | null;
787
+ runFacts?: {
788
+ schema_version: 2;
789
+ run_id: string;
790
+ task_id: string;
791
+ mode: "agent" | "ask" | "plan";
792
+ outcome: {
793
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
794
+ noChanges?: boolean | undefined;
795
+ checks?: "failed" | "not_configured" | "passed" | undefined;
796
+ review?: "approved" | "blocked" | "not_run" | undefined;
797
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
798
+ work_state?: {
799
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
800
+ source: "absent" | "constrained" | "validated";
801
+ required_inputs?: {
802
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
803
+ locator?: string | null | undefined;
804
+ description: string;
805
+ }[] | undefined;
806
+ } | undefined;
807
+ };
808
+ deliverable: {
809
+ present: boolean;
810
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
811
+ path: string | null;
812
+ producer_attempt_id?: string | null | undefined;
813
+ };
814
+ presentation?: {
815
+ state: "diagnostic" | "ready";
816
+ primary: {
817
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
818
+ path: string;
819
+ } | null;
820
+ } | undefined;
821
+ participants: {
822
+ planners: number;
823
+ attempts?: {
824
+ attempt_id: string | null;
825
+ harness_id: string;
826
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
827
+ deliverable_present?: boolean | undefined;
828
+ status?: "blocked" | "failed" | "success" | "success_with_warnings" | null | undefined;
829
+ }[] | undefined;
830
+ };
831
+ gates: {
832
+ configured: boolean;
833
+ required: number;
834
+ total: number;
835
+ executed: boolean;
836
+ state: "failed" | "not_configured" | "passed" | "skipped";
837
+ receipt_attempt_id?: string | null | undefined;
838
+ };
839
+ review: {
840
+ state: "approved" | "blocked" | "not_run";
841
+ blocker_ids?: string[] | undefined;
842
+ blockers: number;
843
+ };
844
+ apply: {
845
+ eligibility?: {
846
+ eligible: boolean;
847
+ state: string | null;
848
+ reason: string | null;
849
+ requiredAction: string | null;
850
+ } | null | undefined;
851
+ operator_decision_present?: boolean | undefined;
852
+ };
853
+ required_actions?: {
854
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
855
+ detail: string;
856
+ }[] | undefined;
857
+ generated_at: string;
858
+ } | null | undefined;
859
+ outcomeFacts?: {
860
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
861
+ noChanges?: boolean | undefined;
862
+ checks?: "failed" | "not_configured" | "passed" | undefined;
863
+ review?: "approved" | "blocked" | "not_run" | undefined;
864
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
865
+ work_state?: {
866
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
867
+ source: "absent" | "constrained" | "validated";
868
+ required_inputs?: {
869
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
870
+ locator?: string | null | undefined;
871
+ description: string;
872
+ }[] | undefined;
873
+ } | undefined;
874
+ } | null | undefined;
875
+ failure?: {
876
+ phase?: string | undefined;
877
+ category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
878
+ code?: "budget_overshoot" | "cost_unverifiable" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "subscription_window_exhausted" | "unknown_paid_in_flight" | null | undefined;
879
+ harnessId?: string | null | undefined;
880
+ attemptId?: string | null | undefined;
881
+ safeMessage: string;
882
+ rawDetailRef?: string | null | undefined;
883
+ logRefs?: string[] | undefined;
884
+ eventRefs?: string[] | undefined;
885
+ runDir?: string | null | undefined;
886
+ resetsAt?: string | null | undefined;
887
+ nextActions?: string[] | undefined;
888
+ } | null | undefined;
889
+ applyEligibility: {
890
+ eligible: boolean;
891
+ state: string | null;
892
+ reason: string | null;
893
+ requiredAction: string | null;
894
+ } | null;
895
+ outcomeBanner?: string | null | undefined;
896
+ planReadiness?: {
897
+ state: "needs_answers" | "ready" | "unverified";
898
+ questionCount?: number | undefined;
899
+ } | null | undefined;
900
+ detailProblem?: {
901
+ code: string | null;
902
+ message: string;
903
+ retryable: boolean | null;
904
+ } | null | undefined;
905
+ council?: {
906
+ requested: number;
907
+ drafted: number;
908
+ degraded?: boolean | undefined;
909
+ mergedBy?: string | null | undefined;
910
+ members?: {
911
+ harnessId: string;
912
+ role: "member" | "primary";
913
+ status: "drafted" | "failed" | "merged";
914
+ error?: string | null | undefined;
915
+ }[] | undefined;
916
+ } | null | undefined;
917
+ parentRunId?: string | null | undefined;
918
+ delegatedFromRunId?: string | null | undefined;
919
+ delegation?: {
920
+ requested?: boolean | undefined;
921
+ effective?: boolean | undefined;
922
+ used?: boolean | undefined;
923
+ reason?: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used" | undefined;
924
+ remediation?: string | null | undefined;
925
+ } | null | undefined;
926
+ }>;
927
+ export type McpRunToolResult = z.infer<typeof McpRunToolResult>;
928
+ /**
929
+ * The structured result shape the MCP READ tools (claudexor_inspect /
930
+ * claudexor_run_status / claudexor_run_result) return: a durable run handle
931
+ * projected from GET /runs/:id through the SAME axes every surface reads.
932
+ * Strict — the read tools emit exactly these keys so hosts can branch on a
933
+ * declared shape instead of a free-text blob (v3: no legacy extra fields).
934
+ */
935
+ export declare const McpRunHandleResult: z.ZodObject<{
936
+ summary: z.ZodString;
937
+ runId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
938
+ runDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
939
+ status: z.ZodDefault<z.ZodNullable<z.ZodString>>;
940
+ runFacts: z.ZodDefault<z.ZodNullable<z.ZodObject<{
941
+ schema_version: z.ZodLiteral<2>;
942
+ run_id: z.ZodString;
943
+ task_id: z.ZodString;
944
+ mode: z.ZodEnum<["ask", "plan", "agent"]>;
945
+ outcome: z.ZodObject<{
946
+ lifecycle: z.ZodEnum<["succeeded", "failed", "cancelled", "interrupted"]>;
947
+ noChanges: z.ZodDefault<z.ZodBoolean>;
948
+ checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
949
+ review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
950
+ reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted", "workspace_unavailable", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
951
+ work_state: z.ZodOptional<z.ZodObject<{
952
+ state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
953
+ source: z.ZodEnum<["constrained", "validated", "absent"]>;
954
+ required_inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
955
+ kind: z.ZodEnum<["file", "context", "credential", "permission", "decision", "external_dependency"]>;
956
+ locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
957
+ description: z.ZodString;
958
+ }, "strip", z.ZodTypeAny, {
959
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
960
+ locator: string | null;
961
+ description: string;
962
+ }, {
963
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
964
+ locator?: string | null | undefined;
965
+ description: string;
966
+ }>, "many">>;
967
+ }, "strip", z.ZodTypeAny, {
968
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
969
+ source: "absent" | "constrained" | "validated";
970
+ required_inputs?: {
971
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
972
+ locator: string | null;
973
+ description: string;
974
+ }[] | undefined;
975
+ }, {
976
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
977
+ source: "absent" | "constrained" | "validated";
978
+ required_inputs?: {
979
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
980
+ locator?: string | null | undefined;
981
+ description: string;
982
+ }[] | undefined;
983
+ }>>;
984
+ }, "strict", z.ZodTypeAny, {
985
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
986
+ noChanges: boolean;
987
+ checks: "failed" | "not_configured" | "passed";
988
+ review: "approved" | "blocked" | "not_run";
989
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
990
+ work_state?: {
991
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
992
+ source: "absent" | "constrained" | "validated";
993
+ required_inputs?: {
994
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
995
+ locator: string | null;
996
+ description: string;
997
+ }[] | undefined;
998
+ } | undefined;
999
+ }, {
1000
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
1001
+ noChanges?: boolean | undefined;
1002
+ checks?: "failed" | "not_configured" | "passed" | undefined;
1003
+ review?: "approved" | "blocked" | "not_run" | undefined;
1004
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
1005
+ work_state?: {
1006
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1007
+ source: "absent" | "constrained" | "validated";
1008
+ required_inputs?: {
1009
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1010
+ locator?: string | null | undefined;
1011
+ description: string;
1012
+ }[] | undefined;
1013
+ } | undefined;
1014
+ }>;
1015
+ deliverable: z.ZodObject<{
1016
+ present: z.ZodBoolean;
1017
+ kind: z.ZodNullable<z.ZodEnum<["answer", "report", "plan", "patch", "structured_output"]>>;
1018
+ path: z.ZodNullable<z.ZodString>;
1019
+ producer_attempt_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1020
+ }, "strict", z.ZodTypeAny, {
1021
+ present: boolean;
1022
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
1023
+ path: string | null;
1024
+ producer_attempt_id: string | null;
1025
+ }, {
1026
+ present: boolean;
1027
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
1028
+ path: string | null;
1029
+ producer_attempt_id?: string | null | undefined;
1030
+ }>;
1031
+ presentation: z.ZodOptional<z.ZodObject<{
1032
+ state: z.ZodEnum<["ready", "diagnostic"]>;
1033
+ primary: z.ZodNullable<z.ZodObject<{
1034
+ kind: z.ZodEnum<["answer", "report", "plan", "patch", "structured_output", "diagnostic"]>;
1035
+ path: z.ZodEffects<z.ZodString, string, string>;
1036
+ }, "strict", z.ZodTypeAny, {
1037
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
1038
+ path: string;
1039
+ }, {
1040
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
1041
+ path: string;
1042
+ }>>;
1043
+ }, "strict", z.ZodTypeAny, {
1044
+ state: "diagnostic" | "ready";
1045
+ primary: {
1046
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
1047
+ path: string;
1048
+ } | null;
1049
+ }, {
1050
+ state: "diagnostic" | "ready";
1051
+ primary: {
1052
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
1053
+ path: string;
1054
+ } | null;
1055
+ }>>;
1056
+ participants: z.ZodObject<{
1057
+ planners: z.ZodNumber;
1058
+ attempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1059
+ attempt_id: z.ZodNullable<z.ZodString>;
1060
+ harness_id: z.ZodString;
1061
+ role: z.ZodEnum<["planner", "merge", "candidate", "scout", "reducer", "reviewer"]>;
1062
+ deliverable_present: z.ZodDefault<z.ZodBoolean>;
1063
+ status: z.ZodDefault<z.ZodNullable<z.ZodEnum<["success", "success_with_warnings", "blocked", "failed"]>>>;
1064
+ }, "strict", z.ZodTypeAny, {
1065
+ attempt_id: string | null;
1066
+ harness_id: string;
1067
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
1068
+ deliverable_present: boolean;
1069
+ status: "blocked" | "failed" | "success" | "success_with_warnings" | null;
1070
+ }, {
1071
+ attempt_id: string | null;
1072
+ harness_id: string;
1073
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
1074
+ deliverable_present?: boolean | undefined;
1075
+ status?: "blocked" | "failed" | "success" | "success_with_warnings" | null | undefined;
1076
+ }>, "many">>;
1077
+ }, "strict", z.ZodTypeAny, {
1078
+ planners: number;
1079
+ attempts: {
1080
+ attempt_id: string | null;
1081
+ harness_id: string;
1082
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
1083
+ deliverable_present: boolean;
1084
+ status: "blocked" | "failed" | "success" | "success_with_warnings" | null;
1085
+ }[];
1086
+ }, {
1087
+ planners: number;
1088
+ attempts?: {
1089
+ attempt_id: string | null;
1090
+ harness_id: string;
1091
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
1092
+ deliverable_present?: boolean | undefined;
1093
+ status?: "blocked" | "failed" | "success" | "success_with_warnings" | null | undefined;
1094
+ }[] | undefined;
1095
+ }>;
1096
+ gates: z.ZodObject<{
1097
+ configured: z.ZodBoolean;
1098
+ required: z.ZodNumber;
1099
+ total: z.ZodNumber;
1100
+ executed: z.ZodBoolean;
1101
+ state: z.ZodEnum<["not_configured", "passed", "failed", "skipped"]>;
1102
+ receipt_attempt_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1103
+ }, "strict", z.ZodTypeAny, {
1104
+ configured: boolean;
1105
+ required: number;
1106
+ total: number;
1107
+ executed: boolean;
1108
+ state: "failed" | "not_configured" | "passed" | "skipped";
1109
+ receipt_attempt_id: string | null;
1110
+ }, {
1111
+ configured: boolean;
1112
+ required: number;
1113
+ total: number;
1114
+ executed: boolean;
1115
+ state: "failed" | "not_configured" | "passed" | "skipped";
1116
+ receipt_attempt_id?: string | null | undefined;
1117
+ }>;
1118
+ review: z.ZodObject<{
1119
+ state: z.ZodEnum<["approved", "blocked", "not_run"]>;
1120
+ blocker_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1121
+ blockers: z.ZodNumber;
1122
+ }, "strict", z.ZodTypeAny, {
1123
+ state: "approved" | "blocked" | "not_run";
1124
+ blocker_ids: string[];
1125
+ blockers: number;
1126
+ }, {
1127
+ state: "approved" | "blocked" | "not_run";
1128
+ blocker_ids?: string[] | undefined;
1129
+ blockers: number;
1130
+ }>;
1131
+ apply: z.ZodObject<{
1132
+ eligibility: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1133
+ eligible: z.ZodBoolean;
1134
+ state: z.ZodNullable<z.ZodString>;
1135
+ reason: z.ZodNullable<z.ZodString>;
1136
+ requiredAction: z.ZodNullable<z.ZodString>;
1137
+ }, "strip", z.ZodTypeAny, {
1138
+ eligible: boolean;
1139
+ state: string | null;
1140
+ reason: string | null;
1141
+ requiredAction: string | null;
1142
+ }, {
1143
+ eligible: boolean;
1144
+ state: string | null;
1145
+ reason: string | null;
1146
+ requiredAction: string | null;
1147
+ }>>>;
1148
+ operator_decision_present: z.ZodDefault<z.ZodBoolean>;
1149
+ }, "strict", z.ZodTypeAny, {
1150
+ eligibility: {
1151
+ eligible: boolean;
1152
+ state: string | null;
1153
+ reason: string | null;
1154
+ requiredAction: string | null;
1155
+ } | null;
1156
+ operator_decision_present: boolean;
1157
+ }, {
1158
+ eligibility?: {
1159
+ eligible: boolean;
1160
+ state: string | null;
1161
+ reason: string | null;
1162
+ requiredAction: string | null;
1163
+ } | null | undefined;
1164
+ operator_decision_present?: boolean | undefined;
1165
+ }>;
1166
+ required_actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1167
+ id: z.ZodEnum<["provide_required_input", "complete_incomplete_work", "resolve_review_block", "fix_failed_checks", "record_operator_decision"]>;
1168
+ detail: z.ZodString;
1169
+ }, "strict", z.ZodTypeAny, {
1170
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
1171
+ detail: string;
1172
+ }, {
1173
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
1174
+ detail: string;
1175
+ }>, "many">>;
1176
+ generated_at: z.ZodString;
1177
+ }, "strict", z.ZodTypeAny, {
1178
+ schema_version: 2;
1179
+ run_id: string;
1180
+ task_id: string;
1181
+ mode: "agent" | "ask" | "plan";
1182
+ outcome: {
1183
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
1184
+ noChanges: boolean;
1185
+ checks: "failed" | "not_configured" | "passed";
1186
+ review: "approved" | "blocked" | "not_run";
1187
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
1188
+ work_state?: {
1189
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1190
+ source: "absent" | "constrained" | "validated";
1191
+ required_inputs?: {
1192
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1193
+ locator: string | null;
1194
+ description: string;
1195
+ }[] | undefined;
1196
+ } | undefined;
1197
+ };
1198
+ deliverable: {
1199
+ present: boolean;
1200
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
1201
+ path: string | null;
1202
+ producer_attempt_id: string | null;
1203
+ };
1204
+ presentation?: {
1205
+ state: "diagnostic" | "ready";
1206
+ primary: {
1207
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
1208
+ path: string;
1209
+ } | null;
1210
+ } | undefined;
1211
+ participants: {
1212
+ planners: number;
1213
+ attempts: {
1214
+ attempt_id: string | null;
1215
+ harness_id: string;
1216
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
1217
+ deliverable_present: boolean;
1218
+ status: "blocked" | "failed" | "success" | "success_with_warnings" | null;
1219
+ }[];
1220
+ };
1221
+ gates: {
1222
+ configured: boolean;
1223
+ required: number;
1224
+ total: number;
1225
+ executed: boolean;
1226
+ state: "failed" | "not_configured" | "passed" | "skipped";
1227
+ receipt_attempt_id: string | null;
1228
+ };
1229
+ review: {
1230
+ state: "approved" | "blocked" | "not_run";
1231
+ blocker_ids: string[];
1232
+ blockers: number;
1233
+ };
1234
+ apply: {
1235
+ eligibility: {
1236
+ eligible: boolean;
1237
+ state: string | null;
1238
+ reason: string | null;
1239
+ requiredAction: string | null;
1240
+ } | null;
1241
+ operator_decision_present: boolean;
1242
+ };
1243
+ required_actions: {
1244
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
1245
+ detail: string;
1246
+ }[];
1247
+ generated_at: string;
1248
+ }, {
1249
+ schema_version: 2;
1250
+ run_id: string;
1251
+ task_id: string;
1252
+ mode: "agent" | "ask" | "plan";
1253
+ outcome: {
1254
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
1255
+ noChanges?: boolean | undefined;
1256
+ checks?: "failed" | "not_configured" | "passed" | undefined;
1257
+ review?: "approved" | "blocked" | "not_run" | undefined;
1258
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
1259
+ work_state?: {
1260
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1261
+ source: "absent" | "constrained" | "validated";
1262
+ required_inputs?: {
1263
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1264
+ locator?: string | null | undefined;
1265
+ description: string;
1266
+ }[] | undefined;
1267
+ } | undefined;
1268
+ };
1269
+ deliverable: {
1270
+ present: boolean;
1271
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
1272
+ path: string | null;
1273
+ producer_attempt_id?: string | null | undefined;
1274
+ };
1275
+ presentation?: {
1276
+ state: "diagnostic" | "ready";
1277
+ primary: {
1278
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
1279
+ path: string;
1280
+ } | null;
1281
+ } | undefined;
1282
+ participants: {
1283
+ planners: number;
1284
+ attempts?: {
1285
+ attempt_id: string | null;
1286
+ harness_id: string;
1287
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
1288
+ deliverable_present?: boolean | undefined;
1289
+ status?: "blocked" | "failed" | "success" | "success_with_warnings" | null | undefined;
1290
+ }[] | undefined;
1291
+ };
1292
+ gates: {
1293
+ configured: boolean;
1294
+ required: number;
1295
+ total: number;
1296
+ executed: boolean;
1297
+ state: "failed" | "not_configured" | "passed" | "skipped";
1298
+ receipt_attempt_id?: string | null | undefined;
1299
+ };
1300
+ review: {
1301
+ state: "approved" | "blocked" | "not_run";
1302
+ blocker_ids?: string[] | undefined;
1303
+ blockers: number;
1304
+ };
1305
+ apply: {
1306
+ eligibility?: {
1307
+ eligible: boolean;
1308
+ state: string | null;
1309
+ reason: string | null;
1310
+ requiredAction: string | null;
1311
+ } | null | undefined;
1312
+ operator_decision_present?: boolean | undefined;
1313
+ };
1314
+ required_actions?: {
1315
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
1316
+ detail: string;
1317
+ }[] | undefined;
1318
+ generated_at: string;
1319
+ }>>>;
1320
+ decisionStatus: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1321
+ pendingInteractions: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1322
+ outcomeFacts: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1323
+ lifecycle: z.ZodEnum<["succeeded", "failed", "cancelled", "interrupted"]>;
1324
+ noChanges: z.ZodDefault<z.ZodBoolean>;
1325
+ checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
1326
+ review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
1327
+ reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted", "workspace_unavailable", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
1328
+ work_state: z.ZodOptional<z.ZodObject<{
1329
+ state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
1330
+ source: z.ZodEnum<["constrained", "validated", "absent"]>;
1331
+ required_inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1332
+ kind: z.ZodEnum<["file", "context", "credential", "permission", "decision", "external_dependency"]>;
1333
+ locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1334
+ description: z.ZodString;
1335
+ }, "strip", z.ZodTypeAny, {
1336
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1337
+ locator: string | null;
1338
+ description: string;
1339
+ }, {
1340
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1341
+ locator?: string | null | undefined;
1342
+ description: string;
1343
+ }>, "many">>;
1344
+ }, "strip", z.ZodTypeAny, {
1345
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1346
+ source: "absent" | "constrained" | "validated";
1347
+ required_inputs?: {
1348
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1349
+ locator: string | null;
1350
+ description: string;
1351
+ }[] | undefined;
1352
+ }, {
1353
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1354
+ source: "absent" | "constrained" | "validated";
1355
+ required_inputs?: {
1356
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1357
+ locator?: string | null | undefined;
1358
+ description: string;
1359
+ }[] | undefined;
1360
+ }>>;
1361
+ }, "strict", z.ZodTypeAny, {
1362
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
1363
+ noChanges: boolean;
1364
+ checks: "failed" | "not_configured" | "passed";
1365
+ review: "approved" | "blocked" | "not_run";
1366
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
1367
+ work_state?: {
1368
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1369
+ source: "absent" | "constrained" | "validated";
1370
+ required_inputs?: {
1371
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1372
+ locator: string | null;
1373
+ description: string;
1374
+ }[] | undefined;
1375
+ } | undefined;
1376
+ }, {
1377
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
1378
+ noChanges?: boolean | undefined;
1379
+ checks?: "failed" | "not_configured" | "passed" | undefined;
1380
+ review?: "approved" | "blocked" | "not_run" | undefined;
1381
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
1382
+ work_state?: {
1383
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1384
+ source: "absent" | "constrained" | "validated";
1385
+ required_inputs?: {
1386
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1387
+ locator?: string | null | undefined;
1388
+ description: string;
1389
+ }[] | undefined;
1390
+ } | undefined;
1391
+ }>>>;
1392
+ failure: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1393
+ phase: z.ZodDefault<z.ZodString>;
1394
+ category: z.ZodDefault<z.ZodEnum<["validation", "project", "auth", "harness_unavailable", "harness_error", "config_error", "budget", "policy", "cancelled", "internal", "unknown"]>>;
1395
+ code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable", "delegation_child_drain_timeout", "subscription_window_exhausted", "delegated_home_unavailable", "delegated_confinement_unavailable", "delegated_evidence_incomplete"]>>>;
1396
+ harnessId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1397
+ attemptId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1398
+ safeMessage: z.ZodString;
1399
+ rawDetailRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1400
+ logRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1401
+ eventRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1402
+ runDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1403
+ resetsAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1404
+ nextActions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1405
+ }, "strip", z.ZodTypeAny, {
1406
+ phase: string;
1407
+ category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
1408
+ code: "budget_overshoot" | "cost_unverifiable" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "subscription_window_exhausted" | "unknown_paid_in_flight" | null;
1409
+ harnessId: string | null;
1410
+ attemptId: string | null;
1411
+ safeMessage: string;
1412
+ rawDetailRef: string | null;
1413
+ logRefs: string[];
1414
+ eventRefs: string[];
1415
+ runDir: string | null;
1416
+ resetsAt: string | null;
1417
+ nextActions: string[];
1418
+ }, {
1419
+ phase?: string | undefined;
1420
+ category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
1421
+ code?: "budget_overshoot" | "cost_unverifiable" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "subscription_window_exhausted" | "unknown_paid_in_flight" | null | undefined;
1422
+ harnessId?: string | null | undefined;
1423
+ attemptId?: string | null | undefined;
1424
+ safeMessage: string;
1425
+ rawDetailRef?: string | null | undefined;
1426
+ logRefs?: string[] | undefined;
1427
+ eventRefs?: string[] | undefined;
1428
+ runDir?: string | null | undefined;
1429
+ resetsAt?: string | null | undefined;
1430
+ nextActions?: string[] | undefined;
1431
+ }>>>;
1432
+ outcomeBanner: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1433
+ applyEligibility: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1434
+ eligible: z.ZodBoolean;
1435
+ state: z.ZodNullable<z.ZodString>;
1436
+ reason: z.ZodNullable<z.ZodString>;
1437
+ requiredAction: z.ZodNullable<z.ZodString>;
1438
+ }, "strip", z.ZodTypeAny, {
1439
+ eligible: boolean;
1440
+ state: string | null;
1441
+ reason: string | null;
1442
+ requiredAction: string | null;
1443
+ }, {
1444
+ eligible: boolean;
1445
+ state: string | null;
1446
+ reason: string | null;
1447
+ requiredAction: string | null;
1448
+ }>>>;
1449
+ planReadiness: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1450
+ state: z.ZodEnum<["ready", "needs_answers", "unverified"]>;
1451
+ questionCount: z.ZodDefault<z.ZodNumber>;
1452
+ }, "strict", z.ZodTypeAny, {
1453
+ state: "needs_answers" | "ready" | "unverified";
1454
+ questionCount: number;
1455
+ }, {
1456
+ state: "needs_answers" | "ready" | "unverified";
1457
+ questionCount?: number | undefined;
1458
+ }>>>;
1459
+ /** Council membership + merge disclosure (QA-023b), projected from the same
1460
+ * GET /runs/:id detail every read surface shares; null for solo/non-plan runs. */
1461
+ council: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1462
+ requested: z.ZodNumber;
1463
+ drafted: z.ZodNumber;
1464
+ degraded: z.ZodDefault<z.ZodBoolean>;
1465
+ mergedBy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1466
+ members: z.ZodDefault<z.ZodArray<z.ZodObject<{
1467
+ harnessId: z.ZodString;
1468
+ role: z.ZodEnum<["primary", "member"]>;
1469
+ status: z.ZodEnum<["drafted", "failed", "merged"]>;
1470
+ error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1471
+ }, "strict", z.ZodTypeAny, {
1472
+ harnessId: string;
1473
+ role: "member" | "primary";
1474
+ status: "drafted" | "failed" | "merged";
1475
+ error: string | null;
1476
+ }, {
1477
+ harnessId: string;
1478
+ role: "member" | "primary";
1479
+ status: "drafted" | "failed" | "merged";
1480
+ error?: string | null | undefined;
1481
+ }>, "many">>;
1482
+ }, "strict", z.ZodTypeAny, {
1483
+ requested: number;
1484
+ drafted: number;
1485
+ degraded: boolean;
1486
+ mergedBy: string | null;
1487
+ members: {
1488
+ harnessId: string;
1489
+ role: "member" | "primary";
1490
+ status: "drafted" | "failed" | "merged";
1491
+ error: string | null;
1492
+ }[];
1493
+ }, {
1494
+ requested: number;
1495
+ drafted: number;
1496
+ degraded?: boolean | undefined;
1497
+ mergedBy?: string | null | undefined;
1498
+ members?: {
1499
+ harnessId: string;
1500
+ role: "member" | "primary";
1501
+ status: "drafted" | "failed" | "merged";
1502
+ error?: string | null | undefined;
1503
+ }[] | undefined;
1504
+ }>>>;
1505
+ /** Run budget snapshot (QA-023c) carrying BOTH exact billed cash and the
1506
+ * separate subscription valuation, so an MCP host learns a native-subscription
1507
+ * run's real resource cost (cash $0 + non-null valuation) without reading
1508
+ * local artifacts; null when no budget snapshot is available. */
1509
+ budget: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1510
+ paidBudget: z.ZodDefault<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1511
+ kind: z.ZodLiteral<"unlimited">;
1512
+ }, "strict", z.ZodTypeAny, {
1513
+ kind: "unlimited";
1514
+ }, {
1515
+ kind: "unlimited";
1516
+ }>, z.ZodObject<{
1517
+ kind: z.ZodLiteral<"finite">;
1518
+ maxUsd: z.ZodNumber;
1519
+ }, "strict", z.ZodTypeAny, {
1520
+ kind: "finite";
1521
+ maxUsd: number;
1522
+ }, {
1523
+ kind: "finite";
1524
+ maxUsd: number;
1525
+ }>]>>;
1526
+ spendUsd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1527
+ valuationUsd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1528
+ valuationKnowledge: z.ZodDefault<z.ZodEnum<["exact", "estimated", "unknown"]>>;
1529
+ remainingUsd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1530
+ estimated: z.ZodDefault<z.ZodBoolean>;
1531
+ source: z.ZodDefault<z.ZodEnum<["decision", "events", "settings", "unknown"]>>;
1532
+ evidence: z.ZodDefault<z.ZodEnum<["complete", "incomplete", "unavailable"]>>;
1533
+ }, "strip", z.ZodTypeAny, {
1534
+ paidBudget: {
1535
+ kind: "unlimited";
1536
+ } | {
1537
+ kind: "finite";
1538
+ maxUsd: number;
1539
+ };
1540
+ spendUsd: number | null;
1541
+ valuationUsd: number | null;
1542
+ valuationKnowledge: "estimated" | "exact" | "unknown";
1543
+ remainingUsd: number | null;
1544
+ estimated: boolean;
1545
+ source: "decision" | "events" | "settings" | "unknown";
1546
+ evidence: "complete" | "incomplete" | "unavailable";
1547
+ }, {
1548
+ paidBudget?: {
1549
+ kind: "unlimited";
1550
+ } | {
1551
+ kind: "finite";
1552
+ maxUsd: number;
1553
+ } | undefined;
1554
+ spendUsd?: number | null | undefined;
1555
+ valuationUsd?: number | null | undefined;
1556
+ valuationKnowledge?: "estimated" | "exact" | "unknown" | undefined;
1557
+ remainingUsd?: number | null | undefined;
1558
+ estimated?: boolean | undefined;
1559
+ source?: "decision" | "events" | "settings" | "unknown" | undefined;
1560
+ evidence?: "complete" | "incomplete" | "unavailable" | undefined;
1561
+ }>>>;
1562
+ parentRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1563
+ delegatedFromRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1564
+ delegation: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodObject<{
1565
+ requested: z.ZodDefault<z.ZodBoolean>;
1566
+ effective: z.ZodDefault<z.ZodBoolean>;
1567
+ used: z.ZodDefault<z.ZodBoolean>;
1568
+ reason: z.ZodDefault<z.ZodEnum<["pending", "not_requested", "injected_unused", "used", "runtime_unavailable", "manifest_unsupported", "access_profile_incompatible", "partially_degraded", "startup_failed"]>>;
1569
+ remediation: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1570
+ }, "strict", z.ZodTypeAny, {
1571
+ requested: boolean;
1572
+ effective: boolean;
1573
+ used: boolean;
1574
+ reason: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used";
1575
+ remediation: string | null;
1576
+ }, {
1577
+ requested?: boolean | undefined;
1578
+ effective?: boolean | undefined;
1579
+ used?: boolean | undefined;
1580
+ reason?: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used" | undefined;
1581
+ remediation?: string | null | undefined;
1582
+ }>, {
1583
+ requested: boolean;
1584
+ effective: boolean;
1585
+ used: boolean;
1586
+ reason: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used";
1587
+ remediation: string | null;
1588
+ }, {
1589
+ requested?: boolean | undefined;
1590
+ effective?: boolean | undefined;
1591
+ used?: boolean | undefined;
1592
+ reason?: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used" | undefined;
1593
+ remediation?: string | null | undefined;
1594
+ }>>>;
1595
+ detailProblem: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1596
+ code: z.ZodNullable<z.ZodString>;
1597
+ message: z.ZodString;
1598
+ retryable: z.ZodNullable<z.ZodBoolean>;
1599
+ }, "strict", z.ZodTypeAny, {
1600
+ code: string | null;
1601
+ message: string;
1602
+ retryable: boolean | null;
1603
+ }, {
1604
+ code: string | null;
1605
+ message: string;
1606
+ retryable: boolean | null;
1607
+ }>>>;
1608
+ }, "strict", z.ZodTypeAny, {
1609
+ summary: string;
1610
+ runId: string | null;
1611
+ runDir: string | null;
1612
+ status: string | null;
1613
+ runFacts: {
1614
+ schema_version: 2;
1615
+ run_id: string;
1616
+ task_id: string;
1617
+ mode: "agent" | "ask" | "plan";
1618
+ outcome: {
1619
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
1620
+ noChanges: boolean;
1621
+ checks: "failed" | "not_configured" | "passed";
1622
+ review: "approved" | "blocked" | "not_run";
1623
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
1624
+ work_state?: {
1625
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1626
+ source: "absent" | "constrained" | "validated";
1627
+ required_inputs?: {
1628
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1629
+ locator: string | null;
1630
+ description: string;
1631
+ }[] | undefined;
1632
+ } | undefined;
1633
+ };
1634
+ deliverable: {
1635
+ present: boolean;
1636
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
1637
+ path: string | null;
1638
+ producer_attempt_id: string | null;
1639
+ };
1640
+ presentation?: {
1641
+ state: "diagnostic" | "ready";
1642
+ primary: {
1643
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
1644
+ path: string;
1645
+ } | null;
1646
+ } | undefined;
1647
+ participants: {
1648
+ planners: number;
1649
+ attempts: {
1650
+ attempt_id: string | null;
1651
+ harness_id: string;
1652
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
1653
+ deliverable_present: boolean;
1654
+ status: "blocked" | "failed" | "success" | "success_with_warnings" | null;
1655
+ }[];
1656
+ };
1657
+ gates: {
1658
+ configured: boolean;
1659
+ required: number;
1660
+ total: number;
1661
+ executed: boolean;
1662
+ state: "failed" | "not_configured" | "passed" | "skipped";
1663
+ receipt_attempt_id: string | null;
1664
+ };
1665
+ review: {
1666
+ state: "approved" | "blocked" | "not_run";
1667
+ blocker_ids: string[];
1668
+ blockers: number;
1669
+ };
1670
+ apply: {
1671
+ eligibility: {
1672
+ eligible: boolean;
1673
+ state: string | null;
1674
+ reason: string | null;
1675
+ requiredAction: string | null;
1676
+ } | null;
1677
+ operator_decision_present: boolean;
1678
+ };
1679
+ required_actions: {
1680
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
1681
+ detail: string;
1682
+ }[];
1683
+ generated_at: string;
1684
+ } | null;
1685
+ decisionStatus: string | null;
1686
+ pendingInteractions: number | null;
1687
+ outcomeFacts: {
1688
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
1689
+ noChanges: boolean;
1690
+ checks: "failed" | "not_configured" | "passed";
1691
+ review: "approved" | "blocked" | "not_run";
1692
+ reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
1693
+ work_state?: {
1694
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1695
+ source: "absent" | "constrained" | "validated";
1696
+ required_inputs?: {
1697
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1698
+ locator: string | null;
1699
+ description: string;
1700
+ }[] | undefined;
1701
+ } | undefined;
1702
+ } | null;
1703
+ failure: {
1704
+ phase: string;
1705
+ category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
1706
+ code: "budget_overshoot" | "cost_unverifiable" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "subscription_window_exhausted" | "unknown_paid_in_flight" | null;
1707
+ harnessId: string | null;
1708
+ attemptId: string | null;
1709
+ safeMessage: string;
1710
+ rawDetailRef: string | null;
1711
+ logRefs: string[];
1712
+ eventRefs: string[];
1713
+ runDir: string | null;
1714
+ resetsAt: string | null;
1715
+ nextActions: string[];
1716
+ } | null;
1717
+ outcomeBanner: string | null;
1718
+ applyEligibility: {
1719
+ eligible: boolean;
1720
+ state: string | null;
1721
+ reason: string | null;
1722
+ requiredAction: string | null;
1723
+ } | null;
1724
+ planReadiness: {
1725
+ state: "needs_answers" | "ready" | "unverified";
1726
+ questionCount: number;
1727
+ } | null;
1728
+ council: {
1729
+ requested: number;
1730
+ drafted: number;
1731
+ degraded: boolean;
1732
+ mergedBy: string | null;
1733
+ members: {
1734
+ harnessId: string;
1735
+ role: "member" | "primary";
1736
+ status: "drafted" | "failed" | "merged";
1737
+ error: string | null;
1738
+ }[];
1739
+ } | null;
1740
+ budget: {
1741
+ paidBudget: {
1742
+ kind: "unlimited";
1743
+ } | {
1744
+ kind: "finite";
1745
+ maxUsd: number;
1746
+ };
1747
+ spendUsd: number | null;
1748
+ valuationUsd: number | null;
1749
+ valuationKnowledge: "estimated" | "exact" | "unknown";
1750
+ remainingUsd: number | null;
1751
+ estimated: boolean;
1752
+ source: "decision" | "events" | "settings" | "unknown";
1753
+ evidence: "complete" | "incomplete" | "unavailable";
1754
+ } | null;
1755
+ parentRunId: string | null;
1756
+ delegatedFromRunId: string | null;
1757
+ delegation: {
1758
+ requested: boolean;
1759
+ effective: boolean;
1760
+ used: boolean;
1761
+ reason: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used";
1762
+ remediation: string | null;
1763
+ } | null;
1764
+ detailProblem: {
1765
+ code: string | null;
1766
+ message: string;
1767
+ retryable: boolean | null;
1768
+ } | null;
1769
+ }, {
1770
+ summary: string;
1771
+ runId?: string | null | undefined;
1772
+ runDir?: string | null | undefined;
1773
+ status?: string | null | undefined;
1774
+ runFacts?: {
1775
+ schema_version: 2;
1776
+ run_id: string;
1777
+ task_id: string;
1778
+ mode: "agent" | "ask" | "plan";
1779
+ outcome: {
1780
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
1781
+ noChanges?: boolean | undefined;
1782
+ checks?: "failed" | "not_configured" | "passed" | undefined;
1783
+ review?: "approved" | "blocked" | "not_run" | undefined;
1784
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
1785
+ work_state?: {
1786
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1787
+ source: "absent" | "constrained" | "validated";
1788
+ required_inputs?: {
1789
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1790
+ locator?: string | null | undefined;
1791
+ description: string;
1792
+ }[] | undefined;
1793
+ } | undefined;
1794
+ };
1795
+ deliverable: {
1796
+ present: boolean;
1797
+ kind: "answer" | "patch" | "plan" | "report" | "structured_output" | null;
1798
+ path: string | null;
1799
+ producer_attempt_id?: string | null | undefined;
1800
+ };
1801
+ presentation?: {
1802
+ state: "diagnostic" | "ready";
1803
+ primary: {
1804
+ kind: "answer" | "diagnostic" | "patch" | "plan" | "report" | "structured_output";
1805
+ path: string;
1806
+ } | null;
1807
+ } | undefined;
1808
+ participants: {
1809
+ planners: number;
1810
+ attempts?: {
1811
+ attempt_id: string | null;
1812
+ harness_id: string;
1813
+ role: "candidate" | "merge" | "planner" | "reducer" | "reviewer" | "scout";
1814
+ deliverable_present?: boolean | undefined;
1815
+ status?: "blocked" | "failed" | "success" | "success_with_warnings" | null | undefined;
1816
+ }[] | undefined;
1817
+ };
1818
+ gates: {
1819
+ configured: boolean;
1820
+ required: number;
1821
+ total: number;
1822
+ executed: boolean;
1823
+ state: "failed" | "not_configured" | "passed" | "skipped";
1824
+ receipt_attempt_id?: string | null | undefined;
1825
+ };
1826
+ review: {
1827
+ state: "approved" | "blocked" | "not_run";
1828
+ blocker_ids?: string[] | undefined;
1829
+ blockers: number;
1830
+ };
1831
+ apply: {
1832
+ eligibility?: {
1833
+ eligible: boolean;
1834
+ state: string | null;
1835
+ reason: string | null;
1836
+ requiredAction: string | null;
1837
+ } | null | undefined;
1838
+ operator_decision_present?: boolean | undefined;
1839
+ };
1840
+ required_actions?: {
1841
+ id: "complete_incomplete_work" | "fix_failed_checks" | "provide_required_input" | "record_operator_decision" | "resolve_review_block";
1842
+ detail: string;
1843
+ }[] | undefined;
1844
+ generated_at: string;
1845
+ } | null | undefined;
1846
+ decisionStatus?: string | null | undefined;
1847
+ pendingInteractions?: number | null | undefined;
1848
+ outcomeFacts?: {
1849
+ lifecycle: "cancelled" | "failed" | "interrupted" | "succeeded";
1850
+ noChanges?: boolean | undefined;
1851
+ checks?: "failed" | "not_configured" | "passed" | undefined;
1852
+ review?: "approved" | "blocked" | "not_run" | undefined;
1853
+ reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "input_required" | "no_changes" | "not_converged" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
1854
+ work_state?: {
1855
+ state: "completed" | "incomplete" | "needs_input" | "unverified";
1856
+ source: "absent" | "constrained" | "validated";
1857
+ required_inputs?: {
1858
+ kind: "context" | "credential" | "decision" | "external_dependency" | "file" | "permission";
1859
+ locator?: string | null | undefined;
1860
+ description: string;
1861
+ }[] | undefined;
1862
+ } | undefined;
1863
+ } | null | undefined;
1864
+ failure?: {
1865
+ phase?: string | undefined;
1866
+ category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
1867
+ code?: "budget_overshoot" | "cost_unverifiable" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "subscription_window_exhausted" | "unknown_paid_in_flight" | null | undefined;
1868
+ harnessId?: string | null | undefined;
1869
+ attemptId?: string | null | undefined;
1870
+ safeMessage: string;
1871
+ rawDetailRef?: string | null | undefined;
1872
+ logRefs?: string[] | undefined;
1873
+ eventRefs?: string[] | undefined;
1874
+ runDir?: string | null | undefined;
1875
+ resetsAt?: string | null | undefined;
1876
+ nextActions?: string[] | undefined;
1877
+ } | null | undefined;
1878
+ outcomeBanner?: string | null | undefined;
1879
+ applyEligibility?: {
1880
+ eligible: boolean;
1881
+ state: string | null;
1882
+ reason: string | null;
1883
+ requiredAction: string | null;
1884
+ } | null | undefined;
1885
+ planReadiness?: {
1886
+ state: "needs_answers" | "ready" | "unverified";
1887
+ questionCount?: number | undefined;
1888
+ } | null | undefined;
1889
+ council?: {
1890
+ requested: number;
1891
+ drafted: number;
1892
+ degraded?: boolean | undefined;
1893
+ mergedBy?: string | null | undefined;
1894
+ members?: {
1895
+ harnessId: string;
1896
+ role: "member" | "primary";
1897
+ status: "drafted" | "failed" | "merged";
1898
+ error?: string | null | undefined;
1899
+ }[] | undefined;
1900
+ } | null | undefined;
1901
+ budget?: {
1902
+ paidBudget?: {
1903
+ kind: "unlimited";
1904
+ } | {
1905
+ kind: "finite";
1906
+ maxUsd: number;
1907
+ } | undefined;
1908
+ spendUsd?: number | null | undefined;
1909
+ valuationUsd?: number | null | undefined;
1910
+ valuationKnowledge?: "estimated" | "exact" | "unknown" | undefined;
1911
+ remainingUsd?: number | null | undefined;
1912
+ estimated?: boolean | undefined;
1913
+ source?: "decision" | "events" | "settings" | "unknown" | undefined;
1914
+ evidence?: "complete" | "incomplete" | "unavailable" | undefined;
1915
+ } | null | undefined;
1916
+ parentRunId?: string | null | undefined;
1917
+ delegatedFromRunId?: string | null | undefined;
1918
+ delegation?: {
1919
+ requested?: boolean | undefined;
1920
+ effective?: boolean | undefined;
1921
+ used?: boolean | undefined;
1922
+ reason?: "access_profile_incompatible" | "injected_unused" | "manifest_unsupported" | "not_requested" | "partially_degraded" | "pending" | "runtime_unavailable" | "startup_failed" | "used" | undefined;
1923
+ remediation?: string | null | undefined;
1924
+ } | null | undefined;
1925
+ detailProblem?: {
1926
+ code: string | null;
1927
+ message: string;
1928
+ retryable: boolean | null;
1929
+ } | null | undefined;
1930
+ }>;
1931
+ export type McpRunHandleResult = z.infer<typeof McpRunHandleResult>;
1932
+ //# sourceMappingURL=mcp-run-result.d.ts.map