@claudexor/cli 3.25.1 → 4.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 (228) hide show
  1. package/dist/account-reset-services.d.ts +2 -2
  2. package/dist/account-reset-services.d.ts.map +1 -1
  3. package/dist/account-reset-services.js.map +1 -1
  4. package/dist/account-resource-query.d.ts +2 -2
  5. package/dist/account-resource-query.d.ts.map +1 -1
  6. package/dist/account-resource-query.js +3 -3
  7. package/dist/account-resource-query.js.map +1 -1
  8. package/dist/claude-statusline.d.ts +2 -4
  9. package/dist/claude-statusline.d.ts.map +1 -1
  10. package/dist/claude-statusline.js +6 -5
  11. package/dist/claude-statusline.js.map +1 -1
  12. package/dist/claudexord-entry.d.ts +7 -2
  13. package/dist/claudexord-entry.d.ts.map +1 -1
  14. package/dist/claudexord-entry.js +10 -3
  15. package/dist/claudexord-entry.js.map +1 -1
  16. package/dist/claudexord.d.ts +0 -1
  17. package/dist/claudexord.d.ts.map +1 -1
  18. package/dist/claudexord.js +308 -240
  19. package/dist/claudexord.js.map +1 -1
  20. package/dist/cli-error.js +3 -3
  21. package/dist/cli-error.js.map +1 -1
  22. package/dist/cli.js +4 -49
  23. package/dist/cli.js.map +1 -1
  24. package/dist/codex-quota-source.js +2 -2
  25. package/dist/codex-quota-source.js.map +1 -1
  26. package/dist/command-flags.d.ts.map +1 -1
  27. package/dist/command-flags.js +1 -0
  28. package/dist/command-flags.js.map +1 -1
  29. package/dist/command-registry.js +1 -1
  30. package/dist/command-registry.js.map +1 -1
  31. package/dist/continue-from-run.d.ts +7 -8
  32. package/dist/continue-from-run.d.ts.map +1 -1
  33. package/dist/continue-from-run.js +3 -4
  34. package/dist/continue-from-run.js.map +1 -1
  35. package/dist/control-api-address.d.ts +6 -0
  36. package/dist/control-api-address.d.ts.map +1 -0
  37. package/dist/control-api-address.js +53 -0
  38. package/dist/control-api-address.js.map +1 -0
  39. package/dist/control-services.d.ts +139 -115
  40. package/dist/control-services.d.ts.map +1 -1
  41. package/dist/control-services.js +11 -32
  42. package/dist/control-services.js.map +1 -1
  43. package/dist/daemon-admission-runtime.d.ts +0 -60
  44. package/dist/daemon-admission-runtime.d.ts.map +1 -1
  45. package/dist/daemon-admission-runtime.js +3 -168
  46. package/dist/daemon-admission-runtime.js.map +1 -1
  47. package/dist/daemon-agent-runner.d.ts +6 -3
  48. package/dist/daemon-agent-runner.d.ts.map +1 -1
  49. package/dist/daemon-agent-runner.js +2 -1
  50. package/dist/daemon-agent-runner.js.map +1 -1
  51. package/dist/daemon-lifecycle.d.ts +10 -3
  52. package/dist/daemon-lifecycle.d.ts.map +1 -1
  53. package/dist/daemon-lifecycle.js +16 -7
  54. package/dist/daemon-lifecycle.js.map +1 -1
  55. package/dist/daemon-owner.d.ts +7 -0
  56. package/dist/daemon-owner.d.ts.map +1 -0
  57. package/dist/daemon-owner.js +39 -0
  58. package/dist/daemon-owner.js.map +1 -0
  59. package/dist/daemon-run.d.ts +8 -1
  60. package/dist/daemon-run.d.ts.map +1 -1
  61. package/dist/daemon-run.js +31 -3
  62. package/dist/daemon-run.js.map +1 -1
  63. package/dist/daemon-runtime-shutdown.d.ts +1 -1
  64. package/dist/daemon-runtime-shutdown.d.ts.map +1 -1
  65. package/dist/daemon-runtime-shutdown.js +2 -2
  66. package/dist/daemon-runtime-shutdown.js.map +1 -1
  67. package/dist/daemon-startup.d.ts +5 -42
  68. package/dist/daemon-startup.d.ts.map +1 -1
  69. package/dist/daemon-startup.js +7 -85
  70. package/dist/daemon-startup.js.map +1 -1
  71. package/dist/daemon-status-report.d.ts +4 -0
  72. package/dist/daemon-status-report.d.ts.map +1 -0
  73. package/dist/daemon-status-report.js +39 -0
  74. package/dist/daemon-status-report.js.map +1 -0
  75. package/dist/engine-skew.d.ts +1 -0
  76. package/dist/engine-skew.d.ts.map +1 -1
  77. package/dist/engine-skew.js +6 -2
  78. package/dist/engine-skew.js.map +1 -1
  79. package/dist/harness-maintenance-service.d.ts +9 -222
  80. package/dist/harness-maintenance-service.d.ts.map +1 -1
  81. package/dist/harness-maintenance-service.js +7 -37
  82. package/dist/harness-maintenance-service.js.map +1 -1
  83. package/dist/live.d.ts +2 -5
  84. package/dist/live.d.ts.map +1 -1
  85. package/dist/live.js +2 -44
  86. package/dist/live.js.map +1 -1
  87. package/dist/mcp-catalog-query.d.ts +2 -1
  88. package/dist/mcp-catalog-query.d.ts.map +1 -1
  89. package/dist/mcp-catalog-query.js +6 -5
  90. package/dist/mcp-catalog-query.js.map +1 -1
  91. package/dist/mcp-daemon-unavailable.d.ts.map +1 -1
  92. package/dist/mcp-daemon-unavailable.js +4 -3
  93. package/dist/mcp-daemon-unavailable.js.map +1 -1
  94. package/dist/mcp-journal-recovery.d.ts.map +1 -1
  95. package/dist/mcp-journal-recovery.js +4 -4
  96. package/dist/mcp-journal-recovery.js.map +1 -1
  97. package/dist/mcp-runner.d.ts +1 -1
  98. package/dist/mcp-runner.d.ts.map +1 -1
  99. package/dist/mcp-runner.js +8 -6
  100. package/dist/mcp-runner.js.map +1 -1
  101. package/dist/mcp-thread-query.d.ts +1 -1
  102. package/dist/mcp-thread-query.d.ts.map +1 -1
  103. package/dist/mcp-thread-query.js +2 -2
  104. package/dist/mcp-thread-query.js.map +1 -1
  105. package/dist/model-operation-control.d.ts +375 -0
  106. package/dist/model-operation-control.d.ts.map +1 -0
  107. package/dist/model-operation-control.js +16 -0
  108. package/dist/model-operation-control.js.map +1 -0
  109. package/dist/model-services.d.ts +302 -91
  110. package/dist/model-services.d.ts.map +1 -1
  111. package/dist/model-services.js +5 -7
  112. package/dist/model-services.js.map +1 -1
  113. package/dist/ops-commands.d.ts +1 -8
  114. package/dist/ops-commands.d.ts.map +1 -1
  115. package/dist/ops-commands.js +13 -16
  116. package/dist/ops-commands.js.map +1 -1
  117. package/dist/orphan-reaper.d.ts +18 -0
  118. package/dist/orphan-reaper.d.ts.map +1 -1
  119. package/dist/orphan-reaper.js +50 -0
  120. package/dist/orphan-reaper.js.map +1 -1
  121. package/dist/plugin-cli.d.ts +3 -0
  122. package/dist/plugin-cli.d.ts.map +1 -0
  123. package/dist/plugin-cli.js +57 -0
  124. package/dist/plugin-cli.js.map +1 -0
  125. package/dist/plugin-mcp.d.ts +3 -0
  126. package/dist/plugin-mcp.d.ts.map +1 -0
  127. package/dist/plugin-mcp.js +116 -0
  128. package/dist/plugin-mcp.js.map +1 -0
  129. package/dist/plugin-runtime.d.ts +24 -0
  130. package/dist/plugin-runtime.d.ts.map +1 -0
  131. package/dist/plugin-runtime.js +113 -0
  132. package/dist/plugin-runtime.js.map +1 -0
  133. package/dist/plugins.d.ts +2 -0
  134. package/dist/plugins.d.ts.map +1 -1
  135. package/dist/plugins.js +92 -184
  136. package/dist/plugins.js.map +1 -1
  137. package/dist/project-command.d.ts +4 -1
  138. package/dist/project-command.d.ts.map +1 -1
  139. package/dist/project-command.js +14 -5
  140. package/dist/project-command.js.map +1 -1
  141. package/dist/quota-services.d.ts +6 -4
  142. package/dist/quota-services.d.ts.map +1 -1
  143. package/dist/quota-services.js +58 -23
  144. package/dist/quota-services.js.map +1 -1
  145. package/dist/recovery-control-services.d.ts +99 -0
  146. package/dist/recovery-control-services.d.ts.map +1 -0
  147. package/dist/recovery-control-services.js +32 -0
  148. package/dist/recovery-control-services.js.map +1 -0
  149. package/dist/remote-filesystem.d.ts +3 -3
  150. package/dist/remote-filesystem.d.ts.map +1 -1
  151. package/dist/remote-filesystem.js.map +1 -1
  152. package/dist/request-preflight.d.ts +2 -2
  153. package/dist/request-preflight.d.ts.map +1 -1
  154. package/dist/request-preflight.js.map +1 -1
  155. package/dist/retention-service.d.ts +3 -3
  156. package/dist/retention-service.d.ts.map +1 -1
  157. package/dist/settings-command.d.ts.map +1 -1
  158. package/dist/settings-command.js +7 -2
  159. package/dist/settings-command.js.map +1 -1
  160. package/dist/settings-service.d.ts +66 -6
  161. package/dist/settings-service.d.ts.map +1 -1
  162. package/dist/settings-service.js +1 -1
  163. package/dist/settings-service.js.map +1 -1
  164. package/dist/setup-client-pty.js +1 -1
  165. package/dist/setup-client-pty.js.map +1 -1
  166. package/dist/setup-credential-window.d.ts +4 -4
  167. package/dist/setup-credential-window.d.ts.map +1 -1
  168. package/dist/setup-credential-window.js +1 -1
  169. package/dist/setup-credential-window.js.map +1 -1
  170. package/dist/setup-device-code-disclosure.js +1 -1
  171. package/dist/setup-device-code-disclosure.js.map +1 -1
  172. package/dist/setup-job-persistence.d.ts +30 -0
  173. package/dist/setup-job-persistence.d.ts.map +1 -0
  174. package/dist/setup-job-persistence.js +3 -0
  175. package/dist/setup-job-persistence.js.map +1 -0
  176. package/dist/{setup-job-store.d.ts → setup-job-projection.d.ts} +9 -17
  177. package/dist/setup-job-projection.d.ts.map +1 -0
  178. package/dist/{setup-job-store.js → setup-job-projection.js} +29 -68
  179. package/dist/setup-job-projection.js.map +1 -0
  180. package/dist/setup-job-support.js +1 -1
  181. package/dist/setup-job-support.js.map +1 -1
  182. package/dist/setup-jobs.d.ts +3 -4
  183. package/dist/setup-jobs.d.ts.map +1 -1
  184. package/dist/setup-jobs.js +3 -3
  185. package/dist/setup-jobs.js.map +1 -1
  186. package/dist/setup-lifecycle-binding.js +1 -1
  187. package/dist/setup-lifecycle-binding.js.map +1 -1
  188. package/dist/setup-login-completion.js +1 -1
  189. package/dist/setup-login-completion.js.map +1 -1
  190. package/dist/sql-daemon-queries.d.ts +24 -0
  191. package/dist/sql-daemon-queries.d.ts.map +1 -0
  192. package/dist/sql-daemon-queries.js +41 -0
  193. package/dist/sql-daemon-queries.js.map +1 -0
  194. package/dist/sql-daemon-runtime.d.ts +1415 -0
  195. package/dist/sql-daemon-runtime.d.ts.map +1 -0
  196. package/dist/sql-daemon-runtime.js +94 -0
  197. package/dist/sql-daemon-runtime.js.map +1 -0
  198. package/dist/sql-daemon-storage.d.ts +40 -0
  199. package/dist/sql-daemon-storage.d.ts.map +1 -0
  200. package/dist/sql-daemon-storage.js +203 -0
  201. package/dist/sql-daemon-storage.js.map +1 -0
  202. package/dist/sql-import-publication.d.ts +19 -0
  203. package/dist/sql-import-publication.d.ts.map +1 -0
  204. package/dist/sql-import-publication.js +54 -0
  205. package/dist/sql-import-publication.js.map +1 -0
  206. package/dist/sql-setup-lifecycle.d.ts +15 -0
  207. package/dist/sql-setup-lifecycle.d.ts.map +1 -0
  208. package/dist/sql-setup-lifecycle.js +28 -0
  209. package/dist/sql-setup-lifecycle.js.map +1 -0
  210. package/dist/sql-setup-store.d.ts +7 -0
  211. package/dist/sql-setup-store.d.ts.map +1 -0
  212. package/dist/sql-setup-store.js +102 -0
  213. package/dist/sql-setup-store.js.map +1 -0
  214. package/dist/sql-startup-storage.d.ts +15 -0
  215. package/dist/sql-startup-storage.d.ts.map +1 -0
  216. package/dist/sql-startup-storage.js +75 -0
  217. package/dist/sql-startup-storage.js.map +1 -0
  218. package/dist/thread-delivery.d.ts +2 -2
  219. package/dist/thread-purge.d.ts +8 -2
  220. package/dist/thread-purge.d.ts.map +1 -1
  221. package/dist/thread-purge.js +37 -8
  222. package/dist/thread-purge.js.map +1 -1
  223. package/dist/thread-turn-services.d.ts +2 -2
  224. package/dist/thread-turn-services.d.ts.map +1 -1
  225. package/dist/thread-turn-services.js.map +1 -1
  226. package/package.json +25 -26
  227. package/dist/setup-job-store.d.ts.map +0 -1
  228. package/dist/setup-job-store.js.map +0 -1
