@linkshell/wire 0.2.1 → 0.2.3

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.
package/dist/updates.d.ts CHANGED
@@ -14,13 +14,13 @@ export declare const contentBlockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
14
14
  data: z.ZodOptional<z.ZodString>;
15
15
  uri: z.ZodOptional<z.ZodString>;
16
16
  }, "strip", z.ZodTypeAny, {
17
- type: "image";
18
17
  mimeType: string;
18
+ type: "image";
19
19
  data?: string | undefined;
20
20
  uri?: string | undefined;
21
21
  }, {
22
- type: "image";
23
22
  mimeType: string;
23
+ type: "image";
24
24
  data?: string | undefined;
25
25
  uri?: string | undefined;
26
26
  }>, z.ZodObject<{
@@ -31,14 +31,14 @@ export declare const contentBlockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
31
31
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
32
32
  }, "strip", z.ZodTypeAny, {
33
33
  type: "resource_link";
34
- uri: string;
35
34
  name: string;
36
- kind?: "file" | "skill" | "agent" | undefined;
35
+ uri: string;
36
+ kind?: "agent" | "file" | "skill" | undefined;
37
37
  }, {
38
38
  type: "resource_link";
39
- uri: string;
40
39
  name: string;
41
- kind?: "file" | "skill" | "agent" | undefined;
40
+ uri: string;
41
+ kind?: "agent" | "file" | "skill" | undefined;
42
42
  }>]>;
43
43
  export type ContentBlock = z.infer<typeof contentBlockSchema>;
44
44
  export declare const toolCallStatusSchema: z.ZodEnum<["pending", "in_progress", "completed", "failed"]>;
@@ -60,13 +60,13 @@ export declare const toolCallContentSchema: z.ZodDiscriminatedUnion<"type", [z.Z
60
60
  data: z.ZodOptional<z.ZodString>;
61
61
  uri: z.ZodOptional<z.ZodString>;
62
62
  }, "strip", z.ZodTypeAny, {
63
- type: "image";
64
63
  mimeType: string;
64
+ type: "image";
65
65
  data?: string | undefined;
66
66
  uri?: string | undefined;
67
67
  }, {
68
- type: "image";
69
68
  mimeType: string;
69
+ type: "image";
70
70
  data?: string | undefined;
71
71
  uri?: string | undefined;
72
72
  }>, z.ZodObject<{
@@ -77,14 +77,14 @@ export declare const toolCallContentSchema: z.ZodDiscriminatedUnion<"type", [z.Z
77
77
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
78
78
  }, "strip", z.ZodTypeAny, {
79
79
  type: "resource_link";
80
- uri: string;
81
80
  name: string;
82
- kind?: "file" | "skill" | "agent" | undefined;
81
+ uri: string;
82
+ kind?: "agent" | "file" | "skill" | undefined;
83
83
  }, {
84
84
  type: "resource_link";
85
- uri: string;
86
85
  name: string;
87
- kind?: "file" | "skill" | "agent" | undefined;
86
+ uri: string;
87
+ kind?: "agent" | "file" | "skill" | undefined;
88
88
  }>]>;
89
89
  }, "strip", z.ZodTypeAny, {
90
90
  type: "content";
@@ -92,15 +92,15 @@ export declare const toolCallContentSchema: z.ZodDiscriminatedUnion<"type", [z.Z
92
92
  type: "text";
93
93
  text: string;
94
94
  } | {
95
- type: "image";
96
95
  mimeType: string;
96
+ type: "image";
97
97
  data?: string | undefined;
98
98
  uri?: string | undefined;
99
99
  } | {
100
100
  type: "resource_link";
101
- uri: string;
102
101
  name: string;
103
- kind?: "file" | "skill" | "agent" | undefined;
102
+ uri: string;
103
+ kind?: "agent" | "file" | "skill" | undefined;
104
104
  };
105
105
  }, {
106
106
  type: "content";
@@ -108,15 +108,15 @@ export declare const toolCallContentSchema: z.ZodDiscriminatedUnion<"type", [z.Z
108
108
  type: "text";
109
109
  text: string;
110
110
  } | {
111
- type: "image";
112
111
  mimeType: string;
112
+ type: "image";
113
113
  data?: string | undefined;
114
114
  uri?: string | undefined;
115
115
  } | {
116
116
  type: "resource_link";
117
- uri: string;
118
117
  name: string;
119
- kind?: "file" | "skill" | "agent" | undefined;
118
+ uri: string;
119
+ kind?: "agent" | "file" | "skill" | undefined;
120
120
  };
121
121
  }>, z.ZodObject<{
122
122
  type: z.ZodLiteral<"diff">;
@@ -124,13 +124,13 @@ export declare const toolCallContentSchema: z.ZodDiscriminatedUnion<"type", [z.Z
124
124
  oldText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
125
125
  newText: z.ZodString;
126
126
  }, "strip", z.ZodTypeAny, {
127
- type: "diff";
128
127
  path: string;
128
+ type: "diff";
129
129
  newText: string;
130
130
  oldText?: string | null | undefined;
131
131
  }, {
132
- type: "diff";
133
132
  path: string;
133
+ type: "diff";
134
134
  newText: string;
135
135
  oldText?: string | null | undefined;
136
136
  }>, z.ZodObject<{
@@ -140,16 +140,16 @@ export declare const toolCallContentSchema: z.ZodDiscriminatedUnion<"type", [z.Z
140
140
  movePath: z.ZodOptional<z.ZodString>;
141
141
  diff: z.ZodString;
142
142
  }, "strip", z.ZodTypeAny, {
143
- type: "patch";
144
143
  path: string;
144
+ type: "patch";
145
145
  diff: string;
146
- change: "add" | "delete" | "update";
146
+ change: "delete" | "add" | "update";
147
147
  movePath?: string | undefined;
148
148
  }, {
149
- type: "patch";
150
149
  path: string;
150
+ type: "patch";
151
151
  diff: string;
152
- change: "add" | "delete" | "update";
152
+ change: "delete" | "add" | "update";
153
153
  movePath?: string | undefined;
154
154
  }>, z.ZodObject<{
155
155
  type: z.ZodLiteral<"terminal">;
@@ -184,12 +184,12 @@ export declare const toolDetailSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
184
184
  tool: z.ZodString;
185
185
  }, "strip", z.ZodTypeAny, {
186
186
  type: "mcp";
187
- server: string;
188
187
  tool: string;
188
+ server: string;
189
189
  }, {
190
190
  type: "mcp";
191
- server: string;
192
191
  tool: string;
192
+ server: string;
193
193
  }>, z.ZodObject<{
194
194
  type: z.ZodLiteral<"subagent">;
195
195
  /** spawn starts a sub-agent (its work nests under this call); the rest talk to one. */
@@ -198,18 +198,205 @@ export declare const toolDetailSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
198
198
  /** The sub-agent's role or type, e.g. "Explore". */
199
199
  agentType: z.ZodOptional<z.ZodString>;
200
200
  model: z.ZodOptional<z.ZodString>;
201
+ /** Agent outcome when a tool's coarse completed/failed state is insufficient. */
202
+ state: z.ZodOptional<z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>>;
203
+ /** A Claude workflow is a background run containing its own agents. Counts are observed, not a predicted total. */
204
+ workflow: z.ZodOptional<z.ZodObject<{
205
+ runId: z.ZodOptional<z.ZodString>;
206
+ name: z.ZodOptional<z.ZodString>;
207
+ state: z.ZodOptional<z.ZodEnum<["running", "paused", "completed", "failed", "stopped"]>>;
208
+ started: z.ZodOptional<z.ZodNumber>;
209
+ completed: z.ZodOptional<z.ZodNumber>;
210
+ tokens: z.ZodOptional<z.ZodNumber>;
211
+ durationMs: z.ZodOptional<z.ZodNumber>;
212
+ startedAt: z.ZodOptional<z.ZodNumber>;
213
+ endedAt: z.ZodOptional<z.ZodNumber>;
214
+ phases: z.ZodOptional<z.ZodArray<z.ZodObject<{
215
+ id: z.ZodString;
216
+ title: z.ZodString;
217
+ order: z.ZodNumber;
218
+ }, "strip", z.ZodTypeAny, {
219
+ id: string;
220
+ title: string;
221
+ order: number;
222
+ }, {
223
+ id: string;
224
+ title: string;
225
+ order: number;
226
+ }>, "many">>;
227
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
228
+ id: z.ZodString;
229
+ toolCallId: z.ZodOptional<z.ZodString>;
230
+ title: z.ZodString;
231
+ state: z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>;
232
+ phaseId: z.ZodOptional<z.ZodString>;
233
+ model: z.ZodOptional<z.ZodString>;
234
+ tokens: z.ZodOptional<z.ZodNumber>;
235
+ toolCalls: z.ZodOptional<z.ZodNumber>;
236
+ durationMs: z.ZodOptional<z.ZodNumber>;
237
+ startedAt: z.ZodOptional<z.ZodNumber>;
238
+ endedAt: z.ZodOptional<z.ZodNumber>;
239
+ result: z.ZodOptional<z.ZodString>;
240
+ }, "strip", z.ZodTypeAny, {
241
+ id: string;
242
+ title: string;
243
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
244
+ toolCallId?: string | undefined;
245
+ phaseId?: string | undefined;
246
+ model?: string | undefined;
247
+ tokens?: number | undefined;
248
+ toolCalls?: number | undefined;
249
+ durationMs?: number | undefined;
250
+ startedAt?: number | undefined;
251
+ endedAt?: number | undefined;
252
+ result?: string | undefined;
253
+ }, {
254
+ id: string;
255
+ title: string;
256
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
257
+ toolCallId?: string | undefined;
258
+ phaseId?: string | undefined;
259
+ model?: string | undefined;
260
+ tokens?: number | undefined;
261
+ toolCalls?: number | undefined;
262
+ durationMs?: number | undefined;
263
+ startedAt?: number | undefined;
264
+ endedAt?: number | undefined;
265
+ result?: string | undefined;
266
+ }>, "many">>;
267
+ }, "strip", z.ZodTypeAny, {
268
+ completed?: number | undefined;
269
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
270
+ tokens?: number | undefined;
271
+ durationMs?: number | undefined;
272
+ startedAt?: number | undefined;
273
+ endedAt?: number | undefined;
274
+ runId?: string | undefined;
275
+ name?: string | undefined;
276
+ started?: number | undefined;
277
+ phases?: {
278
+ id: string;
279
+ title: string;
280
+ order: number;
281
+ }[] | undefined;
282
+ agents?: {
283
+ id: string;
284
+ title: string;
285
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
286
+ toolCallId?: string | undefined;
287
+ phaseId?: string | undefined;
288
+ model?: string | undefined;
289
+ tokens?: number | undefined;
290
+ toolCalls?: number | undefined;
291
+ durationMs?: number | undefined;
292
+ startedAt?: number | undefined;
293
+ endedAt?: number | undefined;
294
+ result?: string | undefined;
295
+ }[] | undefined;
296
+ }, {
297
+ completed?: number | undefined;
298
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
299
+ tokens?: number | undefined;
300
+ durationMs?: number | undefined;
301
+ startedAt?: number | undefined;
302
+ endedAt?: number | undefined;
303
+ runId?: string | undefined;
304
+ name?: string | undefined;
305
+ started?: number | undefined;
306
+ phases?: {
307
+ id: string;
308
+ title: string;
309
+ order: number;
310
+ }[] | undefined;
311
+ agents?: {
312
+ id: string;
313
+ title: string;
314
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
315
+ toolCallId?: string | undefined;
316
+ phaseId?: string | undefined;
317
+ model?: string | undefined;
318
+ tokens?: number | undefined;
319
+ toolCalls?: number | undefined;
320
+ durationMs?: number | undefined;
321
+ startedAt?: number | undefined;
322
+ endedAt?: number | undefined;
323
+ result?: string | undefined;
324
+ }[] | undefined;
325
+ }>>;
201
326
  }, "strip", z.ZodTypeAny, {
202
327
  type: "subagent";
203
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
328
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
329
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
330
+ model?: string | undefined;
204
331
  task?: string | undefined;
205
332
  agentType?: string | undefined;
206
- model?: string | undefined;
333
+ workflow?: {
334
+ completed?: number | undefined;
335
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
336
+ tokens?: number | undefined;
337
+ durationMs?: number | undefined;
338
+ startedAt?: number | undefined;
339
+ endedAt?: number | undefined;
340
+ runId?: string | undefined;
341
+ name?: string | undefined;
342
+ started?: number | undefined;
343
+ phases?: {
344
+ id: string;
345
+ title: string;
346
+ order: number;
347
+ }[] | undefined;
348
+ agents?: {
349
+ id: string;
350
+ title: string;
351
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
352
+ toolCallId?: string | undefined;
353
+ phaseId?: string | undefined;
354
+ model?: string | undefined;
355
+ tokens?: number | undefined;
356
+ toolCalls?: number | undefined;
357
+ durationMs?: number | undefined;
358
+ startedAt?: number | undefined;
359
+ endedAt?: number | undefined;
360
+ result?: string | undefined;
361
+ }[] | undefined;
362
+ } | undefined;
207
363
  }, {
208
364
  type: "subagent";
209
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
365
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
366
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
367
+ model?: string | undefined;
210
368
  task?: string | undefined;
211
369
  agentType?: string | undefined;
212
- model?: string | undefined;
370
+ workflow?: {
371
+ completed?: number | undefined;
372
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
373
+ tokens?: number | undefined;
374
+ durationMs?: number | undefined;
375
+ startedAt?: number | undefined;
376
+ endedAt?: number | undefined;
377
+ runId?: string | undefined;
378
+ name?: string | undefined;
379
+ started?: number | undefined;
380
+ phases?: {
381
+ id: string;
382
+ title: string;
383
+ order: number;
384
+ }[] | undefined;
385
+ agents?: {
386
+ id: string;
387
+ title: string;
388
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
389
+ toolCallId?: string | undefined;
390
+ phaseId?: string | undefined;
391
+ model?: string | undefined;
392
+ tokens?: number | undefined;
393
+ toolCalls?: number | undefined;
394
+ durationMs?: number | undefined;
395
+ startedAt?: number | undefined;
396
+ endedAt?: number | undefined;
397
+ result?: string | undefined;
398
+ }[] | undefined;
399
+ } | undefined;
213
400
  }>, z.ZodObject<{
214
401
  type: z.ZodLiteral<"skill">;
215
402
  name: z.ZodString;
@@ -274,11 +461,11 @@ export declare const planEntrySchema: z.ZodObject<{
274
461
  priority: z.ZodDefault<z.ZodEnum<["high", "medium", "low"]>>;
275
462
  status: z.ZodEnum<["pending", "in_progress", "completed"]>;
276
463
  }, "strip", z.ZodTypeAny, {
277
- status: "pending" | "in_progress" | "completed";
464
+ status: "completed" | "pending" | "in_progress";
278
465
  content: string;
279
466
  priority: "high" | "medium" | "low";
280
467
  }, {
281
- status: "pending" | "in_progress" | "completed";
468
+ status: "completed" | "pending" | "in_progress";
282
469
  content: string;
283
470
  priority?: "high" | "medium" | "low" | undefined;
284
471
  }>;
@@ -305,25 +492,25 @@ export declare const sessionConfigOptionSchema: z.ZodObject<{
305
492
  description?: string | undefined;
306
493
  }>, "many">;
307
494
  }, "strip", z.ZodTypeAny, {
495
+ id: string;
308
496
  values: {
309
497
  value: string;
310
498
  name: string;
311
499
  description?: string | undefined;
312
500
  }[];
313
501
  name: string;
314
- id: string;
315
- category: "model" | "mode" | "effort" | "other";
502
+ category: "model" | "other" | "mode" | "effort";
316
503
  current: string;
317
504
  }, {
505
+ id: string;
318
506
  values: {
319
507
  value: string;
320
508
  name: string;
321
509
  description?: string | undefined;
322
510
  }[];
323
511
  name: string;
324
- id: string;
325
512
  current: string;
326
- category?: "model" | "mode" | "effort" | "other" | undefined;
513
+ category?: "model" | "other" | "mode" | "effort" | undefined;
327
514
  }>;
328
515
  export type SessionConfigOption = z.infer<typeof sessionConfigOptionSchema>;
329
516
  export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate", [z.ZodObject<{
@@ -344,13 +531,13 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
344
531
  data: z.ZodOptional<z.ZodString>;
345
532
  uri: z.ZodOptional<z.ZodString>;
346
533
  }, "strip", z.ZodTypeAny, {
347
- type: "image";
348
534
  mimeType: string;
535
+ type: "image";
349
536
  data?: string | undefined;
350
537
  uri?: string | undefined;
351
538
  }, {
352
- type: "image";
353
539
  mimeType: string;
540
+ type: "image";
354
541
  data?: string | undefined;
355
542
  uri?: string | undefined;
356
543
  }>, z.ZodObject<{
@@ -361,29 +548,29 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
361
548
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
362
549
  }, "strip", z.ZodTypeAny, {
363
550
  type: "resource_link";
364
- uri: string;
365
551
  name: string;
366
- kind?: "file" | "skill" | "agent" | undefined;
552
+ uri: string;
553
+ kind?: "agent" | "file" | "skill" | undefined;
367
554
  }, {
368
555
  type: "resource_link";
369
- uri: string;
370
556
  name: string;
371
- kind?: "file" | "skill" | "agent" | undefined;
557
+ uri: string;
558
+ kind?: "agent" | "file" | "skill" | undefined;
372
559
  }>]>;
373
560
  }, "strip", z.ZodTypeAny, {
374
561
  content: {
375
562
  type: "text";
376
563
  text: string;
377
564
  } | {
378
- type: "image";
379
565
  mimeType: string;
566
+ type: "image";
380
567
  data?: string | undefined;
381
568
  uri?: string | undefined;
382
569
  } | {
383
570
  type: "resource_link";
384
- uri: string;
385
571
  name: string;
386
- kind?: "file" | "skill" | "agent" | undefined;
572
+ uri: string;
573
+ kind?: "agent" | "file" | "skill" | undefined;
387
574
  };
388
575
  sessionUpdate: "user_message_chunk";
389
576
  messageId?: string | undefined;
@@ -392,15 +579,15 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
392
579
  type: "text";
393
580
  text: string;
394
581
  } | {
395
- type: "image";
396
582
  mimeType: string;
583
+ type: "image";
397
584
  data?: string | undefined;
398
585
  uri?: string | undefined;
399
586
  } | {
400
587
  type: "resource_link";
401
- uri: string;
402
588
  name: string;
403
- kind?: "file" | "skill" | "agent" | undefined;
589
+ uri: string;
590
+ kind?: "agent" | "file" | "skill" | undefined;
404
591
  };
405
592
  sessionUpdate: "user_message_chunk";
406
593
  messageId?: string | undefined;
@@ -423,13 +610,13 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
423
610
  data: z.ZodOptional<z.ZodString>;
424
611
  uri: z.ZodOptional<z.ZodString>;
425
612
  }, "strip", z.ZodTypeAny, {
426
- type: "image";
427
613
  mimeType: string;
614
+ type: "image";
428
615
  data?: string | undefined;
429
616
  uri?: string | undefined;
430
617
  }, {
431
- type: "image";
432
618
  mimeType: string;
619
+ type: "image";
433
620
  data?: string | undefined;
434
621
  uri?: string | undefined;
435
622
  }>, z.ZodObject<{
@@ -440,29 +627,29 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
440
627
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
441
628
  }, "strip", z.ZodTypeAny, {
442
629
  type: "resource_link";
443
- uri: string;
444
630
  name: string;
445
- kind?: "file" | "skill" | "agent" | undefined;
631
+ uri: string;
632
+ kind?: "agent" | "file" | "skill" | undefined;
446
633
  }, {
447
634
  type: "resource_link";
448
- uri: string;
449
635
  name: string;
450
- kind?: "file" | "skill" | "agent" | undefined;
636
+ uri: string;
637
+ kind?: "agent" | "file" | "skill" | undefined;
451
638
  }>]>;
452
639
  }, "strip", z.ZodTypeAny, {
453
640
  content: {
454
641
  type: "text";
455
642
  text: string;
456
643
  } | {
457
- type: "image";
458
644
  mimeType: string;
645
+ type: "image";
459
646
  data?: string | undefined;
460
647
  uri?: string | undefined;
461
648
  } | {
462
649
  type: "resource_link";
463
- uri: string;
464
650
  name: string;
465
- kind?: "file" | "skill" | "agent" | undefined;
651
+ uri: string;
652
+ kind?: "agent" | "file" | "skill" | undefined;
466
653
  };
467
654
  sessionUpdate: "agent_message_chunk";
468
655
  messageId: string;
@@ -472,15 +659,15 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
472
659
  type: "text";
473
660
  text: string;
474
661
  } | {
475
- type: "image";
476
662
  mimeType: string;
663
+ type: "image";
477
664
  data?: string | undefined;
478
665
  uri?: string | undefined;
479
666
  } | {
480
667
  type: "resource_link";
481
- uri: string;
482
668
  name: string;
483
- kind?: "file" | "skill" | "agent" | undefined;
669
+ uri: string;
670
+ kind?: "agent" | "file" | "skill" | undefined;
484
671
  };
485
672
  sessionUpdate: "agent_message_chunk";
486
673
  messageId: string;
@@ -504,13 +691,13 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
504
691
  data: z.ZodOptional<z.ZodString>;
505
692
  uri: z.ZodOptional<z.ZodString>;
506
693
  }, "strip", z.ZodTypeAny, {
507
- type: "image";
508
694
  mimeType: string;
695
+ type: "image";
509
696
  data?: string | undefined;
510
697
  uri?: string | undefined;
511
698
  }, {
512
- type: "image";
513
699
  mimeType: string;
700
+ type: "image";
514
701
  data?: string | undefined;
515
702
  uri?: string | undefined;
516
703
  }>, z.ZodObject<{
@@ -521,29 +708,29 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
521
708
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
522
709
  }, "strip", z.ZodTypeAny, {
523
710
  type: "resource_link";
524
- uri: string;
525
711
  name: string;
526
- kind?: "file" | "skill" | "agent" | undefined;
712
+ uri: string;
713
+ kind?: "agent" | "file" | "skill" | undefined;
527
714
  }, {
528
715
  type: "resource_link";
529
- uri: string;
530
716
  name: string;
531
- kind?: "file" | "skill" | "agent" | undefined;
717
+ uri: string;
718
+ kind?: "agent" | "file" | "skill" | undefined;
532
719
  }>]>;
533
720
  }, "strip", z.ZodTypeAny, {
534
721
  content: {
535
722
  type: "text";
536
723
  text: string;
537
724
  } | {
538
- type: "image";
539
725
  mimeType: string;
726
+ type: "image";
540
727
  data?: string | undefined;
541
728
  uri?: string | undefined;
542
729
  } | {
543
730
  type: "resource_link";
544
- uri: string;
545
731
  name: string;
546
- kind?: "file" | "skill" | "agent" | undefined;
732
+ uri: string;
733
+ kind?: "agent" | "file" | "skill" | undefined;
547
734
  };
548
735
  sessionUpdate: "agent_thought_chunk";
549
736
  messageId: string;
@@ -553,15 +740,15 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
553
740
  type: "text";
554
741
  text: string;
555
742
  } | {
556
- type: "image";
557
743
  mimeType: string;
744
+ type: "image";
558
745
  data?: string | undefined;
559
746
  uri?: string | undefined;
560
747
  } | {
561
748
  type: "resource_link";
562
- uri: string;
563
749
  name: string;
564
- kind?: "file" | "skill" | "agent" | undefined;
750
+ uri: string;
751
+ kind?: "agent" | "file" | "skill" | undefined;
565
752
  };
