@claudexor/schema 4.3.1 → 4.5.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 (65) hide show
  1. package/dist/account-routing-evidence.d.ts +282 -0
  2. package/dist/account-routing-evidence.d.ts.map +1 -1
  3. package/dist/account-routing-evidence.js +26 -1
  4. package/dist/account-routing-evidence.js.map +1 -1
  5. package/dist/config.d.ts +2 -2
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/config.js +2 -2
  8. package/dist/config.js.map +1 -1
  9. package/dist/control-gc.d.ts +113 -0
  10. package/dist/control-gc.d.ts.map +1 -1
  11. package/dist/control-gc.js +28 -1
  12. package/dist/control-gc.js.map +1 -1
  13. package/dist/control-run-event-part.d.ts +53 -0
  14. package/dist/control-run-event-part.d.ts.map +1 -0
  15. package/dist/control-run-event-part.js +47 -0
  16. package/dist/control-run-event-part.js.map +1 -0
  17. package/dist/daemon-status.d.ts +327 -0
  18. package/dist/daemon-status.d.ts.map +1 -1
  19. package/dist/daemon-status.js +35 -0
  20. package/dist/daemon-status.js.map +1 -1
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +2 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/mcp-run-result.d.ts +251 -0
  26. package/dist/mcp-run-result.d.ts.map +1 -1
  27. package/dist/mcp-run-result.js +26 -2
  28. package/dist/mcp-run-result.js.map +1 -1
  29. package/dist/mcp-run-wait.d.ts +269 -0
  30. package/dist/mcp-run-wait.d.ts.map +1 -0
  31. package/dist/mcp-run-wait.js +73 -0
  32. package/dist/mcp-run-wait.js.map +1 -0
  33. package/dist/model-operation.d.ts +205 -0
  34. package/dist/model-operation.d.ts.map +1 -1
  35. package/dist/model-operation.js +27 -1
  36. package/dist/model-operation.js.map +1 -1
  37. package/dist/operation.d.ts +5 -0
  38. package/dist/operation.d.ts.map +1 -1
  39. package/dist/operation.js +7 -0
  40. package/dist/operation.js.map +1 -1
  41. package/dist/store-status.d.ts +10 -0
  42. package/dist/store-status.d.ts.map +1 -1
  43. package/dist/store-status.js +8 -0
  44. package/dist/store-status.js.map +1 -1
  45. package/generated/ControlAccountRoutingEvidenceResponse.schema.json +67 -1
  46. package/generated/ControlDaemonStatus.schema.json +174 -6
  47. package/generated/ControlGcReceipt.schema.json +81 -1
  48. package/generated/ControlGcRequest.schema.json +4 -0
  49. package/generated/ControlHandshakeResponse.schema.json +5 -0
  50. package/generated/ControlModelAccountCatalogResponse.schema.json +4 -0
  51. package/generated/ControlModelCatalogQueryResponse.schema.json +4 -0
  52. package/generated/ControlModelCatalogResponse.schema.json +4 -0
  53. package/generated/ControlModelOperationDetail.schema.json +54 -0
  54. package/generated/ControlRunEventPart.schema.json +140 -0
  55. package/generated/GlobalConfig.schema.json +1 -1
  56. package/generated/ImageCallRequest.schema.json +1 -1
  57. package/generated/McpAccountsToolResult.schema.json +66 -0
  58. package/generated/McpRunEventReadInput.schema.json +41 -0
  59. package/generated/McpRunHandleResult.schema.json +382 -0
  60. package/generated/McpRunToolResult.schema.json +10 -2
  61. package/generated/McpRunWaitInput.schema.json +50 -0
  62. package/generated/McpRunWaitResult.schema.json +411 -0
  63. package/generated/ModelCallRequest.schema.json +5 -1
  64. package/generated/ModelCallResult.schema.json +59 -5
  65. package/package.json +2 -2
