stitchkit 0.68.11 → 0.69.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 (120) hide show
  1. package/README.md +30 -1
  2. package/dist/agent-runtime/coding-tool-contract.d.ts +155 -0
  3. package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -0
  4. package/dist/agent-runtime/coding-tool-files.d.ts +3 -0
  5. package/dist/agent-runtime/coding-tool-files.d.ts.map +1 -0
  6. package/dist/agent-runtime/coding-tool-paths.d.ts +19 -0
  7. package/dist/agent-runtime/coding-tool-paths.d.ts.map +1 -0
  8. package/dist/agent-runtime/coding-tool-search-patch.d.ts +3 -0
  9. package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -0
  10. package/dist/agent-runtime/coding-tool-shell.d.ts +3 -0
  11. package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -0
  12. package/dist/agent-runtime/coding-tools.d.ts +17 -0
  13. package/dist/agent-runtime/coding-tools.d.ts.map +1 -0
  14. package/dist/agent-runtime/compaction.d.ts +2 -0
  15. package/dist/agent-runtime/compaction.d.ts.map +1 -1
  16. package/dist/agent-runtime/contained-files.d.ts +31 -0
  17. package/dist/agent-runtime/contained-files.d.ts.map +1 -0
  18. package/dist/agent-runtime/control-schema.d.ts +1074 -0
  19. package/dist/agent-runtime/control-schema.d.ts.map +1 -0
  20. package/dist/agent-runtime/conversations.d.ts +128 -0
  21. package/dist/agent-runtime/conversations.d.ts.map +1 -0
  22. package/dist/agent-runtime/event-schema.d.ts +96 -0
  23. package/dist/agent-runtime/event-schema.d.ts.map +1 -1
  24. package/dist/agent-runtime/harness-contract.d.ts +169 -0
  25. package/dist/agent-runtime/harness-contract.d.ts.map +1 -0
  26. package/dist/agent-runtime/harness-control.d.ts +25 -0
  27. package/dist/agent-runtime/harness-control.d.ts.map +1 -0
  28. package/dist/agent-runtime/harness-file-resources.d.ts +33 -0
  29. package/dist/agent-runtime/harness-file-resources.d.ts.map +1 -0
  30. package/dist/agent-runtime/harness-resources.d.ts +5 -0
  31. package/dist/agent-runtime/harness-resources.d.ts.map +1 -0
  32. package/dist/agent-runtime/harness.d.ts +12 -0
  33. package/dist/agent-runtime/harness.d.ts.map +1 -0
  34. package/dist/agent-runtime/history.d.ts +2 -0
  35. package/dist/agent-runtime/history.d.ts.map +1 -1
  36. package/dist/agent-runtime/models.d.ts +199 -0
  37. package/dist/agent-runtime/models.d.ts.map +1 -1
  38. package/dist/agent-runtime/prompt.d.ts +2 -0
  39. package/dist/agent-runtime/prompt.d.ts.map +1 -1
  40. package/dist/agent-runtime/run-execution.d.ts.map +1 -1
  41. package/dist/agent-runtime/runtime.d.ts +11 -3
  42. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  43. package/dist/agent-runtime/schemas.d.ts +49 -0
  44. package/dist/agent-runtime/schemas.d.ts.map +1 -1
  45. package/dist/agent-runtime/sqlite.d.ts +2 -0
  46. package/dist/agent-runtime/sqlite.d.ts.map +1 -1
  47. package/dist/agent-runtime/store-driver.d.ts +61 -212
  48. package/dist/agent-runtime/store-driver.d.ts.map +1 -1
  49. package/dist/agent-runtime/store.d.ts +368 -1
  50. package/dist/agent-runtime/store.d.ts.map +1 -1
  51. package/dist/agent-runtime/terminal-commit.d.ts +12 -1
  52. package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
  53. package/dist/agent-runtime/terminal-status.d.ts +8 -0
  54. package/dist/agent-runtime/terminal-status.d.ts.map +1 -1
  55. package/dist/agent-runtime-browser.d.ts +1 -0
  56. package/dist/agent-runtime-browser.d.ts.map +1 -1
  57. package/dist/agent-runtime-browser.js +217 -1
  58. package/dist/agent-runtime-coding-tools.d.ts +2 -0
  59. package/dist/agent-runtime-coding-tools.d.ts.map +1 -0
  60. package/dist/agent-runtime-coding-tools.js +706 -0
  61. package/dist/agent-runtime-harness.d.ts +2 -0
  62. package/dist/agent-runtime-harness.d.ts.map +1 -0
  63. package/dist/agent-runtime-harness.js +700 -0
  64. package/dist/agent-runtime-openrouter.d.ts +14 -1
  65. package/dist/agent-runtime-openrouter.d.ts.map +1 -1
  66. package/dist/agent-runtime-openrouter.js +211 -0
  67. package/dist/agent-runtime-sqlite-bun.js +4 -3
  68. package/dist/agent-runtime-sqlite-node.js +4 -3
  69. package/dist/agent-runtime.d.ts +5 -3
  70. package/dist/agent-runtime.d.ts.map +1 -1
  71. package/dist/agent-runtime.js +106 -2580
  72. package/dist/application/diagnostic-journal-contract.d.ts +164 -0
  73. package/dist/application/diagnostic-journal-contract.d.ts.map +1 -0
  74. package/dist/application/diagnostic-journal-manager.d.ts +12 -0
  75. package/dist/application/diagnostic-journal-manager.d.ts.map +1 -0
  76. package/dist/application/diagnostic-journal-storage.d.ts +29 -0
  77. package/dist/application/diagnostic-journal-storage.d.ts.map +1 -0
  78. package/dist/application/diagnostic-journal.d.ts +11 -0
  79. package/dist/application/diagnostic-journal.d.ts.map +1 -0
  80. package/dist/application.d.ts +2 -0
  81. package/dist/application.d.ts.map +1 -1
  82. package/dist/application.js +561 -17
  83. package/dist/browser/socket-io.d.ts.map +1 -1
  84. package/dist/cli.js +8 -6
  85. package/dist/{index-8vpzxg55.js → index-10gbbbaa.js} +103 -2
  86. package/dist/index-3eqrkqhg.js +2565 -0
  87. package/dist/{index-hcx9yypn.js → index-444747ww.js} +7 -7
  88. package/dist/{index-hxh98zbm.js → index-d1jsvkyk.js} +1 -1
  89. package/dist/index-es0h4w26.js +63 -0
  90. package/dist/{index-grgvpbch.js → index-gqdfpv4n.js} +4 -2
  91. package/dist/{index-bt5179zb.js → index-h7ctj1kp.js} +5 -3
  92. package/dist/{index-y2ctppmg.js → index-h8vn1jcr.js} +7 -73
  93. package/dist/{index-hqza5nde.js → index-hsabxjz0.js} +78 -77
  94. package/dist/index-kg9xx84n.js +73 -0
  95. package/dist/{index-hb0mncmj.js → index-kxxyvkka.js} +2 -2
  96. package/dist/{index-2t6zt5cg.js → index-mbxds404.js} +7 -5
  97. package/dist/{index-f24xg2cw.js → index-p1be103g.js} +1 -1
  98. package/dist/{index-xyvxez9r.js → index-q7gdep2c.js} +5 -5
  99. package/dist/{index-t23p2b68.js → index-t4dpby6e.js} +1 -1
  100. package/dist/index-tg3m2ec5.js +157 -0
  101. package/dist/index-v3dpzpjw.js +92 -0
  102. package/dist/{index-eqqyd9v8.js → index-wwst0td5.js} +2 -46
  103. package/dist/{index-ysphyxax.js → index-x1th9s8c.js} +23 -2
  104. package/dist/index-xxsq3ca1.js +51 -0
  105. package/dist/{index-22tjt2rk.js → index-zh459sfj.js} +1 -1
  106. package/dist/index.js +51 -37
  107. package/dist/internal/ai-sdk-typed.d.ts +14 -0
  108. package/dist/internal/ai-sdk-typed.d.ts.map +1 -0
  109. package/dist/node.js +5 -5
  110. package/dist/observability/index.js +4 -4
  111. package/dist/realtime/request.d.ts +5 -0
  112. package/dist/realtime/request.d.ts.map +1 -1
  113. package/dist/remote.js +6 -6
  114. package/dist/server/index.js +9 -9
  115. package/dist/testing.js +5 -5
  116. package/dist/tool-invoker.js +6 -5
  117. package/dist/tools.js +21 -17
  118. package/llms-full.txt +342 -27
  119. package/package.json +10 -2
  120. package/dist/{index-pgsyp3xh.js → index-x18ndp4p.js} +3 -3
