@claudexor/schema 2.1.2 → 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 +380 -215
  21. package/dist/control-run-detail.d.ts.map +1 -1
  22. package/dist/control-run-detail.js +54 -8
  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 -323
  27. package/dist/control.d.ts.map +1 -1
  28. package/dist/control.js +164 -71
  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 +46 -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 +305 -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 +10 -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 -592
  155. package/dist/control-spec.d.ts.map +0 -1
  156. package/dist/control-spec.js +0 -85
  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 -206
  168. package/generated/ControlSpecSession.schema.json +0 -249
  169. package/generated/ControlSpecSessionListResponse.schema.json +0 -261
  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
@@ -1,556 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * The autonomous `orchestrate` planner. It is NOT a privileged harness: it is
4
- * an intent routed like reviewers (doctor-ok + capability + quota headroom),
5
- * sticky per thread, overridable. Its tool belt maps 1:1 onto existing engine
6
- * entry points; it never grows its own business logic.
7
- *
8
- * Detailed per-tool input/output schemas are introduced alongside their wiring
9
- * (staged-field discipline); this module fixes the tool vocabulary + contract.
10
- */
11
- export declare const OrchestrateToolName: z.ZodEnum<["start_run", "race", "status", "answer_question", "apply", "review"]>;
12
- export type OrchestrateToolName = z.infer<typeof OrchestrateToolName>;
13
- /** How much the planner may act without confirmation. */
14
- export declare const OrchestrateAutonomy: z.ZodEnum<["suggest", "auto_safe", "auto_full"]>;
15
- export type OrchestrateAutonomy = z.infer<typeof OrchestrateAutonomy>;
16
- export declare const DEFAULT_ORCHESTRATE_TOOL_BELT: OrchestrateToolName[];
17
- export declare const OrchestrateContract: z.ZodObject<{
18
- thread_id: z.ZodString;
19
- goal: z.ZodString;
20
- tool_belt: z.ZodDefault<z.ZodArray<z.ZodEnum<["start_run", "race", "status", "answer_question", "apply", "review"]>, "many">>;
21
- budget: z.ZodDefault<z.ZodObject<{
22
- paid_budget: z.ZodDefault<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
23
- kind: z.ZodLiteral<"unlimited">;
24
- }, "strict", z.ZodTypeAny, {
25
- kind: "unlimited";
26
- }, {
27
- kind: "unlimited";
28
- }>, z.ZodObject<{
29
- kind: z.ZodLiteral<"finite">;
30
- maxUsd: z.ZodNumber;
31
- }, "strict", z.ZodTypeAny, {
32
- kind: "finite";
33
- maxUsd: number;
34
- }, {
35
- kind: "finite";
36
- maxUsd: number;
37
- }>]>>;
38
- max_tool_calls: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
39
- }, "strip", z.ZodTypeAny, {
40
- paid_budget: {
41
- kind: "unlimited";
42
- } | {
43
- kind: "finite";
44
- maxUsd: number;
45
- };
46
- max_tool_calls: number | null;
47
- }, {
48
- paid_budget?: {
49
- kind: "unlimited";
50
- } | {
51
- kind: "finite";
52
- maxUsd: number;
53
- } | undefined;
54
- max_tool_calls?: number | null | undefined;
55
- }>>;
56
- autonomy: z.ZodDefault<z.ZodEnum<["suggest", "auto_safe", "auto_full"]>>;
57
- }, "strip", z.ZodTypeAny, {
58
- thread_id: string;
59
- budget: {
60
- paid_budget: {
61
- kind: "unlimited";
62
- } | {
63
- kind: "finite";
64
- maxUsd: number;
65
- };
66
- max_tool_calls: number | null;
67
- };
68
- goal: string;
69
- tool_belt: ("status" | "review" | "apply" | "start_run" | "race" | "answer_question")[];
70
- autonomy: "suggest" | "auto_safe" | "auto_full";
71
- }, {
72
- thread_id: string;
73
- goal: string;
74
- budget?: {
75
- paid_budget?: {
76
- kind: "unlimited";
77
- } | {
78
- kind: "finite";
79
- maxUsd: number;
80
- } | undefined;
81
- max_tool_calls?: number | null | undefined;
82
- } | undefined;
83
- tool_belt?: ("status" | "review" | "apply" | "start_run" | "race" | "answer_question")[] | undefined;
84
- autonomy?: "suggest" | "auto_safe" | "auto_full" | undefined;
85
- }>;
86
- export type OrchestrateContract = z.infer<typeof OrchestrateContract>;
87
- /**
88
- * Data-driven tool-risk classification. SAFE = provably no live-tree mutation
89
- * (isolated envelope sub-runs or pure reads); RISKY = mutates the live tree.
90
- * This is the SSOT the executor classifies against — never a hardcoded
91
- * enum-in-logic switch. `apply` is the only mutating tool.
92
- */
93
- export declare const TOOL_RISK: Record<OrchestrateToolName, "safe" | "risky">;
94
- /**
95
- * Classify a tool's risk, FAIL-CLOSED: any unknown/undeclared tool is risky.
96
- * The executor must never auto-run a tool it cannot prove is safe.
97
- */
98
- export declare function toolRisk(tool: string): "safe" | "risky";
99
- /**
100
- * One concrete tool invocation in a planner plan, with PER-TOOL TYPED args via a
101
- * discriminated union on `tool`. The executor (auto_safe/auto_full) runs these
102
- * in order; under `suggest` the user executes them. Args are validated by the
103
- * variant — never an open `z.record` bag — so a malformed plan fails loudly.
104
- */
105
- export declare const OrchestratePlanCall: z.ZodDiscriminatedUnion<"tool", [z.ZodObject<{
106
- tool: z.ZodLiteral<"start_run">;
107
- prompt: z.ZodString;
108
- mode: z.ZodDefault<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
109
- harness: z.ZodOptional<z.ZodString>;
110
- why: z.ZodDefault<z.ZodString>;
111
- required: z.ZodDefault<z.ZodBoolean>;
112
- }, "strip", z.ZodTypeAny, {
113
- mode: "ask" | "plan" | "audit" | "agent" | "orchestrate";
114
- prompt: string;
115
- tool: "start_run";
116
- required: boolean;
117
- why: string;
118
- harness?: string | undefined;
119
- }, {
120
- prompt: string;
121
- tool: "start_run";
122
- harness?: string | undefined;
123
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
124
- required?: boolean | undefined;
125
- why?: string | undefined;
126
- }>, z.ZodObject<{
127
- tool: z.ZodLiteral<"race">;
128
- prompt: z.ZodString;
129
- n: z.ZodDefault<z.ZodNumber>;
130
- why: z.ZodDefault<z.ZodString>;
131
- required: z.ZodDefault<z.ZodBoolean>;
132
- }, "strip", z.ZodTypeAny, {
133
- prompt: string;
134
- tool: "race";
135
- required: boolean;
136
- why: string;
137
- n: number;
138
- }, {
139
- prompt: string;
140
- tool: "race";
141
- required?: boolean | undefined;
142
- why?: string | undefined;
143
- n?: number | undefined;
144
- }>, z.ZodObject<{
145
- tool: z.ZodLiteral<"review">;
146
- run_id: z.ZodString;
147
- why: z.ZodDefault<z.ZodString>;
148
- required: z.ZodDefault<z.ZodBoolean>;
149
- }, "strip", z.ZodTypeAny, {
150
- tool: "review";
151
- run_id: string;
152
- required: boolean;
153
- why: string;
154
- }, {
155
- tool: "review";
156
- run_id: string;
157
- required?: boolean | undefined;
158
- why?: string | undefined;
159
- }>, z.ZodObject<{
160
- tool: z.ZodLiteral<"status">;
161
- run_id: z.ZodString;
162
- why: z.ZodDefault<z.ZodString>;
163
- required: z.ZodDefault<z.ZodBoolean>;
164
- }, "strip", z.ZodTypeAny, {
165
- tool: "status";
166
- run_id: string;
167
- required: boolean;
168
- why: string;
169
- }, {
170
- tool: "status";
171
- run_id: string;
172
- required?: boolean | undefined;
173
- why?: string | undefined;
174
- }>, z.ZodObject<{
175
- tool: z.ZodLiteral<"answer_question">;
176
- interaction_id: z.ZodString;
177
- answers: z.ZodDefault<z.ZodArray<z.ZodObject<{
178
- question_id: z.ZodString;
179
- selected_labels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
180
- free_text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
181
- }, "strip", z.ZodTypeAny, {
182
- question_id: string;
183
- selected_labels: string[];
184
- free_text: string | null;
185
- }, {
186
- question_id: string;
187
- selected_labels?: string[] | undefined;
188
- free_text?: string | null | undefined;
189
- }>, "many">>;
190
- why: z.ZodDefault<z.ZodString>;
191
- required: z.ZodDefault<z.ZodBoolean>;
192
- }, "strip", z.ZodTypeAny, {
193
- interaction_id: string;
194
- answers: {
195
- question_id: string;
196
- selected_labels: string[];
197
- free_text: string | null;
198
- }[];
199
- tool: "answer_question";
200
- required: boolean;
201
- why: string;
202
- }, {
203
- interaction_id: string;
204
- tool: "answer_question";
205
- answers?: {
206
- question_id: string;
207
- selected_labels?: string[] | undefined;
208
- free_text?: string | null | undefined;
209
- }[] | undefined;
210
- required?: boolean | undefined;
211
- why?: string | undefined;
212
- }>, z.ZodObject<{
213
- tool: z.ZodLiteral<"apply">;
214
- run_id: z.ZodString;
215
- mode: z.ZodDefault<z.ZodEnum<["apply", "branch", "commit", "pr"]>>;
216
- why: z.ZodDefault<z.ZodString>;
217
- required: z.ZodDefault<z.ZodBoolean>;
218
- }, "strip", z.ZodTypeAny, {
219
- mode: "apply" | "commit" | "branch" | "pr";
220
- tool: "apply";
221
- run_id: string;
222
- required: boolean;
223
- why: string;
224
- }, {
225
- tool: "apply";
226
- run_id: string;
227
- mode?: "apply" | "commit" | "branch" | "pr" | undefined;
228
- required?: boolean | undefined;
229
- why?: string | undefined;
230
- }>]>;
231
- export type OrchestratePlanCall = z.infer<typeof OrchestratePlanCall>;
232
- /**
233
- * The TYPED orchestration plan extracted from the planner's report (the fenced
234
- * JSON block the orchestrate prompt requires). Persisted as
235
- * `final/orchestration.yaml`; a missing/invalid block is disclosed in the
236
- * summary, never silently dropped.
237
- */
238
- export declare const OrchestratePlan: z.ZodObject<{
239
- tool_calls: z.ZodArray<z.ZodDiscriminatedUnion<"tool", [z.ZodObject<{
240
- tool: z.ZodLiteral<"start_run">;
241
- prompt: z.ZodString;
242
- mode: z.ZodDefault<z.ZodEnum<["ask", "plan", "audit", "agent", "orchestrate"]>>;
243
- harness: z.ZodOptional<z.ZodString>;
244
- why: z.ZodDefault<z.ZodString>;
245
- required: z.ZodDefault<z.ZodBoolean>;
246
- }, "strip", z.ZodTypeAny, {
247
- mode: "ask" | "plan" | "audit" | "agent" | "orchestrate";
248
- prompt: string;
249
- tool: "start_run";
250
- required: boolean;
251
- why: string;
252
- harness?: string | undefined;
253
- }, {
254
- prompt: string;
255
- tool: "start_run";
256
- harness?: string | undefined;
257
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
258
- required?: boolean | undefined;
259
- why?: string | undefined;
260
- }>, z.ZodObject<{
261
- tool: z.ZodLiteral<"race">;
262
- prompt: z.ZodString;
263
- n: z.ZodDefault<z.ZodNumber>;
264
- why: z.ZodDefault<z.ZodString>;
265
- required: z.ZodDefault<z.ZodBoolean>;
266
- }, "strip", z.ZodTypeAny, {
267
- prompt: string;
268
- tool: "race";
269
- required: boolean;
270
- why: string;
271
- n: number;
272
- }, {
273
- prompt: string;
274
- tool: "race";
275
- required?: boolean | undefined;
276
- why?: string | undefined;
277
- n?: number | undefined;
278
- }>, z.ZodObject<{
279
- tool: z.ZodLiteral<"review">;
280
- run_id: z.ZodString;
281
- why: z.ZodDefault<z.ZodString>;
282
- required: z.ZodDefault<z.ZodBoolean>;
283
- }, "strip", z.ZodTypeAny, {
284
- tool: "review";
285
- run_id: string;
286
- required: boolean;
287
- why: string;
288
- }, {
289
- tool: "review";
290
- run_id: string;
291
- required?: boolean | undefined;
292
- why?: string | undefined;
293
- }>, z.ZodObject<{
294
- tool: z.ZodLiteral<"status">;
295
- run_id: z.ZodString;
296
- why: z.ZodDefault<z.ZodString>;
297
- required: z.ZodDefault<z.ZodBoolean>;
298
- }, "strip", z.ZodTypeAny, {
299
- tool: "status";
300
- run_id: string;
301
- required: boolean;
302
- why: string;
303
- }, {
304
- tool: "status";
305
- run_id: string;
306
- required?: boolean | undefined;
307
- why?: string | undefined;
308
- }>, z.ZodObject<{
309
- tool: z.ZodLiteral<"answer_question">;
310
- interaction_id: z.ZodString;
311
- answers: z.ZodDefault<z.ZodArray<z.ZodObject<{
312
- question_id: z.ZodString;
313
- selected_labels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
314
- free_text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
315
- }, "strip", z.ZodTypeAny, {
316
- question_id: string;
317
- selected_labels: string[];
318
- free_text: string | null;
319
- }, {
320
- question_id: string;
321
- selected_labels?: string[] | undefined;
322
- free_text?: string | null | undefined;
323
- }>, "many">>;
324
- why: z.ZodDefault<z.ZodString>;
325
- required: z.ZodDefault<z.ZodBoolean>;
326
- }, "strip", z.ZodTypeAny, {
327
- interaction_id: string;
328
- answers: {
329
- question_id: string;
330
- selected_labels: string[];
331
- free_text: string | null;
332
- }[];
333
- tool: "answer_question";
334
- required: boolean;
335
- why: string;
336
- }, {
337
- interaction_id: string;
338
- tool: "answer_question";
339
- answers?: {
340
- question_id: string;
341
- selected_labels?: string[] | undefined;
342
- free_text?: string | null | undefined;
343
- }[] | undefined;
344
- required?: boolean | undefined;
345
- why?: string | undefined;
346
- }>, z.ZodObject<{
347
- tool: z.ZodLiteral<"apply">;
348
- run_id: z.ZodString;
349
- mode: z.ZodDefault<z.ZodEnum<["apply", "branch", "commit", "pr"]>>;
350
- why: z.ZodDefault<z.ZodString>;
351
- required: z.ZodDefault<z.ZodBoolean>;
352
- }, "strip", z.ZodTypeAny, {
353
- mode: "apply" | "commit" | "branch" | "pr";
354
- tool: "apply";
355
- run_id: string;
356
- required: boolean;
357
- why: string;
358
- }, {
359
- tool: "apply";
360
- run_id: string;
361
- mode?: "apply" | "commit" | "branch" | "pr" | undefined;
362
- required?: boolean | undefined;
363
- why?: string | undefined;
364
- }>]>, "many">;
365
- }, "strip", z.ZodTypeAny, {
366
- tool_calls: ({
367
- mode: "ask" | "plan" | "audit" | "agent" | "orchestrate";
368
- prompt: string;
369
- tool: "start_run";
370
- required: boolean;
371
- why: string;
372
- harness?: string | undefined;
373
- } | {
374
- prompt: string;
375
- tool: "race";
376
- required: boolean;
377
- why: string;
378
- n: number;
379
- } | {
380
- tool: "review";
381
- run_id: string;
382
- required: boolean;
383
- why: string;
384
- } | {
385
- tool: "status";
386
- run_id: string;
387
- required: boolean;
388
- why: string;
389
- } | {
390
- interaction_id: string;
391
- answers: {
392
- question_id: string;
393
- selected_labels: string[];
394
- free_text: string | null;
395
- }[];
396
- tool: "answer_question";
397
- required: boolean;
398
- why: string;
399
- } | {
400
- mode: "apply" | "commit" | "branch" | "pr";
401
- tool: "apply";
402
- run_id: string;
403
- required: boolean;
404
- why: string;
405
- })[];
406
- }, {
407
- tool_calls: ({
408
- prompt: string;
409
- tool: "start_run";
410
- harness?: string | undefined;
411
- mode?: "ask" | "plan" | "audit" | "agent" | "orchestrate" | undefined;
412
- required?: boolean | undefined;
413
- why?: string | undefined;
414
- } | {
415
- prompt: string;
416
- tool: "race";
417
- required?: boolean | undefined;
418
- why?: string | undefined;
419
- n?: number | undefined;
420
- } | {
421
- tool: "review";
422
- run_id: string;
423
- required?: boolean | undefined;
424
- why?: string | undefined;
425
- } | {
426
- tool: "status";
427
- run_id: string;
428
- required?: boolean | undefined;
429
- why?: string | undefined;
430
- } | {
431
- interaction_id: string;
432
- tool: "answer_question";
433
- answers?: {
434
- question_id: string;
435
- selected_labels?: string[] | undefined;
436
- free_text?: string | null | undefined;
437
- }[] | undefined;
438
- required?: boolean | undefined;
439
- why?: string | undefined;
440
- } | {
441
- tool: "apply";
442
- run_id: string;
443
- mode?: "apply" | "commit" | "branch" | "pr" | undefined;
444
- required?: boolean | undefined;
445
- why?: string | undefined;
446
- })[];
447
- }>;
448
- export type OrchestratePlan = z.infer<typeof OrchestratePlan>;
449
- /** Per-step executor status (auto_safe/auto_full). */
450
- export declare const OrchestrateStepStatus: z.ZodEnum<["pending", "running", "done", "skipped", "blocked", "failed"]>;
451
- export type OrchestrateStepStatus = z.infer<typeof OrchestrateStepStatus>;
452
- export declare const OrchestrateTerminalSource: z.ZodEnum<["executor", "subrun", "review", "delivery", "policy", "budget"]>;
453
- export type OrchestrateTerminalSource = z.infer<typeof OrchestrateTerminalSource>;
454
- /**
455
- * Typed executor progress over a plan's tool_calls. Persisted as
456
- * `final/orchestration_progress.yaml` and projected into the run detail so a
457
- * surface renders honest per-step outcomes (which safe steps ran, where a risky
458
- * step blocked, why it stopped). Producer: the orchestrator executor; consumer:
459
- * the control-api run-detail projection.
460
- */
461
- export declare const OrchestratePlanProgress: z.ZodObject<{
462
- steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
463
- index: z.ZodNumber;
464
- tool: z.ZodEnum<["start_run", "race", "status", "answer_question", "apply", "review"]>;
465
- risk: z.ZodEnum<["safe", "risky"]>;
466
- status: z.ZodEnum<["pending", "running", "done", "skipped", "blocked", "failed"]>;
467
- required: z.ZodDefault<z.ZodBoolean>;
468
- terminal_status: z.ZodDefault<z.ZodNullable<z.ZodEnum<["success", "no_op", "ungated", "review_not_run", "blocked", "failed", "interrupted_unknown", "cost_unverifiable", "exhausted_overshoot", "exhausted", "not_converged", "stuck_no_progress", "cancelled"]>>>;
469
- terminal_source: z.ZodDefault<z.ZodNullable<z.ZodEnum<["executor", "subrun", "review", "delivery", "policy", "budget"]>>>;
470
- evidence_refs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
471
- /** Sub-run id this step started/targeted (start_run/race/review/status/apply), when known. */
472
- run_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
473
- detail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
474
- }, "strip", z.ZodTypeAny, {
475
- status: "pending" | "failed" | "running" | "blocked" | "done" | "skipped";
476
- detail: string | null;
477
- index: number;
478
- evidence_refs: string[];
479
- tool: "status" | "review" | "apply" | "start_run" | "race" | "answer_question";
480
- run_id: string | null;
481
- required: boolean;
482
- risk: "safe" | "risky";
483
- terminal_status: "failed" | "cancelled" | "interrupted_unknown" | "success" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | null;
484
- terminal_source: "review" | "delivery" | "policy" | "budget" | "executor" | "subrun" | null;
485
- }, {
486
- status: "pending" | "failed" | "running" | "blocked" | "done" | "skipped";
487
- index: number;
488
- tool: "status" | "review" | "apply" | "start_run" | "race" | "answer_question";
489
- risk: "safe" | "risky";
490
- detail?: string | null | undefined;
491
- evidence_refs?: string[] | undefined;
492
- run_id?: string | null | undefined;
493
- required?: boolean | undefined;
494
- terminal_status?: "failed" | "cancelled" | "interrupted_unknown" | "success" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | null | undefined;
495
- terminal_source?: "review" | "delivery" | "policy" | "budget" | "executor" | "subrun" | null | undefined;
496
- }>, "many">>;
497
- autonomy: z.ZodEnum<["suggest", "auto_safe", "auto_full"]>;
498
- /** Set when the executor stopped early (first risky step under auto_safe, budget, abort). */
499
- stopped_reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
500
- }, "strip", z.ZodTypeAny, {
501
- autonomy: "suggest" | "auto_safe" | "auto_full";
502
- steps: {
503
- status: "pending" | "failed" | "running" | "blocked" | "done" | "skipped";
504
- detail: string | null;
505
- index: number;
506
- evidence_refs: string[];
507
- tool: "status" | "review" | "apply" | "start_run" | "race" | "answer_question";
508
- run_id: string | null;
509
- required: boolean;
510
- risk: "safe" | "risky";
511
- terminal_status: "failed" | "cancelled" | "interrupted_unknown" | "success" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | null;
512
- terminal_source: "review" | "delivery" | "policy" | "budget" | "executor" | "subrun" | null;
513
- }[];
514
- stopped_reason: string | null;
515
- }, {
516
- autonomy: "suggest" | "auto_safe" | "auto_full";
517
- steps?: {
518
- status: "pending" | "failed" | "running" | "blocked" | "done" | "skipped";
519
- index: number;
520
- tool: "status" | "review" | "apply" | "start_run" | "race" | "answer_question";
521
- risk: "safe" | "risky";
522
- detail?: string | null | undefined;
523
- evidence_refs?: string[] | undefined;
524
- run_id?: string | null | undefined;
525
- required?: boolean | undefined;
526
- terminal_status?: "failed" | "cancelled" | "interrupted_unknown" | "success" | "no_op" | "ungated" | "review_not_run" | "blocked" | "cost_unverifiable" | "exhausted_overshoot" | "exhausted" | "not_converged" | "stuck_no_progress" | null | undefined;
527
- terminal_source?: "review" | "delivery" | "policy" | "budget" | "executor" | "subrun" | null | undefined;
528
- }[] | undefined;
529
- stopped_reason?: string | null | undefined;
530
- }>;
531
- export type OrchestratePlanProgress = z.infer<typeof OrchestratePlanProgress>;
532
- export declare function orchestratePlanJsonSchema(): Record<string, unknown>;
533
- /** A caller-supplied output schema the structured-output routes cannot carry. */
534
- export declare class UnsupportedOutputSchemaError extends Error {
535
- }
536
- /**
537
- * Validate a CALLER-supplied per-run output schema and return it UNCHANGED —
538
- * it stays the CONFORMANCE AUTHORITY (the engine validates the final answer
539
- * against exactly what the caller asked for). The vendor transport separately
540
- * strictifies via `strictifyOutputSchema`; NEVER validate the answer against
541
- * the strictified form — strictify turns an optional string into a required
542
- * `string|null`, so `{"field":null}` would falsely pass a schema that forbids it.
543
- *
544
- * Refuses — typed, at the boundary — the shapes the native routes are
545
- * LIVE-VERIFIED to reject rather than let a vendor 400 surface mid-run: the
546
- * root must be an inline `type: "object"` (claude materializes --json-schema as
547
- * a StructuredOutput tool whose input_schema needs a top-level type; a
548
- * $ref-wrapped root 400s), `$ref` is refused anywhere, and `format` is refused
549
- * while the pinned claude (<2.1.205) silently drops a format-bearing schema.
550
- */
551
- export declare function normalizeUserOutputSchema(schema: Record<string, unknown>): Record<string, unknown>;
552
- /** Vendor-strict transport form of a validated output schema (all keys
553
- * required, additionalProperties:false, optionals nullable). Used ONLY to
554
- * constrain the harness — NEVER to judge conformance (see normalizeUserOutputSchema). */
555
- export declare function strictifyOutputSchema(schema: Record<string, unknown>): Record<string, unknown>;
556
- //# sourceMappingURL=orchestrate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestrate.d.ts","sourceRoot":"","sources":["../src/orchestrate.ts"],"names":[],"mappings":"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"}