566
753
  sessionUpdate: "agent_thought_chunk";
567
754
  messageId: string;
@@ -592,13 +779,13 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
592
779
  data: z.ZodOptional<z.ZodString>;
593
780
  uri: z.ZodOptional<z.ZodString>;
594
781
  }, "strip", z.ZodTypeAny, {
595
- type: "image";
596
782
  mimeType: string;
783
+ type: "image";
597
784
  data?: string | undefined;
598
785
  uri?: string | undefined;
599
786
  }, {
600
- type: "image";
601
787
  mimeType: string;
788
+ type: "image";
602
789
  data?: string | undefined;
603
790
  uri?: string | undefined;
604
791
  }>, z.ZodObject<{
@@ -609,14 +796,14 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
609
796
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
610
797
  }, "strip", z.ZodTypeAny, {
611
798
  type: "resource_link";
612
- uri: string;
613
799
  name: string;
614
- kind?: "file" | "skill" | "agent" | undefined;
800
+ uri: string;
801
+ kind?: "agent" | "file" | "skill" | undefined;
615
802
  }, {
616
803
  type: "resource_link";
617
- uri: string;
618
804
  name: string;
619
- kind?: "file" | "skill" | "agent" | undefined;
805
+ uri: string;
806
+ kind?: "agent" | "file" | "skill" | undefined;
620
807
  }>]>;
621
808
  }, "strip", z.ZodTypeAny, {
622
809
  type: "content";
@@ -624,15 +811,15 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
624
811
  type: "text";
625
812
  text: string;
626
813
  } | {
627
- type: "image";
628
814
  mimeType: string;
815
+ type: "image";
629
816
  data?: string | undefined;
630
817
  uri?: string | undefined;
631
818
  } | {
632
819
  type: "resource_link";
633
- uri: string;
634
820
  name: string;
635
- kind?: "file" | "skill" | "agent" | undefined;
821
+ uri: string;
822
+ kind?: "agent" | "file" | "skill" | undefined;
636
823
  };
637
824
  }, {
638
825
  type: "content";
@@ -640,15 +827,15 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
640
827
  type: "text";
641
828
  text: string;
642
829
  } | {
643
- type: "image";
644
830
  mimeType: string;
831
+ type: "image";
645
832
  data?: string | undefined;
646
833
  uri?: string | undefined;
647
834
  } | {
648
835
  type: "resource_link";
649
- uri: string;
650
836
  name: string;
651
- kind?: "file" | "skill" | "agent" | undefined;
837
+ uri: string;
838
+ kind?: "agent" | "file" | "skill" | undefined;
652
839
  };
653
840
  }>, z.ZodObject<{
654
841
  type: z.ZodLiteral<"diff">;
@@ -656,13 +843,13 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
656
843
  oldText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
657
844
  newText: z.ZodString;
658
845
  }, "strip", z.ZodTypeAny, {
659
- type: "diff";
660
846
  path: string;
847
+ type: "diff";
661
848
  newText: string;
662
849
  oldText?: string | null | undefined;
663
850
  }, {
664
- type: "diff";
665
851
  path: string;
852
+ type: "diff";
666
853
  newText: string;
667
854
  oldText?: string | null | undefined;
668
855
  }>, z.ZodObject<{
@@ -672,16 +859,16 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
672
859
  movePath: z.ZodOptional<z.ZodString>;
673
860
  diff: z.ZodString;
674
861
  }, "strip", z.ZodTypeAny, {
675
- type: "patch";
676
862
  path: string;
863
+ type: "patch";
677
864
  diff: string;
678
- change: "add" | "delete" | "update";
865
+ change: "delete" | "add" | "update";
679
866
  movePath?: string | undefined;
680
867
  }, {
681
- type: "patch";
682
868
  path: string;
869
+ type: "patch";
683
870
  diff: string;
684
- change: "add" | "delete" | "update";
871
+ change: "delete" | "add" | "update";
685
872
  movePath?: string | undefined;
686
873
  }>, z.ZodObject<{
687
874
  type: z.ZodLiteral<"terminal">;
@@ -709,12 +896,12 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
709
896
  tool: z.ZodString;
710
897
  }, "strip", z.ZodTypeAny, {
711
898
  type: "mcp";
712
- server: string;
713
899
  tool: string;
900
+ server: string;
714
901
  }, {
715
902
  type: "mcp";
716
- server: string;
717
903
  tool: string;
904
+ server: string;
718
905
  }>, z.ZodObject<{
719
906
  type: z.ZodLiteral<"subagent">;
720
907
  /** spawn starts a sub-agent (its work nests under this call); the rest talk to one. */
@@ -723,18 +910,205 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
723
910
  /** The sub-agent's role or type, e.g. "Explore". */
724
911
  agentType: z.ZodOptional<z.ZodString>;
725
912
  model: z.ZodOptional<z.ZodString>;
913
+ /** Agent outcome when a tool's coarse completed/failed state is insufficient. */
914
+ state: z.ZodOptional<z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>>;
915
+ /** A Claude workflow is a background run containing its own agents. Counts are observed, not a predicted total. */
916
+ workflow: z.ZodOptional<z.ZodObject<{
917
+ runId: z.ZodOptional<z.ZodString>;
918
+ name: z.ZodOptional<z.ZodString>;
919
+ state: z.ZodOptional<z.ZodEnum<["running", "paused", "completed", "failed", "stopped"]>>;
920
+ started: z.ZodOptional<z.ZodNumber>;
921
+ completed: z.ZodOptional<z.ZodNumber>;
922
+ tokens: z.ZodOptional<z.ZodNumber>;
923
+ durationMs: z.ZodOptional<z.ZodNumber>;
924
+ startedAt: z.ZodOptional<z.ZodNumber>;
925
+ endedAt: z.ZodOptional<z.ZodNumber>;
926
+ phases: z.ZodOptional<z.ZodArray<z.ZodObject<{
927
+ id: z.ZodString;
928
+ title: z.ZodString;
929
+ order: z.ZodNumber;
930
+ }, "strip", z.ZodTypeAny, {
931
+ id: string;
932
+ title: string;
933
+ order: number;
934
+ }, {
935
+ id: string;
936
+ title: string;
937
+ order: number;
938
+ }>, "many">>;
939
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
940
+ id: z.ZodString;
941
+ toolCallId: z.ZodOptional<z.ZodString>;
942
+ title: z.ZodString;
943
+ state: z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>;
944
+ phaseId: z.ZodOptional<z.ZodString>;
945
+ model: z.ZodOptional<z.ZodString>;
946
+ tokens: z.ZodOptional<z.ZodNumber>;
947
+ toolCalls: z.ZodOptional<z.ZodNumber>;
948
+ durationMs: z.ZodOptional<z.ZodNumber>;
949
+ startedAt: z.ZodOptional<z.ZodNumber>;
950
+ endedAt: z.ZodOptional<z.ZodNumber>;
951
+ result: z.ZodOptional<z.ZodString>;
952
+ }, "strip", z.ZodTypeAny, {
953
+ id: string;
954
+ title: string;
955
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
956
+ toolCallId?: string | undefined;
957
+ phaseId?: string | undefined;
958
+ model?: string | undefined;
959
+ tokens?: number | undefined;
960
+ toolCalls?: number | undefined;
961
+ durationMs?: number | undefined;
962
+ startedAt?: number | undefined;
963
+ endedAt?: number | undefined;
964
+ result?: string | undefined;
965
+ }, {
966
+ id: string;
967
+ title: string;
968
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
969
+ toolCallId?: string | undefined;
970
+ phaseId?: string | undefined;
971
+ model?: string | undefined;
972
+ tokens?: number | undefined;
973
+ toolCalls?: number | undefined;
974
+ durationMs?: number | undefined;
975
+ startedAt?: number | undefined;
976
+ endedAt?: number | undefined;
977
+ result?: string | undefined;
978
+ }>, "many">>;
979
+ }, "strip", z.ZodTypeAny, {
980
+ completed?: number | undefined;
981
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
982
+ tokens?: number | undefined;
983
+ durationMs?: number | undefined;
984
+ startedAt?: number | undefined;
985
+ endedAt?: number | undefined;
986
+ runId?: string | undefined;
987
+ name?: string | undefined;
988
+ started?: number | undefined;
989
+ phases?: {
990
+ id: string;
991
+ title: string;
992
+ order: number;
993
+ }[] | undefined;
994
+ agents?: {
995
+ id: string;
996
+ title: string;
997
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
998
+ toolCallId?: string | undefined;
999
+ phaseId?: string | undefined;
1000
+ model?: string | undefined;
1001
+ tokens?: number | undefined;
1002
+ toolCalls?: number | undefined;
1003
+ durationMs?: number | undefined;
1004
+ startedAt?: number | undefined;
1005
+ endedAt?: number | undefined;
1006
+ result?: string | undefined;
1007
+ }[] | undefined;
1008
+ }, {
1009
+ completed?: number | undefined;
1010
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1011
+ tokens?: number | undefined;
1012
+ durationMs?: number | undefined;
1013
+ startedAt?: number | undefined;
1014
+ endedAt?: number | undefined;
1015
+ runId?: string | undefined;
1016
+ name?: string | undefined;
1017
+ started?: number | undefined;
1018
+ phases?: {
1019
+ id: string;
1020
+ title: string;
1021
+ order: number;
1022
+ }[] | undefined;
1023
+ agents?: {
1024
+ id: string;
1025
+ title: string;
1026
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1027
+ toolCallId?: string | undefined;
1028
+ phaseId?: string | undefined;
1029
+ model?: string | undefined;
1030
+ tokens?: number | undefined;
1031
+ toolCalls?: number | undefined;
1032
+ durationMs?: number | undefined;
1033
+ startedAt?: number | undefined;
1034
+ endedAt?: number | undefined;
1035
+ result?: string | undefined;
1036
+ }[] | undefined;
1037
+ }>>;
726
1038
  }, "strip", z.ZodTypeAny, {
727
1039
  type: "subagent";
728
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
1040
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
1041
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
1042
+ model?: string | undefined;
729
1043
  task?: string | undefined;
730
1044
  agentType?: string | undefined;
731
- model?: string | undefined;
1045
+ workflow?: {
1046
+ completed?: number | undefined;
1047
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1048
+ tokens?: number | undefined;
1049
+ durationMs?: number | undefined;
1050
+ startedAt?: number | undefined;
1051
+ endedAt?: number | undefined;
1052
+ runId?: string | undefined;
1053
+ name?: string | undefined;
1054
+ started?: number | undefined;
1055
+ phases?: {
1056
+ id: string;
1057
+ title: string;
1058
+ order: number;
1059
+ }[] | undefined;
1060
+ agents?: {
1061
+ id: string;
1062
+ title: string;
1063
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1064
+ toolCallId?: string | undefined;
1065
+ phaseId?: string | undefined;
1066
+ model?: string | undefined;
1067
+ tokens?: number | undefined;
1068
+ toolCalls?: number | undefined;
1069
+ durationMs?: number | undefined;
1070
+ startedAt?: number | undefined;
1071
+ endedAt?: number | undefined;
1072
+ result?: string | undefined;
1073
+ }[] | undefined;
1074
+ } | undefined;
732
1075
  }, {
733
1076
  type: "subagent";
734
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
1077
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
1078
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
1079
+ model?: string | undefined;
735
1080
  task?: string | undefined;
736
1081
  agentType?: string | undefined;
737
- model?: string | undefined;
1082
+ workflow?: {
1083
+ completed?: number | undefined;
1084
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1085
+ tokens?: number | undefined;
1086
+ durationMs?: number | undefined;
1087
+ startedAt?: number | undefined;
1088
+ endedAt?: number | undefined;
1089
+ runId?: string | undefined;
1090
+ name?: string | undefined;
1091
+ started?: number | undefined;
1092
+ phases?: {
1093
+ id: string;
1094
+ title: string;
1095
+ order: number;
1096
+ }[] | undefined;
1097
+ agents?: {
1098
+ id: string;
1099
+ title: string;
1100
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1101
+ toolCallId?: string | undefined;
1102
+ phaseId?: string | undefined;
1103
+ model?: string | undefined;
1104
+ tokens?: number | undefined;
1105
+ toolCalls?: number | undefined;
1106
+ durationMs?: number | undefined;
1107
+ startedAt?: number | undefined;
1108
+ endedAt?: number | undefined;
1109
+ result?: string | undefined;
1110
+ }[] | undefined;
1111
+ } | undefined;
738
1112
  }>, z.ZodObject<{
739
1113
  type: z.ZodLiteral<"skill">;
740
1114
  name: z.ZodString;
@@ -794,58 +1168,156 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
794
1168
  more?: number | undefined;
795
1169
  }>]>>;
796
1170
  }, "strip", z.ZodTypeAny, {
797
- status: "pending" | "in_progress" | "completed" | "failed";
798
- kind: "delete" | "other" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
799
- sessionUpdate: "tool_call";
1171
+ status: "completed" | "failed" | "pending" | "in_progress";
800
1172
  toolCallId: string;
801
1173
  title: string;
1174
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
1175
+ sessionUpdate: "tool_call";
1176
+ detail?: {
1177
+ type: "mcp";
1178
+ tool: string;
1179
+ server: string;
1180
+ } | {
1181
+ type: "subagent";
1182
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
1183
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
1184
+ model?: string | undefined;
1185
+ task?: string | undefined;
1186
+ agentType?: string | undefined;
1187
+ workflow?: {
1188
+ completed?: number | undefined;
1189
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1190
+ tokens?: number | undefined;
1191
+ durationMs?: number | undefined;
1192
+ startedAt?: number | undefined;
1193
+ endedAt?: number | undefined;
1194
+ runId?: string | undefined;
1195
+ name?: string | undefined;
1196
+ started?: number | undefined;
1197
+ phases?: {
1198
+ id: string;
1199
+ title: string;
1200
+ order: number;
1201
+ }[] | undefined;
1202
+ agents?: {
1203
+ id: string;
1204
+ title: string;
1205
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1206
+ toolCallId?: string | undefined;
1207
+ phaseId?: string | undefined;
1208
+ model?: string | undefined;
1209
+ tokens?: number | undefined;
1210
+ toolCalls?: number | undefined;
1211
+ durationMs?: number | undefined;
1212
+ startedAt?: number | undefined;
1213
+ endedAt?: number | undefined;
1214
+ result?: string | undefined;
1215
+ }[] | undefined;
1216
+ } | undefined;
1217
+ } | {
1218
+ type: "skill";
1219
+ name: string;
1220
+ description?: string | undefined;
1221
+ } | {
1222
+ type: "web_search";
1223
+ query?: string | undefined;
1224
+ } | {
1225
+ type: "image_generation";
1226
+ prompt?: string | undefined;
1227
+ } | {
1228
+ type: "compaction";
1229
+ } | {
1230
+ type: "review";
1231
+ phase: "started" | "finished";
1232
+ } | {
1233
+ type: "question";
1234
+ text: string;
1235
+ more?: number | undefined;
1236
+ } | undefined;
1237
+ parentToolCallId?: string | undefined;
802
1238
  content?: ({
803
1239
  type: "content";
804
1240
  content: {
805
1241
  type: "text";
806
1242
  text: string;
807
1243
  } | {
808
- type: "image";
809
1244
  mimeType: string;
1245
+ type: "image";
810
1246
  data?: string | undefined;
811
1247
  uri?: string | undefined;
812
1248
  } | {
813
1249
  type: "resource_link";
814
- uri: string;
815
1250
  name: string;
816
- kind?: "file" | "skill" | "agent" | undefined;
1251
+ uri: string;
1252
+ kind?: "agent" | "file" | "skill" | undefined;
817
1253
  };
818
1254
  } | {
819
- type: "diff";
820
1255
  path: string;
1256
+ type: "diff";
821
1257
  newText: string;
822
1258
  oldText?: string | null | undefined;
823
1259
  } | {
824
- type: "patch";
825
1260
  path: string;
1261
+ type: "patch";
826
1262
  diff: string;
827
- change: "add" | "delete" | "update";
1263
+ change: "delete" | "add" | "update";
828
1264
  movePath?: string | undefined;
829
1265
  } | {
830
1266
  type: "terminal";
831
1267
  terminalId: string;
832
1268
  })[] | undefined;
833
- parentToolCallId?: string | undefined;
834
1269
  rawInput?: unknown;
835
1270
  locations?: {
836
1271
  path: string;
837
1272
  line?: number | undefined;
838
1273
  }[] | undefined;
1274
+ }, {
1275
+ status: "completed" | "failed" | "pending" | "in_progress";
1276
+ toolCallId: string;
1277
+ title: string;
1278
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
1279
+ sessionUpdate: "tool_call";
839
1280
  detail?: {
840
1281
  type: "mcp";
841
- server: string;
842
1282
  tool: string;
1283
+ server: string;
843
1284
  } | {
844
1285
  type: "subagent";
845
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
1286
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
1287
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
1288
+ model?: string | undefined;
846
1289
  task?: string | undefined;
847
1290
  agentType?: string | undefined;
848
- model?: string | undefined;
1291
+ workflow?: {
1292
+ completed?: number | undefined;
1293
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1294
+ tokens?: number | undefined;
1295
+ durationMs?: number | undefined;
1296
+ startedAt?: number | undefined;
1297
+ endedAt?: number | undefined;
1298
+ runId?: string | undefined;
1299
+ name?: string | undefined;
1300
+ started?: number | undefined;
1301
+ phases?: {
1302
+ id: string;
1303
+ title: string;
1304
+ order: number;
1305
+ }[] | undefined;
1306
+ agents?: {
1307
+ id: string;
1308
+ title: string;
1309
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1310
+ toolCallId?: string | undefined;
1311
+ phaseId?: string | undefined;
1312
+ model?: string | undefined;
1313
+ tokens?: number | undefined;
1314
+ toolCalls?: number | undefined;
1315
+ durationMs?: number | undefined;
1316
+ startedAt?: number | undefined;
1317
+ endedAt?: number | undefined;
1318
+ result?: string | undefined;
1319
+ }[] | undefined;
1320
+ } | undefined;
849
1321
  } | {
850
1322
  type: "skill";
851
1323
  name: string;
@@ -866,79 +1338,43 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
866
1338
  text: string;
867
1339
  more?: number | undefined;
868
1340
  } | undefined;
869
- }, {
870
- status: "pending" | "in_progress" | "completed" | "failed";
871
- kind: "delete" | "other" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
872
- sessionUpdate: "tool_call";
873
- toolCallId: string;
874
- title: string;
1341
+ parentToolCallId?: string | undefined;
875
1342
  content?: ({
876
1343
  type: "content";
877
1344
  content: {
878
1345
  type: "text";
879
1346
  text: string;
880
1347
  } | {
881
- type: "image";
882
1348
  mimeType: string;
1349
+ type: "image";
883
1350
  data?: string | undefined;
884
1351
  uri?: string | undefined;
885
1352
  } | {
886
1353
  type: "resource_link";
887
- uri: string;
888
1354
  name: string;
889
- kind?: "file" | "skill" | "agent" | undefined;
1355
+ uri: string;
1356
+ kind?: "agent" | "file" | "skill" | undefined;
890
1357
  };
891
1358
  } | {
892
- type: "diff";
893
1359
  path: string;
1360
+ type: "diff";
894
1361
  newText: string;
895
1362
  oldText?: string | null | undefined;
896
1363
  } | {
897
- type: "patch";
898
1364
  path: string;
1365
+ type: "patch";
899
1366
  diff: string;
900
- change: "add" | "delete" | "update";
1367
+ change: "delete" | "add" | "update";
901
1368
  movePath?: string | undefined;
902
1369
  } | {
903
1370
  type: "terminal";
904
1371
  terminalId: string;
905
1372
  })[] | undefined;
906
- parentToolCallId?: string | undefined;
907
1373
  rawInput?: unknown;
908
1374
  locations?: {
909
1375
  path: string;
910
1376
  line?: number | undefined;
911
1377
  }[] | undefined;
912
- detail?: {
913
- type: "mcp";
914
- server: string;
915
- tool: string;
916
- } | {
917
- type: "subagent";
918
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
919
- task?: string | undefined;
920
- agentType?: string | undefined;
921
- model?: string | undefined;
922
- } | {
923
- type: "skill";
924
- name: string;
925
- description?: string | undefined;
926
- } | {
927
- type: "web_search";
928
- query?: string | undefined;
929
- } | {
930
- type: "image_generation";
931
- prompt?: string | undefined;
932
- } | {
933
- type: "compaction";
934
- } | {
935
- type: "review";
936
- phase: "started" | "finished";
937
- } | {
938
- type: "question";
939
- text: string;
940
- more?: number | undefined;
941
- } | undefined;
942
1378
  }>, z.ZodObject<{
943
1379
  sessionUpdate: z.ZodLiteral<"tool_call_update">;
944
1380
  toolCallId: z.ZodString;
@@ -951,12 +1387,12 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
951
1387
  tool: z.ZodString;
952
1388
  }, "strip", z.ZodTypeAny, {
953
1389
  type: "mcp";
954
- server: string;
955
1390
  tool: string;
1391
+ server: string;
956
1392
  }, {
957
1393
  type: "mcp";
958
- server: string;
959
1394
  tool: string;
1395
+ server: string;
960
1396
  }>, z.ZodObject<{
961
1397
  type: z.ZodLiteral<"subagent">;
962
1398
  /** spawn starts a sub-agent (its work nests under this call); the rest talk to one. */
@@ -965,18 +1401,205 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
965
1401
  /** The sub-agent's role or type, e.g. "Explore". */
966
1402
  agentType: z.ZodOptional<z.ZodString>;
967
1403
  model: z.ZodOptional<z.ZodString>;
1404
+ /** Agent outcome when a tool's coarse completed/failed state is insufficient. */
1405
+ state: z.ZodOptional<z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>>;
1406
+ /** A Claude workflow is a background run containing its own agents. Counts are observed, not a predicted total. */
1407
+ workflow: z.ZodOptional<z.ZodObject<{
1408
+ runId: z.ZodOptional<z.ZodString>;
1409
+ name: z.ZodOptional<z.ZodString>;
1410
+ state: z.ZodOptional<z.ZodEnum<["running", "paused", "completed", "failed", "stopped"]>>;
1411
+ started: z.ZodOptional<z.ZodNumber>;
1412
+ completed: z.ZodOptional<z.ZodNumber>;
1413
+ tokens: z.ZodOptional<z.ZodNumber>;
1414
+ durationMs: z.ZodOptional<z.ZodNumber>;
1415
+ startedAt: z.ZodOptional<z.ZodNumber>;
1416
+ endedAt: z.ZodOptional<z.ZodNumber>;
1417
+ phases: z.ZodOptional<z.ZodArray<z.ZodObject<{
1418
+ id: z.ZodString;
1419
+ title: z.ZodString;
1420
+ order: z.ZodNumber;
1421
+ }, "strip", z.ZodTypeAny, {
1422
+ id: string;
1423
+ title: string;
1424
+ order: number;
1425
+ }, {
1426
+ id: string;
1427
+ title: string;
1428
+ order: number;
1429
+ }>, "many">>;
1430
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
1431
+ id: z.ZodString;
1432
+ toolCallId: z.ZodOptional<z.ZodString>;
1433
+ title: z.ZodString;
1434
+ state: z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>;
1435
+ phaseId: z.ZodOptional<z.ZodString>;
1436
+ model: z.ZodOptional<z.ZodString>;
1437
+ tokens: z.ZodOptional<z.ZodNumber>;
1438
+ toolCalls: z.ZodOptional<z.ZodNumber>;
1439
+ durationMs: z.ZodOptional<z.ZodNumber>;
1440
+ startedAt: z.ZodOptional<z.ZodNumber>;
1441
+ endedAt: z.ZodOptional<z.ZodNumber>;
1442
+ result: z.ZodOptional<z.ZodString>;
1443
+ }, "strip", z.ZodTypeAny, {
1444
+ id: string;
1445
+ title: string;
1446
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1447
+ toolCallId?: string | undefined;
1448
+ phaseId?: string | undefined;
1449
+ model?: string | undefined;
1450
+ tokens?: number | undefined;
1451
+ toolCalls?: number | undefined;
1452
+ durationMs?: number | undefined;
1453
+ startedAt?: number | undefined;
1454
+ endedAt?: number | undefined;
1455
+ result?: string | undefined;
1456
+ }, {
1457
+ id: string;
1458
+ title: string;
1459
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1460
+ toolCallId?: string | undefined;
1461
+ phaseId?: string | undefined;
1462
+ model?: string | undefined;
1463
+ tokens?: number | undefined;
1464
+ toolCalls?: number | undefined;
1465
+ durationMs?: number | undefined;
1466
+ startedAt?: number | undefined;
1467
+ endedAt?: number | undefined;
1468
+ result?: string | undefined;
1469
+ }>, "many">>;
1470
+ }, "strip", z.ZodTypeAny, {
1471
+ completed?: number | undefined;
1472
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1473
+ tokens?: number | undefined;
1474
+ durationMs?: number | undefined;
1475
+ startedAt?: number | undefined;
1476
+ endedAt?: number | undefined;
1477
+ runId?: string | undefined;
1478
+ name?: string | undefined;
1479
+ started?: number | undefined;
1480
+ phases?: {
1481
+ id: string;
1482
+ title: string;
1483
+ order: number;
1484
+ }[] | undefined;
1485
+ agents?: {
1486
+ id: string;
1487
+ title: string;
1488
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1489
+ toolCallId?: string | undefined;
1490
+ phaseId?: string | undefined;
1491
+ model?: string | undefined;
1492
+ tokens?: number | undefined;
1493
+ toolCalls?: number | undefined;
1494
+ durationMs?: number | undefined;
1495
+ startedAt?: number | undefined;
1496
+ endedAt?: number | undefined;
1497
+ result?: string | undefined;
1498
+ }[] | undefined;
1499
+ }, {
1500
+ completed?: number | undefined;
1501
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1502
+ tokens?: number | undefined;
1503
+ durationMs?: number | undefined;
1504
+ startedAt?: number | undefined;
1505
+ endedAt?: number | undefined;
1506
+ runId?: string | undefined;
1507
+ name?: string | undefined;
1508
+ started?: number | undefined;
1509
+ phases?: {
1510
+ id: string;
1511
+ title: string;
1512
+ order: number;
1513
+ }[] | undefined;
1514
+ agents?: {
1515
+ id: string;
1516
+ title: string;
1517
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1518
+ toolCallId?: string | undefined;
1519
+ phaseId?: string | undefined;
1520
+ model?: string | undefined;
1521
+ tokens?: number | undefined;
1522
+ toolCalls?: number | undefined;
1523
+ durationMs?: number | undefined;
1524
+ startedAt?: number | undefined;
1525
+ endedAt?: number | undefined;
1526
+ result?: string | undefined;
1527
+ }[] | undefined;
1528
+ }>>;
968
1529
  }, "strip", z.ZodTypeAny, {
969
1530
  type: "subagent";
970
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
1531
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
1532
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
1533
+ model?: string | undefined;
971
1534
  task?: string | undefined;
972
1535
  agentType?: string | undefined;
973
- model?: string | undefined;
1536
+ workflow?: {
1537
+ completed?: number | undefined;
1538
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1539
+ tokens?: number | undefined;
1540
+ durationMs?: number | undefined;
1541
+ startedAt?: number | undefined;
1542
+ endedAt?: number | undefined;
1543
+ runId?: string | undefined;
1544
+ name?: string | undefined;
1545
+ started?: number | undefined;
1546
+ phases?: {
1547
+ id: string;
1548
+ title: string;
1549
+ order: number;
1550
+ }[] | undefined;
1551
+ agents?: {
1552
+ id: string;
1553
+ title: string;
1554
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1555
+ toolCallId?: string | undefined;
1556
+ phaseId?: string | undefined;
1557
+ model?: string | undefined;
1558
+ tokens?: number | undefined;
1559
+ toolCalls?: number | undefined;
1560
+ durationMs?: number | undefined;
1561
+ startedAt?: number | undefined;
1562
+ endedAt?: number | undefined;
1563
+ result?: string | undefined;
1564
+ }[] | undefined;
1565
+ } | undefined;
974
1566
  }, {
975
1567
  type: "subagent";
976
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
1568
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
1569
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
1570
+ model?: string | undefined;
977
1571
  task?: string | undefined;
978
1572
  agentType?: string | undefined;
979
- model?: string | undefined;
1573
+ workflow?: {
1574
+ completed?: number | undefined;
1575
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1576
+ tokens?: number | undefined;
1577
+ durationMs?: number | undefined;
1578
+ startedAt?: number | undefined;
1579
+ endedAt?: number | undefined;
1580
+ runId?: string | undefined;
1581
+ name?: string | undefined;
1582
+ started?: number | undefined;
1583
+ phases?: {
1584
+ id: string;
1585
+ title: string;
1586
+ order: number;
1587
+ }[] | undefined;
1588
+ agents?: {
1589
+ id: string;
1590
+ title: string;
1591
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1592
+ toolCallId?: string | undefined;
1593
+ phaseId?: string | undefined;
1594
+ model?: string | undefined;
1595
+ tokens?: number | undefined;
1596
+ toolCalls?: number | undefined;
1597
+ durationMs?: number | undefined;
1598
+ startedAt?: number | undefined;
1599
+ endedAt?: number | undefined;
1600
+ result?: string | undefined;
1601
+ }[] | undefined;
1602
+ } | undefined;
980
1603
  }>, z.ZodObject<{
981
1604
  type: z.ZodLiteral<"skill">;
982
1605
  name: z.ZodString;
@@ -1053,13 +1676,13 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1053
1676
  data: z.ZodOptional<z.ZodString>;
1054
1677
  uri: z.ZodOptional<z.ZodString>;
1055
1678
  }, "strip", z.ZodTypeAny, {
1056
- type: "image";
1057
1679
  mimeType: string;
1680
+ type: "image";
1058
1681
  data?: string | undefined;
1059
1682
  uri?: string | undefined;
1060
1683
  }, {
1061
- type: "image";
1062
1684
  mimeType: string;
1685
+ type: "image";
1063
1686
  data?: string | undefined;
1064
1687
  uri?: string | undefined;
1065
1688
  }>, z.ZodObject<{
@@ -1070,14 +1693,14 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1070
1693
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
1071
1694
  }, "strip", z.ZodTypeAny, {
1072
1695
  type: "resource_link";
1073
- uri: string;
1074
1696
  name: string;
1075
- kind?: "file" | "skill" | "agent" | undefined;
1697
+ uri: string;
1698
+ kind?: "agent" | "file" | "skill" | undefined;
1076
1699
  }, {
1077
1700
  type: "resource_link";
1078
- uri: string;
1079
1701
  name: string;
1080
- kind?: "file" | "skill" | "agent" | undefined;
1702
+ uri: string;
1703
+ kind?: "agent" | "file" | "skill" | undefined;
1081
1704
  }>]>;