@@ -0,0 +1,1074 @@
1
+ import { z } from 'zod';
2
+ import { type AgentRuntimeEvent } from './event-schema.js';
3
+ import { type AgentSnapshot } from './schemas.js';
4
+ export declare const AgentControlRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5
+ schemaVersion: z.ZodLiteral<1>;
6
+ requestId: z.ZodString;
7
+ operation: z.ZodLiteral<"attach">;
8
+ conversationId: z.ZodString;
9
+ access: z.ZodEnum<{
10
+ control: "control";
11
+ observe: "observe";
12
+ }>;
13
+ }, z.core.$strict>, z.ZodObject<{
14
+ schemaVersion: z.ZodLiteral<1>;
15
+ requestId: z.ZodString;
16
+ operation: z.ZodLiteral<"detach">;
17
+ conversationId: z.ZodString;
18
+ }, z.core.$strict>, z.ZodObject<{
19
+ schemaVersion: z.ZodLiteral<1>;
20
+ requestId: z.ZodString;
21
+ operation: z.ZodLiteral<"snapshot">;
22
+ conversationId: z.ZodString;
23
+ }, z.core.$strict>, z.ZodObject<{
24
+ schemaVersion: z.ZodLiteral<1>;
25
+ requestId: z.ZodString;
26
+ operation: z.ZodLiteral<"submit">;
27
+ conversationId: z.ZodString;
28
+ idempotencyKey: z.ZodString;
29
+ context: z.ZodUnknown;
30
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
31
+ type: z.ZodLiteral<"text">;
32
+ text: z.ZodString;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ type: z.ZodLiteral<"reasoning">;
35
+ text: z.ZodString;
36
+ provider: z.ZodOptional<z.ZodObject<{
37
+ schemaVersion: z.ZodInt;
38
+ provider: z.ZodString;
39
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ type: z.ZodLiteral<"file">;
43
+ mediaType: z.ZodString;
44
+ reference: z.ZodString;
45
+ filename: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ type: z.ZodLiteral<"source">;
48
+ sourceId: z.ZodString;
49
+ url: z.ZodOptional<z.ZodURL>;
50
+ title: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ type: z.ZodLiteral<"tool-call">;
53
+ callId: z.ZodString;
54
+ toolName: z.ZodString;
55
+ input: z.ZodJSONSchema;
56
+ provider: z.ZodOptional<z.ZodObject<{
57
+ schemaVersion: z.ZodInt;
58
+ provider: z.ZodString;
59
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
60
+ }, z.core.$strip>>;
61
+ }, z.core.$strip>, z.ZodObject<{
62
+ type: z.ZodLiteral<"tool-result">;
63
+ callId: z.ZodString;
64
+ toolName: z.ZodString;
65
+ outcome: z.ZodEnum<{
66
+ error: "error";
67
+ interrupted: "interrupted";
68
+ success: "success";
69
+ }>;
70
+ output: z.ZodOptional<z.ZodJSONSchema>;
71
+ }, z.core.$strip>, z.ZodObject<{
72
+ type: z.ZodLiteral<"tool-approval-request">;
73
+ approvalId: z.ZodString;
74
+ callId: z.ZodString;
75
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
76
+ signature: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strip>, z.ZodObject<{
78
+ type: z.ZodLiteral<"tool-approval-response">;
79
+ approvalId: z.ZodString;
80
+ approved: z.ZodBoolean;
81
+ reason: z.ZodOptional<z.ZodString>;
82
+ }, z.core.$strip>, z.ZodObject<{
83
+ type: z.ZodLiteral<"provider">;
84
+ envelope: z.ZodObject<{
85
+ schemaVersion: z.ZodInt;
86
+ provider: z.ZodString;
87
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
88
+ }, z.core.$strip>;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ type: z.ZodLiteral<"control">;
91
+ reason: z.ZodEnum<{
92
+ "run-interrupted": "run-interrupted";
93
+ "stale-run": "stale-run";
94
+ }>;
95
+ }, z.core.$strip>], "type">>;
96
+ metadata: z.ZodOptional<z.ZodUnknown>;
97
+ }, z.core.$strict>, z.ZodObject<{
98
+ schemaVersion: z.ZodLiteral<1>;
99
+ requestId: z.ZodString;
100
+ operation: z.ZodLiteral<"interrupt">;
101
+ conversationId: z.ZodString;
102
+ runId: z.ZodString;
103
+ }, z.core.$strict>, z.ZodObject<{
104
+ schemaVersion: z.ZodLiteral<1>;
105
+ requestId: z.ZodString;
106
+ operation: z.ZodLiteral<"respond-approval">;
107
+ conversationId: z.ZodString;
108
+ approvalId: z.ZodString;
109
+ approved: z.ZodBoolean;
110
+ reason: z.ZodOptional<z.ZodString>;
111
+ context: z.ZodUnknown;
112
+ metadata: z.ZodOptional<z.ZodUnknown>;
113
+ }, z.core.$strict>], "operation">;
114
+ export type AgentControlRequest = z.infer<typeof AgentControlRequestSchema>;
115
+ export declare const AgentControlResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
116
+ schemaVersion: z.ZodLiteral<1>;
117
+ requestId: z.ZodString;
118
+ outcome: z.ZodLiteral<"ok">;
119
+ snapshot: z.ZodOptional<z.ZodObject<{
120
+ schemaVersion: z.ZodLiteral<1>;
121
+ conversationId: z.ZodString;
122
+ version: z.ZodInt;
123
+ messages: z.ZodArray<z.ZodObject<{
124
+ schemaVersion: z.ZodLiteral<1>;
125
+ id: z.ZodString;
126
+ conversationId: z.ZodString;
127
+ runId: z.ZodOptional<z.ZodString>;
128
+ role: z.ZodEnum<{
129
+ assistant: "assistant";
130
+ summary: "summary";
131
+ system: "system";
132
+ tool: "tool";
133
+ user: "user";
134
+ }>;
135
+ status: z.ZodEnum<{
136
+ committed: "committed";
137
+ completed: "completed";
138
+ failed: "failed";
139
+ interrupted: "interrupted";
140
+ streaming: "streaming";
141
+ superseded: "superseded";
142
+ }>;
143
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
144
+ type: z.ZodLiteral<"text">;
145
+ text: z.ZodString;
146
+ }, z.core.$strip>, z.ZodObject<{
147
+ type: z.ZodLiteral<"reasoning">;
148
+ text: z.ZodString;
149
+ provider: z.ZodOptional<z.ZodObject<{
150
+ schemaVersion: z.ZodInt;
151
+ provider: z.ZodString;
152
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
153
+ }, z.core.$strip>>;
154
+ }, z.core.$strip>, z.ZodObject<{
155
+ type: z.ZodLiteral<"file">;
156
+ mediaType: z.ZodString;
157
+ reference: z.ZodString;
158
+ filename: z.ZodOptional<z.ZodString>;
159
+ }, z.core.$strip>, z.ZodObject<{
160
+ type: z.ZodLiteral<"source">;
161
+ sourceId: z.ZodString;
162
+ url: z.ZodOptional<z.ZodURL>;
163
+ title: z.ZodOptional<z.ZodString>;
164
+ }, z.core.$strip>, z.ZodObject<{
165
+ type: z.ZodLiteral<"tool-call">;
166
+ callId: z.ZodString;
167
+ toolName: z.ZodString;
168
+ input: z.ZodJSONSchema;
169
+ provider: z.ZodOptional<z.ZodObject<{
170
+ schemaVersion: z.ZodInt;
171
+ provider: z.ZodString;
172
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
173
+ }, z.core.$strip>>;
174
+ }, z.core.$strip>, z.ZodObject<{
175
+ type: z.ZodLiteral<"tool-result">;
176
+ callId: z.ZodString;
177
+ toolName: z.ZodString;
178
+ outcome: z.ZodEnum<{
179
+ error: "error";
180
+ interrupted: "interrupted";
181
+ success: "success";
182
+ }>;
183
+ output: z.ZodOptional<z.ZodJSONSchema>;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ type: z.ZodLiteral<"tool-approval-request">;
186
+ approvalId: z.ZodString;
187
+ callId: z.ZodString;
188
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
189
+ signature: z.ZodOptional<z.ZodString>;
190
+ }, z.core.$strip>, z.ZodObject<{
191
+ type: z.ZodLiteral<"tool-approval-response">;
192
+ approvalId: z.ZodString;
193
+ approved: z.ZodBoolean;
194
+ reason: z.ZodOptional<z.ZodString>;
195
+ }, z.core.$strip>, z.ZodObject<{
196
+ type: z.ZodLiteral<"provider">;
197
+ envelope: z.ZodObject<{
198
+ schemaVersion: z.ZodInt;
199
+ provider: z.ZodString;
200
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
201
+ }, z.core.$strip>;
202
+ }, z.core.$strip>, z.ZodObject<{
203
+ type: z.ZodLiteral<"control">;
204
+ reason: z.ZodEnum<{
205
+ "run-interrupted": "run-interrupted";
206
+ "stale-run": "stale-run";
207
+ }>;
208
+ }, z.core.$strip>], "type">>;
209
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
210
+ createdAt: z.ZodISODateTime;
211
+ updatedAt: z.ZodISODateTime;
212
+ }, z.core.$strip>>;
213
+ runs: z.ZodArray<z.ZodObject<{
214
+ schemaVersion: z.ZodLiteral<1>;
215
+ id: z.ZodString;
216
+ conversationId: z.ZodString;
217
+ inputMessageIds: z.ZodArray<z.ZodString>;
218
+ assistantMessageId: z.ZodString;
219
+ state: z.ZodEnum<{
220
+ abandoned: "abandoned";
221
+ cancelled: "cancelled";
222
+ completed: "completed";
223
+ failed: "failed";
224
+ interrupt_requested: "interrupt_requested";
225
+ interrupted: "interrupted";
226
+ queued: "queued";
227
+ running: "running";
228
+ superseded: "superseded";
229
+ }>;
230
+ revision: z.ZodInt;
231
+ queuePriority: z.ZodOptional<z.ZodEnum<{
232
+ "interrupt-next": "interrupt-next";
233
+ }>>;
234
+ executionSequence: z.ZodOptional<z.ZodInt>;
235
+ ownerId: z.ZodOptional<z.ZodString>;
236
+ fencingToken: z.ZodOptional<z.ZodInt>;
237
+ terminalReason: z.ZodOptional<z.ZodEnum<{
238
+ abandoned: "abandoned";
239
+ absorbed: "absorbed";
240
+ cancelled: "cancelled";
241
+ context_overflow: "context_overflow";
242
+ interrupted: "interrupted";
243
+ policy_stop: "policy_stop";
244
+ provider_failure: "provider_failure";
245
+ provider_stop: "provider_stop";
246
+ shutdown: "shutdown";
247
+ success: "success";
248
+ superseded: "superseded";
249
+ timeout: "timeout";
250
+ }>>;
251
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
252
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
253
+ usage: z.ZodOptional<z.ZodObject<{
254
+ inputTokens: z.ZodObject<{
255
+ value: z.ZodOptional<z.ZodInt>;
256
+ provenance: z.ZodEnum<{
257
+ computed: "computed";
258
+ estimated: "estimated";
259
+ "provider-reported": "provider-reported";
260
+ unavailable: "unavailable";
261
+ }>;
262
+ }, z.core.$strip>;
263
+ outputTokens: z.ZodObject<{
264
+ value: z.ZodOptional<z.ZodInt>;
265
+ provenance: z.ZodEnum<{
266
+ computed: "computed";
267
+ estimated: "estimated";
268
+ "provider-reported": "provider-reported";
269
+ unavailable: "unavailable";
270
+ }>;
271
+ }, z.core.$strip>;
272
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
273
+ value: z.ZodOptional<z.ZodInt>;
274
+ provenance: z.ZodEnum<{
275
+ computed: "computed";
276
+ estimated: "estimated";
277
+ "provider-reported": "provider-reported";
278
+ unavailable: "unavailable";
279
+ }>;
280
+ }, z.core.$strip>>;
281
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
282
+ value: z.ZodOptional<z.ZodInt>;
283
+ provenance: z.ZodEnum<{
284
+ computed: "computed";
285
+ estimated: "estimated";
286
+ "provider-reported": "provider-reported";
287
+ unavailable: "unavailable";
288
+ }>;
289
+ }, z.core.$strip>>;
290
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
291
+ value: z.ZodOptional<z.ZodInt>;
292
+ provenance: z.ZodEnum<{
293
+ computed: "computed";
294
+ estimated: "estimated";
295
+ "provider-reported": "provider-reported";
296
+ unavailable: "unavailable";
297
+ }>;
298
+ }, z.core.$strip>>;
299
+ cost: z.ZodOptional<z.ZodObject<{
300
+ value: z.ZodOptional<z.ZodNumber>;
301
+ currency: z.ZodOptional<z.ZodString>;
302
+ provenance: z.ZodEnum<{
303
+ computed: "computed";
304
+ estimated: "estimated";
305
+ "provider-reported": "provider-reported";
306
+ unavailable: "unavailable";
307
+ }>;
308
+ }, z.core.$strip>>;
309
+ }, z.core.$strip>>;
310
+ createdAt: z.ZodISODateTime;
311
+ updatedAt: z.ZodISODateTime;
312
+ }, z.core.$strip>>;
313
+ }, z.core.$strip>>;
314
+ runId: z.ZodOptional<z.ZodString>;
315
+ }, z.core.$strict>, z.ZodObject<{
316
+ schemaVersion: z.ZodLiteral<1>;
317
+ requestId: z.ZodString;
318
+ outcome: z.ZodLiteral<"error">;
319
+ error: z.ZodObject<{
320
+ code: z.ZodString;
321
+ message: z.ZodString;
322
+ }, z.core.$strict>;
323
+ }, z.core.$strict>], "outcome">;
324
+ export type AgentControlResponse = z.infer<typeof AgentControlResponseSchema>;
325
+ export declare const AgentControlDeliverySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
326
+ schemaVersion: z.ZodLiteral<1>;
327
+ type: z.ZodLiteral<"event">;
328
+ event: z.ZodDiscriminatedUnion<[z.ZodObject<{
329
+ type: z.ZodLiteral<"admission">;
330
+ eventId: z.ZodString;
331
+ conversationId: z.ZodString;
332
+ runId: z.ZodString;
333
+ snapshotVersion: z.ZodInt;
334
+ input: z.ZodObject<{
335
+ schemaVersion: z.ZodLiteral<1>;
336
+ id: z.ZodString;
337
+ conversationId: z.ZodString;
338
+ runId: z.ZodOptional<z.ZodString>;
339
+ role: z.ZodEnum<{
340
+ assistant: "assistant";
341
+ summary: "summary";
342
+ system: "system";
343
+ tool: "tool";
344
+ user: "user";
345
+ }>;
346
+ status: z.ZodEnum<{
347
+ committed: "committed";
348
+ completed: "completed";
349
+ failed: "failed";
350
+ interrupted: "interrupted";
351
+ streaming: "streaming";
352
+ superseded: "superseded";
353
+ }>;
354
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
355
+ type: z.ZodLiteral<"text">;
356
+ text: z.ZodString;
357
+ }, z.core.$strip>, z.ZodObject<{
358
+ type: z.ZodLiteral<"reasoning">;
359
+ text: z.ZodString;
360
+ provider: z.ZodOptional<z.ZodObject<{
361
+ schemaVersion: z.ZodInt;
362
+ provider: z.ZodString;
363
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
364
+ }, z.core.$strip>>;
365
+ }, z.core.$strip>, z.ZodObject<{
366
+ type: z.ZodLiteral<"file">;
367
+ mediaType: z.ZodString;
368
+ reference: z.ZodString;
369
+ filename: z.ZodOptional<z.ZodString>;
370
+ }, z.core.$strip>, z.ZodObject<{
371
+ type: z.ZodLiteral<"source">;
372
+ sourceId: z.ZodString;
373
+ url: z.ZodOptional<z.ZodURL>;
374
+ title: z.ZodOptional<z.ZodString>;
375
+ }, z.core.$strip>, z.ZodObject<{
376
+ type: z.ZodLiteral<"tool-call">;
377
+ callId: z.ZodString;
378
+ toolName: z.ZodString;
379
+ input: z.ZodJSONSchema;
380
+ provider: z.ZodOptional<z.ZodObject<{
381
+ schemaVersion: z.ZodInt;
382
+ provider: z.ZodString;
383
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
384
+ }, z.core.$strip>>;
385
+ }, z.core.$strip>, z.ZodObject<{
386
+ type: z.ZodLiteral<"tool-result">;
387
+ callId: z.ZodString;
388
+ toolName: z.ZodString;
389
+ outcome: z.ZodEnum<{
390
+ error: "error";
391
+ interrupted: "interrupted";
392
+ success: "success";
393
+ }>;
394
+ output: z.ZodOptional<z.ZodJSONSchema>;
395
+ }, z.core.$strip>, z.ZodObject<{
396
+ type: z.ZodLiteral<"tool-approval-request">;
397
+ approvalId: z.ZodString;
398
+ callId: z.ZodString;
399
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
400
+ signature: z.ZodOptional<z.ZodString>;
401
+ }, z.core.$strip>, z.ZodObject<{
402
+ type: z.ZodLiteral<"tool-approval-response">;
403
+ approvalId: z.ZodString;
404
+ approved: z.ZodBoolean;
405
+ reason: z.ZodOptional<z.ZodString>;
406
+ }, z.core.$strip>, z.ZodObject<{
407
+ type: z.ZodLiteral<"provider">;
408
+ envelope: z.ZodObject<{
409
+ schemaVersion: z.ZodInt;
410
+ provider: z.ZodString;
411
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
412
+ }, z.core.$strip>;
413
+ }, z.core.$strip>, z.ZodObject<{
414
+ type: z.ZodLiteral<"control">;
415
+ reason: z.ZodEnum<{
416
+ "run-interrupted": "run-interrupted";
417
+ "stale-run": "stale-run";
418
+ }>;
419
+ }, z.core.$strip>], "type">>;
420
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
421
+ createdAt: z.ZodISODateTime;
422
+ updatedAt: z.ZodISODateTime;
423
+ }, z.core.$strip>;
424
+ run: z.ZodObject<{
425
+ schemaVersion: z.ZodLiteral<1>;
426
+ id: z.ZodString;
427
+ conversationId: z.ZodString;
428
+ inputMessageIds: z.ZodArray<z.ZodString>;
429
+ assistantMessageId: z.ZodString;
430
+ state: z.ZodEnum<{
431
+ abandoned: "abandoned";
432
+ cancelled: "cancelled";
433
+ completed: "completed";
434
+ failed: "failed";
435
+ interrupt_requested: "interrupt_requested";
436
+ interrupted: "interrupted";
437
+ queued: "queued";
438
+ running: "running";
439
+ superseded: "superseded";
440
+ }>;
441
+ revision: z.ZodInt;
442
+ queuePriority: z.ZodOptional<z.ZodEnum<{
443
+ "interrupt-next": "interrupt-next";
444
+ }>>;
445
+ executionSequence: z.ZodOptional<z.ZodInt>;
446
+ ownerId: z.ZodOptional<z.ZodString>;
447
+ fencingToken: z.ZodOptional<z.ZodInt>;
448
+ terminalReason: z.ZodOptional<z.ZodEnum<{
449
+ abandoned: "abandoned";
450
+ absorbed: "absorbed";
451
+ cancelled: "cancelled";
452
+ context_overflow: "context_overflow";
453
+ interrupted: "interrupted";
454
+ policy_stop: "policy_stop";
455
+ provider_failure: "provider_failure";
456
+ provider_stop: "provider_stop";
457
+ shutdown: "shutdown";
458
+ success: "success";
459
+ superseded: "superseded";
460
+ timeout: "timeout";
461
+ }>>;
462
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
463
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
464
+ usage: z.ZodOptional<z.ZodObject<{
465
+ inputTokens: z.ZodObject<{
466
+ value: z.ZodOptional<z.ZodInt>;
467
+ provenance: z.ZodEnum<{
468
+ computed: "computed";
469
+ estimated: "estimated";
470
+ "provider-reported": "provider-reported";
471
+ unavailable: "unavailable";
472
+ }>;
473
+ }, z.core.$strip>;
474
+ outputTokens: z.ZodObject<{
475
+ value: z.ZodOptional<z.ZodInt>;
476
+ provenance: z.ZodEnum<{
477
+ computed: "computed";
478
+ estimated: "estimated";
479
+ "provider-reported": "provider-reported";
480
+ unavailable: "unavailable";
481
+ }>;
482
+ }, z.core.$strip>;
483
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
484
+ value: z.ZodOptional<z.ZodInt>;
485
+ provenance: z.ZodEnum<{
486
+ computed: "computed";
487
+ estimated: "estimated";
488
+ "provider-reported": "provider-reported";
489
+ unavailable: "unavailable";
490
+ }>;
491
+ }, z.core.$strip>>;
492
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
493
+ value: z.ZodOptional<z.ZodInt>;
494
+ provenance: z.ZodEnum<{
495
+ computed: "computed";
496
+ estimated: "estimated";
497
+ "provider-reported": "provider-reported";
498
+ unavailable: "unavailable";
499
+ }>;
500
+ }, z.core.$strip>>;
501
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
502
+ value: z.ZodOptional<z.ZodInt>;
503
+ provenance: z.ZodEnum<{
504
+ computed: "computed";
505
+ estimated: "estimated";
506
+ "provider-reported": "provider-reported";
507
+ unavailable: "unavailable";
508
+ }>;
509
+ }, z.core.$strip>>;
510
+ cost: z.ZodOptional<z.ZodObject<{
511
+ value: z.ZodOptional<z.ZodNumber>;
512
+ currency: z.ZodOptional<z.ZodString>;
513
+ provenance: z.ZodEnum<{
514
+ computed: "computed";
515
+ estimated: "estimated";
516
+ "provider-reported": "provider-reported";
517
+ unavailable: "unavailable";
518
+ }>;
519
+ }, z.core.$strip>>;
520
+ }, z.core.$strip>>;
521
+ createdAt: z.ZodISODateTime;
522
+ updatedAt: z.ZodISODateTime;
523
+ }, z.core.$strip>;
524
+ assistant: z.ZodUnion<readonly [z.ZodObject<{
525
+ schemaVersion: z.ZodLiteral<1>;
526
+ id: z.ZodString;
527
+ conversationId: z.ZodString;
528
+ runId: z.ZodString;
529
+ status: z.ZodLiteral<"pending">;
530
+ createdAt: z.ZodISODateTime;
531
+ updatedAt: z.ZodISODateTime;
532
+ }, z.core.$strip>, z.ZodObject<{
533
+ schemaVersion: z.ZodLiteral<1>;
534
+ id: z.ZodString;
535
+ conversationId: z.ZodString;
536
+ runId: z.ZodOptional<z.ZodString>;
537
+ role: z.ZodEnum<{
538
+ assistant: "assistant";
539
+ summary: "summary";
540
+ system: "system";
541
+ tool: "tool";
542
+ user: "user";
543
+ }>;
544
+ status: z.ZodEnum<{
545
+ committed: "committed";
546
+ completed: "completed";
547
+ failed: "failed";
548
+ interrupted: "interrupted";
549
+ streaming: "streaming";
550
+ superseded: "superseded";
551
+ }>;
552
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
553
+ type: z.ZodLiteral<"text">;
554
+ text: z.ZodString;
555
+ }, z.core.$strip>, z.ZodObject<{
556
+ type: z.ZodLiteral<"reasoning">;
557
+ text: z.ZodString;
558
+ provider: z.ZodOptional<z.ZodObject<{
559
+ schemaVersion: z.ZodInt;
560
+ provider: z.ZodString;
561
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
562
+ }, z.core.$strip>>;
563
+ }, z.core.$strip>, z.ZodObject<{
564
+ type: z.ZodLiteral<"file">;
565
+ mediaType: z.ZodString;
566
+ reference: z.ZodString;
567
+ filename: z.ZodOptional<z.ZodString>;
568
+ }, z.core.$strip>, z.ZodObject<{
569
+ type: z.ZodLiteral<"source">;
570
+ sourceId: z.ZodString;
571
+ url: z.ZodOptional<z.ZodURL>;
572
+ title: z.ZodOptional<z.ZodString>;
573
+ }, z.core.$strip>, z.ZodObject<{
574
+ type: z.ZodLiteral<"tool-call">;
575
+ callId: z.ZodString;
576
+ toolName: z.ZodString;
577
+ input: z.ZodJSONSchema;
578
+ provider: z.ZodOptional<z.ZodObject<{
579
+ schemaVersion: z.ZodInt;
580
+ provider: z.ZodString;
581
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
582
+ }, z.core.$strip>>;
583
+ }, z.core.$strip>, z.ZodObject<{
584
+ type: z.ZodLiteral<"tool-result">;
585
+ callId: z.ZodString;
586
+ toolName: z.ZodString;
587
+ outcome: z.ZodEnum<{
588
+ error: "error";
589
+ interrupted: "interrupted";
590
+ success: "success";
591
+ }>;
592
+ output: z.ZodOptional<z.ZodJSONSchema>;
593
+ }, z.core.$strip>, z.ZodObject<{
594
+ type: z.ZodLiteral<"tool-approval-request">;
595
+ approvalId: z.ZodString;
596
+ callId: z.ZodString;
597
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
598
+ signature: z.ZodOptional<z.ZodString>;
599
+ }, z.core.$strip>, z.ZodObject<{
600
+ type: z.ZodLiteral<"tool-approval-response">;
601
+ approvalId: z.ZodString;
602
+ approved: z.ZodBoolean;
603
+ reason: z.ZodOptional<z.ZodString>;
604
+ }, z.core.$strip>, z.ZodObject<{
605
+ type: z.ZodLiteral<"provider">;
606
+ envelope: z.ZodObject<{
607
+ schemaVersion: z.ZodInt;
608
+ provider: z.ZodString;
609
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
610
+ }, z.core.$strip>;
611
+ }, z.core.$strip>, z.ZodObject<{
612
+ type: z.ZodLiteral<"control">;
613
+ reason: z.ZodEnum<{
614
+ "run-interrupted": "run-interrupted";
615
+ "stale-run": "stale-run";
616
+ }>;
617
+ }, z.core.$strip>], "type">>;
618
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
619
+ createdAt: z.ZodISODateTime;
620
+ updatedAt: z.ZodISODateTime;
621
+ }, z.core.$strip>]>;
622
+ emittedAt: z.ZodISODateTime;
623
+ }, z.core.$strip>, z.ZodObject<{
624
+ conversationId: z.ZodString;
625
+ runId: z.ZodString;
626
+ emittedAt: z.ZodISODateTime;
627
+ type: z.ZodLiteral<"assistant-delta">;
628
+ runtimeEpoch: z.ZodString;
629
+ sequence: z.ZodInt;
630
+ textDelta: z.ZodString;
631
+ }, z.core.$strip>, z.ZodObject<{
632
+ conversationId: z.ZodString;
633
+ runId: z.ZodString;
634
+ emittedAt: z.ZodISODateTime;
635
+ runtimeEpoch: z.ZodString;
636
+ sequence: z.ZodInt;
637
+ provider: z.ZodOptional<z.ZodObject<{
638
+ schemaVersion: z.ZodInt;
639
+ provider: z.ZodString;
640
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
641
+ }, z.core.$strip>>;
642
+ type: z.ZodLiteral<"reasoning-start">;
643
+ }, z.core.$strip>, z.ZodObject<{
644
+ conversationId: z.ZodString;
645
+ runId: z.ZodString;
646
+ emittedAt: z.ZodISODateTime;
647
+ runtimeEpoch: z.ZodString;
648
+ sequence: z.ZodInt;
649
+ provider: z.ZodOptional<z.ZodObject<{
650
+ schemaVersion: z.ZodInt;
651
+ provider: z.ZodString;
652
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
653
+ }, z.core.$strip>>;
654
+ type: z.ZodLiteral<"reasoning-delta">;
655
+ textDelta: z.ZodString;
656
+ }, z.core.$strip>, z.ZodObject<{
657
+ conversationId: z.ZodString;
658
+ runId: z.ZodString;
659
+ emittedAt: z.ZodISODateTime;
660
+ runtimeEpoch: z.ZodString;
661
+ sequence: z.ZodInt;
662
+ provider: z.ZodOptional<z.ZodObject<{
663
+ schemaVersion: z.ZodInt;
664
+ provider: z.ZodString;
665
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
666
+ }, z.core.$strip>>;
667
+ type: z.ZodLiteral<"reasoning-end">;
668
+ }, z.core.$strip>, z.ZodObject<{
669
+ conversationId: z.ZodString;
670
+ runId: z.ZodString;
671
+ emittedAt: z.ZodISODateTime;
672
+ type: z.ZodLiteral<"assistant-checkpoint">;
673
+ eventId: z.ZodString;
674
+ snapshotVersion: z.ZodInt;
675
+ message: z.ZodObject<{
676
+ schemaVersion: z.ZodLiteral<1>;
677
+ id: z.ZodString;
678
+ conversationId: z.ZodString;
679
+ runId: z.ZodOptional<z.ZodString>;
680
+ role: z.ZodEnum<{
681
+ assistant: "assistant";
682
+ summary: "summary";
683
+ system: "system";
684
+ tool: "tool";
685
+ user: "user";
686
+ }>;
687
+ status: z.ZodEnum<{
688
+ committed: "committed";
689
+ completed: "completed";
690
+ failed: "failed";
691
+ interrupted: "interrupted";
692
+ streaming: "streaming";
693
+ superseded: "superseded";
694
+ }>;
695
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
696
+ type: z.ZodLiteral<"text">;
697
+ text: z.ZodString;
698
+ }, z.core.$strip>, z.ZodObject<{
699
+ type: z.ZodLiteral<"reasoning">;
700
+ text: z.ZodString;
701
+ provider: z.ZodOptional<z.ZodObject<{
702
+ schemaVersion: z.ZodInt;
703
+ provider: z.ZodString;
704
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
705
+ }, z.core.$strip>>;
706
+ }, z.core.$strip>, z.ZodObject<{
707
+ type: z.ZodLiteral<"file">;
708
+ mediaType: z.ZodString;
709
+ reference: z.ZodString;
710
+ filename: z.ZodOptional<z.ZodString>;
711
+ }, z.core.$strip>, z.ZodObject<{
712
+ type: z.ZodLiteral<"source">;
713
+ sourceId: z.ZodString;
714
+ url: z.ZodOptional<z.ZodURL>;
715
+ title: z.ZodOptional<z.ZodString>;
716
+ }, z.core.$strip>, z.ZodObject<{
717
+ type: z.ZodLiteral<"tool-call">;
718
+ callId: z.ZodString;
719
+ toolName: z.ZodString;
720
+ input: z.ZodJSONSchema;
721
+ provider: z.ZodOptional<z.ZodObject<{
722
+ schemaVersion: z.ZodInt;
723
+ provider: z.ZodString;
724
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
725
+ }, z.core.$strip>>;
726
+ }, z.core.$strip>, z.ZodObject<{
727
+ type: z.ZodLiteral<"tool-result">;
728
+ callId: z.ZodString;
729
+ toolName: z.ZodString;
730
+ outcome: z.ZodEnum<{
731
+ error: "error";
732
+ interrupted: "interrupted";
733
+ success: "success";
734
+ }>;
735
+ output: z.ZodOptional<z.ZodJSONSchema>;
736
+ }, z.core.$strip>, z.ZodObject<{
737
+ type: z.ZodLiteral<"tool-approval-request">;
738
+ approvalId: z.ZodString;
739
+ callId: z.ZodString;
740
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
741
+ signature: z.ZodOptional<z.ZodString>;
742
+ }, z.core.$strip>, z.ZodObject<{
743
+ type: z.ZodLiteral<"tool-approval-response">;
744
+ approvalId: z.ZodString;
745
+ approved: z.ZodBoolean;
746
+ reason: z.ZodOptional<z.ZodString>;
747
+ }, z.core.$strip>, z.ZodObject<{
748
+ type: z.ZodLiteral<"provider">;
749
+ envelope: z.ZodObject<{
750
+ schemaVersion: z.ZodInt;
751
+ provider: z.ZodString;
752
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
753
+ }, z.core.$strip>;
754
+ }, z.core.$strip>, z.ZodObject<{
755
+ type: z.ZodLiteral<"control">;
756
+ reason: z.ZodEnum<{
757
+ "run-interrupted": "run-interrupted";
758
+ "stale-run": "stale-run";
759
+ }>;
760
+ }, z.core.$strip>], "type">>;
761
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
762
+ createdAt: z.ZodISODateTime;
763
+ updatedAt: z.ZodISODateTime;
764
+ }, z.core.$strip>;
765
+ metrics: z.ZodOptional<z.ZodObject<{
766
+ partial: z.ZodBoolean;
767
+ usage: z.ZodObject<{
768
+ inputTokens: z.ZodObject<{
769
+ value: z.ZodOptional<z.ZodInt>;
770
+ provenance: z.ZodEnum<{
771
+ computed: "computed";
772
+ estimated: "estimated";
773
+ "provider-reported": "provider-reported";
774
+ unavailable: "unavailable";
775
+ }>;
776
+ }, z.core.$strip>;
777
+ outputTokens: z.ZodObject<{
778
+ value: z.ZodOptional<z.ZodInt>;
779
+ provenance: z.ZodEnum<{
780
+ computed: "computed";
781
+ estimated: "estimated";
782
+ "provider-reported": "provider-reported";
783
+ unavailable: "unavailable";
784
+ }>;
785
+ }, z.core.$strip>;
786
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
787
+ value: z.ZodOptional<z.ZodInt>;
788
+ provenance: z.ZodEnum<{
789
+ computed: "computed";
790
+ estimated: "estimated";
791
+ "provider-reported": "provider-reported";
792
+ unavailable: "unavailable";
793
+ }>;
794
+ }, z.core.$strip>>;
795
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
796
+ value: z.ZodOptional<z.ZodInt>;
797
+ provenance: z.ZodEnum<{
798
+ computed: "computed";
799
+ estimated: "estimated";
800
+ "provider-reported": "provider-reported";
801
+ unavailable: "unavailable";
802
+ }>;
803
+ }, z.core.$strip>>;
804
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
805
+ value: z.ZodOptional<z.ZodInt>;
806
+ provenance: z.ZodEnum<{
807
+ computed: "computed";
808
+ estimated: "estimated";
809
+ "provider-reported": "provider-reported";
810
+ unavailable: "unavailable";
811
+ }>;
812
+ }, z.core.$strip>>;
813
+ cost: z.ZodOptional<z.ZodObject<{
814
+ value: z.ZodOptional<z.ZodNumber>;
815
+ currency: z.ZodOptional<z.ZodString>;
816
+ provenance: z.ZodEnum<{
817
+ computed: "computed";
818
+ estimated: "estimated";
819
+ "provider-reported": "provider-reported";
820
+ unavailable: "unavailable";
821
+ }>;
822
+ }, z.core.$strip>>;
823
+ }, z.core.$strip>;
824
+ durationMs: z.ZodOptional<z.ZodNumber>;
825
+ ttftMs: z.ZodOptional<z.ZodNumber>;
826
+ }, z.core.$strip>>;
827
+ }, z.core.$strip>, z.ZodObject<{
828
+ conversationId: z.ZodString;
829
+ runId: z.ZodString;
830
+ emittedAt: z.ZodISODateTime;
831
+ type: z.ZodLiteral<"run-state">;
832
+ eventId: z.ZodString;
833
+ snapshotVersion: z.ZodInt;
834
+ state: z.ZodEnum<{
835
+ abandoned: "abandoned";
836
+ cancelled: "cancelled";
837
+ completed: "completed";
838
+ failed: "failed";
839
+ interrupt_requested: "interrupt_requested";
840
+ interrupted: "interrupted";
841
+ queued: "queued";
842
+ running: "running";
843
+ superseded: "superseded";
844
+ }>;
845
+ }, z.core.$strip>, z.ZodObject<{
846
+ conversationId: z.ZodString;
847
+ runId: z.ZodString;
848
+ emittedAt: z.ZodISODateTime;
849
+ type: z.ZodLiteral<"tool-status">;
850
+ runtimeEpoch: z.ZodString;
851
+ sequence: z.ZodInt;
852
+ callId: z.ZodString;
853
+ toolName: z.ZodString;
854
+ status: z.ZodEnum<{
855
+ completed: "completed";
856
+ failed: "failed";
857
+ interrupted: "interrupted";
858
+ started: "started";
859
+ }>;
860
+ input: z.ZodOptional<z.ZodJSONSchema>;
861
+ output: z.ZodOptional<z.ZodJSONSchema>;
862
+ }, z.core.$strip>, z.ZodObject<{
863
+ conversationId: z.ZodString;
864
+ runId: z.ZodString;
865
+ emittedAt: z.ZodISODateTime;
866
+ type: z.ZodLiteral<"terminal">;
867
+ eventId: z.ZodString;
868
+ snapshotVersion: z.ZodInt;
869
+ reason: z.ZodEnum<{
870
+ abandoned: "abandoned";
871
+ absorbed: "absorbed";
872
+ cancelled: "cancelled";
873
+ context_overflow: "context_overflow";
874
+ interrupted: "interrupted";
875
+ policy_stop: "policy_stop";
876
+ provider_failure: "provider_failure";
877
+ provider_stop: "provider_stop";
878
+ shutdown: "shutdown";
879
+ success: "success";
880
+ superseded: "superseded";
881
+ timeout: "timeout";
882
+ }>;
883
+ policyName: z.ZodOptional<z.ZodString>;
884
+ message: z.ZodObject<{
885
+ schemaVersion: z.ZodLiteral<1>;
886
+ id: z.ZodString;
887
+ conversationId: z.ZodString;
888
+ runId: z.ZodOptional<z.ZodString>;
889
+ role: z.ZodEnum<{
890
+ assistant: "assistant";
891
+ summary: "summary";
892
+ system: "system";
893
+ tool: "tool";
894
+ user: "user";
895
+ }>;
896
+ status: z.ZodEnum<{
897
+ committed: "committed";
898
+ completed: "completed";
899
+ failed: "failed";
900
+ interrupted: "interrupted";
901
+ streaming: "streaming";
902
+ superseded: "superseded";
903
+ }>;
904
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
905
+ type: z.ZodLiteral<"text">;
906
+ text: z.ZodString;
907
+ }, z.core.$strip>, z.ZodObject<{
908
+ type: z.ZodLiteral<"reasoning">;
909
+ text: z.ZodString;
910
+ provider: z.ZodOptional<z.ZodObject<{
911
+ schemaVersion: z.ZodInt;
912
+ provider: z.ZodString;
913
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
914
+ }, z.core.$strip>>;
915
+ }, z.core.$strip>, z.ZodObject<{
916
+ type: z.ZodLiteral<"file">;
917
+ mediaType: z.ZodString;
918
+ reference: z.ZodString;
919
+ filename: z.ZodOptional<z.ZodString>;
920
+ }, z.core.$strip>, z.ZodObject<{
921
+ type: z.ZodLiteral<"source">;
922
+ sourceId: z.ZodString;
923
+ url: z.ZodOptional<z.ZodURL>;
924
+ title: z.ZodOptional<z.ZodString>;
925
+ }, z.core.$strip>, z.ZodObject<{
926
+ type: z.ZodLiteral<"tool-call">;
927
+ callId: z.ZodString;
928
+ toolName: z.ZodString;
929
+ input: z.ZodJSONSchema;
930
+ provider: z.ZodOptional<z.ZodObject<{
931
+ schemaVersion: z.ZodInt;
932
+ provider: z.ZodString;
933
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
934
+ }, z.core.$strip>>;
935
+ }, z.core.$strip>, z.ZodObject<{
936
+ type: z.ZodLiteral<"tool-result">;
937
+ callId: z.ZodString;
938
+ toolName: z.ZodString;
939
+ outcome: z.ZodEnum<{
940
+ error: "error";
941
+ interrupted: "interrupted";
942
+ success: "success";
943
+ }>;
944
+ output: z.ZodOptional<z.ZodJSONSchema>;
945
+ }, z.core.$strip>, z.ZodObject<{
946
+ type: z.ZodLiteral<"tool-approval-request">;
947
+ approvalId: z.ZodString;
948
+ callId: z.ZodString;
949
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
950
+ signature: z.ZodOptional<z.ZodString>;
951
+ }, z.core.$strip>, z.ZodObject<{
952
+ type: z.ZodLiteral<"tool-approval-response">;
953
+ approvalId: z.ZodString;
954
+ approved: z.ZodBoolean;
955
+ reason: z.ZodOptional<z.ZodString>;
956
+ }, z.core.$strip>, z.ZodObject<{
957
+ type: z.ZodLiteral<"provider">;
958
+ envelope: z.ZodObject<{
959
+ schemaVersion: z.ZodInt;
960
+ provider: z.ZodString;
961
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
962
+ }, z.core.$strip>;
963
+ }, z.core.$strip>, z.ZodObject<{
964
+ type: z.ZodLiteral<"control">;
965
+ reason: z.ZodEnum<{
966
+ "run-interrupted": "run-interrupted";
967
+ "stale-run": "stale-run";
968
+ }>;
969
+ }, z.core.$strip>], "type">>;
970
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
971
+ createdAt: z.ZodISODateTime;
972
+ updatedAt: z.ZodISODateTime;
973
+ }, z.core.$strip>;
974
+ metrics: z.ZodOptional<z.ZodObject<{
975
+ partial: z.ZodBoolean;
976
+ usage: z.ZodObject<{
977
+ inputTokens: z.ZodObject<{
978
+ value: z.ZodOptional<z.ZodInt>;
979
+ provenance: z.ZodEnum<{
980
+ computed: "computed";
981
+ estimated: "estimated";
982
+ "provider-reported": "provider-reported";
983
+ unavailable: "unavailable";
984
+ }>;
985
+ }, z.core.$strip>;
986
+ outputTokens: z.ZodObject<{
987
+ value: z.ZodOptional<z.ZodInt>;
988
+ provenance: z.ZodEnum<{
989
+ computed: "computed";
990
+ estimated: "estimated";
991
+ "provider-reported": "provider-reported";
992
+ unavailable: "unavailable";
993
+ }>;
994
+ }, z.core.$strip>;
995
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
996
+ value: z.ZodOptional<z.ZodInt>;
997
+ provenance: z.ZodEnum<{
998
+ computed: "computed";
999
+ estimated: "estimated";
1000
+ "provider-reported": "provider-reported";
1001
+ unavailable: "unavailable";
1002
+ }>;
1003
+ }, z.core.$strip>>;
1004
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1005
+ value: z.ZodOptional<z.ZodInt>;
1006
+ provenance: z.ZodEnum<{
1007
+ computed: "computed";
1008
+ estimated: "estimated";
1009
+ "provider-reported": "provider-reported";
1010
+ unavailable: "unavailable";
1011
+ }>;
1012
+ }, z.core.$strip>>;
1013
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1014
+ value: z.ZodOptional<z.ZodInt>;
1015
+ provenance: z.ZodEnum<{
1016
+ computed: "computed";
1017
+ estimated: "estimated";
1018
+ "provider-reported": "provider-reported";
1019
+ unavailable: "unavailable";
1020
+ }>;
1021
+ }, z.core.$strip>>;
1022
+ cost: z.ZodOptional<z.ZodObject<{
1023
+ value: z.ZodOptional<z.ZodNumber>;
1024
+ currency: z.ZodOptional<z.ZodString>;
1025
+ provenance: z.ZodEnum<{
1026
+ computed: "computed";
1027
+ estimated: "estimated";
1028
+ "provider-reported": "provider-reported";
1029
+ unavailable: "unavailable";
1030
+ }>;
1031
+ }, z.core.$strip>>;
1032
+ }, z.core.$strip>;
1033
+ durationMs: z.ZodOptional<z.ZodNumber>;
1034
+ ttftMs: z.ZodOptional<z.ZodNumber>;
1035
+ }, z.core.$strip>>;
1036
+ }, z.core.$strip>], "type">;
1037
+ }, z.core.$strict>, z.ZodObject<{
1038
+ schemaVersion: z.ZodLiteral<1>;
1039
+ type: z.ZodLiteral<"resync-required">;
1040
+ conversationId: z.ZodString;
1041
+ reason: z.ZodLiteral<"overflow">;
1042
+ }, z.core.$strict>], "type">;
1043
+ export type AgentControlDelivery = z.infer<typeof AgentControlDeliverySchema>;
1044
+ export declare const AgentMultiSessionCursorSchema: z.ZodObject<{
1045
+ conversations: z.ZodRecord<z.ZodString, z.ZodObject<{
1046
+ snapshotVersion: z.ZodOptional<z.ZodInt>;
1047
+ durableEventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1048
+ runs: z.ZodRecord<z.ZodString, z.ZodObject<{
1049
+ runtimeEpoch: z.ZodString;
1050
+ sequence: z.ZodInt;
1051
+ }, z.core.$strict>>;
1052
+ }, z.core.$strict>>;
1053
+ }, z.core.$strict>;
1054
+ export type AgentMultiSessionCursor = z.infer<typeof AgentMultiSessionCursorSchema>;
1055
+ export declare function advanceAgentMultiSessionCursor(raw: AgentMultiSessionCursor, event: AgentRuntimeEvent): {
1056
+ status: 'accepted' | 'duplicate' | 'gap';
1057
+ cursor: AgentMultiSessionCursor;
1058
+ };
1059
+ export interface AgentConversationView {
1060
+ snapshot?: AgentSnapshot;
1061
+ resyncRequired: boolean;
1062
+ transientByRun: Readonly<Record<string, {
1063
+ text: string;
1064
+ reasoning: string;
1065
+ }>>;
1066
+ }
1067
+ export interface AgentControlView {
1068
+ cursor: AgentMultiSessionCursor;
1069
+ conversations: Readonly<Record<string, AgentConversationView>>;
1070
+ }
1071
+ export declare function createAgentControlView(): AgentControlView;
1072
+ export declare function reduceAgentControlSnapshot(view: AgentControlView, rawSnapshot: AgentSnapshot): AgentControlView;
1073
+ export declare function reduceAgentControlEvent(view: AgentControlView, rawEvent: AgentRuntimeEvent): AgentControlView;
1074
+ //# sourceMappingURL=control-schema.d.ts.map