@claudexor/orchestrator 5.0.1 → 5.1.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 (251) hide show
  1. package/dist/account-evidence.d.ts +7 -0
  2. package/dist/account-evidence.d.ts.map +1 -1
  3. package/dist/account-evidence.js +12 -0
  4. package/dist/account-evidence.js.map +1 -1
  5. package/dist/account-pool.d.ts +4 -0
  6. package/dist/account-pool.d.ts.map +1 -1
  7. package/dist/account-pool.js +8 -1
  8. package/dist/account-pool.js.map +1 -1
  9. package/dist/account-resolution.d.ts.map +1 -1
  10. package/dist/account-resolution.js +7 -5
  11. package/dist/account-resolution.js.map +1 -1
  12. package/dist/attemptFinalize.d.ts +22 -7
  13. package/dist/attemptFinalize.d.ts.map +1 -1
  14. package/dist/attemptFinalize.js +29 -7
  15. package/dist/attemptFinalize.js.map +1 -1
  16. package/dist/attemptTelemetry.d.ts +19 -18
  17. package/dist/attemptTelemetry.d.ts.map +1 -1
  18. package/dist/attemptTelemetry.js +32 -79
  19. package/dist/attemptTelemetry.js.map +1 -1
  20. package/dist/attemptUsage.d.ts.map +1 -1
  21. package/dist/attemptUsage.js +6 -14
  22. package/dist/attemptUsage.js.map +1 -1
  23. package/dist/attemptUsageCost.d.ts +11 -2
  24. package/dist/attemptUsageCost.d.ts.map +1 -1
  25. package/dist/attemptUsageCost.js +16 -3
  26. package/dist/attemptUsageCost.js.map +1 -1
  27. package/dist/candidateEvidence.d.ts +42 -8
  28. package/dist/candidateEvidence.d.ts.map +1 -1
  29. package/dist/candidateEvidence.js +75 -16
  30. package/dist/candidateEvidence.js.map +1 -1
  31. package/dist/candidateReview.d.ts.map +1 -1
  32. package/dist/candidateReview.js +4 -2
  33. package/dist/candidateReview.js.map +1 -1
  34. package/dist/candidateTerminals.d.ts +10 -0
  35. package/dist/candidateTerminals.d.ts.map +1 -1
  36. package/dist/candidateTerminals.js +55 -11
  37. package/dist/candidateTerminals.js.map +1 -1
  38. package/dist/captureRefusal.d.ts +14 -4
  39. package/dist/captureRefusal.d.ts.map +1 -1
  40. package/dist/captureRefusal.js +64 -27
  41. package/dist/captureRefusal.js.map +1 -1
  42. package/dist/carrier-planner.d.ts +5 -2
  43. package/dist/carrier-planner.d.ts.map +1 -1
  44. package/dist/carrier-planner.js +6 -3
  45. package/dist/carrier-planner.js.map +1 -1
  46. package/dist/command-telemetry.d.ts +15 -0
  47. package/dist/command-telemetry.d.ts.map +1 -0
  48. package/dist/command-telemetry.js +27 -0
  49. package/dist/command-telemetry.js.map +1 -0
  50. package/dist/continuation-custody.d.ts.map +1 -1
  51. package/dist/continuation-custody.js +3 -1
  52. package/dist/continuation-custody.js.map +1 -1
  53. package/dist/continuation-evidence-io.d.ts +13 -3
  54. package/dist/continuation-evidence-io.d.ts.map +1 -1
  55. package/dist/continuation-evidence-io.js +36 -4
  56. package/dist/continuation-evidence-io.js.map +1 -1
  57. package/dist/continuation-evidence.d.ts +13 -2
  58. package/dist/continuation-evidence.d.ts.map +1 -1
  59. package/dist/continuation-evidence.js +23 -4
  60. package/dist/continuation-evidence.js.map +1 -1
  61. package/dist/continuation-later.d.ts.map +1 -1
  62. package/dist/continuation-later.js +6 -6
  63. package/dist/continuation-later.js.map +1 -1
  64. package/dist/continuity-facts.d.ts +25 -1
  65. package/dist/continuity-facts.d.ts.map +1 -1
  66. package/dist/continuity-facts.js +71 -4
  67. package/dist/continuity-facts.js.map +1 -1
  68. package/dist/continuity-notice.d.ts.map +1 -1
  69. package/dist/continuity-notice.js +2 -1
  70. package/dist/continuity-notice.js.map +1 -1
  71. package/dist/continuity-summary.d.ts +4 -1
  72. package/dist/continuity-summary.d.ts.map +1 -1
  73. package/dist/continuity-summary.js +30 -12
  74. package/dist/continuity-summary.js.map +1 -1
  75. package/dist/continuity.d.ts +36 -8
  76. package/dist/continuity.d.ts.map +1 -1
  77. package/dist/continuity.js +96 -21
  78. package/dist/continuity.js.map +1 -1
  79. package/dist/credential-cooldown.d.ts +7 -0
  80. package/dist/credential-cooldown.d.ts.map +1 -1
  81. package/dist/credential-cooldown.js +31 -5
  82. package/dist/credential-cooldown.js.map +1 -1
  83. package/dist/credential-differential.d.ts +15 -1
  84. package/dist/credential-differential.d.ts.map +1 -1
  85. package/dist/credential-differential.js +32 -17
  86. package/dist/credential-differential.js.map +1 -1
  87. package/dist/credential-execution.d.ts.map +1 -1
  88. package/dist/credential-execution.js +14 -15
  89. package/dist/credential-execution.js.map +1 -1
  90. package/dist/credential-preflight.js +1 -1
  91. package/dist/credential-preflight.js.map +1 -1
  92. package/dist/credential-profile-rotation.d.ts +1 -0
  93. package/dist/credential-profile-rotation.d.ts.map +1 -1
  94. package/dist/credential-profile-rotation.js +1 -1
  95. package/dist/credential-profile-rotation.js.map +1 -1
  96. package/dist/deepScanReducer.d.ts.map +1 -1
  97. package/dist/deepScanReducer.js +8 -18
  98. package/dist/deepScanReducer.js.map +1 -1
  99. package/dist/delegatedHome.d.ts +6 -4
  100. package/dist/delegatedHome.d.ts.map +1 -1
  101. package/dist/delegatedHome.js.map +1 -1
  102. package/dist/delegationFailure.d.ts +75 -14
  103. package/dist/delegationFailure.d.ts.map +1 -1
  104. package/dist/delegationFailure.js +38 -9
  105. package/dist/delegationFailure.js.map +1 -1
  106. package/dist/directoryCandidate.d.ts +10 -0
  107. package/dist/directoryCandidate.d.ts.map +1 -1
  108. package/dist/directoryCandidate.js +59 -9
  109. package/dist/directoryCandidate.js.map +1 -1
  110. package/dist/harnessFailure.d.ts +6 -5
  111. package/dist/harnessFailure.d.ts.map +1 -1
  112. package/dist/harnessFailure.js +7 -6
  113. package/dist/harnessFailure.js.map +1 -1
  114. package/dist/index.d.ts +2 -2
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +2 -1
  117. package/dist/index.js.map +1 -1
  118. package/dist/inrun-continuity-carrier.d.ts +4 -1
  119. package/dist/inrun-continuity-carrier.d.ts.map +1 -1
  120. package/dist/inrun-continuity-carrier.js +2 -0
  121. package/dist/inrun-continuity-carrier.js.map +1 -1
  122. package/dist/inrun-continuity.d.ts +2 -2
  123. package/dist/inrun-continuity.d.ts.map +1 -1
  124. package/dist/inrun-continuity.js +22 -19
  125. package/dist/inrun-continuity.js.map +1 -1
  126. package/dist/inrun-retained-output.d.ts +18 -4
  127. package/dist/inrun-retained-output.d.ts.map +1 -1
  128. package/dist/inrun-retained-output.js +39 -8
  129. package/dist/inrun-retained-output.js.map +1 -1
  130. package/dist/laneStreamEvents.d.ts +9 -10
  131. package/dist/laneStreamEvents.d.ts.map +1 -1
  132. package/dist/laneStreamEvents.js +21 -7
  133. package/dist/laneStreamEvents.js.map +1 -1
  134. package/dist/modelGovernance.d.ts +10 -4
  135. package/dist/modelGovernance.d.ts.map +1 -1
  136. package/dist/modelGovernance.js +21 -1
  137. package/dist/modelGovernance.js.map +1 -1
  138. package/dist/native-retry-telemetry.d.ts +4 -1
  139. package/dist/native-retry-telemetry.d.ts.map +1 -1
  140. package/dist/native-retry-telemetry.js +6 -1
  141. package/dist/native-retry-telemetry.js.map +1 -1
  142. package/dist/orchestrator.d.ts +10 -2
  143. package/dist/orchestrator.d.ts.map +1 -1
  144. package/dist/orchestrator.js +137 -156
  145. package/dist/orchestrator.js.map +1 -1
  146. package/dist/planRun.js +4 -4
  147. package/dist/planRun.js.map +1 -1
  148. package/dist/plannerAttempt.d.ts +1 -0
  149. package/dist/plannerAttempt.d.ts.map +1 -1
  150. package/dist/plannerAttempt.js +14 -19
  151. package/dist/plannerAttempt.js.map +1 -1
  152. package/dist/pool-attempt-evidence.d.ts +3 -1
  153. package/dist/pool-attempt-evidence.d.ts.map +1 -1
  154. package/dist/pool-attempt-evidence.js +16 -3
  155. package/dist/pool-attempt-evidence.js.map +1 -1
  156. package/dist/quota-refusal-scope.d.ts +1 -0
  157. package/dist/quota-refusal-scope.d.ts.map +1 -1
  158. package/dist/quota-refusal-scope.js +29 -1
  159. package/dist/quota-refusal-scope.js.map +1 -1
  160. package/dist/rawPatchLane.d.ts +42 -0
  161. package/dist/rawPatchLane.d.ts.map +1 -0
  162. package/dist/rawPatchLane.js +79 -0
  163. package/dist/rawPatchLane.js.map +1 -0
  164. package/dist/readonlyTerminals.d.ts +0 -3
  165. package/dist/readonlyTerminals.d.ts.map +1 -1
  166. package/dist/readonlyTerminals.js +30 -10
  167. package/dist/readonlyTerminals.js.map +1 -1
  168. package/dist/requestRequirements.d.ts +5 -4
  169. package/dist/requestRequirements.d.ts.map +1 -1
  170. package/dist/requestRequirements.js +6 -5
  171. package/dist/requestRequirements.js.map +1 -1
  172. package/dist/retainedOutput.d.ts +19 -2
  173. package/dist/retainedOutput.d.ts.map +1 -1
  174. package/dist/retainedOutput.js +83 -12
  175. package/dist/retainedOutput.js.map +1 -1
  176. package/dist/reviewerInventory.d.ts +2 -8
  177. package/dist/reviewerInventory.d.ts.map +1 -1
  178. package/dist/reviewerInventory.js +2 -3
  179. package/dist/reviewerInventory.js.map +1 -1
  180. package/dist/reviewerPanel.d.ts +1 -1
  181. package/dist/reviewerPanel.d.ts.map +1 -1
  182. package/dist/reviewerPanel.js +9 -4
  183. package/dist/reviewerPanel.js.map +1 -1
  184. package/dist/route-admission.d.ts.map +1 -1
  185. package/dist/route-admission.js +3 -1
  186. package/dist/route-admission.js.map +1 -1
  187. package/dist/routeControls.d.ts +32 -0
  188. package/dist/routeControls.d.ts.map +1 -0
  189. package/dist/routeControls.js +47 -0
  190. package/dist/routeControls.js.map +1 -0
  191. package/dist/run-input-resolution.d.ts +5 -0
  192. package/dist/run-input-resolution.d.ts.map +1 -1
  193. package/dist/run-input-resolution.js +12 -6
  194. package/dist/run-input-resolution.js.map +1 -1
  195. package/dist/run-runtime-root.d.ts +16 -0
  196. package/dist/run-runtime-root.d.ts.map +1 -0
  197. package/dist/run-runtime-root.js +16 -0
  198. package/dist/run-runtime-root.js.map +1 -0
  199. package/dist/runAdmission.d.ts.map +1 -1
  200. package/dist/runAdmission.js +2 -1
  201. package/dist/runAdmission.js.map +1 -1
  202. package/dist/runEventLog.d.ts +2 -1
  203. package/dist/runEventLog.d.ts.map +1 -1
  204. package/dist/runEventLog.js +3 -1
  205. package/dist/runEventLog.js.map +1 -1
  206. package/dist/runFacts.d.ts +5 -2
  207. package/dist/runFacts.d.ts.map +1 -1
  208. package/dist/runFacts.js +11 -11
  209. package/dist/runFacts.js.map +1 -1
  210. package/dist/runScope.d.ts +2 -0
  211. package/dist/runScope.d.ts.map +1 -1
  212. package/dist/runScope.js +3 -2
  213. package/dist/runScope.js.map +1 -1
  214. package/dist/runSupport.d.ts +3 -1
  215. package/dist/runSupport.d.ts.map +1 -1
  216. package/dist/runSupport.js +3 -1
  217. package/dist/runSupport.js.map +1 -1
  218. package/dist/runTelemetryWriter.d.ts +18 -5
  219. package/dist/runTelemetryWriter.d.ts.map +1 -1
  220. package/dist/runTelemetryWriter.js +7 -2
  221. package/dist/runTelemetryWriter.js.map +1 -1
  222. package/dist/runTerminalResults.d.ts.map +1 -1
  223. package/dist/runTerminalResults.js +22 -7
  224. package/dist/runTerminalResults.js.map +1 -1
  225. package/dist/runTerminals.d.ts.map +1 -1
  226. package/dist/runTerminals.js +19 -8
  227. package/dist/runTerminals.js.map +1 -1
  228. package/dist/secretDiff.d.ts.map +1 -1
  229. package/dist/secretDiff.js +2 -1
  230. package/dist/secretDiff.js.map +1 -1
  231. package/dist/transientClassify.d.ts +17 -9
  232. package/dist/transientClassify.d.ts.map +1 -1
  233. package/dist/transientClassify.js +33 -9
  234. package/dist/transientClassify.js.map +1 -1
  235. package/dist/webEvidence.d.ts +41 -0
  236. package/dist/webEvidence.d.ts.map +1 -0
  237. package/dist/webEvidence.js +99 -0
  238. package/dist/webEvidence.js.map +1 -0
  239. package/dist/workReportEnvelope.d.ts +12 -0
  240. package/dist/workReportEnvelope.d.ts.map +1 -1
  241. package/dist/workReportEnvelope.js +19 -0
  242. package/dist/workReportEnvelope.js.map +1 -1
  243. package/package.json +17 -17
  244. package/dist/continuation-chain.test-support.d.ts +0 -473
  245. package/dist/continuation-chain.test-support.d.ts.map +0 -1
  246. package/dist/continuation-chain.test-support.js +0 -206
  247. package/dist/continuation-chain.test-support.js.map +0 -1
  248. package/dist/inrun-continuity.test-support.d.ts +0 -504
  249. package/dist/inrun-continuity.test-support.d.ts.map +0 -1
  250. package/dist/inrun-continuity.test-support.js +0 -212
  251. package/dist/inrun-continuity.test-support.js.map +0 -1