1082
1705
  }, "strip", z.ZodTypeAny, {
1083
1706
  type: "content";
@@ -1085,15 +1708,15 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1085
1708
  type: "text";
1086
1709
  text: string;
1087
1710
  } | {
1088
- type: "image";
1089
1711
  mimeType: string;
1712
+ type: "image";
1090
1713
  data?: string | undefined;
1091
1714
  uri?: string | undefined;
1092
1715
  } | {
1093
1716
  type: "resource_link";
1094
- uri: string;
1095
1717
  name: string;
1096
- kind?: "file" | "skill" | "agent" | undefined;
1718
+ uri: string;
1719
+ kind?: "agent" | "file" | "skill" | undefined;
1097
1720
  };
1098
1721
  }, {
1099
1722
  type: "content";
@@ -1101,15 +1724,15 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1101
1724
  type: "text";
1102
1725
  text: string;
1103
1726
  } | {
1104
- type: "image";
1105
1727
  mimeType: string;
1728
+ type: "image";
1106
1729
  data?: string | undefined;
1107
1730
  uri?: string | undefined;
1108
1731
  } | {
1109
1732
  type: "resource_link";
1110
- uri: string;
1111
1733
  name: string;
1112
- kind?: "file" | "skill" | "agent" | undefined;
1734
+ uri: string;
1735
+ kind?: "agent" | "file" | "skill" | undefined;
1113
1736
  };
1114
1737
  }>, z.ZodObject<{
1115
1738
  type: z.ZodLiteral<"diff">;
@@ -1117,13 +1740,13 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1117
1740
  oldText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1118
1741
  newText: z.ZodString;
1119
1742
  }, "strip", z.ZodTypeAny, {
1120
- type: "diff";
1121
1743
  path: string;
1744
+ type: "diff";
1122
1745
  newText: string;
1123
1746
  oldText?: string | null | undefined;
1124
1747
  }, {
1125
- type: "diff";
1126
1748
  path: string;
1749
+ type: "diff";
1127
1750
  newText: string;
1128
1751
  oldText?: string | null | undefined;
1129
1752
  }>, z.ZodObject<{
@@ -1133,16 +1756,16 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1133
1756
  movePath: z.ZodOptional<z.ZodString>;
1134
1757
  diff: z.ZodString;
1135
1758
  }, "strip", z.ZodTypeAny, {
1136
- type: "patch";
1137
1759
  path: string;
1760
+ type: "patch";
1138
1761
  diff: string;
1139
- change: "add" | "delete" | "update";
1762
+ change: "delete" | "add" | "update";
1140
1763
  movePath?: string | undefined;
1141
1764
  }, {
1142
- type: "patch";
1143
1765
  path: string;
1766
+ type: "patch";
1144
1767
  diff: string;
1145
- change: "add" | "delete" | "update";
1768
+ change: "delete" | "add" | "update";
1146
1769
  movePath?: string | undefined;
1147
1770
  }>, z.ZodObject<{
1148
1771
  type: z.ZodLiteral<"terminal">;
@@ -1158,52 +1781,51 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1158
1781
  appendOutput: z.ZodOptional<z.ZodString>;
1159
1782
  rawOutput: z.ZodOptional<z.ZodUnknown>;
1160
1783
  }, "strip", z.ZodTypeAny, {
1161
- sessionUpdate: "tool_call_update";
1162
1784
  toolCallId: string;
1163
- status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
1164
- content?: ({
1165
- type: "content";
1166
- content: {
1167
- type: "text";
1168
- text: string;
1169
- } | {
1170
- type: "image";
1171
- mimeType: string;
1172
- data?: string | undefined;
1173
- uri?: string | undefined;
1174
- } | {
1175
- type: "resource_link";
1176
- uri: string;
1177
- name: string;
1178
- kind?: "file" | "skill" | "agent" | undefined;
1179
- };
1180
- } | {
1181
- type: "diff";
1182
- path: string;
1183
- newText: string;
1184
- oldText?: string | null | undefined;
1185
- } | {
1186
- type: "patch";
1187
- path: string;
1188
- diff: string;
1189
- change: "add" | "delete" | "update";
1190
- movePath?: string | undefined;
1191
- } | {
1192
- type: "terminal";
1193
- terminalId: string;
1194
- })[] | undefined;
1195
- parentToolCallId?: string | undefined;
1785
+ sessionUpdate: "tool_call_update";
1786
+ status?: "completed" | "failed" | "pending" | "in_progress" | undefined;
1196
1787
  title?: string | undefined;
1197
1788
  detail?: {
1198
1789
  type: "mcp";
1199
- server: string;
1200
1790
  tool: string;
1791
+ server: string;
1201
1792
  } | {
1202
1793
  type: "subagent";
1203
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
1794
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
1795
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
1796
+ model?: string | undefined;
1204
1797
  task?: string | undefined;
1205
1798
  agentType?: string | undefined;
1206
- model?: string | undefined;
1799
+ workflow?: {
1800
+ completed?: number | undefined;
1801
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1802
+ tokens?: number | undefined;
1803
+ durationMs?: number | undefined;
1804
+ startedAt?: number | undefined;
1805
+ endedAt?: number | undefined;
1806
+ runId?: string | undefined;
1807
+ name?: string | undefined;
1808
+ started?: number | undefined;
1809
+ phases?: {
1810
+ id: string;
1811
+ title: string;
1812
+ order: number;
1813
+ }[] | undefined;
1814
+ agents?: {
1815
+ id: string;
1816
+ title: string;
1817
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1818
+ toolCallId?: string | undefined;
1819
+ phaseId?: string | undefined;
1820
+ model?: string | undefined;
1821
+ tokens?: number | undefined;
1822
+ toolCalls?: number | undefined;
1823
+ durationMs?: number | undefined;
1824
+ startedAt?: number | undefined;
1825
+ endedAt?: number | undefined;
1826
+ result?: string | undefined;
1827
+ }[] | undefined;
1828
+ } | undefined;
1207
1829
  } | {
1208
1830
  type: "skill";
1209
1831
  name: string;
@@ -1224,55 +1846,86 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1224
1846
  text: string;
1225
1847
  more?: number | undefined;
1226
1848
  } | undefined;
1227
- appendOutput?: string | undefined;
1228
- rawOutput?: unknown;
1229
- }, {
1230
- sessionUpdate: "tool_call_update";
1231
- toolCallId: string;
1232
- status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
1849
+ parentToolCallId?: string | undefined;
1233
1850
  content?: ({
1234
1851
  type: "content";
1235
1852
  content: {
1236
1853
  type: "text";
1237
1854
  text: string;
1238
1855
  } | {
1239
- type: "image";
1240
1856
  mimeType: string;
1857
+ type: "image";
1241
1858
  data?: string | undefined;
1242
1859
  uri?: string | undefined;
1243
1860
  } | {
1244
1861
  type: "resource_link";
1245
- uri: string;
1246
1862
  name: string;
1247
- kind?: "file" | "skill" | "agent" | undefined;
1863
+ uri: string;
1864
+ kind?: "agent" | "file" | "skill" | undefined;
1248
1865
  };
1249
1866
  } | {
1250
- type: "diff";
1251
1867
  path: string;
1868
+ type: "diff";
1252
1869
  newText: string;
1253
1870
  oldText?: string | null | undefined;
1254
1871
  } | {
1255
- type: "patch";
1256
1872
  path: string;
1873
+ type: "patch";
1257
1874
  diff: string;
1258
- change: "add" | "delete" | "update";
1875
+ change: "delete" | "add" | "update";
1259
1876
  movePath?: string | undefined;
1260
1877
  } | {
1261
1878
  type: "terminal";
1262
1879
  terminalId: string;
1263
1880
  })[] | undefined;
1264
- parentToolCallId?: string | undefined;
1881
+ appendOutput?: string | undefined;
1882
+ rawOutput?: unknown;
1883
+ }, {
1884
+ toolCallId: string;
1885
+ sessionUpdate: "tool_call_update";
1886
+ status?: "completed" | "failed" | "pending" | "in_progress" | undefined;
1265
1887
  title?: string | undefined;
1266
1888
  detail?: {
1267
1889
  type: "mcp";
1268
- server: string;
1269
1890
  tool: string;
1891
+ server: string;
1270
1892
  } | {
1271
1893
  type: "subagent";
1272
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
1894
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
1895
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
1896
+ model?: string | undefined;
1273
1897
  task?: string | undefined;
1274
1898
  agentType?: string | undefined;
1275
- model?: string | undefined;
1899
+ workflow?: {
1900
+ completed?: number | undefined;
1901
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
1902
+ tokens?: number | undefined;
1903
+ durationMs?: number | undefined;
1904
+ startedAt?: number | undefined;
1905
+ endedAt?: number | undefined;
1906
+ runId?: string | undefined;
1907
+ name?: string | undefined;
1908
+ started?: number | undefined;
1909
+ phases?: {
1910
+ id: string;
1911
+ title: string;
1912
+ order: number;
1913
+ }[] | undefined;
1914
+ agents?: {
1915
+ id: string;
1916
+ title: string;
1917
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
1918
+ toolCallId?: string | undefined;
1919
+ phaseId?: string | undefined;
1920
+ model?: string | undefined;
1921
+ tokens?: number | undefined;
1922
+ toolCalls?: number | undefined;
1923
+ durationMs?: number | undefined;
1924
+ startedAt?: number | undefined;
1925
+ endedAt?: number | undefined;
1926
+ result?: string | undefined;
1927
+ }[] | undefined;
1928
+ } | undefined;
1276
1929
  } | {
1277
1930
  type: "skill";
1278
1931
  name: string;
@@ -1293,6 +1946,38 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1293
1946
  text: string;
1294
1947
  more?: number | undefined;
1295
1948
  } | undefined;
1949
+ parentToolCallId?: string | undefined;
1950
+ content?: ({
1951
+ type: "content";
1952
+ content: {
1953
+ type: "text";
1954
+ text: string;
1955
+ } | {
1956
+ mimeType: string;
1957
+ type: "image";
1958
+ data?: string | undefined;
1959
+ uri?: string | undefined;
1960
+ } | {
1961
+ type: "resource_link";
1962
+ name: string;
1963
+ uri: string;
1964
+ kind?: "agent" | "file" | "skill" | undefined;
1965
+ };
1966
+ } | {
1967
+ path: string;
1968
+ type: "diff";
1969
+ newText: string;
1970
+ oldText?: string | null | undefined;
1971
+ } | {
1972
+ path: string;
1973
+ type: "patch";
1974
+ diff: string;
1975
+ change: "delete" | "add" | "update";
1976
+ movePath?: string | undefined;
1977
+ } | {
1978
+ type: "terminal";
1979
+ terminalId: string;
1980
+ })[] | undefined;
1296
1981
  appendOutput?: string | undefined;
1297
1982
  rawOutput?: unknown;
1298
1983
  }>, z.ZodObject<{
@@ -1302,28 +1987,77 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1302
1987
  priority: z.ZodDefault<z.ZodEnum<["high", "medium", "low"]>>;
1303
1988
  status: z.ZodEnum<["pending", "in_progress", "completed"]>;
1304
1989
  }, "strip", z.ZodTypeAny, {
1305
- status: "pending" | "in_progress" | "completed";
1990
+ status: "completed" | "pending" | "in_progress";
1306
1991
  content: string;
1307
1992
  priority: "high" | "medium" | "low";
1308
1993
  }, {
1309
- status: "pending" | "in_progress" | "completed";
1994
+ status: "completed" | "pending" | "in_progress";
1310
1995
  content: string;
1311
1996
  priority?: "high" | "medium" | "low" | undefined;
1312
1997
  }>, "many">;
1313
1998
  }, "strip", z.ZodTypeAny, {
1314
1999
  entries: {
1315
- status: "pending" | "in_progress" | "completed";
2000
+ status: "completed" | "pending" | "in_progress";
1316
2001
  content: string;
1317
2002
  priority: "high" | "medium" | "low";
1318
2003
  }[];
1319
2004
  sessionUpdate: "plan";
1320
2005
  }, {
1321
2006
  entries: {
1322
- status: "pending" | "in_progress" | "completed";
2007
+ status: "completed" | "pending" | "in_progress";
1323
2008
  content: string;
1324
2009
  priority?: "high" | "medium" | "low" | undefined;
1325
2010
  }[];
1326
2011
  sessionUpdate: "plan";
2012
+ }>, z.ZodObject<{
2013
+ sessionUpdate: z.ZodLiteral<"ls_goal">;
2014
+ goal: z.ZodNullable<z.ZodObject<{
2015
+ objective: z.ZodString;
2016
+ status: z.ZodEnum<["active", "paused", "blocked", "usageLimited", "budgetLimited", "complete"]>;
2017
+ tokenBudget: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2018
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
2019
+ timeUsedSeconds: z.ZodOptional<z.ZodNumber>;
2020
+ iterations: z.ZodOptional<z.ZodNumber>;
2021
+ lastReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2022
+ }, "strip", z.ZodTypeAny, {
2023
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
2024
+ objective: string;
2025
+ tokenBudget?: number | null | undefined;
2026
+ tokensUsed?: number | undefined;
2027
+ timeUsedSeconds?: number | undefined;
2028
+ iterations?: number | undefined;
2029
+ lastReason?: string | null | undefined;
2030
+ }, {
2031
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
2032
+ objective: string;
2033
+ tokenBudget?: number | null | undefined;
2034
+ tokensUsed?: number | undefined;
2035
+ timeUsedSeconds?: number | undefined;
2036
+ iterations?: number | undefined;
2037
+ lastReason?: string | null | undefined;
2038
+ }>>;
2039
+ }, "strip", z.ZodTypeAny, {
2040
+ sessionUpdate: "ls_goal";
2041
+ goal: {
2042
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
2043
+ objective: string;
2044
+ tokenBudget?: number | null | undefined;
2045
+ tokensUsed?: number | undefined;
2046
+ timeUsedSeconds?: number | undefined;
2047
+ iterations?: number | undefined;
2048
+ lastReason?: string | null | undefined;
2049
+ } | null;
2050
+ }, {
2051
+ sessionUpdate: "ls_goal";
2052
+ goal: {
2053
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
2054
+ objective: string;
2055
+ tokenBudget?: number | null | undefined;
2056
+ tokensUsed?: number | undefined;
2057
+ timeUsedSeconds?: number | undefined;
2058
+ iterations?: number | undefined;
2059
+ lastReason?: string | null | undefined;
2060
+ } | null;
1327
2061
  }>, z.ZodObject<{
1328
2062
  sessionUpdate: z.ZodLiteral<"available_commands_update">;
1329
2063
  availableCommands: z.ZodArray<z.ZodObject<{
@@ -1368,12 +2102,12 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1368
2102
  model: z.ZodOptional<z.ZodString>;
1369
2103
  }, "strip", z.ZodTypeAny, {
1370
2104
  sessionUpdate: "session_info_update";
1371
- model?: string | undefined;
1372
2105
  title?: string | undefined;
2106
+ model?: string | undefined;
1373
2107
  }, {
1374
2108
  sessionUpdate: "session_info_update";
1375
- model?: string | undefined;
1376
2109
  title?: string | undefined;
2110
+ model?: string | undefined;
1377
2111
  }>, z.ZodObject<{
1378
2112
  sessionUpdate: z.ZodLiteral<"usage_update">;
1379
2113
  usedTokens: z.ZodOptional<z.ZodNumber>;
@@ -1423,50 +2157,50 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1423
2157
  description?: string | undefined;
1424
2158
  }>, "many">;
1425
2159
  }, "strip", z.ZodTypeAny, {
2160
+ id: string;
1426
2161
  values: {
1427
2162
  value: string;
1428
2163
  name: string;
1429
2164
  description?: string | undefined;
1430
2165
  }[];
1431
2166
  name: string;
1432
- id: string;
1433
- category: "model" | "mode" | "effort" | "other";
2167
+ category: "model" | "other" | "mode" | "effort";
1434
2168
  current: string;
1435
2169
  }, {
2170
+ id: string;
1436
2171
  values: {
1437
2172
  value: string;
1438
2173
  name: string;
1439
2174
  description?: string | undefined;
1440
2175
  }[];
1441
2176
  name: string;
1442
- id: string;
1443
2177
  current: string;
1444
- category?: "model" | "mode" | "effort" | "other" | undefined;
2178
+ category?: "model" | "other" | "mode" | "effort" | undefined;
1445
2179
  }>, "many">;
