@claudexor/schema 2.1.3 → 3.0.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 (174) hide show
  1. package/dist/agent-capabilities.d.ts +32 -24
  2. package/dist/agent-capabilities.d.ts.map +1 -1
  3. package/dist/agent-capabilities.js +20 -11
  4. package/dist/agent-capabilities.js.map +1 -1
  5. package/dist/apply-eligibility.d.ts +166 -0
  6. package/dist/apply-eligibility.d.ts.map +1 -1
  7. package/dist/apply-eligibility.js +63 -2
  8. package/dist/apply-eligibility.js.map +1 -1
  9. package/dist/attachment.d.ts +5 -5
  10. package/dist/budget.d.ts +4 -4
  11. package/dist/config.d.ts +59 -41
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/config.js +16 -6
  14. package/dist/config.js.map +1 -1
  15. package/dist/context.d.ts +6 -6
  16. package/dist/control-operation-responses.d.ts +190 -97
  17. package/dist/control-operation-responses.d.ts.map +1 -1
  18. package/dist/control-operation-responses.js +14 -1
  19. package/dist/control-operation-responses.js.map +1 -1
  20. package/dist/control-run-detail.d.ts +347 -215
  21. package/dist/control-run-detail.d.ts.map +1 -1
  22. package/dist/control-run-detail.js +34 -7
  23. package/dist/control-run-detail.js.map +1 -1
  24. package/dist/control-thread-apply.d.ts +5 -5
  25. package/dist/control-trust.d.ts +6 -6
  26. package/dist/control.d.ts +769 -306
  27. package/dist/control.d.ts.map +1 -1
  28. package/dist/control.js +164 -61
  29. package/dist/control.js.map +1 -1
  30. package/dist/credential-profile.d.ts +400 -1
  31. package/dist/credential-profile.d.ts.map +1 -1
  32. package/dist/credential-profile.js +109 -4
  33. package/dist/credential-profile.js.map +1 -1
  34. package/dist/decision.d.ts +78 -14
  35. package/dist/decision.d.ts.map +1 -1
  36. package/dist/decision.js +53 -20
  37. package/dist/decision.js.map +1 -1
  38. package/dist/delivery.d.ts +3 -3
  39. package/dist/delivery.js +1 -1
  40. package/dist/delivery.js.map +1 -1
  41. package/dist/events.d.ts +32 -6
  42. package/dist/events.d.ts.map +1 -1
  43. package/dist/events.js +45 -11
  44. package/dist/events.js.map +1 -1
  45. package/dist/gate.d.ts +4 -4
  46. package/dist/gate.d.ts.map +1 -1
  47. package/dist/gate.js +2 -2
  48. package/dist/gate.js.map +1 -1
  49. package/dist/harness.d.ts +137 -47
  50. package/dist/harness.d.ts.map +1 -1
  51. package/dist/harness.js +65 -16
  52. package/dist/harness.js.map +1 -1
  53. package/dist/index.d.ts +4 -3
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +4 -3
  56. package/dist/index.js.map +1 -1
  57. package/dist/operation.d.ts +66 -7
  58. package/dist/operation.d.ts.map +1 -1
  59. package/dist/operation.js +29 -2
  60. package/dist/operation.js.map +1 -1
  61. package/dist/output-schema.d.ts +40 -0
  62. package/dist/output-schema.d.ts.map +1 -0
  63. package/dist/output-schema.js +109 -0
  64. package/dist/output-schema.js.map +1 -0
  65. package/dist/plan.d.ts +206 -0
  66. package/dist/plan.d.ts.map +1 -0
  67. package/dist/plan.js +107 -0
  68. package/dist/plan.js.map +1 -0
  69. package/dist/primitives.d.ts +14 -10
  70. package/dist/primitives.d.ts.map +1 -1
  71. package/dist/primitives.js +14 -11
  72. package/dist/primitives.js.map +1 -1
  73. package/dist/project.d.ts +75 -0
  74. package/dist/project.d.ts.map +1 -1
  75. package/dist/project.js +17 -0
  76. package/dist/project.js.map +1 -1
  77. package/dist/quota.d.ts +119 -0
  78. package/dist/quota.d.ts.map +1 -1
  79. package/dist/quota.js +22 -0
  80. package/dist/quota.js.map +1 -1
  81. package/dist/raw.d.ts +4 -4
  82. package/dist/readiness.d.ts +14 -7
  83. package/dist/readiness.d.ts.map +1 -1
  84. package/dist/run-strategy.d.ts +17 -0
  85. package/dist/run-strategy.d.ts.map +1 -0
  86. package/dist/run-strategy.js +47 -0
  87. package/dist/run-strategy.js.map +1 -0
  88. package/dist/setup.d.ts +160 -160
  89. package/dist/status-projection.d.ts +78 -0
  90. package/dist/status-projection.d.ts.map +1 -0
  91. package/dist/status-projection.js +171 -0
  92. package/dist/status-projection.js.map +1 -0
  93. package/dist/task.d.ts +48 -316
  94. package/dist/task.d.ts.map +1 -1
  95. package/dist/task.js +3 -60
  96. package/dist/task.js.map +1 -1
  97. package/dist/telemetry.d.ts +89 -89
  98. package/dist/thread.d.ts +167 -32
  99. package/dist/thread.d.ts.map +1 -1
  100. package/dist/thread.js +92 -28
  101. package/dist/thread.js.map +1 -1
  102. package/dist/tool-ref.d.ts +1 -1
  103. package/generated/AgentCapabilityCatalog.schema.json +4 -6
  104. package/generated/ApplyEligibility.schema.json +1 -1
  105. package/generated/BudgetLease.schema.json +1 -2
  106. package/generated/ConformanceReport.schema.json +1 -2
  107. package/generated/ContinuityDisclosure.schema.json +74 -0
  108. package/generated/ControlApplyRequest.schema.json +1 -2
  109. package/generated/ControlCredentialProfileUpdateRequest.schema.json +20 -0
  110. package/generated/ControlCredentialProfileUpdateResponse.schema.json +142 -0
  111. package/generated/ControlCredentialProfilesResponse.schema.json +126 -2
  112. package/generated/ControlDeliveryResponse.schema.json +0 -1
  113. package/generated/ControlHandshakeResponse.schema.json +31 -3
  114. package/generated/ControlHarnessListResponse.schema.json +11 -6
  115. package/generated/ControlHarnessSettingsPatch.schema.json +4 -0
  116. package/generated/ControlOperationCatalog.schema.json +16 -1
  117. package/generated/ControlOperationDescriptor.schema.json +15 -0
  118. package/generated/ControlProject.schema.json +35 -0
  119. package/generated/ControlProjectListResponse.schema.json +35 -0
  120. package/generated/ControlProjectOutputsResponse.schema.json +57 -0
  121. package/generated/ControlQueuedRunInfo.schema.json +2 -11
  122. package/generated/ControlQuotaResponse.schema.json +42 -0
  123. package/generated/ControlRunAgainDraft.schema.json +37 -35
  124. package/generated/ControlRunDecisionRequest.schema.json +0 -1
  125. package/generated/ControlRunDetail.schema.json +292 -213
  126. package/generated/ControlRunListResponse.schema.json +88 -27
  127. package/generated/ControlRunStartRequest.schema.json +37 -35
  128. package/generated/ControlRunStartResponse.schema.json +2 -11
  129. package/generated/ControlRunSummary.schema.json +88 -27
  130. package/generated/ControlSettingsSnapshot.schema.json +6 -11
  131. package/generated/ControlSettingsUpdateRequest.schema.json +5 -10
  132. package/generated/ControlThread.schema.json +21 -3
  133. package/generated/ControlThreadApplyResponse.schema.json +0 -1
  134. package/generated/ControlThreadCreateRequest.schema.json +12 -3
  135. package/generated/ControlThreadDetail.schema.json +174 -16
  136. package/generated/ControlThreadListResponse.schema.json +60 -3
  137. package/generated/ControlThreadTurnRequest.schema.json +40 -34
  138. package/generated/ControlThreadUpdateRequest.schema.json +19 -0
  139. package/generated/DecisionRecord.schema.json +73 -33
  140. package/generated/GateResult.schema.json +1 -2
  141. package/generated/GlobalConfig.schema.json +7 -12
  142. package/generated/HarnessManifest.schema.json +11 -6
  143. package/generated/HarnessStatusDto.schema.json +11 -6
  144. package/generated/LaneCheckpoint.schema.json +59 -0
  145. package/generated/McpRunHandleResult.schema.json +234 -0
  146. package/generated/McpRunToolResult.schema.json +124 -2
  147. package/generated/RoutePrimaryDivergedPayload.schema.json +56 -0
  148. package/generated/RunEvent.schema.json +9 -5
  149. package/generated/RunTelemetry.schema.json +2 -4
  150. package/generated/TaskContract.schema.json +3 -135
  151. package/generated/Thread.schema.json +21 -3
  152. package/generated/ThreadTurn.schema.json +88 -0
  153. package/package.json +2 -2
  154. package/dist/control-spec.d.ts +0 -603
  155. package/dist/control-spec.d.ts.map +0 -1
  156. package/dist/control-spec.js +0 -87
  157. package/dist/control-spec.js.map +0 -1
  158. package/dist/orchestrate.d.ts +0 -556
  159. package/dist/orchestrate.d.ts.map +0 -1
  160. package/dist/orchestrate.js +0 -356
  161. package/dist/orchestrate.js.map +0 -1
  162. package/dist/spec.d.ts +0 -678
  163. package/dist/spec.d.ts.map +0 -1
  164. package/dist/spec.js +0 -186
  165. package/dist/spec.js.map +0 -1
  166. package/generated/ControlSpecAnswersRequest.schema.json +0 -74
  167. package/generated/ControlSpecQuestionsRequest.schema.json +0 -209
  168. package/generated/ControlSpecSession.schema.json +0 -261
  169. package/generated/ControlSpecSessionListResponse.schema.json +0 -273
  170. package/generated/OrchestrateContract.schema.json +0 -119
  171. package/generated/OrchestratePlan.schema.json +0 -264
  172. package/generated/OrchestratePlanProgress.schema.json +0 -164
  173. package/generated/SessionReboundLineage.schema.json +0 -73
  174. package/generated/SpecPack.schema.json +0 -483