@@ -0,0 +1,375 @@
1
+ import type { ModelOperations } from "@claudexor/daemon";
2
+ import type { JobAdmission } from "@claudexor/schema";
3
+ /** Existing model controls, with one synchronous snapshot of this operation's
4
+ * live admission facts. Provider dispatch and result custody stay in their owner. */
5
+ export declare function modelOperationControlServices(operations: Pick<ModelOperations, "create" | "inspect" | "readResult" | "acknowledge" | "cancel">, admission?: (id: string) => JobAdmission | null): {
6
+ createModelOperation: (...args: Parameters<ModelOperations["create"]>) => Promise<{
7
+ id: string;
8
+ state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded";
9
+ admission?: {
10
+ class: "model" | "non_model";
11
+ phase: "active" | "queued";
12
+ blockers: ({
13
+ kind: "global_limit";
14
+ limit: number;
15
+ } | {
16
+ kind: "class_limit";
17
+ limit: number;
18
+ } | {
19
+ kind: "thread_busy";
20
+ } | {
21
+ kind: "stopping";
22
+ })[];
23
+ } | null | undefined;
24
+ createdAt: string;
25
+ startedAt: string | null;
26
+ finishedAt: string | null;
27
+ dispatch: {
28
+ state: "not_started" | "response_received" | "started" | "unknown";
29
+ startedAt: string | null;
30
+ route: {
31
+ source: string;
32
+ credentialProfileId: string;
33
+ accountFingerprint: string | null;
34
+ model: string | null;
35
+ } | null;
36
+ };
37
+ response: {
38
+ state: "absent";
39
+ } | {
40
+ state: "ready";
41
+ ref: {
42
+ resourceId: string;
43
+ sha256: string;
44
+ sizeBytes: number;
45
+ };
46
+ readyAt: string;
47
+ expiresAt: string;
48
+ } | {
49
+ state: "acknowledged";
50
+ ref: {
51
+ resourceId: string;
52
+ sha256: string;
53
+ sizeBytes: number;
54
+ };
55
+ releasedAt: string;
56
+ } | {
57
+ state: "expired";
58
+ ref: {
59
+ resourceId: string;
60
+ sha256: string;
61
+ sizeBytes: number;
62
+ };
63
+ releasedAt: string;
64
+ };
65
+ usage: {
66
+ input_tokens: number | null;
67
+ output_tokens: number | null;
68
+ cached_input_tokens: number | null;
69
+ cache_write_tokens: number | null;
70
+ reasoning_tokens: number | null;
71
+ };
72
+ cost: {
73
+ processing?: {
74
+ nativeMode: string | null;
75
+ kind: "cash" | "included" | "paid_credits" | "unknown" | "valuation";
76
+ source: string;
77
+ } | undefined;
78
+ knowledge: "estimated" | "exact" | "unknown";
79
+ billing: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
80
+ source: string;
81
+ provenance: string[];
82
+ estimatedUsd: number | null;
83
+ cashUsd: number | null;
84
+ valuationUsd: number | null;
85
+ valuationKnowledge: "estimated" | "exact" | "unknown";
86
+ } | null;
87
+ problem: {
88
+ code: string;
89
+ message: string;
90
+ retryable: boolean;
91
+ fieldErrors: Record<string, string[]>;
92
+ requiredActions: string[];
93
+ evidenceRefs: string[];
94
+ context: Record<string, unknown>;
95
+ } | null;
96
+ }>;
97
+ getModelOperation: (id: string) => Promise<{
98
+ id: string;
99
+ state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded";
100
+ admission?: {
101
+ class: "model" | "non_model";
102
+ phase: "active" | "queued";
103
+ blockers: ({
104
+ kind: "global_limit";
105
+ limit: number;
106
+ } | {
107
+ kind: "class_limit";
108
+ limit: number;
109
+ } | {
110
+ kind: "thread_busy";
111
+ } | {
112
+ kind: "stopping";
113
+ })[];
114
+ } | null | undefined;
115
+ createdAt: string;
116
+ startedAt: string | null;
117
+ finishedAt: string | null;
118
+ dispatch: {
119
+ state: "not_started" | "response_received" | "started" | "unknown";
120
+ startedAt: string | null;
121
+ route: {
122
+ source: string;
123
+ credentialProfileId: string;
124
+ accountFingerprint: string | null;
125
+ model: string | null;
126
+ } | null;
127
+ };
128
+ response: {
129
+ state: "absent";
130
+ } | {
131
+ state: "ready";
132
+ ref: {
133
+ resourceId: string;
134
+ sha256: string;
135
+ sizeBytes: number;
136
+ };
137
+ readyAt: string;
138
+ expiresAt: string;
139
+ } | {
140
+ state: "acknowledged";
141
+ ref: {
142
+ resourceId: string;
143
+ sha256: string;
144
+ sizeBytes: number;
145
+ };
146
+ releasedAt: string;
147
+ } | {
148
+ state: "expired";
149
+ ref: {
150
+ resourceId: string;
151
+ sha256: string;
152
+ sizeBytes: number;
153
+ };
154
+ releasedAt: string;
155
+ };
156
+ usage: {
157
+ input_tokens: number | null;
158
+ output_tokens: number | null;
159
+ cached_input_tokens: number | null;
160
+ cache_write_tokens: number | null;
161
+ reasoning_tokens: number | null;
162
+ };
163
+ cost: {
164
+ processing?: {
165
+ nativeMode: string | null;
166
+ kind: "cash" | "included" | "paid_credits" | "unknown" | "valuation";
167
+ source: string;
168
+ } | undefined;
169
+ knowledge: "estimated" | "exact" | "unknown";
170
+ billing: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
171
+ source: string;
172
+ provenance: string[];
173
+ estimatedUsd: number | null;
174
+ cashUsd: number | null;
175
+ valuationUsd: number | null;
176
+ valuationKnowledge: "estimated" | "exact" | "unknown";
177
+ } | null;
178
+ problem: {
179
+ code: string;
180
+ message: string;
181
+ retryable: boolean;
182
+ fieldErrors: Record<string, string[]>;
183
+ requiredActions: string[];
184
+ evidenceRefs: string[];
185
+ context: Record<string, unknown>;
186
+ } | null;
187
+ }>;
188
+ readModelResult: (id: string) => Promise<{
189
+ bytes: Buffer;
190
+ sha256: string;
191
+ }>;
192
+ acknowledgeModelResult: (id: string, sha256: string) => Promise<{
193
+ id: string;
194
+ state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded";
195
+ admission?: {
196
+ class: "model" | "non_model";
197
+ phase: "active" | "queued";
198
+ blockers: ({
199
+ kind: "global_limit";
200
+ limit: number;
201
+ } | {
202
+ kind: "class_limit";
203
+ limit: number;
204
+ } | {
205
+ kind: "thread_busy";
206
+ } | {
207
+ kind: "stopping";
208
+ })[];
209
+ } | null | undefined;
210
+ createdAt: string;
211
+ startedAt: string | null;
212
+ finishedAt: string | null;
213
+ dispatch: {
214
+ state: "not_started" | "response_received" | "started" | "unknown";
215
+ startedAt: string | null;
216
+ route: {
217
+ source: string;
218
+ credentialProfileId: string;
219
+ accountFingerprint: string | null;
220
+ model: string | null;
221
+ } | null;
222
+ };
223
+ response: {
224
+ state: "absent";
225
+ } | {
226
+ state: "ready";
227
+ ref: {
228
+ resourceId: string;
229
+ sha256: string;
230
+ sizeBytes: number;
231
+ };
232
+ readyAt: string;
233
+ expiresAt: string;
234
+ } | {
235
+ state: "acknowledged";
236
+ ref: {
237
+ resourceId: string;
238
+ sha256: string;
239
+ sizeBytes: number;
240
+ };
241
+ releasedAt: string;
242
+ } | {
243
+ state: "expired";
244
+ ref: {
245
+ resourceId: string;
246
+ sha256: string;
247
+ sizeBytes: number;
248
+ };
249
+ releasedAt: string;
250
+ };
251
+ usage: {
252
+ input_tokens: number | null;
253
+ output_tokens: number | null;
254
+ cached_input_tokens: number | null;
255
+ cache_write_tokens: number | null;
256
+ reasoning_tokens: number | null;
257
+ };
258
+ cost: {
259
+ processing?: {
260
+ nativeMode: string | null;
261
+ kind: "cash" | "included" | "paid_credits" | "unknown" | "valuation";
262
+ source: string;
263
+ } | undefined;
264
+ knowledge: "estimated" | "exact" | "unknown";
265
+ billing: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
266
+ source: string;
267
+ provenance: string[];
268
+ estimatedUsd: number | null;
269
+ cashUsd: number | null;
270
+ valuationUsd: number | null;
271
+ valuationKnowledge: "estimated" | "exact" | "unknown";
272
+ } | null;
273
+ problem: {
274
+ code: string;
275
+ message: string;
276
+ retryable: boolean;
277
+ fieldErrors: Record<string, string[]>;
278
+ requiredActions: string[];
279
+ evidenceRefs: string[];
280
+ context: Record<string, unknown>;
281
+ } | null;
282
+ }>;
283
+ cancelModelOperation: (...args: Parameters<ModelOperations["cancel"]>) => Promise<{
284
+ id: string;
285
+ state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded";
286
+ admission?: {
287
+ class: "model" | "non_model";
288
+ phase: "active" | "queued";
289
+ blockers: ({
290
+ kind: "global_limit";
291
+ limit: number;
292
+ } | {
293
+ kind: "class_limit";
294
+ limit: number;
295
+ } | {
296
+ kind: "thread_busy";
297
+ } | {
298
+ kind: "stopping";
299
+ })[];
300
+ } | null | undefined;
301
+ createdAt: string;
302
+ startedAt: string | null;
303
+ finishedAt: string | null;
304
+ dispatch: {
305
+ state: "not_started" | "response_received" | "started" | "unknown";
306
+ startedAt: string | null;
307
+ route: {
308
+ source: string;
309
+ credentialProfileId: string;
310
+ accountFingerprint: string | null;
311
+ model: string | null;
312
+ } | null;
313
+ };
314
+ response: {
315
+ state: "absent";
316
+ } | {
317
+ state: "ready";
318
+ ref: {
319
+ resourceId: string;
320
+ sha256: string;
321
+ sizeBytes: number;
322
+ };
323
+ readyAt: string;
324
+ expiresAt: string;
325
+ } | {
326
+ state: "acknowledged";
327
+ ref: {
328
+ resourceId: string;
329
+ sha256: string;
330
+ sizeBytes: number;
331
+ };
332
+ releasedAt: string;
333
+ } | {
334
+ state: "expired";
335
+ ref: {
336
+ resourceId: string;
337
+ sha256: string;
338
+ sizeBytes: number;
339
+ };
340
+ releasedAt: string;
341
+ };
342
+ usage: {
343
+ input_tokens: number | null;
344
+ output_tokens: number | null;
345
+ cached_input_tokens: number | null;
346
+ cache_write_tokens: number | null;
347
+ reasoning_tokens: number | null;
348
+ };
349
+ cost: {
350
+ processing?: {
351
+ nativeMode: string | null;
352
+ kind: "cash" | "included" | "paid_credits" | "unknown" | "valuation";
353
+ source: string;
354
+ } | undefined;
355
+ knowledge: "estimated" | "exact" | "unknown";
356
+ billing: "metered" | "proven_zero" | "subscription_entitlement" | "unknown";
357
+ source: string;
358
+ provenance: string[];
359
+ estimatedUsd: number | null;
360
+ cashUsd: number | null;
361
+ valuationUsd: number | null;
362
+ valuationKnowledge: "estimated" | "exact" | "unknown";
363
+ } | null;
364
+ problem: {
365
+ code: string;
366
+ message: string;
367
+ retryable: boolean;
368
+ fieldErrors: Record<string, string[]>;
369
+ requiredActions: string[];
370
+ evidenceRefs: string[];
371
+ context: Record<string, unknown>;
372
+ } | null;
373
+ }>;
374
+ };
375
+ //# sourceMappingURL=model-operation-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-operation-control.d.ts","sourceRoot":"","sources":["../src/model-operation-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;qFACqF;AACrF,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,GAAG,QAAQ,CAAC,EACjG,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,YAAY,GAAG,IAAI;IAO7C,oBAAoB,YAAkB,UAAU,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE3E,iBAAiB,OAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACpC,eAAe,OAAa,MAAM;;;;IAClC,sBAAsB,OAAa,MAAM,UAAU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEzD,oBAAoB,YAAkB,UAAU,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9E"}
@@ -0,0 +1,16 @@
1
+ /** Existing model controls, with one synchronous snapshot of this operation's
2
+ * live admission facts. Provider dispatch and result custody stay in their owner. */
3
+ export function modelOperationControlServices(operations, admission) {
4
+ const snapshot = (id) => {
5
+ const detail = operations.inspect(id);
6
+ return admission ? { ...detail, admission: admission(id) } : detail;
7
+ };
8
+ return {
9
+ createModelOperation: async (...args) => snapshot((await operations.create(...args)).id),
10
+ getModelOperation: async (id) => snapshot(id),
11
+ readModelResult: async (id) => operations.readResult(id),
12
+ acknowledgeModelResult: async (id, sha256) => snapshot(operations.acknowledge(id, sha256).id),
13
+ cancelModelOperation: async (...args) => snapshot((await operations.cancel(...args)).id),
14
+ };
15
+ }
16
+ //# sourceMappingURL=model-operation-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-operation-control.js","sourceRoot":"","sources":["../src/model-operation-control.ts"],"names":[],"mappings":"AAGA;qFACqF;AACrF,MAAM,UAAU,6BAA6B,CAC3C,UAAiG,EACjG,SAA+C;IAE/C,MAAM,QAAQ,GAAG,CAAC,EAAU,EAAE,EAAE;QAC9B,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACtC,OAAO,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IACtE,CAAC,CAAC;IACF,OAAO;QACL,oBAAoB,EAAE,KAAK,EAAE,GAAG,IAA2C,EAAE,EAAE,CAC7E,QAAQ,CAAC,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,iBAAiB,EAAE,KAAK,EAAE,EAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrD,eAAe,EAAE,KAAK,EAAE,EAAU,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAChE,sBAAsB,EAAE,KAAK,EAAE,EAAU,EAAE,MAAc,EAAE,EAAE,CAC3D,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;QACjD,oBAAoB,EAAE,KAAK,EAAE,GAAG,IAA2C,EAAE,EAAE,CAC7E,QAAQ,CAAC,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC"}