1446
2180
  }, "strip", z.ZodTypeAny, {
1447
2181
  options: {
2182
+ id: string;
1448
2183
  values: {
1449
2184
  value: string;
1450
2185
  name: string;
1451
2186
  description?: string | undefined;
1452
2187
  }[];
1453
2188
  name: string;
1454
- id: string;
1455
- category: "model" | "mode" | "effort" | "other";
2189
+ category: "model" | "other" | "mode" | "effort";
1456
2190
  current: string;
1457
2191
  }[];
1458
2192
  sessionUpdate: "ls_config";
1459
2193
  }, {
1460
2194
  options: {
2195
+ id: string;
1461
2196
  values: {
1462
2197
  value: string;
1463
2198
  name: string;
1464
2199
  description?: string | undefined;
1465
2200
  }[];
1466
2201
  name: string;
1467
- id: string;
1468
2202
  current: string;
1469
- category?: "model" | "mode" | "effort" | "other" | undefined;
2203
+ category?: "model" | "other" | "mode" | "effort" | undefined;
1470
2204
  }[];
1471
2205
  sessionUpdate: "ls_config";
1472
2206
  }>, z.ZodObject<{
@@ -1475,13 +2209,13 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1475
2209
  title: z.ZodString;
1476
2210
  detail: z.ZodOptional<z.ZodString>;
1477
2211
  }, "strip", z.ZodTypeAny, {
1478
- sessionUpdate: "ls_notice";
1479
2212
  title: string;
2213
+ sessionUpdate: "ls_notice";
1480
2214
  level: "info" | "warning";
1481
2215
  detail?: string | undefined;
1482
2216
  }, {
1483
- sessionUpdate: "ls_notice";
1484
2217
  title: string;
2218
+ sessionUpdate: "ls_notice";
1485
2219
  level: "info" | "warning";
1486
2220
  detail?: string | undefined;
1487
2221
  }>, z.ZodObject<{
@@ -1492,17 +2226,17 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1492
2226
  turnId: z.ZodOptional<z.ZodString>;
1493
2227
  stopReason: z.ZodOptional<z.ZodEnum<["end_turn", "cancelled", "error", "max_tokens", "refusal"]>>;
1494
2228
  }, "strip", z.ZodTypeAny, {
1495
- sessionUpdate: "ls_turn";
1496
2229
  state: "started" | "ended";
2230
+ sessionUpdate: "ls_turn";
1497
2231
  parentToolCallId?: string | undefined;
1498
2232
  turnId?: string | undefined;
1499
- stopReason?: "end_turn" | "cancelled" | "error" | "max_tokens" | "refusal" | undefined;
2233
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
1500
2234
  }, {
1501
- sessionUpdate: "ls_turn";
1502
2235
  state: "started" | "ended";
2236
+ sessionUpdate: "ls_turn";
1503
2237
  parentToolCallId?: string | undefined;
1504
2238
  turnId?: string | undefined;
1505
- stopReason?: "end_turn" | "cancelled" | "error" | "max_tokens" | "refusal" | undefined;
2239
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
1506
2240
  }>, z.ZodObject<{
1507
2241
  sessionUpdate: z.ZodLiteral<"ls_permission">;
1508
2242
  requestId: z.ZodString;
@@ -1515,12 +2249,12 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1515
2249
  kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
1516
2250
  }, "strip", z.ZodTypeAny, {
1517
2251
  name: string;
1518
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1519
2252
  optionId: string;
2253
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1520
2254
  }, {
1521
2255
  name: string;
1522
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1523
2256
  optionId: string;
2257
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1524
2258
  }>, "many">;
1525
2259
  /**
1526
2260
  * The agent is asking the user something: answer with `sessions.answer`.
@@ -1549,9 +2283,9 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1549
2283
  secret: z.ZodOptional<z.ZodBoolean>;
1550
2284
  required: z.ZodOptional<z.ZodBoolean>;
1551
2285
  }, "strip", z.ZodTypeAny, {
1552
- text: string;
1553
- kind: "text" | "choice" | "choices";
1554
2286
  id: string;
2287
+ kind: "text" | "choice" | "choices";
2288
+ text: string;
1555
2289
  options?: {
1556
2290
  value: string;
1557
2291
  label: string;
@@ -1562,9 +2296,9 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1562
2296
  secret?: boolean | undefined;
1563
2297
  required?: boolean | undefined;
1564
2298
  }, {
1565
- text: string;
1566
- kind: "text" | "choice" | "choices";
1567
2299
  id: string;
2300
+ kind: "text" | "choice" | "choices";
2301
+ text: string;
1568
2302
  options?: {
1569
2303
  value: string;
1570
2304
  label: string;
@@ -1578,18 +2312,18 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1578
2312
  }, "strip", z.ZodTypeAny, {
1579
2313
  options: {
1580
2314
  name: string;
1581
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1582
2315
  optionId: string;
2316
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1583
2317
  }[];
1584
- sessionUpdate: "ls_permission";
1585
2318
  title: string;
1586
2319
  requestId: string;
2320
+ sessionUpdate: "ls_permission";
1587
2321
  toolCallId?: string | undefined;
1588
2322
  detail?: string | undefined;
1589
2323
  questions?: {
1590
- text: string;
1591
- kind: "text" | "choice" | "choices";
1592
2324
  id: string;
2325
+ kind: "text" | "choice" | "choices";
2326
+ text: string;
1593
2327
  options?: {
1594
2328
  value: string;
1595
2329
  label: string;
@@ -1603,18 +2337,18 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1603
2337
  }, {
1604
2338
  options: {
1605
2339
  name: string;
1606
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1607
2340
  optionId: string;
2341
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1608
2342
  }[];
1609
- sessionUpdate: "ls_permission";
1610
2343
  title: string;
1611
2344
  requestId: string;
2345
+ sessionUpdate: "ls_permission";
1612
2346
  toolCallId?: string | undefined;
1613
2347
  detail?: string | undefined;
1614
2348
  questions?: {
1615
- text: string;
1616
- kind: "text" | "choice" | "choices";
1617
2349
  id: string;
2350
+ kind: "text" | "choice" | "choices";
2351
+ text: string;
1618
2352
  options?: {
1619
2353
  value: string;
1620
2354
  label: string;
@@ -1635,30 +2369,30 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1635
2369
  values: z.ZodArray<z.ZodString, "many">;
1636
2370
  other: z.ZodOptional<z.ZodString>;
1637
2371
  }, "strip", z.ZodTypeAny, {
1638
- values: string[];
1639
2372
  id: string;
2373
+ values: string[];
1640
2374
  other?: string | undefined;
1641
2375
  }, {
1642
- values: string[];
1643
2376
  id: string;
2377
+ values: string[];
1644
2378
  other?: string | undefined;
1645
2379
  }>, "many">>;
1646
2380
  }, "strip", z.ZodTypeAny, {
1647
- sessionUpdate: "ls_permission_resolved";
1648
2381
  requestId: string;
2382
+ sessionUpdate: "ls_permission_resolved";
1649
2383
  optionId?: string | undefined;
1650
2384
  answers?: {
1651
- values: string[];
1652
2385
  id: string;
2386
+ values: string[];
1653
2387
  other?: string | undefined;
1654
2388
  }[] | undefined;
1655
2389
  }, {
1656
- sessionUpdate: "ls_permission_resolved";
1657
2390
  requestId: string;
2391
+ sessionUpdate: "ls_permission_resolved";
1658
2392
  optionId?: string | undefined;
1659
2393
  answers?: {
1660
- values: string[];
1661
2394
  id: string;
2395
+ values: string[];
1662
2396
  other?: string | undefined;
1663
2397
  }[] | undefined;
1664
2398
  }>, z.ZodObject<{
@@ -1666,22 +2400,101 @@ export declare const sessionUpdateSchema: z.ZodDiscriminatedUnion<"sessionUpdate
1666
2400
  driver: z.ZodEnum<["desktop", "remote", "none"]>;
1667
2401
  deviceId: z.ZodOptional<z.ZodString>;
1668
2402
  }, "strip", z.ZodTypeAny, {
2403
+ driver: "remote" | "desktop" | "none";
1669
2404
  sessionUpdate: "ls_driver";
1670
- driver: "desktop" | "remote" | "none";
1671
2405
  deviceId?: string | undefined;
1672
2406
  }, {
2407
+ driver: "remote" | "desktop" | "none";
1673
2408
  sessionUpdate: "ls_driver";
1674
- driver: "desktop" | "remote" | "none";
1675
2409
  deviceId?: string | undefined;
1676
2410
  }>, z.ZodObject<{
1677
2411
  sessionUpdate: z.ZodLiteral<"ls_status">;
1678
2412
  state: z.ZodEnum<["idle", "running", "waiting", "error", "offline"]>;
1679
2413
  }, "strip", z.ZodTypeAny, {
2414
+ state: "error" | "running" | "idle" | "waiting" | "offline";
1680
2415
  sessionUpdate: "ls_status";
1681
- state: "error" | "idle" | "running" | "waiting" | "offline";
1682
2416
  }, {
2417
+ state: "error" | "running" | "idle" | "waiting" | "offline";
1683
2418
  sessionUpdate: "ls_status";
1684
- state: "error" | "idle" | "running" | "waiting" | "offline";
2419
+ }>, z.ZodObject<{
2420
+ sessionUpdate: z.ZodLiteral<"ls_task">;
2421
+ task: z.ZodObject<{
2422
+ id: z.ZodString;
2423
+ kind: z.ZodEnum<["shell", "monitor"]>;
2424
+ toolCallId: z.ZodOptional<z.ZodString>;
2425
+ title: z.ZodString;
2426
+ command: z.ZodOptional<z.ZodString>;
2427
+ state: z.ZodEnum<["running", "completed", "failed", "stopped", "unknown"]>;
2428
+ startedAt: z.ZodNumber;
2429
+ endedAt: z.ZodOptional<z.ZodNumber>;
2430
+ summary: z.ZodOptional<z.ZodString>;
2431
+ exitCode: z.ZodOptional<z.ZodNumber>;
2432
+ output: z.ZodOptional<z.ZodBoolean>;
2433
+ canStop: z.ZodOptional<z.ZodBoolean>;
2434
+ lastSeq: z.ZodOptional<z.ZodNumber>;
2435
+ }, "strip", z.ZodTypeAny, {
2436
+ id: string;
2437
+ title: string;
2438
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
2439
+ startedAt: number;
2440
+ kind: "shell" | "monitor";
2441
+ toolCallId?: string | undefined;
2442
+ endedAt?: number | undefined;
2443
+ lastSeq?: number | undefined;
2444
+ command?: string | undefined;
2445
+ summary?: string | undefined;
2446
+ exitCode?: number | undefined;
2447
+ output?: boolean | undefined;
2448
+ canStop?: boolean | undefined;
2449
+ }, {
2450
+ id: string;
2451
+ title: string;
2452
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
2453
+ startedAt: number;
2454
+ kind: "shell" | "monitor";
2455
+ toolCallId?: string | undefined;
2456
+ endedAt?: number | undefined;
2457
+ lastSeq?: number | undefined;
2458
+ command?: string | undefined;
2459
+ summary?: string | undefined;
2460
+ exitCode?: number | undefined;
2461
+ output?: boolean | undefined;
2462
+ canStop?: boolean | undefined;
2463
+ }>;
2464
+ }, "strip", z.ZodTypeAny, {
2465
+ task: {
2466
+ id: string;
2467
+ title: string;
2468
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
2469
+ startedAt: number;
2470
+ kind: "shell" | "monitor";
2471
+ toolCallId?: string | undefined;
2472
+ endedAt?: number | undefined;
2473
+ lastSeq?: number | undefined;
2474
+ command?: string | undefined;
2475
+ summary?: string | undefined;
2476
+ exitCode?: number | undefined;
2477
+ output?: boolean | undefined;
2478
+ canStop?: boolean | undefined;
2479
+ };
2480
+ sessionUpdate: "ls_task";
2481
+ }, {
2482
+ task: {
2483
+ id: string;
2484
+ title: string;
2485
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
2486
+ startedAt: number;
2487
+ kind: "shell" | "monitor";
2488
+ toolCallId?: string | undefined;
2489
+ endedAt?: number | undefined;
2490
+ lastSeq?: number | undefined;
2491
+ command?: string | undefined;
2492
+ summary?: string | undefined;
2493
+ exitCode?: number | undefined;
2494
+ output?: boolean | undefined;
2495
+ canStop?: boolean | undefined;
2496
+ };
2497
+ sessionUpdate: "ls_task";
1685
2498
  }>, z.ZodObject<{
1686
2499
  sessionUpdate: z.ZodLiteral<"ls_error">;
1687
2500
  code: z.ZodString;
@@ -1723,13 +2536,13 @@ export declare const sessionEventSchema: z.ZodObject<{
1723
2536
  data: z.ZodOptional<z.ZodString>;
1724
2537
  uri: z.ZodOptional<z.ZodString>;
1725
2538
  }, "strip", z.ZodTypeAny, {
1726
- type: "image";
1727
2539
  mimeType: string;
2540
+ type: "image";
1728
2541
  data?: string | undefined;
1729
2542
  uri?: string | undefined;
1730
2543
  }, {
1731
- type: "image";
1732
2544
  mimeType: string;
2545
+ type: "image";
1733
2546
  data?: string | undefined;
1734
2547
  uri?: string | undefined;
1735
2548
  }>, z.ZodObject<{
@@ -1740,29 +2553,29 @@ export declare const sessionEventSchema: z.ZodObject<{
1740
2553
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
1741
2554
  }, "strip", z.ZodTypeAny, {
1742
2555
  type: "resource_link";
1743
- uri: string;
1744
2556
  name: string;
1745
- kind?: "file" | "skill" | "agent" | undefined;
2557
+ uri: string;
2558
+ kind?: "agent" | "file" | "skill" | undefined;
1746
2559
  }, {
1747
2560
  type: "resource_link";
1748
- uri: string;
1749
2561
  name: string;
1750
- kind?: "file" | "skill" | "agent" | undefined;
2562
+ uri: string;
2563
+ kind?: "agent" | "file" | "skill" | undefined;
1751
2564
  }>]>;
1752
2565
  }, "strip", z.ZodTypeAny, {
1753
2566
  content: {
1754
2567
  type: "text";
1755
2568
  text: string;
1756
2569
  } | {
1757
- type: "image";
1758
2570
  mimeType: string;
2571
+ type: "image";
1759
2572
  data?: string | undefined;
1760
2573
  uri?: string | undefined;
1761
2574
  } | {
1762
2575
  type: "resource_link";
1763
- uri: string;
1764
2576
  name: string;
1765
- kind?: "file" | "skill" | "agent" | undefined;
2577
+ uri: string;
2578
+ kind?: "agent" | "file" | "skill" | undefined;
1766
2579
  };
1767
2580
  sessionUpdate: "user_message_chunk";
1768
2581
  messageId?: string | undefined;
@@ -1771,15 +2584,15 @@ export declare const sessionEventSchema: z.ZodObject<{
1771
2584
  type: "text";
1772
2585
  text: string;
1773
2586
  } | {
1774
- type: "image";
1775
2587
  mimeType: string;
2588
+ type: "image";
1776
2589
  data?: string | undefined;
1777
2590
  uri?: string | undefined;
1778
2591
  } | {
1779
2592
  type: "resource_link";
1780
- uri: string;
1781
2593
  name: string;
1782
- kind?: "file" | "skill" | "agent" | undefined;
2594
+ uri: string;
2595
+ kind?: "agent" | "file" | "skill" | undefined;
1783
2596
  };
1784
2597
  sessionUpdate: "user_message_chunk";
1785
2598
  messageId?: string | undefined;
@@ -1802,13 +2615,13 @@ export declare const sessionEventSchema: z.ZodObject<{
1802
2615
  data: z.ZodOptional<z.ZodString>;
1803
2616
  uri: z.ZodOptional<z.ZodString>;
1804
2617
  }, "strip", z.ZodTypeAny, {
1805
- type: "image";
1806
2618
  mimeType: string;
2619
+ type: "image";
1807
2620
  data?: string | undefined;
1808
2621
  uri?: string | undefined;
1809
2622
  }, {
1810
- type: "image";
1811
2623
  mimeType: string;
2624
+ type: "image";
1812
2625
  data?: string | undefined;
1813
2626
  uri?: string | undefined;
1814
2627
  }>, z.ZodObject<{
@@ -1819,29 +2632,29 @@ export declare const sessionEventSchema: z.ZodObject<{
1819
2632
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
1820
2633
  }, "strip", z.ZodTypeAny, {
1821
2634
  type: "resource_link";
1822
- uri: string;
1823
2635
  name: string;
1824
- kind?: "file" | "skill" | "agent" | undefined;
2636
+ uri: string;
2637
+ kind?: "agent" | "file" | "skill" | undefined;
1825
2638
  }, {
1826
2639
  type: "resource_link";
1827
- uri: string;
1828
2640
  name: string;
1829
- kind?: "file" | "skill" | "agent" | undefined;
2641
+ uri: string;
2642
+ kind?: "agent" | "file" | "skill" | undefined;
1830
2643
  }>]>;
1831
2644
  }, "strip", z.ZodTypeAny, {
1832
2645
  content: {
1833
2646
  type: "text";
1834
2647
  text: string;
1835
2648
  } | {
1836
- type: "image";
1837
2649
  mimeType: string;
2650
+ type: "image";
1838
2651
  data?: string | undefined;
1839
2652
  uri?: string | undefined;
1840
2653
  } | {
1841
2654
  type: "resource_link";
1842
- uri: string;
1843
2655
  name: string;
1844
- kind?: "file" | "skill" | "agent" | undefined;
2656
+ uri: string;
2657
+ kind?: "agent" | "file" | "skill" | undefined;
1845
2658
  };
1846
2659
  sessionUpdate: "agent_message_chunk";
1847
2660
  messageId: string;
@@ -1851,15 +2664,15 @@ export declare const sessionEventSchema: z.ZodObject<{
1851
2664
  type: "text";
1852
2665
  text: string;
1853
2666
  } | {
1854
- type: "image";
1855
2667
  mimeType: string;
2668
+ type: "image";
1856
2669
  data?: string | undefined;
1857
2670
  uri?: string | undefined;
1858
2671
  } | {
1859
2672
  type: "resource_link";
1860
- uri: string;
1861
2673
  name: string;
1862
- kind?: "file" | "skill" | "agent" | undefined;
2674
+ uri: string;
2675
+ kind?: "agent" | "file" | "skill" | undefined;
1863
2676
  };
1864
2677
  sessionUpdate: "agent_message_chunk";
1865
2678
  messageId: string;
@@ -1883,13 +2696,13 @@ export declare const sessionEventSchema: z.ZodObject<{
1883
2696
  data: z.ZodOptional<z.ZodString>;
1884
2697
  uri: z.ZodOptional<z.ZodString>;
1885
2698
  }, "strip", z.ZodTypeAny, {
1886
- type: "image";
1887
2699
  mimeType: string;
2700
+ type: "image";
1888
2701
  data?: string | undefined;
1889
2702
  uri?: string | undefined;
1890
2703
  }, {
1891
- type: "image";
1892
2704
  mimeType: string;
2705
+ type: "image";
1893
2706
  data?: string | undefined;
1894
2707
  uri?: string | undefined;
1895
2708
  }>, z.ZodObject<{
@@ -1900,29 +2713,29 @@ export declare const sessionEventSchema: z.ZodObject<{
1900
2713
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
1901
2714
  }, "strip", z.ZodTypeAny, {
1902
2715
  type: "resource_link";
1903
- uri: string;
1904
2716
  name: string;
1905
- kind?: "file" | "skill" | "agent" | undefined;
2717
+ uri: string;
2718
+ kind?: "agent" | "file" | "skill" | undefined;
1906
2719
  }, {
1907
2720
  type: "resource_link";
1908
- uri: string;
1909
2721
  name: string;
1910
- kind?: "file" | "skill" | "agent" | undefined;
2722
+ uri: string;
2723
+ kind?: "agent" | "file" | "skill" | undefined;
1911
2724
  }>]>;
1912
2725
  }, "strip", z.ZodTypeAny, {
1913
2726
  content: {
1914
2727
  type: "text";
1915
2728
  text: string;
1916
2729
  } | {
1917
- type: "image";
1918
2730
  mimeType: string;
2731
+ type: "image";
1919
2732
  data?: string | undefined;
1920
2733
  uri?: string | undefined;
1921
2734
  } | {
1922
2735
  type: "resource_link";
1923
- uri: string;
1924
2736
  name: string;
1925
- kind?: "file" | "skill" | "agent" | undefined;
2737
+ uri: string;
2738
+ kind?: "agent" | "file" | "skill" | undefined;
1926
2739
  };
1927
2740
  sessionUpdate: "agent_thought_chunk";
1928
2741
  messageId: string;
@@ -1932,15 +2745,15 @@ export declare const sessionEventSchema: z.ZodObject<{
1932
2745
  type: "text";
1933
2746
  text: string;
1934
2747
  } | {
1935
- type: "image";
1936
2748
  mimeType: string;
2749
+ type: "image";
1937
2750
  data?: string | undefined;
1938
2751
  uri?: string | undefined;
1939
2752
  } | {
1940
2753
  type: "resource_link";
1941
- uri: string;
1942
2754
  name: string;
1943
- kind?: "file" | "skill" | "agent" | undefined;
2755
+ uri: string;
2756
+ kind?: "agent" | "file" | "skill" | undefined;
1944
2757
  };
1945
2758
  sessionUpdate: "agent_thought_chunk";
1946
2759
  messageId: string;
@@ -1971,13 +2784,13 @@ export declare const sessionEventSchema: z.ZodObject<{
1971
2784
  data: z.ZodOptional<z.ZodString>;
1972
2785
  uri: z.ZodOptional<z.ZodString>;
1973
2786
  }, "strip", z.ZodTypeAny, {
1974
- type: "image";
1975
2787
  mimeType: string;
2788
+ type: "image";
1976
2789
  data?: string | undefined;
1977
2790
  uri?: string | undefined;
1978
2791
  }, {
1979
- type: "image";
1980
2792
  mimeType: string;
2793
+ type: "image";
1981
2794
  data?: string | undefined;
1982
2795
  uri?: string | undefined;
1983
2796
  }>, z.ZodObject<{
@@ -1988,14 +2801,14 @@ export declare const sessionEventSchema: z.ZodObject<{
1988
2801
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
1989
2802
  }, "strip", z.ZodTypeAny, {
1990
2803
  type: "resource_link";
1991
- uri: string;
1992
2804
  name: string;
1993
- kind?: "file" | "skill" | "agent" | undefined;
2805
+ uri: string;
2806
+ kind?: "agent" | "file" | "skill" | undefined;
1994
2807
  }, {
1995
2808
  type: "resource_link";
1996
- uri: string;
1997
2809
  name: string;
1998
- kind?: "file" | "skill" | "agent" | undefined;
2810
+ uri: string;
2811
+ kind?: "agent" | "file" | "skill" | undefined;
1999
2812
  }>]>;
2000
2813
  }, "strip", z.ZodTypeAny, {
2001
2814
  type: "content";
@@ -2003,15 +2816,15 @@ export declare const sessionEventSchema: z.ZodObject<{
2003
2816
  type: "text";
2004
2817
  text: string;
2005
2818
  } | {
2006
- type: "image";
2007
2819
  mimeType: string;
2820
+ type: "image";
2008
2821
  data?: string | undefined;
2009
2822
  uri?: string | undefined;
2010
2823
  } | {
2011
2824
  type: "resource_link";
2012
- uri: string;
2013
2825
  name: string;
2014
- kind?: "file" | "skill" | "agent" | undefined;
2826
+ uri: string;
2827
+ kind?: "agent" | "file" | "skill" | undefined;
2015
2828
  };
2016
2829
  }, {
2017
2830
  type: "content";
@@ -2019,15 +2832,15 @@ export declare const sessionEventSchema: z.ZodObject<{
2019
2832
  type: "text";
2020
2833
  text: string;
2021
2834
  } | {
2022
- type: "image";
2023
2835
  mimeType: string;
2836
+ type: "image";
2024
2837
  data?: string | undefined;
2025
2838
  uri?: string | undefined;
2026
2839
  } | {
2027
2840
  type: "resource_link";
2028
- uri: string;
2029
2841
  name: string;
2030
- kind?: "file" | "skill" | "agent" | undefined;
2842
+ uri: string;
2843
+ kind?: "agent" | "file" | "skill" | undefined;
2031
2844
  };
2032
2845
  }>, z.ZodObject<{
2033
2846
  type: z.ZodLiteral<"diff">;
@@ -2035,13 +2848,13 @@ export declare const sessionEventSchema: z.ZodObject<{
2035
2848
  oldText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2036
2849
  newText: z.ZodString;
2037
2850
  }, "strip", z.ZodTypeAny, {
2038
- type: "diff";
2039
2851
  path: string;
2852
+ type: "diff";
2040
2853
  newText: string;
2041
2854
  oldText?: string | null | undefined;
2042
2855
  }, {
2043
- type: "diff";
2044
2856
  path: string;
2857
+ type: "diff";
2045
2858
  newText: string;
2046
2859
  oldText?: string | null | undefined;
2047
2860
  }>, z.ZodObject<{
@@ -2051,16 +2864,16 @@ export declare const sessionEventSchema: z.ZodObject<{
2051
2864
  movePath: z.ZodOptional<z.ZodString>;
2052
2865
  diff: z.ZodString;
2053
2866
  }, "strip", z.ZodTypeAny, {
2054
- type: "patch";
2055
2867
  path: string;
2868
+ type: "patch";
2056
2869
  diff: string;
2057
- change: "add" | "delete" | "update";
2870
+ change: "delete" | "add" | "update";
2058
2871
  movePath?: string | undefined;
2059
2872
  }, {
2060
- type: "patch";
2061
2873
  path: string;
2874
+ type: "patch";
2062
2875
  diff: string;
2063
- change: "add" | "delete" | "update";
2876
+ change: "delete" | "add" | "update";
2064
2877
  movePath?: string | undefined;
2065
2878
  }>, z.ZodObject<{
2066
2879
  type: z.ZodLiteral<"terminal">;
@@ -2088,12 +2901,12 @@ export declare const sessionEventSchema: z.ZodObject<{
2088
2901
  tool: z.ZodString;
2089
2902
  }, "strip", z.ZodTypeAny, {
2090
2903
  type: "mcp";
2091
- server: string;
2092
2904
  tool: string;
2905
+ server: string;
2093
2906
  }, {
2094
2907
  type: "mcp";
2095
- server: string;
2096
2908
  tool: string;
2909
+ server: string;
2097
2910
  }>, z.ZodObject<{
2098
2911
  type: z.ZodLiteral<"subagent">;
2099
2912
  /** spawn starts a sub-agent (its work nests under this call); the rest talk to one. */