package/dist/control.d.ts CHANGED
@@ -29,8 +29,8 @@ export type ControlReviewerPanelEntry = z.infer<typeof ControlReviewerPanelEntry
29
29
  export declare const ControlRunStartRequest: z.ZodObject<{
30
30
  prompt: z.ZodDefault<z.ZodString>;
31
31
  /** Caller-supplied system-level instructions layered onto every
32
- * task-producing lane (primary, candidate, planner, explorer,
33
- * orchestrate-planner) — never reviewers, synthesis, or the auth smoke.
32
+ * task-producing lane (primary, candidate, planner, explorer) — never
33
+ * reviewers, synthesis, or the auth smoke.
34
34
  * Scanned by the inline-secret fence like the prompt (INV-062). */
35
35
  instructions: z.ZodOptional<z.ZodString>;
36
36
  /** Immutable daemon resource ids; upload/finalize happens before enqueue. */
@@ -41,7 +41,7 @@ export declare const ControlRunStartRequest: z.ZodObject<{
41
41
  }, {
42
42
  resourceId: string;
43
43
  }>, "many">>;
44
- mode: z.ZodDefault<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
44
+ mode: z.ZodDefault<z.ZodEnum<["ask", "plan", "agent"]>>;
45
45
  scope: z.ZodDefault<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
46
46
  kind: z.ZodLiteral<"project">;
47
47
  root: z.ZodString;
@@ -86,10 +86,17 @@ export declare const ControlRunStartRequest: z.ZodObject<{
86
86
  attempts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
87
87
  /** agent flag: iterate until the convergence predicate is clean (no fixed cap). */
88
88
  untilClean: z.ZodOptional<z.ZodBoolean>;
89
- /** audit flag: bounded read-only research swarm (the old `explore`). */
90
- swarm: z.ZodOptional<z.ZodBoolean>;
89
+ /** ask flag: widen the answer into a bounded multi-scout research sweep
90
+ * with synthesis (the old `audit --swarm` / `explore`). */
91
+ deepScan: z.ZodOptional<z.ZodBoolean>;
91
92
  /** agent flag: create-from-scratch intent (the old `create` mode). */
92
93
  create: z.ZodOptional<z.ZodBoolean>;
94
+ /** plan strategy (D31/INV-031): N harnesses draft plans in parallel, the
95
+ * primary merges them into ONE unified plan whose open questions reach the
96
+ * user as one set. `n` (2..4) sets the member count; default = distinct
97
+ * available harnesses up to 3. Legal only on mode=plan (and `n` on a plan
98
+ * run is legal ONLY with council). */
99
+ council: z.ZodOptional<z.ZodBoolean>;
93
100
  /** Best-of-N synthesis policy. `auto` (default) only synthesizes a 3rd
94
101
  * candidate when n>=3 and candidates genuinely complement; `always`/`never`
95
102
  * force it. Threaded to the orchestrator's decideSynthesis. */
@@ -122,14 +129,14 @@ export declare const ControlRunStartRequest: z.ZodObject<{
122
129
  cwd: z.ZodOptional<z.ZodString>;
123
130
  envAllowlist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
124
131
  }, "strict", z.ZodTypeAny, {
125
- program: string;
126
132
  args: string[];
133
+ program: string;
127
134
  envAllowlist: string[];
128
135
  cwd?: string | undefined;
129
136
  }, {
130
137
  program: string;
131
- cwd?: string | undefined;
132
138
  args?: string[] | undefined;
139
+ cwd?: string | undefined;
133
140
  envAllowlist?: string[] | undefined;
134
141
  }>, "many">>;
135
142
  /** Typed per-run approval for changing auto-protected gate/test paths. This
@@ -144,9 +151,6 @@ export declare const ControlRunStartRequest: z.ZodObject<{
144
151
  path: string;
145
152
  reason?: string | undefined;
146
153
  }>, "many">>;
147
- specPath: z.ZodOptional<z.ZodString>;
148
- specId: z.ZodOptional<z.ZodString>;
149
- specHash: z.ZodOptional<z.ZodString>;
150
154
  /** Thread/session linkage: a run is a turn inside a thread. */
151
155
  threadId: z.ZodOptional<z.ZodString>;
152
156
  /** INTERNAL single-writer handoff: control-api pre-creates the turn and
@@ -156,12 +160,30 @@ export declare const ControlRunStartRequest: z.ZodObject<{
156
160
  turnId: z.ZodOptional<z.ZodString>;
157
161
  parentRunId: z.ZodOptional<z.ZodString>;
158
162
  retryOf: z.ZodOptional<z.ZodString>;
159
- /** When set, this turn implements an approved plan: the engine prefixes the
160
- * parent plan run's final/plan.md into the prompt (mode is forced to agent). */
163
+ /** When set, this turn implements an approved plan (mode is forced to
164
+ * agent); the plan is DELIVERED AS A FILE (planRef), never re-embedded
165
+ * into the prompt text. */
161
166
  planRunId: z.ZodOptional<z.ZodString>;
162
- /** Explicit reviewer panel. When present it overrides the legacy
163
- * per-provider-family reviewerModels/reviewerEfforts maps and preserves
164
- * duplicate harness entries for multi-model same-provider reviews. */
167
+ /** Server-owned frozen-plan reference (D17 freeze-on-implement): the plan
168
+ * run, the sha256 of its final/plan.md at implement time, and the
169
+ * engine-resolved absolute artifact path. The orchestrator re-reads the
170
+ * file, verifies the hash (tamper fence), and materializes it into the
171
+ * execution context; retry replays it verbatim so a retried implement can
172
+ * never silently run without its plan. */
173
+ planRef: z.ZodOptional<z.ZodObject<{
174
+ runId: z.ZodString;
175
+ sha256: z.ZodString;
176
+ path: z.ZodString;
177
+ }, "strict", z.ZodTypeAny, {
178
+ path: string;
179
+ sha256: string;
180
+ runId: string;
181
+ }, {
182
+ path: string;
183
+ sha256: string;
184
+ runId: string;
185
+ }>>;
186
+ /** Explicit reviewer panel; syntax + override semantics in the describe. */
165
187
  reviewerPanel: z.ZodOptional<z.ZodArray<z.ZodObject<{
166
188
  /** Explicit reviewer harness id. Repeated harness ids are allowed so one
167
189
  * native provider can review through multiple requested models. */
@@ -185,13 +207,13 @@ export declare const ControlRunStartRequest: z.ZodObject<{
185
207
  * durable registry by the engine — an unknown/disabled/mismatched id is a
186
208
  * typed refusal, never a silent default. */
187
209
  credentialProfileId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
188
- /** How much the orchestrate planner may act without confirmation
189
- * (suggest/auto_safe/auto_full). Only meaningful for mode=orchestrate;
190
- * consumed by the executor in runOrchestrate. */
191
- autonomy: z.ZodOptional<z.ZodEnum<["suggest", "auto_safe", "auto_full"]>>;
192
- /** Orchestrate executor: cap on plan tool calls. Only meaningful for
193
- * mode=orchestrate; consumed by executeOrchestratePlan. */
194
- maxToolCalls: z.ZodOptional<z.ZodNumber>;
210
+ /** Agent delegation belt toggle (D32). Agent-only: when true and the
211
+ * routed harness declares `capability_profile.mcp_injection`, the engine
212
+ * injects the scoped Claudexor delegation belt (ask/plan/isolated sub-run/
213
+ * best-of/status/result) into the harness sandbox so the harness can spawn
214
+ * bounded isolated sub-runs. Refused (typed preflight) on a non-agent mode
215
+ * or a harness that cannot inject. Default off. */
216
+ delegate: z.ZodOptional<z.ZodBoolean>;
195
217
  /** Hard wall-clock deadline for the WHOLE run, measured from scheduler
196
218
  * start. On expiry the run is cooperatively cancelled (hard-kill fallback)
197
219
  * and ends `cancelled` with reason `wall_clock_exceeded`, preserving partial
@@ -218,7 +240,7 @@ export declare const ControlRunStartRequest: z.ZodObject<{
218
240
  * max_turns support discloses the ignored knob instead of dropping it. */
219
241
  maxTurns: z.ZodOptional<z.ZodNumber>;
220
242
  }, "strict", z.ZodTypeAny, {
221
- mode: "ask" | "plan" | "audit" | "agent" | "orchestrate";
243
+ mode: "ask" | "plan" | "agent";
222
244
  prompt: string;
223
245
  scope: {
224
246
  kind: "project";
@@ -237,29 +259,35 @@ export declare const ControlRunStartRequest: z.ZodObject<{
237
259
  resourceId: string;
238
260
  }[] | undefined;
239
261
  browser?: boolean | undefined;
262
+ threadId?: string | undefined;
240
263
  turnId?: string | undefined;
241
264
  planRunId?: string | undefined;
265
+ planRef?: {
266
+ path: string;
267
+ sha256: string;
268
+ runId: string;
269
+ } | undefined;
242
270
  models?: Record<string, string> | undefined;
243
271
  harnesses?: string[] | undefined;
244
272
  model?: string | undefined;
245
273
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
246
274
  tests?: {
247
- program: string;
248
275
  args: string[];
276
+ program: string;
249
277
  envAllowlist: string[];
250
278
  cwd?: string | undefined;
251
279
  }[] | undefined;
252
- autonomy?: "suggest" | "auto_safe" | "auto_full" | undefined;
253
- n?: number | undefined;
254
280
  retryOf?: string | undefined;
255
281
  primaryHarness?: string | undefined;
256
282
  routingGoal?: "auto" | "quality" | "economy" | undefined;
257
283
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
258
284
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
285
+ n?: number | undefined;
259
286
  attempts?: number | null | undefined;
260
287
  untilClean?: boolean | undefined;
261
- swarm?: boolean | undefined;
288
+ deepScan?: boolean | undefined;
262
289
  create?: boolean | undefined;
290
+ council?: boolean | undefined;
263
291
  synthesis?: "auto" | "never" | "always" | undefined;
264
292
  paidBudget?: {
265
293
  kind: "unlimited";
@@ -272,10 +300,6 @@ export declare const ControlRunStartRequest: z.ZodObject<{
272
300
  path: string;
273
301
  reason?: string | undefined;
274
302
  }[] | undefined;
275
- specPath?: string | undefined;
276
- specId?: string | undefined;
277
- specHash?: string | undefined;
278
- threadId?: string | undefined;
279
303
  parentRunId?: string | undefined;
280
304
  reviewerPanel?: {
281
305
  harness: string;
@@ -284,7 +308,7 @@ export declare const ControlRunStartRequest: z.ZodObject<{
284
308
  }[] | undefined;
285
309
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
286
310
  credentialProfileId?: string | null | undefined;
287
- maxToolCalls?: number | undefined;
311
+ delegate?: boolean | undefined;
288
312
  maxSeconds?: number | undefined;
289
313
  denyPaths?: string[] | undefined;
290
314
  outputSchema?: Record<string, unknown> | undefined;
@@ -292,27 +316,31 @@ export declare const ControlRunStartRequest: z.ZodObject<{
292
316
  }, {
293
317
  web?: "off" | "auto" | "cached" | "live" | undefined;
294
318
  instructions?: string | undefined;
295
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
319
+ mode?: "ask" | "plan" | "agent" | undefined;
296
320
  prompt?: string | undefined;
297
321
  access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
298
322
  attachments?: {
299
323
  resourceId: string;
300
324
  }[] | undefined;
301
325
  browser?: boolean | undefined;
326
+ threadId?: string | undefined;
302
327
  turnId?: string | undefined;
303
328
  planRunId?: string | undefined;
329
+ planRef?: {
330
+ path: string;
331
+ sha256: string;
332
+ runId: string;
333
+ } | undefined;
304
334
  models?: Record<string, string> | undefined;
305
335
  harnesses?: string[] | undefined;
306
336
  model?: string | undefined;
307
337
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
308
338
  tests?: {
309
339
  program: string;
310
- cwd?: string | undefined;
311
340
  args?: string[] | undefined;
341
+ cwd?: string | undefined;
312
342
  envAllowlist?: string[] | undefined;
313
343
  }[] | undefined;
314
- autonomy?: "suggest" | "auto_safe" | "auto_full" | undefined;
315
- n?: number | undefined;
316
344
  retryOf?: string | undefined;
317
345
  scope?: {
318
346
  kind: "project";
@@ -328,10 +356,12 @@ export declare const ControlRunStartRequest: z.ZodObject<{
328
356
  routingGoal?: "auto" | "quality" | "economy" | undefined;
329
357
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
330
358
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
359
+ n?: number | undefined;
331
360
  attempts?: number | null | undefined;
332
361
  untilClean?: boolean | undefined;
333
- swarm?: boolean | undefined;
362
+ deepScan?: boolean | undefined;
334
363
  create?: boolean | undefined;
364
+ council?: boolean | undefined;
335
365
  synthesis?: "auto" | "never" | "always" | undefined;
336
366
  paidBudget?: {
337
367
  kind: "unlimited";
@@ -344,10 +374,6 @@ export declare const ControlRunStartRequest: z.ZodObject<{
344
374
  path: string;
345
375
  reason?: string | undefined;
346
376
  }[] | undefined;
347
- specPath?: string | undefined;
348
- specId?: string | undefined;
349
- specHash?: string | undefined;
350
- threadId?: string | undefined;
351
377
  parentRunId?: string | undefined;
352
378
  reviewerPanel?: {
353
379
  harness: string;
@@ -356,7 +382,7 @@ export declare const ControlRunStartRequest: z.ZodObject<{
356
382
  }[] | undefined;
357
383
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
358
384
  credentialProfileId?: string | null | undefined;
359
- maxToolCalls?: number | undefined;
385
+ delegate?: boolean | undefined;
360
386
  maxSeconds?: number | undefined;
361
387
  denyPaths?: string[] | undefined;
362
388
  outputSchema?: Record<string, unknown> | undefined;
@@ -404,8 +430,8 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
404
430
  request: z.ZodObject<{
405
431
  prompt: z.ZodDefault<z.ZodString>;
406
432
  /** Caller-supplied system-level instructions layered onto every
407
- * task-producing lane (primary, candidate, planner, explorer,
408
- * orchestrate-planner) — never reviewers, synthesis, or the auth smoke.
433
+ * task-producing lane (primary, candidate, planner, explorer) — never
434
+ * reviewers, synthesis, or the auth smoke.
409
435
  * Scanned by the inline-secret fence like the prompt (INV-062). */
410
436
  instructions: z.ZodOptional<z.ZodString>;
411
437
  /** Immutable daemon resource ids; upload/finalize happens before enqueue. */
@@ -416,7 +442,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
416
442
  }, {
417
443
  resourceId: string;
418
444
  }>, "many">>;
419
- mode: z.ZodDefault<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
445
+ mode: z.ZodDefault<z.ZodEnum<["ask", "plan", "agent"]>>;
420
446
  scope: z.ZodDefault<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
421
447
  kind: z.ZodLiteral<"project">;
422
448
  root: z.ZodString;
@@ -461,10 +487,17 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
461
487
  attempts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
462
488
  /** agent flag: iterate until the convergence predicate is clean (no fixed cap). */
463
489
  untilClean: z.ZodOptional<z.ZodBoolean>;
464
- /** audit flag: bounded read-only research swarm (the old `explore`). */
465
- swarm: z.ZodOptional<z.ZodBoolean>;
490
+ /** ask flag: widen the answer into a bounded multi-scout research sweep
491
+ * with synthesis (the old `audit --swarm` / `explore`). */
492
+ deepScan: z.ZodOptional<z.ZodBoolean>;
466
493
  /** agent flag: create-from-scratch intent (the old `create` mode). */
467
494
  create: z.ZodOptional<z.ZodBoolean>;
495
+ /** plan strategy (D31/INV-031): N harnesses draft plans in parallel, the
496
+ * primary merges them into ONE unified plan whose open questions reach the
497
+ * user as one set. `n` (2..4) sets the member count; default = distinct
498
+ * available harnesses up to 3. Legal only on mode=plan (and `n` on a plan
499
+ * run is legal ONLY with council). */
500
+ council: z.ZodOptional<z.ZodBoolean>;
468
501
  /** Best-of-N synthesis policy. `auto` (default) only synthesizes a 3rd
469
502
  * candidate when n>=3 and candidates genuinely complement; `always`/`never`
470
503
  * force it. Threaded to the orchestrator's decideSynthesis. */
@@ -497,14 +530,14 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
497
530
  cwd: z.ZodOptional<z.ZodString>;
498
531
  envAllowlist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
499
532
  }, "strict", z.ZodTypeAny, {
500
- program: string;
501
533
  args: string[];
534
+ program: string;
502
535
  envAllowlist: string[];
503
536
  cwd?: string | undefined;
504
537
  }, {
505
538
  program: string;
506
- cwd?: string | undefined;
507
539
  args?: string[] | undefined;
540
+ cwd?: string | undefined;
508
541
  envAllowlist?: string[] | undefined;
509
542
  }>, "many">>;
510
543
  /** Typed per-run approval for changing auto-protected gate/test paths. This
@@ -519,9 +552,6 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
519
552
  path: string;
520
553
  reason?: string | undefined;
521
554
  }>, "many">>;
522
- specPath: z.ZodOptional<z.ZodString>;
523
- specId: z.ZodOptional<z.ZodString>;
524
- specHash: z.ZodOptional<z.ZodString>;
525
555
  /** Thread/session linkage: a run is a turn inside a thread. */
526
556
  threadId: z.ZodOptional<z.ZodString>;
527
557
  /** INTERNAL single-writer handoff: control-api pre-creates the turn and
@@ -531,12 +561,30 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
531
561
  turnId: z.ZodOptional<z.ZodString>;
532
562
  parentRunId: z.ZodOptional<z.ZodString>;
533
563
  retryOf: z.ZodOptional<z.ZodString>;
534
- /** When set, this turn implements an approved plan: the engine prefixes the
535
- * parent plan run's final/plan.md into the prompt (mode is forced to agent). */
564
+ /** When set, this turn implements an approved plan (mode is forced to
565
+ * agent); the plan is DELIVERED AS A FILE (planRef), never re-embedded
566
+ * into the prompt text. */
536
567
  planRunId: z.ZodOptional<z.ZodString>;
537
- /** Explicit reviewer panel. When present it overrides the legacy
538
- * per-provider-family reviewerModels/reviewerEfforts maps and preserves
539
- * duplicate harness entries for multi-model same-provider reviews. */
568
+ /** Server-owned frozen-plan reference (D17 freeze-on-implement): the plan
569
+ * run, the sha256 of its final/plan.md at implement time, and the
570
+ * engine-resolved absolute artifact path. The orchestrator re-reads the
571
+ * file, verifies the hash (tamper fence), and materializes it into the
572
+ * execution context; retry replays it verbatim so a retried implement can
573
+ * never silently run without its plan. */
574
+ planRef: z.ZodOptional<z.ZodObject<{
575
+ runId: z.ZodString;
576
+ sha256: z.ZodString;
577
+ path: z.ZodString;
578
+ }, "strict", z.ZodTypeAny, {
579
+ path: string;
580
+ sha256: string;
581
+ runId: string;
582
+ }, {
583
+ path: string;
584
+ sha256: string;
585
+ runId: string;
586
+ }>>;
587
+ /** Explicit reviewer panel; syntax + override semantics in the describe. */
540
588
  reviewerPanel: z.ZodOptional<z.ZodArray<z.ZodObject<{
541
589
  /** Explicit reviewer harness id. Repeated harness ids are allowed so one
542
590
  * native provider can review through multiple requested models. */
@@ -560,13 +608,13 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
560
608
  * durable registry by the engine — an unknown/disabled/mismatched id is a
561
609
  * typed refusal, never a silent default. */
562
610
  credentialProfileId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
563
- /** How much the orchestrate planner may act without confirmation
564
- * (suggest/auto_safe/auto_full). Only meaningful for mode=orchestrate;
565
- * consumed by the executor in runOrchestrate. */
566
- autonomy: z.ZodOptional<z.ZodEnum<["suggest", "auto_safe", "auto_full"]>>;
567
- /** Orchestrate executor: cap on plan tool calls. Only meaningful for
568
- * mode=orchestrate; consumed by executeOrchestratePlan. */
569
- maxToolCalls: z.ZodOptional<z.ZodNumber>;
611
+ /** Agent delegation belt toggle (D32). Agent-only: when true and the
612
+ * routed harness declares `capability_profile.mcp_injection`, the engine
613
+ * injects the scoped Claudexor delegation belt (ask/plan/isolated sub-run/
614
+ * best-of/status/result) into the harness sandbox so the harness can spawn
615
+ * bounded isolated sub-runs. Refused (typed preflight) on a non-agent mode
616
+ * or a harness that cannot inject. Default off. */
617
+ delegate: z.ZodOptional<z.ZodBoolean>;
570
618
  /** Hard wall-clock deadline for the WHOLE run, measured from scheduler
571
619
  * start. On expiry the run is cooperatively cancelled (hard-kill fallback)
572
620
  * and ends `cancelled` with reason `wall_clock_exceeded`, preserving partial
@@ -593,7 +641,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
593
641
  * max_turns support discloses the ignored knob instead of dropping it. */
594
642
  maxTurns: z.ZodOptional<z.ZodNumber>;
595
643
  }, "strict", z.ZodTypeAny, {
596
- mode: "ask" | "plan" | "audit" | "agent" | "orchestrate";
644
+ mode: "ask" | "plan" | "agent";
597
645
  prompt: string;
598
646
  scope: {
599
647
  kind: "project";
@@ -612,29 +660,35 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
612
660
  resourceId: string;
613
661
  }[] | undefined;
614
662
  browser?: boolean | undefined;
663
+ threadId?: string | undefined;
615
664
  turnId?: string | undefined;
616
665
  planRunId?: string | undefined;
666
+ planRef?: {
667
+ path: string;
668
+ sha256: string;
669
+ runId: string;
670
+ } | undefined;
617
671
  models?: Record<string, string> | undefined;
618
672
  harnesses?: string[] | undefined;
619
673
  model?: string | undefined;
620
674
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
621
675
  tests?: {
622
- program: string;
623
676
  args: string[];
677
+ program: string;
624
678
  envAllowlist: string[];
625
679
  cwd?: string | undefined;
626
680
  }[] | undefined;
627
- autonomy?: "suggest" | "auto_safe" | "auto_full" | undefined;
628
- n?: number | undefined;
629
681
  retryOf?: string | undefined;
630
682
  primaryHarness?: string | undefined;
631
683
  routingGoal?: "auto" | "quality" | "economy" | undefined;
632
684
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
633
685
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
686
+ n?: number | undefined;
634
687
  attempts?: number | null | undefined;
635
688
  untilClean?: boolean | undefined;
636
- swarm?: boolean | undefined;
689
+ deepScan?: boolean | undefined;
637
690
  create?: boolean | undefined;
691
+ council?: boolean | undefined;
638
692
  synthesis?: "auto" | "never" | "always" | undefined;
639
693
  paidBudget?: {
640
694
  kind: "unlimited";
@@ -647,10 +701,6 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
647
701
  path: string;
648
702
  reason?: string | undefined;
649
703
  }[] | undefined;
650
- specPath?: string | undefined;
651
- specId?: string | undefined;
652
- specHash?: string | undefined;
653
- threadId?: string | undefined;
654
704
  parentRunId?: string | undefined;
655
705
  reviewerPanel?: {
656
706
  harness: string;
@@ -659,7 +709,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
659
709
  }[] | undefined;
660
710
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
661
711
  credentialProfileId?: string | null | undefined;
662
- maxToolCalls?: number | undefined;
712
+ delegate?: boolean | undefined;
663
713
  maxSeconds?: number | undefined;
664
714
  denyPaths?: string[] | undefined;
665
715
  outputSchema?: Record<string, unknown> | undefined;
@@ -667,27 +717,31 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
667
717
  }, {
668
718
  web?: "off" | "auto" | "cached" | "live" | undefined;
669
719
  instructions?: string | undefined;
670
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
720
+ mode?: "ask" | "plan" | "agent" | undefined;
671
721
  prompt?: string | undefined;
672
722
  access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
673
723
  attachments?: {
674
724
  resourceId: string;
675
725
  }[] | undefined;
676
726
  browser?: boolean | undefined;
727
+ threadId?: string | undefined;
677
728
  turnId?: string | undefined;
678
729
  planRunId?: string | undefined;
730
+ planRef?: {
731
+ path: string;
732
+ sha256: string;
733
+ runId: string;
734
+ } | undefined;
679
735
  models?: Record<string, string> | undefined;
680
736
  harnesses?: string[] | undefined;
681
737
  model?: string | undefined;
682
738
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
683
739
  tests?: {
684
740
  program: string;
685
- cwd?: string | undefined;
686
741
  args?: string[] | undefined;
742
+ cwd?: string | undefined;
687
743
  envAllowlist?: string[] | undefined;
688
744
  }[] | undefined;
689
- autonomy?: "suggest" | "auto_safe" | "auto_full" | undefined;
690
- n?: number | undefined;
691
745
  retryOf?: string | undefined;
692
746
  scope?: {
693
747
  kind: "project";
@@ -703,10 +757,12 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
703
757
  routingGoal?: "auto" | "quality" | "economy" | undefined;
704
758
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
705
759
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
760
+ n?: number | undefined;
706
761
  attempts?: number | null | undefined;
707
762
  untilClean?: boolean | undefined;
708
- swarm?: boolean | undefined;
763
+ deepScan?: boolean | undefined;
709
764
  create?: boolean | undefined;
765
+ council?: boolean | undefined;
710
766
  synthesis?: "auto" | "never" | "always" | undefined;
711
767
  paidBudget?: {
712
768
  kind: "unlimited";
@@ -719,10 +775,6 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
719
775
  path: string;
720
776
  reason?: string | undefined;
721
777
  }[] | undefined;
722
- specPath?: string | undefined;
723
- specId?: string | undefined;
724
- specHash?: string | undefined;
725
- threadId?: string | undefined;
726
778
  parentRunId?: string | undefined;
727
779
  reviewerPanel?: {
728
780
  harness: string;
@@ -731,7 +783,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
731
783
  }[] | undefined;
732
784
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
733
785
  credentialProfileId?: string | null | undefined;
734
- maxToolCalls?: number | undefined;
786
+ delegate?: boolean | undefined;
735
787
  maxSeconds?: number | undefined;
736
788
  denyPaths?: string[] | undefined;
737
789
  outputSchema?: Record<string, unknown> | undefined;
@@ -753,7 +805,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
753
805
  }, "strict", z.ZodTypeAny, {
754
806
  sourceRunId: string;
755
807
  request: {
756
- mode: "ask" | "plan" | "audit" | "agent" | "orchestrate";
808
+ mode: "ask" | "plan" | "agent";
757
809
  prompt: string;
758
810
  scope: {
759
811
  kind: "project";
@@ -772,29 +824,35 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
772
824
  resourceId: string;
773
825
  }[] | undefined;
774
826
  browser?: boolean | undefined;
827
+ threadId?: string | undefined;
775
828
  turnId?: string | undefined;
776
829
  planRunId?: string | undefined;
830
+ planRef?: {
831
+ path: string;
832
+ sha256: string;
833
+ runId: string;
834
+ } | undefined;
777
835
  models?: Record<string, string> | undefined;
778
836
  harnesses?: string[] | undefined;
779
837
  model?: string | undefined;
780
838
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
781
839
  tests?: {
782
- program: string;
783
840
  args: string[];
841
+ program: string;
784
842
  envAllowlist: string[];
785
843
  cwd?: string | undefined;
786
844
  }[] | undefined;
787
- autonomy?: "suggest" | "auto_safe" | "auto_full" | undefined;
788
- n?: number | undefined;
789
845
  retryOf?: string | undefined;
790
846
  primaryHarness?: string | undefined;
791
847
  routingGoal?: "auto" | "quality" | "economy" | undefined;
792
848
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
793
849
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
850
+ n?: number | undefined;
794
851
  attempts?: number | null | undefined;
795
852
  untilClean?: boolean | undefined;
796
- swarm?: boolean | undefined;
853
+ deepScan?: boolean | undefined;
797
854
  create?: boolean | undefined;
855
+ council?: boolean | undefined;
798
856
  synthesis?: "auto" | "never" | "always" | undefined;
799
857
  paidBudget?: {
800
858
  kind: "unlimited";
@@ -807,10 +865,6 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
807
865
  path: string;
808
866
  reason?: string | undefined;
809
867
  }[] | undefined;
810
- specPath?: string | undefined;
811
- specId?: string | undefined;
812
- specHash?: string | undefined;
813
- threadId?: string | undefined;
814
868
  parentRunId?: string | undefined;
815
869
  reviewerPanel?: {
816
870
  harness: string;
@@ -819,7 +873,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
819
873
  }[] | undefined;
820
874
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
821
875
  credentialProfileId?: string | null | undefined;
822
- maxToolCalls?: number | undefined;
876
+ delegate?: boolean | undefined;
823
877
  maxSeconds?: number | undefined;
824
878
  denyPaths?: string[] | undefined;
825
879
  outputSchema?: Record<string, unknown> | undefined;
@@ -835,27 +889,31 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
835
889
  request: {
836
890
  web?: "off" | "auto" | "cached" | "live" | undefined;
837
891
  instructions?: string | undefined;
838
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
892
+ mode?: "ask" | "plan" | "agent" | undefined;
839
893
  prompt?: string | undefined;
840
894
  access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
841
895
  attachments?: {
842
896
  resourceId: string;
843
897
  }[] | undefined;
844
898
  browser?: boolean | undefined;
899
+ threadId?: string | undefined;
845
900
  turnId?: string | undefined;
846
901
  planRunId?: string | undefined;
902
+ planRef?: {
903
+ path: string;
904
+ sha256: string;
905
+ runId: string;
906
+ } | undefined;
847
907
  models?: Record<string, string> | undefined;
848
908
  harnesses?: string[] | undefined;
849
909
  model?: string | undefined;
850
910
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
851
911
  tests?: {
852
912
  program: string;
853
- cwd?: string | undefined;
854
913
  args?: string[] | undefined;
914
+ cwd?: string | undefined;
855
915
  envAllowlist?: string[] | undefined;
856
916
  }[] | undefined;
857
- autonomy?: "suggest" | "auto_safe" | "auto_full" | undefined;
858
- n?: number | undefined;
859
917
  retryOf?: string | undefined;
860
918
  scope?: {
861
919
  kind: "project";
@@ -871,10 +929,12 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
871
929
  routingGoal?: "auto" | "quality" | "economy" | undefined;
872
930
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
873
931
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
932
+ n?: number | undefined;
874
933
  attempts?: number | null | undefined;
875
934
  untilClean?: boolean | undefined;
876
- swarm?: boolean | undefined;
935
+ deepScan?: boolean | undefined;
877
936
  create?: boolean | undefined;
937
+ council?: boolean | undefined;
878
938
  synthesis?: "auto" | "never" | "always" | undefined;
879
939
  paidBudget?: {
880
940
  kind: "unlimited";
@@ -887,10 +947,6 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
887
947
  path: string;
888
948
  reason?: string | undefined;
889
949
  }[] | undefined;
890
- specPath?: string | undefined;
891
- specId?: string | undefined;
892
- specHash?: string | undefined;
893
- threadId?: string | undefined;
894
950
  parentRunId?: string | undefined;
895
951
  reviewerPanel?: {
896
952
  harness: string;
@@ -899,7 +955,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
899
955
  }[] | undefined;
900
956
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
901
957
  credentialProfileId?: string | null | undefined;
902
- maxToolCalls?: number | undefined;
958
+ delegate?: boolean | undefined;
903
959
  maxSeconds?: number | undefined;
904
960
  denyPaths?: string[] | undefined;
905
961
  outputSchema?: Record<string, unknown> | undefined;
@@ -911,18 +967,18 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
911
967
  change: "omitted";
912
968
  }[] | undefined;
913
969
  }>;
914
- export declare const ControlRunState: z.ZodEnum<["queued", "running", "blocked", "succeeded", "no_op", "ungated", "review_not_run", "failed", "cancelled", "interrupted_unknown", "cost_unverifiable", "exhausted_overshoot", "exhausted", "not_converged", "stuck_no_progress"]>;
970
+ export declare const ControlRunState: z.ZodEnum<["queued", "running", "succeeded", "failed", "cancelled", "interrupted"]>;
915
971
  export type ControlRunState = z.infer<typeof ControlRunState>;
916
972
  export declare const ControlQueuedRunInfo: z.ZodObject<{
917
973
  jobId: z.ZodString;
918
- state: z.ZodEnum<["queued", "running", "blocked", "succeeded", "no_op", "ungated", "review_not_run", "failed", "cancelled", "interrupted_unknown", "cost_unverifiable", "exhausted_overshoot", "exhausted", "not_converged", "stuck_no_progress"]>;
974
+ state: z.ZodEnum<["queued", "running", "succeeded", "failed", "cancelled", "interrupted"]>;
919
975
  error: z.ZodOptional<z.ZodString>;
920
976
  }, "strip", z.ZodTypeAny, {
921
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
977
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
922
978
  jobId: string;
923
979
  error?: string | undefined;
924
980
  }, {
925
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
981
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
926
982
  jobId: string;
927
983
  error?: string | undefined;
928
984
  }>;
@@ -995,7 +1051,7 @@ export declare const ControlWebEvidence: z.ZodObject<{
995
1051
  /** False when the run predates telemetry.yaml; surfaces must render "telemetry unavailable". */
996
1052
  available: z.ZodDefault<z.ZodBoolean>;
997
1053
  }, "strip", z.ZodTypeAny, {
998
- status: "failed" | "none" | "attempted" | "satisfied" | "unverified";
1054
+ status: "failed" | "none" | "attempted" | "unverified" | "satisfied";
999
1055
  available: boolean;
1000
1056
  target: string | null;
1001
1057
  mode: "off" | "auto" | "cached" | "live";
@@ -1007,7 +1063,7 @@ export declare const ControlWebEvidence: z.ZodObject<{
1007
1063
  satisfied: boolean;
1008
1064
  errorSummary: string | null;
1009
1065
  }, {
1010
- status?: "failed" | "none" | "attempted" | "satisfied" | "unverified" | undefined;
1066
+ status?: "failed" | "none" | "attempted" | "unverified" | "satisfied" | undefined;
1011
1067
  available?: boolean | undefined;
1012
1068
  target?: string | null | undefined;
1013
1069
  mode?: "off" | "auto" | "cached" | "live" | undefined;
@@ -1052,6 +1108,30 @@ export type ControlRouteInfo = z.infer<typeof ControlRouteInfo>;
1052
1108
  */
1053
1109
  export declare const RunApplyState: z.ZodEnum<["not_applied", "applied", "applied_review_blocked", "reverted"]>;
1054
1110
  export type RunApplyState = z.infer<typeof RunApplyState>;
1111
+ /**
1112
+ * The run's MUTABLE delivery/apply state, persisted as its own typed artifact
1113
+ * `final/delivery_state.yaml` (V8/PLAN addendum 2). work_product.yaml is
1114
+ * immutable after the run; the operator apply/revert lifecycle mutates ONLY
1115
+ * this record. Writer: control-api daemon-server (markRunApplyState). Readers:
1116
+ * retention GC and the summarizeRun result projection.
1117
+ */
1118
+ export declare const RunDeliveryState: z.ZodObject<{
1119
+ applyState: z.ZodDefault<z.ZodEnum<["not_applied", "applied", "applied_review_blocked", "reverted"]>>;
1120
+ deliveredAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1121
+ revertAnchorId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1122
+ postTurnSha: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1123
+ }, "strip", z.ZodTypeAny, {
1124
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
1125
+ deliveredAt: string | null;
1126
+ revertAnchorId: string | null;
1127
+ postTurnSha: string | null;
1128
+ }, {
1129
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
1130
+ deliveredAt?: string | null | undefined;
1131
+ revertAnchorId?: string | null | undefined;
1132
+ postTurnSha?: string | null | undefined;
1133
+ }>;
1134
+ export type RunDeliveryState = z.infer<typeof RunDeliveryState>;
1055
1135
  export declare const ControlRunResult: z.ZodObject<{
1056
1136
  kind: z.ZodDefault<z.ZodEnum<["patch", "answer", "plan", "report", "none"]>>;
1057
1137
  diffStat: z.ZodDefault<z.ZodNullable<z.ZodObject<{
@@ -1082,6 +1162,9 @@ export declare const ControlRunResult: z.ZodObject<{
1082
1162
  revertable: z.ZodDefault<z.ZodBoolean>;
1083
1163
  }, "strip", z.ZodTypeAny, {
1084
1164
  kind: "plan" | "none" | "patch" | "answer" | "report";
1165
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
1166
+ revertAnchorId: string | null;
1167
+ postTurnSha: string | null;
1085
1168
  diffStat: {
1086
1169
  files: number;
1087
1170
  additions: number;
@@ -1089,13 +1172,13 @@ export declare const ControlRunResult: z.ZodObject<{
1089
1172
  } | null;
1090
1173
  blockers: number;
1091
1174
  adopted: boolean | null;
1092
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
1093
1175
  preTurnSha: string | null;
1094
- postTurnSha: string | null;
1095
- revertAnchorId: string | null;
1096
1176
  revertable: boolean;
1097
1177
  }, {
1098
1178
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
1179
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
1180
+ revertAnchorId?: string | null | undefined;
1181
+ postTurnSha?: string | null | undefined;
1099
1182
  diffStat?: {
1100
1183
  files: number;
1101
1184
  additions: number;
@@ -1103,10 +1186,7 @@ export declare const ControlRunResult: z.ZodObject<{
1103
1186
  } | null | undefined;
1104
1187
  blockers?: number | undefined;
1105
1188
  adopted?: boolean | null | undefined;
1106
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
1107
1189
  preTurnSha?: string | null | undefined;
1108
- postTurnSha?: string | null | undefined;
1109
- revertAnchorId?: string | null | undefined;
1110
1190
  revertable?: boolean | undefined;
1111
1191
  }>;
1112
1192
  export type ControlRunResult = z.infer<typeof ControlRunResult>;
@@ -1114,7 +1194,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1114
1194
  jobId: z.ZodString;
1115
1195
  runId: z.ZodString;
1116
1196
  taskId: z.ZodOptional<z.ZodString>;
1117
- state: z.ZodEnum<["queued", "running", "blocked", "succeeded", "no_op", "ungated", "review_not_run", "failed", "cancelled", "interrupted_unknown", "cost_unverifiable", "exhausted_overshoot", "exhausted", "not_converged", "stuck_no_progress"]>;
1197
+ state: z.ZodEnum<["queued", "running", "succeeded", "failed", "cancelled", "interrupted"]>;
1118
1198
  runDir: z.ZodOptional<z.ZodString>;
1119
1199
  error: z.ZodOptional<z.ZodString>;
1120
1200
  failure: z.ZodDefault<z.ZodNullable<z.ZodObject<{
@@ -1167,9 +1247,9 @@ export declare const ControlRunSummary: z.ZodObject<{
1167
1247
  context?: "off" | "auto" | undefined;
1168
1248
  projectName?: string | null | undefined;
1169
1249
  }>>;
1170
- mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
1171
- /** v0.9 engine strategy on the mode (flags, not modes): race width / repair caps / swarm / create. */
1172
- strategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["race", "attempts", "until_clean", "swarm", "create"]>>>;
1250
+ mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "agent"]>>;
1251
+ /** v0.9 engine strategy on the mode (flags, not modes): race width / repair caps / deep-scan / create. */
1252
+ strategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["race", "attempts", "until_clean", "deep_scan", "create"]>>>;
1173
1253
  prompt: z.ZodOptional<z.ZodString>;
1174
1254
  harnesses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1175
1255
  primaryHarness: z.ZodOptional<z.ZodString>;
@@ -1300,7 +1380,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1300
1380
  /** False when the run predates telemetry.yaml; surfaces must render "telemetry unavailable". */
1301
1381
  available: z.ZodDefault<z.ZodBoolean>;
1302
1382
  }, "strip", z.ZodTypeAny, {
1303
- status: "failed" | "none" | "attempted" | "satisfied" | "unverified";
1383
+ status: "failed" | "none" | "attempted" | "unverified" | "satisfied";
1304
1384
  available: boolean;
1305
1385
  target: string | null;
1306
1386
  mode: "off" | "auto" | "cached" | "live";
@@ -1312,7 +1392,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1312
1392
  satisfied: boolean;
1313
1393
  errorSummary: string | null;
1314
1394
  }, {
1315
- status?: "failed" | "none" | "attempted" | "satisfied" | "unverified" | undefined;
1395
+ status?: "failed" | "none" | "attempted" | "unverified" | "satisfied" | undefined;
1316
1396
  available?: boolean | undefined;
1317
1397
  target?: string | null | undefined;
1318
1398
  mode?: "off" | "auto" | "cached" | "live" | undefined;
@@ -1384,6 +1464,9 @@ export declare const ControlRunSummary: z.ZodObject<{
1384
1464
  revertable: z.ZodDefault<z.ZodBoolean>;
1385
1465
  }, "strip", z.ZodTypeAny, {
1386
1466
  kind: "plan" | "none" | "patch" | "answer" | "report";
1467
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
1468
+ revertAnchorId: string | null;
1469
+ postTurnSha: string | null;
1387
1470
  diffStat: {
1388
1471
  files: number;
1389
1472
  additions: number;
@@ -1391,13 +1474,13 @@ export declare const ControlRunSummary: z.ZodObject<{
1391
1474
  } | null;
1392
1475
  blockers: number;
1393
1476
  adopted: boolean | null;
1394
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
1395
1477
  preTurnSha: string | null;
1396
- postTurnSha: string | null;
1397
- revertAnchorId: string | null;
1398
1478
  revertable: boolean;
1399
1479
  }, {
1400
1480
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
1481
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
1482
+ revertAnchorId?: string | null | undefined;
1483
+ postTurnSha?: string | null | undefined;
1401
1484
  diffStat?: {
1402
1485
  files: number;
1403
1486
  additions: number;
@@ -1405,12 +1488,31 @@ export declare const ControlRunSummary: z.ZodObject<{
1405
1488
  } | null | undefined;
1406
1489
  blockers?: number | undefined;
1407
1490
  adopted?: boolean | null | undefined;
1408
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
1409
1491
  preTurnSha?: string | null | undefined;
1410
- postTurnSha?: string | null | undefined;
1411
- revertAnchorId?: string | null | undefined;
1412
1492
  revertable?: boolean | undefined;
1413
1493
  }>>;
1494
+ /** The D8 terminal outcome AXES (lifecycle mirrors `state`; plus noChanges,
1495
+ * checks, review, reason) projected from decision.facts, else derived from
1496
+ * the typed failure. Null while the run is not terminal / has no facts. */
1497
+ outcomeFacts: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1498
+ lifecycle: z.ZodEnum<["succeeded", "failed", "cancelled", "interrupted"]>;
1499
+ noChanges: z.ZodDefault<z.ZodBoolean>;
1500
+ checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
1501
+ review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
1502
+ 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"]>>>;
1503
+ }, "strict", z.ZodTypeAny, {
1504
+ review: "not_run" | "approved" | "blocked";
1505
+ reason: "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" | null;
1506
+ checks: "passed" | "failed" | "not_configured";
1507
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1508
+ noChanges: boolean;
1509
+ }, {
1510
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1511
+ review?: "not_run" | "approved" | "blocked" | undefined;
1512
+ reason?: "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" | null | undefined;
1513
+ checks?: "passed" | "failed" | "not_configured" | undefined;
1514
+ noChanges?: boolean | undefined;
1515
+ }>>>;
1414
1516
  /** True while at least one interaction.requested has no answered/timeout. */
1415
1517
  waitingOnUser: z.ZodDefault<z.ZodBoolean>;
1416
1518
  /** Route evidence from telemetry; null when no telemetry exists (legacy). */
@@ -1436,24 +1538,29 @@ export declare const ControlRunSummary: z.ZodObject<{
1436
1538
  cwd: z.ZodOptional<z.ZodString>;
1437
1539
  envAllowlist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1438
1540
  }, "strict", z.ZodTypeAny, {
1439
- program: string;
1440
1541
  args: string[];
1542
+ program: string;
1441
1543
  envAllowlist: string[];
1442
1544
  cwd?: string | undefined;
1443
1545
  }, {
1444
1546
  program: string;
1445
- cwd?: string | undefined;
1446
1547
  args?: string[] | undefined;
1548
+ cwd?: string | undefined;
1447
1549
  envAllowlist?: string[] | undefined;
1448
1550
  }>, "many">>;
1449
- specId: z.ZodOptional<z.ZodString>;
1450
- specHash: z.ZodOptional<z.ZodString>;
1451
1551
  createdAt: z.ZodOptional<z.ZodString>;
1452
1552
  startedAt: z.ZodOptional<z.ZodString>;
1453
1553
  finishedAt: z.ZodOptional<z.ZodString>;
1454
1554
  }, "strip", z.ZodTypeAny, {
1455
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
1555
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
1456
1556
  runId: string;
1557
+ outcomeFacts: {
1558
+ review: "not_run" | "approved" | "blocked";
1559
+ reason: "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" | null;
1560
+ checks: "passed" | "failed" | "not_configured";
1561
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1562
+ noChanges: boolean;
1563
+ } | null;
1457
1564
  project: {
1458
1565
  kind: "none" | "project";
1459
1566
  root: string | null;
@@ -1474,7 +1581,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1474
1581
  nextActions: string[];
1475
1582
  } | null;
1476
1583
  webEvidence: {
1477
- status: "failed" | "none" | "attempted" | "satisfied" | "unverified";
1584
+ status: "failed" | "none" | "attempted" | "unverified" | "satisfied";
1478
1585
  available: boolean;
1479
1586
  target: string | null;
1480
1587
  mode: "off" | "auto" | "cached" | "live";
@@ -1499,6 +1606,9 @@ export declare const ControlRunSummary: z.ZodObject<{
1499
1606
  toolWarningsTotal: number;
1500
1607
  result: {
1501
1608
  kind: "plan" | "none" | "patch" | "answer" | "report";
1609
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
1610
+ revertAnchorId: string | null;
1611
+ postTurnSha: string | null;
1502
1612
  diffStat: {
1503
1613
  files: number;
1504
1614
  additions: number;
@@ -1506,10 +1616,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1506
1616
  } | null;
1507
1617
  blockers: number;
1508
1618
  adopted: boolean | null;
1509
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
1510
1619
  preTurnSha: string | null;
1511
- postTurnSha: string | null;
1512
- revertAnchorId: string | null;
1513
1620
  revertable: boolean;
1514
1621
  };
1515
1622
  waitingOnUser: boolean;
@@ -1522,22 +1629,22 @@ export declare const ControlRunSummary: z.ZodObject<{
1522
1629
  startedAt?: string | undefined;
1523
1630
  error?: string | undefined;
1524
1631
  createdAt?: string | undefined;
1525
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
1632
+ mode?: "ask" | "plan" | "agent" | undefined;
1526
1633
  prompt?: string | undefined;
1527
1634
  access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
1528
1635
  harnesses?: string[] | undefined;
1529
1636
  runDir?: string | undefined;
1530
1637
  model?: string | undefined;
1531
1638
  tests?: {
1532
- program: string;
1533
1639
  args: string[];
1640
+ program: string;
1534
1641
  envAllowlist: string[];
1535
1642
  cwd?: string | undefined;
1536
1643
  }[] | undefined;
1537
- n?: number | undefined;
1538
1644
  taskId?: string | undefined;
1539
1645
  primaryHarness?: string | undefined;
1540
1646
  routingGoal?: "auto" | "quality" | "economy" | undefined;
1647
+ n?: number | undefined;
1541
1648
  paidBudget?: {
1542
1649
  kind: "unlimited";
1543
1650
  } | {
@@ -1549,14 +1656,12 @@ export declare const ControlRunSummary: z.ZodObject<{
1549
1656
  path: string;
1550
1657
  reason?: string | undefined;
1551
1658
  }[] | undefined;
1552
- specId?: string | undefined;
1553
- specHash?: string | undefined;
1554
1659
  reviewerPanel?: {
1555
1660
  harness: string;
1556
1661
  model?: string | undefined;
1557
1662
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
1558
1663
  }[] | undefined;
1559
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
1664
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
1560
1665
  spendUsd?: number | null | undefined;
1561
1666
  spendEstimated?: boolean | undefined;
1562
1667
  inputTokens?: number | null | undefined;
@@ -1582,22 +1687,29 @@ export declare const ControlRunSummary: z.ZodObject<{
1582
1687
  toolPermissionPolicy?: Record<string, unknown> | undefined;
1583
1688
  finishedAt?: string | undefined;
1584
1689
  }, {
1585
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
1690
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
1586
1691
  runId: string;
1587
1692
  jobId: string;
1588
1693
  startedAt?: string | undefined;
1589
1694
  error?: string | undefined;
1590
1695
  createdAt?: string | undefined;
1591
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
1696
+ mode?: "ask" | "plan" | "agent" | undefined;
1592
1697
  prompt?: string | undefined;
1593
1698
  access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
1594
1699
  harnesses?: string[] | undefined;
1595
1700
  runDir?: string | undefined;
1701
+ outcomeFacts?: {
1702
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1703
+ review?: "not_run" | "approved" | "blocked" | undefined;
1704
+ reason?: "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" | null | undefined;
1705
+ checks?: "passed" | "failed" | "not_configured" | undefined;
1706
+ noChanges?: boolean | undefined;
1707
+ } | null | undefined;
1596
1708
  model?: string | undefined;
1597
1709
  tests?: {
1598
1710
  program: string;
1599
- cwd?: string | undefined;
1600
1711
  args?: string[] | undefined;
1712
+ cwd?: string | undefined;
1601
1713
  envAllowlist?: string[] | undefined;
1602
1714
  }[] | undefined;
1603
1715
  project?: {
@@ -1606,10 +1718,10 @@ export declare const ControlRunSummary: z.ZodObject<{
1606
1718
  context?: "off" | "auto" | undefined;
1607
1719
  projectName?: string | null | undefined;
1608
1720
  } | undefined;
1609
- n?: number | undefined;
1610
1721
  taskId?: string | undefined;
1611
1722
  primaryHarness?: string | undefined;
1612
1723
  routingGoal?: "auto" | "quality" | "economy" | undefined;
1724
+ n?: number | undefined;
1613
1725
  paidBudget?: {
1614
1726
  kind: "unlimited";
1615
1727
  } | {
@@ -1621,8 +1733,6 @@ export declare const ControlRunSummary: z.ZodObject<{
1621
1733
  path: string;
1622
1734
  reason?: string | undefined;
1623
1735
  }[] | undefined;
1624
- specId?: string | undefined;
1625
- specHash?: string | undefined;
1626
1736
  reviewerPanel?: {
1627
1737
  harness: string;
1628
1738
  model?: string | undefined;
@@ -1640,7 +1750,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1640
1750
  eventRefs?: string[] | undefined;
1641
1751
  nextActions?: string[] | undefined;
1642
1752
  } | null | undefined;
1643
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
1753
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
1644
1754
  spendUsd?: number | null | undefined;
1645
1755
  spendEstimated?: boolean | undefined;
1646
1756
  inputTokens?: number | null | undefined;
@@ -1664,7 +1774,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1664
1774
  webRequired?: boolean | undefined;
1665
1775
  webMode?: "off" | "auto" | "cached" | "live" | undefined;
1666
1776
  webEvidence?: {
1667
- status?: "failed" | "none" | "attempted" | "satisfied" | "unverified" | undefined;
1777
+ status?: "failed" | "none" | "attempted" | "unverified" | "satisfied" | undefined;
1668
1778
  available?: boolean | undefined;
1669
1779
  target?: string | null | undefined;
1670
1780
  mode?: "off" | "auto" | "cached" | "live" | undefined;
@@ -1690,6 +1800,9 @@ export declare const ControlRunSummary: z.ZodObject<{
1690
1800
  toolWarningsTotal?: number | undefined;
1691
1801
  result?: {
1692
1802
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
1803
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
1804
+ revertAnchorId?: string | null | undefined;
1805
+ postTurnSha?: string | null | undefined;
1693
1806
  diffStat?: {
1694
1807
  files: number;
1695
1808
  additions: number;
@@ -1697,10 +1810,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1697
1810
  } | null | undefined;
1698
1811
  blockers?: number | undefined;
1699
1812
  adopted?: boolean | null | undefined;
1700
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
1701
1813
  preTurnSha?: string | null | undefined;
1702
- postTurnSha?: string | null | undefined;
1703
- revertAnchorId?: string | null | undefined;
1704
1814
  revertable?: boolean | undefined;
1705
1815
  } | undefined;
1706
1816
  waitingOnUser?: boolean | undefined;
@@ -1986,13 +2096,13 @@ export declare const RunControl: z.ZodObject<{
1986
2096
  reason?: string | undefined;
1987
2097
  }, {
1988
2098
  kind: "cancel";
2099
+ reason?: string | undefined;
1989
2100
  target?: {
1990
2101
  harnessId?: string | undefined;
1991
2102
  attemptId?: string | undefined;
1992
2103
  sessionId?: string | undefined;
1993
2104
  requestId?: string | undefined;
1994
2105
  } | undefined;
1995
- reason?: string | undefined;
1996
2106
  }>;
1997
2107
  export type RunControl = z.infer<typeof RunControl>;
1998
2108
  export declare const ControlRunControlRequest: z.ZodObject<{
@@ -2026,13 +2136,13 @@ export declare const ControlRunControlRequest: z.ZodObject<{
2026
2136
  reason?: string | undefined;
2027
2137
  }, {
2028
2138
  kind: "cancel";
2139
+ reason?: string | undefined;
2029
2140
  target?: {
2030
2141
  harnessId?: string | undefined;
2031
2142
  attemptId?: string | undefined;
2032
2143
  sessionId?: string | undefined;
2033
2144
  requestId?: string | undefined;
2034
2145
  } | undefined;
2035
- reason?: string | undefined;
2036
2146
  }>;
2037
2147
  }, "strip", z.ZodTypeAny, {
2038
2148
  control: {
@@ -2048,13 +2158,13 @@ export declare const ControlRunControlRequest: z.ZodObject<{
2048
2158
  }, {
2049
2159
  control: {
2050
2160
  kind: "cancel";
2161
+ reason?: string | undefined;
2051
2162
  target?: {
2052
2163
  harnessId?: string | undefined;
2053
2164
  attemptId?: string | undefined;
2054
2165
  sessionId?: string | undefined;
2055
2166
  requestId?: string | undefined;
2056
2167
  } | undefined;
2057
- reason?: string | undefined;
2058
2168
  };
2059
2169
  }>;
2060
2170
  export type ControlRunControlRequest = z.infer<typeof ControlRunControlRequest>;
@@ -2142,7 +2252,7 @@ export declare const ControlApplyRequest: z.ZodObject<{
2142
2252
  kind: "project";
2143
2253
  root: string;
2144
2254
  }>]>>;
2145
- mode: z.ZodDefault<z.ZodEnum<["artifact_only", "apply", "branch", "commit", "pr"]>>;
2255
+ mode: z.ZodDefault<z.ZodEnum<["apply", "branch", "commit", "pr"]>>;
2146
2256
  branch: z.ZodOptional<z.ZodString>;
2147
2257
  message: z.ZodOptional<z.ZodString>;
2148
2258
  }, "strict", z.ZodTypeAny, {
@@ -2152,7 +2262,7 @@ export declare const ControlApplyRequest: z.ZodObject<{
2152
2262
  kind: "project";
2153
2263
  root: string;
2154
2264
  };
2155
- mode: "apply" | "commit" | "branch" | "pr" | "artifact_only";
2265
+ mode: "apply" | "commit" | "branch" | "pr";
2156
2266
  message?: string | undefined;
2157
2267
  branch?: string | undefined;
2158
2268
  }, {
@@ -2163,7 +2273,7 @@ export declare const ControlApplyRequest: z.ZodObject<{
2163
2273
  kind: "project";
2164
2274
  root: string;
2165
2275
  } | undefined;
2166
- mode?: "apply" | "commit" | "branch" | "pr" | "artifact_only" | undefined;
2276
+ mode?: "apply" | "commit" | "branch" | "pr" | undefined;
2167
2277
  branch?: string | undefined;
2168
2278
  }>;
2169
2279
  export type ControlApplyRequest = z.infer<typeof ControlApplyRequest>;
@@ -2183,7 +2293,7 @@ export declare const ControlRunDecisionRequest: z.ZodObject<{
2183
2293
  /** Risk reasons being explicitly accepted (recorded, never silent). */
2184
2294
  acceptedRisks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2185
2295
  /** Apply mode + target for accept_clean_patch. */
2186
- applyMode: z.ZodOptional<z.ZodEnum<["artifact_only", "apply", "branch", "commit", "pr"]>>;
2296
+ applyMode: z.ZodOptional<z.ZodEnum<["apply", "branch", "commit", "pr"]>>;
2187
2297
  target: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2188
2298
  kind: z.ZodLiteral<"original_project">;
2189
2299
  }, "strict", z.ZodTypeAny, {
@@ -2211,7 +2321,7 @@ export declare const ControlRunDecisionRequest: z.ZodObject<{
2211
2321
  root: string;
2212
2322
  } | undefined;
2213
2323
  feedback?: string | undefined;
2214
- applyMode?: "apply" | "commit" | "branch" | "pr" | "artifact_only" | undefined;
2324
+ applyMode?: "apply" | "commit" | "branch" | "pr" | undefined;
2215
2325
  }, {
2216
2326
  action: "accept_clean_patch" | "rerun_with_feedback" | "accept_risk" | "override_needs_human" | "revert_run";
2217
2327
  target?: {
@@ -2223,7 +2333,7 @@ export declare const ControlRunDecisionRequest: z.ZodObject<{
2223
2333
  findingIds?: string[] | undefined;
2224
2334
  feedback?: string | undefined;
2225
2335
  acceptedRisks?: string[] | undefined;
2226
- applyMode?: "apply" | "commit" | "branch" | "pr" | "artifact_only" | undefined;
2336
+ applyMode?: "apply" | "commit" | "branch" | "pr" | undefined;
2227
2337
  }>;
2228
2338
  export type ControlRunDecisionRequest = z.infer<typeof ControlRunDecisionRequest>;
2229
2339
  export declare const ControlRunDecisionResponse: z.ZodObject<{
@@ -2248,7 +2358,7 @@ export declare const ControlThread: z.ZodObject<{
2248
2358
  id: z.ZodString;
2249
2359
  title: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2250
2360
  repoRoot: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2251
- mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
2361
+ mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "agent"]>>;
2252
2362
  /** How turns touch files (in-place live tree vs isolated worktree). */
2253
2363
  workspaceMode: z.ZodDefault<z.ZodEnum<["in_place", "isolated"]>>;
2254
2364
  authPreference: z.ZodDefault<z.ZodEnum<["subscription", "api_key", "auto"]>>;
@@ -2258,6 +2368,8 @@ export declare const ControlThread: z.ZodObject<{
2258
2368
  /** Sticky credential profile (INV-135): clients can SET it via
2259
2369
  * create/PATCH, so the projection must report it back (round-15 #3). */
2260
2370
  credentialProfileId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2371
+ /** Sticky write scope for write turns (D26); null = repo trust default. */
2372
+ access: z.ZodDefault<z.ZodNullable<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>>>;
2261
2373
  state: z.ZodDefault<z.ZodEnum<["active", "closed", "trashed", "purged"]>>;
2262
2374
  trashedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2263
2375
  purgeAfter: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -2271,6 +2383,7 @@ export declare const ControlThread: z.ZodObject<{
2271
2383
  state: "active" | "closed" | "trashed" | "purged";
2272
2384
  createdAt: string;
2273
2385
  id: string;
2386
+ access: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null;
2274
2387
  title: string | null;
2275
2388
  primaryHarness: string | null;
2276
2389
  authPreference: "auto" | "subscription" | "api_key";
@@ -2284,13 +2397,14 @@ export declare const ControlThread: z.ZodObject<{
2284
2397
  headRunId: string | null;
2285
2398
  needsHuman: boolean;
2286
2399
  updatedAt: string;
2287
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2400
+ mode?: "ask" | "plan" | "agent" | undefined;
2288
2401
  }, {
2289
2402
  createdAt: string;
2290
2403
  id: string;
2291
2404
  updatedAt: string;
2292
2405
  state?: "active" | "closed" | "trashed" | "purged" | undefined;
2293
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2406
+ mode?: "ask" | "plan" | "agent" | undefined;
2407
+ access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null | undefined;
2294
2408
  title?: string | null | undefined;
2295
2409
  primaryHarness?: string | null | undefined;
2296
2410
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
@@ -2339,9 +2453,9 @@ export type ControlSession = z.infer<typeof ControlSession>;
2339
2453
  * conversation from one GET /threads/:id (no N+1 run-detail fetch per turn).
2340
2454
  */
2341
2455
  export declare const ControlTurnRunCard: z.ZodObject<{
2342
- state: z.ZodEnum<["queued", "running", "blocked", "succeeded", "no_op", "ungated", "review_not_run", "failed", "cancelled", "interrupted_unknown", "cost_unverifiable", "exhausted_overshoot", "exhausted", "not_converged", "stuck_no_progress"]>;
2343
- mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
2344
- strategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["race", "attempts", "until_clean", "swarm", "create"]>>>;
2456
+ state: z.ZodEnum<["queued", "running", "succeeded", "failed", "cancelled", "interrupted"]>;
2457
+ mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "agent"]>>;
2458
+ strategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["race", "attempts", "until_clean", "deep_scan", "create"]>>>;
2345
2459
  n: z.ZodOptional<z.ZodNumber>;
2346
2460
  result: z.ZodDefault<z.ZodObject<{
2347
2461
  kind: z.ZodDefault<z.ZodEnum<["patch", "answer", "plan", "report", "none"]>>;
@@ -2373,6 +2487,9 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2373
2487
  revertable: z.ZodDefault<z.ZodBoolean>;
2374
2488
  }, "strip", z.ZodTypeAny, {
2375
2489
  kind: "plan" | "none" | "patch" | "answer" | "report";
2490
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2491
+ revertAnchorId: string | null;
2492
+ postTurnSha: string | null;
2376
2493
  diffStat: {
2377
2494
  files: number;
2378
2495
  additions: number;
@@ -2380,13 +2497,13 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2380
2497
  } | null;
2381
2498
  blockers: number;
2382
2499
  adopted: boolean | null;
2383
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2384
2500
  preTurnSha: string | null;
2385
- postTurnSha: string | null;
2386
- revertAnchorId: string | null;
2387
2501
  revertable: boolean;
2388
2502
  }, {
2389
2503
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
2504
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2505
+ revertAnchorId?: string | null | undefined;
2506
+ postTurnSha?: string | null | undefined;
2390
2507
  diffStat?: {
2391
2508
  files: number;
2392
2509
  additions: number;
@@ -2394,21 +2511,47 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2394
2511
  } | null | undefined;
2395
2512
  blockers?: number | undefined;
2396
2513
  adopted?: boolean | null | undefined;
2397
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2398
2514
  preTurnSha?: string | null | undefined;
2399
- postTurnSha?: string | null | undefined;
2400
- revertAnchorId?: string | null | undefined;
2401
2515
  revertable?: boolean | undefined;
2402
2516
  }>>;
2517
+ outcomeFacts: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2518
+ lifecycle: z.ZodEnum<["succeeded", "failed", "cancelled", "interrupted"]>;
2519
+ noChanges: z.ZodDefault<z.ZodBoolean>;
2520
+ checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
2521
+ review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
2522
+ 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"]>>>;
2523
+ }, "strict", z.ZodTypeAny, {
2524
+ review: "not_run" | "approved" | "blocked";
2525
+ reason: "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" | null;
2526
+ checks: "passed" | "failed" | "not_configured";
2527
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2528
+ noChanges: boolean;
2529
+ }, {
2530
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2531
+ review?: "not_run" | "approved" | "blocked" | undefined;
2532
+ reason?: "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" | null | undefined;
2533
+ checks?: "passed" | "failed" | "not_configured" | undefined;
2534
+ noChanges?: boolean | undefined;
2535
+ }>>>;
2403
2536
  spendUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2404
2537
  outputReadyState: z.ZodDefault<z.ZodEnum<["pending", "finalizing", "ready", "diagnostic"]>>;
2405
2538
  waitingOnUser: z.ZodDefault<z.ZodBoolean>;
2406
2539
  finishedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2407
2540
  }, "strip", z.ZodTypeAny, {
2408
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
2541
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2542
+ outcomeFacts: {
2543
+ review: "not_run" | "approved" | "blocked";
2544
+ reason: "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" | null;
2545
+ checks: "passed" | "failed" | "not_configured";
2546
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2547
+ noChanges: boolean;
2548
+ } | null;
2409
2549
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
2410
2550
  result: {
2411
2551
  kind: "plan" | "none" | "patch" | "answer" | "report";
2552
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2553
+ revertAnchorId: string | null;
2554
+ postTurnSha: string | null;
2412
2555
  diffStat: {
2413
2556
  files: number;
2414
2557
  additions: number;
@@ -2416,27 +2559,34 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2416
2559
  } | null;
2417
2560
  blockers: number;
2418
2561
  adopted: boolean | null;
2419
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2420
2562
  preTurnSha: string | null;
2421
- postTurnSha: string | null;
2422
- revertAnchorId: string | null;
2423
2563
  revertable: boolean;
2424
2564
  };
2425
2565
  waitingOnUser: boolean;
2426
2566
  finishedAt: string | null;
2427
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2567
+ mode?: "ask" | "plan" | "agent" | undefined;
2428
2568
  n?: number | undefined;
2429
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
2569
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
2430
2570
  spendUsd?: number | null | undefined;
2431
2571
  }, {
2432
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
2433
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2572
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2573
+ mode?: "ask" | "plan" | "agent" | undefined;
2574
+ outcomeFacts?: {
2575
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2576
+ review?: "not_run" | "approved" | "blocked" | undefined;
2577
+ reason?: "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" | null | undefined;
2578
+ checks?: "passed" | "failed" | "not_configured" | undefined;
2579
+ noChanges?: boolean | undefined;
2580
+ } | null | undefined;
2434
2581
  n?: number | undefined;
2435
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
2582
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
2436
2583
  spendUsd?: number | null | undefined;
2437
2584
  outputReadyState?: "pending" | "finalizing" | "ready" | "diagnostic" | undefined;
2438
2585
  result?: {
2439
2586
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
2587
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2588
+ revertAnchorId?: string | null | undefined;
2589
+ postTurnSha?: string | null | undefined;
2440
2590
  diffStat?: {
2441
2591
  files: number;
2442
2592
  additions: number;
@@ -2444,10 +2594,7 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2444
2594
  } | null | undefined;
2445
2595
  blockers?: number | undefined;
2446
2596
  adopted?: boolean | null | undefined;
2447
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2448
2597
  preTurnSha?: string | null | undefined;
2449
- postTurnSha?: string | null | undefined;
2450
- revertAnchorId?: string | null | undefined;
2451
2598
  revertable?: boolean | undefined;
2452
2599
  } | undefined;
2453
2600
  waitingOnUser?: boolean | undefined;
@@ -2465,9 +2612,9 @@ export declare const ControlThreadTurn: z.ZodObject<{
2465
2612
  prompt: z.ZodDefault<z.ZodString>;
2466
2613
  /** Embedded run card (outcome/state) so the chat renders without N+1 fetches. */
2467
2614
  run: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2468
- state: z.ZodEnum<["queued", "running", "blocked", "succeeded", "no_op", "ungated", "review_not_run", "failed", "cancelled", "interrupted_unknown", "cost_unverifiable", "exhausted_overshoot", "exhausted", "not_converged", "stuck_no_progress"]>;
2469
- mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
2470
- strategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["race", "attempts", "until_clean", "swarm", "create"]>>>;
2615
+ state: z.ZodEnum<["queued", "running", "succeeded", "failed", "cancelled", "interrupted"]>;
2616
+ mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "agent"]>>;
2617
+ strategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["race", "attempts", "until_clean", "deep_scan", "create"]>>>;
2471
2618
  n: z.ZodOptional<z.ZodNumber>;
2472
2619
  result: z.ZodDefault<z.ZodObject<{
2473
2620
  kind: z.ZodDefault<z.ZodEnum<["patch", "answer", "plan", "report", "none"]>>;
@@ -2499,6 +2646,9 @@ export declare const ControlThreadTurn: z.ZodObject<{
2499
2646
  revertable: z.ZodDefault<z.ZodBoolean>;
2500
2647
  }, "strip", z.ZodTypeAny, {
2501
2648
  kind: "plan" | "none" | "patch" | "answer" | "report";
2649
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2650
+ revertAnchorId: string | null;
2651
+ postTurnSha: string | null;
2502
2652
  diffStat: {
2503
2653
  files: number;
2504
2654
  additions: number;
@@ -2506,13 +2656,13 @@ export declare const ControlThreadTurn: z.ZodObject<{
2506
2656
  } | null;
2507
2657
  blockers: number;
2508
2658
  adopted: boolean | null;
2509
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2510
2659
  preTurnSha: string | null;
2511
- postTurnSha: string | null;
2512
- revertAnchorId: string | null;
2513
2660
  revertable: boolean;
2514
2661
  }, {
2515
2662
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
2663
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2664
+ revertAnchorId?: string | null | undefined;
2665
+ postTurnSha?: string | null | undefined;
2516
2666
  diffStat?: {
2517
2667
  files: number;
2518
2668
  additions: number;
@@ -2520,21 +2670,47 @@ export declare const ControlThreadTurn: z.ZodObject<{
2520
2670
  } | null | undefined;
2521
2671
  blockers?: number | undefined;
2522
2672
  adopted?: boolean | null | undefined;
2523
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2524
2673
  preTurnSha?: string | null | undefined;
2525
- postTurnSha?: string | null | undefined;
2526
- revertAnchorId?: string | null | undefined;
2527
2674
  revertable?: boolean | undefined;
2528
2675
  }>>;
2676
+ outcomeFacts: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2677
+ lifecycle: z.ZodEnum<["succeeded", "failed", "cancelled", "interrupted"]>;
2678
+ noChanges: z.ZodDefault<z.ZodBoolean>;
2679
+ checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
2680
+ review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
2681
+ 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"]>>>;
2682
+ }, "strict", z.ZodTypeAny, {
2683
+ review: "not_run" | "approved" | "blocked";
2684
+ reason: "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" | null;
2685
+ checks: "passed" | "failed" | "not_configured";
2686
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2687
+ noChanges: boolean;
2688
+ }, {
2689
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2690
+ review?: "not_run" | "approved" | "blocked" | undefined;
2691
+ reason?: "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" | null | undefined;
2692
+ checks?: "passed" | "failed" | "not_configured" | undefined;
2693
+ noChanges?: boolean | undefined;
2694
+ }>>>;
2529
2695
  spendUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2530
2696
  outputReadyState: z.ZodDefault<z.ZodEnum<["pending", "finalizing", "ready", "diagnostic"]>>;
2531
2697
  waitingOnUser: z.ZodDefault<z.ZodBoolean>;
2532
2698
  finishedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2533
2699
  }, "strip", z.ZodTypeAny, {
2534
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
2700
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2701
+ outcomeFacts: {
2702
+ review: "not_run" | "approved" | "blocked";
2703
+ reason: "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" | null;
2704
+ checks: "passed" | "failed" | "not_configured";
2705
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2706
+ noChanges: boolean;
2707
+ } | null;
2535
2708
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
2536
2709
  result: {
2537
2710
  kind: "plan" | "none" | "patch" | "answer" | "report";
2711
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2712
+ revertAnchorId: string | null;
2713
+ postTurnSha: string | null;
2538
2714
  diffStat: {
2539
2715
  files: number;
2540
2716
  additions: number;
@@ -2542,27 +2718,34 @@ export declare const ControlThreadTurn: z.ZodObject<{
2542
2718
  } | null;
2543
2719
  blockers: number;
2544
2720
  adopted: boolean | null;
2545
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2546
2721
  preTurnSha: string | null;
2547
- postTurnSha: string | null;
2548
- revertAnchorId: string | null;
2549
2722
  revertable: boolean;
2550
2723
  };
2551
2724
  waitingOnUser: boolean;
2552
2725
  finishedAt: string | null;
2553
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2726
+ mode?: "ask" | "plan" | "agent" | undefined;
2554
2727
  n?: number | undefined;
2555
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
2728
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
2556
2729
  spendUsd?: number | null | undefined;
2557
2730
  }, {
2558
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
2559
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2731
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2732
+ mode?: "ask" | "plan" | "agent" | undefined;
2733
+ outcomeFacts?: {
2734
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2735
+ review?: "not_run" | "approved" | "blocked" | undefined;
2736
+ reason?: "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" | null | undefined;
2737
+ checks?: "passed" | "failed" | "not_configured" | undefined;
2738
+ noChanges?: boolean | undefined;
2739
+ } | null | undefined;
2560
2740
  n?: number | undefined;
2561
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
2741
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
2562
2742
  spendUsd?: number | null | undefined;
2563
2743
  outputReadyState?: "pending" | "finalizing" | "ready" | "diagnostic" | undefined;
2564
2744
  result?: {
2565
2745
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
2746
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2747
+ revertAnchorId?: string | null | undefined;
2748
+ postTurnSha?: string | null | undefined;
2566
2749
  diffStat?: {
2567
2750
  files: number;
2568
2751
  additions: number;
@@ -2570,10 +2753,7 @@ export declare const ControlThreadTurn: z.ZodObject<{
2570
2753
  } | null | undefined;
2571
2754
  blockers?: number | undefined;
2572
2755
  adopted?: boolean | null | undefined;
2573
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2574
2756
  preTurnSha?: string | null | undefined;
2575
- postTurnSha?: string | null | undefined;
2576
- revertAnchorId?: string | null | undefined;
2577
2757
  revertable?: boolean | undefined;
2578
2758
  } | undefined;
2579
2759
  waitingOnUser?: boolean | undefined;
@@ -2601,21 +2781,75 @@ export declare const ControlThreadTurn: z.ZodObject<{
2601
2781
  code?: string | null | undefined;
2602
2782
  retryable?: boolean | undefined;
2603
2783
  }>>>;
2784
+ /** How this turn's lane was continued (INV-137): native resume, a
2785
+ * continuation packet (with the delta-turn count + whether the older
2786
+ * prefix was collapsed), or a fresh start. Surfaces render a one-line
2787
+ * disclosure from this; null until the engine stamps the lane. */
2788
+ continuity: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2789
+ kind: z.ZodEnum<["native_resume", "packet", "fresh"]>;
2790
+ packetTurns: z.ZodDefault<z.ZodNumber>;
2791
+ summarized: z.ZodDefault<z.ZodBoolean>;
2792
+ laneSwitchedFrom: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2793
+ harness: z.ZodString;
2794
+ profileId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2795
+ }, "strip", z.ZodTypeAny, {
2796
+ harness: string;
2797
+ profileId: string | null;
2798
+ }, {
2799
+ harness: string;
2800
+ profileId?: string | null | undefined;
2801
+ }>>>;
2802
+ }, "strip", z.ZodTypeAny, {
2803
+ kind: "fresh" | "native_resume" | "packet";
2804
+ summarized: boolean;
2805
+ packetTurns: number;
2806
+ laneSwitchedFrom: {
2807
+ harness: string;
2808
+ profileId: string | null;
2809
+ } | null;
2810
+ }, {
2811
+ kind: "fresh" | "native_resume" | "packet";
2812
+ summarized?: boolean | undefined;
2813
+ packetTurns?: number | undefined;
2814
+ laneSwitchedFrom?: {
2815
+ harness: string;
2816
+ profileId?: string | null | undefined;
2817
+ } | null | undefined;
2818
+ }>>>;
2604
2819
  createdAt: z.ZodString;
2605
2820
  }, "strip", z.ZodTypeAny, {
2606
2821
  kind: "initial" | "followup" | "decision";
2607
2822
  createdAt: string;
2608
2823
  id: string;
2609
2824
  prompt: string;
2825
+ continuity: {
2826
+ kind: "fresh" | "native_resume" | "packet";
2827
+ summarized: boolean;
2828
+ packetTurns: number;
2829
+ laneSwitchedFrom: {
2830
+ harness: string;
2831
+ profileId: string | null;
2832
+ } | null;
2833
+ } | null;
2834
+ threadId: string;
2610
2835
  planRunId: string | null;
2611
2836
  runId: string | null;
2612
- threadId: string;
2613
2837
  parentRunId: string | null;
2614
2838
  run: {
2615
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
2839
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2840
+ outcomeFacts: {
2841
+ review: "not_run" | "approved" | "blocked";
2842
+ reason: "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" | null;
2843
+ checks: "passed" | "failed" | "not_configured";
2844
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2845
+ noChanges: boolean;
2846
+ } | null;
2616
2847
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
2617
2848
  result: {
2618
2849
  kind: "plan" | "none" | "patch" | "answer" | "report";
2850
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2851
+ revertAnchorId: string | null;
2852
+ postTurnSha: string | null;
2619
2853
  diffStat: {
2620
2854
  files: number;
2621
2855
  additions: number;
@@ -2623,17 +2857,14 @@ export declare const ControlThreadTurn: z.ZodObject<{
2623
2857
  } | null;
2624
2858
  blockers: number;
2625
2859
  adopted: boolean | null;
2626
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
2627
2860
  preTurnSha: string | null;
2628
- postTurnSha: string | null;
2629
- revertAnchorId: string | null;
2630
2861
  revertable: boolean;
2631
2862
  };
2632
2863
  waitingOnUser: boolean;
2633
2864
  finishedAt: string | null;
2634
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2865
+ mode?: "ask" | "plan" | "agent" | undefined;
2635
2866
  n?: number | undefined;
2636
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
2867
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
2637
2868
  spendUsd?: number | null | undefined;
2638
2869
  } | null;
2639
2870
  enqueueError: {
@@ -2648,18 +2879,37 @@ export declare const ControlThreadTurn: z.ZodObject<{
2648
2879
  threadId: string;
2649
2880
  kind?: "initial" | "followup" | "decision" | undefined;
2650
2881
  prompt?: string | undefined;
2882
+ continuity?: {
2883
+ kind: "fresh" | "native_resume" | "packet";
2884
+ summarized?: boolean | undefined;
2885
+ packetTurns?: number | undefined;
2886
+ laneSwitchedFrom?: {
2887
+ harness: string;
2888
+ profileId?: string | null | undefined;
2889
+ } | null | undefined;
2890
+ } | null | undefined;
2651
2891
  planRunId?: string | null | undefined;
2652
2892
  runId?: string | null | undefined;
2653
2893
  parentRunId?: string | null | undefined;
2654
2894
  run?: {
2655
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
2656
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2895
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2896
+ mode?: "ask" | "plan" | "agent" | undefined;
2897
+ outcomeFacts?: {
2898
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2899
+ review?: "not_run" | "approved" | "blocked" | undefined;
2900
+ reason?: "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" | null | undefined;
2901
+ checks?: "passed" | "failed" | "not_configured" | undefined;
2902
+ noChanges?: boolean | undefined;
2903
+ } | null | undefined;
2657
2904
  n?: number | undefined;
2658
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
2905
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
2659
2906
  spendUsd?: number | null | undefined;
2660
2907
  outputReadyState?: "pending" | "finalizing" | "ready" | "diagnostic" | undefined;
2661
2908
  result?: {
2662
2909
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
2910
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2911
+ revertAnchorId?: string | null | undefined;
2912
+ postTurnSha?: string | null | undefined;
2663
2913
  diffStat?: {
2664
2914
  files: number;
2665
2915
  additions: number;
@@ -2667,10 +2917,7 @@ export declare const ControlThreadTurn: z.ZodObject<{
2667
2917
  } | null | undefined;
2668
2918
  blockers?: number | undefined;
2669
2919
  adopted?: boolean | null | undefined;
2670
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
2671
2920
  preTurnSha?: string | null | undefined;
2672
- postTurnSha?: string | null | undefined;
2673
- revertAnchorId?: string | null | undefined;
2674
2921
  revertable?: boolean | undefined;
2675
2922
  } | undefined;
2676
2923
  waitingOnUser?: boolean | undefined;
@@ -2705,13 +2952,14 @@ export declare const ControlThreadCreateRequest: z.ZodObject<{
2705
2952
  }, {
2706
2953
  kind: "none";
2707
2954
  }>]>>;
2708
- mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
2955
+ mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "agent"]>>;
2709
2956
  workspace: z.ZodOptional<z.ZodEnum<["in_place", "isolated"]>>;
2710
2957
  authPreference: z.ZodOptional<z.ZodEnum<["subscription", "api_key", "auto"]>>;
2711
2958
  credentialProfileId: z.ZodOptional<z.ZodString>;
2712
2959
  primaryHarness: z.ZodOptional<z.ZodString>;
2713
2960
  /** Sticky eligible pool for the thread; turns inherit it when unset. */
2714
2961
  eligibleHarnesses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2962
+ access: z.ZodOptional<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>>;
2715
2963
  }, "strict", z.ZodTypeAny, {
2716
2964
  scope: {
2717
2965
  kind: "project";
@@ -2721,7 +2969,8 @@ export declare const ControlThreadCreateRequest: z.ZodObject<{
2721
2969
  kind: "none";
2722
2970
  };
2723
2971
  workspace?: "in_place" | "isolated" | undefined;
2724
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2972
+ mode?: "ask" | "plan" | "agent" | undefined;
2973
+ access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
2725
2974
  title?: string | undefined;
2726
2975
  primaryHarness?: string | undefined;
2727
2976
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
@@ -2729,7 +2978,8 @@ export declare const ControlThreadCreateRequest: z.ZodObject<{
2729
2978
  eligibleHarnesses?: string[] | undefined;
2730
2979
  }, {
2731
2980
  workspace?: "in_place" | "isolated" | undefined;
2732
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
2981
+ mode?: "ask" | "plan" | "agent" | undefined;
2982
+ access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
2733
2983
  title?: string | undefined;
2734
2984
  scope?: {
2735
2985
  kind: "project";
@@ -2752,26 +3002,49 @@ export declare const ControlThreadUpdateRequest: z.ZodObject<{
2752
3002
  primaryHarness: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2753
3003
  credentialProfileId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2754
3004
  eligibleHarnesses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3005
+ access: z.ZodOptional<z.ZodNullable<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>>>;
2755
3006
  }, "strict", z.ZodTypeAny, {
2756
3007
  state?: "active" | "closed" | undefined;
3008
+ access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null | undefined;
2757
3009
  title?: string | undefined;
2758
3010
  primaryHarness?: string | null | undefined;
2759
3011
  credentialProfileId?: string | null | undefined;
2760
3012
  eligibleHarnesses?: string[] | undefined;
2761
3013
  }, {
2762
3014
  state?: "active" | "closed" | undefined;
3015
+ access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null | undefined;
2763
3016
  title?: string | undefined;
2764
3017
  primaryHarness?: string | null | undefined;
2765
3018
  credentialProfileId?: string | null | undefined;
2766
3019
  eligibleHarnesses?: string[] | undefined;
2767
3020
  }>;
2768
3021
  export type ControlThreadUpdateRequest = z.infer<typeof ControlThreadUpdateRequest>;
3022
+ /** A registered project skipped during thread listing because its root is no
3023
+ * longer usable (F2 resilience): disclosed per-project so a dead root
3024
+ * never 400s the whole listing rather than silently dropping its threads. */
3025
+ export declare const ControlProjectListingProblem: z.ZodObject<{
3026
+ projectId: z.ZodString;
3027
+ root: z.ZodString;
3028
+ code: z.ZodEnum<["project_root_missing"]>;
3029
+ message: z.ZodString;
3030
+ }, "strict", z.ZodTypeAny, {
3031
+ code: "project_root_missing";
3032
+ message: string;
3033
+ root: string;
3034
+ projectId: string;
3035
+ }, {
3036
+ code: "project_root_missing";
3037
+ message: string;
3038
+ root: string;
3039
+ projectId: string;
3040
+ }>;
3041
+ export type ControlProjectListingProblem = z.infer<typeof ControlProjectListingProblem>;
2769
3042
  export declare const ControlThreadListResponse: z.ZodObject<{
2770
3043
  threads: z.ZodDefault<z.ZodArray<z.ZodObject<{
2771
3044
  id: z.ZodString;
2772
3045
  title: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2773
3046
  repoRoot: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2774
- mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
3047
+ mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "agent"]>>;
2775
3048
  /** How turns touch files (in-place live tree vs isolated worktree). */
2776
3049
  workspaceMode: z.ZodDefault<z.ZodEnum<["in_place", "isolated"]>>;
2777
3050
  authPreference: z.ZodDefault<z.ZodEnum<["subscription", "api_key", "auto"]>>;
@@ -2781,6 +3054,8 @@ export declare const ControlThreadListResponse: z.ZodObject<{
2781
3054
  /** Sticky credential profile (INV-135): clients can SET it via
2782
3055
  * create/PATCH, so the projection must report it back (round-15 #3). */
2783
3056
  credentialProfileId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3057
+ /** Sticky write scope for write turns (D26); null = repo trust default. */
3058
+ access: z.ZodDefault<z.ZodNullable<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>>>;
2784
3059
  state: z.ZodDefault<z.ZodEnum<["active", "closed", "trashed", "purged"]>>;
2785
3060
  trashedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2786
3061
  purgeAfter: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -2794,6 +3069,7 @@ export declare const ControlThreadListResponse: z.ZodObject<{
2794
3069
  state: "active" | "closed" | "trashed" | "purged";
2795
3070
  createdAt: string;
2796
3071
  id: string;
3072
+ access: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null;
2797
3073
  title: string | null;
2798
3074
  primaryHarness: string | null;
2799
3075
  authPreference: "auto" | "subscription" | "api_key";
@@ -2807,13 +3083,14 @@ export declare const ControlThreadListResponse: z.ZodObject<{
2807
3083
  headRunId: string | null;
2808
3084
  needsHuman: boolean;
2809
3085
  updatedAt: string;
2810
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3086
+ mode?: "ask" | "plan" | "agent" | undefined;
2811
3087
  }, {
2812
3088
  createdAt: string;
2813
3089
  id: string;
2814
3090
  updatedAt: string;
2815
3091
  state?: "active" | "closed" | "trashed" | "purged" | undefined;
2816
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3092
+ mode?: "ask" | "plan" | "agent" | undefined;
3093
+ access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null | undefined;
2817
3094
  title?: string | null | undefined;
2818
3095
  primaryHarness?: string | null | undefined;
2819
3096
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
@@ -2827,11 +3104,28 @@ export declare const ControlThreadListResponse: z.ZodObject<{
2827
3104
  headRunId?: string | null | undefined;
2828
3105
  needsHuman?: boolean | undefined;
2829
3106
  }>, "many">>;
3107
+ problems: z.ZodDefault<z.ZodArray<z.ZodObject<{
3108
+ projectId: z.ZodString;
3109
+ root: z.ZodString;
3110
+ code: z.ZodEnum<["project_root_missing"]>;
3111
+ message: z.ZodString;
3112
+ }, "strict", z.ZodTypeAny, {
3113
+ code: "project_root_missing";
3114
+ message: string;
3115
+ root: string;
3116
+ projectId: string;
3117
+ }, {
3118
+ code: "project_root_missing";
3119
+ message: string;
3120
+ root: string;
3121
+ projectId: string;
3122
+ }>, "many">>;
2830
3123
  }, "strip", z.ZodTypeAny, {
2831
3124
  threads: {
2832
3125
  state: "active" | "closed" | "trashed" | "purged";
2833
3126
  createdAt: string;
2834
3127
  id: string;
3128
+ access: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null;
2835
3129
  title: string | null;
2836
3130
  primaryHarness: string | null;
2837
3131
  authPreference: "auto" | "subscription" | "api_key";
@@ -2845,7 +3139,13 @@ export declare const ControlThreadListResponse: z.ZodObject<{
2845
3139
  headRunId: string | null;
2846
3140
  needsHuman: boolean;
2847
3141
  updatedAt: string;
2848
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3142
+ mode?: "ask" | "plan" | "agent" | undefined;
3143
+ }[];
3144
+ problems: {
3145
+ code: "project_root_missing";
3146
+ message: string;
3147
+ root: string;
3148
+ projectId: string;
2849
3149
  }[];
2850
3150
  }, {
2851
3151
  threads?: {
@@ -2853,7 +3153,8 @@ export declare const ControlThreadListResponse: z.ZodObject<{
2853
3153
  id: string;
2854
3154
  updatedAt: string;
2855
3155
  state?: "active" | "closed" | "trashed" | "purged" | undefined;
2856
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3156
+ mode?: "ask" | "plan" | "agent" | undefined;
3157
+ access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null | undefined;
2857
3158
  title?: string | null | undefined;
2858
3159
  primaryHarness?: string | null | undefined;
2859
3160
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
@@ -2867,6 +3168,12 @@ export declare const ControlThreadListResponse: z.ZodObject<{
2867
3168
  headRunId?: string | null | undefined;
2868
3169
  needsHuman?: boolean | undefined;
2869
3170
  }[] | undefined;
3171
+ problems?: {
3172
+ code: "project_root_missing";
3173
+ message: string;
3174
+ root: string;
3175
+ projectId: string;
3176
+ }[] | undefined;
2870
3177
  }>;
2871
3178
  export type ControlThreadListResponse = z.infer<typeof ControlThreadListResponse>;
2872
3179
  export declare const ControlThreadDetail: z.ZodObject<{
@@ -2874,7 +3181,7 @@ export declare const ControlThreadDetail: z.ZodObject<{
2874
3181
  id: z.ZodString;
2875
3182
  title: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2876
3183
  repoRoot: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2877
- mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
3184
+ mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "agent"]>>;
2878
3185
  /** How turns touch files (in-place live tree vs isolated worktree). */
2879
3186
  workspaceMode: z.ZodDefault<z.ZodEnum<["in_place", "isolated"]>>;
2880
3187
  authPreference: z.ZodDefault<z.ZodEnum<["subscription", "api_key", "auto"]>>;
@@ -2884,6 +3191,8 @@ export declare const ControlThreadDetail: z.ZodObject<{
2884
3191
  /** Sticky credential profile (INV-135): clients can SET it via
2885
3192
  * create/PATCH, so the projection must report it back (round-15 #3). */
2886
3193
  credentialProfileId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3194
+ /** Sticky write scope for write turns (D26); null = repo trust default. */
3195
+ access: z.ZodDefault<z.ZodNullable<z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>>>;
2887
3196
  state: z.ZodDefault<z.ZodEnum<["active", "closed", "trashed", "purged"]>>;
2888
3197
  trashedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2889
3198
  purgeAfter: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -2897,6 +3206,7 @@ export declare const ControlThreadDetail: z.ZodObject<{
2897
3206
  state: "active" | "closed" | "trashed" | "purged";
2898
3207
  createdAt: string;
2899
3208
  id: string;
3209
+ access: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null;
2900
3210
  title: string | null;
2901
3211
  primaryHarness: string | null;
2902
3212
  authPreference: "auto" | "subscription" | "api_key";
@@ -2910,13 +3220,14 @@ export declare const ControlThreadDetail: z.ZodObject<{
2910
3220
  headRunId: string | null;
2911
3221
  needsHuman: boolean;
2912
3222
  updatedAt: string;
2913
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3223
+ mode?: "ask" | "plan" | "agent" | undefined;
2914
3224
  }, {
2915
3225
  createdAt: string;
2916
3226
  id: string;
2917
3227
  updatedAt: string;
2918
3228
  state?: "active" | "closed" | "trashed" | "purged" | undefined;
2919
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3229
+ mode?: "ask" | "plan" | "agent" | undefined;
3230
+ access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null | undefined;
2920
3231
  title?: string | null | undefined;
2921
3232
  primaryHarness?: string | null | undefined;
2922
3233
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
@@ -2969,9 +3280,9 @@ export declare const ControlThreadDetail: z.ZodObject<{
2969
3280
  prompt: z.ZodDefault<z.ZodString>;
2970
3281
  /** Embedded run card (outcome/state) so the chat renders without N+1 fetches. */
2971
3282
  run: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2972
- state: z.ZodEnum<["queued", "running", "blocked", "succeeded", "no_op", "ungated", "review_not_run", "failed", "cancelled", "interrupted_unknown", "cost_unverifiable", "exhausted_overshoot", "exhausted", "not_converged", "stuck_no_progress"]>;
2973
- mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
2974
- strategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["race", "attempts", "until_clean", "swarm", "create"]>>>;
3283
+ state: z.ZodEnum<["queued", "running", "succeeded", "failed", "cancelled", "interrupted"]>;
3284
+ mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "agent"]>>;
3285
+ strategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["race", "attempts", "until_clean", "deep_scan", "create"]>>>;
2975
3286
  n: z.ZodOptional<z.ZodNumber>;
2976
3287
  result: z.ZodDefault<z.ZodObject<{
2977
3288
  kind: z.ZodDefault<z.ZodEnum<["patch", "answer", "plan", "report", "none"]>>;
@@ -3003,6 +3314,9 @@ export declare const ControlThreadDetail: z.ZodObject<{
3003
3314
  revertable: z.ZodDefault<z.ZodBoolean>;
3004
3315
  }, "strip", z.ZodTypeAny, {
3005
3316
  kind: "plan" | "none" | "patch" | "answer" | "report";
3317
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
3318
+ revertAnchorId: string | null;
3319
+ postTurnSha: string | null;
3006
3320
  diffStat: {
3007
3321
  files: number;
3008
3322
  additions: number;
@@ -3010,13 +3324,13 @@ export declare const ControlThreadDetail: z.ZodObject<{
3010
3324
  } | null;
3011
3325
  blockers: number;
3012
3326
  adopted: boolean | null;
3013
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
3014
3327
  preTurnSha: string | null;
3015
- postTurnSha: string | null;
3016
- revertAnchorId: string | null;
3017
3328
  revertable: boolean;
3018
3329
  }, {
3019
3330
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
3331
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
3332
+ revertAnchorId?: string | null | undefined;
3333
+ postTurnSha?: string | null | undefined;
3020
3334
  diffStat?: {
3021
3335
  files: number;
3022
3336
  additions: number;
@@ -3024,21 +3338,47 @@ export declare const ControlThreadDetail: z.ZodObject<{
3024
3338
  } | null | undefined;
3025
3339
  blockers?: number | undefined;
3026
3340
  adopted?: boolean | null | undefined;
3027
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
3028
3341
  preTurnSha?: string | null | undefined;
3029
- postTurnSha?: string | null | undefined;
3030
- revertAnchorId?: string | null | undefined;
3031
3342
  revertable?: boolean | undefined;
3032
3343
  }>>;
3344
+ outcomeFacts: z.ZodDefault<z.ZodNullable<z.ZodObject<{
3345
+ lifecycle: z.ZodEnum<["succeeded", "failed", "cancelled", "interrupted"]>;
3346
+ noChanges: z.ZodDefault<z.ZodBoolean>;
3347
+ checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
3348
+ review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
3349
+ 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"]>>>;
3350
+ }, "strict", z.ZodTypeAny, {
3351
+ review: "not_run" | "approved" | "blocked";
3352
+ reason: "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" | null;
3353
+ checks: "passed" | "failed" | "not_configured";
3354
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3355
+ noChanges: boolean;
3356
+ }, {
3357
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3358
+ review?: "not_run" | "approved" | "blocked" | undefined;
3359
+ reason?: "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" | null | undefined;
3360
+ checks?: "passed" | "failed" | "not_configured" | undefined;
3361
+ noChanges?: boolean | undefined;
3362
+ }>>>;
3033
3363
  spendUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3034
3364
  outputReadyState: z.ZodDefault<z.ZodEnum<["pending", "finalizing", "ready", "diagnostic"]>>;
3035
3365
  waitingOnUser: z.ZodDefault<z.ZodBoolean>;
3036
3366
  finishedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3037
3367
  }, "strip", z.ZodTypeAny, {
3038
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
3368
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3369
+ outcomeFacts: {
3370
+ review: "not_run" | "approved" | "blocked";
3371
+ reason: "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" | null;
3372
+ checks: "passed" | "failed" | "not_configured";
3373
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3374
+ noChanges: boolean;
3375
+ } | null;
3039
3376
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
3040
3377
  result: {
3041
3378
  kind: "plan" | "none" | "patch" | "answer" | "report";
3379
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
3380
+ revertAnchorId: string | null;
3381
+ postTurnSha: string | null;
3042
3382
  diffStat: {
3043
3383
  files: number;
3044
3384
  additions: number;
@@ -3046,27 +3386,34 @@ export declare const ControlThreadDetail: z.ZodObject<{
3046
3386
  } | null;
3047
3387
  blockers: number;
3048
3388
  adopted: boolean | null;
3049
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
3050
3389
  preTurnSha: string | null;
3051
- postTurnSha: string | null;
3052
- revertAnchorId: string | null;
3053
3390
  revertable: boolean;
3054
3391
  };
3055
3392
  waitingOnUser: boolean;
3056
3393
  finishedAt: string | null;
3057
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3394
+ mode?: "ask" | "plan" | "agent" | undefined;
3058
3395
  n?: number | undefined;
3059
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
3396
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
3060
3397
  spendUsd?: number | null | undefined;
3061
3398
  }, {
3062
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
3063
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3399
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3400
+ mode?: "ask" | "plan" | "agent" | undefined;
3401
+ outcomeFacts?: {
3402
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3403
+ review?: "not_run" | "approved" | "blocked" | undefined;
3404
+ reason?: "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" | null | undefined;
3405
+ checks?: "passed" | "failed" | "not_configured" | undefined;
3406
+ noChanges?: boolean | undefined;
3407
+ } | null | undefined;
3064
3408
  n?: number | undefined;
3065
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
3409
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
3066
3410
  spendUsd?: number | null | undefined;
3067
3411
  outputReadyState?: "pending" | "finalizing" | "ready" | "diagnostic" | undefined;
3068
3412
  result?: {
3069
3413
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
3414
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
3415
+ revertAnchorId?: string | null | undefined;
3416
+ postTurnSha?: string | null | undefined;
3070
3417
  diffStat?: {
3071
3418
  files: number;
3072
3419
  additions: number;
@@ -3074,10 +3421,7 @@ export declare const ControlThreadDetail: z.ZodObject<{
3074
3421
  } | null | undefined;
3075
3422
  blockers?: number | undefined;
3076
3423
  adopted?: boolean | null | undefined;
3077
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
3078
3424
  preTurnSha?: string | null | undefined;
3079
- postTurnSha?: string | null | undefined;
3080
- revertAnchorId?: string | null | undefined;
3081
3425
  revertable?: boolean | undefined;
3082
3426
  } | undefined;
3083
3427
  waitingOnUser?: boolean | undefined;
@@ -3105,21 +3449,75 @@ export declare const ControlThreadDetail: z.ZodObject<{
3105
3449
  code?: string | null | undefined;
3106
3450
  retryable?: boolean | undefined;
3107
3451
  }>>>;
3452
+ /** How this turn's lane was continued (INV-137): native resume, a
3453
+ * continuation packet (with the delta-turn count + whether the older
3454
+ * prefix was collapsed), or a fresh start. Surfaces render a one-line
3455
+ * disclosure from this; null until the engine stamps the lane. */
3456
+ continuity: z.ZodDefault<z.ZodNullable<z.ZodObject<{
3457
+ kind: z.ZodEnum<["native_resume", "packet", "fresh"]>;
3458
+ packetTurns: z.ZodDefault<z.ZodNumber>;
3459
+ summarized: z.ZodDefault<z.ZodBoolean>;
3460
+ laneSwitchedFrom: z.ZodDefault<z.ZodNullable<z.ZodObject<{
3461
+ harness: z.ZodString;
3462
+ profileId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3463
+ }, "strip", z.ZodTypeAny, {
3464
+ harness: string;
3465
+ profileId: string | null;
3466
+ }, {
3467
+ harness: string;
3468
+ profileId?: string | null | undefined;
3469
+ }>>>;
3470
+ }, "strip", z.ZodTypeAny, {
3471
+ kind: "fresh" | "native_resume" | "packet";
3472
+ summarized: boolean;
3473
+ packetTurns: number;
3474
+ laneSwitchedFrom: {
3475
+ harness: string;
3476
+ profileId: string | null;
3477
+ } | null;
3478
+ }, {
3479
+ kind: "fresh" | "native_resume" | "packet";
3480
+ summarized?: boolean | undefined;
3481
+ packetTurns?: number | undefined;
3482
+ laneSwitchedFrom?: {
3483
+ harness: string;
3484
+ profileId?: string | null | undefined;
3485
+ } | null | undefined;
3486
+ }>>>;
3108
3487
  createdAt: z.ZodString;
3109
3488
  }, "strip", z.ZodTypeAny, {
3110
3489
  kind: "initial" | "followup" | "decision";
3111
3490
  createdAt: string;
3112
3491
  id: string;
3113
3492
  prompt: string;
3493
+ continuity: {
3494
+ kind: "fresh" | "native_resume" | "packet";
3495
+ summarized: boolean;
3496
+ packetTurns: number;
3497
+ laneSwitchedFrom: {
3498
+ harness: string;
3499
+ profileId: string | null;
3500
+ } | null;
3501
+ } | null;
3502
+ threadId: string;
3114
3503
  planRunId: string | null;
3115
3504
  runId: string | null;
3116
- threadId: string;
3117
3505
  parentRunId: string | null;
3118
3506
  run: {
3119
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
3507
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3508
+ outcomeFacts: {
3509
+ review: "not_run" | "approved" | "blocked";
3510
+ reason: "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" | null;
3511
+ checks: "passed" | "failed" | "not_configured";
3512
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3513
+ noChanges: boolean;
3514
+ } | null;
3120
3515
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
3121
3516
  result: {
3122
3517
  kind: "plan" | "none" | "patch" | "answer" | "report";
3518
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
3519
+ revertAnchorId: string | null;
3520
+ postTurnSha: string | null;
3123
3521
  diffStat: {
3124
3522
  files: number;
3125
3523
  additions: number;
@@ -3127,17 +3525,14 @@ export declare const ControlThreadDetail: z.ZodObject<{
3127
3525
  } | null;
3128
3526
  blockers: number;
3129
3527
  adopted: boolean | null;
3130
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
3131
3528
  preTurnSha: string | null;
3132
- postTurnSha: string | null;
3133
- revertAnchorId: string | null;
3134
3529
  revertable: boolean;
3135
3530
  };
3136
3531
  waitingOnUser: boolean;
3137
3532
  finishedAt: string | null;
3138
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3533
+ mode?: "ask" | "plan" | "agent" | undefined;
3139
3534
  n?: number | undefined;
3140
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
3535
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
3141
3536
  spendUsd?: number | null | undefined;
3142
3537
  } | null;
3143
3538
  enqueueError: {
@@ -3152,18 +3547,37 @@ export declare const ControlThreadDetail: z.ZodObject<{
3152
3547
  threadId: string;
3153
3548
  kind?: "initial" | "followup" | "decision" | undefined;
3154
3549
  prompt?: string | undefined;
3550
+ continuity?: {
3551
+ kind: "fresh" | "native_resume" | "packet";
3552
+ summarized?: boolean | undefined;
3553
+ packetTurns?: number | undefined;
3554
+ laneSwitchedFrom?: {
3555
+ harness: string;
3556
+ profileId?: string | null | undefined;
3557
+ } | null | undefined;
3558
+ } | null | undefined;
3155
3559
  planRunId?: string | null | undefined;
3156
3560
  runId?: string | null | undefined;
3157
3561
  parentRunId?: string | null | undefined;
3158
3562
  run?: {
3159
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
3160
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3563
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3564
+ mode?: "ask" | "plan" | "agent" | undefined;
3565
+ outcomeFacts?: {
3566
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3567
+ review?: "not_run" | "approved" | "blocked" | undefined;
3568
+ reason?: "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" | null | undefined;
3569
+ checks?: "passed" | "failed" | "not_configured" | undefined;
3570
+ noChanges?: boolean | undefined;
3571
+ } | null | undefined;
3161
3572
  n?: number | undefined;
3162
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
3573
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
3163
3574
  spendUsd?: number | null | undefined;
3164
3575
  outputReadyState?: "pending" | "finalizing" | "ready" | "diagnostic" | undefined;
3165
3576
  result?: {
3166
3577
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
3578
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
3579
+ revertAnchorId?: string | null | undefined;
3580
+ postTurnSha?: string | null | undefined;
3167
3581
  diffStat?: {
3168
3582
  files: number;
3169
3583
  additions: number;
@@ -3171,10 +3585,7 @@ export declare const ControlThreadDetail: z.ZodObject<{
3171
3585
  } | null | undefined;
3172
3586
  blockers?: number | undefined;
3173
3587
  adopted?: boolean | null | undefined;
3174
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
3175
3588
  preTurnSha?: string | null | undefined;
3176
- postTurnSha?: string | null | undefined;
3177
- revertAnchorId?: string | null | undefined;
3178
3589
  revertable?: boolean | undefined;
3179
3590
  } | undefined;
3180
3591
  waitingOnUser?: boolean | undefined;
@@ -3192,6 +3603,7 @@ export declare const ControlThreadDetail: z.ZodObject<{
3192
3603
  state: "active" | "closed" | "trashed" | "purged";
3193
3604
  createdAt: string;
3194
3605
  id: string;
3606
+ access: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null;
3195
3607
  title: string | null;
3196
3608
  primaryHarness: string | null;
3197
3609
  authPreference: "auto" | "subscription" | "api_key";
@@ -3205,7 +3617,7 @@ export declare const ControlThreadDetail: z.ZodObject<{
3205
3617
  headRunId: string | null;
3206
3618
  needsHuman: boolean;
3207
3619
  updatedAt: string;
3208
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3620
+ mode?: "ask" | "plan" | "agent" | undefined;
3209
3621
  };
3210
3622
  sessions: {
3211
3623
  harnessId: string;
@@ -3221,15 +3633,34 @@ export declare const ControlThreadDetail: z.ZodObject<{
3221
3633
  createdAt: string;
3222
3634
  id: string;
3223
3635
  prompt: string;
3636
+ continuity: {
3637
+ kind: "fresh" | "native_resume" | "packet";
3638
+ summarized: boolean;
3639
+ packetTurns: number;
3640
+ laneSwitchedFrom: {
3641
+ harness: string;
3642
+ profileId: string | null;
3643
+ } | null;
3644
+ } | null;
3645
+ threadId: string;
3224
3646
  planRunId: string | null;
3225
3647
  runId: string | null;
3226
- threadId: string;
3227
3648
  parentRunId: string | null;
3228
3649
  run: {
3229
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
3650
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3651
+ outcomeFacts: {
3652
+ review: "not_run" | "approved" | "blocked";
3653
+ reason: "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" | null;
3654
+ checks: "passed" | "failed" | "not_configured";
3655
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3656
+ noChanges: boolean;
3657
+ } | null;
3230
3658
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
3231
3659
  result: {
3232
3660
  kind: "plan" | "none" | "patch" | "answer" | "report";
3661
+ applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
3662
+ revertAnchorId: string | null;
3663
+ postTurnSha: string | null;
3233
3664
  diffStat: {
3234
3665
  files: number;
3235
3666
  additions: number;
@@ -3237,17 +3668,14 @@ export declare const ControlThreadDetail: z.ZodObject<{
3237
3668
  } | null;
3238
3669
  blockers: number;
3239
3670
  adopted: boolean | null;
3240
- applyState: "not_applied" | "applied" | "applied_review_blocked" | "reverted";
3241
3671
  preTurnSha: string | null;
3242
- postTurnSha: string | null;
3243
- revertAnchorId: string | null;
3244
3672
  revertable: boolean;
3245
3673
  };
3246
3674
  waitingOnUser: boolean;
3247
3675
  finishedAt: string | null;
3248
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3676
+ mode?: "ask" | "plan" | "agent" | undefined;
3249
3677
  n?: number | undefined;
3250
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
3678
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
3251
3679
  spendUsd?: number | null | undefined;
3252
3680
  } | null;
3253
3681
  enqueueError: {
@@ -3263,7 +3691,8 @@ export declare const ControlThreadDetail: z.ZodObject<{
3263
3691
  id: string;
3264
3692
  updatedAt: string;
3265
3693
  state?: "active" | "closed" | "trashed" | "purged" | undefined;
3266
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3694
+ mode?: "ask" | "plan" | "agent" | undefined;
3695
+ access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | null | undefined;
3267
3696
  title?: string | null | undefined;
3268
3697
  primaryHarness?: string | null | undefined;
3269
3698
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
@@ -3292,18 +3721,37 @@ export declare const ControlThreadDetail: z.ZodObject<{
3292
3721
  threadId: string;
3293
3722
  kind?: "initial" | "followup" | "decision" | undefined;
3294
3723
  prompt?: string | undefined;
3724
+ continuity?: {
3725
+ kind: "fresh" | "native_resume" | "packet";
3726
+ summarized?: boolean | undefined;
3727
+ packetTurns?: number | undefined;
3728
+ laneSwitchedFrom?: {
3729
+ harness: string;
3730
+ profileId?: string | null | undefined;
3731
+ } | null | undefined;
3732
+ } | null | undefined;
3295
3733
  planRunId?: string | null | undefined;
3296
3734
  runId?: string | null | undefined;
3297
3735
  parentRunId?: string | null | undefined;
3298
3736
  run?: {
3299
- state: "failed" | "cancelled" | "running" | "interrupted_unknown" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | "queued" | "succeeded";
3300
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
3737
+ state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3738
+ mode?: "ask" | "plan" | "agent" | undefined;
3739
+ outcomeFacts?: {
3740
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3741
+ review?: "not_run" | "approved" | "blocked" | undefined;
3742
+ reason?: "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" | null | undefined;
3743
+ checks?: "passed" | "failed" | "not_configured" | undefined;
3744
+ noChanges?: boolean | undefined;
3745
+ } | null | undefined;
3301
3746
  n?: number | undefined;
3302
- strategy?: "race" | "attempts" | "swarm" | "create" | "until_clean" | null | undefined;
3747
+ strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
3303
3748
  spendUsd?: number | null | undefined;
3304
3749
  outputReadyState?: "pending" | "finalizing" | "ready" | "diagnostic" | undefined;
3305
3750
  result?: {
3306
3751
  kind?: "plan" | "none" | "patch" | "answer" | "report" | undefined;
3752
+ applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
3753
+ revertAnchorId?: string | null | undefined;
3754
+ postTurnSha?: string | null | undefined;
3307
3755
  diffStat?: {
3308
3756
  files: number;
3309
3757
  additions: number;
@@ -3311,10 +3759,7 @@ export declare const ControlThreadDetail: z.ZodObject<{
3311
3759
  } | null | undefined;
3312
3760
  blockers?: number | undefined;
3313
3761
  adopted?: boolean | null | undefined;
3314
- applyState?: "not_applied" | "applied" | "applied_review_blocked" | "reverted" | undefined;
3315
3762
  preTurnSha?: string | null | undefined;
3316
- postTurnSha?: string | null | undefined;
3317
- revertAnchorId?: string | null | undefined;
3318
3763
  revertable?: boolean | undefined;
3319
3764
  } | undefined;
3320
3765
  waitingOnUser?: boolean | undefined;
@@ -3407,6 +3852,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3407
3852
  max_count: number;
3408
3853
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
3409
3854
  }>, "many">>;
3855
+ mcp_injection: z.ZodDefault<z.ZodBoolean>;
3856
+ mcp_injection_requires_full_access: z.ZodDefault<z.ZodBoolean>;
3410
3857
  }, "strip", z.ZodTypeAny, {
3411
3858
  auth: {
3412
3859
  supported_sources: ("native_session" | "oauth_token_env" | "api_key_env" | "api_key_flag" | "provider_auth_file" | "none")[];
@@ -3430,6 +3877,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3430
3877
  max_count: number;
3431
3878
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
3432
3879
  }[];
3880
+ mcp_injection: boolean;
3881
+ mcp_injection_requires_full_access: boolean;
3433
3882
  }, {
3434
3883
  auth?: {
3435
3884
  supported_sources?: ("native_session" | "oauth_token_env" | "api_key_env" | "api_key_flag" | "provider_auth_file" | "none")[] | undefined;
@@ -3453,6 +3902,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3453
3902
  max_count: number;
3454
3903
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
3455
3904
  }[] | undefined;
3905
+ mcp_injection?: boolean | undefined;
3906
+ mcp_injection_requires_full_access?: boolean | undefined;
3456
3907
  }>>;
3457
3908
  capabilities: z.ZodObject<{
3458
3909
  plan: z.ZodDefault<z.ZodBoolean>;
@@ -3468,7 +3919,6 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3468
3919
  max_turns: z.ZodDefault<z.ZodBoolean>;
3469
3920
  tool_lists: z.ZodDefault<z.ZodBoolean>;
3470
3921
  interactive: z.ZodDefault<z.ZodBoolean>;
3471
- orchestrate: z.ZodDefault<z.ZodBoolean>;
3472
3922
  json_schema_output: z.ZodDefault<z.ZodBoolean>;
3473
3923
  effort_levels: z.ZodDefault<z.ZodArray<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>, "many">>;
3474
3924
  known_models: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -3484,7 +3934,6 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3484
3934
  known_models_verified_against: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3485
3935
  }, "strip", z.ZodTypeAny, {
3486
3936
  plan: boolean;
3487
- orchestrate: boolean;
3488
3937
  implement: boolean;
3489
3938
  create_from_scratch: boolean;
3490
3939
  review: boolean;
@@ -3506,7 +3955,6 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3506
3955
  known_models_verified_against: string | null;
3507
3956
  }, {
3508
3957
  plan?: boolean | undefined;
3509
- orchestrate?: boolean | undefined;
3510
3958
  implement?: boolean | undefined;
3511
3959
  create_from_scratch?: boolean | undefined;
3512
3960
  review?: boolean | undefined;
@@ -3557,10 +4005,11 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3557
4005
  max_count: number;
3558
4006
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
3559
4007
  }[];
4008
+ mcp_injection: boolean;
4009
+ mcp_injection_requires_full_access: boolean;
3560
4010
  };
3561
4011
  capabilities: {
3562
4012
  plan: boolean;
3563
- orchestrate: boolean;
3564
4013
  implement: boolean;
3565
4014
  create_from_scratch: boolean;
3566
4015
  review: boolean;
@@ -3591,7 +4040,6 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3591
4040
  id: string;
3592
4041
  capabilities: {
3593
4042
  plan?: boolean | undefined;
3594
- orchestrate?: boolean | undefined;
3595
4043
  implement?: boolean | undefined;
3596
4044
  create_from_scratch?: boolean | undefined;
3597
4045
  review?: boolean | undefined;
@@ -3638,6 +4086,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3638
4086
  max_count: number;
3639
4087
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
3640
4088
  }[] | undefined;
4089
+ mcp_injection?: boolean | undefined;
4090
+ mcp_injection_requires_full_access?: boolean | undefined;
3641
4091
  } | undefined;
3642
4092
  auth_modes?: ("api_key" | "none" | "local_session")[] | undefined;
3643
4093
  access_profiles_supported?: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[] | undefined;
@@ -3767,10 +4217,11 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3767
4217
  max_count: number;
3768
4218
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
3769
4219
  }[];
4220
+ mcp_injection: boolean;
4221
+ mcp_injection_requires_full_access: boolean;
3770
4222
  };
3771
4223
  capabilities: {
3772
4224
  plan: boolean;
3773
- orchestrate: boolean;
3774
4225
  implement: boolean;
3775
4226
  create_from_scratch: boolean;
3776
4227
  review: boolean;
@@ -3819,7 +4270,6 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3819
4270
  id: string;
3820
4271
  capabilities: {
3821
4272
  plan?: boolean | undefined;
3822
- orchestrate?: boolean | undefined;
3823
4273
  implement?: boolean | undefined;
3824
4274
  create_from_scratch?: boolean | undefined;
3825
4275
  review?: boolean | undefined;
@@ -3866,6 +4316,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3866
4316
  max_count: number;
3867
4317
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
3868
4318
  }[] | undefined;
4319
+ mcp_injection?: boolean | undefined;
4320
+ mcp_injection_requires_full_access?: boolean | undefined;
3869
4321
  } | undefined;
3870
4322
  auth_modes?: ("api_key" | "none" | "local_session")[] | undefined;
3871
4323
  access_profiles_supported?: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[] | undefined;
@@ -3945,10 +4397,11 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3945
4397
  max_count: number;
3946
4398
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
3947
4399
  }[];
4400
+ mcp_injection: boolean;
4401
+ mcp_injection_requires_full_access: boolean;
3948
4402
  };
3949
4403
  capabilities: {
3950
4404
  plan: boolean;
3951
- orchestrate: boolean;
3952
4405
  implement: boolean;
3953
4406
  create_from_scratch: boolean;
3954
4407
  review: boolean;
@@ -3999,7 +4452,6 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3999
4452
  id: string;
4000
4453
  capabilities: {
4001
4454
  plan?: boolean | undefined;
4002
- orchestrate?: boolean | undefined;
4003
4455
  implement?: boolean | undefined;
4004
4456
  create_from_scratch?: boolean | undefined;
4005
4457
  review?: boolean | undefined;
@@ -4046,6 +4498,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
4046
4498
  max_count: number;
4047
4499
  transport: "file_path" | "base64_stream" | "base64_inline" | "text_inline";
4048
4500
  }[] | undefined;
4501
+ mcp_injection?: boolean | undefined;
4502
+ mcp_injection_requires_full_access?: boolean | undefined;
4049
4503
  } | undefined;
4050
4504
  auth_modes?: ("api_key" | "none" | "local_session")[] | undefined;
4051
4505
  access_profiles_supported?: ("readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native")[] | undefined;
@@ -4123,14 +4577,13 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4123
4577
  /** How long a run waits for an interactive answer before a benign decline. */
4124
4578
  interactionTimeoutMs: z.ZodDefault<z.ZodNumber>;
4125
4579
  routing: z.ZodDefault<z.ZodObject<{
4126
- defaultPolicy: z.ZodDefault<z.ZodEnum<["auto", "primary"]>>;
4127
4580
  primaryHarness: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4128
4581
  eligibleHarnesses: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4129
4582
  envInheritance: z.ZodDefault<z.ZodEnum<["mirror_native", "clean"]>>;
4130
4583
  authPreference: z.ZodDefault<z.ZodEnum<["subscription", "api_key", "auto"]>>;
4131
4584
  goal: z.ZodDefault<z.ZodEnum<["auto", "quality", "economy"]>>;
4132
4585
  paidFallback: z.ZodDefault<z.ZodEnum<["never", "when_unavailable", "allowed_within_cap"]>>;
4133
- qualityTiers: z.ZodDefault<z.ZodRecord<z.ZodEnum<["plan", "spec", "implement", "create_from_scratch", "repair", "review", "verify", "synthesize", "explain", "audit", "orchestrate"]>, z.ZodArray<z.ZodArray<z.ZodObject<{
4586
+ qualityTiers: z.ZodDefault<z.ZodRecord<z.ZodEnum<["plan", "spec", "implement", "create_from_scratch", "repair", "review", "verify", "synthesize", "explain", "audit"]>, z.ZodArray<z.ZodArray<z.ZodObject<{
4134
4587
  harness: z.ZodString;
4135
4588
  model: z.ZodString;
4136
4589
  effort: z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>;
@@ -4148,10 +4601,9 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4148
4601
  primaryHarness: string | null;
4149
4602
  authPreference: "auto" | "subscription" | "api_key";
4150
4603
  eligibleHarnesses: string[];
4151
- defaultPolicy: "auto" | "primary";
4152
4604
  envInheritance: "mirror_native" | "clean";
4153
4605
  paidFallback: "never" | "when_unavailable" | "allowed_within_cap";
4154
- qualityTiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
4606
+ qualityTiers: Partial<Record<"plan" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain" | "audit", {
4155
4607
  harness: string;
4156
4608
  model: string;
4157
4609
  effort: "low" | "medium" | "high" | "xhigh" | "max";
@@ -4161,10 +4613,9 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4161
4613
  primaryHarness?: string | null | undefined;
4162
4614
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4163
4615
  eligibleHarnesses?: string[] | undefined;
4164
- defaultPolicy?: "auto" | "primary" | undefined;
4165
4616
  envInheritance?: "mirror_native" | "clean" | undefined;
4166
4617
  paidFallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
4167
- qualityTiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
4618
+ qualityTiers?: Partial<Record<"plan" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain" | "audit", {
4168
4619
  harness: string;
4169
4620
  model: string;
4170
4621
  effort: "low" | "medium" | "high" | "xhigh" | "max";
@@ -4237,6 +4688,9 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4237
4688
  }>>;
4238
4689
  harnesses: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
4239
4690
  enabled: z.ZodDefault<z.ZodBoolean>;
4691
+ /** Whether the native/CLI login participates in the credential
4692
+ * ladder for this harness (INV-135). */
4693
+ nativeCredentialsEnabled: z.ZodDefault<z.ZodBoolean>;
4240
4694
  defaultModel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4241
4695
  effort: z.ZodDefault<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
4242
4696
  maxTurns: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
@@ -4256,6 +4710,7 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4256
4710
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
4257
4711
  authPreference: "auto" | "subscription" | "api_key";
4258
4712
  maxTurns: number | null;
4713
+ nativeCredentialsEnabled: boolean;
4259
4714
  defaultModel: string | null;
4260
4715
  maxRounds: number | null;
4261
4716
  toolsAllow: string[];
@@ -4268,6 +4723,7 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4268
4723
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
4269
4724
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4270
4725
  maxTurns?: number | null | undefined;
4726
+ nativeCredentialsEnabled?: boolean | undefined;
4271
4727
  defaultModel?: string | null | undefined;
4272
4728
  maxRounds?: number | null | undefined;
4273
4729
  toolsAllow?: string[] | undefined;
@@ -4282,6 +4738,7 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4282
4738
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
4283
4739
  authPreference: "auto" | "subscription" | "api_key";
4284
4740
  maxTurns: number | null;
4741
+ nativeCredentialsEnabled: boolean;
4285
4742
  defaultModel: string | null;
4286
4743
  maxRounds: number | null;
4287
4744
  toolsAllow: string[];
@@ -4302,10 +4759,9 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4302
4759
  primaryHarness: string | null;
4303
4760
  authPreference: "auto" | "subscription" | "api_key";
4304
4761
  eligibleHarnesses: string[];
4305
- defaultPolicy: "auto" | "primary";
4306
4762
  envInheritance: "mirror_native" | "clean";
4307
4763
  paidFallback: "never" | "when_unavailable" | "allowed_within_cap";
4308
- qualityTiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
4764
+ qualityTiers: Partial<Record<"plan" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain" | "audit", {
4309
4765
  harness: string;
4310
4766
  model: string;
4311
4767
  effort: "low" | "medium" | "high" | "xhigh" | "max";
@@ -4329,6 +4785,7 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4329
4785
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
4330
4786
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4331
4787
  maxTurns?: number | null | undefined;
4788
+ nativeCredentialsEnabled?: boolean | undefined;
4332
4789
  defaultModel?: string | null | undefined;
4333
4790
  maxRounds?: number | null | undefined;
4334
4791
  toolsAllow?: string[] | undefined;
@@ -4349,10 +4806,9 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4349
4806
  primaryHarness?: string | null | undefined;
4350
4807
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4351
4808
  eligibleHarnesses?: string[] | undefined;
4352
- defaultPolicy?: "auto" | "primary" | undefined;
4353
4809
  envInheritance?: "mirror_native" | "clean" | undefined;
4354
4810
  paidFallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
4355
- qualityTiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
4811
+ qualityTiers?: Partial<Record<"plan" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain" | "audit", {
4356
4812
  harness: string;
4357
4813
  model: string;
4358
4814
  effort: "low" | "medium" | "high" | "xhigh" | "max";
@@ -4377,6 +4833,8 @@ export type ControlSettingsSnapshot = z.infer<typeof ControlSettingsSnapshot>;
4377
4833
  */
4378
4834
  export declare const ControlHarnessSettingsPatch: z.ZodObject<{
4379
4835
  enabled: z.ZodOptional<z.ZodBoolean>;
4836
+ /** Toggle the native/CLI login in this harness's credential ladder (INV-135). */
4837
+ nativeCredentialsEnabled: z.ZodOptional<z.ZodBoolean>;
4380
4838
  defaultModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4381
4839
  effort: z.ZodOptional<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
4382
4840
  maxTurns: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -4395,6 +4853,7 @@ export declare const ControlHarnessSettingsPatch: z.ZodObject<{
4395
4853
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
4396
4854
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4397
4855
  maxTurns?: number | null | undefined;
4856
+ nativeCredentialsEnabled?: boolean | undefined;
4398
4857
  defaultModel?: string | null | undefined;
4399
4858
  maxRounds?: number | null | undefined;
4400
4859
  toolsAllow?: string[] | undefined;
@@ -4407,6 +4866,7 @@ export declare const ControlHarnessSettingsPatch: z.ZodObject<{
4407
4866
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
4408
4867
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4409
4868
  maxTurns?: number | null | undefined;
4869
+ nativeCredentialsEnabled?: boolean | undefined;
4410
4870
  defaultModel?: string | null | undefined;
4411
4871
  maxRounds?: number | null | undefined;
4412
4872
  toolsAllow?: string[] | undefined;
@@ -4418,7 +4878,7 @@ export type ControlHarnessSettingsPatch = z.infer<typeof ControlHarnessSettingsP
4418
4878
  export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4419
4879
  routingGoal: z.ZodOptional<z.ZodEnum<["auto", "quality", "economy"]>>;
4420
4880
  paidFallback: z.ZodOptional<z.ZodEnum<["never", "when_unavailable", "allowed_within_cap"]>>;
4421
- qualityTiers: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodEnum<["plan", "spec", "implement", "create_from_scratch", "repair", "review", "verify", "synthesize", "explain", "audit", "orchestrate"]>, z.ZodArray<z.ZodArray<z.ZodObject<{
4881
+ qualityTiers: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodEnum<["plan", "spec", "implement", "create_from_scratch", "repair", "review", "verify", "synthesize", "explain", "audit"]>, z.ZodArray<z.ZodArray<z.ZodObject<{
4422
4882
  harness: z.ZodString;
4423
4883
  model: z.ZodString;
4424
4884
  effort: z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>;
@@ -4432,7 +4892,6 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4432
4892
  effort: "low" | "medium" | "high" | "xhigh" | "max";
4433
4893
  }>, "many">, "many">>>>;
4434
4894
  interactionTimeoutMs: z.ZodOptional<z.ZodNumber>;
4435
- routingPolicy: z.ZodOptional<z.ZodEnum<["auto", "primary"]>>;
4436
4895
  primaryHarness: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4437
4896
  eligibleHarnesses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4438
4897
  envInheritance: z.ZodOptional<z.ZodEnum<["mirror_native", "clean"]>>;
@@ -4455,6 +4914,8 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4455
4914
  authPreference: z.ZodOptional<z.ZodEnum<["subscription", "api_key", "auto"]>>;
4456
4915
  harnesses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
4457
4916
  enabled: z.ZodOptional<z.ZodBoolean>;
4917
+ /** Toggle the native/CLI login in this harness's credential ladder (INV-135). */
4918
+ nativeCredentialsEnabled: z.ZodOptional<z.ZodBoolean>;
4458
4919
  defaultModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4459
4920
  effort: z.ZodOptional<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
4460
4921
  maxTurns: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -4473,6 +4934,7 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4473
4934
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
4474
4935
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4475
4936
  maxTurns?: number | null | undefined;
4937
+ nativeCredentialsEnabled?: boolean | undefined;
4476
4938
  defaultModel?: string | null | undefined;
4477
4939
  maxRounds?: number | null | undefined;
4478
4940
  toolsAllow?: string[] | undefined;
@@ -4485,6 +4947,7 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4485
4947
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
4486
4948
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4487
4949
  maxTurns?: number | null | undefined;
4950
+ nativeCredentialsEnabled?: boolean | undefined;
4488
4951
  defaultModel?: string | null | undefined;
4489
4952
  maxRounds?: number | null | undefined;
4490
4953
  toolsAllow?: string[] | undefined;
@@ -4499,6 +4962,7 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4499
4962
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
4500
4963
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4501
4964
  maxTurns?: number | null | undefined;
4965
+ nativeCredentialsEnabled?: boolean | undefined;
4502
4966
  defaultModel?: string | null | undefined;
4503
4967
  maxRounds?: number | null | undefined;
4504
4968
  toolsAllow?: string[] | undefined;
@@ -4513,7 +4977,7 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4513
4977
  interactionTimeoutMs?: number | undefined;
4514
4978
  envInheritance?: "mirror_native" | "clean" | undefined;
4515
4979
  paidFallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
4516
- qualityTiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
4980
+ qualityTiers?: Partial<Record<"plan" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain" | "audit", {
4517
4981
  harness: string;
4518
4982
  model: string;
4519
4983
  effort: "low" | "medium" | "high" | "xhigh" | "max";
@@ -4524,7 +4988,6 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4524
4988
  kind: "finite";
4525
4989
  maxUsd: number;
4526
4990
  } | undefined;
4527
- routingPolicy?: "auto" | "primary" | undefined;
4528
4991
  }, {
4529
4992
  harnesses?: Record<string, {
4530
4993
  enabled?: boolean | undefined;
@@ -4532,6 +4995,7 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4532
4995
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
4533
4996
  authPreference?: "auto" | "subscription" | "api_key" | undefined;
4534
4997
  maxTurns?: number | null | undefined;
4998
+ nativeCredentialsEnabled?: boolean | undefined;
4535
4999
  defaultModel?: string | null | undefined;
4536
5000
  maxRounds?: number | null | undefined;
4537
5001
  toolsAllow?: string[] | undefined;
@@ -4546,7 +5010,7 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4546
5010
  interactionTimeoutMs?: number | undefined;
4547
5011
  envInheritance?: "mirror_native" | "clean" | undefined;
4548
5012
  paidFallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
4549
- qualityTiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
5013
+ qualityTiers?: Partial<Record<"plan" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain" | "audit", {
4550
5014
  harness: string;
4551
5015
  model: string;
4552
5016
  effort: "low" | "medium" | "high" | "xhigh" | "max";
@@ -4557,7 +5021,6 @@ export declare const ControlSettingsUpdateRequest: z.ZodObject<{
4557
5021
  kind: "finite";
4558
5022
  maxUsd: number;
4559
5023
  } | undefined;
4560
- routingPolicy?: "auto" | "primary" | undefined;
4561
5024
  }>;
4562
5025
  export type ControlSettingsUpdateRequest = z.infer<typeof ControlSettingsUpdateRequest>;
4563
5026
  //# sourceMappingURL=control.d.ts.map