@claudexor/schema 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/config.d.ts +2 -2
  2. package/dist/config.d.ts.map +1 -1
  3. package/dist/config.js +2 -2
  4. package/dist/config.js.map +1 -1
  5. package/dist/control-gc.d.ts +113 -0
  6. package/dist/control-gc.d.ts.map +1 -1
  7. package/dist/control-gc.js +28 -1
  8. package/dist/control-gc.js.map +1 -1
  9. package/dist/control-run-event-part.d.ts +53 -0
  10. package/dist/control-run-event-part.d.ts.map +1 -0
  11. package/dist/control-run-event-part.js +47 -0
  12. package/dist/control-run-event-part.js.map +1 -0
  13. package/dist/daemon-status.d.ts +327 -0
  14. package/dist/daemon-status.d.ts.map +1 -1
  15. package/dist/daemon-status.js +35 -0
  16. package/dist/daemon-status.js.map +1 -1
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/mcp-run-result.d.ts +251 -0
  22. package/dist/mcp-run-result.d.ts.map +1 -1
  23. package/dist/mcp-run-result.js +26 -2
  24. package/dist/mcp-run-result.js.map +1 -1
  25. package/dist/mcp-run-wait.d.ts +269 -0
  26. package/dist/mcp-run-wait.d.ts.map +1 -0
  27. package/dist/mcp-run-wait.js +73 -0
  28. package/dist/mcp-run-wait.js.map +1 -0
  29. package/dist/operation.d.ts +5 -0
  30. package/dist/operation.d.ts.map +1 -1
  31. package/dist/operation.js +7 -0
  32. package/dist/operation.js.map +1 -1
  33. package/dist/store-status.d.ts +10 -0
  34. package/dist/store-status.d.ts.map +1 -1
  35. package/dist/store-status.js +8 -0
  36. package/dist/store-status.js.map +1 -1
  37. package/generated/ControlDaemonStatus.schema.json +174 -6
  38. package/generated/ControlGcReceipt.schema.json +81 -1
  39. package/generated/ControlGcRequest.schema.json +4 -0
  40. package/generated/ControlHandshakeResponse.schema.json +5 -0
  41. package/generated/ControlRunEventPart.schema.json +140 -0
  42. package/generated/GlobalConfig.schema.json +1 -1
  43. package/generated/McpRunEventReadInput.schema.json +41 -0
  44. package/generated/McpRunHandleResult.schema.json +382 -0
  45. package/generated/McpRunToolResult.schema.json +10 -2
  46. package/generated/McpRunWaitInput.schema.json +50 -0
  47. package/generated/McpRunWaitResult.schema.json +411 -0
  48. package/package.json +2 -2