@@ -2102,18 +2915,205 @@ export declare const sessionEventSchema: z.ZodObject<{
2102
2915
  /** The sub-agent's role or type, e.g. "Explore". */
2103
2916
  agentType: z.ZodOptional<z.ZodString>;
2104
2917
  model: z.ZodOptional<z.ZodString>;
2918
+ /** Agent outcome when a tool's coarse completed/failed state is insufficient. */
2919
+ state: z.ZodOptional<z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>>;
2920
+ /** A Claude workflow is a background run containing its own agents. Counts are observed, not a predicted total. */
2921
+ workflow: z.ZodOptional<z.ZodObject<{
2922
+ runId: z.ZodOptional<z.ZodString>;
2923
+ name: z.ZodOptional<z.ZodString>;
2924
+ state: z.ZodOptional<z.ZodEnum<["running", "paused", "completed", "failed", "stopped"]>>;
2925
+ started: z.ZodOptional<z.ZodNumber>;
2926
+ completed: z.ZodOptional<z.ZodNumber>;
2927
+ tokens: z.ZodOptional<z.ZodNumber>;
2928
+ durationMs: z.ZodOptional<z.ZodNumber>;
2929
+ startedAt: z.ZodOptional<z.ZodNumber>;
2930
+ endedAt: z.ZodOptional<z.ZodNumber>;
2931
+ phases: z.ZodOptional<z.ZodArray<z.ZodObject<{
2932
+ id: z.ZodString;
2933
+ title: z.ZodString;
2934
+ order: z.ZodNumber;
2935
+ }, "strip", z.ZodTypeAny, {
2936
+ id: string;
2937
+ title: string;
2938
+ order: number;
2939
+ }, {
2940
+ id: string;
2941
+ title: string;
2942
+ order: number;
2943
+ }>, "many">>;
2944
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
2945
+ id: z.ZodString;
2946
+ toolCallId: z.ZodOptional<z.ZodString>;
2947
+ title: z.ZodString;
2948
+ state: z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>;
2949
+ phaseId: z.ZodOptional<z.ZodString>;
2950
+ model: z.ZodOptional<z.ZodString>;
2951
+ tokens: z.ZodOptional<z.ZodNumber>;
2952
+ toolCalls: z.ZodOptional<z.ZodNumber>;
2953
+ durationMs: z.ZodOptional<z.ZodNumber>;
2954
+ startedAt: z.ZodOptional<z.ZodNumber>;
2955
+ endedAt: z.ZodOptional<z.ZodNumber>;
2956
+ result: z.ZodOptional<z.ZodString>;
2957
+ }, "strip", z.ZodTypeAny, {
2958
+ id: string;
2959
+ title: string;
2960
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
2961
+ toolCallId?: string | undefined;
2962
+ phaseId?: string | undefined;
2963
+ model?: string | undefined;
2964
+ tokens?: number | undefined;
2965
+ toolCalls?: number | undefined;
2966
+ durationMs?: number | undefined;
2967
+ startedAt?: number | undefined;
2968
+ endedAt?: number | undefined;
2969
+ result?: string | undefined;
2970
+ }, {
2971
+ id: string;
2972
+ title: string;
2973
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
2974
+ toolCallId?: string | undefined;
2975
+ phaseId?: string | undefined;
2976
+ model?: string | undefined;
2977
+ tokens?: number | undefined;
2978
+ toolCalls?: number | undefined;
2979
+ durationMs?: number | undefined;
2980
+ startedAt?: number | undefined;
2981
+ endedAt?: number | undefined;
2982
+ result?: string | undefined;
2983
+ }>, "many">>;
2984
+ }, "strip", z.ZodTypeAny, {
2985
+ completed?: number | undefined;
2986
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
2987
+ tokens?: number | undefined;
2988
+ durationMs?: number | undefined;
2989
+ startedAt?: number | undefined;
2990
+ endedAt?: number | undefined;
2991
+ runId?: string | undefined;
2992
+ name?: string | undefined;
2993
+ started?: number | undefined;
2994
+ phases?: {
2995
+ id: string;
2996
+ title: string;
2997
+ order: number;
2998
+ }[] | undefined;
2999
+ agents?: {
3000
+ id: string;
3001
+ title: string;
3002
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3003
+ toolCallId?: string | undefined;
3004
+ phaseId?: string | undefined;
3005
+ model?: string | undefined;
3006
+ tokens?: number | undefined;
3007
+ toolCalls?: number | undefined;
3008
+ durationMs?: number | undefined;
3009
+ startedAt?: number | undefined;
3010
+ endedAt?: number | undefined;
3011
+ result?: string | undefined;
3012
+ }[] | undefined;
3013
+ }, {
3014
+ completed?: number | undefined;
3015
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3016
+ tokens?: number | undefined;
3017
+ durationMs?: number | undefined;
3018
+ startedAt?: number | undefined;
3019
+ endedAt?: number | undefined;
3020
+ runId?: string | undefined;
3021
+ name?: string | undefined;
3022
+ started?: number | undefined;
3023
+ phases?: {
3024
+ id: string;
3025
+ title: string;
3026
+ order: number;
3027
+ }[] | undefined;
3028
+ agents?: {
3029
+ id: string;
3030
+ title: string;
3031
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3032
+ toolCallId?: string | undefined;
3033
+ phaseId?: string | undefined;
3034
+ model?: string | undefined;
3035
+ tokens?: number | undefined;
3036
+ toolCalls?: number | undefined;
3037
+ durationMs?: number | undefined;
3038
+ startedAt?: number | undefined;
3039
+ endedAt?: number | undefined;
3040
+ result?: string | undefined;
3041
+ }[] | undefined;
3042
+ }>>;
2105
3043
  }, "strip", z.ZodTypeAny, {
2106
3044
  type: "subagent";
2107
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3045
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
3046
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
3047
+ model?: string | undefined;
2108
3048
  task?: string | undefined;
2109
3049
  agentType?: string | undefined;
2110
- model?: string | undefined;
3050
+ workflow?: {
3051
+ completed?: number | undefined;
3052
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3053
+ tokens?: number | undefined;
3054
+ durationMs?: number | undefined;
3055
+ startedAt?: number | undefined;
3056
+ endedAt?: number | undefined;
3057
+ runId?: string | undefined;
3058
+ name?: string | undefined;
3059
+ started?: number | undefined;
3060
+ phases?: {
3061
+ id: string;
3062
+ title: string;
3063
+ order: number;
3064
+ }[] | undefined;
3065
+ agents?: {
3066
+ id: string;
3067
+ title: string;
3068
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3069
+ toolCallId?: string | undefined;
3070
+ phaseId?: string | undefined;
3071
+ model?: string | undefined;
3072
+ tokens?: number | undefined;
3073
+ toolCalls?: number | undefined;
3074
+ durationMs?: number | undefined;
3075
+ startedAt?: number | undefined;
3076
+ endedAt?: number | undefined;
3077
+ result?: string | undefined;
3078
+ }[] | undefined;
3079
+ } | undefined;
2111
3080
  }, {
2112
3081
  type: "subagent";
2113
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
3082
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
3083
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
3084
+ model?: string | undefined;
2114
3085
  task?: string | undefined;
2115
3086
  agentType?: string | undefined;
2116
- model?: string | undefined;
3087
+ workflow?: {
3088
+ completed?: number | undefined;
3089
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3090
+ tokens?: number | undefined;
3091
+ durationMs?: number | undefined;
3092
+ startedAt?: number | undefined;
3093
+ endedAt?: number | undefined;
3094
+ runId?: string | undefined;
3095
+ name?: string | undefined;
3096
+ started?: number | undefined;
3097
+ phases?: {
3098
+ id: string;
3099
+ title: string;
3100
+ order: number;
3101
+ }[] | undefined;
3102
+ agents?: {
3103
+ id: string;
3104
+ title: string;
3105
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3106
+ toolCallId?: string | undefined;
3107
+ phaseId?: string | undefined;
3108
+ model?: string | undefined;
3109
+ tokens?: number | undefined;
3110
+ toolCalls?: number | undefined;
3111
+ durationMs?: number | undefined;
3112
+ startedAt?: number | undefined;
3113
+ endedAt?: number | undefined;
3114
+ result?: string | undefined;
3115
+ }[] | undefined;
3116
+ } | undefined;
2117
3117
  }>, z.ZodObject<{
2118
3118
  type: z.ZodLiteral<"skill">;
2119
3119
  name: z.ZodString;
@@ -2173,58 +3173,156 @@ export declare const sessionEventSchema: z.ZodObject<{
2173
3173
  more?: number | undefined;
2174
3174
  }>]>>;