@@ -1,473 +0,0 @@
1
- import type { HarnessAdapter, HarnessContinuityCapability } from "@claudexor/core";
2
- import { type HarnessEvent, type HarnessRunSpec, type RunEvent } from "@claudexor/schema";
3
- import { type OrchestratorResult, type RunInput } from "./orchestrator.js";
4
- import type { RunContinuation } from "./continuation-custody.js";
5
- export declare const WORK_ORDER = "WORK-ORDER-7f3a: build the dashboard";
6
- export interface ChainSpawn {
7
- label: string;
8
- nth: number;
9
- profile: string;
10
- resume: string | null;
11
- prompt: string;
12
- model: string | null;
13
- cwd: string;
14
- }
15
- export type Emit = (ev: Partial<HarnessEvent>) => HarnessEvent;
16
- export type ChainScript = (ctx: ChainSpawn & {
17
- spec: HarnessRunSpec;
18
- emit: Emit;
19
- seed: (sid: string) => void;
20
- }) => Generator<HarnessEvent>;
21
- export interface ChainFixture {
22
- root: string;
23
- stores: Record<string, string>;
24
- spawns: ChainSpawn[];
25
- adapter: HarnessAdapter;
26
- label: {
27
- current: string;
28
- };
29
- }
30
- /** A movable fake store: sessions live under `<locator>/sessions/<sid>.jsonl`. */
31
- export declare function movableStore(retire?: (file: string) => void): HarnessContinuityCapability;
32
- export declare function chainFixture(opts: {
33
- profiles: string[];
34
- maxRetries?: number;
35
- fallbackModel?: string;
36
- continuity?: HarnessContinuityCapability;
37
- }, script: ChainScript): ChainFixture;
38
- export interface ChainRun {
39
- result: OrchestratorResult;
40
- events: RunEvent[];
41
- receipts: Record<string, unknown>[];
42
- resumable: Record<string, unknown> | undefined;
43
- }
44
- export declare function runLabelled(f: ChainFixture, label: string, input: Partial<RunInput>): Promise<ChainRun>;
45
- /** The facts the daemon resolves for a successor of `pred` (its own ancestors first). */
46
- export declare function continuing(pred: ChainRun, workOrder: string, ancestors?: ChainRun[], over?: Partial<NonNullable<RunContinuation["from"]>>): RunContinuation;
47
- export declare const limitStop: (emit: Emit) => {
48
- account_usage?: {
49
- code: string;
50
- detail: string | null;
51
- }[] | undefined;
52
- quota?: {
53
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_image_response" | "codex_rollout" | "cursor_rate_limit" | "grok_rate_limit";
54
- plan_label: string | null;
55
- subject_id: string | null;
56
- constraints: {
57
- id: string;
58
- label: string;
59
- applies_to_models?: string[] | null | undefined;
60
- applies_to_model_prefixes?: string[] | undefined;
61
- applies_to_unspecified_model?: boolean | undefined;
62
- applies_to_request_kinds?: ("image" | "text")[] | undefined;
63
- used_ratio: number | null;
64
- window_seconds: number | null;
65
- resets_at: string | null;
66
- cooldown_until: string | null;
67
- }[];
68
- } | undefined;
69
- observed_model?: string | undefined;
70
- observed_model_catalog_match?: {
71
- label: string;
72
- id: string;
73
- source: "account_catalog";
74
- profile_id: string | null;
75
- } | undefined;
76
- speech?: {
77
- key: string;
78
- op: "abandoned" | "complete" | "fragment";
79
- } | undefined;
80
- request_refusal?: {
81
- scope: "turn_text";
82
- unit: "unicode_scalars";
83
- source: string;
84
- kind: "input_too_large";
85
- limit: number | null;
86
- actual: number | null;
87
- native_code: string;
88
- } | {
89
- kind: "vendor_cli_too_old";
90
- native_code: "claude_code_version_too_old";
91
- source: "claude_stdout";
92
- binary_path: string | null;
93
- installed_version: string | null;
94
- } | {
95
- kind: "credential_source_unconfirmed";
96
- native_code: "grok_credential_source_unconfirmed";
97
- source: "grok_init";
98
- reported_source: string;
99
- } | undefined;
100
- effort_resolution?: {
101
- requested: string | null;
102
- submitted: string | null;
103
- resolution: "downward" | "exact" | "floor" | "omitted" | "rejected" | "unverifiable";
104
- source: "account_catalog" | "adapter" | "live_probe" | "versioned_snapshot";
105
- parameter: string | null;
106
- observed: string | null;
107
- observedSource: string | null;
108
- reason?: string | undefined;
109
- } | undefined;
110
- processing?: {
111
- requested: "economy" | "fast" | "standard" | null;
112
- submitted: "economy" | "fast" | "standard" | null;
113
- submittedNative: string | null;
114
- observed: "economy" | "fast" | "mixed" | "standard" | "unknown";
115
- observedNative: string[];
116
- reason: string | null;
117
- source: string;
118
- } | undefined;
119
- processing_cost_basis?: {
120
- nativeMode: string | null;
121
- kind: "cash" | "included" | "paid_credits" | "unknown" | "valuation";
122
- source: string;
123
- debit?: "unobserved" | undefined;
124
- } | undefined;
125
- prompt_cache_ttl?: {
126
- requested: "1h" | "5m" | null;
127
- submitted: "1h" | "5m" | null;
128
- reason: string | null;
129
- observed: "1h" | "5m" | "mixed" | "none" | "unknown";
130
- write_5m_tokens: number | null;
131
- write_1h_tokens: number | null;
132
- } | undefined;
133
- type: "completed" | "context" | "error" | "file_change" | "interaction_requested" | "message" | "patch_produced" | "started" | "status" | "thinking" | "tool_call" | "tool_result" | "usage";
134
- session_id: string;
135
- ts: string;
136
- text?: string | undefined;
137
- final?: boolean | undefined;
138
- tool?: {
139
- name: string;
140
- kind: "command" | "file" | "mcp" | "other" | "search" | "web";
141
- use_id?: string | undefined;
142
- target?: string | undefined;
143
- status?: "cancelled" | "denied" | "error" | "ok" | undefined;
144
- phase?: "completed" | "started" | undefined;
145
- error_summary?: string | undefined;
146
- content_summary?: string | undefined;
147
- exit_code?: number | undefined;
148
- command_outcome?: {
149
- state: "backgrounded" | "exited" | "timed_out" | "unknown";
150
- signal?: string | undefined;
151
- timeout_ms?: number | undefined;
152
- background_reason?: "requested" | "timeout" | undefined;
153
- shell_id?: string | undefined;
154
- pid?: number | undefined;
155
- } | undefined;
156
- web_retrieval?: "dispatched" | "failed" | "verified" | undefined;
157
- } | undefined;
158
- interaction?: {
159
- interaction_id: string;
160
- questions: {
161
- id: string;
162
- question: string;
163
- header: string | null;
164
- options: {
165
- label: string;
166
- description: string | null;
167
- }[];
168
- multi_select: boolean;
169
- }[];
170
- source_tool: string | null;
171
- } | undefined;
172
- patch_envelope?: {
173
- schema_version: 1;
174
- context_packet_hash: string;
175
- base_tree_sha: string;
176
- patch: string;
177
- patch_hash: string;
178
- touched_paths: {
179
- path: string;
180
- expected_blob_oid: string | null;
181
- }[];
182
- } | undefined;
183
- refusal_code?: "raw_context_exceeds_window" | "raw_patch_apply_failed" | "raw_patch_base_mismatch" | "raw_patch_binary_unsupported" | "raw_patch_digest_mismatch" | "raw_patch_missing_evidence" | "raw_patch_outside_scope" | "raw_patch_path_traversal" | "raw_patch_requires_isolation" | "raw_patch_stale_preimage" | "raw_patch_truncated" | undefined;
184
- raw_context?: {
185
- model: string;
186
- estimated_request_tokens: number;
187
- budget: {
188
- estimator: "chars_div_4";
189
- basis: "assumed_ceiling" | "model_context_window";
190
- model: string | null;
191
- context_window: number | null;
192
- output_allowance_tokens: number | null;
193
- framing_tokens: number | null;
194
- selection_limit_tokens: number;
195
- estimated_packet_tokens: number;
196
- omitted_for_budget: number;
197
- mandatory_paths: string[];
198
- };
199
- } | undefined;
200
- permission_denial?: {
201
- permission: string;
202
- source: string;
203
- } | undefined;
204
- usage?: {
205
- input_tokens?: number | undefined;
206
- output_tokens?: number | undefined;
207
- cached_input_tokens?: number | undefined;
208
- input_token_usage?: {
209
- total_tokens: number | null;
210
- cache_read_tokens: number | null;
211
- cache_write_tokens: number | null;
212
- } | undefined;
213
- cost_usd?: number | undefined;
214
- cost_basis?: {
215
- kind: "cash" | "unknown" | "valuation";
216
- source: string;
217
- } | undefined;
218
- estimated?: boolean | undefined;
219
- } | undefined;
220
- credential_route?: "local" | "managed_api_key" | "vendor_native" | undefined;
221
- credential_source?: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file" | undefined;
222
- credential_profile_id?: string | undefined;
223
- plan_progress?: {
224
- items: {
225
- id: string;
226
- title: string;
227
- status: "completed" | "in_progress" | "pending";
228
- }[];
229
- } | undefined;
230
- rate_limit?: {
231
- constraint_id?: string | undefined;
232
- applies_to_request_kinds?: ("image" | "text")[] | undefined;
233
- applies_to_models?: string[] | null | undefined;
234
- applies_to_model_prefixes?: string[] | undefined;
235
- resets_at: string | null;
236
- retry_delay_ms: number | null;
237
- } | undefined;
238
- status?: {
239
- kind: "api_retry";
240
- attempt?: number | undefined;
241
- max_retries?: number | undefined;
242
- retry_delay_ms?: number | undefined;
243
- error_category?: "authentication_failed" | "billing_error" | "invalid_request" | "max_output_tokens" | "model_not_found" | "oauth_org_not_allowed" | "overloaded" | "rate_limit" | "server_error" | "timeout" | "unknown" | undefined;
244
- } | undefined;
245
- transient?: {
246
- kind: "network" | "service_unavailable" | "stream_disconnect" | "timeout" | "unknown";
247
- retry_delay_ms: number | null;
248
- } | undefined;
249
- context?: {
250
- kind: "capacity_exhausted" | "compaction_completed" | "compaction_started";
251
- cause: "blocking_limit" | "prompt_too_long" | "repeated_refill" | "unknown" | "window_exceeded";
252
- native_code: string | null;
253
- trigger: "auto" | "manual" | null;
254
- pre_tokens: number | null;
255
- } | undefined;
256
- error?: string | undefined;
257
- aborted?: boolean | undefined;
258
- payload?: Record<string, unknown> | undefined;
259
- }[];
260
- export declare const crash: (emit: Emit) => {
261
- account_usage?: {
262
- code: string;
263
- detail: string | null;
264
- }[] | undefined;
265
- quota?: {
266
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_image_response" | "codex_rollout" | "cursor_rate_limit" | "grok_rate_limit";
267
- plan_label: string | null;
268
- subject_id: string | null;
269
- constraints: {
270
- id: string;
271
- label: string;
272
- applies_to_models?: string[] | null | undefined;
273
- applies_to_model_prefixes?: string[] | undefined;
274
- applies_to_unspecified_model?: boolean | undefined;
275
- applies_to_request_kinds?: ("image" | "text")[] | undefined;
276
- used_ratio: number | null;
277
- window_seconds: number | null;
278
- resets_at: string | null;
279
- cooldown_until: string | null;
280
- }[];
281
- } | undefined;
282
- observed_model?: string | undefined;
283
- observed_model_catalog_match?: {
284
- label: string;
285
- id: string;
286
- source: "account_catalog";
287
- profile_id: string | null;
288
- } | undefined;
289
- speech?: {
290
- key: string;
291
- op: "abandoned" | "complete" | "fragment";
292
- } | undefined;
293
- request_refusal?: {
294
- scope: "turn_text";
295
- unit: "unicode_scalars";
296
- source: string;
297
- kind: "input_too_large";
298
- limit: number | null;
299
- actual: number | null;
300
- native_code: string;
301
- } | {
302
- kind: "vendor_cli_too_old";
303
- native_code: "claude_code_version_too_old";
304
- source: "claude_stdout";
305
- binary_path: string | null;
306
- installed_version: string | null;
307
- } | {
308
- kind: "credential_source_unconfirmed";
309
- native_code: "grok_credential_source_unconfirmed";
310
- source: "grok_init";
311
- reported_source: string;
312
- } | undefined;
313
- effort_resolution?: {
314
- requested: string | null;
315
- submitted: string | null;
316
- resolution: "downward" | "exact" | "floor" | "omitted" | "rejected" | "unverifiable";
317
- source: "account_catalog" | "adapter" | "live_probe" | "versioned_snapshot";
318
- parameter: string | null;
319
- observed: string | null;
320
- observedSource: string | null;
321
- reason?: string | undefined;
322
- } | undefined;
323
- processing?: {
324
- requested: "economy" | "fast" | "standard" | null;
325
- submitted: "economy" | "fast" | "standard" | null;
326
- submittedNative: string | null;
327
- observed: "economy" | "fast" | "mixed" | "standard" | "unknown";
328
- observedNative: string[];
329
- reason: string | null;
330
- source: string;
331
- } | undefined;
332
- processing_cost_basis?: {
333
- nativeMode: string | null;
334
- kind: "cash" | "included" | "paid_credits" | "unknown" | "valuation";
335
- source: string;
336
- debit?: "unobserved" | undefined;
337
- } | undefined;
338
- prompt_cache_ttl?: {
339
- requested: "1h" | "5m" | null;
340
- submitted: "1h" | "5m" | null;
341
- reason: string | null;
342
- observed: "1h" | "5m" | "mixed" | "none" | "unknown";
343
- write_5m_tokens: number | null;
344
- write_1h_tokens: number | null;
345
- } | undefined;
346
- type: "completed" | "context" | "error" | "file_change" | "interaction_requested" | "message" | "patch_produced" | "started" | "status" | "thinking" | "tool_call" | "tool_result" | "usage";
347
- session_id: string;
348
- ts: string;
349
- text?: string | undefined;
350
- final?: boolean | undefined;
351
- tool?: {
352
- name: string;
353
- kind: "command" | "file" | "mcp" | "other" | "search" | "web";
354
- use_id?: string | undefined;
355
- target?: string | undefined;
356
- status?: "cancelled" | "denied" | "error" | "ok" | undefined;
357
- phase?: "completed" | "started" | undefined;
358
- error_summary?: string | undefined;
359
- content_summary?: string | undefined;
360
- exit_code?: number | undefined;
361
- command_outcome?: {
362
- state: "backgrounded" | "exited" | "timed_out" | "unknown";
363
- signal?: string | undefined;
364
- timeout_ms?: number | undefined;
365
- background_reason?: "requested" | "timeout" | undefined;
366
- shell_id?: string | undefined;
367
- pid?: number | undefined;
368
- } | undefined;
369
- web_retrieval?: "dispatched" | "failed" | "verified" | undefined;
370
- } | undefined;
371
- interaction?: {
372
- interaction_id: string;
373
- questions: {
374
- id: string;
375
- question: string;
376
- header: string | null;
377
- options: {
378
- label: string;
379
- description: string | null;
380
- }[];
381
- multi_select: boolean;
382
- }[];
383
- source_tool: string | null;
384
- } | undefined;
385
- patch_envelope?: {
386
- schema_version: 1;
387
- context_packet_hash: string;
388
- base_tree_sha: string;
389
- patch: string;
390
- patch_hash: string;
391
- touched_paths: {
392
- path: string;
393
- expected_blob_oid: string | null;
394
- }[];
395
- } | undefined;
396
- refusal_code?: "raw_context_exceeds_window" | "raw_patch_apply_failed" | "raw_patch_base_mismatch" | "raw_patch_binary_unsupported" | "raw_patch_digest_mismatch" | "raw_patch_missing_evidence" | "raw_patch_outside_scope" | "raw_patch_path_traversal" | "raw_patch_requires_isolation" | "raw_patch_stale_preimage" | "raw_patch_truncated" | undefined;
397
- raw_context?: {
398
- model: string;
399
- estimated_request_tokens: number;
400
- budget: {
401
- estimator: "chars_div_4";
402
- basis: "assumed_ceiling" | "model_context_window";
403
- model: string | null;
404
- context_window: number | null;
405
- output_allowance_tokens: number | null;
406
- framing_tokens: number | null;
407
- selection_limit_tokens: number;
408
- estimated_packet_tokens: number;
409
- omitted_for_budget: number;
410
- mandatory_paths: string[];
411
- };
412
- } | undefined;
413
- permission_denial?: {
414
- permission: string;
415
- source: string;
416
- } | undefined;
417
- usage?: {
418
- input_tokens?: number | undefined;
419
- output_tokens?: number | undefined;
420
- cached_input_tokens?: number | undefined;
421
- input_token_usage?: {
422
- total_tokens: number | null;
423
- cache_read_tokens: number | null;
424
- cache_write_tokens: number | null;
425
- } | undefined;
426
- cost_usd?: number | undefined;
427
- cost_basis?: {
428
- kind: "cash" | "unknown" | "valuation";
429
- source: string;
430
- } | undefined;
431
- estimated?: boolean | undefined;
432
- } | undefined;
433
- credential_route?: "local" | "managed_api_key" | "vendor_native" | undefined;
434
- credential_source?: "api_key_env" | "api_key_flag" | "native_session" | "none" | "oauth_token_env" | "provider_auth_file" | undefined;
435
- credential_profile_id?: string | undefined;
436
- plan_progress?: {
437
- items: {
438
- id: string;
439
- title: string;
440
- status: "completed" | "in_progress" | "pending";
441
- }[];
442
- } | undefined;
443
- rate_limit?: {
444
- constraint_id?: string | undefined;
445
- applies_to_request_kinds?: ("image" | "text")[] | undefined;
446
- applies_to_models?: string[] | null | undefined;
447
- applies_to_model_prefixes?: string[] | undefined;
448
- resets_at: string | null;
449
- retry_delay_ms: number | null;
450
- } | undefined;
451
- status?: {
452
- kind: "api_retry";
453
- attempt?: number | undefined;
454
- max_retries?: number | undefined;
455
- retry_delay_ms?: number | undefined;
456
- error_category?: "authentication_failed" | "billing_error" | "invalid_request" | "max_output_tokens" | "model_not_found" | "oauth_org_not_allowed" | "overloaded" | "rate_limit" | "server_error" | "timeout" | "unknown" | undefined;
457
- } | undefined;
458
- transient?: {
459
- kind: "network" | "service_unavailable" | "stream_disconnect" | "timeout" | "unknown";
460
- retry_delay_ms: number | null;
461
- } | undefined;
462
- context?: {
463
- kind: "capacity_exhausted" | "compaction_completed" | "compaction_started";
464
- cause: "blocking_limit" | "prompt_too_long" | "repeated_refill" | "unknown" | "window_exceeded";
465
- native_code: string | null;
466
- trigger: "auto" | "manual" | null;
467
- pre_tokens: number | null;
468
- } | undefined;
469
- error?: string | undefined;
470
- aborted?: boolean | undefined;
471
- payload?: Record<string, unknown> | undefined;
472
- }[];
473
- //# sourceMappingURL=continuation-chain.test-support.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"continuation-chain.test-support.d.ts","sourceRoot":"","sources":["../src/continuation-chain.test-support.ts"],"names":[],"mappings":"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"}
@@ -1,206 +0,0 @@
1
- /**
2
- * A `continueFrom` chain of real Orchestrator runs on one scripted fake
3
- * harness (no vendor calls): each run is labelled (A, B, C...) so a script
4
- * can answer per run and per spawn, and the successor receives exactly the
5
- * continuation facts the daemon runner resolves.
6
- */
7
- import { afterEach } from "vitest";
8
- import { execFileSync } from "node:child_process";
9
- import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10
- import { tmpdir } from "node:os";
11
- import { join } from "node:path";
12
- import { ConformanceReport, HarnessManifest, } from "@claudexor/schema";
13
- import { Orchestrator } from "./orchestrator.js";
14
- const roots = [];
15
- afterEach(() => roots.splice(0).forEach((root) => rmSync(root, { recursive: true, force: true })));
16
- export const WORK_ORDER = "WORK-ORDER-7f3a: build the dashboard";
17
- /** A movable fake store: sessions live under `<locator>/sessions/<sid>.jsonl`. */
18
- export function movableStore(retire = (file) => rmSync(file)) {
19
- const fileFor = (env, sid) => join(String(env["CLAUDEXOR_PROFILE_LOCATOR"] ?? "/nowhere"), "sessions", `${sid}.jsonl`);
20
- return {
21
- async locate(ref, env) {
22
- const file = fileFor(env, ref.nativeSessionId);
23
- return existsSync(file)
24
- ? { found: true, file, mtimeMs: Date.now(), sidecars: [] }
25
- : { found: false };
26
- },
27
- async move(located, _fromEnv, toEnv) {
28
- const sid = located.nativeSessionId ?? "?";
29
- const target = fileFor(toEnv, sid);
30
- execFileSync("mkdir", ["-p", join(target, "..")]);
31
- writeFileSync(target, readFileSync(located.file));
32
- return { ok: true, resumeRef: { nativeSessionId: sid }, retire: () => retire(located.file) };
33
- },
34
- };
35
- }
36
- export function chainFixture(opts, script) {
37
- const root = mkdtempSync(join(tmpdir(), "cx-chain-"));
38
- roots.push(root);
39
- execFileSync("git", ["init", "-b", "main"], { cwd: root, stdio: "pipe" });
40
- writeFileSync(join(root, "README.md"), "fixture\n");
41
- execFileSync("git", ["add", "README.md"], { cwd: root });
42
- execFileSync("git", ["-c", "user.name=Fixture", "-c", "user.email=fixture@example.test", "commit", "-m", "base"], { cwd: root, stdio: "pipe" });
43
- const stores = Object.fromEntries(opts.profiles.map((id) => [id, join(root, `store-${id}`)]));
44
- writeFileSync(join(process.env.CLAUDEXOR_CONFIG_DIR, "config.yaml"), JSON.stringify({
45
- runtime: {
46
- transient_retry: {
47
- max_retries: opts.maxRetries ?? 0,
48
- initial_delay_ms: 1,
49
- max_delay_ms: 2,
50
- },
51
- },
52
- credential_profiles: opts.profiles.map((id) => ({
53
- profile_id: id,
54
- harness_id: "fake",
55
- display_name: id,
56
- credential_kind: "config_dir_login",
57
- isolation_locator: stores[id],
58
- })),
59
- harnesses: {
60
- fake: {
61
- ...(opts.fallbackModel ? { fallback_model: opts.fallbackModel } : {}),
62
- profile_policy: { limit_action: "rotate" },
63
- },
64
- },
65
- }));
66
- const spawns = [];
67
- const label = { current: "A" };
68
- const adapter = {
69
- id: "fake",
70
- continuity: opts.continuity ?? movableStore(),
71
- async discover() {
72
- return HarnessManifest.parse({
73
- id: "fake",
74
- display_name: "fake",
75
- kind: "local_cli",
76
- provider_family: "local",
77
- capabilities: {
78
- implement: true,
79
- read_files: true,
80
- effort_levels: ["high"],
81
- repair: true,
82
- explain: true,
83
- audit: true,
84
- known_models: ["m1", "m2"],
85
- },
86
- auth_modes: ["local_session"],
87
- access_profiles_supported: ["workspace_write", "readonly"],
88
- });
89
- },
90
- async doctor() {
91
- return ConformanceReport.parse({
92
- harness_id: "fake",
93
- status: "ok",
94
- enabled_intents: ["implement", "repair", "explain", "audit"],
95
- auth_sources: [
96
- { source: "native_session", availability: "available", verification: "passed" },
97
- ],
98
- });
99
- },
100
- async probeCredentialProfile(profile) {
101
- return {
102
- profile_id: profile.profile_id,
103
- harness_id: "fake",
104
- availability: "available",
105
- verification: "passed",
106
- verification_source: "local_store",
107
- last_verified_at: new Date().toISOString(),
108
- };
109
- },
110
- async models() {
111
- return ["m1", "m2"].map((id) => ({ id, label: null, context_window: null, routes: null }));
112
- },
113
- async *run(spec) {
114
- const profile = spec.credential_profile.profile_id;
115
- const ctx = {
116
- label: label.current,
117
- nth: spawns.filter((s) => s.label === label.current).length + 1,
118
- profile,
119
- resume: spec.resume_session_id ?? null,
120
- prompt: spec.prompt,
121
- model: spec.model_hint ?? null,
122
- cwd: spec.cwd,
123
- };
124
- spawns.push(ctx);
125
- const emit = (ev) => ({
126
- session_id: spec.session_id,
127
- ts: new Date().toISOString(),
128
- credential_route: "vendor_native",
129
- credential_profile_id: profile,
130
- ...ev,
131
- });
132
- const seed = (sid) => {
133
- execFileSync("mkdir", ["-p", join(stores[profile], "sessions")]);
134
- writeFileSync(join(stores[profile], "sessions", `${sid}.jsonl`), `{"sid":"${sid}"}\n`);
135
- };
136
- yield* script({ ...ctx, spec, emit, seed });
137
- },
138
- };
139
- return { root, stores, spawns, adapter, label };
140
- }
141
- export async function runLabelled(f, label, input) {
142
- f.label.current = label;
143
- const events = [];
144
- const result = await new Orchestrator({
145
- registry: new Map([["fake", f.adapter]]),
146
- reviewers: [],
147
- }).run({
148
- repoRoot: f.root,
149
- mode: "agent",
150
- prompt: WORK_ORDER,
151
- harnesses: ["fake"],
152
- review: false,
153
- models: { fake: "m1" },
154
- effort: "high",
155
- authPreference: "subscription",
156
- web: "off",
157
- ...input,
158
- onEvent: (event) => events.push(event),
159
- });
160
- const terminal = events.find((e) => ["run.failed", "run.completed", "run.blocked"].includes(e.type));
161
- return {
162
- result,
163
- events,
164
- receipts: events
165
- .filter((e) => e.type === "run.continuity")
166
- .map((e) => e.payload["receipt"]),
167
- resumable: terminal?.payload["resumable"],
168
- };
169
- }
170
- /** The facts the daemon resolves for a successor of `pred` (its own ancestors first). */
171
- export function continuing(pred, workOrder, ancestors = [], over = {}) {
172
- return {
173
- retain: true,
174
- from: {
175
- runId: pred.result.runId,
176
- runDir: pred.result.runDir,
177
- state: pred.result.lifecycle,
178
- workOrder,
179
- preference: "auto",
180
- ancestors: ancestors.map((run) => ({
181
- runId: run.result.runId,
182
- runDir: run.result.runDir,
183
- state: run.result.lifecycle,
184
- })),
185
- ...over,
186
- },
187
- };
188
- }
189
- export const limitStop = (emit) => [
190
- emit({
191
- type: "status",
192
- status: { kind: "api_retry", error_category: "rate_limit" },
193
- rate_limit: {
194
- resets_at: "2026-10-06T21:00:00.000Z",
195
- retry_delay_ms: null,
196
- constraint_id: "five_hour",
197
- },
198
- }),
199
- emit({ type: "error", error: "usage limit reached" }),
200
- emit({ type: "completed" }),
201
- ];
202
- export const crash = (emit) => [
203
- emit({ type: "error", error: "connection reset" }),
204
- emit({ type: "completed", payload: { exit_code: 1, harness_reported_error: true } }),
205
- ];
206
- //# sourceMappingURL=continuation-chain.test-support.js.map