@@ -0,0 +1,411 @@
1
+ {
2
+ "$ref": "#/definitions/McpRunWaitResult",
3
+ "definitions": {
4
+ "McpRunWaitResult": {
5
+ "type": "object",
6
+ "properties": {
7
+ "runId": {
8
+ "type": "string",
9
+ "description": "Canonical run id; a queued job id converges to its run id once the run binds."
10
+ },
11
+ "status": {
12
+ "type": "string",
13
+ "enum": [
14
+ "queued",
15
+ "running",
16
+ "succeeded",
17
+ "failed",
18
+ "cancelled",
19
+ "interrupted"
20
+ ],
21
+ "description": "Control-plane run state = the run LIFECYCLE (D8): queued/running while live, then exactly one of succeeded / failed / cancelled / interrupted. Outcome quality (checks/review/delivery) is orthogonal — see outcomeFacts."
22
+ },
23
+ "snapshotSeq": {
24
+ "type": "integer",
25
+ "minimum": 0,
26
+ "maximum": 9007199254740991,
27
+ "description": "Last event seq at the latest snapshot: a fence, not a cursor. nextSeq below it means events are already written; eventOmission stream_ended reports when the stream cannot serve them."
28
+ },
29
+ "snapshotPhase": {
30
+ "type": "string",
31
+ "enum": [
32
+ "before_wait",
33
+ "after_wait"
34
+ ]
35
+ },
36
+ "snapshotProblem": {
37
+ "anyOf": [
38
+ {
39
+ "type": "string",
40
+ "enum": [
41
+ "snapshot_unavailable"
42
+ ]
43
+ },
44
+ {
45
+ "type": "null"
46
+ }
47
+ ],
48
+ "description": "A failed final read leaves the explicitly labelled initial snapshot, never invented current state."
49
+ },
50
+ "nextSeq": {
51
+ "type": "integer",
52
+ "minimum": 0,
53
+ "maximum": 9007199254740991,
54
+ "description": "Last returned event seq, or afterSeq when none was returned. It never advances over an unreturned event."
55
+ },
56
+ "events": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "properties": {
61
+ "seq": {
62
+ "type": "integer",
63
+ "minimum": 0,
64
+ "maximum": 9007199254740991
65
+ },
66
+ "event": {
67
+ "type": "object",
68
+ "properties": {
69
+ "seq": {
70
+ "type": "integer",
71
+ "exclusiveMinimum": 0,
72
+ "description": "Monotonic per-run sequence stamped at emit time; the durable SSE cursor and snapshot fence. Optional only for pre-v0.8.0 artifacts."
73
+ },
74
+ "ts": {
75
+ "type": "string",
76
+ "description": "Event timestamp."
77
+ },
78
+ "run_id": {
79
+ "type": "string",
80
+ "minLength": 1,
81
+ "description": "Run the event belongs to."
82
+ },
83
+ "task_id": {
84
+ "type": "string",
85
+ "minLength": 1,
86
+ "description": "Task the run belongs to."
87
+ },
88
+ "thread_id": {
89
+ "type": "string",
90
+ "minLength": 1,
91
+ "description": "Thread this run is a turn of, when any."
92
+ },
93
+ "type": {
94
+ "type": "string",
95
+ "enum": [
96
+ "run.created",
97
+ "task.contract.created",
98
+ "context.pack.created",
99
+ "project.git.initialized",
100
+ "project.claude_bridge.created",
101
+ "budget.lease.created",
102
+ "budget.observation",
103
+ "budget.cash",
104
+ "policy.web.upgraded",
105
+ "harness.started",
106
+ "harness.event",
107
+ "harness.completed",
108
+ "route.fallback.started",
109
+ "route.fallback.completed",
110
+ "route.fallback.exhausted",
111
+ "route.transient.detected",
112
+ "route.transient.retry_scheduled",
113
+ "route.profile.headroom_exceeded",
114
+ "route.profile.rotated",
115
+ "route.profile.rotation_exhausted",
116
+ "route.profile.credential_unusable",
117
+ "route.account.pool_selected",
118
+ "route.account.lane_switch",
119
+ "route.account.pool_exhausted",
120
+ "route.transient.exhausted",
121
+ "route.fallback.auth_switched",
122
+ "route.primary.diverged",
123
+ "route.pool.degraded",
124
+ "session.continuity",
125
+ "interaction.requested",
126
+ "interaction.answered",
127
+ "interaction.timeout",
128
+ "interaction.answer_discarded",
129
+ "interaction.withdrawn",
130
+ "message.accepted",
131
+ "message.delivered",
132
+ "message.refused",
133
+ "plan.progress",
134
+ "plan.questions",
135
+ "plan.brief.materialized",
136
+ "council.started",
137
+ "council.draft",
138
+ "council.member.failed",
139
+ "council.merged",
140
+ "budget.quota_pressure",
141
+ "delegation.belt.unavailable",
142
+ "delegation.belt.degraded",
143
+ "output.ready",
144
+ "gate.started",
145
+ "gate.completed",
146
+ "review.preflight",
147
+ "review.started",
148
+ "review.skipped",
149
+ "reviewer.started",
150
+ "reviewer.first_event",
151
+ "reviewer.auth_switched",
152
+ "reviewer.completed",
153
+ "reviewer.timed_out",
154
+ "reviewer.failed",
155
+ "finding.revalidated",
156
+ "synthesis.started",
157
+ "arbitration.completed",
158
+ "work_product.emitted",
159
+ "work_product.adopted",
160
+ "control.requested",
161
+ "control.applied",
162
+ "control.rejected",
163
+ "run.blocked",
164
+ "run.completed",
165
+ "run.failed",
166
+ "run.continuation",
167
+ "run.continuation.denied",
168
+ "run.continuity",
169
+ "workspace.retained"
170
+ ],
171
+ "description": "Type of an append-only run event, covering run lifecycle, contract/context creation, budget, routing fallbacks, harness activity, interactions, gates, review, arbitration, work products, and control verbs."
172
+ },
173
+ "payload": {
174
+ "type": "object",
175
+ "additionalProperties": {},
176
+ "default": {},
177
+ "description": "Event-type-specific payload."
178
+ }
179
+ },
180
+ "required": [
181
+ "ts",
182
+ "run_id",
183
+ "task_id",
184
+ "type"
185
+ ],
186
+ "additionalProperties": false,
187
+ "description": "Append-only run event record (one JSONL line in the run's event log)."
188
+ }
189
+ },
190
+ "required": [
191
+ "seq",
192
+ "event"
193
+ ],
194
+ "additionalProperties": false
195
+ },
196
+ "maxItems": 200,
197
+ "description": "Ordered new events, at most 65536 UTF-8 JSON bytes including envelopes. Legacy events retain their body and use the stream id as seq."
198
+ },
199
+ "eventOmission": {
200
+ "anyOf": [
201
+ {
202
+ "type": "string",
203
+ "enum": [
204
+ "event_limit",
205
+ "byte_limit",
206
+ "oversized_frame",
207
+ "invalid_event",
208
+ "stream_ended"
209
+ ]
210
+ },
211
+ {
212
+ "type": "null"
213
+ }
214
+ ],
215
+ "description": "Why the page stopped early: event_limit or byte_limit (more events may follow; resume with nextSeq), oversized_frame (the next frame exceeds the 131072-byte stream frame cap), invalid_event (the next frame failed validation and is never skipped), stream_ended (the stream, which ends only for a terminal run, served nothing after nextSeq although snapshotSeq is higher, such as a last line left unterminated by a crash; nothing was skipped, and the same call returns the same page until the log changes, so stop there). Null means no limit was reached, not that replay is exhausted."
216
+ },
217
+ "oversizedEvent": {
218
+ "anyOf": [
219
+ {
220
+ "type": "object",
221
+ "properties": {
222
+ "seq": {
223
+ "type": "integer",
224
+ "minimum": 0,
225
+ "maximum": 9007199254740991,
226
+ "description": "Durable seq of the next unread event."
227
+ },
228
+ "type": {
229
+ "type": "string",
230
+ "description": "Event type the daemon stream names for it."
231
+ }
232
+ },
233
+ "required": [
234
+ "seq",
235
+ "type"
236
+ ],
237
+ "additionalProperties": false
238
+ },
239
+ {
240
+ "type": "null"
241
+ }
242
+ ],
243
+ "description": "The next unread event after nextSeq cannot fit one page. Read its exact bytes in parts with claudexor_run_event_read, then resume with afterSeq set to its seq. Null otherwise."
244
+ },
245
+ "pendingInteractions": {
246
+ "type": "array",
247
+ "items": {
248
+ "type": "object",
249
+ "properties": {
250
+ "interactionId": {
251
+ "type": "string",
252
+ "minLength": 1,
253
+ "description": "Interaction id used to answer."
254
+ },
255
+ "runId": {
256
+ "type": "string",
257
+ "minLength": 1,
258
+ "description": "Run the interaction belongs to."
259
+ },
260
+ "attemptId": {
261
+ "type": [
262
+ "string",
263
+ "null"
264
+ ],
265
+ "default": null,
266
+ "description": "Attempt the interaction was raised in, when known."
267
+ },
268
+ "harnessId": {
269
+ "type": [
270
+ "string",
271
+ "null"
272
+ ],
273
+ "default": null,
274
+ "description": "Harness that raised the interaction."
275
+ },
276
+ "sourceTool": {
277
+ "type": [
278
+ "string",
279
+ "null"
280
+ ],
281
+ "default": null,
282
+ "description": "Native tool that raised the request."
283
+ },
284
+ "questions": {
285
+ "type": "array",
286
+ "items": {
287
+ "type": "object",
288
+ "properties": {
289
+ "id": {
290
+ "type": "string",
291
+ "minLength": 1,
292
+ "description": "Question id."
293
+ },
294
+ "question": {
295
+ "type": "string",
296
+ "description": "The question text."
297
+ },
298
+ "header": {
299
+ "type": [
300
+ "string",
301
+ "null"
302
+ ],
303
+ "default": null,
304
+ "description": "Short chip/header text some harnesses attach to a question."
305
+ },
306
+ "options": {
307
+ "type": "array",
308
+ "items": {
309
+ "type": "object",
310
+ "properties": {
311
+ "label": {
312
+ "type": "string",
313
+ "description": "Option label shown to the user."
314
+ },
315
+ "description": {
316
+ "type": [
317
+ "string",
318
+ "null"
319
+ ],
320
+ "default": null,
321
+ "description": "Optional longer explanation of the option."
322
+ }
323
+ },
324
+ "required": [
325
+ "label"
326
+ ],
327
+ "additionalProperties": false,
328
+ "description": "One multiple-choice option of an interactive question."
329
+ },
330
+ "default": [],
331
+ "description": "Selectable options; empty for free-text-only questions."
332
+ },
333
+ "multi_select": {
334
+ "type": "boolean",
335
+ "default": false,
336
+ "description": "Whether multiple options may be selected."
337
+ }
338
+ },
339
+ "required": [
340
+ "id",
341
+ "question"
342
+ ],
343
+ "additionalProperties": false,
344
+ "description": "One question of an interactive user-input request."
345
+ },
346
+ "default": [],
347
+ "description": "Questions awaiting answers."
348
+ },
349
+ "requestedAt": {
350
+ "type": "string",
351
+ "description": "When the interaction was requested."
352
+ },
353
+ "timeoutAt": {
354
+ "type": [
355
+ "string",
356
+ "null"
357
+ ],
358
+ "default": null,
359
+ "description": "When the interaction times out into a benign decline; null = no timeout."
360
+ }
361
+ },
362
+ "required": [
363
+ "interactionId",
364
+ "runId",
365
+ "requestedAt"
366
+ ],
367
+ "additionalProperties": false,
368
+ "description": "A live interactive question awaiting the user's answer (snapshot projection)."
369
+ },
370
+ "description": "Current snapshot's pending questions, bounded to 32768 UTF-8 JSON bytes; claudexor_run_interactions returns complete bodies. They never hold back events."
371
+ },
372
+ "pendingInteractionCount": {
373
+ "$ref": "#/definitions/McpRunWaitResult/properties/events/items/properties/seq"
374
+ },
375
+ "omittedInteractions": {
376
+ "$ref": "#/definitions/McpRunWaitResult/properties/events/items/properties/seq"
377
+ },
378
+ "wakeReason": {
379
+ "type": "string",
380
+ "enum": [
381
+ "events",
382
+ "interactions",
383
+ "terminal",
384
+ "timeout",
385
+ "aborted",
386
+ "disconnected"
387
+ ],
388
+ "description": "Why this observation returned, by precedence: aborted (this read was cancelled; the worker continues), terminal (the run is terminal; events may still follow nextSeq unless eventOmission is stream_ended), interactions (this page includes a question event), events (event mode, a completed zero-wait page, or a page, even an empty one, stopped by event_limit, byte_limit, oversized_frame or invalid_event), timeout (waitMs elapsed, possibly with a partial batch), disconnected (the stream ended early; never completion)."
389
+ }
390
+ },
391
+ "required": [
392
+ "runId",
393
+ "status",
394
+ "snapshotSeq",
395
+ "snapshotPhase",
396
+ "snapshotProblem",
397
+ "nextSeq",
398
+ "events",
399
+ "eventOmission",
400
+ "oversizedEvent",
401
+ "pendingInteractions",
402
+ "pendingInteractionCount",
403
+ "omittedInteractions",
404
+ "wakeReason"
405
+ ],
406
+ "additionalProperties": false,
407
+ "description": "Read-only run observation, at most 131072 UTF-8 JSON bytes: at most two snapshot reads and one stream subscription, no automatic reconnect or worker cancellation. Events already available at the snapshot fence are returned before any wait, whether or not a question is pending. Resume with nextSeq."
408
+ }
409
+ },
410
+ "$schema": "http://json-schema.org/draft-07/schema#"
411
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudexor/schema",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "license": "MIT",
5
5
  "description": "Single source of truth for all Claudexor data shapes (Zod + generated JSON Schema).",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "zod": "^4.6.5",
22
22
  "zod-to-json-schema": "^3.24.1",
23
- "@claudexor/util": "4.3.0"
23
+ "@claudexor/util": "4.4.0"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",