2175
3175
  }, "strip", z.ZodTypeAny, {
2176
- status: "pending" | "in_progress" | "completed" | "failed";
2177
- kind: "delete" | "other" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
2178
- sessionUpdate: "tool_call";
3176
+ status: "completed" | "failed" | "pending" | "in_progress";
2179
3177
  toolCallId: string;
2180
3178
  title: string;
3179
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
3180
+ sessionUpdate: "tool_call";
3181
+ detail?: {
3182
+ type: "mcp";
3183
+ tool: string;
3184
+ server: string;
3185
+ } | {
3186
+ type: "subagent";
3187
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
3188
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
3189
+ model?: string | undefined;
3190
+ task?: string | undefined;
3191
+ agentType?: string | undefined;
3192
+ workflow?: {
3193
+ completed?: number | undefined;
3194
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3195
+ tokens?: number | undefined;
3196
+ durationMs?: number | undefined;
3197
+ startedAt?: number | undefined;
3198
+ endedAt?: number | undefined;
3199
+ runId?: string | undefined;
3200
+ name?: string | undefined;
3201
+ started?: number | undefined;
3202
+ phases?: {
3203
+ id: string;
3204
+ title: string;
3205
+ order: number;
3206
+ }[] | undefined;
3207
+ agents?: {
3208
+ id: string;
3209
+ title: string;
3210
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3211
+ toolCallId?: string | undefined;
3212
+ phaseId?: string | undefined;
3213
+ model?: string | undefined;
3214
+ tokens?: number | undefined;
3215
+ toolCalls?: number | undefined;
3216
+ durationMs?: number | undefined;
3217
+ startedAt?: number | undefined;
3218
+ endedAt?: number | undefined;
3219
+ result?: string | undefined;
3220
+ }[] | undefined;
3221
+ } | undefined;
3222
+ } | {
3223
+ type: "skill";
3224
+ name: string;
3225
+ description?: string | undefined;
3226
+ } | {
3227
+ type: "web_search";
3228
+ query?: string | undefined;
3229
+ } | {
3230
+ type: "image_generation";
3231
+ prompt?: string | undefined;
3232
+ } | {
3233
+ type: "compaction";
3234
+ } | {
3235
+ type: "review";
3236
+ phase: "started" | "finished";
3237
+ } | {
3238
+ type: "question";
3239
+ text: string;
3240
+ more?: number | undefined;
3241
+ } | undefined;
3242
+ parentToolCallId?: string | undefined;
2181
3243
  content?: ({
2182
3244
  type: "content";
2183
3245
  content: {
2184
3246
  type: "text";
2185
3247
  text: string;
2186
3248
  } | {
2187
- type: "image";
2188
3249
  mimeType: string;
3250
+ type: "image";
2189
3251
  data?: string | undefined;
2190
3252
  uri?: string | undefined;
2191
3253
  } | {
2192
3254
  type: "resource_link";
2193
- uri: string;
2194
3255
  name: string;
2195
- kind?: "file" | "skill" | "agent" | undefined;
3256
+ uri: string;
3257
+ kind?: "agent" | "file" | "skill" | undefined;
2196
3258
  };
2197
3259
  } | {
2198
- type: "diff";
2199
3260
  path: string;
3261
+ type: "diff";
2200
3262
  newText: string;
2201
3263
  oldText?: string | null | undefined;
2202
3264
  } | {
2203
- type: "patch";
2204
3265
  path: string;
3266
+ type: "patch";
2205
3267
  diff: string;
2206
- change: "add" | "delete" | "update";
3268
+ change: "delete" | "add" | "update";
2207
3269
  movePath?: string | undefined;
2208
3270
  } | {
2209
3271
  type: "terminal";
2210
3272
  terminalId: string;
2211
3273
  })[] | undefined;
2212
- parentToolCallId?: string | undefined;
2213
3274
  rawInput?: unknown;
2214
3275
  locations?: {
2215
3276
  path: string;
2216
3277
  line?: number | undefined;
2217
3278
  }[] | undefined;
3279
+ }, {
3280
+ status: "completed" | "failed" | "pending" | "in_progress";
3281
+ toolCallId: string;
3282
+ title: string;
3283
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
3284
+ sessionUpdate: "tool_call";
2218
3285
  detail?: {
2219
3286
  type: "mcp";
2220
- server: string;
2221
3287
  tool: string;
3288
+ server: string;
2222
3289
  } | {
2223
3290
  type: "subagent";
2224
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3291
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
3292
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
3293
+ model?: string | undefined;
2225
3294
  task?: string | undefined;
2226
3295
  agentType?: string | undefined;
2227
- model?: string | undefined;
3296
+ workflow?: {
3297
+ completed?: number | undefined;
3298
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3299
+ tokens?: number | undefined;
3300
+ durationMs?: number | undefined;
3301
+ startedAt?: number | undefined;
3302
+ endedAt?: number | undefined;
3303
+ runId?: string | undefined;
3304
+ name?: string | undefined;
3305
+ started?: number | undefined;
3306
+ phases?: {
3307
+ id: string;
3308
+ title: string;
3309
+ order: number;
3310
+ }[] | undefined;
3311
+ agents?: {
3312
+ id: string;
3313
+ title: string;
3314
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3315
+ toolCallId?: string | undefined;
3316
+ phaseId?: string | undefined;
3317
+ model?: string | undefined;
3318
+ tokens?: number | undefined;
3319
+ toolCalls?: number | undefined;
3320
+ durationMs?: number | undefined;
3321
+ startedAt?: number | undefined;
3322
+ endedAt?: number | undefined;
3323
+ result?: string | undefined;
3324
+ }[] | undefined;
3325
+ } | undefined;
2228
3326
  } | {
2229
3327
  type: "skill";
2230
3328
  name: string;
@@ -2245,79 +3343,43 @@ export declare const sessionEventSchema: z.ZodObject<{
2245
3343
  text: string;
2246
3344
  more?: number | undefined;
2247
3345
  } | undefined;
2248
- }, {
2249
- status: "pending" | "in_progress" | "completed" | "failed";
2250
- kind: "delete" | "other" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
2251
- sessionUpdate: "tool_call";
2252
- toolCallId: string;
2253
- title: string;
3346
+ parentToolCallId?: string | undefined;
2254
3347
  content?: ({
2255
3348
  type: "content";
2256
3349
  content: {
2257
3350
  type: "text";
2258
3351
  text: string;
2259
3352
  } | {
2260
- type: "image";
2261
3353
  mimeType: string;
3354
+ type: "image";
2262
3355
  data?: string | undefined;
2263
3356
  uri?: string | undefined;
2264
3357
  } | {
2265
3358
  type: "resource_link";
2266
- uri: string;
2267
3359
  name: string;
2268
- kind?: "file" | "skill" | "agent" | undefined;
3360
+ uri: string;
3361
+ kind?: "agent" | "file" | "skill" | undefined;
2269
3362
  };
2270
3363
  } | {
2271
- type: "diff";
2272
3364
  path: string;
3365
+ type: "diff";
2273
3366
  newText: string;
2274
3367
  oldText?: string | null | undefined;
2275
3368
  } | {
2276
- type: "patch";
2277
3369
  path: string;
3370
+ type: "patch";
2278
3371
  diff: string;
2279
- change: "add" | "delete" | "update";
3372
+ change: "delete" | "add" | "update";
2280
3373
  movePath?: string | undefined;
2281
3374
  } | {
2282
3375
  type: "terminal";
2283
3376
  terminalId: string;
2284
3377
  })[] | undefined;
2285
- parentToolCallId?: string | undefined;
2286
3378
  rawInput?: unknown;
2287
3379
  locations?: {
2288
3380
  path: string;
2289
3381
  line?: number | undefined;
2290
3382
  }[] | undefined;
2291
- detail?: {
2292
- type: "mcp";
2293
- server: string;
2294
- tool: string;
2295
- } | {
2296
- type: "subagent";
2297
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
2298
- task?: string | undefined;
2299
- agentType?: string | undefined;
2300
- model?: string | undefined;
2301
- } | {
2302
- type: "skill";
2303
- name: string;
2304
- description?: string | undefined;
2305
- } | {
2306
- type: "web_search";
2307
- query?: string | undefined;
2308
- } | {
2309
- type: "image_generation";
2310
- prompt?: string | undefined;
2311
- } | {
2312
- type: "compaction";
2313
- } | {
2314
- type: "review";
2315
- phase: "started" | "finished";
2316
- } | {
2317
- type: "question";
2318
- text: string;
2319
- more?: number | undefined;
2320
- } | undefined;
2321
3383
  }>, z.ZodObject<{
2322
3384
  sessionUpdate: z.ZodLiteral<"tool_call_update">;
2323
3385
  toolCallId: z.ZodString;
@@ -2330,12 +3392,12 @@ export declare const sessionEventSchema: z.ZodObject<{
2330
3392
  tool: z.ZodString;
2331
3393
  }, "strip", z.ZodTypeAny, {
2332
3394
  type: "mcp";
2333
- server: string;
2334
3395
  tool: string;
3396
+ server: string;
2335
3397
  }, {
2336
3398
  type: "mcp";
2337
- server: string;
2338
3399
  tool: string;
3400
+ server: string;
2339
3401
  }>, z.ZodObject<{
2340
3402
  type: z.ZodLiteral<"subagent">;
2341
3403
  /** spawn starts a sub-agent (its work nests under this call); the rest talk to one. */
@@ -2344,18 +3406,205 @@ export declare const sessionEventSchema: z.ZodObject<{
2344
3406
  /** The sub-agent's role or type, e.g. "Explore". */
2345
3407
  agentType: z.ZodOptional<z.ZodString>;
2346
3408
  model: z.ZodOptional<z.ZodString>;
3409
+ /** Agent outcome when a tool's coarse completed/failed state is insufficient. */
3410
+ state: z.ZodOptional<z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>>;
3411
+ /** A Claude workflow is a background run containing its own agents. Counts are observed, not a predicted total. */
3412
+ workflow: z.ZodOptional<z.ZodObject<{
3413
+ runId: z.ZodOptional<z.ZodString>;
3414
+ name: z.ZodOptional<z.ZodString>;
3415
+ state: z.ZodOptional<z.ZodEnum<["running", "paused", "completed", "failed", "stopped"]>>;
3416
+ started: z.ZodOptional<z.ZodNumber>;
3417
+ completed: z.ZodOptional<z.ZodNumber>;
3418
+ tokens: z.ZodOptional<z.ZodNumber>;
3419
+ durationMs: z.ZodOptional<z.ZodNumber>;
3420
+ startedAt: z.ZodOptional<z.ZodNumber>;
3421
+ endedAt: z.ZodOptional<z.ZodNumber>;
3422
+ phases: z.ZodOptional<z.ZodArray<z.ZodObject<{
3423
+ id: z.ZodString;
3424
+ title: z.ZodString;
3425
+ order: z.ZodNumber;
3426
+ }, "strip", z.ZodTypeAny, {
3427
+ id: string;
3428
+ title: string;
3429
+ order: number;
3430
+ }, {
3431
+ id: string;
3432
+ title: string;
3433
+ order: number;
3434
+ }>, "many">>;
3435
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
3436
+ id: z.ZodString;
3437
+ toolCallId: z.ZodOptional<z.ZodString>;
3438
+ title: z.ZodString;
3439
+ state: z.ZodEnum<["pending", "running", "paused", "completed", "failed", "stopped", "unknown"]>;
3440
+ phaseId: z.ZodOptional<z.ZodString>;
3441
+ model: z.ZodOptional<z.ZodString>;
3442
+ tokens: z.ZodOptional<z.ZodNumber>;
3443
+ toolCalls: z.ZodOptional<z.ZodNumber>;
3444
+ durationMs: z.ZodOptional<z.ZodNumber>;
3445
+ startedAt: z.ZodOptional<z.ZodNumber>;
3446
+ endedAt: z.ZodOptional<z.ZodNumber>;
3447
+ result: z.ZodOptional<z.ZodString>;
3448
+ }, "strip", z.ZodTypeAny, {
3449
+ id: string;
3450
+ title: string;
3451
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3452
+ toolCallId?: string | undefined;
3453
+ phaseId?: string | undefined;
3454
+ model?: string | undefined;
3455
+ tokens?: number | undefined;
3456
+ toolCalls?: number | undefined;
3457
+ durationMs?: number | undefined;
3458
+ startedAt?: number | undefined;
3459
+ endedAt?: number | undefined;
3460
+ result?: string | undefined;
3461
+ }, {
3462
+ id: string;
3463
+ title: string;
3464
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3465
+ toolCallId?: string | undefined;
3466
+ phaseId?: string | undefined;
3467
+ model?: string | undefined;
3468
+ tokens?: number | undefined;
3469
+ toolCalls?: number | undefined;
3470
+ durationMs?: number | undefined;
3471
+ startedAt?: number | undefined;
3472
+ endedAt?: number | undefined;
3473
+ result?: string | undefined;
3474
+ }>, "many">>;
3475
+ }, "strip", z.ZodTypeAny, {
3476
+ completed?: number | undefined;
3477
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3478
+ tokens?: number | undefined;
3479
+ durationMs?: number | undefined;
3480
+ startedAt?: number | undefined;
3481
+ endedAt?: number | undefined;
3482
+ runId?: string | undefined;
3483
+ name?: string | undefined;
3484
+ started?: number | undefined;
3485
+ phases?: {
3486
+ id: string;
3487
+ title: string;
3488
+ order: number;
3489
+ }[] | undefined;
3490
+ agents?: {
3491
+ id: string;
3492
+ title: string;
3493
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3494
+ toolCallId?: string | undefined;
3495
+ phaseId?: string | undefined;
3496
+ model?: string | undefined;
3497
+ tokens?: number | undefined;
3498
+ toolCalls?: number | undefined;
3499
+ durationMs?: number | undefined;
3500
+ startedAt?: number | undefined;
3501
+ endedAt?: number | undefined;
3502
+ result?: string | undefined;
3503
+ }[] | undefined;
3504
+ }, {
3505
+ completed?: number | undefined;
3506
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3507
+ tokens?: number | undefined;
3508
+ durationMs?: number | undefined;
3509
+ startedAt?: number | undefined;
3510
+ endedAt?: number | undefined;
3511
+ runId?: string | undefined;
3512
+ name?: string | undefined;
3513
+ started?: number | undefined;
3514
+ phases?: {
3515
+ id: string;
3516
+ title: string;
3517
+ order: number;
3518
+ }[] | undefined;
3519
+ agents?: {
3520
+ id: string;
3521
+ title: string;
3522
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3523
+ toolCallId?: string | undefined;
3524
+ phaseId?: string | undefined;
3525
+ model?: string | undefined;
3526
+ tokens?: number | undefined;
3527
+ toolCalls?: number | undefined;
3528
+ durationMs?: number | undefined;
3529
+ startedAt?: number | undefined;
3530
+ endedAt?: number | undefined;
3531
+ result?: string | undefined;
3532
+ }[] | undefined;
3533
+ }>>;
2347
3534
  }, "strip", z.ZodTypeAny, {
2348
3535
  type: "subagent";
2349
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3536
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
3537
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
3538
+ model?: string | undefined;
2350
3539
  task?: string | undefined;
2351
3540
  agentType?: string | undefined;
2352
- model?: string | undefined;
3541
+ workflow?: {
3542
+ completed?: number | undefined;
3543
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3544
+ tokens?: number | undefined;
3545
+ durationMs?: number | undefined;
3546
+ startedAt?: number | undefined;
3547
+ endedAt?: number | undefined;
3548
+ runId?: string | undefined;
3549
+ name?: string | undefined;
3550
+ started?: number | undefined;
3551
+ phases?: {
3552
+ id: string;
3553
+ title: string;
3554
+ order: number;
3555
+ }[] | undefined;
3556
+ agents?: {
3557
+ id: string;
3558
+ title: string;
3559
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3560
+ toolCallId?: string | undefined;
3561
+ phaseId?: string | undefined;
3562
+ model?: string | undefined;
3563
+ tokens?: number | undefined;
3564
+ toolCalls?: number | undefined;
3565
+ durationMs?: number | undefined;
3566
+ startedAt?: number | undefined;
3567
+ endedAt?: number | undefined;
3568
+ result?: string | undefined;
3569
+ }[] | undefined;
3570
+ } | undefined;
2353
3571
  }, {
2354
3572
  type: "subagent";
2355
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
3573
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
3574
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
3575
+ model?: string | undefined;
2356
3576
  task?: string | undefined;
2357
3577
  agentType?: string | undefined;
2358
- model?: string | undefined;
3578
+ workflow?: {
3579
+ completed?: number | undefined;
3580
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3581
+ tokens?: number | undefined;
3582
+ durationMs?: number | undefined;
3583
+ startedAt?: number | undefined;
3584
+ endedAt?: number | undefined;
3585
+ runId?: string | undefined;
3586
+ name?: string | undefined;
3587
+ started?: number | undefined;
3588
+ phases?: {
3589
+ id: string;
3590
+ title: string;
3591
+ order: number;
3592
+ }[] | undefined;
3593
+ agents?: {
3594
+ id: string;
3595
+ title: string;
3596
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3597
+ toolCallId?: string | undefined;
3598
+ phaseId?: string | undefined;
3599
+ model?: string | undefined;
3600
+ tokens?: number | undefined;
3601
+ toolCalls?: number | undefined;
3602
+ durationMs?: number | undefined;
3603
+ startedAt?: number | undefined;
3604
+ endedAt?: number | undefined;
3605
+ result?: string | undefined;
3606
+ }[] | undefined;
3607
+ } | undefined;
2359
3608
  }>, z.ZodObject<{
2360
3609
  type: z.ZodLiteral<"skill">;
2361
3610
  name: z.ZodString;
@@ -2432,13 +3681,13 @@ export declare const sessionEventSchema: z.ZodObject<{
2432
3681
  data: z.ZodOptional<z.ZodString>;
2433
3682
  uri: z.ZodOptional<z.ZodString>;
2434
3683
  }, "strip", z.ZodTypeAny, {
2435
- type: "image";
2436
3684
  mimeType: string;
3685
+ type: "image";
2437
3686
  data?: string | undefined;
2438
3687
  uri?: string | undefined;
2439
3688
  }, {
2440
- type: "image";
2441
3689
  mimeType: string;
3690
+ type: "image";
2442
3691
  data?: string | undefined;
2443
3692
  uri?: string | undefined;
2444
3693
  }>, z.ZodObject<{
@@ -2449,14 +3698,14 @@ export declare const sessionEventSchema: z.ZodObject<{
2449
3698
  kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
2450
3699
  }, "strip", z.ZodTypeAny, {
2451
3700
  type: "resource_link";
2452
- uri: string;
2453
3701
  name: string;
2454
- kind?: "file" | "skill" | "agent" | undefined;
3702
+ uri: string;
3703
+ kind?: "agent" | "file" | "skill" | undefined;
2455
3704
  }, {
2456
3705
  type: "resource_link";
2457
- uri: string;
2458
3706
  name: string;
2459
- kind?: "file" | "skill" | "agent" | undefined;
3707
+ uri: string;
3708
+ kind?: "agent" | "file" | "skill" | undefined;
2460
3709
  }>]>;
2461
3710
  }, "strip", z.ZodTypeAny, {
2462
3711
  type: "content";
@@ -2464,15 +3713,15 @@ export declare const sessionEventSchema: z.ZodObject<{
2464
3713
  type: "text";
2465
3714
  text: string;
2466
3715
  } | {
2467
- type: "image";
2468
3716
  mimeType: string;
3717
+ type: "image";
2469
3718
  data?: string | undefined;
2470
3719
  uri?: string | undefined;
2471
3720
  } | {
2472
3721
  type: "resource_link";
2473
- uri: string;
2474
3722
  name: string;
2475
- kind?: "file" | "skill" | "agent" | undefined;
3723
+ uri: string;
3724
+ kind?: "agent" | "file" | "skill" | undefined;
2476
3725
  };
2477
3726
  }, {
2478
3727
  type: "content";
@@ -2480,15 +3729,15 @@ export declare const sessionEventSchema: z.ZodObject<{
2480
3729
  type: "text";
2481
3730
  text: string;
2482
3731
  } | {
2483
- type: "image";
2484
3732
  mimeType: string;
3733
+ type: "image";
2485
3734
  data?: string | undefined;
2486
3735
  uri?: string | undefined;
2487
3736
  } | {
2488
3737
  type: "resource_link";
2489
- uri: string;
2490
3738
  name: string;
2491
- kind?: "file" | "skill" | "agent" | undefined;
3739
+ uri: string;
3740
+ kind?: "agent" | "file" | "skill" | undefined;
2492
3741
  };
2493
3742
  }>, z.ZodObject<{
2494
3743
  type: z.ZodLiteral<"diff">;
@@ -2496,13 +3745,13 @@ export declare const sessionEventSchema: z.ZodObject<{
2496
3745
  oldText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2497
3746
  newText: z.ZodString;
2498
3747
  }, "strip", z.ZodTypeAny, {
2499
- type: "diff";
2500
3748
  path: string;
3749
+ type: "diff";
2501
3750
  newText: string;
2502
3751
  oldText?: string | null | undefined;
2503
3752
  }, {
2504
- type: "diff";
2505
3753
  path: string;
3754
+ type: "diff";
2506
3755
  newText: string;
2507
3756
  oldText?: string | null | undefined;
2508
3757
  }>, z.ZodObject<{
@@ -2512,16 +3761,16 @@ export declare const sessionEventSchema: z.ZodObject<{
2512
3761
  movePath: z.ZodOptional<z.ZodString>;
2513
3762
  diff: z.ZodString;
2514
3763
  }, "strip", z.ZodTypeAny, {
2515
- type: "patch";
2516
3764
  path: string;
3765
+ type: "patch";
2517
3766
  diff: string;
2518
- change: "add" | "delete" | "update";
3767
+ change: "delete" | "add" | "update";
2519
3768
  movePath?: string | undefined;
2520
3769
  }, {
2521
- type: "patch";
2522
3770
  path: string;
3771
+ type: "patch";
2523
3772
  diff: string;
2524
- change: "add" | "delete" | "update";
3773
+ change: "delete" | "add" | "update";
2525
3774
  movePath?: string | undefined;
2526
3775
  }>, z.ZodObject<{
2527
3776
  type: z.ZodLiteral<"terminal">;
@@ -2537,52 +3786,51 @@ export declare const sessionEventSchema: z.ZodObject<{
2537
3786
  appendOutput: z.ZodOptional<z.ZodString>;
2538
3787
  rawOutput: z.ZodOptional<z.ZodUnknown>;
2539
3788
  }, "strip", z.ZodTypeAny, {
2540
- sessionUpdate: "tool_call_update";
2541
3789
  toolCallId: string;
2542
- status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
2543
- content?: ({
2544
- type: "content";
2545
- content: {
2546
- type: "text";
2547
- text: string;
2548
- } | {
2549
- type: "image";
2550
- mimeType: string;
2551
- data?: string | undefined;
2552
- uri?: string | undefined;
2553
- } | {
2554
- type: "resource_link";
2555
- uri: string;
2556
- name: string;
2557
- kind?: "file" | "skill" | "agent" | undefined;
2558
- };
2559
- } | {
2560
- type: "diff";
2561
- path: string;
2562
- newText: string;
2563
- oldText?: string | null | undefined;
2564
- } | {
2565
- type: "patch";
2566
- path: string;
2567
- diff: string;
2568
- change: "add" | "delete" | "update";
2569
- movePath?: string | undefined;
2570
- } | {
2571
- type: "terminal";
2572
- terminalId: string;
2573
- })[] | undefined;
2574
- parentToolCallId?: string | undefined;
3790
+ sessionUpdate: "tool_call_update";
3791
+ status?: "completed" | "failed" | "pending" | "in_progress" | undefined;
2575
3792
  title?: string | undefined;
2576
3793
  detail?: {
2577
3794
  type: "mcp";
2578
- server: string;
2579
3795
  tool: string;
3796
+ server: string;
2580
3797
  } | {
2581
3798
  type: "subagent";
2582
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3799
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
3800
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
3801
+ model?: string | undefined;
2583
3802
  task?: string | undefined;
2584
3803
  agentType?: string | undefined;
2585
- model?: string | undefined;
3804
+ workflow?: {
3805
+ completed?: number | undefined;
3806
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3807
+ tokens?: number | undefined;
3808
+ durationMs?: number | undefined;
3809
+ startedAt?: number | undefined;
3810
+ endedAt?: number | undefined;
3811
+ runId?: string | undefined;
3812
+ name?: string | undefined;
3813
+ started?: number | undefined;
3814
+ phases?: {
3815
+ id: string;
3816
+ title: string;
3817
+ order: number;
3818
+ }[] | undefined;
3819
+ agents?: {
3820
+ id: string;
3821
+ title: string;
3822
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3823
+ toolCallId?: string | undefined;
3824
+ phaseId?: string | undefined;
3825
+ model?: string | undefined;
3826
+ tokens?: number | undefined;
3827
+ toolCalls?: number | undefined;
3828
+ durationMs?: number | undefined;
3829
+ startedAt?: number | undefined;
3830
+ endedAt?: number | undefined;
3831
+ result?: string | undefined;
3832
+ }[] | undefined;
3833
+ } | undefined;
2586
3834
  } | {
2587
3835
  type: "skill";
2588
3836
  name: string;
@@ -2603,55 +3851,86 @@ export declare const sessionEventSchema: z.ZodObject<{
2603
3851
  text: string;
2604
3852
  more?: number | undefined;
2605
3853
  } | undefined;
2606
- appendOutput?: string | undefined;
2607
- rawOutput?: unknown;
2608
- }, {
2609
- sessionUpdate: "tool_call_update";
2610
- toolCallId: string;
2611
- status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
3854
+ parentToolCallId?: string | undefined;
2612
3855
  content?: ({
2613
3856
  type: "content";
2614
3857
  content: {
2615
3858
  type: "text";
2616
3859
  text: string;
2617
3860
  } | {
2618
- type: "image";
2619
3861
  mimeType: string;
3862
+ type: "image";
2620
3863
  data?: string | undefined;
2621
3864
  uri?: string | undefined;
2622
3865
  } | {
2623
3866
  type: "resource_link";
2624
- uri: string;
2625
3867
  name: string;
2626
- kind?: "file" | "skill" | "agent" | undefined;
3868
+ uri: string;
3869
+ kind?: "agent" | "file" | "skill" | undefined;
2627
3870
  };
2628
3871
  } | {
2629
- type: "diff";
2630
3872
  path: string;
3873
+ type: "diff";
2631
3874
  newText: string;
2632
3875
  oldText?: string | null | undefined;
2633
3876
  } | {
2634
- type: "patch";
2635
3877
  path: string;
3878
+ type: "patch";
2636
3879
  diff: string;
2637
- change: "add" | "delete" | "update";
3880
+ change: "delete" | "add" | "update";
2638
3881
  movePath?: string | undefined;
2639
3882
  } | {
2640
3883
  type: "terminal";
2641
3884
  terminalId: string;
2642
3885
  })[] | undefined;
2643
- parentToolCallId?: string | undefined;
3886
+ appendOutput?: string | undefined;
3887
+ rawOutput?: unknown;
3888
+ }, {
3889
+ toolCallId: string;
3890
+ sessionUpdate: "tool_call_update";
3891
+ status?: "completed" | "failed" | "pending" | "in_progress" | undefined;
2644
3892
  title?: string | undefined;
2645
3893
  detail?: {
2646
3894
  type: "mcp";
2647
- server: string;
2648
3895
  tool: string;
3896
+ server: string;
2649
3897
  } | {
2650
3898
  type: "subagent";
2651
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
3899
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
3900
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
3901
+ model?: string | undefined;
2652
3902
  task?: string | undefined;
2653
3903
  agentType?: string | undefined;
2654
- model?: string | undefined;
3904
+ workflow?: {
3905
+ completed?: number | undefined;
3906
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
3907
+ tokens?: number | undefined;
3908
+ durationMs?: number | undefined;
3909
+ startedAt?: number | undefined;
3910
+ endedAt?: number | undefined;
3911
+ runId?: string | undefined;
3912
+ name?: string | undefined;
3913
+ started?: number | undefined;
3914
+ phases?: {
3915
+ id: string;
3916
+ title: string;
3917
+ order: number;
3918
+ }[] | undefined;
3919
+ agents?: {
3920
+ id: string;
3921
+ title: string;
3922
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
3923
+ toolCallId?: string | undefined;
3924
+ phaseId?: string | undefined;
3925
+ model?: string | undefined;
3926
+ tokens?: number | undefined;
3927
+ toolCalls?: number | undefined;
3928
+ durationMs?: number | undefined;
3929
+ startedAt?: number | undefined;
3930
+ endedAt?: number | undefined;
3931
+ result?: string | undefined;
3932
+ }[] | undefined;
3933
+ } | undefined;
2655
3934
  } | {
2656
3935
  type: "skill";
2657
3936
  name: string;
@@ -2672,6 +3951,38 @@ export declare const sessionEventSchema: z.ZodObject<{
2672
3951
  text: string;
2673
3952
  more?: number | undefined;
2674
3953
  } | undefined;
3954
+ parentToolCallId?: string | undefined;
3955
+ content?: ({
3956
+ type: "content";
3957
+ content: {
3958
+ type: "text";
3959
+ text: string;
3960
+ } | {
3961
+ mimeType: string;
3962
+ type: "image";
3963
+ data?: string | undefined;
3964
+ uri?: string | undefined;
3965
+ } | {
3966
+ type: "resource_link";
3967
+ name: string;
3968
+ uri: string;
3969
+ kind?: "agent" | "file" | "skill" | undefined;
3970
+ };
3971
+ } | {
3972
+ path: string;
3973
+ type: "diff";
3974
+ newText: string;
3975
+ oldText?: string | null | undefined;
3976
+ } | {
3977
+ path: string;
3978
+ type: "patch";
3979
+ diff: string;
3980
+ change: "delete" | "add" | "update";
3981
+ movePath?: string | undefined;
3982
+ } | {
3983
+ type: "terminal";
3984
+ terminalId: string;
3985
+ })[] | undefined;
2675
3986
  appendOutput?: string | undefined;
2676
3987
  rawOutput?: unknown;
2677
3988
  }>, z.ZodObject<{
@@ -2681,28 +3992,77 @@ export declare const sessionEventSchema: z.ZodObject<{
2681
3992
  priority: z.ZodDefault<z.ZodEnum<["high", "medium", "low"]>>;
2682
3993
  status: z.ZodEnum<["pending", "in_progress", "completed"]>;
2683
3994
  }, "strip", z.ZodTypeAny, {
2684
- status: "pending" | "in_progress" | "completed";
3995
+ status: "completed" | "pending" | "in_progress";
2685
3996
  content: string;
2686
3997
  priority: "high" | "medium" | "low";
2687
3998
  }, {
2688
- status: "pending" | "in_progress" | "completed";
3999
+ status: "completed" | "pending" | "in_progress";
2689
4000
  content: string;
2690
4001
  priority?: "high" | "medium" | "low" | undefined;
2691
4002
  }>, "many">;
2692
4003
  }, "strip", z.ZodTypeAny, {
2693
4004
  entries: {
2694
- status: "pending" | "in_progress" | "completed";
4005
+ status: "completed" | "pending" | "in_progress";
2695
4006
  content: string;
2696
4007
  priority: "high" | "medium" | "low";
2697
4008
  }[];
2698
4009
  sessionUpdate: "plan";
2699
4010
  }, {
2700
4011
  entries: {
2701
- status: "pending" | "in_progress" | "completed";
4012
+ status: "completed" | "pending" | "in_progress";
2702
4013
  content: string;
2703
4014
  priority?: "high" | "medium" | "low" | undefined;
2704
4015
  }[];
2705
4016
  sessionUpdate: "plan";
4017
+ }>, z.ZodObject<{
4018
+ sessionUpdate: z.ZodLiteral<"ls_goal">;
4019
+ goal: z.ZodNullable<z.ZodObject<{
4020
+ objective: z.ZodString;
4021
+ status: z.ZodEnum<["active", "paused", "blocked", "usageLimited", "budgetLimited", "complete"]>;
4022
+ tokenBudget: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4023
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
4024
+ timeUsedSeconds: z.ZodOptional<z.ZodNumber>;
4025
+ iterations: z.ZodOptional<z.ZodNumber>;
4026
+ lastReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4027
+ }, "strip", z.ZodTypeAny, {
4028
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
4029
+ objective: string;
4030
+ tokenBudget?: number | null | undefined;
4031
+ tokensUsed?: number | undefined;
4032
+ timeUsedSeconds?: number | undefined;
4033
+ iterations?: number | undefined;
4034
+ lastReason?: string | null | undefined;
4035
+ }, {
4036
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
4037
+ objective: string;
4038
+ tokenBudget?: number | null | undefined;
4039
+ tokensUsed?: number | undefined;
4040
+ timeUsedSeconds?: number | undefined;
4041
+ iterations?: number | undefined;
4042
+ lastReason?: string | null | undefined;
4043
+ }>>;
4044
+ }, "strip", z.ZodTypeAny, {
4045
+ sessionUpdate: "ls_goal";
4046
+ goal: {
4047
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
4048
+ objective: string;
4049
+ tokenBudget?: number | null | undefined;
4050
+ tokensUsed?: number | undefined;
4051
+ timeUsedSeconds?: number | undefined;
4052
+ iterations?: number | undefined;
4053
+ lastReason?: string | null | undefined;
4054
+ } | null;
4055
+ }, {
4056
+ sessionUpdate: "ls_goal";
4057
+ goal: {
4058
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
4059
+ objective: string;
4060
+ tokenBudget?: number | null | undefined;
4061
+ tokensUsed?: number | undefined;
4062
+ timeUsedSeconds?: number | undefined;
4063
+ iterations?: number | undefined;
4064
+ lastReason?: string | null | undefined;
4065
+ } | null;
2706
4066
  }>, z.ZodObject<{
2707
4067
  sessionUpdate: z.ZodLiteral<"available_commands_update">;
2708
4068
  availableCommands: z.ZodArray<z.ZodObject<{
@@ -2747,12 +4107,12 @@ export declare const sessionEventSchema: z.ZodObject<{
2747
4107
  model: z.ZodOptional<z.ZodString>;
2748
4108
  }, "strip", z.ZodTypeAny, {
2749
4109
  sessionUpdate: "session_info_update";
2750
- model?: string | undefined;
2751
4110
  title?: string | undefined;
4111
+ model?: string | undefined;
2752
4112
  }, {
2753
4113
  sessionUpdate: "session_info_update";
2754
- model?: string | undefined;
2755
4114
  title?: string | undefined;
4115
+ model?: string | undefined;
2756
4116
  }>, z.ZodObject<{
2757
4117
  sessionUpdate: z.ZodLiteral<"usage_update">;
2758
4118
  usedTokens: z.ZodOptional<z.ZodNumber>;
@@ -2802,50 +4162,50 @@ export declare const sessionEventSchema: z.ZodObject<{
2802
4162
  description?: string | undefined;
2803
4163
  }>, "many">;
2804
4164
  }, "strip", z.ZodTypeAny, {
4165
+ id: string;
2805
4166
  values: {
2806
4167
  value: string;
2807
4168
  name: string;
2808
4169
  description?: string | undefined;
2809
4170
  }[];
2810
4171
  name: string;
2811
- id: string;
2812
- category: "model" | "mode" | "effort" | "other";
4172
+ category: "model" | "other" | "mode" | "effort";
2813
4173
  current: string;
2814
4174
  }, {
4175
+ id: string;
2815
4176
  values: {
2816
4177
  value: string;
2817
4178
  name: string;
2818
4179
  description?: string | undefined;
2819
4180
  }[];
2820
4181
  name: string;
2821
- id: string;
2822
4182
  current: string;
2823
- category?: "model" | "mode" | "effort" | "other" | undefined;
4183
+ category?: "model" | "other" | "mode" | "effort" | undefined;
2824
4184
  }>, "many">;
2825
4185
  }, "strip", z.ZodTypeAny, {
2826
4186
  options: {
4187
+ id: string;
2827
4188
  values: {
2828
4189
  value: string;
2829
4190
  name: string;
2830
4191
  description?: string | undefined;
2831
4192
  }[];
2832
4193
  name: string;
2833
- id: string;
2834
- category: "model" | "mode" | "effort" | "other";
4194
+ category: "model" | "other" | "mode" | "effort";
2835
4195
  current: string;
2836
4196
  }[];
2837
4197
  sessionUpdate: "ls_config";
2838
4198
  }, {
2839
4199
  options: {
4200
+ id: string;
2840
4201
  values: {
2841
4202
  value: string;
2842
4203
  name: string;
2843
4204
  description?: string | undefined;
2844
4205
  }[];
2845
4206
  name: string;
2846
- id: string;
2847
4207
  current: string;
2848
- category?: "model" | "mode" | "effort" | "other" | undefined;
4208
+ category?: "model" | "other" | "mode" | "effort" | undefined;
2849
4209
  }[];
2850
4210
  sessionUpdate: "ls_config";
2851
4211
  }>, z.ZodObject<{
@@ -2854,13 +4214,13 @@ export declare const sessionEventSchema: z.ZodObject<{
2854
4214
  title: z.ZodString;
2855
4215
  detail: z.ZodOptional<z.ZodString>;
2856
4216
  }, "strip", z.ZodTypeAny, {
2857
- sessionUpdate: "ls_notice";
2858
4217
  title: string;
4218
+ sessionUpdate: "ls_notice";
2859
4219
  level: "info" | "warning";
2860
4220
  detail?: string | undefined;
2861
4221
  }, {
2862
- sessionUpdate: "ls_notice";
2863
4222
  title: string;
4223
+ sessionUpdate: "ls_notice";
2864
4224
  level: "info" | "warning";
2865
4225
  detail?: string | undefined;
2866
4226
  }>, z.ZodObject<{
@@ -2871,17 +4231,17 @@ export declare const sessionEventSchema: z.ZodObject<{
2871
4231
  turnId: z.ZodOptional<z.ZodString>;
2872
4232
  stopReason: z.ZodOptional<z.ZodEnum<["end_turn", "cancelled", "error", "max_tokens", "refusal"]>>;
2873
4233
  }, "strip", z.ZodTypeAny, {
2874
- sessionUpdate: "ls_turn";
2875
4234
  state: "started" | "ended";
4235
+ sessionUpdate: "ls_turn";
2876
4236
  parentToolCallId?: string | undefined;
2877
4237
  turnId?: string | undefined;
2878
- stopReason?: "end_turn" | "cancelled" | "error" | "max_tokens" | "refusal" | undefined;
4238
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
2879
4239
  }, {
2880
- sessionUpdate: "ls_turn";
2881
4240
  state: "started" | "ended";
4241
+ sessionUpdate: "ls_turn";
2882
4242
  parentToolCallId?: string | undefined;
2883
4243
  turnId?: string | undefined;
2884
- stopReason?: "end_turn" | "cancelled" | "error" | "max_tokens" | "refusal" | undefined;
4244
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
2885
4245
  }>, z.ZodObject<{
2886
4246
  sessionUpdate: z.ZodLiteral<"ls_permission">;
2887
4247
  requestId: z.ZodString;
@@ -2894,12 +4254,12 @@ export declare const sessionEventSchema: z.ZodObject<{
2894
4254
  kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
2895
4255
  }, "strip", z.ZodTypeAny, {
2896
4256
  name: string;
2897
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
2898
4257
  optionId: string;
4258
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
2899
4259
  }, {
2900
4260
  name: string;
2901
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
2902
4261
  optionId: string;
4262
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
2903
4263
  }>, "many">;
2904
4264
  /**
2905
4265
  * The agent is asking the user something: answer with `sessions.answer`.
@@ -2928,9 +4288,9 @@ export declare const sessionEventSchema: z.ZodObject<{
2928
4288
  secret: z.ZodOptional<z.ZodBoolean>;
2929
4289
  required: z.ZodOptional<z.ZodBoolean>;
2930
4290
  }, "strip", z.ZodTypeAny, {
2931
- text: string;
2932
- kind: "text" | "choice" | "choices";
2933
4291
  id: string;
4292
+ kind: "text" | "choice" | "choices";
4293
+ text: string;
2934
4294
  options?: {
2935
4295
  value: string;
2936
4296
  label: string;
@@ -2941,9 +4301,9 @@ export declare const sessionEventSchema: z.ZodObject<{
2941
4301
  secret?: boolean | undefined;
2942
4302
  required?: boolean | undefined;
2943
4303
  }, {
2944
- text: string;
2945
- kind: "text" | "choice" | "choices";
2946
4304
  id: string;
4305
+ kind: "text" | "choice" | "choices";
4306
+ text: string;
2947
4307
  options?: {
2948
4308
  value: string;
2949
4309
  label: string;
@@ -2957,18 +4317,18 @@ export declare const sessionEventSchema: z.ZodObject<{
2957
4317
  }, "strip", z.ZodTypeAny, {
2958
4318
  options: {
2959
4319
  name: string;
2960
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
2961
4320
  optionId: string;
4321
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
2962
4322
  }[];
2963
- sessionUpdate: "ls_permission";
2964
4323
  title: string;
2965
4324
  requestId: string;
4325
+ sessionUpdate: "ls_permission";
2966
4326
  toolCallId?: string | undefined;
2967
4327
  detail?: string | undefined;
2968
4328
  questions?: {
2969
- text: string;
2970
- kind: "text" | "choice" | "choices";
2971
4329
  id: string;
4330
+ kind: "text" | "choice" | "choices";
4331
+ text: string;
2972
4332
  options?: {
2973
4333
  value: string;
2974
4334
  label: string;
@@ -2982,18 +4342,18 @@ export declare const sessionEventSchema: z.ZodObject<{
2982
4342
  }, {
2983
4343
  options: {
2984
4344
  name: string;
2985
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
2986
4345
  optionId: string;
4346
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
2987
4347
  }[];
2988
- sessionUpdate: "ls_permission";
2989
4348
  title: string;
2990
4349
  requestId: string;
4350
+ sessionUpdate: "ls_permission";
2991
4351
  toolCallId?: string | undefined;
2992
4352
  detail?: string | undefined;
2993
4353
  questions?: {
2994
- text: string;
2995
- kind: "text" | "choice" | "choices";
2996
4354
  id: string;
4355
+ kind: "text" | "choice" | "choices";
4356
+ text: string;
2997
4357
  options?: {
2998
4358
  value: string;
2999
4359
  label: string;
@@ -3014,30 +4374,30 @@ export declare const sessionEventSchema: z.ZodObject<{
3014
4374
  values: z.ZodArray<z.ZodString, "many">;
3015
4375
  other: z.ZodOptional<z.ZodString>;
3016
4376
  }, "strip", z.ZodTypeAny, {
3017
- values: string[];
3018
4377
  id: string;
4378
+ values: string[];
3019
4379
  other?: string | undefined;
3020
4380
  }, {
3021
- values: string[];
3022
4381
  id: string;
4382
+ values: string[];
3023
4383
  other?: string | undefined;
3024
4384
  }>, "many">>;
3025
4385
  }, "strip", z.ZodTypeAny, {
3026
- sessionUpdate: "ls_permission_resolved";
3027
4386
  requestId: string;
4387
+ sessionUpdate: "ls_permission_resolved";
3028
4388
  optionId?: string | undefined;
3029
4389
  answers?: {
3030
- values: string[];
3031
4390
  id: string;
4391
+ values: string[];
3032
4392
  other?: string | undefined;
3033
4393
  }[] | undefined;
3034
4394
  }, {
3035
- sessionUpdate: "ls_permission_resolved";
3036
4395
  requestId: string;
4396
+ sessionUpdate: "ls_permission_resolved";
3037
4397
  optionId?: string | undefined;
3038
4398
  answers?: {
3039
- values: string[];
3040
4399
  id: string;
4400
+ values: string[];
3041
4401
  other?: string | undefined;
3042
4402
  }[] | undefined;
3043
4403
  }>, z.ZodObject<{
@@ -3045,22 +4405,101 @@ export declare const sessionEventSchema: z.ZodObject<{
3045
4405
  driver: z.ZodEnum<["desktop", "remote", "none"]>;
3046
4406
  deviceId: z.ZodOptional<z.ZodString>;
3047
4407
  }, "strip", z.ZodTypeAny, {
4408
+ driver: "remote" | "desktop" | "none";
3048
4409
  sessionUpdate: "ls_driver";
3049
- driver: "desktop" | "remote" | "none";
3050
4410
  deviceId?: string | undefined;
3051
4411
  }, {
4412
+ driver: "remote" | "desktop" | "none";
3052
4413
  sessionUpdate: "ls_driver";
3053
- driver: "desktop" | "remote" | "none";
3054
4414
  deviceId?: string | undefined;
3055
4415
  }>, z.ZodObject<{
3056
4416
  sessionUpdate: z.ZodLiteral<"ls_status">;
3057
4417
  state: z.ZodEnum<["idle", "running", "waiting", "error", "offline"]>;
3058
4418
  }, "strip", z.ZodTypeAny, {
4419
+ state: "error" | "running" | "idle" | "waiting" | "offline";
3059
4420
  sessionUpdate: "ls_status";
3060
- state: "error" | "idle" | "running" | "waiting" | "offline";
3061
4421
  }, {
4422
+ state: "error" | "running" | "idle" | "waiting" | "offline";
3062
4423
  sessionUpdate: "ls_status";
3063
- state: "error" | "idle" | "running" | "waiting" | "offline";
4424
+ }>, z.ZodObject<{
4425
+ sessionUpdate: z.ZodLiteral<"ls_task">;
4426
+ task: z.ZodObject<{
4427
+ id: z.ZodString;
4428
+ kind: z.ZodEnum<["shell", "monitor"]>;
4429
+ toolCallId: z.ZodOptional<z.ZodString>;
4430
+ title: z.ZodString;
4431
+ command: z.ZodOptional<z.ZodString>;
4432
+ state: z.ZodEnum<["running", "completed", "failed", "stopped", "unknown"]>;
4433
+ startedAt: z.ZodNumber;
4434
+ endedAt: z.ZodOptional<z.ZodNumber>;
4435
+ summary: z.ZodOptional<z.ZodString>;
4436
+ exitCode: z.ZodOptional<z.ZodNumber>;
4437
+ output: z.ZodOptional<z.ZodBoolean>;
4438
+ canStop: z.ZodOptional<z.ZodBoolean>;
4439
+ lastSeq: z.ZodOptional<z.ZodNumber>;
4440
+ }, "strip", z.ZodTypeAny, {
4441
+ id: string;
4442
+ title: string;
4443
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
4444
+ startedAt: number;
4445
+ kind: "shell" | "monitor";
4446
+ toolCallId?: string | undefined;
4447
+ endedAt?: number | undefined;
4448
+ lastSeq?: number | undefined;
4449
+ command?: string | undefined;
4450
+ summary?: string | undefined;
4451
+ exitCode?: number | undefined;
4452
+ output?: boolean | undefined;
4453
+ canStop?: boolean | undefined;
4454
+ }, {
4455
+ id: string;
4456
+ title: string;
4457
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
4458
+ startedAt: number;
4459
+ kind: "shell" | "monitor";
4460
+ toolCallId?: string | undefined;
4461
+ endedAt?: number | undefined;
4462
+ lastSeq?: number | undefined;
4463
+ command?: string | undefined;
4464
+ summary?: string | undefined;
4465
+ exitCode?: number | undefined;
4466
+ output?: boolean | undefined;
4467
+ canStop?: boolean | undefined;
4468
+ }>;
4469
+ }, "strip", z.ZodTypeAny, {
4470
+ task: {
4471
+ id: string;
4472
+ title: string;
4473
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
4474
+ startedAt: number;
4475
+ kind: "shell" | "monitor";
4476
+ toolCallId?: string | undefined;
4477
+ endedAt?: number | undefined;
4478
+ lastSeq?: number | undefined;
4479
+ command?: string | undefined;
4480
+ summary?: string | undefined;
4481
+ exitCode?: number | undefined;
4482
+ output?: boolean | undefined;
4483
+ canStop?: boolean | undefined;
4484
+ };
4485
+ sessionUpdate: "ls_task";
4486
+ }, {
4487
+ task: {
4488
+ id: string;
4489
+ title: string;
4490
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
4491
+ startedAt: number;
4492
+ kind: "shell" | "monitor";
4493
+ toolCallId?: string | undefined;
4494
+ endedAt?: number | undefined;
4495
+ lastSeq?: number | undefined;
4496
+ command?: string | undefined;
4497
+ summary?: string | undefined;
4498
+ exitCode?: number | undefined;
4499
+ output?: boolean | undefined;
4500
+ canStop?: boolean | undefined;
4501
+ };
4502
+ sessionUpdate: "ls_task";
3064
4503
  }>, z.ZodObject<{
3065
4504
  sessionUpdate: z.ZodLiteral<"ls_error">;
3066
4505
  code: z.ZodString;
@@ -3083,15 +4522,15 @@ export declare const sessionEventSchema: z.ZodObject<{
3083
4522
  type: "text";
3084
4523
  text: string;
3085
4524
  } | {
3086
- type: "image";
3087
4525
  mimeType: string;
4526
+ type: "image";
3088
4527
  data?: string | undefined;
3089
4528
  uri?: string | undefined;
3090
4529
  } | {
3091
4530
  type: "resource_link";
3092
- uri: string;
3093
4531
  name: string;
3094
- kind?: "file" | "skill" | "agent" | undefined;
4532
+ uri: string;
4533
+ kind?: "agent" | "file" | "skill" | undefined;
3095
4534
  };
3096
4535
  sessionUpdate: "user_message_chunk";
3097
4536
  messageId?: string | undefined;
@@ -3100,15 +4539,15 @@ export declare const sessionEventSchema: z.ZodObject<{
3100
4539
  type: "text";
3101
4540
  text: string;
3102
4541
  } | {
3103
- type: "image";
3104
4542
  mimeType: string;
4543
+ type: "image";
3105
4544
  data?: string | undefined;
3106
4545
  uri?: string | undefined;
3107
4546
  } | {
3108
4547
  type: "resource_link";
3109
- uri: string;
3110
4548
  name: string;
3111
- kind?: "file" | "skill" | "agent" | undefined;
4549
+ uri: string;
4550
+ kind?: "agent" | "file" | "skill" | undefined;
3112
4551
  };
3113
4552
  sessionUpdate: "agent_message_chunk";
3114
4553
  messageId: string;
@@ -3118,72 +4557,169 @@ export declare const sessionEventSchema: z.ZodObject<{
3118
4557
  type: "text";
3119
4558
  text: string;
3120
4559
  } | {
3121
- type: "image";
3122
4560
  mimeType: string;
4561
+ type: "image";
3123
4562
  data?: string | undefined;
3124
4563
  uri?: string | undefined;
3125
4564
  } | {
3126
4565
  type: "resource_link";
3127
- uri: string;
3128
4566
  name: string;
3129
- kind?: "file" | "skill" | "agent" | undefined;
4567
+ uri: string;
4568
+ kind?: "agent" | "file" | "skill" | undefined;
3130
4569
  };
3131
4570
  sessionUpdate: "agent_thought_chunk";
3132
4571
  messageId: string;
3133
4572
  parentToolCallId?: string | undefined;
3134
4573
  } | {
3135
- status: "pending" | "in_progress" | "completed" | "failed";
3136
- kind: "delete" | "other" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
3137
- sessionUpdate: "tool_call";
4574
+ status: "completed" | "failed" | "pending" | "in_progress";
3138
4575
  toolCallId: string;
3139
4576
  title: string;
4577
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
4578
+ sessionUpdate: "tool_call";
4579
+ detail?: {
4580
+ type: "mcp";
4581
+ tool: string;
4582
+ server: string;
4583
+ } | {
4584
+ type: "subagent";
4585
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
4586
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
4587
+ model?: string | undefined;
4588
+ task?: string | undefined;
4589
+ agentType?: string | undefined;
4590
+ workflow?: {
4591
+ completed?: number | undefined;
4592
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
4593
+ tokens?: number | undefined;
4594
+ durationMs?: number | undefined;
4595
+ startedAt?: number | undefined;
4596
+ endedAt?: number | undefined;
4597
+ runId?: string | undefined;
4598
+ name?: string | undefined;
4599
+ started?: number | undefined;
4600
+ phases?: {
4601
+ id: string;
4602
+ title: string;
4603
+ order: number;
4604
+ }[] | undefined;
4605
+ agents?: {
4606
+ id: string;
4607
+ title: string;
4608
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
4609
+ toolCallId?: string | undefined;
4610
+ phaseId?: string | undefined;
4611
+ model?: string | undefined;
4612
+ tokens?: number | undefined;
4613
+ toolCalls?: number | undefined;
4614
+ durationMs?: number | undefined;
4615
+ startedAt?: number | undefined;
4616
+ endedAt?: number | undefined;
4617
+ result?: string | undefined;
4618
+ }[] | undefined;
4619
+ } | undefined;
4620
+ } | {
4621
+ type: "skill";
4622
+ name: string;
4623
+ description?: string | undefined;
4624
+ } | {
4625
+ type: "web_search";
4626
+ query?: string | undefined;
4627
+ } | {
4628
+ type: "image_generation";
4629
+ prompt?: string | undefined;
4630
+ } | {
4631
+ type: "compaction";
4632
+ } | {
4633
+ type: "review";
4634
+ phase: "started" | "finished";
4635
+ } | {
4636
+ type: "question";
4637
+ text: string;
4638
+ more?: number | undefined;
4639
+ } | undefined;
4640
+ parentToolCallId?: string | undefined;
3140
4641
  content?: ({
3141
4642
  type: "content";
3142
4643
  content: {
3143
4644
  type: "text";
3144
4645
  text: string;
3145
4646
  } | {
3146
- type: "image";
3147
4647
  mimeType: string;
4648
+ type: "image";
3148
4649
  data?: string | undefined;
3149
4650
  uri?: string | undefined;
3150
4651
  } | {
3151
4652
  type: "resource_link";
3152
- uri: string;
3153
4653
  name: string;
3154
- kind?: "file" | "skill" | "agent" | undefined;
4654
+ uri: string;
4655
+ kind?: "agent" | "file" | "skill" | undefined;
3155
4656
  };
3156
4657
  } | {
3157
- type: "diff";
3158
4658
  path: string;
4659
+ type: "diff";
3159
4660
  newText: string;
3160
4661
  oldText?: string | null | undefined;
3161
4662
  } | {
3162
- type: "patch";
3163
4663
  path: string;
4664
+ type: "patch";
3164
4665
  diff: string;
3165
- change: "add" | "delete" | "update";
4666
+ change: "delete" | "add" | "update";
3166
4667
  movePath?: string | undefined;
3167
4668
  } | {
3168
4669
  type: "terminal";
3169
4670
  terminalId: string;
3170
4671
  })[] | undefined;
3171
- parentToolCallId?: string | undefined;
3172
4672
  rawInput?: unknown;
3173
4673
  locations?: {
3174
4674
  path: string;
3175
4675
  line?: number | undefined;
3176
4676
  }[] | undefined;
4677
+ } | {
4678
+ toolCallId: string;
4679
+ sessionUpdate: "tool_call_update";
4680
+ status?: "completed" | "failed" | "pending" | "in_progress" | undefined;
4681
+ title?: string | undefined;
3177
4682
  detail?: {
3178
4683
  type: "mcp";
3179
- server: string;
3180
4684
  tool: string;
4685
+ server: string;
3181
4686
  } | {
3182
4687
  type: "subagent";
3183
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
4688
+ action: "message" | "resume" | "spawn" | "wait" | "stop" | "list";
4689
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
4690
+ model?: string | undefined;
3184
4691
  task?: string | undefined;
3185
4692
  agentType?: string | undefined;
3186
- model?: string | undefined;
4693
+ workflow?: {
4694
+ completed?: number | undefined;
4695
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
4696
+ tokens?: number | undefined;
4697
+ durationMs?: number | undefined;
4698
+ startedAt?: number | undefined;
4699
+ endedAt?: number | undefined;
4700
+ runId?: string | undefined;
4701
+ name?: string | undefined;
4702
+ started?: number | undefined;
4703
+ phases?: {
4704
+ id: string;
4705
+ title: string;
4706
+ order: number;
4707
+ }[] | undefined;
4708
+ agents?: {
4709
+ id: string;
4710
+ title: string;
4711
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
4712
+ toolCallId?: string | undefined;
4713
+ phaseId?: string | undefined;
4714
+ model?: string | undefined;
4715
+ tokens?: number | undefined;
4716
+ toolCalls?: number | undefined;
4717
+ durationMs?: number | undefined;
4718
+ startedAt?: number | undefined;
4719
+ endedAt?: number | undefined;
4720
+ result?: string | undefined;
4721
+ }[] | undefined;
4722
+ } | undefined;
3187
4723
  } | {
3188
4724
  type: "skill";
3189
4725
  name: string;
@@ -3204,82 +4740,58 @@ export declare const sessionEventSchema: z.ZodObject<{
3204
4740
  text: string;
3205
4741
  more?: number | undefined;
3206
4742
  } | undefined;
3207
- } | {
3208
- sessionUpdate: "tool_call_update";
3209
- toolCallId: string;
3210
- status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
4743
+ parentToolCallId?: string | undefined;
3211
4744
  content?: ({
3212
4745
  type: "content";
3213
4746
  content: {
3214
4747
  type: "text";
3215
4748
  text: string;
3216
4749
  } | {
3217
- type: "image";
3218
4750
  mimeType: string;
4751
+ type: "image";
3219
4752
  data?: string | undefined;
3220
4753
  uri?: string | undefined;
3221
4754
  } | {
3222
4755
  type: "resource_link";
3223
- uri: string;
3224
4756
  name: string;
3225
- kind?: "file" | "skill" | "agent" | undefined;
4757
+ uri: string;
4758
+ kind?: "agent" | "file" | "skill" | undefined;
3226
4759
  };
3227
4760
  } | {
3228
- type: "diff";
3229
4761
  path: string;
4762
+ type: "diff";
3230
4763
  newText: string;
3231
4764
  oldText?: string | null | undefined;
3232
4765
  } | {
3233
- type: "patch";
3234
4766
  path: string;
4767
+ type: "patch";
3235
4768
  diff: string;
3236
- change: "add" | "delete" | "update";
4769
+ change: "delete" | "add" | "update";
3237
4770
  movePath?: string | undefined;
3238
4771
  } | {
3239
4772
  type: "terminal";
3240
4773
  terminalId: string;
3241
4774
  })[] | undefined;
3242
- parentToolCallId?: string | undefined;
3243
- title?: string | undefined;
3244
- detail?: {
3245
- type: "mcp";
3246
- server: string;
3247
- tool: string;
3248
- } | {
3249
- type: "subagent";
3250
- action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3251
- task?: string | undefined;
3252
- agentType?: string | undefined;
3253
- model?: string | undefined;
3254
- } | {
3255
- type: "skill";
3256
- name: string;
3257
- description?: string | undefined;
3258
- } | {
3259
- type: "web_search";
3260
- query?: string | undefined;
3261
- } | {
3262
- type: "image_generation";
3263
- prompt?: string | undefined;
3264
- } | {
3265
- type: "compaction";
3266
- } | {
3267
- type: "review";
3268
- phase: "started" | "finished";
3269
- } | {
3270
- type: "question";
3271
- text: string;
3272
- more?: number | undefined;
3273
- } | undefined;
3274
4775
  appendOutput?: string | undefined;
3275
4776
  rawOutput?: unknown;
3276
4777
  } | {
3277
4778
  entries: {
3278
- status: "pending" | "in_progress" | "completed";
4779
+ status: "completed" | "pending" | "in_progress";
3279
4780
  content: string;
3280
4781
  priority: "high" | "medium" | "low";
3281
4782
  }[];
3282
4783
  sessionUpdate: "plan";
4784
+ } | {
4785
+ sessionUpdate: "ls_goal";
4786
+ goal: {
4787
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
4788
+ objective: string;
4789
+ tokenBudget?: number | null | undefined;
4790
+ tokensUsed?: number | undefined;
4791
+ timeUsedSeconds?: number | undefined;
4792
+ iterations?: number | undefined;
4793
+ lastReason?: string | null | undefined;
4794
+ } | null;
3283
4795
  } | {
3284
4796
  sessionUpdate: "available_commands_update";
3285
4797
  availableCommands: {
@@ -3292,8 +4804,8 @@ export declare const sessionEventSchema: z.ZodObject<{
3292
4804
  currentModeId: string;
3293
4805
  } | {
3294
4806
  sessionUpdate: "session_info_update";
3295
- model?: string | undefined;
3296
4807
  title?: string | undefined;
4808
+ model?: string | undefined;
3297
4809
  } | {
3298
4810
  sessionUpdate: "usage_update";
3299
4811
  usedTokens?: number | undefined;
@@ -3305,43 +4817,43 @@ export declare const sessionEventSchema: z.ZodObject<{
3305
4817
  parentToolCallId?: string | undefined;
3306
4818
  } | {
3307
4819
  options: {
4820
+ id: string;
3308
4821
  values: {
3309
4822
  value: string;
3310
4823
  name: string;
3311
4824
  description?: string | undefined;
3312
4825
  }[];
3313
4826
  name: string;
3314
- id: string;
3315
- category: "model" | "mode" | "effort" | "other";
4827
+ category: "model" | "other" | "mode" | "effort";
3316
4828
  current: string;
3317
4829
  }[];
3318
4830
  sessionUpdate: "ls_config";
3319
4831
  } | {
3320
- sessionUpdate: "ls_notice";
3321
4832
  title: string;
4833
+ sessionUpdate: "ls_notice";
3322
4834
  level: "info" | "warning";
3323
4835
  detail?: string | undefined;
3324
4836
  } | {
3325
- sessionUpdate: "ls_turn";
3326
4837
  state: "started" | "ended";
4838
+ sessionUpdate: "ls_turn";
3327
4839
  parentToolCallId?: string | undefined;
3328
4840
  turnId?: string | undefined;
3329
- stopReason?: "end_turn" | "cancelled" | "error" | "max_tokens" | "refusal" | undefined;
4841
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
3330
4842
  } | {
3331
4843
  options: {
3332
4844
  name: string;
3333
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3334
4845
  optionId: string;
4846
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3335
4847
  }[];
3336
- sessionUpdate: "ls_permission";
3337
4848
  title: string;
3338
4849
  requestId: string;
4850
+ sessionUpdate: "ls_permission";
3339
4851
  toolCallId?: string | undefined;
3340
4852
  detail?: string | undefined;
3341
4853
  questions?: {
3342
- text: string;
3343
- kind: "text" | "choice" | "choices";
3344
4854
  id: string;
4855
+ kind: "text" | "choice" | "choices";
4856
+ text: string;
3345
4857
  options?: {
3346
4858
  value: string;
3347
4859
  label: string;
@@ -3353,21 +4865,38 @@ export declare const sessionEventSchema: z.ZodObject<{
3353
4865
  required?: boolean | undefined;
3354
4866
  }[] | undefined;
3355
4867
  } | {
3356
- sessionUpdate: "ls_permission_resolved";
3357
4868
  requestId: string;
4869
+ sessionUpdate: "ls_permission_resolved";
3358
4870
  optionId?: string | undefined;
3359
4871
  answers?: {
3360
- values: string[];
3361
4872
  id: string;
4873
+ values: string[];
3362
4874
  other?: string | undefined;
3363
4875
  }[] | undefined;
3364
4876
  } | {
4877
+ driver: "remote" | "desktop" | "none";
3365
4878
  sessionUpdate: "ls_driver";
3366
- driver: "desktop" | "remote" | "none";
3367
4879
  deviceId?: string | undefined;
3368
4880
  } | {
4881
+ state: "error" | "running" | "idle" | "waiting" | "offline";
3369
4882
  sessionUpdate: "ls_status";
3370
- state: "error" | "idle" | "running" | "waiting" | "offline";
4883
+ } | {
4884
+ task: {
4885
+ id: string;
4886
+ title: string;
4887
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
4888
+ startedAt: number;
4889
+ kind: "shell" | "monitor";
4890
+ toolCallId?: string | undefined;
4891
+ endedAt?: number | undefined;
4892
+ lastSeq?: number | undefined;
4893
+ command?: string | undefined;
4894
+ summary?: string | undefined;
4895
+ exitCode?: number | undefined;
4896
+ output?: boolean | undefined;
4897
+ canStop?: boolean | undefined;
4898
+ };
4899
+ sessionUpdate: "ls_task";
3371
4900
  } | {
3372
4901
  code: string;
3373
4902
  message: string;
@@ -3383,15 +4912,15 @@ export declare const sessionEventSchema: z.ZodObject<{
3383
4912
  type: "text";
3384
4913
  text: string;
3385
4914
  } | {
3386
- type: "image";
3387
4915
  mimeType: string;
4916
+ type: "image";
3388
4917
  data?: string | undefined;
3389
4918
  uri?: string | undefined;
3390
4919
  } | {
3391
4920
  type: "resource_link";
3392
- uri: string;
3393
4921
  name: string;
3394
- kind?: "file" | "skill" | "agent" | undefined;
4922
+ uri: string;
4923
+ kind?: "agent" | "file" | "skill" | undefined;
3395
4924
  };
3396
4925
  sessionUpdate: "user_message_chunk";
3397
4926
  messageId?: string | undefined;
@@ -3400,15 +4929,15 @@ export declare const sessionEventSchema: z.ZodObject<{
3400
4929
  type: "text";
3401
4930
  text: string;
3402
4931
  } | {
3403
- type: "image";
3404
4932
  mimeType: string;
4933
+ type: "image";
3405
4934
  data?: string | undefined;
3406
4935
  uri?: string | undefined;
3407
4936
  } | {
3408
4937
  type: "resource_link";
3409
- uri: string;
3410
4938
  name: string;
3411
- kind?: "file" | "skill" | "agent" | undefined;
4939
+ uri: string;
4940
+ kind?: "agent" | "file" | "skill" | undefined;
3412
4941
  };
3413
4942
  sessionUpdate: "agent_message_chunk";
3414
4943
  messageId: string;
@@ -3418,72 +4947,169 @@ export declare const sessionEventSchema: z.ZodObject<{
3418
4947
  type: "text";
3419
4948
  text: string;
3420
4949
  } | {
3421
- type: "image";
3422
4950
  mimeType: string;
4951
+ type: "image";
3423
4952
  data?: string | undefined;
3424
4953
  uri?: string | undefined;
3425
4954
  } | {
3426
4955
  type: "resource_link";
3427
- uri: string;
3428
4956
  name: string;
3429
- kind?: "file" | "skill" | "agent" | undefined;
4957
+ uri: string;
4958
+ kind?: "agent" | "file" | "skill" | undefined;
3430
4959
  };
3431
4960
  sessionUpdate: "agent_thought_chunk";
3432
4961
  messageId: string;
3433
4962
  parentToolCallId?: string | undefined;
3434
4963
  } | {
3435
- status: "pending" | "in_progress" | "completed" | "failed";
3436
- kind: "delete" | "other" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
3437
- sessionUpdate: "tool_call";
4964
+ status: "completed" | "failed" | "pending" | "in_progress";
3438
4965
  toolCallId: string;
3439
4966
  title: string;
4967
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
4968
+ sessionUpdate: "tool_call";
4969
+ detail?: {
4970
+ type: "mcp";
4971
+ tool: string;
4972
+ server: string;
4973
+ } | {
4974
+ type: "subagent";
4975
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
4976
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
4977
+ model?: string | undefined;
4978
+ task?: string | undefined;
4979
+ agentType?: string | undefined;
4980
+ workflow?: {
4981
+ completed?: number | undefined;
4982
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
4983
+ tokens?: number | undefined;
4984
+ durationMs?: number | undefined;
4985
+ startedAt?: number | undefined;
4986
+ endedAt?: number | undefined;
4987
+ runId?: string | undefined;
4988
+ name?: string | undefined;
4989
+ started?: number | undefined;
4990
+ phases?: {
4991
+ id: string;
4992
+ title: string;
4993
+ order: number;
4994
+ }[] | undefined;
4995
+ agents?: {
4996
+ id: string;
4997
+ title: string;
4998
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
4999
+ toolCallId?: string | undefined;
5000
+ phaseId?: string | undefined;
5001
+ model?: string | undefined;
5002
+ tokens?: number | undefined;
5003
+ toolCalls?: number | undefined;
5004
+ durationMs?: number | undefined;
5005
+ startedAt?: number | undefined;
5006
+ endedAt?: number | undefined;
5007
+ result?: string | undefined;
5008
+ }[] | undefined;
5009
+ } | undefined;
5010
+ } | {
5011
+ type: "skill";
5012
+ name: string;
5013
+ description?: string | undefined;
5014
+ } | {
5015
+ type: "web_search";
5016
+ query?: string | undefined;
5017
+ } | {
5018
+ type: "image_generation";
5019
+ prompt?: string | undefined;
5020
+ } | {
5021
+ type: "compaction";
5022
+ } | {
5023
+ type: "review";
5024
+ phase: "started" | "finished";
5025
+ } | {
5026
+ type: "question";
5027
+ text: string;
5028
+ more?: number | undefined;
5029
+ } | undefined;
5030
+ parentToolCallId?: string | undefined;
3440
5031
  content?: ({
3441
5032
  type: "content";
3442
5033
  content: {
3443
5034
  type: "text";
3444
5035
  text: string;
3445
5036
  } | {
3446
- type: "image";
3447
5037
  mimeType: string;
5038
+ type: "image";
3448
5039
  data?: string | undefined;
3449
5040
  uri?: string | undefined;
3450
5041
  } | {
3451
5042
  type: "resource_link";
3452
- uri: string;
3453
5043
  name: string;
3454
- kind?: "file" | "skill" | "agent" | undefined;
5044
+ uri: string;
5045
+ kind?: "agent" | "file" | "skill" | undefined;
3455
5046
  };
3456
5047
  } | {
3457
- type: "diff";
3458
5048
  path: string;
5049
+ type: "diff";
3459
5050
  newText: string;
3460
5051
  oldText?: string | null | undefined;
3461
5052
  } | {
3462
- type: "patch";
3463
5053
  path: string;
5054
+ type: "patch";
3464
5055
  diff: string;
3465
- change: "add" | "delete" | "update";
5056
+ change: "delete" | "add" | "update";
3466
5057
  movePath?: string | undefined;
3467
5058
  } | {
3468
5059
  type: "terminal";
3469
5060
  terminalId: string;
3470
5061
  })[] | undefined;
3471
- parentToolCallId?: string | undefined;
3472
5062
  rawInput?: unknown;
3473
5063
  locations?: {
3474
5064
  path: string;
3475
5065
  line?: number | undefined;
3476
5066
  }[] | undefined;
5067
+ } | {
5068
+ toolCallId: string;
5069
+ sessionUpdate: "tool_call_update";
5070
+ status?: "completed" | "failed" | "pending" | "in_progress" | undefined;
5071
+ title?: string | undefined;
3477
5072
  detail?: {
3478
5073
  type: "mcp";
3479
- server: string;
3480
5074
  tool: string;
5075
+ server: string;
3481
5076
  } | {
3482
5077
  type: "subagent";
3483
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
5078
+ action?: "message" | "resume" | "spawn" | "wait" | "stop" | "list" | undefined;
5079
+ state?: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending" | undefined;
5080
+ model?: string | undefined;
3484
5081
  task?: string | undefined;
3485
5082
  agentType?: string | undefined;
3486
- model?: string | undefined;
5083
+ workflow?: {
5084
+ completed?: number | undefined;
5085
+ state?: "paused" | "running" | "completed" | "failed" | "stopped" | undefined;
5086
+ tokens?: number | undefined;
5087
+ durationMs?: number | undefined;
5088
+ startedAt?: number | undefined;
5089
+ endedAt?: number | undefined;
5090
+ runId?: string | undefined;
5091
+ name?: string | undefined;
5092
+ started?: number | undefined;
5093
+ phases?: {
5094
+ id: string;
5095
+ title: string;
5096
+ order: number;
5097
+ }[] | undefined;
5098
+ agents?: {
5099
+ id: string;
5100
+ title: string;
5101
+ state: "unknown" | "paused" | "running" | "completed" | "failed" | "stopped" | "pending";
5102
+ toolCallId?: string | undefined;
5103
+ phaseId?: string | undefined;
5104
+ model?: string | undefined;
5105
+ tokens?: number | undefined;
5106
+ toolCalls?: number | undefined;
5107
+ durationMs?: number | undefined;
5108
+ startedAt?: number | undefined;
5109
+ endedAt?: number | undefined;
5110
+ result?: string | undefined;
5111
+ }[] | undefined;
5112
+ } | undefined;
3487
5113
  } | {
3488
5114
  type: "skill";
3489
5115
  name: string;
@@ -3504,82 +5130,58 @@ export declare const sessionEventSchema: z.ZodObject<{
3504
5130
  text: string;
3505
5131
  more?: number | undefined;
3506
5132
  } | undefined;
3507
- } | {
3508
- sessionUpdate: "tool_call_update";
3509
- toolCallId: string;
3510
- status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
5133
+ parentToolCallId?: string | undefined;
3511
5134
  content?: ({
3512
5135
  type: "content";
3513
5136
  content: {
3514
5137
  type: "text";
3515
5138
  text: string;
3516
5139
  } | {
3517
- type: "image";
3518
5140
  mimeType: string;
5141
+ type: "image";
3519
5142
  data?: string | undefined;
3520
5143
  uri?: string | undefined;
3521
5144
  } | {
3522
5145
  type: "resource_link";
3523
- uri: string;
3524
5146
  name: string;
3525
- kind?: "file" | "skill" | "agent" | undefined;
5147
+ uri: string;
5148
+ kind?: "agent" | "file" | "skill" | undefined;
3526
5149
  };
3527
5150
  } | {
3528
- type: "diff";
3529
5151
  path: string;
5152
+ type: "diff";
3530
5153
  newText: string;
3531
5154
  oldText?: string | null | undefined;
3532
5155
  } | {
3533
- type: "patch";
3534
5156
  path: string;
5157
+ type: "patch";
3535
5158
  diff: string;
3536
- change: "add" | "delete" | "update";
5159
+ change: "delete" | "add" | "update";
3537
5160
  movePath?: string | undefined;
3538
5161
  } | {
3539
5162
  type: "terminal";
3540
5163
  terminalId: string;
3541
5164
  })[] | undefined;
3542
- parentToolCallId?: string | undefined;
3543
- title?: string | undefined;
3544
- detail?: {
3545
- type: "mcp";
3546
- server: string;
3547
- tool: string;
3548
- } | {
3549
- type: "subagent";
3550
- action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
3551
- task?: string | undefined;
3552
- agentType?: string | undefined;
3553
- model?: string | undefined;
3554
- } | {
3555
- type: "skill";
3556
- name: string;
3557
- description?: string | undefined;
3558
- } | {
3559
- type: "web_search";
3560
- query?: string | undefined;
3561
- } | {
3562
- type: "image_generation";
3563
- prompt?: string | undefined;
3564
- } | {
3565
- type: "compaction";
3566
- } | {
3567
- type: "review";
3568
- phase: "started" | "finished";
3569
- } | {
3570
- type: "question";
3571
- text: string;
3572
- more?: number | undefined;
3573
- } | undefined;
3574
5165
  appendOutput?: string | undefined;
3575
5166
  rawOutput?: unknown;
3576
5167
  } | {
3577
5168
  entries: {
3578
- status: "pending" | "in_progress" | "completed";
5169
+ status: "completed" | "pending" | "in_progress";
3579
5170
  content: string;
3580
5171
  priority?: "high" | "medium" | "low" | undefined;
3581
5172
  }[];
3582
5173
  sessionUpdate: "plan";
5174
+ } | {
5175
+ sessionUpdate: "ls_goal";
5176
+ goal: {
5177
+ status: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
5178
+ objective: string;
5179
+ tokenBudget?: number | null | undefined;
5180
+ tokensUsed?: number | undefined;
5181
+ timeUsedSeconds?: number | undefined;
5182
+ iterations?: number | undefined;
5183
+ lastReason?: string | null | undefined;
5184
+ } | null;
3583
5185
  } | {
3584
5186
  sessionUpdate: "available_commands_update";
3585
5187
  availableCommands: {
@@ -3592,8 +5194,8 @@ export declare const sessionEventSchema: z.ZodObject<{
3592
5194
  currentModeId: string;
3593
5195
  } | {
3594
5196
  sessionUpdate: "session_info_update";
3595
- model?: string | undefined;
3596
5197
  title?: string | undefined;
5198
+ model?: string | undefined;
3597
5199
  } | {
3598
5200
  sessionUpdate: "usage_update";
3599
5201
  usedTokens?: number | undefined;
@@ -3605,43 +5207,43 @@ export declare const sessionEventSchema: z.ZodObject<{
3605
5207
  parentToolCallId?: string | undefined;
3606
5208
  } | {
3607
5209
  options: {
5210
+ id: string;
3608
5211
  values: {
3609
5212
  value: string;
3610
5213
  name: string;
3611
5214
  description?: string | undefined;
3612
5215
  }[];
3613
5216
  name: string;
3614
- id: string;
3615
5217
  current: string;
3616
- category?: "model" | "mode" | "effort" | "other" | undefined;
5218
+ category?: "model" | "other" | "mode" | "effort" | undefined;
3617
5219
  }[];
3618
5220
  sessionUpdate: "ls_config";
3619
5221
  } | {
3620
- sessionUpdate: "ls_notice";
3621
5222
  title: string;
5223
+ sessionUpdate: "ls_notice";
3622
5224
  level: "info" | "warning";
3623
5225
  detail?: string | undefined;
3624
5226
  } | {
3625
- sessionUpdate: "ls_turn";
3626
5227
  state: "started" | "ended";
5228
+ sessionUpdate: "ls_turn";
3627
5229
  parentToolCallId?: string | undefined;
3628
5230
  turnId?: string | undefined;
3629
- stopReason?: "end_turn" | "cancelled" | "error" | "max_tokens" | "refusal" | undefined;
5231
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
3630
5232
  } | {
3631
5233
  options: {
3632
5234
  name: string;
3633
- kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3634
5235
  optionId: string;
5236
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3635
5237
  }[];
3636
- sessionUpdate: "ls_permission";
3637
5238
  title: string;
3638
5239
  requestId: string;
5240
+ sessionUpdate: "ls_permission";
3639
5241
  toolCallId?: string | undefined;
3640
5242
  detail?: string | undefined;
3641
5243
  questions?: {
3642
- text: string;
3643
- kind: "text" | "choice" | "choices";
3644
5244
  id: string;
5245
+ kind: "text" | "choice" | "choices";
5246
+ text: string;
3645
5247
  options?: {
3646
5248
  value: string;
3647
5249
  label: string;
@@ -3653,21 +5255,38 @@ export declare const sessionEventSchema: z.ZodObject<{
3653
5255
  required?: boolean | undefined;
3654
5256
  }[] | undefined;
3655
5257
  } | {
3656
- sessionUpdate: "ls_permission_resolved";
3657
5258
  requestId: string;
5259
+ sessionUpdate: "ls_permission_resolved";
3658
5260
  optionId?: string | undefined;
3659
5261
  answers?: {
3660
- values: string[];
3661
5262
  id: string;
5263
+ values: string[];
3662
5264
  other?: string | undefined;
3663
5265
  }[] | undefined;
3664
5266
  } | {
5267
+ driver: "remote" | "desktop" | "none";
3665
5268
  sessionUpdate: "ls_driver";
3666
- driver: "desktop" | "remote" | "none";
3667
5269
  deviceId?: string | undefined;
3668
5270
  } | {
5271
+ state: "error" | "running" | "idle" | "waiting" | "offline";
3669
5272
  sessionUpdate: "ls_status";
3670
- state: "error" | "idle" | "running" | "waiting" | "offline";
5273
+ } | {
5274
+ task: {
5275
+ id: string;
5276
+ title: string;
5277
+ state: "unknown" | "running" | "completed" | "failed" | "stopped";
5278
+ startedAt: number;
5279
+ kind: "shell" | "monitor";
5280
+ toolCallId?: string | undefined;
5281
+ endedAt?: number | undefined;
5282
+ lastSeq?: number | undefined;
5283
+ command?: string | undefined;
5284
+ summary?: string | undefined;
5285
+ exitCode?: number | undefined;
5286
+ output?: boolean | undefined;
5287
+ canStop?: boolean | undefined;
5288
+ };
5289
+ sessionUpdate: "ls_task";
3671
5290
  } | {
3672
5291
  code: string;
3673
5292
  message: string;