@myagentroam/protocol 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4301 @@
1
+ import { z } from 'zod';
2
+ export declare const healthStatusSchema: z.ZodObject<{
3
+ status: z.ZodLiteral<"ok">;
4
+ }, "strip", z.ZodTypeAny, {
5
+ status: "ok";
6
+ }, {
7
+ status: "ok";
8
+ }>;
9
+ export type HealthStatus = z.infer<typeof healthStatusSchema>;
10
+ /** The only wire protocol version understood by this build. */
11
+ export declare const NODE_PROTOCOL_VERSION = 2;
12
+ export declare const WORKBENCH_PROTOCOL_VERSION = 1;
13
+ export declare const nodePlatformSchema: z.ZodEnum<["win32", "linux"]>;
14
+ export declare const runnerAvailabilitySchema: z.ZodObject<{
15
+ available: z.ZodBoolean;
16
+ version: z.ZodOptional<z.ZodString>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ available: boolean;
19
+ version?: string | undefined;
20
+ }, {
21
+ available: boolean;
22
+ version?: string | undefined;
23
+ }>;
24
+ export declare const nodeCapabilitiesSchema: z.ZodObject<{
25
+ platform: z.ZodEnum<["win32", "linux"]>;
26
+ architecture: z.ZodString;
27
+ nodeVersion: z.ZodString;
28
+ codex: z.ZodObject<{
29
+ available: z.ZodBoolean;
30
+ version: z.ZodOptional<z.ZodString>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ available: boolean;
33
+ version?: string | undefined;
34
+ }, {
35
+ available: boolean;
36
+ version?: string | undefined;
37
+ }>;
38
+ claudeCode: z.ZodObject<{
39
+ available: z.ZodBoolean;
40
+ version: z.ZodOptional<z.ZodString>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ available: boolean;
43
+ version?: string | undefined;
44
+ }, {
45
+ available: boolean;
46
+ version?: string | undefined;
47
+ }>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ platform: "win32" | "linux";
50
+ architecture: string;
51
+ nodeVersion: string;
52
+ codex: {
53
+ available: boolean;
54
+ version?: string | undefined;
55
+ };
56
+ claudeCode: {
57
+ available: boolean;
58
+ version?: string | undefined;
59
+ };
60
+ }, {
61
+ platform: "win32" | "linux";
62
+ architecture: string;
63
+ nodeVersion: string;
64
+ codex: {
65
+ available: boolean;
66
+ version?: string | undefined;
67
+ };
68
+ claudeCode: {
69
+ available: boolean;
70
+ version?: string | undefined;
71
+ };
72
+ }>;
73
+ export type NodeCapabilities = z.infer<typeof nodeCapabilitiesSchema>;
74
+ export declare const workspaceKindSchema: z.ZodEnum<["DIRECTORY", "GIT_WORKSPACE"]>;
75
+ export type WorkspaceKind = z.infer<typeof workspaceKindSchema>;
76
+ export declare const gitSummarySchema: z.ZodObject<{
77
+ commonDir: z.ZodString;
78
+ head: z.ZodString;
79
+ branch: z.ZodNullable<z.ZodString>;
80
+ dirty: z.ZodBoolean;
81
+ snapshot: z.ZodString;
82
+ }, "strip", z.ZodTypeAny, {
83
+ dirty: boolean;
84
+ commonDir: string;
85
+ head: string;
86
+ branch: string | null;
87
+ snapshot: string;
88
+ }, {
89
+ dirty: boolean;
90
+ commonDir: string;
91
+ head: string;
92
+ branch: string | null;
93
+ snapshot: string;
94
+ }>;
95
+ export type GitSummary = z.infer<typeof gitSummarySchema>;
96
+ /** Runner names are deliberately closed in the first implementation. */
97
+ export declare const runnerNameSchema: z.ZodEnum<["codex", "claude-code"]>;
98
+ export type RunnerName = z.infer<typeof runnerNameSchema>;
99
+ /** Account-level quota visibility is intentionally separate from a Runner's execution availability. */
100
+ export declare const runnerUsageStatusSchema: z.ZodObject<{
101
+ runner: z.ZodEnum<["codex", "claude-code"]>;
102
+ available: z.ZodBoolean;
103
+ reasonCode: z.ZodNullable<z.ZodString>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ available: boolean;
106
+ runner: "codex" | "claude-code";
107
+ reasonCode: string | null;
108
+ }, {
109
+ available: boolean;
110
+ runner: "codex" | "claude-code";
111
+ reasonCode: string | null;
112
+ }>;
113
+ export type RunnerUsageStatus = z.infer<typeof runnerUsageStatusSchema>;
114
+ export declare const runnerUsageWindowSchema: z.ZodObject<{
115
+ id: z.ZodString;
116
+ label: z.ZodString;
117
+ usedPercentage: z.ZodNumber;
118
+ resetsAt: z.ZodNullable<z.ZodNumber>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ id: string;
121
+ label: string;
122
+ usedPercentage: number;
123
+ resetsAt: number | null;
124
+ }, {
125
+ id: string;
126
+ label: string;
127
+ usedPercentage: number;
128
+ resetsAt: number | null;
129
+ }>;
130
+ export type RunnerUsageWindow = z.infer<typeof runnerUsageWindowSchema>;
131
+ export declare const runnerUsageSchema: z.ZodObject<{
132
+ runner: z.ZodEnum<["codex", "claude-code"]>;
133
+ windows: z.ZodArray<z.ZodObject<{
134
+ id: z.ZodString;
135
+ label: z.ZodString;
136
+ usedPercentage: z.ZodNumber;
137
+ resetsAt: z.ZodNullable<z.ZodNumber>;
138
+ }, "strip", z.ZodTypeAny, {
139
+ id: string;
140
+ label: string;
141
+ usedPercentage: number;
142
+ resetsAt: number | null;
143
+ }, {
144
+ id: string;
145
+ label: string;
146
+ usedPercentage: number;
147
+ resetsAt: number | null;
148
+ }>, "many">;
149
+ fetchedAt: z.ZodNumber;
150
+ cached: z.ZodBoolean;
151
+ }, "strip", z.ZodTypeAny, {
152
+ runner: "codex" | "claude-code";
153
+ windows: {
154
+ id: string;
155
+ label: string;
156
+ usedPercentage: number;
157
+ resetsAt: number | null;
158
+ }[];
159
+ fetchedAt: number;
160
+ cached: boolean;
161
+ }, {
162
+ runner: "codex" | "claude-code";
163
+ windows: {
164
+ id: string;
165
+ label: string;
166
+ usedPercentage: number;
167
+ resetsAt: number | null;
168
+ }[];
169
+ fetchedAt: number;
170
+ cached: boolean;
171
+ }>;
172
+ export type RunnerUsage = z.infer<typeof runnerUsageSchema>;
173
+ /** What the runner can do in an existing native conversation. */
174
+ export declare const runnerControlLevelSchema: z.ZodEnum<["OBSERVE", "MESSAGE", "INTERRUPT"]>;
175
+ export type RunnerControlLevel = z.infer<typeof runnerControlLevelSchema>;
176
+ export declare const runnerCapabilitiesSchema: z.ZodObject<{
177
+ available: z.ZodBoolean;
178
+ version: z.ZodOptional<z.ZodString>;
179
+ controlLevel: z.ZodEnum<["OBSERVE", "MESSAGE", "INTERRUPT"]>;
180
+ supportsResume: z.ZodBoolean;
181
+ supportsExternalSession: z.ZodBoolean;
182
+ }, "strip", z.ZodTypeAny, {
183
+ available: boolean;
184
+ controlLevel: "OBSERVE" | "MESSAGE" | "INTERRUPT";
185
+ supportsResume: boolean;
186
+ supportsExternalSession: boolean;
187
+ version?: string | undefined;
188
+ }, {
189
+ available: boolean;
190
+ controlLevel: "OBSERVE" | "MESSAGE" | "INTERRUPT";
191
+ supportsResume: boolean;
192
+ supportsExternalSession: boolean;
193
+ version?: string | undefined;
194
+ }>;
195
+ export type RunnerCapabilities = z.infer<typeof runnerCapabilitiesSchema>;
196
+ /** Fixed runner contracts; implementations are supplied by later runner tasks. */
197
+ export declare const runnerDefinitionSchema: z.ZodObject<{
198
+ name: z.ZodEnum<["codex", "claude-code"]>;
199
+ capabilities: z.ZodObject<{
200
+ available: z.ZodBoolean;
201
+ version: z.ZodOptional<z.ZodString>;
202
+ controlLevel: z.ZodEnum<["OBSERVE", "MESSAGE", "INTERRUPT"]>;
203
+ supportsResume: z.ZodBoolean;
204
+ supportsExternalSession: z.ZodBoolean;
205
+ }, "strip", z.ZodTypeAny, {
206
+ available: boolean;
207
+ controlLevel: "OBSERVE" | "MESSAGE" | "INTERRUPT";
208
+ supportsResume: boolean;
209
+ supportsExternalSession: boolean;
210
+ version?: string | undefined;
211
+ }, {
212
+ available: boolean;
213
+ controlLevel: "OBSERVE" | "MESSAGE" | "INTERRUPT";
214
+ supportsResume: boolean;
215
+ supportsExternalSession: boolean;
216
+ version?: string | undefined;
217
+ }>;
218
+ }, "strip", z.ZodTypeAny, {
219
+ name: "codex" | "claude-code";
220
+ capabilities: {
221
+ available: boolean;
222
+ controlLevel: "OBSERVE" | "MESSAGE" | "INTERRUPT";
223
+ supportsResume: boolean;
224
+ supportsExternalSession: boolean;
225
+ version?: string | undefined;
226
+ };
227
+ }, {
228
+ name: "codex" | "claude-code";
229
+ capabilities: {
230
+ available: boolean;
231
+ controlLevel: "OBSERVE" | "MESSAGE" | "INTERRUPT";
232
+ supportsResume: boolean;
233
+ supportsExternalSession: boolean;
234
+ version?: string | undefined;
235
+ };
236
+ }>;
237
+ export type RunnerDefinition = z.infer<typeof runnerDefinitionSchema>;
238
+ export declare const runnerDefinitions: Readonly<Record<RunnerName, RunnerDefinition>>;
239
+ export declare const agentRunStatusSchema: z.ZodEnum<["QUEUED", "STARTING", "RUNNING", "CANCELLING", "SUCCEEDED", "FAILED", "CANCELLED", "INTERRUPTED"]>;
240
+ export type AgentRunStatus = z.infer<typeof agentRunStatusSchema>;
241
+ /** Process-local Workspace FIFO projection; queue contents never enter SQLite. */
242
+ export declare const workspaceQueueItemSchema: z.ZodObject<{
243
+ run: z.ZodObject<{
244
+ id: z.ZodString;
245
+ sessionId: z.ZodString;
246
+ workspaceId: z.ZodString;
247
+ runner: z.ZodEnum<["codex", "claude-code"]>;
248
+ status: z.ZodLiteral<"QUEUED">;
249
+ clientMessageId: z.ZodString;
250
+ createdAt: z.ZodNumber;
251
+ }, "strip", z.ZodTypeAny, {
252
+ status: "QUEUED";
253
+ runner: "codex" | "claude-code";
254
+ id: string;
255
+ sessionId: string;
256
+ workspaceId: string;
257
+ clientMessageId: string;
258
+ createdAt: number;
259
+ }, {
260
+ status: "QUEUED";
261
+ runner: "codex" | "claude-code";
262
+ id: string;
263
+ sessionId: string;
264
+ workspaceId: string;
265
+ clientMessageId: string;
266
+ createdAt: number;
267
+ }>;
268
+ sessionId: z.ZodString;
269
+ sessionTitle: z.ZodString;
270
+ content: z.ZodString;
271
+ }, "strip", z.ZodTypeAny, {
272
+ run: {
273
+ status: "QUEUED";
274
+ runner: "codex" | "claude-code";
275
+ id: string;
276
+ sessionId: string;
277
+ workspaceId: string;
278
+ clientMessageId: string;
279
+ createdAt: number;
280
+ };
281
+ sessionId: string;
282
+ sessionTitle: string;
283
+ content: string;
284
+ }, {
285
+ run: {
286
+ status: "QUEUED";
287
+ runner: "codex" | "claude-code";
288
+ id: string;
289
+ sessionId: string;
290
+ workspaceId: string;
291
+ clientMessageId: string;
292
+ createdAt: number;
293
+ };
294
+ sessionId: string;
295
+ sessionTitle: string;
296
+ content: string;
297
+ }>;
298
+ export declare const workspaceQueueSchema: z.ZodObject<{
299
+ version: z.ZodNumber;
300
+ paused: z.ZodBoolean;
301
+ items: z.ZodArray<z.ZodObject<{
302
+ run: z.ZodObject<{
303
+ id: z.ZodString;
304
+ sessionId: z.ZodString;
305
+ workspaceId: z.ZodString;
306
+ runner: z.ZodEnum<["codex", "claude-code"]>;
307
+ status: z.ZodLiteral<"QUEUED">;
308
+ clientMessageId: z.ZodString;
309
+ createdAt: z.ZodNumber;
310
+ }, "strip", z.ZodTypeAny, {
311
+ status: "QUEUED";
312
+ runner: "codex" | "claude-code";
313
+ id: string;
314
+ sessionId: string;
315
+ workspaceId: string;
316
+ clientMessageId: string;
317
+ createdAt: number;
318
+ }, {
319
+ status: "QUEUED";
320
+ runner: "codex" | "claude-code";
321
+ id: string;
322
+ sessionId: string;
323
+ workspaceId: string;
324
+ clientMessageId: string;
325
+ createdAt: number;
326
+ }>;
327
+ sessionId: z.ZodString;
328
+ sessionTitle: z.ZodString;
329
+ content: z.ZodString;
330
+ }, "strip", z.ZodTypeAny, {
331
+ run: {
332
+ status: "QUEUED";
333
+ runner: "codex" | "claude-code";
334
+ id: string;
335
+ sessionId: string;
336
+ workspaceId: string;
337
+ clientMessageId: string;
338
+ createdAt: number;
339
+ };
340
+ sessionId: string;
341
+ sessionTitle: string;
342
+ content: string;
343
+ }, {
344
+ run: {
345
+ status: "QUEUED";
346
+ runner: "codex" | "claude-code";
347
+ id: string;
348
+ sessionId: string;
349
+ workspaceId: string;
350
+ clientMessageId: string;
351
+ createdAt: number;
352
+ };
353
+ sessionId: string;
354
+ sessionTitle: string;
355
+ content: string;
356
+ }>, "many">;
357
+ }, "strip", z.ZodTypeAny, {
358
+ version: number;
359
+ paused: boolean;
360
+ items: {
361
+ run: {
362
+ status: "QUEUED";
363
+ runner: "codex" | "claude-code";
364
+ id: string;
365
+ sessionId: string;
366
+ workspaceId: string;
367
+ clientMessageId: string;
368
+ createdAt: number;
369
+ };
370
+ sessionId: string;
371
+ sessionTitle: string;
372
+ content: string;
373
+ }[];
374
+ }, {
375
+ version: number;
376
+ paused: boolean;
377
+ items: {
378
+ run: {
379
+ status: "QUEUED";
380
+ runner: "codex" | "claude-code";
381
+ id: string;
382
+ sessionId: string;
383
+ workspaceId: string;
384
+ clientMessageId: string;
385
+ createdAt: number;
386
+ };
387
+ sessionId: string;
388
+ sessionTitle: string;
389
+ content: string;
390
+ }[];
391
+ }>;
392
+ export type WorkspaceQueue = z.infer<typeof workspaceQueueSchema>;
393
+ export declare const runEventSchema: z.ZodObject<{
394
+ runId: z.ZodString;
395
+ sequence: z.ZodNumber;
396
+ eventType: z.ZodString;
397
+ payload: z.ZodUnknown;
398
+ status: z.ZodOptional<z.ZodEnum<["QUEUED", "STARTING", "RUNNING", "CANCELLING", "SUCCEEDED", "FAILED", "CANCELLED", "INTERRUPTED"]>>;
399
+ version: z.ZodOptional<z.ZodNumber>;
400
+ }, "strip", z.ZodTypeAny, {
401
+ runId: string;
402
+ sequence: number;
403
+ eventType: string;
404
+ status?: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED" | undefined;
405
+ version?: number | undefined;
406
+ payload?: unknown;
407
+ }, {
408
+ runId: string;
409
+ sequence: number;
410
+ eventType: string;
411
+ status?: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED" | undefined;
412
+ version?: number | undefined;
413
+ payload?: unknown;
414
+ }>;
415
+ export type RunEvent = z.infer<typeof runEventSchema>;
416
+ /**
417
+ * Node-to-Workbench asynchronous notifications. This is deliberately a
418
+ * small envelope: business payloads remain owned by the Node and Server only
419
+ * authenticates and relays them to an Admin page connection.
420
+ */
421
+ export declare const workbenchEventCategorySchema: z.ZodEnum<["node", "session", "conversation", "run", "queue", "workspace"]>;
422
+ export type WorkbenchEventCategory = z.infer<typeof workbenchEventCategorySchema>;
423
+ export declare const workbenchEventSchema: z.ZodObject<{
424
+ sequence: z.ZodNumber;
425
+ category: z.ZodEnum<["node", "session", "conversation", "run", "queue", "workspace"]>;
426
+ payload: z.ZodUnknown;
427
+ }, "strip", z.ZodTypeAny, {
428
+ sequence: number;
429
+ category: "run" | "node" | "session" | "conversation" | "queue" | "workspace";
430
+ payload?: unknown;
431
+ }, {
432
+ sequence: number;
433
+ category: "run" | "node" | "session" | "conversation" | "queue" | "workspace";
434
+ payload?: unknown;
435
+ }>;
436
+ export type WorkbenchEvent = z.infer<typeof workbenchEventSchema>;
437
+ export declare const capabilityAvailabilitySchema: z.ZodEffects<z.ZodObject<{
438
+ available: z.ZodBoolean;
439
+ reasonCode: z.ZodNullable<z.ZodString>;
440
+ }, "strip", z.ZodTypeAny, {
441
+ available: boolean;
442
+ reasonCode: string | null;
443
+ }, {
444
+ available: boolean;
445
+ reasonCode: string | null;
446
+ }>, {
447
+ [x: string]: any;
448
+ }, {
449
+ [x: string]: any;
450
+ }>;
451
+ export type CapabilityAvailability = z.infer<typeof capabilityAvailabilitySchema>;
452
+ export declare const runnerCommandDescriptorSchema: z.ZodEffects<z.ZodObject<{
453
+ id: z.ZodString;
454
+ runner: z.ZodEnum<["codex", "claude-code"]>;
455
+ label: z.ZodString;
456
+ stateLabel: z.ZodOptional<z.ZodString>;
457
+ description: z.ZodString;
458
+ /** Commands are entered exactly as the Runner documents them: `/name args`. */
459
+ inputHint: z.ZodString;
460
+ source: z.ZodEnum<["CODEX_APP_SERVER", "CLAUDE_AGENT_SDK"]>;
461
+ interaction: z.ZodEnum<["RUNNER_TEXT", "IMMEDIATE_ACTION", "TOGGLE", "VALUE"]>;
462
+ available: z.ZodBoolean;
463
+ reasonCode: z.ZodNullable<z.ZodString>;
464
+ }, "strip", z.ZodTypeAny, {
465
+ available: boolean;
466
+ runner: "codex" | "claude-code";
467
+ reasonCode: string | null;
468
+ id: string;
469
+ label: string;
470
+ description: string;
471
+ inputHint: string;
472
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
473
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
474
+ stateLabel?: string | undefined;
475
+ }, {
476
+ available: boolean;
477
+ runner: "codex" | "claude-code";
478
+ reasonCode: string | null;
479
+ id: string;
480
+ label: string;
481
+ description: string;
482
+ inputHint: string;
483
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
484
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
485
+ stateLabel?: string | undefined;
486
+ }>, {
487
+ available: boolean;
488
+ runner: "codex" | "claude-code";
489
+ reasonCode: string | null;
490
+ id: string;
491
+ label: string;
492
+ description: string;
493
+ inputHint: string;
494
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
495
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
496
+ stateLabel?: string | undefined;
497
+ }, {
498
+ available: boolean;
499
+ runner: "codex" | "claude-code";
500
+ reasonCode: string | null;
501
+ id: string;
502
+ label: string;
503
+ description: string;
504
+ inputHint: string;
505
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
506
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
507
+ stateLabel?: string | undefined;
508
+ }>;
509
+ export type RunnerCommandDescriptor = z.infer<typeof runnerCommandDescriptorSchema>;
510
+ export declare const runnerCommandStateSchema: z.ZodObject<{
511
+ commandId: z.ZodString;
512
+ active: z.ZodBoolean;
513
+ label: z.ZodString;
514
+ detail: z.ZodNullable<z.ZodString>;
515
+ closable: z.ZodBoolean;
516
+ closeInput: z.ZodNullable<z.ZodString>;
517
+ /** A Node-declared, fixed continuation for a completed structured result. */
518
+ continuation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
519
+ label: z.ZodString;
520
+ prompt: z.ZodString;
521
+ }, "strip", z.ZodTypeAny, {
522
+ label: string;
523
+ prompt: string;
524
+ }, {
525
+ label: string;
526
+ prompt: string;
527
+ }>>>;
528
+ }, "strip", z.ZodTypeAny, {
529
+ label: string;
530
+ commandId: string;
531
+ active: boolean;
532
+ detail: string | null;
533
+ closable: boolean;
534
+ closeInput: string | null;
535
+ continuation?: {
536
+ label: string;
537
+ prompt: string;
538
+ } | null | undefined;
539
+ }, {
540
+ label: string;
541
+ commandId: string;
542
+ active: boolean;
543
+ detail: string | null;
544
+ closable: boolean;
545
+ closeInput: string | null;
546
+ continuation?: {
547
+ label: string;
548
+ prompt: string;
549
+ } | null | undefined;
550
+ }>;
551
+ export type RunnerCommandState = z.infer<typeof runnerCommandStateSchema>;
552
+ export declare const runnerProfileSchema: z.ZodObject<{
553
+ runner: z.ZodEnum<["codex", "claude-code"]>;
554
+ models: z.ZodArray<z.ZodObject<{
555
+ id: z.ZodString;
556
+ label: z.ZodString;
557
+ supportedEfforts: z.ZodArray<z.ZodString, "many">;
558
+ }, "strip", z.ZodTypeAny, {
559
+ id: string;
560
+ label: string;
561
+ supportedEfforts: string[];
562
+ }, {
563
+ id: string;
564
+ label: string;
565
+ supportedEfforts: string[];
566
+ }>, "many">;
567
+ accessOptions: z.ZodArray<z.ZodObject<{
568
+ id: z.ZodString;
569
+ label: z.ZodString;
570
+ description: z.ZodString;
571
+ }, "strip", z.ZodTypeAny, {
572
+ id: string;
573
+ label: string;
574
+ description: string;
575
+ }, {
576
+ id: string;
577
+ label: string;
578
+ description: string;
579
+ }>, "many">;
580
+ commands: z.ZodArray<z.ZodEffects<z.ZodObject<{
581
+ id: z.ZodString;
582
+ runner: z.ZodEnum<["codex", "claude-code"]>;
583
+ label: z.ZodString;
584
+ stateLabel: z.ZodOptional<z.ZodString>;
585
+ description: z.ZodString;
586
+ /** Commands are entered exactly as the Runner documents them: `/name args`. */
587
+ inputHint: z.ZodString;
588
+ source: z.ZodEnum<["CODEX_APP_SERVER", "CLAUDE_AGENT_SDK"]>;
589
+ interaction: z.ZodEnum<["RUNNER_TEXT", "IMMEDIATE_ACTION", "TOGGLE", "VALUE"]>;
590
+ available: z.ZodBoolean;
591
+ reasonCode: z.ZodNullable<z.ZodString>;
592
+ }, "strip", z.ZodTypeAny, {
593
+ available: boolean;
594
+ runner: "codex" | "claude-code";
595
+ reasonCode: string | null;
596
+ id: string;
597
+ label: string;
598
+ description: string;
599
+ inputHint: string;
600
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
601
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
602
+ stateLabel?: string | undefined;
603
+ }, {
604
+ available: boolean;
605
+ runner: "codex" | "claude-code";
606
+ reasonCode: string | null;
607
+ id: string;
608
+ label: string;
609
+ description: string;
610
+ inputHint: string;
611
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
612
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
613
+ stateLabel?: string | undefined;
614
+ }>, {
615
+ available: boolean;
616
+ runner: "codex" | "claude-code";
617
+ reasonCode: string | null;
618
+ id: string;
619
+ label: string;
620
+ description: string;
621
+ inputHint: string;
622
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
623
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
624
+ stateLabel?: string | undefined;
625
+ }, {
626
+ available: boolean;
627
+ runner: "codex" | "claude-code";
628
+ reasonCode: string | null;
629
+ id: string;
630
+ label: string;
631
+ description: string;
632
+ inputHint: string;
633
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
634
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
635
+ stateLabel?: string | undefined;
636
+ }>, "many">;
637
+ capabilities: z.ZodArray<z.ZodString, "many">;
638
+ }, "strip", z.ZodTypeAny, {
639
+ runner: "codex" | "claude-code";
640
+ capabilities: string[];
641
+ models: {
642
+ id: string;
643
+ label: string;
644
+ supportedEfforts: string[];
645
+ }[];
646
+ accessOptions: {
647
+ id: string;
648
+ label: string;
649
+ description: string;
650
+ }[];
651
+ commands: {
652
+ available: boolean;
653
+ runner: "codex" | "claude-code";
654
+ reasonCode: string | null;
655
+ id: string;
656
+ label: string;
657
+ description: string;
658
+ inputHint: string;
659
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
660
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
661
+ stateLabel?: string | undefined;
662
+ }[];
663
+ }, {
664
+ runner: "codex" | "claude-code";
665
+ capabilities: string[];
666
+ models: {
667
+ id: string;
668
+ label: string;
669
+ supportedEfforts: string[];
670
+ }[];
671
+ accessOptions: {
672
+ id: string;
673
+ label: string;
674
+ description: string;
675
+ }[];
676
+ commands: {
677
+ available: boolean;
678
+ runner: "codex" | "claude-code";
679
+ reasonCode: string | null;
680
+ id: string;
681
+ label: string;
682
+ description: string;
683
+ inputHint: string;
684
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
685
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
686
+ stateLabel?: string | undefined;
687
+ }[];
688
+ }>;
689
+ export type RunnerProfile = z.infer<typeof runnerProfileSchema>;
690
+ /** The last explicitly chosen Composer configuration belongs to one Node Runner. */
691
+ export declare const runnerDefaultConfigurationSchema: z.ZodObject<{
692
+ runner: z.ZodEnum<["codex", "claude-code"]>;
693
+ model: z.ZodString;
694
+ effort: z.ZodString;
695
+ access: z.ZodString;
696
+ }, "strip", z.ZodTypeAny, {
697
+ runner: "codex" | "claude-code";
698
+ model: string;
699
+ effort: string;
700
+ access: string;
701
+ }, {
702
+ runner: "codex" | "claude-code";
703
+ model: string;
704
+ effort: string;
705
+ access: string;
706
+ }>;
707
+ export type RunnerDefaultConfiguration = z.infer<typeof runnerDefaultConfigurationSchema>;
708
+ /** A Runner command is selected from a Node-declared profile, never guessed from `/` text. */
709
+ export declare const runnerCommandExecutionSchema: z.ZodObject<{
710
+ commandId: z.ZodString;
711
+ input: z.ZodString;
712
+ }, "strip", z.ZodTypeAny, {
713
+ commandId: string;
714
+ input: string;
715
+ }, {
716
+ commandId: string;
717
+ input: string;
718
+ }>;
719
+ export type RunnerCommandExecution = z.infer<typeof runnerCommandExecutionSchema>;
720
+ export declare const serverWorkbenchCapabilitiesSchema: z.ZodObject<{
721
+ workbenchProtocolVersion: z.ZodLiteral<1>;
722
+ conversationItemVersions: z.ZodArray<z.ZodLiteral<1>, "many">;
723
+ supportsWorkspaceActivityStream: z.ZodBoolean;
724
+ supportsSessionDetailStream: z.ZodBoolean;
725
+ supportsTerminalBrowserRelay: z.ZodBoolean;
726
+ supportsTerminalNodeDataChannel: z.ZodBoolean;
727
+ maxSseSubscriptionsPerUser: z.ZodNumber;
728
+ maxTerminalBrowserConnectionsPerUser: z.ZodNumber;
729
+ }, "strip", z.ZodTypeAny, {
730
+ workbenchProtocolVersion: 1;
731
+ conversationItemVersions: 1[];
732
+ supportsWorkspaceActivityStream: boolean;
733
+ supportsSessionDetailStream: boolean;
734
+ supportsTerminalBrowserRelay: boolean;
735
+ supportsTerminalNodeDataChannel: boolean;
736
+ maxSseSubscriptionsPerUser: number;
737
+ maxTerminalBrowserConnectionsPerUser: number;
738
+ }, {
739
+ workbenchProtocolVersion: 1;
740
+ conversationItemVersions: 1[];
741
+ supportsWorkspaceActivityStream: boolean;
742
+ supportsSessionDetailStream: boolean;
743
+ supportsTerminalBrowserRelay: boolean;
744
+ supportsTerminalNodeDataChannel: boolean;
745
+ maxSseSubscriptionsPerUser: number;
746
+ maxTerminalBrowserConnectionsPerUser: number;
747
+ }>;
748
+ export type ServerWorkbenchCapabilities = z.infer<typeof serverWorkbenchCapabilitiesSchema>;
749
+ export declare const nodeWorkbenchCapabilitiesSchema: z.ZodObject<{
750
+ manifestVersion: z.ZodLiteral<1>;
751
+ revision: z.ZodNumber;
752
+ observedAt: z.ZodNumber;
753
+ platform: z.ZodEnum<["windows", "linux"]>;
754
+ architecture: z.ZodString;
755
+ conversation: z.ZodEffects<z.ZodObject<{
756
+ available: z.ZodBoolean;
757
+ reasonCode: z.ZodNullable<z.ZodString>;
758
+ } & {
759
+ itemVersions: z.ZodArray<z.ZodLiteral<1>, "many">;
760
+ supportsSessionCursor: z.ZodBoolean;
761
+ supportsWorkspaceActivityCursor: z.ZodBoolean;
762
+ supportsHistoryPaging: z.ZodBoolean;
763
+ supportsItemFinalSnapshots: z.ZodBoolean;
764
+ maxPageSize: z.ZodNumber;
765
+ }, "strip", z.ZodTypeAny, {
766
+ available: boolean;
767
+ reasonCode: string | null;
768
+ itemVersions: 1[];
769
+ supportsSessionCursor: boolean;
770
+ supportsWorkspaceActivityCursor: boolean;
771
+ supportsHistoryPaging: boolean;
772
+ supportsItemFinalSnapshots: boolean;
773
+ maxPageSize: number;
774
+ }, {
775
+ available: boolean;
776
+ reasonCode: string | null;
777
+ itemVersions: 1[];
778
+ supportsSessionCursor: boolean;
779
+ supportsWorkspaceActivityCursor: boolean;
780
+ supportsHistoryPaging: boolean;
781
+ supportsItemFinalSnapshots: boolean;
782
+ maxPageSize: number;
783
+ }>, {
784
+ [x: string]: any;
785
+ }, {
786
+ [x: string]: any;
787
+ }>;
788
+ runners: z.ZodArray<z.ZodObject<{
789
+ runner: z.ZodEnum<["codex", "claude-code"]>;
790
+ models: z.ZodArray<z.ZodObject<{
791
+ id: z.ZodString;
792
+ label: z.ZodString;
793
+ supportedEfforts: z.ZodArray<z.ZodString, "many">;
794
+ }, "strip", z.ZodTypeAny, {
795
+ id: string;
796
+ label: string;
797
+ supportedEfforts: string[];
798
+ }, {
799
+ id: string;
800
+ label: string;
801
+ supportedEfforts: string[];
802
+ }>, "many">;
803
+ accessOptions: z.ZodArray<z.ZodObject<{
804
+ id: z.ZodString;
805
+ label: z.ZodString;
806
+ description: z.ZodString;
807
+ }, "strip", z.ZodTypeAny, {
808
+ id: string;
809
+ label: string;
810
+ description: string;
811
+ }, {
812
+ id: string;
813
+ label: string;
814
+ description: string;
815
+ }>, "many">;
816
+ commands: z.ZodArray<z.ZodEffects<z.ZodObject<{
817
+ id: z.ZodString;
818
+ runner: z.ZodEnum<["codex", "claude-code"]>;
819
+ label: z.ZodString;
820
+ stateLabel: z.ZodOptional<z.ZodString>;
821
+ description: z.ZodString;
822
+ /** Commands are entered exactly as the Runner documents them: `/name args`. */
823
+ inputHint: z.ZodString;
824
+ source: z.ZodEnum<["CODEX_APP_SERVER", "CLAUDE_AGENT_SDK"]>;
825
+ interaction: z.ZodEnum<["RUNNER_TEXT", "IMMEDIATE_ACTION", "TOGGLE", "VALUE"]>;
826
+ available: z.ZodBoolean;
827
+ reasonCode: z.ZodNullable<z.ZodString>;
828
+ }, "strip", z.ZodTypeAny, {
829
+ available: boolean;
830
+ runner: "codex" | "claude-code";
831
+ reasonCode: string | null;
832
+ id: string;
833
+ label: string;
834
+ description: string;
835
+ inputHint: string;
836
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
837
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
838
+ stateLabel?: string | undefined;
839
+ }, {
840
+ available: boolean;
841
+ runner: "codex" | "claude-code";
842
+ reasonCode: string | null;
843
+ id: string;
844
+ label: string;
845
+ description: string;
846
+ inputHint: string;
847
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
848
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
849
+ stateLabel?: string | undefined;
850
+ }>, {
851
+ available: boolean;
852
+ runner: "codex" | "claude-code";
853
+ reasonCode: string | null;
854
+ id: string;
855
+ label: string;
856
+ description: string;
857
+ inputHint: string;
858
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
859
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
860
+ stateLabel?: string | undefined;
861
+ }, {
862
+ available: boolean;
863
+ runner: "codex" | "claude-code";
864
+ reasonCode: string | null;
865
+ id: string;
866
+ label: string;
867
+ description: string;
868
+ inputHint: string;
869
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
870
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
871
+ stateLabel?: string | undefined;
872
+ }>, "many">;
873
+ capabilities: z.ZodArray<z.ZodString, "many">;
874
+ }, "strip", z.ZodTypeAny, {
875
+ runner: "codex" | "claude-code";
876
+ capabilities: string[];
877
+ models: {
878
+ id: string;
879
+ label: string;
880
+ supportedEfforts: string[];
881
+ }[];
882
+ accessOptions: {
883
+ id: string;
884
+ label: string;
885
+ description: string;
886
+ }[];
887
+ commands: {
888
+ available: boolean;
889
+ runner: "codex" | "claude-code";
890
+ reasonCode: string | null;
891
+ id: string;
892
+ label: string;
893
+ description: string;
894
+ inputHint: string;
895
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
896
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
897
+ stateLabel?: string | undefined;
898
+ }[];
899
+ }, {
900
+ runner: "codex" | "claude-code";
901
+ capabilities: string[];
902
+ models: {
903
+ id: string;
904
+ label: string;
905
+ supportedEfforts: string[];
906
+ }[];
907
+ accessOptions: {
908
+ id: string;
909
+ label: string;
910
+ description: string;
911
+ }[];
912
+ commands: {
913
+ available: boolean;
914
+ runner: "codex" | "claude-code";
915
+ reasonCode: string | null;
916
+ id: string;
917
+ label: string;
918
+ description: string;
919
+ inputHint: string;
920
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
921
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
922
+ stateLabel?: string | undefined;
923
+ }[];
924
+ }>, "many">;
925
+ files: z.ZodEffects<z.ZodObject<{
926
+ available: z.ZodBoolean;
927
+ reasonCode: z.ZodNullable<z.ZodString>;
928
+ } & {
929
+ supportsList: z.ZodBoolean;
930
+ supportsReadRange: z.ZodBoolean;
931
+ supportsSearch: z.ZodBoolean;
932
+ maxDirectoryPageSize: z.ZodNumber;
933
+ maxReadBytes: z.ZodNumber;
934
+ maxSearchResults: z.ZodNumber;
935
+ }, "strip", z.ZodTypeAny, {
936
+ available: boolean;
937
+ reasonCode: string | null;
938
+ supportsList: boolean;
939
+ supportsReadRange: boolean;
940
+ supportsSearch: boolean;
941
+ maxDirectoryPageSize: number;
942
+ maxReadBytes: number;
943
+ maxSearchResults: number;
944
+ }, {
945
+ available: boolean;
946
+ reasonCode: string | null;
947
+ supportsList: boolean;
948
+ supportsReadRange: boolean;
949
+ supportsSearch: boolean;
950
+ maxDirectoryPageSize: number;
951
+ maxReadBytes: number;
952
+ maxSearchResults: number;
953
+ }>, {
954
+ [x: string]: any;
955
+ }, {
956
+ [x: string]: any;
957
+ }>;
958
+ git: z.ZodEffects<z.ZodObject<{
959
+ available: z.ZodBoolean;
960
+ reasonCode: z.ZodNullable<z.ZodString>;
961
+ } & {
962
+ supportsCurrentChanges: z.ZodBoolean;
963
+ supportsTurnChanges: z.ZodBoolean;
964
+ maxDiffBytes: z.ZodNumber;
965
+ }, "strip", z.ZodTypeAny, {
966
+ available: boolean;
967
+ reasonCode: string | null;
968
+ supportsCurrentChanges: boolean;
969
+ supportsTurnChanges: boolean;
970
+ maxDiffBytes: number;
971
+ }, {
972
+ available: boolean;
973
+ reasonCode: string | null;
974
+ supportsCurrentChanges: boolean;
975
+ supportsTurnChanges: boolean;
976
+ maxDiffBytes: number;
977
+ }>, {
978
+ [x: string]: any;
979
+ }, {
980
+ [x: string]: any;
981
+ }>;
982
+ terminal: z.ZodEffects<z.ZodObject<{
983
+ available: z.ZodBoolean;
984
+ reasonCode: z.ZodNullable<z.ZodString>;
985
+ } & {
986
+ supportsPty: z.ZodBoolean;
987
+ supportsConPty: z.ZodBoolean;
988
+ supportsReplay: z.ZodBoolean;
989
+ supportsReadonlyAttach: z.ZodBoolean;
990
+ supportsTakeover: z.ZodBoolean;
991
+ maxTerminals: z.ZodNumber;
992
+ maxReplayBytes: z.ZodNumber;
993
+ reconnectWindowMs: z.ZodNumber;
994
+ profiles: z.ZodArray<z.ZodObject<{
995
+ id: z.ZodString;
996
+ label: z.ZodString;
997
+ isDefault: z.ZodBoolean;
998
+ }, "strip", z.ZodTypeAny, {
999
+ id: string;
1000
+ label: string;
1001
+ isDefault: boolean;
1002
+ }, {
1003
+ id: string;
1004
+ label: string;
1005
+ isDefault: boolean;
1006
+ }>, "many">;
1007
+ }, "strip", z.ZodTypeAny, {
1008
+ available: boolean;
1009
+ reasonCode: string | null;
1010
+ supportsPty: boolean;
1011
+ supportsConPty: boolean;
1012
+ supportsReplay: boolean;
1013
+ supportsReadonlyAttach: boolean;
1014
+ supportsTakeover: boolean;
1015
+ maxTerminals: number;
1016
+ maxReplayBytes: number;
1017
+ reconnectWindowMs: number;
1018
+ profiles: {
1019
+ id: string;
1020
+ label: string;
1021
+ isDefault: boolean;
1022
+ }[];
1023
+ }, {
1024
+ available: boolean;
1025
+ reasonCode: string | null;
1026
+ supportsPty: boolean;
1027
+ supportsConPty: boolean;
1028
+ supportsReplay: boolean;
1029
+ supportsReadonlyAttach: boolean;
1030
+ supportsTakeover: boolean;
1031
+ maxTerminals: number;
1032
+ maxReplayBytes: number;
1033
+ reconnectWindowMs: number;
1034
+ profiles: {
1035
+ id: string;
1036
+ label: string;
1037
+ isDefault: boolean;
1038
+ }[];
1039
+ }>, {
1040
+ [x: string]: any;
1041
+ }, {
1042
+ [x: string]: any;
1043
+ }>;
1044
+ }, "strip", z.ZodTypeAny, {
1045
+ platform: "linux" | "windows";
1046
+ architecture: string;
1047
+ conversation: {
1048
+ [x: string]: any;
1049
+ };
1050
+ manifestVersion: 1;
1051
+ revision: number;
1052
+ observedAt: number;
1053
+ runners: {
1054
+ runner: "codex" | "claude-code";
1055
+ capabilities: string[];
1056
+ models: {
1057
+ id: string;
1058
+ label: string;
1059
+ supportedEfforts: string[];
1060
+ }[];
1061
+ accessOptions: {
1062
+ id: string;
1063
+ label: string;
1064
+ description: string;
1065
+ }[];
1066
+ commands: {
1067
+ available: boolean;
1068
+ runner: "codex" | "claude-code";
1069
+ reasonCode: string | null;
1070
+ id: string;
1071
+ label: string;
1072
+ description: string;
1073
+ inputHint: string;
1074
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
1075
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
1076
+ stateLabel?: string | undefined;
1077
+ }[];
1078
+ }[];
1079
+ files: {
1080
+ [x: string]: any;
1081
+ };
1082
+ git: {
1083
+ [x: string]: any;
1084
+ };
1085
+ terminal: {
1086
+ [x: string]: any;
1087
+ };
1088
+ }, {
1089
+ platform: "linux" | "windows";
1090
+ architecture: string;
1091
+ conversation: {
1092
+ [x: string]: any;
1093
+ };
1094
+ manifestVersion: 1;
1095
+ revision: number;
1096
+ observedAt: number;
1097
+ runners: {
1098
+ runner: "codex" | "claude-code";
1099
+ capabilities: string[];
1100
+ models: {
1101
+ id: string;
1102
+ label: string;
1103
+ supportedEfforts: string[];
1104
+ }[];
1105
+ accessOptions: {
1106
+ id: string;
1107
+ label: string;
1108
+ description: string;
1109
+ }[];
1110
+ commands: {
1111
+ available: boolean;
1112
+ runner: "codex" | "claude-code";
1113
+ reasonCode: string | null;
1114
+ id: string;
1115
+ label: string;
1116
+ description: string;
1117
+ inputHint: string;
1118
+ source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK";
1119
+ interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
1120
+ stateLabel?: string | undefined;
1121
+ }[];
1122
+ }[];
1123
+ files: {
1124
+ [x: string]: any;
1125
+ };
1126
+ git: {
1127
+ [x: string]: any;
1128
+ };
1129
+ terminal: {
1130
+ [x: string]: any;
1131
+ };
1132
+ }>;
1133
+ export type NodeWorkbenchCapabilities = z.infer<typeof nodeWorkbenchCapabilitiesSchema>;
1134
+ export declare const sessionRuntimeCapabilitySchema: z.ZodEnum<["history.read", "events.live", "turn.start", "turn.queue", "turn.interrupt", "run.cancel", "approval.respond", "user-input.respond", "session.rename", "session.remove", "session.pin"]>;
1135
+ export declare const sessionRuntimeCapabilitiesSchema: z.ZodObject<{
1136
+ level: z.ZodEnum<["MANAGED", "SHARED_CONTROL", "OBSERVE_ONLY", "RESUMABLE", "UNAVAILABLE"]>;
1137
+ capabilities: z.ZodArray<z.ZodEnum<["history.read", "events.live", "turn.start", "turn.queue", "turn.interrupt", "run.cancel", "approval.respond", "user-input.respond", "session.rename", "session.remove", "session.pin"]>, "many">;
1138
+ reasonCode: z.ZodNullable<z.ZodString>;
1139
+ }, "strip", z.ZodTypeAny, {
1140
+ reasonCode: string | null;
1141
+ capabilities: ("history.read" | "events.live" | "turn.start" | "turn.queue" | "turn.interrupt" | "run.cancel" | "approval.respond" | "user-input.respond" | "session.rename" | "session.remove" | "session.pin")[];
1142
+ level: "MANAGED" | "SHARED_CONTROL" | "OBSERVE_ONLY" | "RESUMABLE" | "UNAVAILABLE";
1143
+ }, {
1144
+ reasonCode: string | null;
1145
+ capabilities: ("history.read" | "events.live" | "turn.start" | "turn.queue" | "turn.interrupt" | "run.cancel" | "approval.respond" | "user-input.respond" | "session.rename" | "session.remove" | "session.pin")[];
1146
+ level: "MANAGED" | "SHARED_CONTROL" | "OBSERVE_ONLY" | "RESUMABLE" | "UNAVAILABLE";
1147
+ }>;
1148
+ export type SessionRuntimeCapabilities = z.infer<typeof sessionRuntimeCapabilitiesSchema>;
1149
+ export declare const sessionActivityStateSchema: z.ZodEnum<["MANAGED_ACTIVE", "EXTERNAL_ACTIVE", "IDLE", "UNAVAILABLE"]>;
1150
+ export type SessionActivityState = z.infer<typeof sessionActivityStateSchema>;
1151
+ export declare const eventCursorSchema: z.ZodObject<{
1152
+ scope: z.ZodEnum<["RUN", "SESSION", "WORKSPACE_ACTIVITY"]>;
1153
+ streamId: z.ZodString;
1154
+ cursor: z.ZodString;
1155
+ }, "strip", z.ZodTypeAny, {
1156
+ scope: "RUN" | "SESSION" | "WORKSPACE_ACTIVITY";
1157
+ streamId: string;
1158
+ cursor: string;
1159
+ }, {
1160
+ scope: "RUN" | "SESSION" | "WORKSPACE_ACTIVITY";
1161
+ streamId: string;
1162
+ cursor: string;
1163
+ }>;
1164
+ export type EventCursor = z.infer<typeof eventCursorSchema>;
1165
+ export declare const contextReferenceSchema: z.ZodObject<{
1166
+ type: z.ZodEnum<["file", "directory", "changes", "diff", "turn", "message", "terminal_selection"]>;
1167
+ referenceId: z.ZodString;
1168
+ label: z.ZodString;
1169
+ path: z.ZodOptional<z.ZodString>;
1170
+ startLine: z.ZodOptional<z.ZodNumber>;
1171
+ endLine: z.ZodOptional<z.ZodNumber>;
1172
+ }, "strip", z.ZodTypeAny, {
1173
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
1174
+ label: string;
1175
+ referenceId: string;
1176
+ path?: string | undefined;
1177
+ startLine?: number | undefined;
1178
+ endLine?: number | undefined;
1179
+ }, {
1180
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
1181
+ label: string;
1182
+ referenceId: string;
1183
+ path?: string | undefined;
1184
+ startLine?: number | undefined;
1185
+ endLine?: number | undefined;
1186
+ }>;
1187
+ export type ContextReference = z.infer<typeof contextReferenceSchema>;
1188
+ export declare const conversationItemSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1189
+ id: z.ZodString;
1190
+ sessionId: z.ZodString;
1191
+ turnId: z.ZodString;
1192
+ runId: z.ZodNullable<z.ZodString>;
1193
+ parentItemId: z.ZodNullable<z.ZodString>;
1194
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1195
+ revision: z.ZodNumber;
1196
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1197
+ startedAt: z.ZodNullable<z.ZodNumber>;
1198
+ completedAt: z.ZodNullable<z.ZodNumber>;
1199
+ } & {
1200
+ kind: z.ZodLiteral<"assistant_message">;
1201
+ payload: z.ZodObject<{
1202
+ text: z.ZodString;
1203
+ format: z.ZodLiteral<"markdown">;
1204
+ model: z.ZodNullable<z.ZodString>;
1205
+ }, "strip", z.ZodTypeAny, {
1206
+ model: string | null;
1207
+ text: string;
1208
+ format: "markdown";
1209
+ }, {
1210
+ model: string | null;
1211
+ text: string;
1212
+ format: "markdown";
1213
+ }>;
1214
+ }, "strip", z.ZodTypeAny, {
1215
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1216
+ id: string;
1217
+ sessionId: string;
1218
+ runId: string | null;
1219
+ payload: {
1220
+ model: string | null;
1221
+ text: string;
1222
+ format: "markdown";
1223
+ };
1224
+ revision: number;
1225
+ turnId: string;
1226
+ parentItemId: string | null;
1227
+ sourceSequence: number | null;
1228
+ startedAt: number | null;
1229
+ completedAt: number | null;
1230
+ kind: "assistant_message";
1231
+ }, {
1232
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1233
+ id: string;
1234
+ sessionId: string;
1235
+ runId: string | null;
1236
+ payload: {
1237
+ model: string | null;
1238
+ text: string;
1239
+ format: "markdown";
1240
+ };
1241
+ revision: number;
1242
+ turnId: string;
1243
+ parentItemId: string | null;
1244
+ sourceSequence: number | null;
1245
+ startedAt: number | null;
1246
+ completedAt: number | null;
1247
+ kind: "assistant_message";
1248
+ }>, z.ZodObject<{
1249
+ id: z.ZodString;
1250
+ sessionId: z.ZodString;
1251
+ turnId: z.ZodString;
1252
+ runId: z.ZodNullable<z.ZodString>;
1253
+ parentItemId: z.ZodNullable<z.ZodString>;
1254
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1255
+ revision: z.ZodNumber;
1256
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1257
+ startedAt: z.ZodNullable<z.ZodNumber>;
1258
+ completedAt: z.ZodNullable<z.ZodNumber>;
1259
+ } & {
1260
+ kind: z.ZodLiteral<"user_message">;
1261
+ payload: z.ZodObject<{
1262
+ clientMessageId: z.ZodNullable<z.ZodString>;
1263
+ text: z.ZodString;
1264
+ contexts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1265
+ type: z.ZodEnum<["file", "directory", "changes", "diff", "turn", "message", "terminal_selection"]>;
1266
+ referenceId: z.ZodString;
1267
+ label: z.ZodString;
1268
+ path: z.ZodOptional<z.ZodString>;
1269
+ startLine: z.ZodOptional<z.ZodNumber>;
1270
+ endLine: z.ZodOptional<z.ZodNumber>;
1271
+ }, "strip", z.ZodTypeAny, {
1272
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
1273
+ label: string;
1274
+ referenceId: string;
1275
+ path?: string | undefined;
1276
+ startLine?: number | undefined;
1277
+ endLine?: number | undefined;
1278
+ }, {
1279
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
1280
+ label: string;
1281
+ referenceId: string;
1282
+ path?: string | undefined;
1283
+ startLine?: number | undefined;
1284
+ endLine?: number | undefined;
1285
+ }>, "many">>;
1286
+ delivery: z.ZodEnum<["PENDING", "ACCEPTED", "STEERED", "QUEUED_NEXT_TURN", "REJECTED"]>;
1287
+ }, "strip", z.ZodTypeAny, {
1288
+ clientMessageId: string | null;
1289
+ text: string;
1290
+ contexts: {
1291
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
1292
+ label: string;
1293
+ referenceId: string;
1294
+ path?: string | undefined;
1295
+ startLine?: number | undefined;
1296
+ endLine?: number | undefined;
1297
+ }[];
1298
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
1299
+ }, {
1300
+ clientMessageId: string | null;
1301
+ text: string;
1302
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
1303
+ contexts?: {
1304
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
1305
+ label: string;
1306
+ referenceId: string;
1307
+ path?: string | undefined;
1308
+ startLine?: number | undefined;
1309
+ endLine?: number | undefined;
1310
+ }[] | undefined;
1311
+ }>;
1312
+ }, "strip", z.ZodTypeAny, {
1313
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1314
+ id: string;
1315
+ sessionId: string;
1316
+ runId: string | null;
1317
+ payload: {
1318
+ clientMessageId: string | null;
1319
+ text: string;
1320
+ contexts: {
1321
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
1322
+ label: string;
1323
+ referenceId: string;
1324
+ path?: string | undefined;
1325
+ startLine?: number | undefined;
1326
+ endLine?: number | undefined;
1327
+ }[];
1328
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
1329
+ };
1330
+ revision: number;
1331
+ turnId: string;
1332
+ parentItemId: string | null;
1333
+ sourceSequence: number | null;
1334
+ startedAt: number | null;
1335
+ completedAt: number | null;
1336
+ kind: "user_message";
1337
+ }, {
1338
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1339
+ id: string;
1340
+ sessionId: string;
1341
+ runId: string | null;
1342
+ payload: {
1343
+ clientMessageId: string | null;
1344
+ text: string;
1345
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
1346
+ contexts?: {
1347
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
1348
+ label: string;
1349
+ referenceId: string;
1350
+ path?: string | undefined;
1351
+ startLine?: number | undefined;
1352
+ endLine?: number | undefined;
1353
+ }[] | undefined;
1354
+ };
1355
+ revision: number;
1356
+ turnId: string;
1357
+ parentItemId: string | null;
1358
+ sourceSequence: number | null;
1359
+ startedAt: number | null;
1360
+ completedAt: number | null;
1361
+ kind: "user_message";
1362
+ }>, z.ZodObject<{
1363
+ id: z.ZodString;
1364
+ sessionId: z.ZodString;
1365
+ turnId: z.ZodString;
1366
+ runId: z.ZodNullable<z.ZodString>;
1367
+ parentItemId: z.ZodNullable<z.ZodString>;
1368
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1369
+ revision: z.ZodNumber;
1370
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1371
+ startedAt: z.ZodNullable<z.ZodNumber>;
1372
+ completedAt: z.ZodNullable<z.ZodNumber>;
1373
+ } & {
1374
+ kind: z.ZodLiteral<"reasoning_summary">;
1375
+ payload: z.ZodObject<{
1376
+ sections: z.ZodArray<z.ZodObject<{
1377
+ index: z.ZodNumber;
1378
+ text: z.ZodString;
1379
+ }, "strip", z.ZodTypeAny, {
1380
+ text: string;
1381
+ index: number;
1382
+ }, {
1383
+ text: string;
1384
+ index: number;
1385
+ }>, "many">;
1386
+ }, "strip", z.ZodTypeAny, {
1387
+ sections: {
1388
+ text: string;
1389
+ index: number;
1390
+ }[];
1391
+ }, {
1392
+ sections: {
1393
+ text: string;
1394
+ index: number;
1395
+ }[];
1396
+ }>;
1397
+ }, "strip", z.ZodTypeAny, {
1398
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1399
+ id: string;
1400
+ sessionId: string;
1401
+ runId: string | null;
1402
+ payload: {
1403
+ sections: {
1404
+ text: string;
1405
+ index: number;
1406
+ }[];
1407
+ };
1408
+ revision: number;
1409
+ turnId: string;
1410
+ parentItemId: string | null;
1411
+ sourceSequence: number | null;
1412
+ startedAt: number | null;
1413
+ completedAt: number | null;
1414
+ kind: "reasoning_summary";
1415
+ }, {
1416
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1417
+ id: string;
1418
+ sessionId: string;
1419
+ runId: string | null;
1420
+ payload: {
1421
+ sections: {
1422
+ text: string;
1423
+ index: number;
1424
+ }[];
1425
+ };
1426
+ revision: number;
1427
+ turnId: string;
1428
+ parentItemId: string | null;
1429
+ sourceSequence: number | null;
1430
+ startedAt: number | null;
1431
+ completedAt: number | null;
1432
+ kind: "reasoning_summary";
1433
+ }>, z.ZodObject<{
1434
+ id: z.ZodString;
1435
+ sessionId: z.ZodString;
1436
+ turnId: z.ZodString;
1437
+ runId: z.ZodNullable<z.ZodString>;
1438
+ parentItemId: z.ZodNullable<z.ZodString>;
1439
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1440
+ revision: z.ZodNumber;
1441
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1442
+ startedAt: z.ZodNullable<z.ZodNumber>;
1443
+ completedAt: z.ZodNullable<z.ZodNumber>;
1444
+ } & {
1445
+ kind: z.ZodLiteral<"plan">;
1446
+ payload: z.ZodObject<{
1447
+ explanation: z.ZodNullable<z.ZodString>;
1448
+ steps: z.ZodArray<z.ZodObject<{
1449
+ id: z.ZodString;
1450
+ text: z.ZodString;
1451
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED"]>;
1452
+ }, "strip", z.ZodTypeAny, {
1453
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
1454
+ id: string;
1455
+ text: string;
1456
+ }, {
1457
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
1458
+ id: string;
1459
+ text: string;
1460
+ }>, "many">;
1461
+ }, "strip", z.ZodTypeAny, {
1462
+ explanation: string | null;
1463
+ steps: {
1464
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
1465
+ id: string;
1466
+ text: string;
1467
+ }[];
1468
+ }, {
1469
+ explanation: string | null;
1470
+ steps: {
1471
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
1472
+ id: string;
1473
+ text: string;
1474
+ }[];
1475
+ }>;
1476
+ }, "strip", z.ZodTypeAny, {
1477
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1478
+ id: string;
1479
+ sessionId: string;
1480
+ runId: string | null;
1481
+ payload: {
1482
+ explanation: string | null;
1483
+ steps: {
1484
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
1485
+ id: string;
1486
+ text: string;
1487
+ }[];
1488
+ };
1489
+ revision: number;
1490
+ turnId: string;
1491
+ parentItemId: string | null;
1492
+ sourceSequence: number | null;
1493
+ startedAt: number | null;
1494
+ completedAt: number | null;
1495
+ kind: "plan";
1496
+ }, {
1497
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1498
+ id: string;
1499
+ sessionId: string;
1500
+ runId: string | null;
1501
+ payload: {
1502
+ explanation: string | null;
1503
+ steps: {
1504
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
1505
+ id: string;
1506
+ text: string;
1507
+ }[];
1508
+ };
1509
+ revision: number;
1510
+ turnId: string;
1511
+ parentItemId: string | null;
1512
+ sourceSequence: number | null;
1513
+ startedAt: number | null;
1514
+ completedAt: number | null;
1515
+ kind: "plan";
1516
+ }>, z.ZodObject<{
1517
+ id: z.ZodString;
1518
+ sessionId: z.ZodString;
1519
+ turnId: z.ZodString;
1520
+ runId: z.ZodNullable<z.ZodString>;
1521
+ parentItemId: z.ZodNullable<z.ZodString>;
1522
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1523
+ revision: z.ZodNumber;
1524
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1525
+ startedAt: z.ZodNullable<z.ZodNumber>;
1526
+ completedAt: z.ZodNullable<z.ZodNumber>;
1527
+ } & {
1528
+ kind: z.ZodLiteral<"tool_call">;
1529
+ payload: z.ZodObject<{
1530
+ namespace: z.ZodString;
1531
+ toolName: z.ZodString;
1532
+ title: z.ZodString;
1533
+ inputSummary: z.ZodNullable<z.ZodString>;
1534
+ outputSummary: z.ZodNullable<z.ZodString>;
1535
+ progressLabel: z.ZodNullable<z.ZodString>;
1536
+ errorCode: z.ZodNullable<z.ZodString>;
1537
+ truncated: z.ZodBoolean;
1538
+ }, "strip", z.ZodTypeAny, {
1539
+ namespace: string;
1540
+ toolName: string;
1541
+ title: string;
1542
+ inputSummary: string | null;
1543
+ outputSummary: string | null;
1544
+ progressLabel: string | null;
1545
+ errorCode: string | null;
1546
+ truncated: boolean;
1547
+ }, {
1548
+ namespace: string;
1549
+ toolName: string;
1550
+ title: string;
1551
+ inputSummary: string | null;
1552
+ outputSummary: string | null;
1553
+ progressLabel: string | null;
1554
+ errorCode: string | null;
1555
+ truncated: boolean;
1556
+ }>;
1557
+ }, "strip", z.ZodTypeAny, {
1558
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1559
+ id: string;
1560
+ sessionId: string;
1561
+ runId: string | null;
1562
+ payload: {
1563
+ namespace: string;
1564
+ toolName: string;
1565
+ title: string;
1566
+ inputSummary: string | null;
1567
+ outputSummary: string | null;
1568
+ progressLabel: string | null;
1569
+ errorCode: string | null;
1570
+ truncated: boolean;
1571
+ };
1572
+ revision: number;
1573
+ turnId: string;
1574
+ parentItemId: string | null;
1575
+ sourceSequence: number | null;
1576
+ startedAt: number | null;
1577
+ completedAt: number | null;
1578
+ kind: "tool_call";
1579
+ }, {
1580
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1581
+ id: string;
1582
+ sessionId: string;
1583
+ runId: string | null;
1584
+ payload: {
1585
+ namespace: string;
1586
+ toolName: string;
1587
+ title: string;
1588
+ inputSummary: string | null;
1589
+ outputSummary: string | null;
1590
+ progressLabel: string | null;
1591
+ errorCode: string | null;
1592
+ truncated: boolean;
1593
+ };
1594
+ revision: number;
1595
+ turnId: string;
1596
+ parentItemId: string | null;
1597
+ sourceSequence: number | null;
1598
+ startedAt: number | null;
1599
+ completedAt: number | null;
1600
+ kind: "tool_call";
1601
+ }>, z.ZodObject<{
1602
+ id: z.ZodString;
1603
+ sessionId: z.ZodString;
1604
+ turnId: z.ZodString;
1605
+ runId: z.ZodNullable<z.ZodString>;
1606
+ parentItemId: z.ZodNullable<z.ZodString>;
1607
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1608
+ revision: z.ZodNumber;
1609
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1610
+ startedAt: z.ZodNullable<z.ZodNumber>;
1611
+ completedAt: z.ZodNullable<z.ZodNumber>;
1612
+ } & {
1613
+ kind: z.ZodLiteral<"command_execution">;
1614
+ payload: z.ZodObject<{
1615
+ command: z.ZodString;
1616
+ cwd: z.ZodNullable<z.ZodString>;
1617
+ outputPreview: z.ZodString;
1618
+ outputRef: z.ZodNullable<z.ZodString>;
1619
+ exitCode: z.ZodNullable<z.ZodNumber>;
1620
+ durationMs: z.ZodNullable<z.ZodNumber>;
1621
+ truncated: z.ZodBoolean;
1622
+ }, "strip", z.ZodTypeAny, {
1623
+ durationMs: number | null;
1624
+ truncated: boolean;
1625
+ command: string;
1626
+ cwd: string | null;
1627
+ outputPreview: string;
1628
+ outputRef: string | null;
1629
+ exitCode: number | null;
1630
+ }, {
1631
+ durationMs: number | null;
1632
+ truncated: boolean;
1633
+ command: string;
1634
+ cwd: string | null;
1635
+ outputPreview: string;
1636
+ outputRef: string | null;
1637
+ exitCode: number | null;
1638
+ }>;
1639
+ }, "strip", z.ZodTypeAny, {
1640
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1641
+ id: string;
1642
+ sessionId: string;
1643
+ runId: string | null;
1644
+ payload: {
1645
+ durationMs: number | null;
1646
+ truncated: boolean;
1647
+ command: string;
1648
+ cwd: string | null;
1649
+ outputPreview: string;
1650
+ outputRef: string | null;
1651
+ exitCode: number | null;
1652
+ };
1653
+ revision: number;
1654
+ turnId: string;
1655
+ parentItemId: string | null;
1656
+ sourceSequence: number | null;
1657
+ startedAt: number | null;
1658
+ completedAt: number | null;
1659
+ kind: "command_execution";
1660
+ }, {
1661
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1662
+ id: string;
1663
+ sessionId: string;
1664
+ runId: string | null;
1665
+ payload: {
1666
+ durationMs: number | null;
1667
+ truncated: boolean;
1668
+ command: string;
1669
+ cwd: string | null;
1670
+ outputPreview: string;
1671
+ outputRef: string | null;
1672
+ exitCode: number | null;
1673
+ };
1674
+ revision: number;
1675
+ turnId: string;
1676
+ parentItemId: string | null;
1677
+ sourceSequence: number | null;
1678
+ startedAt: number | null;
1679
+ completedAt: number | null;
1680
+ kind: "command_execution";
1681
+ }>, z.ZodObject<{
1682
+ id: z.ZodString;
1683
+ sessionId: z.ZodString;
1684
+ turnId: z.ZodString;
1685
+ runId: z.ZodNullable<z.ZodString>;
1686
+ parentItemId: z.ZodNullable<z.ZodString>;
1687
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1688
+ revision: z.ZodNumber;
1689
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1690
+ startedAt: z.ZodNullable<z.ZodNumber>;
1691
+ completedAt: z.ZodNullable<z.ZodNumber>;
1692
+ } & {
1693
+ kind: z.ZodLiteral<"file_change">;
1694
+ payload: z.ZodObject<{
1695
+ changes: z.ZodArray<z.ZodObject<{
1696
+ path: z.ZodString;
1697
+ change: z.ZodEnum<["ADDED", "MODIFIED", "DELETED", "RENAMED", "COPIED", "TYPE_CHANGED"]>;
1698
+ additions: z.ZodNullable<z.ZodNumber>;
1699
+ deletions: z.ZodNullable<z.ZodNumber>;
1700
+ diffAvailable: z.ZodBoolean;
1701
+ }, "strip", z.ZodTypeAny, {
1702
+ path: string;
1703
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
1704
+ additions: number | null;
1705
+ deletions: number | null;
1706
+ diffAvailable: boolean;
1707
+ }, {
1708
+ path: string;
1709
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
1710
+ additions: number | null;
1711
+ deletions: number | null;
1712
+ diffAvailable: boolean;
1713
+ }>, "many">;
1714
+ }, "strip", z.ZodTypeAny, {
1715
+ changes: {
1716
+ path: string;
1717
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
1718
+ additions: number | null;
1719
+ deletions: number | null;
1720
+ diffAvailable: boolean;
1721
+ }[];
1722
+ }, {
1723
+ changes: {
1724
+ path: string;
1725
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
1726
+ additions: number | null;
1727
+ deletions: number | null;
1728
+ diffAvailable: boolean;
1729
+ }[];
1730
+ }>;
1731
+ }, "strip", z.ZodTypeAny, {
1732
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1733
+ id: string;
1734
+ sessionId: string;
1735
+ runId: string | null;
1736
+ payload: {
1737
+ changes: {
1738
+ path: string;
1739
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
1740
+ additions: number | null;
1741
+ deletions: number | null;
1742
+ diffAvailable: boolean;
1743
+ }[];
1744
+ };
1745
+ revision: number;
1746
+ turnId: string;
1747
+ parentItemId: string | null;
1748
+ sourceSequence: number | null;
1749
+ startedAt: number | null;
1750
+ completedAt: number | null;
1751
+ kind: "file_change";
1752
+ }, {
1753
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1754
+ id: string;
1755
+ sessionId: string;
1756
+ runId: string | null;
1757
+ payload: {
1758
+ changes: {
1759
+ path: string;
1760
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
1761
+ additions: number | null;
1762
+ deletions: number | null;
1763
+ diffAvailable: boolean;
1764
+ }[];
1765
+ };
1766
+ revision: number;
1767
+ turnId: string;
1768
+ parentItemId: string | null;
1769
+ sourceSequence: number | null;
1770
+ startedAt: number | null;
1771
+ completedAt: number | null;
1772
+ kind: "file_change";
1773
+ }>, z.ZodObject<{
1774
+ id: z.ZodString;
1775
+ sessionId: z.ZodString;
1776
+ turnId: z.ZodString;
1777
+ runId: z.ZodNullable<z.ZodString>;
1778
+ parentItemId: z.ZodNullable<z.ZodString>;
1779
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1780
+ revision: z.ZodNumber;
1781
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1782
+ startedAt: z.ZodNullable<z.ZodNumber>;
1783
+ completedAt: z.ZodNullable<z.ZodNumber>;
1784
+ } & {
1785
+ kind: z.ZodLiteral<"approval">;
1786
+ payload: z.ZodObject<{
1787
+ approvalId: z.ZodString;
1788
+ category: z.ZodEnum<["COMMAND", "FILE_CHANGE", "NETWORK", "TOOL", "OTHER"]>;
1789
+ reason: z.ZodNullable<z.ZodString>;
1790
+ expiresAt: z.ZodNumber;
1791
+ resolvedDecision: z.ZodNullable<z.ZodString>;
1792
+ }, "strip", z.ZodTypeAny, {
1793
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
1794
+ approvalId: string;
1795
+ reason: string | null;
1796
+ expiresAt: number;
1797
+ resolvedDecision: string | null;
1798
+ }, {
1799
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
1800
+ approvalId: string;
1801
+ reason: string | null;
1802
+ expiresAt: number;
1803
+ resolvedDecision: string | null;
1804
+ }>;
1805
+ }, "strip", z.ZodTypeAny, {
1806
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1807
+ id: string;
1808
+ sessionId: string;
1809
+ runId: string | null;
1810
+ payload: {
1811
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
1812
+ approvalId: string;
1813
+ reason: string | null;
1814
+ expiresAt: number;
1815
+ resolvedDecision: string | null;
1816
+ };
1817
+ revision: number;
1818
+ turnId: string;
1819
+ parentItemId: string | null;
1820
+ sourceSequence: number | null;
1821
+ startedAt: number | null;
1822
+ completedAt: number | null;
1823
+ kind: "approval";
1824
+ }, {
1825
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1826
+ id: string;
1827
+ sessionId: string;
1828
+ runId: string | null;
1829
+ payload: {
1830
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
1831
+ approvalId: string;
1832
+ reason: string | null;
1833
+ expiresAt: number;
1834
+ resolvedDecision: string | null;
1835
+ };
1836
+ revision: number;
1837
+ turnId: string;
1838
+ parentItemId: string | null;
1839
+ sourceSequence: number | null;
1840
+ startedAt: number | null;
1841
+ completedAt: number | null;
1842
+ kind: "approval";
1843
+ }>, z.ZodObject<{
1844
+ id: z.ZodString;
1845
+ sessionId: z.ZodString;
1846
+ turnId: z.ZodString;
1847
+ runId: z.ZodNullable<z.ZodString>;
1848
+ parentItemId: z.ZodNullable<z.ZodString>;
1849
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1850
+ revision: z.ZodNumber;
1851
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1852
+ startedAt: z.ZodNullable<z.ZodNumber>;
1853
+ completedAt: z.ZodNullable<z.ZodNumber>;
1854
+ } & {
1855
+ kind: z.ZodLiteral<"user_input_request">;
1856
+ payload: z.ZodObject<{
1857
+ requestId: z.ZodString;
1858
+ questions: z.ZodArray<z.ZodObject<{
1859
+ id: z.ZodString;
1860
+ prompt: z.ZodString;
1861
+ input: z.ZodEnum<["SINGLE_SELECT", "MULTI_SELECT", "SHORT_TEXT"]>;
1862
+ options: z.ZodArray<z.ZodObject<{
1863
+ value: z.ZodString;
1864
+ label: z.ZodString;
1865
+ description: z.ZodNullable<z.ZodString>;
1866
+ }, "strip", z.ZodTypeAny, {
1867
+ value: string;
1868
+ label: string;
1869
+ description: string | null;
1870
+ }, {
1871
+ value: string;
1872
+ label: string;
1873
+ description: string | null;
1874
+ }>, "many">;
1875
+ allowOther: z.ZodBoolean;
1876
+ }, "strip", z.ZodTypeAny, {
1877
+ options: {
1878
+ value: string;
1879
+ label: string;
1880
+ description: string | null;
1881
+ }[];
1882
+ id: string;
1883
+ prompt: string;
1884
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
1885
+ allowOther: boolean;
1886
+ }, {
1887
+ options: {
1888
+ value: string;
1889
+ label: string;
1890
+ description: string | null;
1891
+ }[];
1892
+ id: string;
1893
+ prompt: string;
1894
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
1895
+ allowOther: boolean;
1896
+ }>, "many">;
1897
+ }, "strip", z.ZodTypeAny, {
1898
+ requestId: string;
1899
+ questions: {
1900
+ options: {
1901
+ value: string;
1902
+ label: string;
1903
+ description: string | null;
1904
+ }[];
1905
+ id: string;
1906
+ prompt: string;
1907
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
1908
+ allowOther: boolean;
1909
+ }[];
1910
+ }, {
1911
+ requestId: string;
1912
+ questions: {
1913
+ options: {
1914
+ value: string;
1915
+ label: string;
1916
+ description: string | null;
1917
+ }[];
1918
+ id: string;
1919
+ prompt: string;
1920
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
1921
+ allowOther: boolean;
1922
+ }[];
1923
+ }>;
1924
+ }, "strip", z.ZodTypeAny, {
1925
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1926
+ id: string;
1927
+ sessionId: string;
1928
+ runId: string | null;
1929
+ payload: {
1930
+ requestId: string;
1931
+ questions: {
1932
+ options: {
1933
+ value: string;
1934
+ label: string;
1935
+ description: string | null;
1936
+ }[];
1937
+ id: string;
1938
+ prompt: string;
1939
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
1940
+ allowOther: boolean;
1941
+ }[];
1942
+ };
1943
+ revision: number;
1944
+ turnId: string;
1945
+ parentItemId: string | null;
1946
+ sourceSequence: number | null;
1947
+ startedAt: number | null;
1948
+ completedAt: number | null;
1949
+ kind: "user_input_request";
1950
+ }, {
1951
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
1952
+ id: string;
1953
+ sessionId: string;
1954
+ runId: string | null;
1955
+ payload: {
1956
+ requestId: string;
1957
+ questions: {
1958
+ options: {
1959
+ value: string;
1960
+ label: string;
1961
+ description: string | null;
1962
+ }[];
1963
+ id: string;
1964
+ prompt: string;
1965
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
1966
+ allowOther: boolean;
1967
+ }[];
1968
+ };
1969
+ revision: number;
1970
+ turnId: string;
1971
+ parentItemId: string | null;
1972
+ sourceSequence: number | null;
1973
+ startedAt: number | null;
1974
+ completedAt: number | null;
1975
+ kind: "user_input_request";
1976
+ }>, z.ZodObject<{
1977
+ id: z.ZodString;
1978
+ sessionId: z.ZodString;
1979
+ turnId: z.ZodString;
1980
+ runId: z.ZodNullable<z.ZodString>;
1981
+ parentItemId: z.ZodNullable<z.ZodString>;
1982
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
1983
+ revision: z.ZodNumber;
1984
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
1985
+ startedAt: z.ZodNullable<z.ZodNumber>;
1986
+ completedAt: z.ZodNullable<z.ZodNumber>;
1987
+ } & {
1988
+ kind: z.ZodLiteral<"context_compaction">;
1989
+ payload: z.ZodObject<{
1990
+ phase: z.ZodEnum<["STARTED", "COMPLETED"]>;
1991
+ summary: z.ZodNullable<z.ZodString>;
1992
+ }, "strip", z.ZodTypeAny, {
1993
+ phase: "COMPLETED" | "STARTED";
1994
+ summary: string | null;
1995
+ }, {
1996
+ phase: "COMPLETED" | "STARTED";
1997
+ summary: string | null;
1998
+ }>;
1999
+ }, "strip", z.ZodTypeAny, {
2000
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2001
+ id: string;
2002
+ sessionId: string;
2003
+ runId: string | null;
2004
+ payload: {
2005
+ phase: "COMPLETED" | "STARTED";
2006
+ summary: string | null;
2007
+ };
2008
+ revision: number;
2009
+ turnId: string;
2010
+ parentItemId: string | null;
2011
+ sourceSequence: number | null;
2012
+ startedAt: number | null;
2013
+ completedAt: number | null;
2014
+ kind: "context_compaction";
2015
+ }, {
2016
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2017
+ id: string;
2018
+ sessionId: string;
2019
+ runId: string | null;
2020
+ payload: {
2021
+ phase: "COMPLETED" | "STARTED";
2022
+ summary: string | null;
2023
+ };
2024
+ revision: number;
2025
+ turnId: string;
2026
+ parentItemId: string | null;
2027
+ sourceSequence: number | null;
2028
+ startedAt: number | null;
2029
+ completedAt: number | null;
2030
+ kind: "context_compaction";
2031
+ }>, z.ZodObject<{
2032
+ id: z.ZodString;
2033
+ sessionId: z.ZodString;
2034
+ turnId: z.ZodString;
2035
+ runId: z.ZodNullable<z.ZodString>;
2036
+ parentItemId: z.ZodNullable<z.ZodString>;
2037
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2038
+ revision: z.ZodNumber;
2039
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2040
+ startedAt: z.ZodNullable<z.ZodNumber>;
2041
+ completedAt: z.ZodNullable<z.ZodNumber>;
2042
+ } & {
2043
+ kind: z.ZodLiteral<"warning">;
2044
+ payload: z.ZodObject<{
2045
+ code: z.ZodString;
2046
+ message: z.ZodString;
2047
+ recoverable: z.ZodBoolean;
2048
+ }, "strip", z.ZodTypeAny, {
2049
+ code: string;
2050
+ message: string;
2051
+ recoverable: boolean;
2052
+ }, {
2053
+ code: string;
2054
+ message: string;
2055
+ recoverable: boolean;
2056
+ }>;
2057
+ }, "strip", z.ZodTypeAny, {
2058
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2059
+ id: string;
2060
+ sessionId: string;
2061
+ runId: string | null;
2062
+ payload: {
2063
+ code: string;
2064
+ message: string;
2065
+ recoverable: boolean;
2066
+ };
2067
+ revision: number;
2068
+ turnId: string;
2069
+ parentItemId: string | null;
2070
+ sourceSequence: number | null;
2071
+ startedAt: number | null;
2072
+ completedAt: number | null;
2073
+ kind: "warning";
2074
+ }, {
2075
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2076
+ id: string;
2077
+ sessionId: string;
2078
+ runId: string | null;
2079
+ payload: {
2080
+ code: string;
2081
+ message: string;
2082
+ recoverable: boolean;
2083
+ };
2084
+ revision: number;
2085
+ turnId: string;
2086
+ parentItemId: string | null;
2087
+ sourceSequence: number | null;
2088
+ startedAt: number | null;
2089
+ completedAt: number | null;
2090
+ kind: "warning";
2091
+ }>, z.ZodObject<{
2092
+ id: z.ZodString;
2093
+ sessionId: z.ZodString;
2094
+ turnId: z.ZodString;
2095
+ runId: z.ZodNullable<z.ZodString>;
2096
+ parentItemId: z.ZodNullable<z.ZodString>;
2097
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2098
+ revision: z.ZodNumber;
2099
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2100
+ startedAt: z.ZodNullable<z.ZodNumber>;
2101
+ completedAt: z.ZodNullable<z.ZodNumber>;
2102
+ } & {
2103
+ kind: z.ZodLiteral<"error">;
2104
+ payload: z.ZodObject<{
2105
+ code: z.ZodString;
2106
+ message: z.ZodString;
2107
+ recoverable: z.ZodBoolean;
2108
+ retryAfterMs: z.ZodNullable<z.ZodNumber>;
2109
+ }, "strip", z.ZodTypeAny, {
2110
+ code: string;
2111
+ message: string;
2112
+ recoverable: boolean;
2113
+ retryAfterMs: number | null;
2114
+ }, {
2115
+ code: string;
2116
+ message: string;
2117
+ recoverable: boolean;
2118
+ retryAfterMs: number | null;
2119
+ }>;
2120
+ }, "strip", z.ZodTypeAny, {
2121
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2122
+ id: string;
2123
+ sessionId: string;
2124
+ runId: string | null;
2125
+ payload: {
2126
+ code: string;
2127
+ message: string;
2128
+ recoverable: boolean;
2129
+ retryAfterMs: number | null;
2130
+ };
2131
+ revision: number;
2132
+ turnId: string;
2133
+ parentItemId: string | null;
2134
+ sourceSequence: number | null;
2135
+ startedAt: number | null;
2136
+ completedAt: number | null;
2137
+ kind: "error";
2138
+ }, {
2139
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2140
+ id: string;
2141
+ sessionId: string;
2142
+ runId: string | null;
2143
+ payload: {
2144
+ code: string;
2145
+ message: string;
2146
+ recoverable: boolean;
2147
+ retryAfterMs: number | null;
2148
+ };
2149
+ revision: number;
2150
+ turnId: string;
2151
+ parentItemId: string | null;
2152
+ sourceSequence: number | null;
2153
+ startedAt: number | null;
2154
+ completedAt: number | null;
2155
+ kind: "error";
2156
+ }>, z.ZodObject<{
2157
+ id: z.ZodString;
2158
+ sessionId: z.ZodString;
2159
+ turnId: z.ZodString;
2160
+ runId: z.ZodNullable<z.ZodString>;
2161
+ parentItemId: z.ZodNullable<z.ZodString>;
2162
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2163
+ revision: z.ZodNumber;
2164
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2165
+ startedAt: z.ZodNullable<z.ZodNumber>;
2166
+ completedAt: z.ZodNullable<z.ZodNumber>;
2167
+ } & {
2168
+ kind: z.ZodLiteral<"turn_summary">;
2169
+ payload: z.ZodObject<{
2170
+ status: z.ZodEnum<["QUEUED", "STARTING", "RUNNING", "CANCELLING", "SUCCEEDED", "FAILED", "CANCELLED", "INTERRUPTED"]>;
2171
+ durationMs: z.ZodNullable<z.ZodNumber>;
2172
+ }, "strip", z.ZodTypeAny, {
2173
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
2174
+ durationMs: number | null;
2175
+ }, {
2176
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
2177
+ durationMs: number | null;
2178
+ }>;
2179
+ }, "strip", z.ZodTypeAny, {
2180
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2181
+ id: string;
2182
+ sessionId: string;
2183
+ runId: string | null;
2184
+ payload: {
2185
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
2186
+ durationMs: number | null;
2187
+ };
2188
+ revision: number;
2189
+ turnId: string;
2190
+ parentItemId: string | null;
2191
+ sourceSequence: number | null;
2192
+ startedAt: number | null;
2193
+ completedAt: number | null;
2194
+ kind: "turn_summary";
2195
+ }, {
2196
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2197
+ id: string;
2198
+ sessionId: string;
2199
+ runId: string | null;
2200
+ payload: {
2201
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
2202
+ durationMs: number | null;
2203
+ };
2204
+ revision: number;
2205
+ turnId: string;
2206
+ parentItemId: string | null;
2207
+ sourceSequence: number | null;
2208
+ startedAt: number | null;
2209
+ completedAt: number | null;
2210
+ kind: "turn_summary";
2211
+ }>, z.ZodObject<{
2212
+ id: z.ZodString;
2213
+ sessionId: z.ZodString;
2214
+ turnId: z.ZodString;
2215
+ runId: z.ZodNullable<z.ZodString>;
2216
+ parentItemId: z.ZodNullable<z.ZodString>;
2217
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2218
+ revision: z.ZodNumber;
2219
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2220
+ startedAt: z.ZodNullable<z.ZodNumber>;
2221
+ completedAt: z.ZodNullable<z.ZodNumber>;
2222
+ } & {
2223
+ kind: z.ZodLiteral<"unknown">;
2224
+ payload: z.ZodObject<{
2225
+ sourceEventType: z.ZodString;
2226
+ label: z.ZodString;
2227
+ }, "strip", z.ZodTypeAny, {
2228
+ label: string;
2229
+ sourceEventType: string;
2230
+ }, {
2231
+ label: string;
2232
+ sourceEventType: string;
2233
+ }>;
2234
+ }, "strip", z.ZodTypeAny, {
2235
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2236
+ id: string;
2237
+ sessionId: string;
2238
+ runId: string | null;
2239
+ payload: {
2240
+ label: string;
2241
+ sourceEventType: string;
2242
+ };
2243
+ revision: number;
2244
+ turnId: string;
2245
+ parentItemId: string | null;
2246
+ sourceSequence: number | null;
2247
+ startedAt: number | null;
2248
+ completedAt: number | null;
2249
+ kind: "unknown";
2250
+ }, {
2251
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2252
+ id: string;
2253
+ sessionId: string;
2254
+ runId: string | null;
2255
+ payload: {
2256
+ label: string;
2257
+ sourceEventType: string;
2258
+ };
2259
+ revision: number;
2260
+ turnId: string;
2261
+ parentItemId: string | null;
2262
+ sourceSequence: number | null;
2263
+ startedAt: number | null;
2264
+ completedAt: number | null;
2265
+ kind: "unknown";
2266
+ }>]>;
2267
+ export type ConversationItem = z.infer<typeof conversationItemSchema>;
2268
+ export declare const conversationTurnSchema: z.ZodObject<{
2269
+ id: z.ZodString;
2270
+ sessionId: z.ZodString;
2271
+ runId: z.ZodNullable<z.ZodString>;
2272
+ userItemId: z.ZodNullable<z.ZodString>;
2273
+ status: z.ZodEnum<["QUEUED", "RUNNING", "WAITING_INPUT", "WAITING_APPROVAL", "SUCCEEDED", "FAILED", "CANCELLED", "INTERRUPTED", "LOST"]>;
2274
+ model: z.ZodNullable<z.ZodString>;
2275
+ effort: z.ZodNullable<z.ZodString>;
2276
+ access: z.ZodNullable<z.ZodString>;
2277
+ items: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2278
+ id: z.ZodString;
2279
+ sessionId: z.ZodString;
2280
+ turnId: z.ZodString;
2281
+ runId: z.ZodNullable<z.ZodString>;
2282
+ parentItemId: z.ZodNullable<z.ZodString>;
2283
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2284
+ revision: z.ZodNumber;
2285
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2286
+ startedAt: z.ZodNullable<z.ZodNumber>;
2287
+ completedAt: z.ZodNullable<z.ZodNumber>;
2288
+ } & {
2289
+ kind: z.ZodLiteral<"assistant_message">;
2290
+ payload: z.ZodObject<{
2291
+ text: z.ZodString;
2292
+ format: z.ZodLiteral<"markdown">;
2293
+ model: z.ZodNullable<z.ZodString>;
2294
+ }, "strip", z.ZodTypeAny, {
2295
+ model: string | null;
2296
+ text: string;
2297
+ format: "markdown";
2298
+ }, {
2299
+ model: string | null;
2300
+ text: string;
2301
+ format: "markdown";
2302
+ }>;
2303
+ }, "strip", z.ZodTypeAny, {
2304
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2305
+ id: string;
2306
+ sessionId: string;
2307
+ runId: string | null;
2308
+ payload: {
2309
+ model: string | null;
2310
+ text: string;
2311
+ format: "markdown";
2312
+ };
2313
+ revision: number;
2314
+ turnId: string;
2315
+ parentItemId: string | null;
2316
+ sourceSequence: number | null;
2317
+ startedAt: number | null;
2318
+ completedAt: number | null;
2319
+ kind: "assistant_message";
2320
+ }, {
2321
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2322
+ id: string;
2323
+ sessionId: string;
2324
+ runId: string | null;
2325
+ payload: {
2326
+ model: string | null;
2327
+ text: string;
2328
+ format: "markdown";
2329
+ };
2330
+ revision: number;
2331
+ turnId: string;
2332
+ parentItemId: string | null;
2333
+ sourceSequence: number | null;
2334
+ startedAt: number | null;
2335
+ completedAt: number | null;
2336
+ kind: "assistant_message";
2337
+ }>, z.ZodObject<{
2338
+ id: z.ZodString;
2339
+ sessionId: z.ZodString;
2340
+ turnId: z.ZodString;
2341
+ runId: z.ZodNullable<z.ZodString>;
2342
+ parentItemId: z.ZodNullable<z.ZodString>;
2343
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2344
+ revision: z.ZodNumber;
2345
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2346
+ startedAt: z.ZodNullable<z.ZodNumber>;
2347
+ completedAt: z.ZodNullable<z.ZodNumber>;
2348
+ } & {
2349
+ kind: z.ZodLiteral<"user_message">;
2350
+ payload: z.ZodObject<{
2351
+ clientMessageId: z.ZodNullable<z.ZodString>;
2352
+ text: z.ZodString;
2353
+ contexts: z.ZodDefault<z.ZodArray<z.ZodObject<{
2354
+ type: z.ZodEnum<["file", "directory", "changes", "diff", "turn", "message", "terminal_selection"]>;
2355
+ referenceId: z.ZodString;
2356
+ label: z.ZodString;
2357
+ path: z.ZodOptional<z.ZodString>;
2358
+ startLine: z.ZodOptional<z.ZodNumber>;
2359
+ endLine: z.ZodOptional<z.ZodNumber>;
2360
+ }, "strip", z.ZodTypeAny, {
2361
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
2362
+ label: string;
2363
+ referenceId: string;
2364
+ path?: string | undefined;
2365
+ startLine?: number | undefined;
2366
+ endLine?: number | undefined;
2367
+ }, {
2368
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
2369
+ label: string;
2370
+ referenceId: string;
2371
+ path?: string | undefined;
2372
+ startLine?: number | undefined;
2373
+ endLine?: number | undefined;
2374
+ }>, "many">>;
2375
+ delivery: z.ZodEnum<["PENDING", "ACCEPTED", "STEERED", "QUEUED_NEXT_TURN", "REJECTED"]>;
2376
+ }, "strip", z.ZodTypeAny, {
2377
+ clientMessageId: string | null;
2378
+ text: string;
2379
+ contexts: {
2380
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
2381
+ label: string;
2382
+ referenceId: string;
2383
+ path?: string | undefined;
2384
+ startLine?: number | undefined;
2385
+ endLine?: number | undefined;
2386
+ }[];
2387
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
2388
+ }, {
2389
+ clientMessageId: string | null;
2390
+ text: string;
2391
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
2392
+ contexts?: {
2393
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
2394
+ label: string;
2395
+ referenceId: string;
2396
+ path?: string | undefined;
2397
+ startLine?: number | undefined;
2398
+ endLine?: number | undefined;
2399
+ }[] | undefined;
2400
+ }>;
2401
+ }, "strip", z.ZodTypeAny, {
2402
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2403
+ id: string;
2404
+ sessionId: string;
2405
+ runId: string | null;
2406
+ payload: {
2407
+ clientMessageId: string | null;
2408
+ text: string;
2409
+ contexts: {
2410
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
2411
+ label: string;
2412
+ referenceId: string;
2413
+ path?: string | undefined;
2414
+ startLine?: number | undefined;
2415
+ endLine?: number | undefined;
2416
+ }[];
2417
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
2418
+ };
2419
+ revision: number;
2420
+ turnId: string;
2421
+ parentItemId: string | null;
2422
+ sourceSequence: number | null;
2423
+ startedAt: number | null;
2424
+ completedAt: number | null;
2425
+ kind: "user_message";
2426
+ }, {
2427
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2428
+ id: string;
2429
+ sessionId: string;
2430
+ runId: string | null;
2431
+ payload: {
2432
+ clientMessageId: string | null;
2433
+ text: string;
2434
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
2435
+ contexts?: {
2436
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
2437
+ label: string;
2438
+ referenceId: string;
2439
+ path?: string | undefined;
2440
+ startLine?: number | undefined;
2441
+ endLine?: number | undefined;
2442
+ }[] | undefined;
2443
+ };
2444
+ revision: number;
2445
+ turnId: string;
2446
+ parentItemId: string | null;
2447
+ sourceSequence: number | null;
2448
+ startedAt: number | null;
2449
+ completedAt: number | null;
2450
+ kind: "user_message";
2451
+ }>, z.ZodObject<{
2452
+ id: z.ZodString;
2453
+ sessionId: z.ZodString;
2454
+ turnId: z.ZodString;
2455
+ runId: z.ZodNullable<z.ZodString>;
2456
+ parentItemId: z.ZodNullable<z.ZodString>;
2457
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2458
+ revision: z.ZodNumber;
2459
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2460
+ startedAt: z.ZodNullable<z.ZodNumber>;
2461
+ completedAt: z.ZodNullable<z.ZodNumber>;
2462
+ } & {
2463
+ kind: z.ZodLiteral<"reasoning_summary">;
2464
+ payload: z.ZodObject<{
2465
+ sections: z.ZodArray<z.ZodObject<{
2466
+ index: z.ZodNumber;
2467
+ text: z.ZodString;
2468
+ }, "strip", z.ZodTypeAny, {
2469
+ text: string;
2470
+ index: number;
2471
+ }, {
2472
+ text: string;
2473
+ index: number;
2474
+ }>, "many">;
2475
+ }, "strip", z.ZodTypeAny, {
2476
+ sections: {
2477
+ text: string;
2478
+ index: number;
2479
+ }[];
2480
+ }, {
2481
+ sections: {
2482
+ text: string;
2483
+ index: number;
2484
+ }[];
2485
+ }>;
2486
+ }, "strip", z.ZodTypeAny, {
2487
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2488
+ id: string;
2489
+ sessionId: string;
2490
+ runId: string | null;
2491
+ payload: {
2492
+ sections: {
2493
+ text: string;
2494
+ index: number;
2495
+ }[];
2496
+ };
2497
+ revision: number;
2498
+ turnId: string;
2499
+ parentItemId: string | null;
2500
+ sourceSequence: number | null;
2501
+ startedAt: number | null;
2502
+ completedAt: number | null;
2503
+ kind: "reasoning_summary";
2504
+ }, {
2505
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2506
+ id: string;
2507
+ sessionId: string;
2508
+ runId: string | null;
2509
+ payload: {
2510
+ sections: {
2511
+ text: string;
2512
+ index: number;
2513
+ }[];
2514
+ };
2515
+ revision: number;
2516
+ turnId: string;
2517
+ parentItemId: string | null;
2518
+ sourceSequence: number | null;
2519
+ startedAt: number | null;
2520
+ completedAt: number | null;
2521
+ kind: "reasoning_summary";
2522
+ }>, z.ZodObject<{
2523
+ id: z.ZodString;
2524
+ sessionId: z.ZodString;
2525
+ turnId: z.ZodString;
2526
+ runId: z.ZodNullable<z.ZodString>;
2527
+ parentItemId: z.ZodNullable<z.ZodString>;
2528
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2529
+ revision: z.ZodNumber;
2530
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2531
+ startedAt: z.ZodNullable<z.ZodNumber>;
2532
+ completedAt: z.ZodNullable<z.ZodNumber>;
2533
+ } & {
2534
+ kind: z.ZodLiteral<"plan">;
2535
+ payload: z.ZodObject<{
2536
+ explanation: z.ZodNullable<z.ZodString>;
2537
+ steps: z.ZodArray<z.ZodObject<{
2538
+ id: z.ZodString;
2539
+ text: z.ZodString;
2540
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED"]>;
2541
+ }, "strip", z.ZodTypeAny, {
2542
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
2543
+ id: string;
2544
+ text: string;
2545
+ }, {
2546
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
2547
+ id: string;
2548
+ text: string;
2549
+ }>, "many">;
2550
+ }, "strip", z.ZodTypeAny, {
2551
+ explanation: string | null;
2552
+ steps: {
2553
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
2554
+ id: string;
2555
+ text: string;
2556
+ }[];
2557
+ }, {
2558
+ explanation: string | null;
2559
+ steps: {
2560
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
2561
+ id: string;
2562
+ text: string;
2563
+ }[];
2564
+ }>;
2565
+ }, "strip", z.ZodTypeAny, {
2566
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2567
+ id: string;
2568
+ sessionId: string;
2569
+ runId: string | null;
2570
+ payload: {
2571
+ explanation: string | null;
2572
+ steps: {
2573
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
2574
+ id: string;
2575
+ text: string;
2576
+ }[];
2577
+ };
2578
+ revision: number;
2579
+ turnId: string;
2580
+ parentItemId: string | null;
2581
+ sourceSequence: number | null;
2582
+ startedAt: number | null;
2583
+ completedAt: number | null;
2584
+ kind: "plan";
2585
+ }, {
2586
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2587
+ id: string;
2588
+ sessionId: string;
2589
+ runId: string | null;
2590
+ payload: {
2591
+ explanation: string | null;
2592
+ steps: {
2593
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
2594
+ id: string;
2595
+ text: string;
2596
+ }[];
2597
+ };
2598
+ revision: number;
2599
+ turnId: string;
2600
+ parentItemId: string | null;
2601
+ sourceSequence: number | null;
2602
+ startedAt: number | null;
2603
+ completedAt: number | null;
2604
+ kind: "plan";
2605
+ }>, z.ZodObject<{
2606
+ id: z.ZodString;
2607
+ sessionId: z.ZodString;
2608
+ turnId: z.ZodString;
2609
+ runId: z.ZodNullable<z.ZodString>;
2610
+ parentItemId: z.ZodNullable<z.ZodString>;
2611
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2612
+ revision: z.ZodNumber;
2613
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2614
+ startedAt: z.ZodNullable<z.ZodNumber>;
2615
+ completedAt: z.ZodNullable<z.ZodNumber>;
2616
+ } & {
2617
+ kind: z.ZodLiteral<"tool_call">;
2618
+ payload: z.ZodObject<{
2619
+ namespace: z.ZodString;
2620
+ toolName: z.ZodString;
2621
+ title: z.ZodString;
2622
+ inputSummary: z.ZodNullable<z.ZodString>;
2623
+ outputSummary: z.ZodNullable<z.ZodString>;
2624
+ progressLabel: z.ZodNullable<z.ZodString>;
2625
+ errorCode: z.ZodNullable<z.ZodString>;
2626
+ truncated: z.ZodBoolean;
2627
+ }, "strip", z.ZodTypeAny, {
2628
+ namespace: string;
2629
+ toolName: string;
2630
+ title: string;
2631
+ inputSummary: string | null;
2632
+ outputSummary: string | null;
2633
+ progressLabel: string | null;
2634
+ errorCode: string | null;
2635
+ truncated: boolean;
2636
+ }, {
2637
+ namespace: string;
2638
+ toolName: string;
2639
+ title: string;
2640
+ inputSummary: string | null;
2641
+ outputSummary: string | null;
2642
+ progressLabel: string | null;
2643
+ errorCode: string | null;
2644
+ truncated: boolean;
2645
+ }>;
2646
+ }, "strip", z.ZodTypeAny, {
2647
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2648
+ id: string;
2649
+ sessionId: string;
2650
+ runId: string | null;
2651
+ payload: {
2652
+ namespace: string;
2653
+ toolName: string;
2654
+ title: string;
2655
+ inputSummary: string | null;
2656
+ outputSummary: string | null;
2657
+ progressLabel: string | null;
2658
+ errorCode: string | null;
2659
+ truncated: boolean;
2660
+ };
2661
+ revision: number;
2662
+ turnId: string;
2663
+ parentItemId: string | null;
2664
+ sourceSequence: number | null;
2665
+ startedAt: number | null;
2666
+ completedAt: number | null;
2667
+ kind: "tool_call";
2668
+ }, {
2669
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2670
+ id: string;
2671
+ sessionId: string;
2672
+ runId: string | null;
2673
+ payload: {
2674
+ namespace: string;
2675
+ toolName: string;
2676
+ title: string;
2677
+ inputSummary: string | null;
2678
+ outputSummary: string | null;
2679
+ progressLabel: string | null;
2680
+ errorCode: string | null;
2681
+ truncated: boolean;
2682
+ };
2683
+ revision: number;
2684
+ turnId: string;
2685
+ parentItemId: string | null;
2686
+ sourceSequence: number | null;
2687
+ startedAt: number | null;
2688
+ completedAt: number | null;
2689
+ kind: "tool_call";
2690
+ }>, z.ZodObject<{
2691
+ id: z.ZodString;
2692
+ sessionId: z.ZodString;
2693
+ turnId: z.ZodString;
2694
+ runId: z.ZodNullable<z.ZodString>;
2695
+ parentItemId: z.ZodNullable<z.ZodString>;
2696
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2697
+ revision: z.ZodNumber;
2698
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2699
+ startedAt: z.ZodNullable<z.ZodNumber>;
2700
+ completedAt: z.ZodNullable<z.ZodNumber>;
2701
+ } & {
2702
+ kind: z.ZodLiteral<"command_execution">;
2703
+ payload: z.ZodObject<{
2704
+ command: z.ZodString;
2705
+ cwd: z.ZodNullable<z.ZodString>;
2706
+ outputPreview: z.ZodString;
2707
+ outputRef: z.ZodNullable<z.ZodString>;
2708
+ exitCode: z.ZodNullable<z.ZodNumber>;
2709
+ durationMs: z.ZodNullable<z.ZodNumber>;
2710
+ truncated: z.ZodBoolean;
2711
+ }, "strip", z.ZodTypeAny, {
2712
+ durationMs: number | null;
2713
+ truncated: boolean;
2714
+ command: string;
2715
+ cwd: string | null;
2716
+ outputPreview: string;
2717
+ outputRef: string | null;
2718
+ exitCode: number | null;
2719
+ }, {
2720
+ durationMs: number | null;
2721
+ truncated: boolean;
2722
+ command: string;
2723
+ cwd: string | null;
2724
+ outputPreview: string;
2725
+ outputRef: string | null;
2726
+ exitCode: number | null;
2727
+ }>;
2728
+ }, "strip", z.ZodTypeAny, {
2729
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2730
+ id: string;
2731
+ sessionId: string;
2732
+ runId: string | null;
2733
+ payload: {
2734
+ durationMs: number | null;
2735
+ truncated: boolean;
2736
+ command: string;
2737
+ cwd: string | null;
2738
+ outputPreview: string;
2739
+ outputRef: string | null;
2740
+ exitCode: number | null;
2741
+ };
2742
+ revision: number;
2743
+ turnId: string;
2744
+ parentItemId: string | null;
2745
+ sourceSequence: number | null;
2746
+ startedAt: number | null;
2747
+ completedAt: number | null;
2748
+ kind: "command_execution";
2749
+ }, {
2750
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2751
+ id: string;
2752
+ sessionId: string;
2753
+ runId: string | null;
2754
+ payload: {
2755
+ durationMs: number | null;
2756
+ truncated: boolean;
2757
+ command: string;
2758
+ cwd: string | null;
2759
+ outputPreview: string;
2760
+ outputRef: string | null;
2761
+ exitCode: number | null;
2762
+ };
2763
+ revision: number;
2764
+ turnId: string;
2765
+ parentItemId: string | null;
2766
+ sourceSequence: number | null;
2767
+ startedAt: number | null;
2768
+ completedAt: number | null;
2769
+ kind: "command_execution";
2770
+ }>, z.ZodObject<{
2771
+ id: z.ZodString;
2772
+ sessionId: z.ZodString;
2773
+ turnId: z.ZodString;
2774
+ runId: z.ZodNullable<z.ZodString>;
2775
+ parentItemId: z.ZodNullable<z.ZodString>;
2776
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2777
+ revision: z.ZodNumber;
2778
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2779
+ startedAt: z.ZodNullable<z.ZodNumber>;
2780
+ completedAt: z.ZodNullable<z.ZodNumber>;
2781
+ } & {
2782
+ kind: z.ZodLiteral<"file_change">;
2783
+ payload: z.ZodObject<{
2784
+ changes: z.ZodArray<z.ZodObject<{
2785
+ path: z.ZodString;
2786
+ change: z.ZodEnum<["ADDED", "MODIFIED", "DELETED", "RENAMED", "COPIED", "TYPE_CHANGED"]>;
2787
+ additions: z.ZodNullable<z.ZodNumber>;
2788
+ deletions: z.ZodNullable<z.ZodNumber>;
2789
+ diffAvailable: z.ZodBoolean;
2790
+ }, "strip", z.ZodTypeAny, {
2791
+ path: string;
2792
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
2793
+ additions: number | null;
2794
+ deletions: number | null;
2795
+ diffAvailable: boolean;
2796
+ }, {
2797
+ path: string;
2798
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
2799
+ additions: number | null;
2800
+ deletions: number | null;
2801
+ diffAvailable: boolean;
2802
+ }>, "many">;
2803
+ }, "strip", z.ZodTypeAny, {
2804
+ changes: {
2805
+ path: string;
2806
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
2807
+ additions: number | null;
2808
+ deletions: number | null;
2809
+ diffAvailable: boolean;
2810
+ }[];
2811
+ }, {
2812
+ changes: {
2813
+ path: string;
2814
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
2815
+ additions: number | null;
2816
+ deletions: number | null;
2817
+ diffAvailable: boolean;
2818
+ }[];
2819
+ }>;
2820
+ }, "strip", z.ZodTypeAny, {
2821
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2822
+ id: string;
2823
+ sessionId: string;
2824
+ runId: string | null;
2825
+ payload: {
2826
+ changes: {
2827
+ path: string;
2828
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
2829
+ additions: number | null;
2830
+ deletions: number | null;
2831
+ diffAvailable: boolean;
2832
+ }[];
2833
+ };
2834
+ revision: number;
2835
+ turnId: string;
2836
+ parentItemId: string | null;
2837
+ sourceSequence: number | null;
2838
+ startedAt: number | null;
2839
+ completedAt: number | null;
2840
+ kind: "file_change";
2841
+ }, {
2842
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2843
+ id: string;
2844
+ sessionId: string;
2845
+ runId: string | null;
2846
+ payload: {
2847
+ changes: {
2848
+ path: string;
2849
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
2850
+ additions: number | null;
2851
+ deletions: number | null;
2852
+ diffAvailable: boolean;
2853
+ }[];
2854
+ };
2855
+ revision: number;
2856
+ turnId: string;
2857
+ parentItemId: string | null;
2858
+ sourceSequence: number | null;
2859
+ startedAt: number | null;
2860
+ completedAt: number | null;
2861
+ kind: "file_change";
2862
+ }>, z.ZodObject<{
2863
+ id: z.ZodString;
2864
+ sessionId: z.ZodString;
2865
+ turnId: z.ZodString;
2866
+ runId: z.ZodNullable<z.ZodString>;
2867
+ parentItemId: z.ZodNullable<z.ZodString>;
2868
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2869
+ revision: z.ZodNumber;
2870
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2871
+ startedAt: z.ZodNullable<z.ZodNumber>;
2872
+ completedAt: z.ZodNullable<z.ZodNumber>;
2873
+ } & {
2874
+ kind: z.ZodLiteral<"approval">;
2875
+ payload: z.ZodObject<{
2876
+ approvalId: z.ZodString;
2877
+ category: z.ZodEnum<["COMMAND", "FILE_CHANGE", "NETWORK", "TOOL", "OTHER"]>;
2878
+ reason: z.ZodNullable<z.ZodString>;
2879
+ expiresAt: z.ZodNumber;
2880
+ resolvedDecision: z.ZodNullable<z.ZodString>;
2881
+ }, "strip", z.ZodTypeAny, {
2882
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
2883
+ approvalId: string;
2884
+ reason: string | null;
2885
+ expiresAt: number;
2886
+ resolvedDecision: string | null;
2887
+ }, {
2888
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
2889
+ approvalId: string;
2890
+ reason: string | null;
2891
+ expiresAt: number;
2892
+ resolvedDecision: string | null;
2893
+ }>;
2894
+ }, "strip", z.ZodTypeAny, {
2895
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2896
+ id: string;
2897
+ sessionId: string;
2898
+ runId: string | null;
2899
+ payload: {
2900
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
2901
+ approvalId: string;
2902
+ reason: string | null;
2903
+ expiresAt: number;
2904
+ resolvedDecision: string | null;
2905
+ };
2906
+ revision: number;
2907
+ turnId: string;
2908
+ parentItemId: string | null;
2909
+ sourceSequence: number | null;
2910
+ startedAt: number | null;
2911
+ completedAt: number | null;
2912
+ kind: "approval";
2913
+ }, {
2914
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
2915
+ id: string;
2916
+ sessionId: string;
2917
+ runId: string | null;
2918
+ payload: {
2919
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
2920
+ approvalId: string;
2921
+ reason: string | null;
2922
+ expiresAt: number;
2923
+ resolvedDecision: string | null;
2924
+ };
2925
+ revision: number;
2926
+ turnId: string;
2927
+ parentItemId: string | null;
2928
+ sourceSequence: number | null;
2929
+ startedAt: number | null;
2930
+ completedAt: number | null;
2931
+ kind: "approval";
2932
+ }>, z.ZodObject<{
2933
+ id: z.ZodString;
2934
+ sessionId: z.ZodString;
2935
+ turnId: z.ZodString;
2936
+ runId: z.ZodNullable<z.ZodString>;
2937
+ parentItemId: z.ZodNullable<z.ZodString>;
2938
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
2939
+ revision: z.ZodNumber;
2940
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
2941
+ startedAt: z.ZodNullable<z.ZodNumber>;
2942
+ completedAt: z.ZodNullable<z.ZodNumber>;
2943
+ } & {
2944
+ kind: z.ZodLiteral<"user_input_request">;
2945
+ payload: z.ZodObject<{
2946
+ requestId: z.ZodString;
2947
+ questions: z.ZodArray<z.ZodObject<{
2948
+ id: z.ZodString;
2949
+ prompt: z.ZodString;
2950
+ input: z.ZodEnum<["SINGLE_SELECT", "MULTI_SELECT", "SHORT_TEXT"]>;
2951
+ options: z.ZodArray<z.ZodObject<{
2952
+ value: z.ZodString;
2953
+ label: z.ZodString;
2954
+ description: z.ZodNullable<z.ZodString>;
2955
+ }, "strip", z.ZodTypeAny, {
2956
+ value: string;
2957
+ label: string;
2958
+ description: string | null;
2959
+ }, {
2960
+ value: string;
2961
+ label: string;
2962
+ description: string | null;
2963
+ }>, "many">;
2964
+ allowOther: z.ZodBoolean;
2965
+ }, "strip", z.ZodTypeAny, {
2966
+ options: {
2967
+ value: string;
2968
+ label: string;
2969
+ description: string | null;
2970
+ }[];
2971
+ id: string;
2972
+ prompt: string;
2973
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
2974
+ allowOther: boolean;
2975
+ }, {
2976
+ options: {
2977
+ value: string;
2978
+ label: string;
2979
+ description: string | null;
2980
+ }[];
2981
+ id: string;
2982
+ prompt: string;
2983
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
2984
+ allowOther: boolean;
2985
+ }>, "many">;
2986
+ }, "strip", z.ZodTypeAny, {
2987
+ requestId: string;
2988
+ questions: {
2989
+ options: {
2990
+ value: string;
2991
+ label: string;
2992
+ description: string | null;
2993
+ }[];
2994
+ id: string;
2995
+ prompt: string;
2996
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
2997
+ allowOther: boolean;
2998
+ }[];
2999
+ }, {
3000
+ requestId: string;
3001
+ questions: {
3002
+ options: {
3003
+ value: string;
3004
+ label: string;
3005
+ description: string | null;
3006
+ }[];
3007
+ id: string;
3008
+ prompt: string;
3009
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
3010
+ allowOther: boolean;
3011
+ }[];
3012
+ }>;
3013
+ }, "strip", z.ZodTypeAny, {
3014
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3015
+ id: string;
3016
+ sessionId: string;
3017
+ runId: string | null;
3018
+ payload: {
3019
+ requestId: string;
3020
+ questions: {
3021
+ options: {
3022
+ value: string;
3023
+ label: string;
3024
+ description: string | null;
3025
+ }[];
3026
+ id: string;
3027
+ prompt: string;
3028
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
3029
+ allowOther: boolean;
3030
+ }[];
3031
+ };
3032
+ revision: number;
3033
+ turnId: string;
3034
+ parentItemId: string | null;
3035
+ sourceSequence: number | null;
3036
+ startedAt: number | null;
3037
+ completedAt: number | null;
3038
+ kind: "user_input_request";
3039
+ }, {
3040
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3041
+ id: string;
3042
+ sessionId: string;
3043
+ runId: string | null;
3044
+ payload: {
3045
+ requestId: string;
3046
+ questions: {
3047
+ options: {
3048
+ value: string;
3049
+ label: string;
3050
+ description: string | null;
3051
+ }[];
3052
+ id: string;
3053
+ prompt: string;
3054
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
3055
+ allowOther: boolean;
3056
+ }[];
3057
+ };
3058
+ revision: number;
3059
+ turnId: string;
3060
+ parentItemId: string | null;
3061
+ sourceSequence: number | null;
3062
+ startedAt: number | null;
3063
+ completedAt: number | null;
3064
+ kind: "user_input_request";
3065
+ }>, z.ZodObject<{
3066
+ id: z.ZodString;
3067
+ sessionId: z.ZodString;
3068
+ turnId: z.ZodString;
3069
+ runId: z.ZodNullable<z.ZodString>;
3070
+ parentItemId: z.ZodNullable<z.ZodString>;
3071
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
3072
+ revision: z.ZodNumber;
3073
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
3074
+ startedAt: z.ZodNullable<z.ZodNumber>;
3075
+ completedAt: z.ZodNullable<z.ZodNumber>;
3076
+ } & {
3077
+ kind: z.ZodLiteral<"context_compaction">;
3078
+ payload: z.ZodObject<{
3079
+ phase: z.ZodEnum<["STARTED", "COMPLETED"]>;
3080
+ summary: z.ZodNullable<z.ZodString>;
3081
+ }, "strip", z.ZodTypeAny, {
3082
+ phase: "COMPLETED" | "STARTED";
3083
+ summary: string | null;
3084
+ }, {
3085
+ phase: "COMPLETED" | "STARTED";
3086
+ summary: string | null;
3087
+ }>;
3088
+ }, "strip", z.ZodTypeAny, {
3089
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3090
+ id: string;
3091
+ sessionId: string;
3092
+ runId: string | null;
3093
+ payload: {
3094
+ phase: "COMPLETED" | "STARTED";
3095
+ summary: string | null;
3096
+ };
3097
+ revision: number;
3098
+ turnId: string;
3099
+ parentItemId: string | null;
3100
+ sourceSequence: number | null;
3101
+ startedAt: number | null;
3102
+ completedAt: number | null;
3103
+ kind: "context_compaction";
3104
+ }, {
3105
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3106
+ id: string;
3107
+ sessionId: string;
3108
+ runId: string | null;
3109
+ payload: {
3110
+ phase: "COMPLETED" | "STARTED";
3111
+ summary: string | null;
3112
+ };
3113
+ revision: number;
3114
+ turnId: string;
3115
+ parentItemId: string | null;
3116
+ sourceSequence: number | null;
3117
+ startedAt: number | null;
3118
+ completedAt: number | null;
3119
+ kind: "context_compaction";
3120
+ }>, z.ZodObject<{
3121
+ id: z.ZodString;
3122
+ sessionId: z.ZodString;
3123
+ turnId: z.ZodString;
3124
+ runId: z.ZodNullable<z.ZodString>;
3125
+ parentItemId: z.ZodNullable<z.ZodString>;
3126
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
3127
+ revision: z.ZodNumber;
3128
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
3129
+ startedAt: z.ZodNullable<z.ZodNumber>;
3130
+ completedAt: z.ZodNullable<z.ZodNumber>;
3131
+ } & {
3132
+ kind: z.ZodLiteral<"warning">;
3133
+ payload: z.ZodObject<{
3134
+ code: z.ZodString;
3135
+ message: z.ZodString;
3136
+ recoverable: z.ZodBoolean;
3137
+ }, "strip", z.ZodTypeAny, {
3138
+ code: string;
3139
+ message: string;
3140
+ recoverable: boolean;
3141
+ }, {
3142
+ code: string;
3143
+ message: string;
3144
+ recoverable: boolean;
3145
+ }>;
3146
+ }, "strip", z.ZodTypeAny, {
3147
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3148
+ id: string;
3149
+ sessionId: string;
3150
+ runId: string | null;
3151
+ payload: {
3152
+ code: string;
3153
+ message: string;
3154
+ recoverable: boolean;
3155
+ };
3156
+ revision: number;
3157
+ turnId: string;
3158
+ parentItemId: string | null;
3159
+ sourceSequence: number | null;
3160
+ startedAt: number | null;
3161
+ completedAt: number | null;
3162
+ kind: "warning";
3163
+ }, {
3164
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3165
+ id: string;
3166
+ sessionId: string;
3167
+ runId: string | null;
3168
+ payload: {
3169
+ code: string;
3170
+ message: string;
3171
+ recoverable: boolean;
3172
+ };
3173
+ revision: number;
3174
+ turnId: string;
3175
+ parentItemId: string | null;
3176
+ sourceSequence: number | null;
3177
+ startedAt: number | null;
3178
+ completedAt: number | null;
3179
+ kind: "warning";
3180
+ }>, z.ZodObject<{
3181
+ id: z.ZodString;
3182
+ sessionId: z.ZodString;
3183
+ turnId: z.ZodString;
3184
+ runId: z.ZodNullable<z.ZodString>;
3185
+ parentItemId: z.ZodNullable<z.ZodString>;
3186
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
3187
+ revision: z.ZodNumber;
3188
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
3189
+ startedAt: z.ZodNullable<z.ZodNumber>;
3190
+ completedAt: z.ZodNullable<z.ZodNumber>;
3191
+ } & {
3192
+ kind: z.ZodLiteral<"error">;
3193
+ payload: z.ZodObject<{
3194
+ code: z.ZodString;
3195
+ message: z.ZodString;
3196
+ recoverable: z.ZodBoolean;
3197
+ retryAfterMs: z.ZodNullable<z.ZodNumber>;
3198
+ }, "strip", z.ZodTypeAny, {
3199
+ code: string;
3200
+ message: string;
3201
+ recoverable: boolean;
3202
+ retryAfterMs: number | null;
3203
+ }, {
3204
+ code: string;
3205
+ message: string;
3206
+ recoverable: boolean;
3207
+ retryAfterMs: number | null;
3208
+ }>;
3209
+ }, "strip", z.ZodTypeAny, {
3210
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3211
+ id: string;
3212
+ sessionId: string;
3213
+ runId: string | null;
3214
+ payload: {
3215
+ code: string;
3216
+ message: string;
3217
+ recoverable: boolean;
3218
+ retryAfterMs: number | null;
3219
+ };
3220
+ revision: number;
3221
+ turnId: string;
3222
+ parentItemId: string | null;
3223
+ sourceSequence: number | null;
3224
+ startedAt: number | null;
3225
+ completedAt: number | null;
3226
+ kind: "error";
3227
+ }, {
3228
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3229
+ id: string;
3230
+ sessionId: string;
3231
+ runId: string | null;
3232
+ payload: {
3233
+ code: string;
3234
+ message: string;
3235
+ recoverable: boolean;
3236
+ retryAfterMs: number | null;
3237
+ };
3238
+ revision: number;
3239
+ turnId: string;
3240
+ parentItemId: string | null;
3241
+ sourceSequence: number | null;
3242
+ startedAt: number | null;
3243
+ completedAt: number | null;
3244
+ kind: "error";
3245
+ }>, z.ZodObject<{
3246
+ id: z.ZodString;
3247
+ sessionId: z.ZodString;
3248
+ turnId: z.ZodString;
3249
+ runId: z.ZodNullable<z.ZodString>;
3250
+ parentItemId: z.ZodNullable<z.ZodString>;
3251
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
3252
+ revision: z.ZodNumber;
3253
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
3254
+ startedAt: z.ZodNullable<z.ZodNumber>;
3255
+ completedAt: z.ZodNullable<z.ZodNumber>;
3256
+ } & {
3257
+ kind: z.ZodLiteral<"turn_summary">;
3258
+ payload: z.ZodObject<{
3259
+ status: z.ZodEnum<["QUEUED", "STARTING", "RUNNING", "CANCELLING", "SUCCEEDED", "FAILED", "CANCELLED", "INTERRUPTED"]>;
3260
+ durationMs: z.ZodNullable<z.ZodNumber>;
3261
+ }, "strip", z.ZodTypeAny, {
3262
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
3263
+ durationMs: number | null;
3264
+ }, {
3265
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
3266
+ durationMs: number | null;
3267
+ }>;
3268
+ }, "strip", z.ZodTypeAny, {
3269
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3270
+ id: string;
3271
+ sessionId: string;
3272
+ runId: string | null;
3273
+ payload: {
3274
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
3275
+ durationMs: number | null;
3276
+ };
3277
+ revision: number;
3278
+ turnId: string;
3279
+ parentItemId: string | null;
3280
+ sourceSequence: number | null;
3281
+ startedAt: number | null;
3282
+ completedAt: number | null;
3283
+ kind: "turn_summary";
3284
+ }, {
3285
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3286
+ id: string;
3287
+ sessionId: string;
3288
+ runId: string | null;
3289
+ payload: {
3290
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
3291
+ durationMs: number | null;
3292
+ };
3293
+ revision: number;
3294
+ turnId: string;
3295
+ parentItemId: string | null;
3296
+ sourceSequence: number | null;
3297
+ startedAt: number | null;
3298
+ completedAt: number | null;
3299
+ kind: "turn_summary";
3300
+ }>, z.ZodObject<{
3301
+ id: z.ZodString;
3302
+ sessionId: z.ZodString;
3303
+ turnId: z.ZodString;
3304
+ runId: z.ZodNullable<z.ZodString>;
3305
+ parentItemId: z.ZodNullable<z.ZodString>;
3306
+ sourceSequence: z.ZodNullable<z.ZodNumber>;
3307
+ revision: z.ZodNumber;
3308
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "DECLINED", "CANCELLED", "INTERRUPTED"]>;
3309
+ startedAt: z.ZodNullable<z.ZodNumber>;
3310
+ completedAt: z.ZodNullable<z.ZodNumber>;
3311
+ } & {
3312
+ kind: z.ZodLiteral<"unknown">;
3313
+ payload: z.ZodObject<{
3314
+ sourceEventType: z.ZodString;
3315
+ label: z.ZodString;
3316
+ }, "strip", z.ZodTypeAny, {
3317
+ label: string;
3318
+ sourceEventType: string;
3319
+ }, {
3320
+ label: string;
3321
+ sourceEventType: string;
3322
+ }>;
3323
+ }, "strip", z.ZodTypeAny, {
3324
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3325
+ id: string;
3326
+ sessionId: string;
3327
+ runId: string | null;
3328
+ payload: {
3329
+ label: string;
3330
+ sourceEventType: string;
3331
+ };
3332
+ revision: number;
3333
+ turnId: string;
3334
+ parentItemId: string | null;
3335
+ sourceSequence: number | null;
3336
+ startedAt: number | null;
3337
+ completedAt: number | null;
3338
+ kind: "unknown";
3339
+ }, {
3340
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3341
+ id: string;
3342
+ sessionId: string;
3343
+ runId: string | null;
3344
+ payload: {
3345
+ label: string;
3346
+ sourceEventType: string;
3347
+ };
3348
+ revision: number;
3349
+ turnId: string;
3350
+ parentItemId: string | null;
3351
+ sourceSequence: number | null;
3352
+ startedAt: number | null;
3353
+ completedAt: number | null;
3354
+ kind: "unknown";
3355
+ }>]>, "many">;
3356
+ startedAt: z.ZodNullable<z.ZodNumber>;
3357
+ completedAt: z.ZodNullable<z.ZodNumber>;
3358
+ }, "strip", z.ZodTypeAny, {
3359
+ status: "QUEUED" | "RUNNING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED" | "WAITING_INPUT" | "WAITING_APPROVAL" | "LOST";
3360
+ id: string;
3361
+ sessionId: string;
3362
+ items: ({
3363
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3364
+ id: string;
3365
+ sessionId: string;
3366
+ runId: string | null;
3367
+ payload: {
3368
+ model: string | null;
3369
+ text: string;
3370
+ format: "markdown";
3371
+ };
3372
+ revision: number;
3373
+ turnId: string;
3374
+ parentItemId: string | null;
3375
+ sourceSequence: number | null;
3376
+ startedAt: number | null;
3377
+ completedAt: number | null;
3378
+ kind: "assistant_message";
3379
+ } | {
3380
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3381
+ id: string;
3382
+ sessionId: string;
3383
+ runId: string | null;
3384
+ payload: {
3385
+ clientMessageId: string | null;
3386
+ text: string;
3387
+ contexts: {
3388
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
3389
+ label: string;
3390
+ referenceId: string;
3391
+ path?: string | undefined;
3392
+ startLine?: number | undefined;
3393
+ endLine?: number | undefined;
3394
+ }[];
3395
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
3396
+ };
3397
+ revision: number;
3398
+ turnId: string;
3399
+ parentItemId: string | null;
3400
+ sourceSequence: number | null;
3401
+ startedAt: number | null;
3402
+ completedAt: number | null;
3403
+ kind: "user_message";
3404
+ } | {
3405
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3406
+ id: string;
3407
+ sessionId: string;
3408
+ runId: string | null;
3409
+ payload: {
3410
+ explanation: string | null;
3411
+ steps: {
3412
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
3413
+ id: string;
3414
+ text: string;
3415
+ }[];
3416
+ };
3417
+ revision: number;
3418
+ turnId: string;
3419
+ parentItemId: string | null;
3420
+ sourceSequence: number | null;
3421
+ startedAt: number | null;
3422
+ completedAt: number | null;
3423
+ kind: "plan";
3424
+ } | {
3425
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3426
+ id: string;
3427
+ sessionId: string;
3428
+ runId: string | null;
3429
+ payload: {
3430
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
3431
+ approvalId: string;
3432
+ reason: string | null;
3433
+ expiresAt: number;
3434
+ resolvedDecision: string | null;
3435
+ };
3436
+ revision: number;
3437
+ turnId: string;
3438
+ parentItemId: string | null;
3439
+ sourceSequence: number | null;
3440
+ startedAt: number | null;
3441
+ completedAt: number | null;
3442
+ kind: "approval";
3443
+ } | {
3444
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3445
+ id: string;
3446
+ sessionId: string;
3447
+ runId: string | null;
3448
+ payload: {
3449
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
3450
+ durationMs: number | null;
3451
+ };
3452
+ revision: number;
3453
+ turnId: string;
3454
+ parentItemId: string | null;
3455
+ sourceSequence: number | null;
3456
+ startedAt: number | null;
3457
+ completedAt: number | null;
3458
+ kind: "turn_summary";
3459
+ } | {
3460
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3461
+ id: string;
3462
+ sessionId: string;
3463
+ runId: string | null;
3464
+ payload: {
3465
+ sections: {
3466
+ text: string;
3467
+ index: number;
3468
+ }[];
3469
+ };
3470
+ revision: number;
3471
+ turnId: string;
3472
+ parentItemId: string | null;
3473
+ sourceSequence: number | null;
3474
+ startedAt: number | null;
3475
+ completedAt: number | null;
3476
+ kind: "reasoning_summary";
3477
+ } | {
3478
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3479
+ id: string;
3480
+ sessionId: string;
3481
+ runId: string | null;
3482
+ payload: {
3483
+ namespace: string;
3484
+ toolName: string;
3485
+ title: string;
3486
+ inputSummary: string | null;
3487
+ outputSummary: string | null;
3488
+ progressLabel: string | null;
3489
+ errorCode: string | null;
3490
+ truncated: boolean;
3491
+ };
3492
+ revision: number;
3493
+ turnId: string;
3494
+ parentItemId: string | null;
3495
+ sourceSequence: number | null;
3496
+ startedAt: number | null;
3497
+ completedAt: number | null;
3498
+ kind: "tool_call";
3499
+ } | {
3500
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3501
+ id: string;
3502
+ sessionId: string;
3503
+ runId: string | null;
3504
+ payload: {
3505
+ durationMs: number | null;
3506
+ truncated: boolean;
3507
+ command: string;
3508
+ cwd: string | null;
3509
+ outputPreview: string;
3510
+ outputRef: string | null;
3511
+ exitCode: number | null;
3512
+ };
3513
+ revision: number;
3514
+ turnId: string;
3515
+ parentItemId: string | null;
3516
+ sourceSequence: number | null;
3517
+ startedAt: number | null;
3518
+ completedAt: number | null;
3519
+ kind: "command_execution";
3520
+ } | {
3521
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3522
+ id: string;
3523
+ sessionId: string;
3524
+ runId: string | null;
3525
+ payload: {
3526
+ changes: {
3527
+ path: string;
3528
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
3529
+ additions: number | null;
3530
+ deletions: number | null;
3531
+ diffAvailable: boolean;
3532
+ }[];
3533
+ };
3534
+ revision: number;
3535
+ turnId: string;
3536
+ parentItemId: string | null;
3537
+ sourceSequence: number | null;
3538
+ startedAt: number | null;
3539
+ completedAt: number | null;
3540
+ kind: "file_change";
3541
+ } | {
3542
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3543
+ id: string;
3544
+ sessionId: string;
3545
+ runId: string | null;
3546
+ payload: {
3547
+ requestId: string;
3548
+ questions: {
3549
+ options: {
3550
+ value: string;
3551
+ label: string;
3552
+ description: string | null;
3553
+ }[];
3554
+ id: string;
3555
+ prompt: string;
3556
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
3557
+ allowOther: boolean;
3558
+ }[];
3559
+ };
3560
+ revision: number;
3561
+ turnId: string;
3562
+ parentItemId: string | null;
3563
+ sourceSequence: number | null;
3564
+ startedAt: number | null;
3565
+ completedAt: number | null;
3566
+ kind: "user_input_request";
3567
+ } | {
3568
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3569
+ id: string;
3570
+ sessionId: string;
3571
+ runId: string | null;
3572
+ payload: {
3573
+ phase: "COMPLETED" | "STARTED";
3574
+ summary: string | null;
3575
+ };
3576
+ revision: number;
3577
+ turnId: string;
3578
+ parentItemId: string | null;
3579
+ sourceSequence: number | null;
3580
+ startedAt: number | null;
3581
+ completedAt: number | null;
3582
+ kind: "context_compaction";
3583
+ } | {
3584
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3585
+ id: string;
3586
+ sessionId: string;
3587
+ runId: string | null;
3588
+ payload: {
3589
+ code: string;
3590
+ message: string;
3591
+ recoverable: boolean;
3592
+ };
3593
+ revision: number;
3594
+ turnId: string;
3595
+ parentItemId: string | null;
3596
+ sourceSequence: number | null;
3597
+ startedAt: number | null;
3598
+ completedAt: number | null;
3599
+ kind: "warning";
3600
+ } | {
3601
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3602
+ id: string;
3603
+ sessionId: string;
3604
+ runId: string | null;
3605
+ payload: {
3606
+ code: string;
3607
+ message: string;
3608
+ recoverable: boolean;
3609
+ retryAfterMs: number | null;
3610
+ };
3611
+ revision: number;
3612
+ turnId: string;
3613
+ parentItemId: string | null;
3614
+ sourceSequence: number | null;
3615
+ startedAt: number | null;
3616
+ completedAt: number | null;
3617
+ kind: "error";
3618
+ } | {
3619
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3620
+ id: string;
3621
+ sessionId: string;
3622
+ runId: string | null;
3623
+ payload: {
3624
+ label: string;
3625
+ sourceEventType: string;
3626
+ };
3627
+ revision: number;
3628
+ turnId: string;
3629
+ parentItemId: string | null;
3630
+ sourceSequence: number | null;
3631
+ startedAt: number | null;
3632
+ completedAt: number | null;
3633
+ kind: "unknown";
3634
+ })[];
3635
+ runId: string | null;
3636
+ model: string | null;
3637
+ effort: string | null;
3638
+ access: string | null;
3639
+ startedAt: number | null;
3640
+ completedAt: number | null;
3641
+ userItemId: string | null;
3642
+ }, {
3643
+ status: "QUEUED" | "RUNNING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED" | "WAITING_INPUT" | "WAITING_APPROVAL" | "LOST";
3644
+ id: string;
3645
+ sessionId: string;
3646
+ items: ({
3647
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3648
+ id: string;
3649
+ sessionId: string;
3650
+ runId: string | null;
3651
+ payload: {
3652
+ model: string | null;
3653
+ text: string;
3654
+ format: "markdown";
3655
+ };
3656
+ revision: number;
3657
+ turnId: string;
3658
+ parentItemId: string | null;
3659
+ sourceSequence: number | null;
3660
+ startedAt: number | null;
3661
+ completedAt: number | null;
3662
+ kind: "assistant_message";
3663
+ } | {
3664
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3665
+ id: string;
3666
+ sessionId: string;
3667
+ runId: string | null;
3668
+ payload: {
3669
+ clientMessageId: string | null;
3670
+ text: string;
3671
+ delivery: "PENDING" | "ACCEPTED" | "STEERED" | "QUEUED_NEXT_TURN" | "REJECTED";
3672
+ contexts?: {
3673
+ type: "message" | "file" | "directory" | "changes" | "diff" | "turn" | "terminal_selection";
3674
+ label: string;
3675
+ referenceId: string;
3676
+ path?: string | undefined;
3677
+ startLine?: number | undefined;
3678
+ endLine?: number | undefined;
3679
+ }[] | undefined;
3680
+ };
3681
+ revision: number;
3682
+ turnId: string;
3683
+ parentItemId: string | null;
3684
+ sourceSequence: number | null;
3685
+ startedAt: number | null;
3686
+ completedAt: number | null;
3687
+ kind: "user_message";
3688
+ } | {
3689
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3690
+ id: string;
3691
+ sessionId: string;
3692
+ runId: string | null;
3693
+ payload: {
3694
+ explanation: string | null;
3695
+ steps: {
3696
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
3697
+ id: string;
3698
+ text: string;
3699
+ }[];
3700
+ };
3701
+ revision: number;
3702
+ turnId: string;
3703
+ parentItemId: string | null;
3704
+ sourceSequence: number | null;
3705
+ startedAt: number | null;
3706
+ completedAt: number | null;
3707
+ kind: "plan";
3708
+ } | {
3709
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3710
+ id: string;
3711
+ sessionId: string;
3712
+ runId: string | null;
3713
+ payload: {
3714
+ category: "COMMAND" | "FILE_CHANGE" | "NETWORK" | "TOOL" | "OTHER";
3715
+ approvalId: string;
3716
+ reason: string | null;
3717
+ expiresAt: number;
3718
+ resolvedDecision: string | null;
3719
+ };
3720
+ revision: number;
3721
+ turnId: string;
3722
+ parentItemId: string | null;
3723
+ sourceSequence: number | null;
3724
+ startedAt: number | null;
3725
+ completedAt: number | null;
3726
+ kind: "approval";
3727
+ } | {
3728
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3729
+ id: string;
3730
+ sessionId: string;
3731
+ runId: string | null;
3732
+ payload: {
3733
+ status: "QUEUED" | "STARTING" | "RUNNING" | "CANCELLING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "INTERRUPTED";
3734
+ durationMs: number | null;
3735
+ };
3736
+ revision: number;
3737
+ turnId: string;
3738
+ parentItemId: string | null;
3739
+ sourceSequence: number | null;
3740
+ startedAt: number | null;
3741
+ completedAt: number | null;
3742
+ kind: "turn_summary";
3743
+ } | {
3744
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3745
+ id: string;
3746
+ sessionId: string;
3747
+ runId: string | null;
3748
+ payload: {
3749
+ sections: {
3750
+ text: string;
3751
+ index: number;
3752
+ }[];
3753
+ };
3754
+ revision: number;
3755
+ turnId: string;
3756
+ parentItemId: string | null;
3757
+ sourceSequence: number | null;
3758
+ startedAt: number | null;
3759
+ completedAt: number | null;
3760
+ kind: "reasoning_summary";
3761
+ } | {
3762
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3763
+ id: string;
3764
+ sessionId: string;
3765
+ runId: string | null;
3766
+ payload: {
3767
+ namespace: string;
3768
+ toolName: string;
3769
+ title: string;
3770
+ inputSummary: string | null;
3771
+ outputSummary: string | null;
3772
+ progressLabel: string | null;
3773
+ errorCode: string | null;
3774
+ truncated: boolean;
3775
+ };
3776
+ revision: number;
3777
+ turnId: string;
3778
+ parentItemId: string | null;
3779
+ sourceSequence: number | null;
3780
+ startedAt: number | null;
3781
+ completedAt: number | null;
3782
+ kind: "tool_call";
3783
+ } | {
3784
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3785
+ id: string;
3786
+ sessionId: string;
3787
+ runId: string | null;
3788
+ payload: {
3789
+ durationMs: number | null;
3790
+ truncated: boolean;
3791
+ command: string;
3792
+ cwd: string | null;
3793
+ outputPreview: string;
3794
+ outputRef: string | null;
3795
+ exitCode: number | null;
3796
+ };
3797
+ revision: number;
3798
+ turnId: string;
3799
+ parentItemId: string | null;
3800
+ sourceSequence: number | null;
3801
+ startedAt: number | null;
3802
+ completedAt: number | null;
3803
+ kind: "command_execution";
3804
+ } | {
3805
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3806
+ id: string;
3807
+ sessionId: string;
3808
+ runId: string | null;
3809
+ payload: {
3810
+ changes: {
3811
+ path: string;
3812
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
3813
+ additions: number | null;
3814
+ deletions: number | null;
3815
+ diffAvailable: boolean;
3816
+ }[];
3817
+ };
3818
+ revision: number;
3819
+ turnId: string;
3820
+ parentItemId: string | null;
3821
+ sourceSequence: number | null;
3822
+ startedAt: number | null;
3823
+ completedAt: number | null;
3824
+ kind: "file_change";
3825
+ } | {
3826
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3827
+ id: string;
3828
+ sessionId: string;
3829
+ runId: string | null;
3830
+ payload: {
3831
+ requestId: string;
3832
+ questions: {
3833
+ options: {
3834
+ value: string;
3835
+ label: string;
3836
+ description: string | null;
3837
+ }[];
3838
+ id: string;
3839
+ prompt: string;
3840
+ input: "SINGLE_SELECT" | "MULTI_SELECT" | "SHORT_TEXT";
3841
+ allowOther: boolean;
3842
+ }[];
3843
+ };
3844
+ revision: number;
3845
+ turnId: string;
3846
+ parentItemId: string | null;
3847
+ sourceSequence: number | null;
3848
+ startedAt: number | null;
3849
+ completedAt: number | null;
3850
+ kind: "user_input_request";
3851
+ } | {
3852
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3853
+ id: string;
3854
+ sessionId: string;
3855
+ runId: string | null;
3856
+ payload: {
3857
+ phase: "COMPLETED" | "STARTED";
3858
+ summary: string | null;
3859
+ };
3860
+ revision: number;
3861
+ turnId: string;
3862
+ parentItemId: string | null;
3863
+ sourceSequence: number | null;
3864
+ startedAt: number | null;
3865
+ completedAt: number | null;
3866
+ kind: "context_compaction";
3867
+ } | {
3868
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3869
+ id: string;
3870
+ sessionId: string;
3871
+ runId: string | null;
3872
+ payload: {
3873
+ code: string;
3874
+ message: string;
3875
+ recoverable: boolean;
3876
+ };
3877
+ revision: number;
3878
+ turnId: string;
3879
+ parentItemId: string | null;
3880
+ sourceSequence: number | null;
3881
+ startedAt: number | null;
3882
+ completedAt: number | null;
3883
+ kind: "warning";
3884
+ } | {
3885
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3886
+ id: string;
3887
+ sessionId: string;
3888
+ runId: string | null;
3889
+ payload: {
3890
+ code: string;
3891
+ message: string;
3892
+ recoverable: boolean;
3893
+ retryAfterMs: number | null;
3894
+ };
3895
+ revision: number;
3896
+ turnId: string;
3897
+ parentItemId: string | null;
3898
+ sourceSequence: number | null;
3899
+ startedAt: number | null;
3900
+ completedAt: number | null;
3901
+ kind: "error";
3902
+ } | {
3903
+ status: "FAILED" | "CANCELLED" | "INTERRUPTED" | "PENDING" | "IN_PROGRESS" | "COMPLETED" | "DECLINED";
3904
+ id: string;
3905
+ sessionId: string;
3906
+ runId: string | null;
3907
+ payload: {
3908
+ label: string;
3909
+ sourceEventType: string;
3910
+ };
3911
+ revision: number;
3912
+ turnId: string;
3913
+ parentItemId: string | null;
3914
+ sourceSequence: number | null;
3915
+ startedAt: number | null;
3916
+ completedAt: number | null;
3917
+ kind: "unknown";
3918
+ })[];
3919
+ runId: string | null;
3920
+ model: string | null;
3921
+ effort: string | null;
3922
+ access: string | null;
3923
+ startedAt: number | null;
3924
+ completedAt: number | null;
3925
+ userItemId: string | null;
3926
+ }>;
3927
+ export type ConversationTurn = z.infer<typeof conversationTurnSchema>;
3928
+ export declare const conversationItemDeltaSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
3929
+ kind: z.ZodLiteral<"assistant_text_append">;
3930
+ itemId: z.ZodString;
3931
+ itemRevision: z.ZodNumber;
3932
+ text: z.ZodString;
3933
+ }, "strip", z.ZodTypeAny, {
3934
+ kind: "assistant_text_append";
3935
+ text: string;
3936
+ itemId: string;
3937
+ itemRevision: number;
3938
+ }, {
3939
+ kind: "assistant_text_append";
3940
+ text: string;
3941
+ itemId: string;
3942
+ itemRevision: number;
3943
+ }>, z.ZodObject<{
3944
+ kind: z.ZodLiteral<"plan_replace">;
3945
+ itemId: z.ZodString;
3946
+ itemRevision: z.ZodNumber;
3947
+ steps: z.ZodArray<z.ZodObject<{
3948
+ id: z.ZodString;
3949
+ text: z.ZodString;
3950
+ status: z.ZodEnum<["PENDING", "IN_PROGRESS", "COMPLETED"]>;
3951
+ }, "strip", z.ZodTypeAny, {
3952
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
3953
+ id: string;
3954
+ text: string;
3955
+ }, {
3956
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
3957
+ id: string;
3958
+ text: string;
3959
+ }>, "many">;
3960
+ }, "strip", z.ZodTypeAny, {
3961
+ kind: "plan_replace";
3962
+ steps: {
3963
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
3964
+ id: string;
3965
+ text: string;
3966
+ }[];
3967
+ itemId: string;
3968
+ itemRevision: number;
3969
+ }, {
3970
+ kind: "plan_replace";
3971
+ steps: {
3972
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED";
3973
+ id: string;
3974
+ text: string;
3975
+ }[];
3976
+ itemId: string;
3977
+ itemRevision: number;
3978
+ }>, z.ZodObject<{
3979
+ kind: z.ZodLiteral<"tool_progress_replace">;
3980
+ itemId: z.ZodString;
3981
+ itemRevision: z.ZodNumber;
3982
+ label: z.ZodString;
3983
+ }, "strip", z.ZodTypeAny, {
3984
+ label: string;
3985
+ kind: "tool_progress_replace";
3986
+ itemId: string;
3987
+ itemRevision: number;
3988
+ }, {
3989
+ label: string;
3990
+ kind: "tool_progress_replace";
3991
+ itemId: string;
3992
+ itemRevision: number;
3993
+ }>]>;
3994
+ export type ConversationItemDelta = z.infer<typeof conversationItemDeltaSchema>;
3995
+ export declare const terminalDataFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3996
+ type: z.ZodLiteral<"attach">;
3997
+ terminalId: z.ZodString;
3998
+ afterSequence: z.ZodNumber;
3999
+ }, "strip", z.ZodTypeAny, {
4000
+ type: "attach";
4001
+ terminalId: string;
4002
+ afterSequence: number;
4003
+ }, {
4004
+ type: "attach";
4005
+ terminalId: string;
4006
+ afterSequence: number;
4007
+ }>, z.ZodObject<{
4008
+ type: z.ZodLiteral<"resize">;
4009
+ terminalId: z.ZodString;
4010
+ rows: z.ZodNumber;
4011
+ cols: z.ZodNumber;
4012
+ }, "strip", z.ZodTypeAny, {
4013
+ type: "resize";
4014
+ terminalId: string;
4015
+ rows: number;
4016
+ cols: number;
4017
+ }, {
4018
+ type: "resize";
4019
+ terminalId: string;
4020
+ rows: number;
4021
+ cols: number;
4022
+ }>, z.ZodObject<{
4023
+ type: z.ZodLiteral<"input">;
4024
+ terminalId: z.ZodString;
4025
+ data: z.ZodString;
4026
+ }, "strip", z.ZodTypeAny, {
4027
+ type: "input";
4028
+ terminalId: string;
4029
+ data: string;
4030
+ }, {
4031
+ type: "input";
4032
+ terminalId: string;
4033
+ data: string;
4034
+ }>, z.ZodObject<{
4035
+ type: z.ZodLiteral<"output">;
4036
+ terminalId: z.ZodString;
4037
+ sequence: z.ZodNumber;
4038
+ data: z.ZodString;
4039
+ }, "strip", z.ZodTypeAny, {
4040
+ type: "output";
4041
+ sequence: number;
4042
+ terminalId: string;
4043
+ data: string;
4044
+ }, {
4045
+ type: "output";
4046
+ sequence: number;
4047
+ terminalId: string;
4048
+ data: string;
4049
+ }>, z.ZodObject<{
4050
+ type: z.ZodLiteral<"close">;
4051
+ terminalId: z.ZodString;
4052
+ }, "strip", z.ZodTypeAny, {
4053
+ type: "close";
4054
+ terminalId: string;
4055
+ }, {
4056
+ type: "close";
4057
+ terminalId: string;
4058
+ }>, z.ZodObject<{
4059
+ type: z.ZodLiteral<"exit">;
4060
+ terminalId: z.ZodString;
4061
+ exitCode: z.ZodNullable<z.ZodNumber>;
4062
+ }, "strip", z.ZodTypeAny, {
4063
+ type: "exit";
4064
+ exitCode: number | null;
4065
+ terminalId: string;
4066
+ }, {
4067
+ type: "exit";
4068
+ exitCode: number | null;
4069
+ terminalId: string;
4070
+ }>, z.ZodObject<{
4071
+ type: z.ZodLiteral<"error">;
4072
+ terminalId: z.ZodString;
4073
+ code: z.ZodString;
4074
+ }, "strip", z.ZodTypeAny, {
4075
+ code: string;
4076
+ type: "error";
4077
+ terminalId: string;
4078
+ }, {
4079
+ code: string;
4080
+ type: "error";
4081
+ terminalId: string;
4082
+ }>]>;
4083
+ export type TerminalDataFrame = z.infer<typeof terminalDataFrameSchema>;
4084
+ export declare const terminalAttachTicketSchema: z.ZodEffects<z.ZodObject<{
4085
+ ticket: z.ZodString;
4086
+ nodeId: z.ZodString;
4087
+ terminalId: z.ZodString;
4088
+ userSessionFingerprint: z.ZodString;
4089
+ issuedAt: z.ZodNumber;
4090
+ expiresAt: z.ZodNumber;
4091
+ }, "strip", z.ZodTypeAny, {
4092
+ expiresAt: number;
4093
+ terminalId: string;
4094
+ ticket: string;
4095
+ nodeId: string;
4096
+ userSessionFingerprint: string;
4097
+ issuedAt: number;
4098
+ }, {
4099
+ expiresAt: number;
4100
+ terminalId: string;
4101
+ ticket: string;
4102
+ nodeId: string;
4103
+ userSessionFingerprint: string;
4104
+ issuedAt: number;
4105
+ }>, {
4106
+ expiresAt: number;
4107
+ terminalId: string;
4108
+ ticket: string;
4109
+ nodeId: string;
4110
+ userSessionFingerprint: string;
4111
+ issuedAt: number;
4112
+ }, {
4113
+ expiresAt: number;
4114
+ terminalId: string;
4115
+ ticket: string;
4116
+ nodeId: string;
4117
+ userSessionFingerprint: string;
4118
+ issuedAt: number;
4119
+ }>;
4120
+ export type TerminalAttachTicket = z.infer<typeof terminalAttachTicketSchema>;
4121
+ export declare const workspaceFileEntrySchema: z.ZodObject<{
4122
+ path: z.ZodString;
4123
+ name: z.ZodString;
4124
+ kind: z.ZodEnum<["FILE", "DIRECTORY"]>;
4125
+ size: z.ZodNullable<z.ZodNumber>;
4126
+ modifiedAt: z.ZodNullable<z.ZodNumber>;
4127
+ }, "strip", z.ZodTypeAny, {
4128
+ path: string;
4129
+ name: string;
4130
+ kind: "DIRECTORY" | "FILE";
4131
+ size: number | null;
4132
+ modifiedAt: number | null;
4133
+ }, {
4134
+ path: string;
4135
+ name: string;
4136
+ kind: "DIRECTORY" | "FILE";
4137
+ size: number | null;
4138
+ modifiedAt: number | null;
4139
+ }>;
4140
+ export declare const workspaceFileListSchema: z.ZodObject<{
4141
+ entries: z.ZodArray<z.ZodObject<{
4142
+ path: z.ZodString;
4143
+ name: z.ZodString;
4144
+ kind: z.ZodEnum<["FILE", "DIRECTORY"]>;
4145
+ size: z.ZodNullable<z.ZodNumber>;
4146
+ modifiedAt: z.ZodNullable<z.ZodNumber>;
4147
+ }, "strip", z.ZodTypeAny, {
4148
+ path: string;
4149
+ name: string;
4150
+ kind: "DIRECTORY" | "FILE";
4151
+ size: number | null;
4152
+ modifiedAt: number | null;
4153
+ }, {
4154
+ path: string;
4155
+ name: string;
4156
+ kind: "DIRECTORY" | "FILE";
4157
+ size: number | null;
4158
+ modifiedAt: number | null;
4159
+ }>, "many">;
4160
+ nextCursor: z.ZodNullable<z.ZodString>;
4161
+ truncated: z.ZodBoolean;
4162
+ }, "strip", z.ZodTypeAny, {
4163
+ entries: {
4164
+ path: string;
4165
+ name: string;
4166
+ kind: "DIRECTORY" | "FILE";
4167
+ size: number | null;
4168
+ modifiedAt: number | null;
4169
+ }[];
4170
+ truncated: boolean;
4171
+ nextCursor: string | null;
4172
+ }, {
4173
+ entries: {
4174
+ path: string;
4175
+ name: string;
4176
+ kind: "DIRECTORY" | "FILE";
4177
+ size: number | null;
4178
+ modifiedAt: number | null;
4179
+ }[];
4180
+ truncated: boolean;
4181
+ nextCursor: string | null;
4182
+ }>;
4183
+ export declare const workspaceFileReadSchema: z.ZodObject<{
4184
+ path: z.ZodString;
4185
+ encoding: z.ZodEnum<["utf-8", "base64"]>;
4186
+ size: z.ZodNumber;
4187
+ content: z.ZodString;
4188
+ truncated: z.ZodBoolean;
4189
+ nextOffset: z.ZodNullable<z.ZodNumber>;
4190
+ }, "strip", z.ZodTypeAny, {
4191
+ path: string;
4192
+ content: string;
4193
+ truncated: boolean;
4194
+ size: number;
4195
+ encoding: "utf-8" | "base64";
4196
+ nextOffset: number | null;
4197
+ }, {
4198
+ path: string;
4199
+ content: string;
4200
+ truncated: boolean;
4201
+ size: number;
4202
+ encoding: "utf-8" | "base64";
4203
+ nextOffset: number | null;
4204
+ }>;
4205
+ export declare const workspaceUploadPreflightSchema: z.ZodObject<{
4206
+ name: z.ZodString;
4207
+ status: z.ZodEnum<["READY", "EXISTS_FILE", "EXISTS_DIRECTORY", "INVALID_NAME"]>;
4208
+ path: z.ZodNullable<z.ZodString>;
4209
+ }, "strip", z.ZodTypeAny, {
4210
+ status: "READY" | "EXISTS_FILE" | "EXISTS_DIRECTORY" | "INVALID_NAME";
4211
+ path: string | null;
4212
+ name: string;
4213
+ }, {
4214
+ status: "READY" | "EXISTS_FILE" | "EXISTS_DIRECTORY" | "INVALID_NAME";
4215
+ path: string | null;
4216
+ name: string;
4217
+ }>;
4218
+ export declare const workspaceUploadSchema: z.ZodObject<{
4219
+ uploadId: z.ZodString;
4220
+ path: z.ZodString;
4221
+ receivedBytes: z.ZodNumber;
4222
+ size: z.ZodNumber;
4223
+ }, "strip", z.ZodTypeAny, {
4224
+ path: string;
4225
+ size: number;
4226
+ uploadId: string;
4227
+ receivedBytes: number;
4228
+ }, {
4229
+ path: string;
4230
+ size: number;
4231
+ uploadId: string;
4232
+ receivedBytes: number;
4233
+ }>;
4234
+ export declare const workspaceChangeSchema: z.ZodObject<{
4235
+ path: z.ZodString;
4236
+ state: z.ZodEnum<["STAGED", "UNSTAGED", "UNTRACKED"]>;
4237
+ change: z.ZodEnum<["ADDED", "MODIFIED", "DELETED", "RENAMED", "COPIED", "TYPE_CHANGED"]>;
4238
+ additions: z.ZodNullable<z.ZodNumber>;
4239
+ deletions: z.ZodNullable<z.ZodNumber>;
4240
+ binary: z.ZodBoolean;
4241
+ diffAvailable: z.ZodBoolean;
4242
+ }, "strip", z.ZodTypeAny, {
4243
+ path: string;
4244
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
4245
+ additions: number | null;
4246
+ deletions: number | null;
4247
+ diffAvailable: boolean;
4248
+ state: "STAGED" | "UNSTAGED" | "UNTRACKED";
4249
+ binary: boolean;
4250
+ }, {
4251
+ path: string;
4252
+ change: "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "COPIED" | "TYPE_CHANGED";
4253
+ additions: number | null;
4254
+ deletions: number | null;
4255
+ diffAvailable: boolean;
4256
+ state: "STAGED" | "UNSTAGED" | "UNTRACKED";
4257
+ binary: boolean;
4258
+ }>;
4259
+ export type WorkspaceFileEntry = z.infer<typeof workspaceFileEntrySchema>;
4260
+ export type WorkspaceFileList = z.infer<typeof workspaceFileListSchema>;
4261
+ export type WorkspaceFileRead = z.infer<typeof workspaceFileReadSchema>;
4262
+ export type WorkspaceUploadPreflight = z.infer<typeof workspaceUploadPreflightSchema>;
4263
+ export type WorkspaceUpload = z.infer<typeof workspaceUploadSchema>;
4264
+ export type WorkspaceChange = z.infer<typeof workspaceChangeSchema>;
4265
+ export declare const workbenchNodeOperationSchema: z.ZodEnum<["node.workbench.capabilities", "runner.usage.status", "runner.usage.read", "workspace.directories.list", "workspace.remove", "session.metadata.update", "session.remove", "session.config.update", "session.turns.list", "session.events.read", "session.context.read", "session.command.execute", "runner.command.execute", "workspace.activity.read", "runner.profiles.list", "runner.defaults.save", "workspace.files.list", "workspace.file.read", "workspace.files.search", "workspace.files.upload.preflight", "workspace.files.upload.create", "workspace.files.upload.chunk", "workspace.files.upload.status", "workspace.files.upload.complete", "workspace.files.upload.cancel", "workspace.changes.current", "workspace.change.diff", "workspace.change.restore", "run.image.read", "terminal.open", "terminal.list", "terminal.close", "terminal.attach.authorize"]>;
4266
+ export type WorkbenchNodeOperation = z.infer<typeof workbenchNodeOperationSchema>;
4267
+ /**
4268
+ * A small, explicit envelope keeps WebSocket messages independently parseable
4269
+ * and makes it safe to reject future message kinds without guessing payloads.
4270
+ */
4271
+ export declare const nodeEnvelopeSchema: z.ZodObject<{
4272
+ version: z.ZodLiteral<2>;
4273
+ id: z.ZodString;
4274
+ type: z.ZodString;
4275
+ replyTo: z.ZodOptional<z.ZodString>;
4276
+ payload: z.ZodUnknown;
4277
+ }, "strip", z.ZodTypeAny, {
4278
+ type: string;
4279
+ version: 2;
4280
+ id: string;
4281
+ payload?: unknown;
4282
+ replyTo?: string | undefined;
4283
+ }, {
4284
+ type: string;
4285
+ version: 2;
4286
+ id: string;
4287
+ payload?: unknown;
4288
+ replyTo?: string | undefined;
4289
+ }>;
4290
+ export type NodeEnvelope = z.infer<typeof nodeEnvelopeSchema>;
4291
+ export declare const nodeErrorSchema: z.ZodObject<{
4292
+ code: z.ZodEnum<["PROTOCOL_VERSION_UNSUPPORTED", "MESSAGE_TYPE_UNKNOWN", "MESSAGE_INVALID", "NODE_UNAUTHENTICATED", "NODE_DISABLED", "REGISTRATION_TOKEN_INVALID", "WORKSPACE_INVALID", "RUN_NOT_FOUND", "RUN_STATE_INVALID", "RUN_LOST", "APPROVAL_NOT_FOUND", "APPROVAL_EXPIRED", "APPROVAL_ALREADY_DECIDED", "APPROVAL_ALREADY_EXISTS", "WORKBENCH_PROTOCOL_UNSUPPORTED", "CAPABILITY_UNAVAILABLE", "CAPABILITY_VERSION_UNSUPPORTED", "CAPABILITY_STALE", "EVENT_CURSOR_INVALID", "EVENT_CURSOR_GAP", "ITEM_REVISION_CONFLICT", "RUNNER_PROFILE_INVALID", "RUNNER_COMMAND_UNSUPPORTED", "FILE_NOT_FOUND", "FILE_NOT_REGULAR", "FILE_TOO_LARGE", "FILE_ENCODING_UNSUPPORTED", "FILE_PATH_ESCAPE", "DIRECTORY_CURSOR_INVALID", "FILE_SEARCH_LIMIT_EXCEEDED", "GIT_CHANGE_RESTORE_UNAVAILABLE", "TERMINAL_UNAVAILABLE", "TERMINAL_LIMIT_REACHED", "TERMINAL_NOT_FOUND", "TERMINAL_ATTACH_CONFLICT", "TERMINAL_REPLAY_GAP", "TERMINAL_DATA_CHANNEL_UNAVAILABLE", "INTERNAL_ERROR"]>;
4293
+ }, "strip", z.ZodTypeAny, {
4294
+ code: "PROTOCOL_VERSION_UNSUPPORTED" | "MESSAGE_TYPE_UNKNOWN" | "MESSAGE_INVALID" | "NODE_UNAUTHENTICATED" | "NODE_DISABLED" | "REGISTRATION_TOKEN_INVALID" | "WORKSPACE_INVALID" | "RUN_NOT_FOUND" | "RUN_STATE_INVALID" | "RUN_LOST" | "APPROVAL_NOT_FOUND" | "APPROVAL_EXPIRED" | "APPROVAL_ALREADY_DECIDED" | "APPROVAL_ALREADY_EXISTS" | "WORKBENCH_PROTOCOL_UNSUPPORTED" | "CAPABILITY_UNAVAILABLE" | "CAPABILITY_VERSION_UNSUPPORTED" | "CAPABILITY_STALE" | "EVENT_CURSOR_INVALID" | "EVENT_CURSOR_GAP" | "ITEM_REVISION_CONFLICT" | "RUNNER_PROFILE_INVALID" | "RUNNER_COMMAND_UNSUPPORTED" | "FILE_NOT_FOUND" | "FILE_NOT_REGULAR" | "FILE_TOO_LARGE" | "FILE_ENCODING_UNSUPPORTED" | "FILE_PATH_ESCAPE" | "DIRECTORY_CURSOR_INVALID" | "FILE_SEARCH_LIMIT_EXCEEDED" | "GIT_CHANGE_RESTORE_UNAVAILABLE" | "TERMINAL_UNAVAILABLE" | "TERMINAL_LIMIT_REACHED" | "TERMINAL_NOT_FOUND" | "TERMINAL_ATTACH_CONFLICT" | "TERMINAL_REPLAY_GAP" | "TERMINAL_DATA_CHANNEL_UNAVAILABLE" | "INTERNAL_ERROR";
4295
+ }, {
4296
+ code: "PROTOCOL_VERSION_UNSUPPORTED" | "MESSAGE_TYPE_UNKNOWN" | "MESSAGE_INVALID" | "NODE_UNAUTHENTICATED" | "NODE_DISABLED" | "REGISTRATION_TOKEN_INVALID" | "WORKSPACE_INVALID" | "RUN_NOT_FOUND" | "RUN_STATE_INVALID" | "RUN_LOST" | "APPROVAL_NOT_FOUND" | "APPROVAL_EXPIRED" | "APPROVAL_ALREADY_DECIDED" | "APPROVAL_ALREADY_EXISTS" | "WORKBENCH_PROTOCOL_UNSUPPORTED" | "CAPABILITY_UNAVAILABLE" | "CAPABILITY_VERSION_UNSUPPORTED" | "CAPABILITY_STALE" | "EVENT_CURSOR_INVALID" | "EVENT_CURSOR_GAP" | "ITEM_REVISION_CONFLICT" | "RUNNER_PROFILE_INVALID" | "RUNNER_COMMAND_UNSUPPORTED" | "FILE_NOT_FOUND" | "FILE_NOT_REGULAR" | "FILE_TOO_LARGE" | "FILE_ENCODING_UNSUPPORTED" | "FILE_PATH_ESCAPE" | "DIRECTORY_CURSOR_INVALID" | "FILE_SEARCH_LIMIT_EXCEEDED" | "GIT_CHANGE_RESTORE_UNAVAILABLE" | "TERMINAL_UNAVAILABLE" | "TERMINAL_LIMIT_REACHED" | "TERMINAL_NOT_FOUND" | "TERMINAL_ATTACH_CONFLICT" | "TERMINAL_REPLAY_GAP" | "TERMINAL_DATA_CHANNEL_UNAVAILABLE" | "INTERNAL_ERROR";
4297
+ }>;
4298
+ export declare function createEnvelope(type: string, payload: unknown, options?: {
4299
+ id?: string;
4300
+ replyTo?: string;
4301
+ }): NodeEnvelope;