@@ -0,0 +1,269 @@
1
+ import { z } from "zod/v3";
2
+ export declare const MCP_RUN_WAIT_EVENT_BYTES = 65536;
3
+ export declare const MCP_RUN_WAIT_INTERACTION_BYTES = 32768;
4
+ export declare const MCP_RUN_WAIT_RESULT_BYTES = 131072;
5
+ export declare const McpRunWaitInput: z.ZodObject<{
6
+ runId: z.ZodString;
7
+ afterSeq: z.ZodDefault<z.ZodNumber>;
8
+ waitMs: z.ZodDefault<z.ZodNumber>;
9
+ maxEvents: z.ZodDefault<z.ZodNumber>;
10
+ wake: z.ZodDefault<z.ZodEnum<["batch", "event"]>>;
11
+ }, "strict", z.ZodTypeAny, {
12
+ runId: string;
13
+ afterSeq: number;
14
+ waitMs: number;
15
+ maxEvents: number;
16
+ wake: "batch" | "event";
17
+ }, {
18
+ runId: string;
19
+ afterSeq?: number | undefined;
20
+ waitMs?: number | undefined;
21
+ maxEvents?: number | undefined;
22
+ wake?: "batch" | "event" | undefined;
23
+ }>;
24
+ export type McpRunWaitInput = z.infer<typeof McpRunWaitInput>;
25
+ export declare const McpRunWaitResult: z.ZodObject<{
26
+ runId: z.ZodString;
27
+ status: z.ZodEnum<["queued", "running", "succeeded", "failed", "cancelled", "interrupted"]>;
28
+ snapshotSeq: z.ZodNumber;
29
+ snapshotPhase: z.ZodEnum<["before_wait", "after_wait"]>;
30
+ snapshotProblem: z.ZodNullable<z.ZodEnum<["snapshot_unavailable"]>>;
31
+ nextSeq: z.ZodNumber;
32
+ events: z.ZodArray<z.ZodObject<{
33
+ seq: z.ZodNumber;
34
+ event: z.ZodObject<{
35
+ seq: z.ZodOptional<z.ZodNumber>;
36
+ ts: z.ZodString;
37
+ run_id: z.ZodString;
38
+ task_id: z.ZodString;
39
+ thread_id: z.ZodOptional<z.ZodString>;
40
+ type: z.ZodEnum<["run.created", "task.contract.created", "context.pack.created", "project.git.initialized", "project.claude_bridge.created", "budget.lease.created", "budget.observation", "budget.cash", "policy.web.upgraded", "harness.started", "harness.event", "harness.completed", "route.fallback.started", "route.fallback.completed", "route.fallback.exhausted", "route.transient.detected", "route.transient.retry_scheduled", "route.profile.headroom_exceeded", "route.profile.rotated", "route.profile.rotation_exhausted", "route.profile.credential_unusable", "route.account.pool_selected", "route.account.lane_switch", "route.account.pool_exhausted", "route.transient.exhausted", "route.fallback.auth_switched", "route.primary.diverged", "route.pool.degraded", "session.continuity", "interaction.requested", "interaction.answered", "interaction.timeout", "interaction.answer_discarded", "interaction.withdrawn", "message.accepted", "message.delivered", "message.refused", "plan.progress", "plan.questions", "plan.brief.materialized", "council.started", "council.draft", "council.member.failed", "council.merged", "budget.quota_pressure", "delegation.belt.unavailable", "delegation.belt.degraded", "output.ready", "gate.started", "gate.completed", "review.preflight", "review.started", "review.skipped", "reviewer.started", "reviewer.first_event", "reviewer.auth_switched", "reviewer.completed", "reviewer.timed_out", "reviewer.failed", "finding.revalidated", "synthesis.started", "arbitration.completed", "work_product.emitted", "work_product.adopted", "control.requested", "control.applied", "control.rejected", "run.blocked", "run.completed", "run.failed", "run.continuation", "run.continuation.denied", "run.continuity", "workspace.retained"]>;
41
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ seq?: number | undefined;
44
+ ts: string;
45
+ run_id: string;
46
+ task_id: string;
47
+ thread_id?: string | undefined;
48
+ type: "arbitration.completed" | "budget.cash" | "budget.lease.created" | "budget.observation" | "budget.quota_pressure" | "context.pack.created" | "control.applied" | "control.rejected" | "control.requested" | "council.draft" | "council.member.failed" | "council.merged" | "council.started" | "delegation.belt.degraded" | "delegation.belt.unavailable" | "finding.revalidated" | "gate.completed" | "gate.started" | "harness.completed" | "harness.event" | "harness.started" | "interaction.answer_discarded" | "interaction.answered" | "interaction.requested" | "interaction.timeout" | "interaction.withdrawn" | "message.accepted" | "message.delivered" | "message.refused" | "output.ready" | "plan.brief.materialized" | "plan.progress" | "plan.questions" | "policy.web.upgraded" | "project.claude_bridge.created" | "project.git.initialized" | "review.preflight" | "review.skipped" | "review.started" | "reviewer.auth_switched" | "reviewer.completed" | "reviewer.failed" | "reviewer.first_event" | "reviewer.started" | "reviewer.timed_out" | "route.account.lane_switch" | "route.account.pool_exhausted" | "route.account.pool_selected" | "route.fallback.auth_switched" | "route.fallback.completed" | "route.fallback.exhausted" | "route.fallback.started" | "route.pool.degraded" | "route.primary.diverged" | "route.profile.credential_unusable" | "route.profile.headroom_exceeded" | "route.profile.rotated" | "route.profile.rotation_exhausted" | "route.transient.detected" | "route.transient.exhausted" | "route.transient.retry_scheduled" | "run.blocked" | "run.completed" | "run.continuation" | "run.continuation.denied" | "run.continuity" | "run.created" | "run.failed" | "session.continuity" | "synthesis.started" | "task.contract.created" | "work_product.adopted" | "work_product.emitted" | "workspace.retained";
49
+ payload: Record<string, unknown>;
50
+ }, {
51
+ seq?: number | undefined;
52
+ ts: string;
53
+ run_id: string;
54
+ task_id: string;
55
+ thread_id?: string | undefined;
56
+ type: "arbitration.completed" | "budget.cash" | "budget.lease.created" | "budget.observation" | "budget.quota_pressure" | "context.pack.created" | "control.applied" | "control.rejected" | "control.requested" | "council.draft" | "council.member.failed" | "council.merged" | "council.started" | "delegation.belt.degraded" | "delegation.belt.unavailable" | "finding.revalidated" | "gate.completed" | "gate.started" | "harness.completed" | "harness.event" | "harness.started" | "interaction.answer_discarded" | "interaction.answered" | "interaction.requested" | "interaction.timeout" | "interaction.withdrawn" | "message.accepted" | "message.delivered" | "message.refused" | "output.ready" | "plan.brief.materialized" | "plan.progress" | "plan.questions" | "policy.web.upgraded" | "project.claude_bridge.created" | "project.git.initialized" | "review.preflight" | "review.skipped" | "review.started" | "reviewer.auth_switched" | "reviewer.completed" | "reviewer.failed" | "reviewer.first_event" | "reviewer.started" | "reviewer.timed_out" | "route.account.lane_switch" | "route.account.pool_exhausted" | "route.account.pool_selected" | "route.fallback.auth_switched" | "route.fallback.completed" | "route.fallback.exhausted" | "route.fallback.started" | "route.pool.degraded" | "route.primary.diverged" | "route.profile.credential_unusable" | "route.profile.headroom_exceeded" | "route.profile.rotated" | "route.profile.rotation_exhausted" | "route.transient.detected" | "route.transient.exhausted" | "route.transient.retry_scheduled" | "run.blocked" | "run.completed" | "run.continuation" | "run.continuation.denied" | "run.continuity" | "run.created" | "run.failed" | "session.continuity" | "synthesis.started" | "task.contract.created" | "work_product.adopted" | "work_product.emitted" | "workspace.retained";
57
+ payload?: Record<string, unknown> | undefined;
58
+ }>;
59
+ }, "strict", z.ZodTypeAny, {
60
+ seq: number;
61
+ event: {
62
+ seq?: number | undefined;
63
+ ts: string;
64
+ run_id: string;
65
+ task_id: string;
66
+ thread_id?: string | undefined;
67
+ type: "arbitration.completed" | "budget.cash" | "budget.lease.created" | "budget.observation" | "budget.quota_pressure" | "context.pack.created" | "control.applied" | "control.rejected" | "control.requested" | "council.draft" | "council.member.failed" | "council.merged" | "council.started" | "delegation.belt.degraded" | "delegation.belt.unavailable" | "finding.revalidated" | "gate.completed" | "gate.started" | "harness.completed" | "harness.event" | "harness.started" | "interaction.answer_discarded" | "interaction.answered" | "interaction.requested" | "interaction.timeout" | "interaction.withdrawn" | "message.accepted" | "message.delivered" | "message.refused" | "output.ready" | "plan.brief.materialized" | "plan.progress" | "plan.questions" | "policy.web.upgraded" | "project.claude_bridge.created" | "project.git.initialized" | "review.preflight" | "review.skipped" | "review.started" | "reviewer.auth_switched" | "reviewer.completed" | "reviewer.failed" | "reviewer.first_event" | "reviewer.started" | "reviewer.timed_out" | "route.account.lane_switch" | "route.account.pool_exhausted" | "route.account.pool_selected" | "route.fallback.auth_switched" | "route.fallback.completed" | "route.fallback.exhausted" | "route.fallback.started" | "route.pool.degraded" | "route.primary.diverged" | "route.profile.credential_unusable" | "route.profile.headroom_exceeded" | "route.profile.rotated" | "route.profile.rotation_exhausted" | "route.transient.detected" | "route.transient.exhausted" | "route.transient.retry_scheduled" | "run.blocked" | "run.completed" | "run.continuation" | "run.continuation.denied" | "run.continuity" | "run.created" | "run.failed" | "session.continuity" | "synthesis.started" | "task.contract.created" | "work_product.adopted" | "work_product.emitted" | "workspace.retained";
68
+ payload: Record<string, unknown>;
69
+ };
70
+ }, {
71
+ seq: number;
72
+ event: {
73
+ seq?: number | undefined;
74
+ ts: string;
75
+ run_id: string;
76
+ task_id: string;
77
+ thread_id?: string | undefined;
78
+ type: "arbitration.completed" | "budget.cash" | "budget.lease.created" | "budget.observation" | "budget.quota_pressure" | "context.pack.created" | "control.applied" | "control.rejected" | "control.requested" | "council.draft" | "council.member.failed" | "council.merged" | "council.started" | "delegation.belt.degraded" | "delegation.belt.unavailable" | "finding.revalidated" | "gate.completed" | "gate.started" | "harness.completed" | "harness.event" | "harness.started" | "interaction.answer_discarded" | "interaction.answered" | "interaction.requested" | "interaction.timeout" | "interaction.withdrawn" | "message.accepted" | "message.delivered" | "message.refused" | "output.ready" | "plan.brief.materialized" | "plan.progress" | "plan.questions" | "policy.web.upgraded" | "project.claude_bridge.created" | "project.git.initialized" | "review.preflight" | "review.skipped" | "review.started" | "reviewer.auth_switched" | "reviewer.completed" | "reviewer.failed" | "reviewer.first_event" | "reviewer.started" | "reviewer.timed_out" | "route.account.lane_switch" | "route.account.pool_exhausted" | "route.account.pool_selected" | "route.fallback.auth_switched" | "route.fallback.completed" | "route.fallback.exhausted" | "route.fallback.started" | "route.pool.degraded" | "route.primary.diverged" | "route.profile.credential_unusable" | "route.profile.headroom_exceeded" | "route.profile.rotated" | "route.profile.rotation_exhausted" | "route.transient.detected" | "route.transient.exhausted" | "route.transient.retry_scheduled" | "run.blocked" | "run.completed" | "run.continuation" | "run.continuation.denied" | "run.continuity" | "run.created" | "run.failed" | "session.continuity" | "synthesis.started" | "task.contract.created" | "work_product.adopted" | "work_product.emitted" | "workspace.retained";
79
+ payload?: Record<string, unknown> | undefined;
80
+ };
81
+ }>, "many">;
82
+ eventOmission: z.ZodNullable<z.ZodEnum<["event_limit", "byte_limit", "oversized_frame", "invalid_event", "stream_ended"]>>;
83
+ oversizedEvent: z.ZodNullable<z.ZodObject<{
84
+ seq: z.ZodNumber;
85
+ type: z.ZodString;
86
+ }, "strict", z.ZodTypeAny, {
87
+ seq: number;
88
+ type: string;
89
+ }, {
90
+ seq: number;
91
+ type: string;
92
+ }>>;
93
+ pendingInteractions: z.ZodArray<z.ZodObject<{
94
+ interactionId: z.ZodString;
95
+ runId: z.ZodString;
96
+ attemptId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
97
+ harnessId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
98
+ sourceTool: z.ZodDefault<z.ZodNullable<z.ZodString>>;
99
+ questions: z.ZodDefault<z.ZodArray<z.ZodObject<{
100
+ id: z.ZodString;
101
+ question: z.ZodString;
102
+ header: z.ZodDefault<z.ZodNullable<z.ZodString>>;
103
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
104
+ label: z.ZodString;
105
+ description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ label: string;
108
+ description: string | null;
109
+ }, {
110
+ label: string;
111
+ description?: string | null | undefined;
112
+ }>, "many">>;
113
+ multi_select: z.ZodDefault<z.ZodBoolean>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ id: string;
116
+ question: string;
117
+ header: string | null;
118
+ options: {
119
+ label: string;
120
+ description: string | null;
121
+ }[];
122
+ multi_select: boolean;
123
+ }, {
124
+ id: string;
125
+ question: string;
126
+ header?: string | null | undefined;
127
+ options?: {
128
+ label: string;
129
+ description?: string | null | undefined;
130
+ }[] | undefined;
131
+ multi_select?: boolean | undefined;
132
+ }>, "many">>;
133
+ requestedAt: z.ZodString;
134
+ timeoutAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ interactionId: string;
137
+ runId: string;
138
+ attemptId: string | null;
139
+ harnessId: string | null;
140
+ sourceTool: string | null;
141
+ questions: {
142
+ id: string;
143
+ question: string;
144
+ header: string | null;
145
+ options: {
146
+ label: string;
147
+ description: string | null;
148
+ }[];
149
+ multi_select: boolean;
150
+ }[];
151
+ requestedAt: string;
152
+ timeoutAt: string | null;
153
+ }, {
154
+ interactionId: string;
155
+ runId: string;
156
+ attemptId?: string | null | undefined;
157
+ harnessId?: string | null | undefined;
158
+ sourceTool?: string | null | undefined;
159
+ questions?: {
160
+ id: string;
161
+ question: string;
162
+ header?: string | null | undefined;
163
+ options?: {
164
+ label: string;
165
+ description?: string | null | undefined;
166
+ }[] | undefined;
167
+ multi_select?: boolean | undefined;
168
+ }[] | undefined;
169
+ requestedAt: string;
170
+ timeoutAt?: string | null | undefined;
171
+ }>, "many">;
172
+ pendingInteractionCount: z.ZodNumber;
173
+ omittedInteractions: z.ZodNumber;
174
+ wakeReason: z.ZodEnum<["events", "interactions", "terminal", "timeout", "aborted", "disconnected"]>;
175
+ }, "strict", z.ZodTypeAny, {
176
+ runId: string;
177
+ status: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded";
178
+ snapshotSeq: number;
179
+ snapshotPhase: "after_wait" | "before_wait";
180
+ snapshotProblem: "snapshot_unavailable" | null;
181
+ nextSeq: number;
182
+ events: {
183
+ seq: number;
184
+ event: {
185
+ seq?: number | undefined;
186
+ ts: string;
187
+ run_id: string;
188
+ task_id: string;
189
+ thread_id?: string | undefined;
190
+ type: "arbitration.completed" | "budget.cash" | "budget.lease.created" | "budget.observation" | "budget.quota_pressure" | "context.pack.created" | "control.applied" | "control.rejected" | "control.requested" | "council.draft" | "council.member.failed" | "council.merged" | "council.started" | "delegation.belt.degraded" | "delegation.belt.unavailable" | "finding.revalidated" | "gate.completed" | "gate.started" | "harness.completed" | "harness.event" | "harness.started" | "interaction.answer_discarded" | "interaction.answered" | "interaction.requested" | "interaction.timeout" | "interaction.withdrawn" | "message.accepted" | "message.delivered" | "message.refused" | "output.ready" | "plan.brief.materialized" | "plan.progress" | "plan.questions" | "policy.web.upgraded" | "project.claude_bridge.created" | "project.git.initialized" | "review.preflight" | "review.skipped" | "review.started" | "reviewer.auth_switched" | "reviewer.completed" | "reviewer.failed" | "reviewer.first_event" | "reviewer.started" | "reviewer.timed_out" | "route.account.lane_switch" | "route.account.pool_exhausted" | "route.account.pool_selected" | "route.fallback.auth_switched" | "route.fallback.completed" | "route.fallback.exhausted" | "route.fallback.started" | "route.pool.degraded" | "route.primary.diverged" | "route.profile.credential_unusable" | "route.profile.headroom_exceeded" | "route.profile.rotated" | "route.profile.rotation_exhausted" | "route.transient.detected" | "route.transient.exhausted" | "route.transient.retry_scheduled" | "run.blocked" | "run.completed" | "run.continuation" | "run.continuation.denied" | "run.continuity" | "run.created" | "run.failed" | "session.continuity" | "synthesis.started" | "task.contract.created" | "work_product.adopted" | "work_product.emitted" | "workspace.retained";
191
+ payload: Record<string, unknown>;
192
+ };
193
+ }[];
194
+ eventOmission: "byte_limit" | "event_limit" | "invalid_event" | "oversized_frame" | "stream_ended" | null;
195
+ oversizedEvent: {
196
+ seq: number;
197
+ type: string;
198
+ } | null;
199
+ pendingInteractions: {
200
+ interactionId: string;
201
+ runId: string;
202
+ attemptId: string | null;
203
+ harnessId: string | null;
204
+ sourceTool: string | null;
205
+ questions: {
206
+ id: string;
207
+ question: string;
208
+ header: string | null;
209
+ options: {
210
+ label: string;
211
+ description: string | null;
212
+ }[];
213
+ multi_select: boolean;
214
+ }[];
215
+ requestedAt: string;
216
+ timeoutAt: string | null;
217
+ }[];
218
+ pendingInteractionCount: number;
219
+ omittedInteractions: number;
220
+ wakeReason: "aborted" | "disconnected" | "events" | "interactions" | "terminal" | "timeout";
221
+ }, {
222
+ runId: string;
223
+ status: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded";
224
+ snapshotSeq: number;
225
+ snapshotPhase: "after_wait" | "before_wait";
226
+ snapshotProblem: "snapshot_unavailable" | null;
227
+ nextSeq: number;
228
+ events: {
229
+ seq: number;
230
+ event: {
231
+ seq?: number | undefined;
232
+ ts: string;
233
+ run_id: string;
234
+ task_id: string;
235
+ thread_id?: string | undefined;
236
+ type: "arbitration.completed" | "budget.cash" | "budget.lease.created" | "budget.observation" | "budget.quota_pressure" | "context.pack.created" | "control.applied" | "control.rejected" | "control.requested" | "council.draft" | "council.member.failed" | "council.merged" | "council.started" | "delegation.belt.degraded" | "delegation.belt.unavailable" | "finding.revalidated" | "gate.completed" | "gate.started" | "harness.completed" | "harness.event" | "harness.started" | "interaction.answer_discarded" | "interaction.answered" | "interaction.requested" | "interaction.timeout" | "interaction.withdrawn" | "message.accepted" | "message.delivered" | "message.refused" | "output.ready" | "plan.brief.materialized" | "plan.progress" | "plan.questions" | "policy.web.upgraded" | "project.claude_bridge.created" | "project.git.initialized" | "review.preflight" | "review.skipped" | "review.started" | "reviewer.auth_switched" | "reviewer.completed" | "reviewer.failed" | "reviewer.first_event" | "reviewer.started" | "reviewer.timed_out" | "route.account.lane_switch" | "route.account.pool_exhausted" | "route.account.pool_selected" | "route.fallback.auth_switched" | "route.fallback.completed" | "route.fallback.exhausted" | "route.fallback.started" | "route.pool.degraded" | "route.primary.diverged" | "route.profile.credential_unusable" | "route.profile.headroom_exceeded" | "route.profile.rotated" | "route.profile.rotation_exhausted" | "route.transient.detected" | "route.transient.exhausted" | "route.transient.retry_scheduled" | "run.blocked" | "run.completed" | "run.continuation" | "run.continuation.denied" | "run.continuity" | "run.created" | "run.failed" | "session.continuity" | "synthesis.started" | "task.contract.created" | "work_product.adopted" | "work_product.emitted" | "workspace.retained";
237
+ payload?: Record<string, unknown> | undefined;
238
+ };
239
+ }[];
240
+ eventOmission: "byte_limit" | "event_limit" | "invalid_event" | "oversized_frame" | "stream_ended" | null;
241
+ oversizedEvent: {
242
+ seq: number;
243
+ type: string;
244
+ } | null;
245
+ pendingInteractions: {
246
+ interactionId: string;
247
+ runId: string;
248
+ attemptId?: string | null | undefined;
249
+ harnessId?: string | null | undefined;
250
+ sourceTool?: string | null | undefined;
251
+ questions?: {
252
+ id: string;
253
+ question: string;
254
+ header?: string | null | undefined;
255
+ options?: {
256
+ label: string;
257
+ description?: string | null | undefined;
258
+ }[] | undefined;
259
+ multi_select?: boolean | undefined;
260
+ }[] | undefined;
261
+ requestedAt: string;
262
+ timeoutAt?: string | null | undefined;
263
+ }[];
264
+ pendingInteractionCount: number;
265
+ omittedInteractions: number;
266
+ wakeReason: "aborted" | "disconnected" | "events" | "interactions" | "terminal" | "timeout";
267
+ }>;
268
+ export type McpRunWaitResult = z.infer<typeof McpRunWaitResult>;
269
+ //# sourceMappingURL=mcp-run-wait.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-run-wait.d.ts","sourceRoot":"","sources":["../src/mcp-run-wait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAC/C,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,yBAAyB,SAAU,CAAC;AAIjD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;EA8BjB,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyD1B,CAAC;AACJ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { z } from "zod/v3";
2
+ import { ControlPendingInteraction, ControlRunState } from "./control.js";
3
+ import { RunEvent } from "./events.js";
4
+ export const MCP_RUN_WAIT_EVENT_BYTES = 65_536;
5
+ export const MCP_RUN_WAIT_INTERACTION_BYTES = 32_768;
6
+ export const MCP_RUN_WAIT_RESULT_BYTES = 131_072;
7
+ const sequence = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
8
+ export const McpRunWaitInput = z
9
+ .object({
10
+ runId: z
11
+ .string()
12
+ .trim()
13
+ .min(1)
14
+ .max(256)
15
+ .describe("Run id, or the job id of an accepted launch that may still be queued."),
16
+ afterSeq: sequence
17
+ .default(0)
18
+ .describe("Last durable event seq already consumed (the previous nextSeq), never snapshotSeq."),
19
+ waitMs: z
20
+ .number()
21
+ .int()
22
+ .min(0)
23
+ .max(50_000)
24
+ .default(25_000)
25
+ .describe("Bound of the event stage. Zero never waits for new events: it returns the bounded page already available at the snapshot fence, read within a separate 5s budget. Daemon discovery and each snapshot read have their own 5s budgets, so one call can take up to waitMs plus about 15s."),
26
+ maxEvents: z.number().int().min(1).max(200).default(50),
27
+ wake: z
28
+ .enum(["batch", "event"])
29
+ .default("batch")
30
+ .describe("batch (default): collect events until the page fills, it includes a question event (interaction.requested, also one written before the wait), the run ends, or waitMs elapses. event: return as soon as any event is available. A pending question whose event is not in the page is reported in both modes but never ends a wait by itself."),
31
+ })
32
+ .strict();
33
+ export const McpRunWaitResult = z
34
+ .object({
35
+ runId: z
36
+ .string()
37
+ .describe("Canonical run id; a queued job id converges to its run id once the run binds."),
38
+ status: ControlRunState,
39
+ snapshotSeq: sequence.describe("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."),
40
+ snapshotPhase: z.enum(["before_wait", "after_wait"]),
41
+ snapshotProblem: z
42
+ .enum(["snapshot_unavailable"])
43
+ .nullable()
44
+ .describe("A failed final read leaves the explicitly labelled initial snapshot, never invented current state."),
45
+ nextSeq: sequence.describe("Last returned event seq, or afterSeq when none was returned. It never advances over an unreturned event."),
46
+ events: z
47
+ .array(z.object({ seq: sequence, event: RunEvent }).strict())
48
+ .max(200)
49
+ .describe("Ordered new events, at most 65536 UTF-8 JSON bytes including envelopes. Legacy events retain their body and use the stream id as seq."),
50
+ eventOmission: z
51
+ .enum(["event_limit", "byte_limit", "oversized_frame", "invalid_event", "stream_ended"])
52
+ .nullable()
53
+ .describe("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."),
54
+ oversizedEvent: z
55
+ .object({
56
+ seq: sequence.describe("Durable seq of the next unread event."),
57
+ type: z.string().describe("Event type the daemon stream names for it."),
58
+ })
59
+ .strict()
60
+ .nullable()
61
+ .describe("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."),
62
+ pendingInteractions: z
63
+ .array(ControlPendingInteraction)
64
+ .describe("Current snapshot's pending questions, bounded to 32768 UTF-8 JSON bytes; claudexor_run_interactions returns complete bodies. They never hold back events."),
65
+ pendingInteractionCount: sequence,
66
+ omittedInteractions: sequence,
67
+ wakeReason: z
68
+ .enum(["events", "interactions", "terminal", "timeout", "aborted", "disconnected"])
69
+ .describe("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)."),
70
+ })
71
+ .strict()
72
+ .describe("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.");
73
+ //# sourceMappingURL=mcp-run-wait.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-run-wait.js","sourceRoot":"","sources":["../src/mcp-run-wait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAC/C,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;AACrD,MAAM,CAAC,MAAM,y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