@linkshell/wire 0.0.0-stage → 0.1.1

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/rpc.d.ts ADDED
@@ -0,0 +1,4835 @@
1
+ import { z } from "zod";
2
+ export declare const rpcIdSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
3
+ export type RpcId = z.infer<typeof rpcIdSchema>;
4
+ export declare const rpcErrorSchema: z.ZodObject<{
5
+ code: z.ZodNumber;
6
+ message: z.ZodString;
7
+ data: z.ZodOptional<z.ZodUnknown>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ code: number;
10
+ message: string;
11
+ data?: unknown;
12
+ }, {
13
+ code: number;
14
+ message: string;
15
+ data?: unknown;
16
+ }>;
17
+ export type RpcErrorObject = z.infer<typeof rpcErrorSchema>;
18
+ export declare const rpcMessageSchema: z.ZodObject<{
19
+ jsonrpc: z.ZodLiteral<"2.0">;
20
+ id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
21
+ method: z.ZodOptional<z.ZodString>;
22
+ params: z.ZodOptional<z.ZodUnknown>;
23
+ result: z.ZodOptional<z.ZodUnknown>;
24
+ error: z.ZodOptional<z.ZodObject<{
25
+ code: z.ZodNumber;
26
+ message: z.ZodString;
27
+ data: z.ZodOptional<z.ZodUnknown>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ code: number;
30
+ message: string;
31
+ data?: unknown;
32
+ }, {
33
+ code: number;
34
+ message: string;
35
+ data?: unknown;
36
+ }>>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ jsonrpc: "2.0";
39
+ params?: unknown;
40
+ method?: string | undefined;
41
+ id?: string | number | undefined;
42
+ error?: {
43
+ code: number;
44
+ message: string;
45
+ data?: unknown;
46
+ } | undefined;
47
+ result?: unknown;
48
+ }, {
49
+ jsonrpc: "2.0";
50
+ params?: unknown;
51
+ method?: string | undefined;
52
+ id?: string | number | undefined;
53
+ error?: {
54
+ code: number;
55
+ message: string;
56
+ data?: unknown;
57
+ } | undefined;
58
+ result?: unknown;
59
+ }>;
60
+ export type RpcMessage = z.infer<typeof rpcMessageSchema>;
61
+ /** Application error codes carried in `error.data.code`. */
62
+ export declare const appErrorCodeSchema: z.ZodEnum<["invalid_params", "not_found", "agent_unavailable", "not_supported", "not_ready", "busy", "offline", "internal"]>;
63
+ export type AppErrorCode = z.infer<typeof appErrorCodeSchema>;
64
+ export declare const RPC_INVALID_PARAMS = -32602;
65
+ export declare const RPC_METHOD_NOT_FOUND = -32601;
66
+ export declare const RPC_APP_ERROR = -32000;
67
+ export declare const directoryEntrySchema: z.ZodObject<{
68
+ name: z.ZodString;
69
+ path: z.ZodString;
70
+ /** Looks like a code project (has .git, package.json, …). */
71
+ project: z.ZodOptional<z.ZodBoolean>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ path: string;
74
+ name: string;
75
+ project?: boolean | undefined;
76
+ }, {
77
+ path: string;
78
+ name: string;
79
+ project?: boolean | undefined;
80
+ }>;
81
+ export type DirectoryEntry = z.infer<typeof directoryEntrySchema>;
82
+ export declare const methods: {
83
+ readonly "machine.info": {
84
+ readonly params: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
85
+ readonly result: z.ZodObject<{
86
+ machineId: z.ZodString;
87
+ hostname: z.ZodString;
88
+ platform: z.ZodString;
89
+ hostVersion: z.ZodString;
90
+ home: z.ZodOptional<z.ZodString>;
91
+ agents: z.ZodArray<z.ZodObject<{
92
+ id: z.ZodString;
93
+ label: z.ZodString;
94
+ tier: z.ZodEnum<["multi_client", "handoff", "remote", "terminal"]>;
95
+ installed: z.ZodBoolean;
96
+ version: z.ZodOptional<z.ZodString>;
97
+ problem: z.ZodOptional<z.ZodString>;
98
+ auth: z.ZodOptional<z.ZodObject<{
99
+ state: z.ZodEnum<["ok", "missing", "unknown"]>;
100
+ method: z.ZodOptional<z.ZodString>;
101
+ hint: z.ZodOptional<z.ZodString>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ state: "unknown" | "ok" | "missing";
104
+ method?: string | undefined;
105
+ hint?: string | undefined;
106
+ }, {
107
+ state: "unknown" | "ok" | "missing";
108
+ method?: string | undefined;
109
+ hint?: string | undefined;
110
+ }>>;
111
+ capabilities: z.ZodObject<{
112
+ interrupt: z.ZodBoolean;
113
+ steer: z.ZodBoolean;
114
+ permissions: z.ZodBoolean;
115
+ images: z.ZodBoolean;
116
+ fork: z.ZodBoolean;
117
+ models: z.ZodBoolean;
118
+ modes: z.ZodBoolean;
119
+ }, "strip", z.ZodTypeAny, {
120
+ interrupt: boolean;
121
+ steer: boolean;
122
+ permissions: boolean;
123
+ images: boolean;
124
+ fork: boolean;
125
+ models: boolean;
126
+ modes: boolean;
127
+ }, {
128
+ interrupt: boolean;
129
+ steer: boolean;
130
+ permissions: boolean;
131
+ images: boolean;
132
+ fork: boolean;
133
+ models: boolean;
134
+ modes: boolean;
135
+ }>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ id: string;
138
+ label: string;
139
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
140
+ installed: boolean;
141
+ capabilities: {
142
+ interrupt: boolean;
143
+ steer: boolean;
144
+ permissions: boolean;
145
+ images: boolean;
146
+ fork: boolean;
147
+ models: boolean;
148
+ modes: boolean;
149
+ };
150
+ version?: string | undefined;
151
+ problem?: string | undefined;
152
+ auth?: {
153
+ state: "unknown" | "ok" | "missing";
154
+ method?: string | undefined;
155
+ hint?: string | undefined;
156
+ } | undefined;
157
+ }, {
158
+ id: string;
159
+ label: string;
160
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
161
+ installed: boolean;
162
+ capabilities: {
163
+ interrupt: boolean;
164
+ steer: boolean;
165
+ permissions: boolean;
166
+ images: boolean;
167
+ fork: boolean;
168
+ models: boolean;
169
+ modes: boolean;
170
+ };
171
+ version?: string | undefined;
172
+ problem?: string | undefined;
173
+ auth?: {
174
+ state: "unknown" | "ok" | "missing";
175
+ method?: string | undefined;
176
+ hint?: string | undefined;
177
+ } | undefined;
178
+ }>, "many">;
179
+ }, "strip", z.ZodTypeAny, {
180
+ machineId: string;
181
+ hostname: string;
182
+ platform: string;
183
+ hostVersion: string;
184
+ agents: {
185
+ id: string;
186
+ label: string;
187
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
188
+ installed: boolean;
189
+ capabilities: {
190
+ interrupt: boolean;
191
+ steer: boolean;
192
+ permissions: boolean;
193
+ images: boolean;
194
+ fork: boolean;
195
+ models: boolean;
196
+ modes: boolean;
197
+ };
198
+ version?: string | undefined;
199
+ problem?: string | undefined;
200
+ auth?: {
201
+ state: "unknown" | "ok" | "missing";
202
+ method?: string | undefined;
203
+ hint?: string | undefined;
204
+ } | undefined;
205
+ }[];
206
+ home?: string | undefined;
207
+ }, {
208
+ machineId: string;
209
+ hostname: string;
210
+ platform: string;
211
+ hostVersion: string;
212
+ agents: {
213
+ id: string;
214
+ label: string;
215
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
216
+ installed: boolean;
217
+ capabilities: {
218
+ interrupt: boolean;
219
+ steer: boolean;
220
+ permissions: boolean;
221
+ images: boolean;
222
+ fork: boolean;
223
+ models: boolean;
224
+ modes: boolean;
225
+ };
226
+ version?: string | undefined;
227
+ problem?: string | undefined;
228
+ auth?: {
229
+ state: "unknown" | "ok" | "missing";
230
+ method?: string | undefined;
231
+ hint?: string | undefined;
232
+ } | undefined;
233
+ }[];
234
+ home?: string | undefined;
235
+ }>;
236
+ };
237
+ readonly "projects.list": {
238
+ readonly params: z.ZodObject<{
239
+ limit: z.ZodOptional<z.ZodNumber>;
240
+ }, "strip", z.ZodTypeAny, {
241
+ limit?: number | undefined;
242
+ }, {
243
+ limit?: number | undefined;
244
+ }>;
245
+ readonly result: z.ZodObject<{
246
+ projects: z.ZodArray<z.ZodObject<{
247
+ cwd: z.ZodString;
248
+ name: z.ZodString;
249
+ lastActiveAt: z.ZodNumber;
250
+ sessionCount: z.ZodNumber;
251
+ }, "strip", z.ZodTypeAny, {
252
+ name: string;
253
+ cwd: string;
254
+ lastActiveAt: number;
255
+ sessionCount: number;
256
+ }, {
257
+ name: string;
258
+ cwd: string;
259
+ lastActiveAt: number;
260
+ sessionCount: number;
261
+ }>, "many">;
262
+ }, "strip", z.ZodTypeAny, {
263
+ projects: {
264
+ name: string;
265
+ cwd: string;
266
+ lastActiveAt: number;
267
+ sessionCount: number;
268
+ }[];
269
+ }, {
270
+ projects: {
271
+ name: string;
272
+ cwd: string;
273
+ lastActiveAt: number;
274
+ sessionCount: number;
275
+ }[];
276
+ }>;
277
+ };
278
+ readonly "sessions.list": {
279
+ readonly params: z.ZodObject<{
280
+ limit: z.ZodOptional<z.ZodNumber>;
281
+ /** Only sessions updated strictly before this timestamp (pagination). */
282
+ before: z.ZodOptional<z.ZodNumber>;
283
+ includeArchived: z.ZodOptional<z.ZodBoolean>;
284
+ }, "strip", z.ZodTypeAny, {
285
+ limit?: number | undefined;
286
+ before?: number | undefined;
287
+ includeArchived?: boolean | undefined;
288
+ }, {
289
+ limit?: number | undefined;
290
+ before?: number | undefined;
291
+ includeArchived?: boolean | undefined;
292
+ }>;
293
+ readonly result: z.ZodObject<{
294
+ sessions: z.ZodArray<z.ZodObject<{
295
+ id: z.ZodString;
296
+ agent: z.ZodString;
297
+ nativeId: z.ZodString;
298
+ title: z.ZodOptional<z.ZodString>;
299
+ preview: z.ZodOptional<z.ZodString>;
300
+ cwd: z.ZodString;
301
+ state: z.ZodEnum<["idle", "running", "waiting", "error", "offline"]>;
302
+ driver: z.ZodOptional<z.ZodEnum<["desktop", "remote", "none"]>>;
303
+ pendingPermissions: z.ZodNumber;
304
+ model: z.ZodOptional<z.ZodString>;
305
+ createdAt: z.ZodNumber;
306
+ updatedAt: z.ZodNumber;
307
+ lastSeq: z.ZodNumber;
308
+ archived: z.ZodBoolean;
309
+ activity: z.ZodOptional<z.ZodObject<{
310
+ kind: z.ZodEnum<["thinking", "responding", "tool"]>;
311
+ title: z.ZodOptional<z.ZodString>;
312
+ toolKind: z.ZodOptional<z.ZodEnum<["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]>>;
313
+ }, "strip", z.ZodTypeAny, {
314
+ kind: "thinking" | "responding" | "tool";
315
+ title?: string | undefined;
316
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
317
+ }, {
318
+ kind: "thinking" | "responding" | "tool";
319
+ title?: string | undefined;
320
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
321
+ }>>;
322
+ permission: z.ZodOptional<z.ZodObject<{
323
+ requestId: z.ZodString;
324
+ toolCallId: z.ZodOptional<z.ZodString>;
325
+ title: z.ZodString;
326
+ detail: z.ZodOptional<z.ZodString>;
327
+ options: z.ZodArray<z.ZodObject<{
328
+ optionId: z.ZodString;
329
+ name: z.ZodString;
330
+ kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
331
+ }, "strip", z.ZodTypeAny, {
332
+ optionId: string;
333
+ name: string;
334
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
335
+ }, {
336
+ optionId: string;
337
+ name: string;
338
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
339
+ }>, "many">;
340
+ }, "strip", z.ZodTypeAny, {
341
+ options: {
342
+ optionId: string;
343
+ name: string;
344
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
345
+ }[];
346
+ title: string;
347
+ requestId: string;
348
+ toolCallId?: string | undefined;
349
+ detail?: string | undefined;
350
+ }, {
351
+ options: {
352
+ optionId: string;
353
+ name: string;
354
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
355
+ }[];
356
+ title: string;
357
+ requestId: string;
358
+ toolCallId?: string | undefined;
359
+ detail?: string | undefined;
360
+ }>>;
361
+ queue: z.ZodOptional<z.ZodArray<z.ZodObject<{
362
+ clientMessageId: z.ZodString;
363
+ text: z.ZodString;
364
+ images: z.ZodNumber;
365
+ }, "strip", z.ZodTypeAny, {
366
+ images: number;
367
+ clientMessageId: string;
368
+ text: string;
369
+ }, {
370
+ images: number;
371
+ clientMessageId: string;
372
+ text: string;
373
+ }>, "many">>;
374
+ }, "strip", z.ZodTypeAny, {
375
+ state: "idle" | "running" | "waiting" | "error" | "offline";
376
+ id: string;
377
+ agent: string;
378
+ nativeId: string;
379
+ cwd: string;
380
+ pendingPermissions: number;
381
+ createdAt: number;
382
+ updatedAt: number;
383
+ lastSeq: number;
384
+ archived: boolean;
385
+ title?: string | undefined;
386
+ preview?: string | undefined;
387
+ driver?: "remote" | "desktop" | "none" | undefined;
388
+ model?: string | undefined;
389
+ activity?: {
390
+ kind: "thinking" | "responding" | "tool";
391
+ title?: string | undefined;
392
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
393
+ } | undefined;
394
+ permission?: {
395
+ options: {
396
+ optionId: string;
397
+ name: string;
398
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
399
+ }[];
400
+ title: string;
401
+ requestId: string;
402
+ toolCallId?: string | undefined;
403
+ detail?: string | undefined;
404
+ } | undefined;
405
+ queue?: {
406
+ images: number;
407
+ clientMessageId: string;
408
+ text: string;
409
+ }[] | undefined;
410
+ }, {
411
+ state: "idle" | "running" | "waiting" | "error" | "offline";
412
+ id: string;
413
+ agent: string;
414
+ nativeId: string;
415
+ cwd: string;
416
+ pendingPermissions: number;
417
+ createdAt: number;
418
+ updatedAt: number;
419
+ lastSeq: number;
420
+ archived: boolean;
421
+ title?: string | undefined;
422
+ preview?: string | undefined;
423
+ driver?: "remote" | "desktop" | "none" | undefined;
424
+ model?: string | undefined;
425
+ activity?: {
426
+ kind: "thinking" | "responding" | "tool";
427
+ title?: string | undefined;
428
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
429
+ } | undefined;
430
+ permission?: {
431
+ options: {
432
+ optionId: string;
433
+ name: string;
434
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
435
+ }[];
436
+ title: string;
437
+ requestId: string;
438
+ toolCallId?: string | undefined;
439
+ detail?: string | undefined;
440
+ } | undefined;
441
+ queue?: {
442
+ images: number;
443
+ clientMessageId: string;
444
+ text: string;
445
+ }[] | undefined;
446
+ }>, "many">;
447
+ nextBefore: z.ZodOptional<z.ZodNumber>;
448
+ }, "strip", z.ZodTypeAny, {
449
+ sessions: {
450
+ state: "idle" | "running" | "waiting" | "error" | "offline";
451
+ id: string;
452
+ agent: string;
453
+ nativeId: string;
454
+ cwd: string;
455
+ pendingPermissions: number;
456
+ createdAt: number;
457
+ updatedAt: number;
458
+ lastSeq: number;
459
+ archived: boolean;
460
+ title?: string | undefined;
461
+ preview?: string | undefined;
462
+ driver?: "remote" | "desktop" | "none" | undefined;
463
+ model?: string | undefined;
464
+ activity?: {
465
+ kind: "thinking" | "responding" | "tool";
466
+ title?: string | undefined;
467
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
468
+ } | undefined;
469
+ permission?: {
470
+ options: {
471
+ optionId: string;
472
+ name: string;
473
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
474
+ }[];
475
+ title: string;
476
+ requestId: string;
477
+ toolCallId?: string | undefined;
478
+ detail?: string | undefined;
479
+ } | undefined;
480
+ queue?: {
481
+ images: number;
482
+ clientMessageId: string;
483
+ text: string;
484
+ }[] | undefined;
485
+ }[];
486
+ nextBefore?: number | undefined;
487
+ }, {
488
+ sessions: {
489
+ state: "idle" | "running" | "waiting" | "error" | "offline";
490
+ id: string;
491
+ agent: string;
492
+ nativeId: string;
493
+ cwd: string;
494
+ pendingPermissions: number;
495
+ createdAt: number;
496
+ updatedAt: number;
497
+ lastSeq: number;
498
+ archived: boolean;
499
+ title?: string | undefined;
500
+ preview?: string | undefined;
501
+ driver?: "remote" | "desktop" | "none" | undefined;
502
+ model?: string | undefined;
503
+ activity?: {
504
+ kind: "thinking" | "responding" | "tool";
505
+ title?: string | undefined;
506
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
507
+ } | undefined;
508
+ permission?: {
509
+ options: {
510
+ optionId: string;
511
+ name: string;
512
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
513
+ }[];
514
+ title: string;
515
+ requestId: string;
516
+ toolCallId?: string | undefined;
517
+ detail?: string | undefined;
518
+ } | undefined;
519
+ queue?: {
520
+ images: number;
521
+ clientMessageId: string;
522
+ text: string;
523
+ }[] | undefined;
524
+ }[];
525
+ nextBefore?: number | undefined;
526
+ }>;
527
+ };
528
+ readonly "sessions.create": {
529
+ readonly params: z.ZodObject<{
530
+ agent: z.ZodString;
531
+ cwd: z.ZodString;
532
+ prompt: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
533
+ type: z.ZodLiteral<"text">;
534
+ text: z.ZodString;
535
+ }, "strip", z.ZodTypeAny, {
536
+ type: "text";
537
+ text: string;
538
+ }, {
539
+ type: "text";
540
+ text: string;
541
+ }>, z.ZodObject<{
542
+ type: z.ZodLiteral<"image">;
543
+ mimeType: z.ZodString;
544
+ data: z.ZodOptional<z.ZodString>;
545
+ uri: z.ZodOptional<z.ZodString>;
546
+ }, "strip", z.ZodTypeAny, {
547
+ type: "image";
548
+ mimeType: string;
549
+ data?: string | undefined;
550
+ uri?: string | undefined;
551
+ }, {
552
+ type: "image";
553
+ mimeType: string;
554
+ data?: string | undefined;
555
+ uri?: string | undefined;
556
+ }>, z.ZodObject<{
557
+ type: z.ZodLiteral<"resource_link">;
558
+ uri: z.ZodString;
559
+ name: z.ZodString;
560
+ kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
561
+ }, "strip", z.ZodTypeAny, {
562
+ type: "resource_link";
563
+ name: string;
564
+ uri: string;
565
+ kind?: "agent" | "file" | "skill" | undefined;
566
+ }, {
567
+ type: "resource_link";
568
+ name: string;
569
+ uri: string;
570
+ kind?: "agent" | "file" | "skill" | undefined;
571
+ }>]>, "many">>;
572
+ clientMessageId: z.ZodOptional<z.ZodString>;
573
+ model: z.ZodOptional<z.ZodString>;
574
+ }, "strip", z.ZodTypeAny, {
575
+ agent: string;
576
+ cwd: string;
577
+ clientMessageId?: string | undefined;
578
+ model?: string | undefined;
579
+ prompt?: ({
580
+ type: "text";
581
+ text: string;
582
+ } | {
583
+ type: "image";
584
+ mimeType: string;
585
+ data?: string | undefined;
586
+ uri?: string | undefined;
587
+ } | {
588
+ type: "resource_link";
589
+ name: string;
590
+ uri: string;
591
+ kind?: "agent" | "file" | "skill" | undefined;
592
+ })[] | undefined;
593
+ }, {
594
+ agent: string;
595
+ cwd: string;
596
+ clientMessageId?: string | undefined;
597
+ model?: string | undefined;
598
+ prompt?: ({
599
+ type: "text";
600
+ text: string;
601
+ } | {
602
+ type: "image";
603
+ mimeType: string;
604
+ data?: string | undefined;
605
+ uri?: string | undefined;
606
+ } | {
607
+ type: "resource_link";
608
+ name: string;
609
+ uri: string;
610
+ kind?: "agent" | "file" | "skill" | undefined;
611
+ })[] | undefined;
612
+ }>;
613
+ readonly result: z.ZodObject<{
614
+ session: z.ZodObject<{
615
+ id: z.ZodString;
616
+ agent: z.ZodString;
617
+ nativeId: z.ZodString;
618
+ title: z.ZodOptional<z.ZodString>;
619
+ preview: z.ZodOptional<z.ZodString>;
620
+ cwd: z.ZodString;
621
+ state: z.ZodEnum<["idle", "running", "waiting", "error", "offline"]>;
622
+ driver: z.ZodOptional<z.ZodEnum<["desktop", "remote", "none"]>>;
623
+ pendingPermissions: z.ZodNumber;
624
+ model: z.ZodOptional<z.ZodString>;
625
+ createdAt: z.ZodNumber;
626
+ updatedAt: z.ZodNumber;
627
+ lastSeq: z.ZodNumber;
628
+ archived: z.ZodBoolean;
629
+ activity: z.ZodOptional<z.ZodObject<{
630
+ kind: z.ZodEnum<["thinking", "responding", "tool"]>;
631
+ title: z.ZodOptional<z.ZodString>;
632
+ toolKind: z.ZodOptional<z.ZodEnum<["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]>>;
633
+ }, "strip", z.ZodTypeAny, {
634
+ kind: "thinking" | "responding" | "tool";
635
+ title?: string | undefined;
636
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
637
+ }, {
638
+ kind: "thinking" | "responding" | "tool";
639
+ title?: string | undefined;
640
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
641
+ }>>;
642
+ permission: z.ZodOptional<z.ZodObject<{
643
+ requestId: z.ZodString;
644
+ toolCallId: z.ZodOptional<z.ZodString>;
645
+ title: z.ZodString;
646
+ detail: z.ZodOptional<z.ZodString>;
647
+ options: z.ZodArray<z.ZodObject<{
648
+ optionId: z.ZodString;
649
+ name: z.ZodString;
650
+ kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
651
+ }, "strip", z.ZodTypeAny, {
652
+ optionId: string;
653
+ name: string;
654
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
655
+ }, {
656
+ optionId: string;
657
+ name: string;
658
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
659
+ }>, "many">;
660
+ }, "strip", z.ZodTypeAny, {
661
+ options: {
662
+ optionId: string;
663
+ name: string;
664
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
665
+ }[];
666
+ title: string;
667
+ requestId: string;
668
+ toolCallId?: string | undefined;
669
+ detail?: string | undefined;
670
+ }, {
671
+ options: {
672
+ optionId: string;
673
+ name: string;
674
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
675
+ }[];
676
+ title: string;
677
+ requestId: string;
678
+ toolCallId?: string | undefined;
679
+ detail?: string | undefined;
680
+ }>>;
681
+ queue: z.ZodOptional<z.ZodArray<z.ZodObject<{
682
+ clientMessageId: z.ZodString;
683
+ text: z.ZodString;
684
+ images: z.ZodNumber;
685
+ }, "strip", z.ZodTypeAny, {
686
+ images: number;
687
+ clientMessageId: string;
688
+ text: string;
689
+ }, {
690
+ images: number;
691
+ clientMessageId: string;
692
+ text: string;
693
+ }>, "many">>;
694
+ }, "strip", z.ZodTypeAny, {
695
+ state: "idle" | "running" | "waiting" | "error" | "offline";
696
+ id: string;
697
+ agent: string;
698
+ nativeId: string;
699
+ cwd: string;
700
+ pendingPermissions: number;
701
+ createdAt: number;
702
+ updatedAt: number;
703
+ lastSeq: number;
704
+ archived: boolean;
705
+ title?: string | undefined;
706
+ preview?: string | undefined;
707
+ driver?: "remote" | "desktop" | "none" | undefined;
708
+ model?: string | undefined;
709
+ activity?: {
710
+ kind: "thinking" | "responding" | "tool";
711
+ title?: string | undefined;
712
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
713
+ } | undefined;
714
+ permission?: {
715
+ options: {
716
+ optionId: string;
717
+ name: string;
718
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
719
+ }[];
720
+ title: string;
721
+ requestId: string;
722
+ toolCallId?: string | undefined;
723
+ detail?: string | undefined;
724
+ } | undefined;
725
+ queue?: {
726
+ images: number;
727
+ clientMessageId: string;
728
+ text: string;
729
+ }[] | undefined;
730
+ }, {
731
+ state: "idle" | "running" | "waiting" | "error" | "offline";
732
+ id: string;
733
+ agent: string;
734
+ nativeId: string;
735
+ cwd: string;
736
+ pendingPermissions: number;
737
+ createdAt: number;
738
+ updatedAt: number;
739
+ lastSeq: number;
740
+ archived: boolean;
741
+ title?: string | undefined;
742
+ preview?: string | undefined;
743
+ driver?: "remote" | "desktop" | "none" | undefined;
744
+ model?: string | undefined;
745
+ activity?: {
746
+ kind: "thinking" | "responding" | "tool";
747
+ title?: string | undefined;
748
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
749
+ } | undefined;
750
+ permission?: {
751
+ options: {
752
+ optionId: string;
753
+ name: string;
754
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
755
+ }[];
756
+ title: string;
757
+ requestId: string;
758
+ toolCallId?: string | undefined;
759
+ detail?: string | undefined;
760
+ } | undefined;
761
+ queue?: {
762
+ images: number;
763
+ clientMessageId: string;
764
+ text: string;
765
+ }[] | undefined;
766
+ }>;
767
+ }, "strip", z.ZodTypeAny, {
768
+ session: {
769
+ state: "idle" | "running" | "waiting" | "error" | "offline";
770
+ id: string;
771
+ agent: string;
772
+ nativeId: string;
773
+ cwd: string;
774
+ pendingPermissions: number;
775
+ createdAt: number;
776
+ updatedAt: number;
777
+ lastSeq: number;
778
+ archived: boolean;
779
+ title?: string | undefined;
780
+ preview?: string | undefined;
781
+ driver?: "remote" | "desktop" | "none" | undefined;
782
+ model?: string | undefined;
783
+ activity?: {
784
+ kind: "thinking" | "responding" | "tool";
785
+ title?: string | undefined;
786
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
787
+ } | undefined;
788
+ permission?: {
789
+ options: {
790
+ optionId: string;
791
+ name: string;
792
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
793
+ }[];
794
+ title: string;
795
+ requestId: string;
796
+ toolCallId?: string | undefined;
797
+ detail?: string | undefined;
798
+ } | undefined;
799
+ queue?: {
800
+ images: number;
801
+ clientMessageId: string;
802
+ text: string;
803
+ }[] | undefined;
804
+ };
805
+ }, {
806
+ session: {
807
+ state: "idle" | "running" | "waiting" | "error" | "offline";
808
+ id: string;
809
+ agent: string;
810
+ nativeId: string;
811
+ cwd: string;
812
+ pendingPermissions: number;
813
+ createdAt: number;
814
+ updatedAt: number;
815
+ lastSeq: number;
816
+ archived: boolean;
817
+ title?: string | undefined;
818
+ preview?: string | undefined;
819
+ driver?: "remote" | "desktop" | "none" | undefined;
820
+ model?: string | undefined;
821
+ activity?: {
822
+ kind: "thinking" | "responding" | "tool";
823
+ title?: string | undefined;
824
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
825
+ } | undefined;
826
+ permission?: {
827
+ options: {
828
+ optionId: string;
829
+ name: string;
830
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
831
+ }[];
832
+ title: string;
833
+ requestId: string;
834
+ toolCallId?: string | undefined;
835
+ detail?: string | undefined;
836
+ } | undefined;
837
+ queue?: {
838
+ images: number;
839
+ clientMessageId: string;
840
+ text: string;
841
+ }[] | undefined;
842
+ };
843
+ }>;
844
+ };
845
+ readonly "sessions.subscribe": {
846
+ readonly params: z.ZodObject<{
847
+ sessionId: z.ZodString;
848
+ /** Last seq the client already has; 0 for a fresh subscription. */
849
+ fromSeq: z.ZodNumber;
850
+ }, "strip", z.ZodTypeAny, {
851
+ sessionId: string;
852
+ fromSeq: number;
853
+ }, {
854
+ sessionId: string;
855
+ fromSeq: number;
856
+ }>;
857
+ readonly result: z.ZodObject<{
858
+ session: z.ZodObject<{
859
+ id: z.ZodString;
860
+ agent: z.ZodString;
861
+ nativeId: z.ZodString;
862
+ title: z.ZodOptional<z.ZodString>;
863
+ preview: z.ZodOptional<z.ZodString>;
864
+ cwd: z.ZodString;
865
+ state: z.ZodEnum<["idle", "running", "waiting", "error", "offline"]>;
866
+ driver: z.ZodOptional<z.ZodEnum<["desktop", "remote", "none"]>>;
867
+ pendingPermissions: z.ZodNumber;
868
+ model: z.ZodOptional<z.ZodString>;
869
+ createdAt: z.ZodNumber;
870
+ updatedAt: z.ZodNumber;
871
+ lastSeq: z.ZodNumber;
872
+ archived: z.ZodBoolean;
873
+ activity: z.ZodOptional<z.ZodObject<{
874
+ kind: z.ZodEnum<["thinking", "responding", "tool"]>;
875
+ title: z.ZodOptional<z.ZodString>;
876
+ toolKind: z.ZodOptional<z.ZodEnum<["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]>>;
877
+ }, "strip", z.ZodTypeAny, {
878
+ kind: "thinking" | "responding" | "tool";
879
+ title?: string | undefined;
880
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
881
+ }, {
882
+ kind: "thinking" | "responding" | "tool";
883
+ title?: string | undefined;
884
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
885
+ }>>;
886
+ permission: z.ZodOptional<z.ZodObject<{
887
+ requestId: z.ZodString;
888
+ toolCallId: z.ZodOptional<z.ZodString>;
889
+ title: z.ZodString;
890
+ detail: z.ZodOptional<z.ZodString>;
891
+ options: z.ZodArray<z.ZodObject<{
892
+ optionId: z.ZodString;
893
+ name: z.ZodString;
894
+ kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
895
+ }, "strip", z.ZodTypeAny, {
896
+ optionId: string;
897
+ name: string;
898
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
899
+ }, {
900
+ optionId: string;
901
+ name: string;
902
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
903
+ }>, "many">;
904
+ }, "strip", z.ZodTypeAny, {
905
+ options: {
906
+ optionId: string;
907
+ name: string;
908
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
909
+ }[];
910
+ title: string;
911
+ requestId: string;
912
+ toolCallId?: string | undefined;
913
+ detail?: string | undefined;
914
+ }, {
915
+ options: {
916
+ optionId: string;
917
+ name: string;
918
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
919
+ }[];
920
+ title: string;
921
+ requestId: string;
922
+ toolCallId?: string | undefined;
923
+ detail?: string | undefined;
924
+ }>>;
925
+ queue: z.ZodOptional<z.ZodArray<z.ZodObject<{
926
+ clientMessageId: z.ZodString;
927
+ text: z.ZodString;
928
+ images: z.ZodNumber;
929
+ }, "strip", z.ZodTypeAny, {
930
+ images: number;
931
+ clientMessageId: string;
932
+ text: string;
933
+ }, {
934
+ images: number;
935
+ clientMessageId: string;
936
+ text: string;
937
+ }>, "many">>;
938
+ }, "strip", z.ZodTypeAny, {
939
+ state: "idle" | "running" | "waiting" | "error" | "offline";
940
+ id: string;
941
+ agent: string;
942
+ nativeId: string;
943
+ cwd: string;
944
+ pendingPermissions: number;
945
+ createdAt: number;
946
+ updatedAt: number;
947
+ lastSeq: number;
948
+ archived: boolean;
949
+ title?: string | undefined;
950
+ preview?: string | undefined;
951
+ driver?: "remote" | "desktop" | "none" | undefined;
952
+ model?: string | undefined;
953
+ activity?: {
954
+ kind: "thinking" | "responding" | "tool";
955
+ title?: string | undefined;
956
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
957
+ } | undefined;
958
+ permission?: {
959
+ options: {
960
+ optionId: string;
961
+ name: string;
962
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
963
+ }[];
964
+ title: string;
965
+ requestId: string;
966
+ toolCallId?: string | undefined;
967
+ detail?: string | undefined;
968
+ } | undefined;
969
+ queue?: {
970
+ images: number;
971
+ clientMessageId: string;
972
+ text: string;
973
+ }[] | undefined;
974
+ }, {
975
+ state: "idle" | "running" | "waiting" | "error" | "offline";
976
+ id: string;
977
+ agent: string;
978
+ nativeId: string;
979
+ cwd: string;
980
+ pendingPermissions: number;
981
+ createdAt: number;
982
+ updatedAt: number;
983
+ lastSeq: number;
984
+ archived: boolean;
985
+ title?: string | undefined;
986
+ preview?: string | undefined;
987
+ driver?: "remote" | "desktop" | "none" | undefined;
988
+ model?: string | undefined;
989
+ activity?: {
990
+ kind: "thinking" | "responding" | "tool";
991
+ title?: string | undefined;
992
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
993
+ } | undefined;
994
+ permission?: {
995
+ options: {
996
+ optionId: string;
997
+ name: string;
998
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
999
+ }[];
1000
+ title: string;
1001
+ requestId: string;
1002
+ toolCallId?: string | undefined;
1003
+ detail?: string | undefined;
1004
+ } | undefined;
1005
+ queue?: {
1006
+ images: number;
1007
+ clientMessageId: string;
1008
+ text: string;
1009
+ }[] | undefined;
1010
+ }>;
1011
+ }, "strip", z.ZodTypeAny, {
1012
+ session: {
1013
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1014
+ id: string;
1015
+ agent: string;
1016
+ nativeId: string;
1017
+ cwd: string;
1018
+ pendingPermissions: number;
1019
+ createdAt: number;
1020
+ updatedAt: number;
1021
+ lastSeq: number;
1022
+ archived: boolean;
1023
+ title?: string | undefined;
1024
+ preview?: string | undefined;
1025
+ driver?: "remote" | "desktop" | "none" | undefined;
1026
+ model?: string | undefined;
1027
+ activity?: {
1028
+ kind: "thinking" | "responding" | "tool";
1029
+ title?: string | undefined;
1030
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1031
+ } | undefined;
1032
+ permission?: {
1033
+ options: {
1034
+ optionId: string;
1035
+ name: string;
1036
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1037
+ }[];
1038
+ title: string;
1039
+ requestId: string;
1040
+ toolCallId?: string | undefined;
1041
+ detail?: string | undefined;
1042
+ } | undefined;
1043
+ queue?: {
1044
+ images: number;
1045
+ clientMessageId: string;
1046
+ text: string;
1047
+ }[] | undefined;
1048
+ };
1049
+ }, {
1050
+ session: {
1051
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1052
+ id: string;
1053
+ agent: string;
1054
+ nativeId: string;
1055
+ cwd: string;
1056
+ pendingPermissions: number;
1057
+ createdAt: number;
1058
+ updatedAt: number;
1059
+ lastSeq: number;
1060
+ archived: boolean;
1061
+ title?: string | undefined;
1062
+ preview?: string | undefined;
1063
+ driver?: "remote" | "desktop" | "none" | undefined;
1064
+ model?: string | undefined;
1065
+ activity?: {
1066
+ kind: "thinking" | "responding" | "tool";
1067
+ title?: string | undefined;
1068
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1069
+ } | undefined;
1070
+ permission?: {
1071
+ options: {
1072
+ optionId: string;
1073
+ name: string;
1074
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1075
+ }[];
1076
+ title: string;
1077
+ requestId: string;
1078
+ toolCallId?: string | undefined;
1079
+ detail?: string | undefined;
1080
+ } | undefined;
1081
+ queue?: {
1082
+ images: number;
1083
+ clientMessageId: string;
1084
+ text: string;
1085
+ }[] | undefined;
1086
+ };
1087
+ }>;
1088
+ };
1089
+ readonly "sessions.unsubscribe": {
1090
+ readonly params: z.ZodObject<{
1091
+ sessionId: z.ZodString;
1092
+ }, "strip", z.ZodTypeAny, {
1093
+ sessionId: string;
1094
+ }, {
1095
+ sessionId: string;
1096
+ }>;
1097
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1098
+ };
1099
+ readonly "sessions.prompt": {
1100
+ readonly params: z.ZodObject<{
1101
+ sessionId: z.ZodString;
1102
+ /** Client-generated idempotency key; a retried send is not delivered twice. */
1103
+ clientMessageId: z.ZodString;
1104
+ content: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1105
+ type: z.ZodLiteral<"text">;
1106
+ text: z.ZodString;
1107
+ }, "strip", z.ZodTypeAny, {
1108
+ type: "text";
1109
+ text: string;
1110
+ }, {
1111
+ type: "text";
1112
+ text: string;
1113
+ }>, z.ZodObject<{
1114
+ type: z.ZodLiteral<"image">;
1115
+ mimeType: z.ZodString;
1116
+ data: z.ZodOptional<z.ZodString>;
1117
+ uri: z.ZodOptional<z.ZodString>;
1118
+ }, "strip", z.ZodTypeAny, {
1119
+ type: "image";
1120
+ mimeType: string;
1121
+ data?: string | undefined;
1122
+ uri?: string | undefined;
1123
+ }, {
1124
+ type: "image";
1125
+ mimeType: string;
1126
+ data?: string | undefined;
1127
+ uri?: string | undefined;
1128
+ }>, z.ZodObject<{
1129
+ type: z.ZodLiteral<"resource_link">;
1130
+ uri: z.ZodString;
1131
+ name: z.ZodString;
1132
+ kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
1133
+ }, "strip", z.ZodTypeAny, {
1134
+ type: "resource_link";
1135
+ name: string;
1136
+ uri: string;
1137
+ kind?: "agent" | "file" | "skill" | undefined;
1138
+ }, {
1139
+ type: "resource_link";
1140
+ name: string;
1141
+ uri: string;
1142
+ kind?: "agent" | "file" | "skill" | undefined;
1143
+ }>]>, "many">;
1144
+ }, "strip", z.ZodTypeAny, {
1145
+ clientMessageId: string;
1146
+ content: ({
1147
+ type: "text";
1148
+ text: string;
1149
+ } | {
1150
+ type: "image";
1151
+ mimeType: string;
1152
+ data?: string | undefined;
1153
+ uri?: string | undefined;
1154
+ } | {
1155
+ type: "resource_link";
1156
+ name: string;
1157
+ uri: string;
1158
+ kind?: "agent" | "file" | "skill" | undefined;
1159
+ })[];
1160
+ sessionId: string;
1161
+ }, {
1162
+ clientMessageId: string;
1163
+ content: ({
1164
+ type: "text";
1165
+ text: string;
1166
+ } | {
1167
+ type: "image";
1168
+ mimeType: string;
1169
+ data?: string | undefined;
1170
+ uri?: string | undefined;
1171
+ } | {
1172
+ type: "resource_link";
1173
+ name: string;
1174
+ uri: string;
1175
+ kind?: "agent" | "file" | "skill" | undefined;
1176
+ })[];
1177
+ sessionId: string;
1178
+ }>;
1179
+ /** queued: the agent can't take input mid-turn; it is sent when the turn ends. */
1180
+ readonly result: z.ZodObject<{
1181
+ delivery: z.ZodEnum<["started", "steered", "queued", "duplicate"]>;
1182
+ }, "strip", z.ZodTypeAny, {
1183
+ delivery: "started" | "steered" | "queued" | "duplicate";
1184
+ }, {
1185
+ delivery: "started" | "steered" | "queued" | "duplicate";
1186
+ }>;
1187
+ };
1188
+ readonly "sessions.cancel": {
1189
+ readonly params: z.ZodObject<{
1190
+ sessionId: z.ZodString;
1191
+ }, "strip", z.ZodTypeAny, {
1192
+ sessionId: string;
1193
+ }, {
1194
+ sessionId: string;
1195
+ }>;
1196
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1197
+ };
1198
+ readonly "sessions.permission": {
1199
+ readonly params: z.ZodObject<{
1200
+ sessionId: z.ZodString;
1201
+ requestId: z.ZodString;
1202
+ optionId: z.ZodString;
1203
+ }, "strip", z.ZodTypeAny, {
1204
+ optionId: string;
1205
+ requestId: string;
1206
+ sessionId: string;
1207
+ }, {
1208
+ optionId: string;
1209
+ requestId: string;
1210
+ sessionId: string;
1211
+ }>;
1212
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1213
+ };
1214
+ readonly "sessions.setConfig": {
1215
+ readonly params: z.ZodObject<{
1216
+ sessionId: z.ZodString;
1217
+ optionId: z.ZodString;
1218
+ value: z.ZodString;
1219
+ }, "strip", z.ZodTypeAny, {
1220
+ value: string;
1221
+ optionId: string;
1222
+ sessionId: string;
1223
+ }, {
1224
+ value: string;
1225
+ optionId: string;
1226
+ sessionId: string;
1227
+ }>;
1228
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1229
+ };
1230
+ /** Drops a message still waiting in the host's queue (see SessionSummary.queue). */
1231
+ readonly "sessions.unqueue": {
1232
+ readonly params: z.ZodObject<{
1233
+ sessionId: z.ZodString;
1234
+ clientMessageId: z.ZodString;
1235
+ }, "strip", z.ZodTypeAny, {
1236
+ clientMessageId: string;
1237
+ sessionId: string;
1238
+ }, {
1239
+ clientMessageId: string;
1240
+ sessionId: string;
1241
+ }>;
1242
+ readonly result: z.ZodObject<{
1243
+ removed: z.ZodBoolean;
1244
+ }, "strip", z.ZodTypeAny, {
1245
+ removed: boolean;
1246
+ }, {
1247
+ removed: boolean;
1248
+ }>;
1249
+ };
1250
+ /** Archives (or restores) a session: hidden from lists, kept on disk; natively where the agent supports it. */
1251
+ readonly "sessions.archive": {
1252
+ readonly params: z.ZodObject<{
1253
+ sessionId: z.ZodString;
1254
+ archived: z.ZodBoolean;
1255
+ }, "strip", z.ZodTypeAny, {
1256
+ archived: boolean;
1257
+ sessionId: string;
1258
+ }, {
1259
+ archived: boolean;
1260
+ sessionId: string;
1261
+ }>;
1262
+ readonly result: z.ZodObject<{
1263
+ session: z.ZodObject<{
1264
+ id: z.ZodString;
1265
+ agent: z.ZodString;
1266
+ nativeId: z.ZodString;
1267
+ title: z.ZodOptional<z.ZodString>;
1268
+ preview: z.ZodOptional<z.ZodString>;
1269
+ cwd: z.ZodString;
1270
+ state: z.ZodEnum<["idle", "running", "waiting", "error", "offline"]>;
1271
+ driver: z.ZodOptional<z.ZodEnum<["desktop", "remote", "none"]>>;
1272
+ pendingPermissions: z.ZodNumber;
1273
+ model: z.ZodOptional<z.ZodString>;
1274
+ createdAt: z.ZodNumber;
1275
+ updatedAt: z.ZodNumber;
1276
+ lastSeq: z.ZodNumber;
1277
+ archived: z.ZodBoolean;
1278
+ activity: z.ZodOptional<z.ZodObject<{
1279
+ kind: z.ZodEnum<["thinking", "responding", "tool"]>;
1280
+ title: z.ZodOptional<z.ZodString>;
1281
+ toolKind: z.ZodOptional<z.ZodEnum<["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]>>;
1282
+ }, "strip", z.ZodTypeAny, {
1283
+ kind: "thinking" | "responding" | "tool";
1284
+ title?: string | undefined;
1285
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1286
+ }, {
1287
+ kind: "thinking" | "responding" | "tool";
1288
+ title?: string | undefined;
1289
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1290
+ }>>;
1291
+ permission: z.ZodOptional<z.ZodObject<{
1292
+ requestId: z.ZodString;
1293
+ toolCallId: z.ZodOptional<z.ZodString>;
1294
+ title: z.ZodString;
1295
+ detail: z.ZodOptional<z.ZodString>;
1296
+ options: z.ZodArray<z.ZodObject<{
1297
+ optionId: z.ZodString;
1298
+ name: z.ZodString;
1299
+ kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
1300
+ }, "strip", z.ZodTypeAny, {
1301
+ optionId: string;
1302
+ name: string;
1303
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1304
+ }, {
1305
+ optionId: string;
1306
+ name: string;
1307
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1308
+ }>, "many">;
1309
+ }, "strip", z.ZodTypeAny, {
1310
+ options: {
1311
+ optionId: string;
1312
+ name: string;
1313
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1314
+ }[];
1315
+ title: string;
1316
+ requestId: string;
1317
+ toolCallId?: string | undefined;
1318
+ detail?: string | undefined;
1319
+ }, {
1320
+ options: {
1321
+ optionId: string;
1322
+ name: string;
1323
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1324
+ }[];
1325
+ title: string;
1326
+ requestId: string;
1327
+ toolCallId?: string | undefined;
1328
+ detail?: string | undefined;
1329
+ }>>;
1330
+ queue: z.ZodOptional<z.ZodArray<z.ZodObject<{
1331
+ clientMessageId: z.ZodString;
1332
+ text: z.ZodString;
1333
+ images: z.ZodNumber;
1334
+ }, "strip", z.ZodTypeAny, {
1335
+ images: number;
1336
+ clientMessageId: string;
1337
+ text: string;
1338
+ }, {
1339
+ images: number;
1340
+ clientMessageId: string;
1341
+ text: string;
1342
+ }>, "many">>;
1343
+ }, "strip", z.ZodTypeAny, {
1344
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1345
+ id: string;
1346
+ agent: string;
1347
+ nativeId: string;
1348
+ cwd: string;
1349
+ pendingPermissions: number;
1350
+ createdAt: number;
1351
+ updatedAt: number;
1352
+ lastSeq: number;
1353
+ archived: boolean;
1354
+ title?: string | undefined;
1355
+ preview?: string | undefined;
1356
+ driver?: "remote" | "desktop" | "none" | undefined;
1357
+ model?: string | undefined;
1358
+ activity?: {
1359
+ kind: "thinking" | "responding" | "tool";
1360
+ title?: string | undefined;
1361
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1362
+ } | undefined;
1363
+ permission?: {
1364
+ options: {
1365
+ optionId: string;
1366
+ name: string;
1367
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1368
+ }[];
1369
+ title: string;
1370
+ requestId: string;
1371
+ toolCallId?: string | undefined;
1372
+ detail?: string | undefined;
1373
+ } | undefined;
1374
+ queue?: {
1375
+ images: number;
1376
+ clientMessageId: string;
1377
+ text: string;
1378
+ }[] | undefined;
1379
+ }, {
1380
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1381
+ id: string;
1382
+ agent: string;
1383
+ nativeId: string;
1384
+ cwd: string;
1385
+ pendingPermissions: number;
1386
+ createdAt: number;
1387
+ updatedAt: number;
1388
+ lastSeq: number;
1389
+ archived: boolean;
1390
+ title?: string | undefined;
1391
+ preview?: string | undefined;
1392
+ driver?: "remote" | "desktop" | "none" | undefined;
1393
+ model?: string | undefined;
1394
+ activity?: {
1395
+ kind: "thinking" | "responding" | "tool";
1396
+ title?: string | undefined;
1397
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1398
+ } | undefined;
1399
+ permission?: {
1400
+ options: {
1401
+ optionId: string;
1402
+ name: string;
1403
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1404
+ }[];
1405
+ title: string;
1406
+ requestId: string;
1407
+ toolCallId?: string | undefined;
1408
+ detail?: string | undefined;
1409
+ } | undefined;
1410
+ queue?: {
1411
+ images: number;
1412
+ clientMessageId: string;
1413
+ text: string;
1414
+ }[] | undefined;
1415
+ }>;
1416
+ }, "strip", z.ZodTypeAny, {
1417
+ session: {
1418
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1419
+ id: string;
1420
+ agent: string;
1421
+ nativeId: string;
1422
+ cwd: string;
1423
+ pendingPermissions: number;
1424
+ createdAt: number;
1425
+ updatedAt: number;
1426
+ lastSeq: number;
1427
+ archived: boolean;
1428
+ title?: string | undefined;
1429
+ preview?: string | undefined;
1430
+ driver?: "remote" | "desktop" | "none" | undefined;
1431
+ model?: string | undefined;
1432
+ activity?: {
1433
+ kind: "thinking" | "responding" | "tool";
1434
+ title?: string | undefined;
1435
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1436
+ } | undefined;
1437
+ permission?: {
1438
+ options: {
1439
+ optionId: string;
1440
+ name: string;
1441
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1442
+ }[];
1443
+ title: string;
1444
+ requestId: string;
1445
+ toolCallId?: string | undefined;
1446
+ detail?: string | undefined;
1447
+ } | undefined;
1448
+ queue?: {
1449
+ images: number;
1450
+ clientMessageId: string;
1451
+ text: string;
1452
+ }[] | undefined;
1453
+ };
1454
+ }, {
1455
+ session: {
1456
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1457
+ id: string;
1458
+ agent: string;
1459
+ nativeId: string;
1460
+ cwd: string;
1461
+ pendingPermissions: number;
1462
+ createdAt: number;
1463
+ updatedAt: number;
1464
+ lastSeq: number;
1465
+ archived: boolean;
1466
+ title?: string | undefined;
1467
+ preview?: string | undefined;
1468
+ driver?: "remote" | "desktop" | "none" | undefined;
1469
+ model?: string | undefined;
1470
+ activity?: {
1471
+ kind: "thinking" | "responding" | "tool";
1472
+ title?: string | undefined;
1473
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1474
+ } | undefined;
1475
+ permission?: {
1476
+ options: {
1477
+ optionId: string;
1478
+ name: string;
1479
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1480
+ }[];
1481
+ title: string;
1482
+ requestId: string;
1483
+ toolCallId?: string | undefined;
1484
+ detail?: string | undefined;
1485
+ } | undefined;
1486
+ queue?: {
1487
+ images: number;
1488
+ clientMessageId: string;
1489
+ text: string;
1490
+ }[] | undefined;
1491
+ };
1492
+ }>;
1493
+ };
1494
+ /** Names a session; an empty title goes back to the agent's own. */
1495
+ readonly "sessions.rename": {
1496
+ readonly params: z.ZodObject<{
1497
+ sessionId: z.ZodString;
1498
+ title: z.ZodString;
1499
+ }, "strip", z.ZodTypeAny, {
1500
+ title: string;
1501
+ sessionId: string;
1502
+ }, {
1503
+ title: string;
1504
+ sessionId: string;
1505
+ }>;
1506
+ readonly result: z.ZodObject<{
1507
+ session: z.ZodObject<{
1508
+ id: z.ZodString;
1509
+ agent: z.ZodString;
1510
+ nativeId: z.ZodString;
1511
+ title: z.ZodOptional<z.ZodString>;
1512
+ preview: z.ZodOptional<z.ZodString>;
1513
+ cwd: z.ZodString;
1514
+ state: z.ZodEnum<["idle", "running", "waiting", "error", "offline"]>;
1515
+ driver: z.ZodOptional<z.ZodEnum<["desktop", "remote", "none"]>>;
1516
+ pendingPermissions: z.ZodNumber;
1517
+ model: z.ZodOptional<z.ZodString>;
1518
+ createdAt: z.ZodNumber;
1519
+ updatedAt: z.ZodNumber;
1520
+ lastSeq: z.ZodNumber;
1521
+ archived: z.ZodBoolean;
1522
+ activity: z.ZodOptional<z.ZodObject<{
1523
+ kind: z.ZodEnum<["thinking", "responding", "tool"]>;
1524
+ title: z.ZodOptional<z.ZodString>;
1525
+ toolKind: z.ZodOptional<z.ZodEnum<["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]>>;
1526
+ }, "strip", z.ZodTypeAny, {
1527
+ kind: "thinking" | "responding" | "tool";
1528
+ title?: string | undefined;
1529
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1530
+ }, {
1531
+ kind: "thinking" | "responding" | "tool";
1532
+ title?: string | undefined;
1533
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1534
+ }>>;
1535
+ permission: z.ZodOptional<z.ZodObject<{
1536
+ requestId: z.ZodString;
1537
+ toolCallId: z.ZodOptional<z.ZodString>;
1538
+ title: z.ZodString;
1539
+ detail: z.ZodOptional<z.ZodString>;
1540
+ options: z.ZodArray<z.ZodObject<{
1541
+ optionId: z.ZodString;
1542
+ name: z.ZodString;
1543
+ kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
1544
+ }, "strip", z.ZodTypeAny, {
1545
+ optionId: string;
1546
+ name: string;
1547
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1548
+ }, {
1549
+ optionId: string;
1550
+ name: string;
1551
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1552
+ }>, "many">;
1553
+ }, "strip", z.ZodTypeAny, {
1554
+ options: {
1555
+ optionId: string;
1556
+ name: string;
1557
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1558
+ }[];
1559
+ title: string;
1560
+ requestId: string;
1561
+ toolCallId?: string | undefined;
1562
+ detail?: string | undefined;
1563
+ }, {
1564
+ options: {
1565
+ optionId: string;
1566
+ name: string;
1567
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1568
+ }[];
1569
+ title: string;
1570
+ requestId: string;
1571
+ toolCallId?: string | undefined;
1572
+ detail?: string | undefined;
1573
+ }>>;
1574
+ queue: z.ZodOptional<z.ZodArray<z.ZodObject<{
1575
+ clientMessageId: z.ZodString;
1576
+ text: z.ZodString;
1577
+ images: z.ZodNumber;
1578
+ }, "strip", z.ZodTypeAny, {
1579
+ images: number;
1580
+ clientMessageId: string;
1581
+ text: string;
1582
+ }, {
1583
+ images: number;
1584
+ clientMessageId: string;
1585
+ text: string;
1586
+ }>, "many">>;
1587
+ }, "strip", z.ZodTypeAny, {
1588
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1589
+ id: string;
1590
+ agent: string;
1591
+ nativeId: string;
1592
+ cwd: string;
1593
+ pendingPermissions: number;
1594
+ createdAt: number;
1595
+ updatedAt: number;
1596
+ lastSeq: number;
1597
+ archived: boolean;
1598
+ title?: string | undefined;
1599
+ preview?: string | undefined;
1600
+ driver?: "remote" | "desktop" | "none" | undefined;
1601
+ model?: string | undefined;
1602
+ activity?: {
1603
+ kind: "thinking" | "responding" | "tool";
1604
+ title?: string | undefined;
1605
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1606
+ } | undefined;
1607
+ permission?: {
1608
+ options: {
1609
+ optionId: string;
1610
+ name: string;
1611
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1612
+ }[];
1613
+ title: string;
1614
+ requestId: string;
1615
+ toolCallId?: string | undefined;
1616
+ detail?: string | undefined;
1617
+ } | undefined;
1618
+ queue?: {
1619
+ images: number;
1620
+ clientMessageId: string;
1621
+ text: string;
1622
+ }[] | undefined;
1623
+ }, {
1624
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1625
+ id: string;
1626
+ agent: string;
1627
+ nativeId: string;
1628
+ cwd: string;
1629
+ pendingPermissions: number;
1630
+ createdAt: number;
1631
+ updatedAt: number;
1632
+ lastSeq: number;
1633
+ archived: boolean;
1634
+ title?: string | undefined;
1635
+ preview?: string | undefined;
1636
+ driver?: "remote" | "desktop" | "none" | undefined;
1637
+ model?: string | undefined;
1638
+ activity?: {
1639
+ kind: "thinking" | "responding" | "tool";
1640
+ title?: string | undefined;
1641
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1642
+ } | undefined;
1643
+ permission?: {
1644
+ options: {
1645
+ optionId: string;
1646
+ name: string;
1647
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1648
+ }[];
1649
+ title: string;
1650
+ requestId: string;
1651
+ toolCallId?: string | undefined;
1652
+ detail?: string | undefined;
1653
+ } | undefined;
1654
+ queue?: {
1655
+ images: number;
1656
+ clientMessageId: string;
1657
+ text: string;
1658
+ }[] | undefined;
1659
+ }>;
1660
+ }, "strip", z.ZodTypeAny, {
1661
+ session: {
1662
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1663
+ id: string;
1664
+ agent: string;
1665
+ nativeId: string;
1666
+ cwd: string;
1667
+ pendingPermissions: number;
1668
+ createdAt: number;
1669
+ updatedAt: number;
1670
+ lastSeq: number;
1671
+ archived: boolean;
1672
+ title?: string | undefined;
1673
+ preview?: string | undefined;
1674
+ driver?: "remote" | "desktop" | "none" | undefined;
1675
+ model?: string | undefined;
1676
+ activity?: {
1677
+ kind: "thinking" | "responding" | "tool";
1678
+ title?: string | undefined;
1679
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1680
+ } | undefined;
1681
+ permission?: {
1682
+ options: {
1683
+ optionId: string;
1684
+ name: string;
1685
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1686
+ }[];
1687
+ title: string;
1688
+ requestId: string;
1689
+ toolCallId?: string | undefined;
1690
+ detail?: string | undefined;
1691
+ } | undefined;
1692
+ queue?: {
1693
+ images: number;
1694
+ clientMessageId: string;
1695
+ text: string;
1696
+ }[] | undefined;
1697
+ };
1698
+ }, {
1699
+ session: {
1700
+ state: "idle" | "running" | "waiting" | "error" | "offline";
1701
+ id: string;
1702
+ agent: string;
1703
+ nativeId: string;
1704
+ cwd: string;
1705
+ pendingPermissions: number;
1706
+ createdAt: number;
1707
+ updatedAt: number;
1708
+ lastSeq: number;
1709
+ archived: boolean;
1710
+ title?: string | undefined;
1711
+ preview?: string | undefined;
1712
+ driver?: "remote" | "desktop" | "none" | undefined;
1713
+ model?: string | undefined;
1714
+ activity?: {
1715
+ kind: "thinking" | "responding" | "tool";
1716
+ title?: string | undefined;
1717
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
1718
+ } | undefined;
1719
+ permission?: {
1720
+ options: {
1721
+ optionId: string;
1722
+ name: string;
1723
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1724
+ }[];
1725
+ title: string;
1726
+ requestId: string;
1727
+ toolCallId?: string | undefined;
1728
+ detail?: string | undefined;
1729
+ } | undefined;
1730
+ queue?: {
1731
+ images: number;
1732
+ clientMessageId: string;
1733
+ text: string;
1734
+ }[] | undefined;
1735
+ };
1736
+ }>;
1737
+ };
1738
+ /**
1739
+ * Deletes a session: the agent's own record where it has one (Codex thread,
1740
+ * Claude transcript), and LinkShell's copy either way. Not while it runs.
1741
+ */
1742
+ readonly "sessions.delete": {
1743
+ readonly params: z.ZodObject<{
1744
+ sessionId: z.ZodString;
1745
+ }, "strip", z.ZodTypeAny, {
1746
+ sessionId: string;
1747
+ }, {
1748
+ sessionId: string;
1749
+ }>;
1750
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1751
+ };
1752
+ readonly "sessions.takeover": {
1753
+ readonly params: z.ZodObject<{
1754
+ sessionId: z.ZodString;
1755
+ }, "strip", z.ZodTypeAny, {
1756
+ sessionId: string;
1757
+ }, {
1758
+ sessionId: string;
1759
+ }>;
1760
+ readonly result: z.ZodObject<{
1761
+ driver: z.ZodOptional<z.ZodEnum<["desktop", "remote", "none"]>>;
1762
+ }, "strip", z.ZodTypeAny, {
1763
+ driver?: "remote" | "desktop" | "none" | undefined;
1764
+ }, {
1765
+ driver?: "remote" | "desktop" | "none" | undefined;
1766
+ }>;
1767
+ };
1768
+ readonly "sessions.release": {
1769
+ readonly params: z.ZodObject<{
1770
+ sessionId: z.ZodString;
1771
+ }, "strip", z.ZodTypeAny, {
1772
+ sessionId: string;
1773
+ }, {
1774
+ sessionId: string;
1775
+ }>;
1776
+ readonly result: z.ZodObject<{
1777
+ driver: z.ZodOptional<z.ZodEnum<["desktop", "remote", "none"]>>;
1778
+ }, "strip", z.ZodTypeAny, {
1779
+ driver?: "remote" | "desktop" | "none" | undefined;
1780
+ }, {
1781
+ driver?: "remote" | "desktop" | "none" | undefined;
1782
+ }>;
1783
+ };
1784
+ /**
1785
+ * How a desktop terminal should launch the agent's native UI attached to the
1786
+ * host (used by `linkshell <agent>`). The shim execs exactly what it gets.
1787
+ * For handoff agents the calling connection becomes the session's desktop
1788
+ * controller: it receives `desktop.yield` when a device takes over.
1789
+ */
1790
+ readonly "desktop.launch": {
1791
+ readonly params: z.ZodObject<{
1792
+ agent: z.ZodString;
1793
+ sessionId: z.ZodOptional<z.ZodString>;
1794
+ args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1795
+ /** The terminal's working directory and environment. */
1796
+ cwd: z.ZodOptional<z.ZodString>;
1797
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1798
+ }, "strip", z.ZodTypeAny, {
1799
+ agent: string;
1800
+ args: string[];
1801
+ cwd?: string | undefined;
1802
+ sessionId?: string | undefined;
1803
+ env?: Record<string, string> | undefined;
1804
+ }, {
1805
+ agent: string;
1806
+ cwd?: string | undefined;
1807
+ sessionId?: string | undefined;
1808
+ args?: string[] | undefined;
1809
+ env?: Record<string, string> | undefined;
1810
+ }>;
1811
+ readonly result: z.ZodObject<{
1812
+ command: z.ZodString;
1813
+ args: z.ZodArray<z.ZodString, "many">;
1814
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1815
+ /** Set for handoff agents: the session this terminal now drives. */
1816
+ sessionId: z.ZodOptional<z.ZodString>;
1817
+ }, "strip", z.ZodTypeAny, {
1818
+ command: string;
1819
+ args: string[];
1820
+ sessionId?: string | undefined;
1821
+ env?: Record<string, string> | undefined;
1822
+ }, {
1823
+ command: string;
1824
+ args: string[];
1825
+ sessionId?: string | undefined;
1826
+ env?: Record<string, string> | undefined;
1827
+ }>;
1828
+ };
1829
+ /** The shim's native UI exited after a `desktop.yield`; the device may drive now. */
1830
+ readonly "desktop.yielded": {
1831
+ readonly params: z.ZodObject<{
1832
+ sessionId: z.ZodString;
1833
+ }, "strip", z.ZodTypeAny, {
1834
+ sessionId: string;
1835
+ }, {
1836
+ sessionId: string;
1837
+ }>;
1838
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1839
+ };
1840
+ /** The user is back at the keyboard: stop remote driving, relaunch the native UI. */
1841
+ readonly "desktop.reclaim": {
1842
+ readonly params: z.ZodObject<{
1843
+ sessionId: z.ZodString;
1844
+ }, "strip", z.ZodTypeAny, {
1845
+ sessionId: string;
1846
+ }, {
1847
+ sessionId: string;
1848
+ }>;
1849
+ readonly result: z.ZodObject<{
1850
+ command: z.ZodString;
1851
+ args: z.ZodArray<z.ZodString, "many">;
1852
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1853
+ }, "strip", z.ZodTypeAny, {
1854
+ command: string;
1855
+ args: string[];
1856
+ env?: Record<string, string> | undefined;
1857
+ }, {
1858
+ command: string;
1859
+ args: string[];
1860
+ env?: Record<string, string> | undefined;
1861
+ }>;
1862
+ };
1863
+ readonly "gateway.status": {
1864
+ readonly params: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1865
+ readonly result: z.ZodObject<{
1866
+ url: z.ZodOptional<z.ZodString>;
1867
+ status: z.ZodEnum<["off", "connecting", "online", "offline"]>;
1868
+ error: z.ZodOptional<z.ZodObject<{
1869
+ code: z.ZodString;
1870
+ message: z.ZodString;
1871
+ }, "strip", z.ZodTypeAny, {
1872
+ code: string;
1873
+ message: string;
1874
+ }, {
1875
+ code: string;
1876
+ message: string;
1877
+ }>>;
1878
+ machine: z.ZodOptional<z.ZodObject<{
1879
+ id: z.ZodString;
1880
+ name: z.ZodString;
1881
+ }, "strip", z.ZodTypeAny, {
1882
+ id: string;
1883
+ name: string;
1884
+ }, {
1885
+ id: string;
1886
+ name: string;
1887
+ }>>;
1888
+ account: z.ZodOptional<z.ZodObject<{
1889
+ userId: z.ZodString;
1890
+ email: z.ZodOptional<z.ZodString>;
1891
+ }, "strip", z.ZodTypeAny, {
1892
+ userId: string;
1893
+ email?: string | undefined;
1894
+ }, {
1895
+ userId: string;
1896
+ email?: string | undefined;
1897
+ }>>;
1898
+ devices: z.ZodArray<z.ZodObject<{
1899
+ id: z.ZodString;
1900
+ name: z.ZodString;
1901
+ pairedAt: z.ZodNumber;
1902
+ online: z.ZodBoolean;
1903
+ }, "strip", z.ZodTypeAny, {
1904
+ id: string;
1905
+ name: string;
1906
+ online: boolean;
1907
+ pairedAt: number;
1908
+ }, {
1909
+ id: string;
1910
+ name: string;
1911
+ online: boolean;
1912
+ pairedAt: number;
1913
+ }>, "many">;
1914
+ }, "strip", z.ZodTypeAny, {
1915
+ status: "offline" | "off" | "connecting" | "online";
1916
+ devices: {
1917
+ id: string;
1918
+ name: string;
1919
+ online: boolean;
1920
+ pairedAt: number;
1921
+ }[];
1922
+ error?: {
1923
+ code: string;
1924
+ message: string;
1925
+ } | undefined;
1926
+ url?: string | undefined;
1927
+ machine?: {
1928
+ id: string;
1929
+ name: string;
1930
+ } | undefined;
1931
+ account?: {
1932
+ userId: string;
1933
+ email?: string | undefined;
1934
+ } | undefined;
1935
+ }, {
1936
+ status: "offline" | "off" | "connecting" | "online";
1937
+ devices: {
1938
+ id: string;
1939
+ name: string;
1940
+ online: boolean;
1941
+ pairedAt: number;
1942
+ }[];
1943
+ error?: {
1944
+ code: string;
1945
+ message: string;
1946
+ } | undefined;
1947
+ url?: string | undefined;
1948
+ machine?: {
1949
+ id: string;
1950
+ name: string;
1951
+ } | undefined;
1952
+ account?: {
1953
+ userId: string;
1954
+ email?: string | undefined;
1955
+ } | undefined;
1956
+ }>;
1957
+ };
1958
+ /**
1959
+ * Opens a pairing window (local only). `link` is what the QR encodes; the
1960
+ * code can be typed instead. `pairing.done` follows when a device pairs.
1961
+ */
1962
+ readonly "pairing.start": {
1963
+ readonly params: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1964
+ readonly result: z.ZodObject<{
1965
+ link: z.ZodString;
1966
+ code: z.ZodString;
1967
+ expiresAt: z.ZodNumber;
1968
+ gateway: z.ZodString;
1969
+ }, "strip", z.ZodTypeAny, {
1970
+ code: string;
1971
+ link: string;
1972
+ expiresAt: number;
1973
+ gateway: string;
1974
+ }, {
1975
+ code: string;
1976
+ link: string;
1977
+ expiresAt: number;
1978
+ gateway: string;
1979
+ }>;
1980
+ };
1981
+ readonly "devices.revoke": {
1982
+ readonly params: z.ZodObject<{
1983
+ deviceId: z.ZodString;
1984
+ }, "strip", z.ZodTypeAny, {
1985
+ deviceId: string;
1986
+ }, {
1987
+ deviceId: string;
1988
+ }>;
1989
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1990
+ };
1991
+ /** Subdirectories of `path` (default: the home directory). */
1992
+ readonly "fs.list": {
1993
+ readonly params: z.ZodObject<{
1994
+ path: z.ZodOptional<z.ZodString>;
1995
+ hidden: z.ZodDefault<z.ZodBoolean>;
1996
+ }, "strip", z.ZodTypeAny, {
1997
+ hidden: boolean;
1998
+ path?: string | undefined;
1999
+ }, {
2000
+ path?: string | undefined;
2001
+ hidden?: boolean | undefined;
2002
+ }>;
2003
+ readonly result: z.ZodObject<{
2004
+ path: z.ZodString;
2005
+ parent: z.ZodOptional<z.ZodString>;
2006
+ home: z.ZodString;
2007
+ entries: z.ZodArray<z.ZodObject<{
2008
+ name: z.ZodString;
2009
+ path: z.ZodString;
2010
+ /** Looks like a code project (has .git, package.json, …). */
2011
+ project: z.ZodOptional<z.ZodBoolean>;
2012
+ }, "strip", z.ZodTypeAny, {
2013
+ path: string;
2014
+ name: string;
2015
+ project?: boolean | undefined;
2016
+ }, {
2017
+ path: string;
2018
+ name: string;
2019
+ project?: boolean | undefined;
2020
+ }>, "many">;
2021
+ }, "strip", z.ZodTypeAny, {
2022
+ entries: {
2023
+ path: string;
2024
+ name: string;
2025
+ project?: boolean | undefined;
2026
+ }[];
2027
+ path: string;
2028
+ home: string;
2029
+ parent?: string | undefined;
2030
+ }, {
2031
+ entries: {
2032
+ path: string;
2033
+ name: string;
2034
+ project?: boolean | undefined;
2035
+ }[];
2036
+ path: string;
2037
+ home: string;
2038
+ parent?: string | undefined;
2039
+ }>;
2040
+ };
2041
+ /** A file's contents, for viewing: text as-is, images as base64, anything else refused. */
2042
+ readonly "fs.read": {
2043
+ readonly params: z.ZodObject<{
2044
+ path: z.ZodString;
2045
+ maxBytes: z.ZodDefault<z.ZodNumber>;
2046
+ }, "strip", z.ZodTypeAny, {
2047
+ path: string;
2048
+ maxBytes: number;
2049
+ }, {
2050
+ path: string;
2051
+ maxBytes?: number | undefined;
2052
+ }>;
2053
+ readonly result: z.ZodObject<{
2054
+ path: z.ZodString;
2055
+ size: z.ZodNumber;
2056
+ modifiedAt: z.ZodNumber;
2057
+ kind: z.ZodEnum<["text", "image", "binary"]>;
2058
+ text: z.ZodOptional<z.ZodString>;
2059
+ data: z.ZodOptional<z.ZodString>;
2060
+ mimeType: z.ZodOptional<z.ZodString>;
2061
+ truncated: z.ZodBoolean;
2062
+ }, "strip", z.ZodTypeAny, {
2063
+ path: string;
2064
+ kind: "text" | "image" | "binary";
2065
+ size: number;
2066
+ modifiedAt: number;
2067
+ truncated: boolean;
2068
+ text?: string | undefined;
2069
+ mimeType?: string | undefined;
2070
+ data?: string | undefined;
2071
+ }, {
2072
+ path: string;
2073
+ kind: "text" | "image" | "binary";
2074
+ size: number;
2075
+ modifiedAt: number;
2076
+ truncated: boolean;
2077
+ text?: string | undefined;
2078
+ mimeType?: string | undefined;
2079
+ data?: string | undefined;
2080
+ }>;
2081
+ };
2082
+ /**
2083
+ * Saves a file from the device into `dir`. A name that's taken gets a
2084
+ * numbered suffix ("photo 2.jpg") rather than overwriting.
2085
+ */
2086
+ readonly "fs.upload": {
2087
+ readonly params: z.ZodObject<{
2088
+ dir: z.ZodString;
2089
+ name: z.ZodString;
2090
+ /** base64; up to ~30 MB of file. */
2091
+ data: z.ZodString;
2092
+ }, "strip", z.ZodTypeAny, {
2093
+ name: string;
2094
+ data: string;
2095
+ dir: string;
2096
+ }, {
2097
+ name: string;
2098
+ data: string;
2099
+ dir: string;
2100
+ }>;
2101
+ readonly result: z.ZodObject<{
2102
+ path: z.ZodString;
2103
+ size: z.ZodNumber;
2104
+ }, "strip", z.ZodTypeAny, {
2105
+ path: string;
2106
+ size: number;
2107
+ }, {
2108
+ path: string;
2109
+ size: number;
2110
+ }>;
2111
+ };
2112
+ /** Creates a directory `name` inside `parent`. */
2113
+ readonly "fs.mkdir": {
2114
+ readonly params: z.ZodObject<{
2115
+ parent: z.ZodString;
2116
+ name: z.ZodString;
2117
+ }, "strip", z.ZodTypeAny, {
2118
+ name: string;
2119
+ parent: string;
2120
+ }, {
2121
+ name: string;
2122
+ parent: string;
2123
+ }>;
2124
+ readonly result: z.ZodObject<{
2125
+ path: z.ZodString;
2126
+ }, "strip", z.ZodTypeAny, {
2127
+ path: string;
2128
+ }, {
2129
+ path: string;
2130
+ }>;
2131
+ };
2132
+ /** Directories under the home directory whose name contains `query`, projects first. */
2133
+ readonly "fs.search": {
2134
+ readonly params: z.ZodObject<{
2135
+ query: z.ZodString;
2136
+ limit: z.ZodDefault<z.ZodNumber>;
2137
+ }, "strip", z.ZodTypeAny, {
2138
+ query: string;
2139
+ limit: number;
2140
+ }, {
2141
+ query: string;
2142
+ limit?: number | undefined;
2143
+ }>;
2144
+ readonly result: z.ZodObject<{
2145
+ entries: z.ZodArray<z.ZodObject<{
2146
+ name: z.ZodString;
2147
+ path: z.ZodString;
2148
+ /** Looks like a code project (has .git, package.json, …). */
2149
+ project: z.ZodOptional<z.ZodBoolean>;
2150
+ }, "strip", z.ZodTypeAny, {
2151
+ path: string;
2152
+ name: string;
2153
+ project?: boolean | undefined;
2154
+ }, {
2155
+ path: string;
2156
+ name: string;
2157
+ project?: boolean | undefined;
2158
+ }>, "many">;
2159
+ truncated: z.ZodBoolean;
2160
+ }, "strip", z.ZodTypeAny, {
2161
+ entries: {
2162
+ path: string;
2163
+ name: string;
2164
+ project?: boolean | undefined;
2165
+ }[];
2166
+ truncated: boolean;
2167
+ }, {
2168
+ entries: {
2169
+ path: string;
2170
+ name: string;
2171
+ project?: boolean | undefined;
2172
+ }[];
2173
+ truncated: boolean;
2174
+ }>;
2175
+ };
2176
+ readonly "terminals.list": {
2177
+ readonly params: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2178
+ readonly result: z.ZodObject<{
2179
+ terminals: z.ZodArray<z.ZodObject<{
2180
+ id: z.ZodString;
2181
+ title: z.ZodString;
2182
+ cwd: z.ZodString;
2183
+ cols: z.ZodNumber;
2184
+ rows: z.ZodNumber;
2185
+ createdAt: z.ZodNumber;
2186
+ activeAt: z.ZodNumber;
2187
+ command: z.ZodOptional<z.ZodString>;
2188
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2189
+ interrupted: z.ZodOptional<z.ZodBoolean>;
2190
+ }, "strip", z.ZodTypeAny, {
2191
+ id: string;
2192
+ title: string;
2193
+ cwd: string;
2194
+ createdAt: number;
2195
+ cols: number;
2196
+ rows: number;
2197
+ activeAt: number;
2198
+ command?: string | undefined;
2199
+ exitCode?: number | null | undefined;
2200
+ interrupted?: boolean | undefined;
2201
+ }, {
2202
+ id: string;
2203
+ title: string;
2204
+ cwd: string;
2205
+ createdAt: number;
2206
+ cols: number;
2207
+ rows: number;
2208
+ activeAt: number;
2209
+ command?: string | undefined;
2210
+ exitCode?: number | null | undefined;
2211
+ interrupted?: boolean | undefined;
2212
+ }>, "many">;
2213
+ }, "strip", z.ZodTypeAny, {
2214
+ terminals: {
2215
+ id: string;
2216
+ title: string;
2217
+ cwd: string;
2218
+ createdAt: number;
2219
+ cols: number;
2220
+ rows: number;
2221
+ activeAt: number;
2222
+ command?: string | undefined;
2223
+ exitCode?: number | null | undefined;
2224
+ interrupted?: boolean | undefined;
2225
+ }[];
2226
+ }, {
2227
+ terminals: {
2228
+ id: string;
2229
+ title: string;
2230
+ cwd: string;
2231
+ createdAt: number;
2232
+ cols: number;
2233
+ rows: number;
2234
+ activeAt: number;
2235
+ command?: string | undefined;
2236
+ exitCode?: number | null | undefined;
2237
+ interrupted?: boolean | undefined;
2238
+ }[];
2239
+ }>;
2240
+ };
2241
+ readonly "terminals.create": {
2242
+ readonly params: z.ZodObject<{
2243
+ cwd: z.ZodOptional<z.ZodString>;
2244
+ /** Run this in the shell right away (the shell stays open after it). */
2245
+ command: z.ZodOptional<z.ZodString>;
2246
+ cols: z.ZodDefault<z.ZodNumber>;
2247
+ rows: z.ZodDefault<z.ZodNumber>;
2248
+ }, "strip", z.ZodTypeAny, {
2249
+ cols: number;
2250
+ rows: number;
2251
+ cwd?: string | undefined;
2252
+ command?: string | undefined;
2253
+ }, {
2254
+ cwd?: string | undefined;
2255
+ cols?: number | undefined;
2256
+ rows?: number | undefined;
2257
+ command?: string | undefined;
2258
+ }>;
2259
+ readonly result: z.ZodObject<{
2260
+ terminal: z.ZodObject<{
2261
+ id: z.ZodString;
2262
+ title: z.ZodString;
2263
+ cwd: z.ZodString;
2264
+ cols: z.ZodNumber;
2265
+ rows: z.ZodNumber;
2266
+ createdAt: z.ZodNumber;
2267
+ activeAt: z.ZodNumber;
2268
+ command: z.ZodOptional<z.ZodString>;
2269
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2270
+ interrupted: z.ZodOptional<z.ZodBoolean>;
2271
+ }, "strip", z.ZodTypeAny, {
2272
+ id: string;
2273
+ title: string;
2274
+ cwd: string;
2275
+ createdAt: number;
2276
+ cols: number;
2277
+ rows: number;
2278
+ activeAt: number;
2279
+ command?: string | undefined;
2280
+ exitCode?: number | null | undefined;
2281
+ interrupted?: boolean | undefined;
2282
+ }, {
2283
+ id: string;
2284
+ title: string;
2285
+ cwd: string;
2286
+ createdAt: number;
2287
+ cols: number;
2288
+ rows: number;
2289
+ activeAt: number;
2290
+ command?: string | undefined;
2291
+ exitCode?: number | null | undefined;
2292
+ interrupted?: boolean | undefined;
2293
+ }>;
2294
+ }, "strip", z.ZodTypeAny, {
2295
+ terminal: {
2296
+ id: string;
2297
+ title: string;
2298
+ cwd: string;
2299
+ createdAt: number;
2300
+ cols: number;
2301
+ rows: number;
2302
+ activeAt: number;
2303
+ command?: string | undefined;
2304
+ exitCode?: number | null | undefined;
2305
+ interrupted?: boolean | undefined;
2306
+ };
2307
+ }, {
2308
+ terminal: {
2309
+ id: string;
2310
+ title: string;
2311
+ cwd: string;
2312
+ createdAt: number;
2313
+ cols: number;
2314
+ rows: number;
2315
+ activeAt: number;
2316
+ command?: string | undefined;
2317
+ exitCode?: number | null | undefined;
2318
+ interrupted?: boolean | undefined;
2319
+ };
2320
+ }>;
2321
+ };
2322
+ /**
2323
+ * Start receiving `terminal.output` for a terminal. With `fromSeq` the host
2324
+ * sends only newer output when it still has it; otherwise `replay` holds the
2325
+ * recent screen history to redraw from scratch.
2326
+ */
2327
+ readonly "terminals.attach": {
2328
+ readonly params: z.ZodObject<{
2329
+ terminalId: z.ZodString;
2330
+ fromSeq: z.ZodOptional<z.ZodNumber>;
2331
+ }, "strip", z.ZodTypeAny, {
2332
+ terminalId: string;
2333
+ fromSeq?: number | undefined;
2334
+ }, {
2335
+ terminalId: string;
2336
+ fromSeq?: number | undefined;
2337
+ }>;
2338
+ readonly result: z.ZodObject<{
2339
+ terminal: z.ZodObject<{
2340
+ id: z.ZodString;
2341
+ title: z.ZodString;
2342
+ cwd: z.ZodString;
2343
+ cols: z.ZodNumber;
2344
+ rows: z.ZodNumber;
2345
+ createdAt: z.ZodNumber;
2346
+ activeAt: z.ZodNumber;
2347
+ command: z.ZodOptional<z.ZodString>;
2348
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2349
+ interrupted: z.ZodOptional<z.ZodBoolean>;
2350
+ }, "strip", z.ZodTypeAny, {
2351
+ id: string;
2352
+ title: string;
2353
+ cwd: string;
2354
+ createdAt: number;
2355
+ cols: number;
2356
+ rows: number;
2357
+ activeAt: number;
2358
+ command?: string | undefined;
2359
+ exitCode?: number | null | undefined;
2360
+ interrupted?: boolean | undefined;
2361
+ }, {
2362
+ id: string;
2363
+ title: string;
2364
+ cwd: string;
2365
+ createdAt: number;
2366
+ cols: number;
2367
+ rows: number;
2368
+ activeAt: number;
2369
+ command?: string | undefined;
2370
+ exitCode?: number | null | undefined;
2371
+ interrupted?: boolean | undefined;
2372
+ }>;
2373
+ /** Output to write before any `terminal.output` that follows. */
2374
+ replay: z.ZodString;
2375
+ /** Clear the screen before writing `replay` (the host no longer has what came after `fromSeq`). */
2376
+ reset: z.ZodBoolean;
2377
+ /** The last output seq `replay` covers; later chunks arrive as `terminal.output`. */
2378
+ seq: z.ZodNumber;
2379
+ }, "strip", z.ZodTypeAny, {
2380
+ terminal: {
2381
+ id: string;
2382
+ title: string;
2383
+ cwd: string;
2384
+ createdAt: number;
2385
+ cols: number;
2386
+ rows: number;
2387
+ activeAt: number;
2388
+ command?: string | undefined;
2389
+ exitCode?: number | null | undefined;
2390
+ interrupted?: boolean | undefined;
2391
+ };
2392
+ seq: number;
2393
+ replay: string;
2394
+ reset: boolean;
2395
+ }, {
2396
+ terminal: {
2397
+ id: string;
2398
+ title: string;
2399
+ cwd: string;
2400
+ createdAt: number;
2401
+ cols: number;
2402
+ rows: number;
2403
+ activeAt: number;
2404
+ command?: string | undefined;
2405
+ exitCode?: number | null | undefined;
2406
+ interrupted?: boolean | undefined;
2407
+ };
2408
+ seq: number;
2409
+ replay: string;
2410
+ reset: boolean;
2411
+ }>;
2412
+ };
2413
+ readonly "terminals.detach": {
2414
+ readonly params: z.ZodObject<{
2415
+ terminalId: z.ZodString;
2416
+ }, "strip", z.ZodTypeAny, {
2417
+ terminalId: string;
2418
+ }, {
2419
+ terminalId: string;
2420
+ }>;
2421
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2422
+ };
2423
+ readonly "terminals.input": {
2424
+ readonly params: z.ZodObject<{
2425
+ terminalId: z.ZodString;
2426
+ data: z.ZodString;
2427
+ }, "strip", z.ZodTypeAny, {
2428
+ data: string;
2429
+ terminalId: string;
2430
+ }, {
2431
+ data: string;
2432
+ terminalId: string;
2433
+ }>;
2434
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2435
+ };
2436
+ readonly "terminals.resize": {
2437
+ readonly params: z.ZodObject<{
2438
+ terminalId: z.ZodString;
2439
+ cols: z.ZodNumber;
2440
+ rows: z.ZodNumber;
2441
+ }, "strip", z.ZodTypeAny, {
2442
+ cols: number;
2443
+ rows: number;
2444
+ terminalId: string;
2445
+ }, {
2446
+ cols: number;
2447
+ rows: number;
2448
+ terminalId: string;
2449
+ }>;
2450
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2451
+ };
2452
+ readonly "terminals.close": {
2453
+ readonly params: z.ZodObject<{
2454
+ terminalId: z.ZodString;
2455
+ }, "strip", z.ZodTypeAny, {
2456
+ terminalId: string;
2457
+ }, {
2458
+ terminalId: string;
2459
+ }>;
2460
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2461
+ };
2462
+ /** Servers listening on the host that look like something to preview. */
2463
+ readonly "ports.list": {
2464
+ readonly params: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2465
+ readonly result: z.ZodObject<{
2466
+ ports: z.ZodArray<z.ZodObject<{
2467
+ port: z.ZodNumber;
2468
+ process: z.ZodString;
2469
+ pid: z.ZodOptional<z.ZodNumber>;
2470
+ cwd: z.ZodOptional<z.ZodString>;
2471
+ title: z.ZodOptional<z.ZodString>;
2472
+ http: z.ZodBoolean;
2473
+ }, "strip", z.ZodTypeAny, {
2474
+ port: number;
2475
+ process: string;
2476
+ http: boolean;
2477
+ title?: string | undefined;
2478
+ cwd?: string | undefined;
2479
+ pid?: number | undefined;
2480
+ }, {
2481
+ port: number;
2482
+ process: string;
2483
+ http: boolean;
2484
+ title?: string | undefined;
2485
+ cwd?: string | undefined;
2486
+ pid?: number | undefined;
2487
+ }>, "many">;
2488
+ }, "strip", z.ZodTypeAny, {
2489
+ ports: {
2490
+ port: number;
2491
+ process: string;
2492
+ http: boolean;
2493
+ title?: string | undefined;
2494
+ cwd?: string | undefined;
2495
+ pid?: number | undefined;
2496
+ }[];
2497
+ }, {
2498
+ ports: {
2499
+ port: number;
2500
+ process: string;
2501
+ http: boolean;
2502
+ title?: string | undefined;
2503
+ cwd?: string | undefined;
2504
+ pid?: number | undefined;
2505
+ }[];
2506
+ }>;
2507
+ };
2508
+ /**
2509
+ * A TCP stream to `port` on the host's loopback, like `ssh -L`: the device
2510
+ * runs a local listener and carries each connection over this channel, so a
2511
+ * page, its WebSocket (hot reload) and its cookies all work unchanged. The
2512
+ * host's bytes arrive as `proxy.data`; the stream ends with `proxy.closed`.
2513
+ */
2514
+ readonly "proxy.open": {
2515
+ readonly params: z.ZodObject<{
2516
+ port: z.ZodNumber;
2517
+ }, "strip", z.ZodTypeAny, {
2518
+ port: number;
2519
+ }, {
2520
+ port: number;
2521
+ }>;
2522
+ readonly result: z.ZodObject<{
2523
+ streamId: z.ZodString;
2524
+ }, "strip", z.ZodTypeAny, {
2525
+ streamId: string;
2526
+ }, {
2527
+ streamId: string;
2528
+ }>;
2529
+ };
2530
+ /**
2531
+ * Starts the host's screen viewer: a page plus H.264 stream on a loopback
2532
+ * port, opened like a preview (`proxy.open`) at `/?token=…&display=…`.
2533
+ */
2534
+ readonly "screen.start": {
2535
+ readonly params: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2536
+ readonly result: z.ZodObject<{
2537
+ port: z.ZodNumber;
2538
+ token: z.ZodString;
2539
+ displays: z.ZodArray<z.ZodObject<{
2540
+ index: z.ZodNumber;
2541
+ name: z.ZodString;
2542
+ }, "strip", z.ZodTypeAny, {
2543
+ name: string;
2544
+ index: number;
2545
+ }, {
2546
+ name: string;
2547
+ index: number;
2548
+ }>, "many">;
2549
+ }, "strip", z.ZodTypeAny, {
2550
+ port: number;
2551
+ token: string;
2552
+ displays: {
2553
+ name: string;
2554
+ index: number;
2555
+ }[];
2556
+ }, {
2557
+ port: number;
2558
+ token: string;
2559
+ displays: {
2560
+ name: string;
2561
+ index: number;
2562
+ }[];
2563
+ }>;
2564
+ };
2565
+ /** Bytes to the host's end of a stream (base64). */
2566
+ readonly "proxy.write": {
2567
+ readonly params: z.ZodObject<{
2568
+ streamId: z.ZodString;
2569
+ data: z.ZodString;
2570
+ }, "strip", z.ZodTypeAny, {
2571
+ data: string;
2572
+ streamId: string;
2573
+ }, {
2574
+ data: string;
2575
+ streamId: string;
2576
+ }>;
2577
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2578
+ };
2579
+ readonly "proxy.close": {
2580
+ readonly params: z.ZodObject<{
2581
+ streamId: z.ZodString;
2582
+ }, "strip", z.ZodTypeAny, {
2583
+ streamId: string;
2584
+ }, {
2585
+ streamId: string;
2586
+ }>;
2587
+ readonly result: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2588
+ };
2589
+ };
2590
+ export type MethodName = keyof typeof methods;
2591
+ export type MethodParams<M extends MethodName> = z.input<(typeof methods)[M]["params"]>;
2592
+ export type MethodResult<M extends MethodName> = z.infer<(typeof methods)[M]["result"]>;
2593
+ export declare function isMethodName(name: string): name is MethodName;
2594
+ export declare const notifications: {
2595
+ readonly "session.event": z.ZodObject<{
2596
+ sessionId: z.ZodString;
2597
+ seq: z.ZodNumber;
2598
+ ts: z.ZodNumber;
2599
+ update: z.ZodDiscriminatedUnion<"sessionUpdate", [z.ZodObject<{
2600
+ sessionUpdate: z.ZodLiteral<"user_message_chunk">;
2601
+ messageId: z.ZodOptional<z.ZodString>;
2602
+ content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2603
+ type: z.ZodLiteral<"text">;
2604
+ text: z.ZodString;
2605
+ }, "strip", z.ZodTypeAny, {
2606
+ type: "text";
2607
+ text: string;
2608
+ }, {
2609
+ type: "text";
2610
+ text: string;
2611
+ }>, z.ZodObject<{
2612
+ type: z.ZodLiteral<"image">;
2613
+ mimeType: z.ZodString;
2614
+ data: z.ZodOptional<z.ZodString>;
2615
+ uri: z.ZodOptional<z.ZodString>;
2616
+ }, "strip", z.ZodTypeAny, {
2617
+ type: "image";
2618
+ mimeType: string;
2619
+ data?: string | undefined;
2620
+ uri?: string | undefined;
2621
+ }, {
2622
+ type: "image";
2623
+ mimeType: string;
2624
+ data?: string | undefined;
2625
+ uri?: string | undefined;
2626
+ }>, z.ZodObject<{
2627
+ type: z.ZodLiteral<"resource_link">;
2628
+ uri: z.ZodString;
2629
+ name: z.ZodString;
2630
+ kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
2631
+ }, "strip", z.ZodTypeAny, {
2632
+ type: "resource_link";
2633
+ name: string;
2634
+ uri: string;
2635
+ kind?: "agent" | "file" | "skill" | undefined;
2636
+ }, {
2637
+ type: "resource_link";
2638
+ name: string;
2639
+ uri: string;
2640
+ kind?: "agent" | "file" | "skill" | undefined;
2641
+ }>]>;
2642
+ }, "strip", z.ZodTypeAny, {
2643
+ content: {
2644
+ type: "text";
2645
+ text: string;
2646
+ } | {
2647
+ type: "image";
2648
+ mimeType: string;
2649
+ data?: string | undefined;
2650
+ uri?: string | undefined;
2651
+ } | {
2652
+ type: "resource_link";
2653
+ name: string;
2654
+ uri: string;
2655
+ kind?: "agent" | "file" | "skill" | undefined;
2656
+ };
2657
+ sessionUpdate: "user_message_chunk";
2658
+ messageId?: string | undefined;
2659
+ }, {
2660
+ content: {
2661
+ type: "text";
2662
+ text: string;
2663
+ } | {
2664
+ type: "image";
2665
+ mimeType: string;
2666
+ data?: string | undefined;
2667
+ uri?: string | undefined;
2668
+ } | {
2669
+ type: "resource_link";
2670
+ name: string;
2671
+ uri: string;
2672
+ kind?: "agent" | "file" | "skill" | undefined;
2673
+ };
2674
+ sessionUpdate: "user_message_chunk";
2675
+ messageId?: string | undefined;
2676
+ }>, z.ZodObject<{
2677
+ sessionUpdate: z.ZodLiteral<"agent_message_chunk">;
2678
+ parentToolCallId: z.ZodOptional<z.ZodString>;
2679
+ messageId: z.ZodString;
2680
+ content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2681
+ type: z.ZodLiteral<"text">;
2682
+ text: z.ZodString;
2683
+ }, "strip", z.ZodTypeAny, {
2684
+ type: "text";
2685
+ text: string;
2686
+ }, {
2687
+ type: "text";
2688
+ text: string;
2689
+ }>, z.ZodObject<{
2690
+ type: z.ZodLiteral<"image">;
2691
+ mimeType: z.ZodString;
2692
+ data: z.ZodOptional<z.ZodString>;
2693
+ uri: z.ZodOptional<z.ZodString>;
2694
+ }, "strip", z.ZodTypeAny, {
2695
+ type: "image";
2696
+ mimeType: string;
2697
+ data?: string | undefined;
2698
+ uri?: string | undefined;
2699
+ }, {
2700
+ type: "image";
2701
+ mimeType: string;
2702
+ data?: string | undefined;
2703
+ uri?: string | undefined;
2704
+ }>, z.ZodObject<{
2705
+ type: z.ZodLiteral<"resource_link">;
2706
+ uri: z.ZodString;
2707
+ name: z.ZodString;
2708
+ kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
2709
+ }, "strip", z.ZodTypeAny, {
2710
+ type: "resource_link";
2711
+ name: string;
2712
+ uri: string;
2713
+ kind?: "agent" | "file" | "skill" | undefined;
2714
+ }, {
2715
+ type: "resource_link";
2716
+ name: string;
2717
+ uri: string;
2718
+ kind?: "agent" | "file" | "skill" | undefined;
2719
+ }>]>;
2720
+ }, "strip", z.ZodTypeAny, {
2721
+ content: {
2722
+ type: "text";
2723
+ text: string;
2724
+ } | {
2725
+ type: "image";
2726
+ mimeType: string;
2727
+ data?: string | undefined;
2728
+ uri?: string | undefined;
2729
+ } | {
2730
+ type: "resource_link";
2731
+ name: string;
2732
+ uri: string;
2733
+ kind?: "agent" | "file" | "skill" | undefined;
2734
+ };
2735
+ sessionUpdate: "agent_message_chunk";
2736
+ messageId: string;
2737
+ parentToolCallId?: string | undefined;
2738
+ }, {
2739
+ content: {
2740
+ type: "text";
2741
+ text: string;
2742
+ } | {
2743
+ type: "image";
2744
+ mimeType: string;
2745
+ data?: string | undefined;
2746
+ uri?: string | undefined;
2747
+ } | {
2748
+ type: "resource_link";
2749
+ name: string;
2750
+ uri: string;
2751
+ kind?: "agent" | "file" | "skill" | undefined;
2752
+ };
2753
+ sessionUpdate: "agent_message_chunk";
2754
+ messageId: string;
2755
+ parentToolCallId?: string | undefined;
2756
+ }>, z.ZodObject<{
2757
+ sessionUpdate: z.ZodLiteral<"agent_thought_chunk">;
2758
+ parentToolCallId: z.ZodOptional<z.ZodString>;
2759
+ messageId: z.ZodString;
2760
+ content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2761
+ type: z.ZodLiteral<"text">;
2762
+ text: z.ZodString;
2763
+ }, "strip", z.ZodTypeAny, {
2764
+ type: "text";
2765
+ text: string;
2766
+ }, {
2767
+ type: "text";
2768
+ text: string;
2769
+ }>, z.ZodObject<{
2770
+ type: z.ZodLiteral<"image">;
2771
+ mimeType: z.ZodString;
2772
+ data: z.ZodOptional<z.ZodString>;
2773
+ uri: z.ZodOptional<z.ZodString>;
2774
+ }, "strip", z.ZodTypeAny, {
2775
+ type: "image";
2776
+ mimeType: string;
2777
+ data?: string | undefined;
2778
+ uri?: string | undefined;
2779
+ }, {
2780
+ type: "image";
2781
+ mimeType: string;
2782
+ data?: string | undefined;
2783
+ uri?: string | undefined;
2784
+ }>, z.ZodObject<{
2785
+ type: z.ZodLiteral<"resource_link">;
2786
+ uri: z.ZodString;
2787
+ name: z.ZodString;
2788
+ kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
2789
+ }, "strip", z.ZodTypeAny, {
2790
+ type: "resource_link";
2791
+ name: string;
2792
+ uri: string;
2793
+ kind?: "agent" | "file" | "skill" | undefined;
2794
+ }, {
2795
+ type: "resource_link";
2796
+ name: string;
2797
+ uri: string;
2798
+ kind?: "agent" | "file" | "skill" | undefined;
2799
+ }>]>;
2800
+ }, "strip", z.ZodTypeAny, {
2801
+ content: {
2802
+ type: "text";
2803
+ text: string;
2804
+ } | {
2805
+ type: "image";
2806
+ mimeType: string;
2807
+ data?: string | undefined;
2808
+ uri?: string | undefined;
2809
+ } | {
2810
+ type: "resource_link";
2811
+ name: string;
2812
+ uri: string;
2813
+ kind?: "agent" | "file" | "skill" | undefined;
2814
+ };
2815
+ sessionUpdate: "agent_thought_chunk";
2816
+ messageId: string;
2817
+ parentToolCallId?: string | undefined;
2818
+ }, {
2819
+ content: {
2820
+ type: "text";
2821
+ text: string;
2822
+ } | {
2823
+ type: "image";
2824
+ mimeType: string;
2825
+ data?: string | undefined;
2826
+ uri?: string | undefined;
2827
+ } | {
2828
+ type: "resource_link";
2829
+ name: string;
2830
+ uri: string;
2831
+ kind?: "agent" | "file" | "skill" | undefined;
2832
+ };
2833
+ sessionUpdate: "agent_thought_chunk";
2834
+ messageId: string;
2835
+ parentToolCallId?: string | undefined;
2836
+ }>, z.ZodObject<{
2837
+ sessionUpdate: z.ZodLiteral<"tool_call">;
2838
+ toolCallId: z.ZodString;
2839
+ parentToolCallId: z.ZodOptional<z.ZodString>;
2840
+ title: z.ZodString;
2841
+ kind: z.ZodEnum<["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]>;
2842
+ status: z.ZodEnum<["pending", "in_progress", "completed", "failed"]>;
2843
+ rawInput: z.ZodOptional<z.ZodUnknown>;
2844
+ content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2845
+ type: z.ZodLiteral<"content">;
2846
+ content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2847
+ type: z.ZodLiteral<"text">;
2848
+ text: z.ZodString;
2849
+ }, "strip", z.ZodTypeAny, {
2850
+ type: "text";
2851
+ text: string;
2852
+ }, {
2853
+ type: "text";
2854
+ text: string;
2855
+ }>, z.ZodObject<{
2856
+ type: z.ZodLiteral<"image">;
2857
+ mimeType: z.ZodString;
2858
+ data: z.ZodOptional<z.ZodString>;
2859
+ uri: z.ZodOptional<z.ZodString>;
2860
+ }, "strip", z.ZodTypeAny, {
2861
+ type: "image";
2862
+ mimeType: string;
2863
+ data?: string | undefined;
2864
+ uri?: string | undefined;
2865
+ }, {
2866
+ type: "image";
2867
+ mimeType: string;
2868
+ data?: string | undefined;
2869
+ uri?: string | undefined;
2870
+ }>, z.ZodObject<{
2871
+ type: z.ZodLiteral<"resource_link">;
2872
+ uri: z.ZodString;
2873
+ name: z.ZodString;
2874
+ kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
2875
+ }, "strip", z.ZodTypeAny, {
2876
+ type: "resource_link";
2877
+ name: string;
2878
+ uri: string;
2879
+ kind?: "agent" | "file" | "skill" | undefined;
2880
+ }, {
2881
+ type: "resource_link";
2882
+ name: string;
2883
+ uri: string;
2884
+ kind?: "agent" | "file" | "skill" | undefined;
2885
+ }>]>;
2886
+ }, "strip", z.ZodTypeAny, {
2887
+ type: "content";
2888
+ content: {
2889
+ type: "text";
2890
+ text: string;
2891
+ } | {
2892
+ type: "image";
2893
+ mimeType: string;
2894
+ data?: string | undefined;
2895
+ uri?: string | undefined;
2896
+ } | {
2897
+ type: "resource_link";
2898
+ name: string;
2899
+ uri: string;
2900
+ kind?: "agent" | "file" | "skill" | undefined;
2901
+ };
2902
+ }, {
2903
+ type: "content";
2904
+ content: {
2905
+ type: "text";
2906
+ text: string;
2907
+ } | {
2908
+ type: "image";
2909
+ mimeType: string;
2910
+ data?: string | undefined;
2911
+ uri?: string | undefined;
2912
+ } | {
2913
+ type: "resource_link";
2914
+ name: string;
2915
+ uri: string;
2916
+ kind?: "agent" | "file" | "skill" | undefined;
2917
+ };
2918
+ }>, z.ZodObject<{
2919
+ type: z.ZodLiteral<"diff">;
2920
+ path: z.ZodString;
2921
+ oldText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2922
+ newText: z.ZodString;
2923
+ }, "strip", z.ZodTypeAny, {
2924
+ path: string;
2925
+ type: "diff";
2926
+ newText: string;
2927
+ oldText?: string | null | undefined;
2928
+ }, {
2929
+ path: string;
2930
+ type: "diff";
2931
+ newText: string;
2932
+ oldText?: string | null | undefined;
2933
+ }>, z.ZodObject<{
2934
+ type: z.ZodLiteral<"patch">;
2935
+ path: z.ZodString;
2936
+ change: z.ZodEnum<["add", "delete", "update"]>;
2937
+ movePath: z.ZodOptional<z.ZodString>;
2938
+ diff: z.ZodString;
2939
+ }, "strip", z.ZodTypeAny, {
2940
+ path: string;
2941
+ type: "patch";
2942
+ diff: string;
2943
+ change: "delete" | "add" | "update";
2944
+ movePath?: string | undefined;
2945
+ }, {
2946
+ path: string;
2947
+ type: "patch";
2948
+ diff: string;
2949
+ change: "delete" | "add" | "update";
2950
+ movePath?: string | undefined;
2951
+ }>, z.ZodObject<{
2952
+ type: z.ZodLiteral<"terminal">;
2953
+ terminalId: z.ZodString;
2954
+ }, "strip", z.ZodTypeAny, {
2955
+ type: "terminal";
2956
+ terminalId: string;
2957
+ }, {
2958
+ type: "terminal";
2959
+ terminalId: string;
2960
+ }>]>, "many">>;
2961
+ locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
2962
+ path: z.ZodString;
2963
+ line: z.ZodOptional<z.ZodNumber>;
2964
+ }, "strip", z.ZodTypeAny, {
2965
+ path: string;
2966
+ line?: number | undefined;
2967
+ }, {
2968
+ path: string;
2969
+ line?: number | undefined;
2970
+ }>, "many">>;
2971
+ detail: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2972
+ type: z.ZodLiteral<"mcp">;
2973
+ server: z.ZodString;
2974
+ tool: z.ZodString;
2975
+ }, "strip", z.ZodTypeAny, {
2976
+ type: "mcp";
2977
+ tool: string;
2978
+ server: string;
2979
+ }, {
2980
+ type: "mcp";
2981
+ tool: string;
2982
+ server: string;
2983
+ }>, z.ZodObject<{
2984
+ type: z.ZodLiteral<"subagent">;
2985
+ action: z.ZodDefault<z.ZodEnum<["spawn", "message", "wait", "stop", "resume", "list"]>>;
2986
+ task: z.ZodOptional<z.ZodString>;
2987
+ agentType: z.ZodOptional<z.ZodString>;
2988
+ model: z.ZodOptional<z.ZodString>;
2989
+ }, "strip", z.ZodTypeAny, {
2990
+ type: "subagent";
2991
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
2992
+ model?: string | undefined;
2993
+ task?: string | undefined;
2994
+ agentType?: string | undefined;
2995
+ }, {
2996
+ type: "subagent";
2997
+ model?: string | undefined;
2998
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
2999
+ task?: string | undefined;
3000
+ agentType?: string | undefined;
3001
+ }>, z.ZodObject<{
3002
+ type: z.ZodLiteral<"skill">;
3003
+ name: z.ZodString;
3004
+ description: z.ZodOptional<z.ZodString>;
3005
+ }, "strip", z.ZodTypeAny, {
3006
+ type: "skill";
3007
+ name: string;
3008
+ description?: string | undefined;
3009
+ }, {
3010
+ type: "skill";
3011
+ name: string;
3012
+ description?: string | undefined;
3013
+ }>, z.ZodObject<{
3014
+ type: z.ZodLiteral<"web_search">;
3015
+ query: z.ZodOptional<z.ZodString>;
3016
+ }, "strip", z.ZodTypeAny, {
3017
+ type: "web_search";
3018
+ query?: string | undefined;
3019
+ }, {
3020
+ type: "web_search";
3021
+ query?: string | undefined;
3022
+ }>, z.ZodObject<{
3023
+ type: z.ZodLiteral<"image_generation">;
3024
+ prompt: z.ZodOptional<z.ZodString>;
3025
+ }, "strip", z.ZodTypeAny, {
3026
+ type: "image_generation";
3027
+ prompt?: string | undefined;
3028
+ }, {
3029
+ type: "image_generation";
3030
+ prompt?: string | undefined;
3031
+ }>, z.ZodObject<{
3032
+ type: z.ZodLiteral<"compaction">;
3033
+ }, "strip", z.ZodTypeAny, {
3034
+ type: "compaction";
3035
+ }, {
3036
+ type: "compaction";
3037
+ }>, z.ZodObject<{
3038
+ type: z.ZodLiteral<"review">;
3039
+ phase: z.ZodEnum<["started", "finished"]>;
3040
+ }, "strip", z.ZodTypeAny, {
3041
+ type: "review";
3042
+ phase: "started" | "finished";
3043
+ }, {
3044
+ type: "review";
3045
+ phase: "started" | "finished";
3046
+ }>]>>;
3047
+ }, "strip", z.ZodTypeAny, {
3048
+ status: "pending" | "in_progress" | "completed" | "failed";
3049
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
3050
+ title: string;
3051
+ toolCallId: string;
3052
+ sessionUpdate: "tool_call";
3053
+ detail?: {
3054
+ type: "mcp";
3055
+ tool: string;
3056
+ server: string;
3057
+ } | {
3058
+ type: "subagent";
3059
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3060
+ model?: string | undefined;
3061
+ task?: string | undefined;
3062
+ agentType?: string | undefined;
3063
+ } | {
3064
+ type: "skill";
3065
+ name: string;
3066
+ description?: string | undefined;
3067
+ } | {
3068
+ type: "web_search";
3069
+ query?: string | undefined;
3070
+ } | {
3071
+ type: "image_generation";
3072
+ prompt?: string | undefined;
3073
+ } | {
3074
+ type: "compaction";
3075
+ } | {
3076
+ type: "review";
3077
+ phase: "started" | "finished";
3078
+ } | undefined;
3079
+ content?: ({
3080
+ type: "content";
3081
+ content: {
3082
+ type: "text";
3083
+ text: string;
3084
+ } | {
3085
+ type: "image";
3086
+ mimeType: string;
3087
+ data?: string | undefined;
3088
+ uri?: string | undefined;
3089
+ } | {
3090
+ type: "resource_link";
3091
+ name: string;
3092
+ uri: string;
3093
+ kind?: "agent" | "file" | "skill" | undefined;
3094
+ };
3095
+ } | {
3096
+ path: string;
3097
+ type: "diff";
3098
+ newText: string;
3099
+ oldText?: string | null | undefined;
3100
+ } | {
3101
+ path: string;
3102
+ type: "patch";
3103
+ diff: string;
3104
+ change: "delete" | "add" | "update";
3105
+ movePath?: string | undefined;
3106
+ } | {
3107
+ type: "terminal";
3108
+ terminalId: string;
3109
+ })[] | undefined;
3110
+ parentToolCallId?: string | undefined;
3111
+ rawInput?: unknown;
3112
+ locations?: {
3113
+ path: string;
3114
+ line?: number | undefined;
3115
+ }[] | undefined;
3116
+ }, {
3117
+ status: "pending" | "in_progress" | "completed" | "failed";
3118
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
3119
+ title: string;
3120
+ toolCallId: string;
3121
+ sessionUpdate: "tool_call";
3122
+ detail?: {
3123
+ type: "mcp";
3124
+ tool: string;
3125
+ server: string;
3126
+ } | {
3127
+ type: "subagent";
3128
+ model?: string | undefined;
3129
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
3130
+ task?: string | undefined;
3131
+ agentType?: string | undefined;
3132
+ } | {
3133
+ type: "skill";
3134
+ name: string;
3135
+ description?: string | undefined;
3136
+ } | {
3137
+ type: "web_search";
3138
+ query?: string | undefined;
3139
+ } | {
3140
+ type: "image_generation";
3141
+ prompt?: string | undefined;
3142
+ } | {
3143
+ type: "compaction";
3144
+ } | {
3145
+ type: "review";
3146
+ phase: "started" | "finished";
3147
+ } | undefined;
3148
+ content?: ({
3149
+ type: "content";
3150
+ content: {
3151
+ type: "text";
3152
+ text: string;
3153
+ } | {
3154
+ type: "image";
3155
+ mimeType: string;
3156
+ data?: string | undefined;
3157
+ uri?: string | undefined;
3158
+ } | {
3159
+ type: "resource_link";
3160
+ name: string;
3161
+ uri: string;
3162
+ kind?: "agent" | "file" | "skill" | undefined;
3163
+ };
3164
+ } | {
3165
+ path: string;
3166
+ type: "diff";
3167
+ newText: string;
3168
+ oldText?: string | null | undefined;
3169
+ } | {
3170
+ path: string;
3171
+ type: "patch";
3172
+ diff: string;
3173
+ change: "delete" | "add" | "update";
3174
+ movePath?: string | undefined;
3175
+ } | {
3176
+ type: "terminal";
3177
+ terminalId: string;
3178
+ })[] | undefined;
3179
+ parentToolCallId?: string | undefined;
3180
+ rawInput?: unknown;
3181
+ locations?: {
3182
+ path: string;
3183
+ line?: number | undefined;
3184
+ }[] | undefined;
3185
+ }>, z.ZodObject<{
3186
+ sessionUpdate: z.ZodLiteral<"tool_call_update">;
3187
+ toolCallId: z.ZodString;
3188
+ parentToolCallId: z.ZodOptional<z.ZodString>;
3189
+ status: z.ZodOptional<z.ZodEnum<["pending", "in_progress", "completed", "failed"]>>;
3190
+ title: z.ZodOptional<z.ZodString>;
3191
+ detail: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3192
+ type: z.ZodLiteral<"mcp">;
3193
+ server: z.ZodString;
3194
+ tool: z.ZodString;
3195
+ }, "strip", z.ZodTypeAny, {
3196
+ type: "mcp";
3197
+ tool: string;
3198
+ server: string;
3199
+ }, {
3200
+ type: "mcp";
3201
+ tool: string;
3202
+ server: string;
3203
+ }>, z.ZodObject<{
3204
+ type: z.ZodLiteral<"subagent">;
3205
+ action: z.ZodDefault<z.ZodEnum<["spawn", "message", "wait", "stop", "resume", "list"]>>;
3206
+ task: z.ZodOptional<z.ZodString>;
3207
+ agentType: z.ZodOptional<z.ZodString>;
3208
+ model: z.ZodOptional<z.ZodString>;
3209
+ }, "strip", z.ZodTypeAny, {
3210
+ type: "subagent";
3211
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3212
+ model?: string | undefined;
3213
+ task?: string | undefined;
3214
+ agentType?: string | undefined;
3215
+ }, {
3216
+ type: "subagent";
3217
+ model?: string | undefined;
3218
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
3219
+ task?: string | undefined;
3220
+ agentType?: string | undefined;
3221
+ }>, z.ZodObject<{
3222
+ type: z.ZodLiteral<"skill">;
3223
+ name: z.ZodString;
3224
+ description: z.ZodOptional<z.ZodString>;
3225
+ }, "strip", z.ZodTypeAny, {
3226
+ type: "skill";
3227
+ name: string;
3228
+ description?: string | undefined;
3229
+ }, {
3230
+ type: "skill";
3231
+ name: string;
3232
+ description?: string | undefined;
3233
+ }>, z.ZodObject<{
3234
+ type: z.ZodLiteral<"web_search">;
3235
+ query: z.ZodOptional<z.ZodString>;
3236
+ }, "strip", z.ZodTypeAny, {
3237
+ type: "web_search";
3238
+ query?: string | undefined;
3239
+ }, {
3240
+ type: "web_search";
3241
+ query?: string | undefined;
3242
+ }>, z.ZodObject<{
3243
+ type: z.ZodLiteral<"image_generation">;
3244
+ prompt: z.ZodOptional<z.ZodString>;
3245
+ }, "strip", z.ZodTypeAny, {
3246
+ type: "image_generation";
3247
+ prompt?: string | undefined;
3248
+ }, {
3249
+ type: "image_generation";
3250
+ prompt?: string | undefined;
3251
+ }>, z.ZodObject<{
3252
+ type: z.ZodLiteral<"compaction">;
3253
+ }, "strip", z.ZodTypeAny, {
3254
+ type: "compaction";
3255
+ }, {
3256
+ type: "compaction";
3257
+ }>, z.ZodObject<{
3258
+ type: z.ZodLiteral<"review">;
3259
+ phase: z.ZodEnum<["started", "finished"]>;
3260
+ }, "strip", z.ZodTypeAny, {
3261
+ type: "review";
3262
+ phase: "started" | "finished";
3263
+ }, {
3264
+ type: "review";
3265
+ phase: "started" | "finished";
3266
+ }>]>>;
3267
+ content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3268
+ type: z.ZodLiteral<"content">;
3269
+ content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3270
+ type: z.ZodLiteral<"text">;
3271
+ text: z.ZodString;
3272
+ }, "strip", z.ZodTypeAny, {
3273
+ type: "text";
3274
+ text: string;
3275
+ }, {
3276
+ type: "text";
3277
+ text: string;
3278
+ }>, z.ZodObject<{
3279
+ type: z.ZodLiteral<"image">;
3280
+ mimeType: z.ZodString;
3281
+ data: z.ZodOptional<z.ZodString>;
3282
+ uri: z.ZodOptional<z.ZodString>;
3283
+ }, "strip", z.ZodTypeAny, {
3284
+ type: "image";
3285
+ mimeType: string;
3286
+ data?: string | undefined;
3287
+ uri?: string | undefined;
3288
+ }, {
3289
+ type: "image";
3290
+ mimeType: string;
3291
+ data?: string | undefined;
3292
+ uri?: string | undefined;
3293
+ }>, z.ZodObject<{
3294
+ type: z.ZodLiteral<"resource_link">;
3295
+ uri: z.ZodString;
3296
+ name: z.ZodString;
3297
+ kind: z.ZodOptional<z.ZodEnum<["file", "skill", "agent"]>>;
3298
+ }, "strip", z.ZodTypeAny, {
3299
+ type: "resource_link";
3300
+ name: string;
3301
+ uri: string;
3302
+ kind?: "agent" | "file" | "skill" | undefined;
3303
+ }, {
3304
+ type: "resource_link";
3305
+ name: string;
3306
+ uri: string;
3307
+ kind?: "agent" | "file" | "skill" | undefined;
3308
+ }>]>;
3309
+ }, "strip", z.ZodTypeAny, {
3310
+ type: "content";
3311
+ content: {
3312
+ type: "text";
3313
+ text: string;
3314
+ } | {
3315
+ type: "image";
3316
+ mimeType: string;
3317
+ data?: string | undefined;
3318
+ uri?: string | undefined;
3319
+ } | {
3320
+ type: "resource_link";
3321
+ name: string;
3322
+ uri: string;
3323
+ kind?: "agent" | "file" | "skill" | undefined;
3324
+ };
3325
+ }, {
3326
+ type: "content";
3327
+ content: {
3328
+ type: "text";
3329
+ text: string;
3330
+ } | {
3331
+ type: "image";
3332
+ mimeType: string;
3333
+ data?: string | undefined;
3334
+ uri?: string | undefined;
3335
+ } | {
3336
+ type: "resource_link";
3337
+ name: string;
3338
+ uri: string;
3339
+ kind?: "agent" | "file" | "skill" | undefined;
3340
+ };
3341
+ }>, z.ZodObject<{
3342
+ type: z.ZodLiteral<"diff">;
3343
+ path: z.ZodString;
3344
+ oldText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3345
+ newText: z.ZodString;
3346
+ }, "strip", z.ZodTypeAny, {
3347
+ path: string;
3348
+ type: "diff";
3349
+ newText: string;
3350
+ oldText?: string | null | undefined;
3351
+ }, {
3352
+ path: string;
3353
+ type: "diff";
3354
+ newText: string;
3355
+ oldText?: string | null | undefined;
3356
+ }>, z.ZodObject<{
3357
+ type: z.ZodLiteral<"patch">;
3358
+ path: z.ZodString;
3359
+ change: z.ZodEnum<["add", "delete", "update"]>;
3360
+ movePath: z.ZodOptional<z.ZodString>;
3361
+ diff: z.ZodString;
3362
+ }, "strip", z.ZodTypeAny, {
3363
+ path: string;
3364
+ type: "patch";
3365
+ diff: string;
3366
+ change: "delete" | "add" | "update";
3367
+ movePath?: string | undefined;
3368
+ }, {
3369
+ path: string;
3370
+ type: "patch";
3371
+ diff: string;
3372
+ change: "delete" | "add" | "update";
3373
+ movePath?: string | undefined;
3374
+ }>, z.ZodObject<{
3375
+ type: z.ZodLiteral<"terminal">;
3376
+ terminalId: z.ZodString;
3377
+ }, "strip", z.ZodTypeAny, {
3378
+ type: "terminal";
3379
+ terminalId: string;
3380
+ }, {
3381
+ type: "terminal";
3382
+ terminalId: string;
3383
+ }>]>, "many">>;
3384
+ appendOutput: z.ZodOptional<z.ZodString>;
3385
+ rawOutput: z.ZodOptional<z.ZodUnknown>;
3386
+ }, "strip", z.ZodTypeAny, {
3387
+ toolCallId: string;
3388
+ sessionUpdate: "tool_call_update";
3389
+ status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
3390
+ title?: string | undefined;
3391
+ detail?: {
3392
+ type: "mcp";
3393
+ tool: string;
3394
+ server: string;
3395
+ } | {
3396
+ type: "subagent";
3397
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3398
+ model?: string | undefined;
3399
+ task?: string | undefined;
3400
+ agentType?: string | undefined;
3401
+ } | {
3402
+ type: "skill";
3403
+ name: string;
3404
+ description?: string | undefined;
3405
+ } | {
3406
+ type: "web_search";
3407
+ query?: string | undefined;
3408
+ } | {
3409
+ type: "image_generation";
3410
+ prompt?: string | undefined;
3411
+ } | {
3412
+ type: "compaction";
3413
+ } | {
3414
+ type: "review";
3415
+ phase: "started" | "finished";
3416
+ } | undefined;
3417
+ content?: ({
3418
+ type: "content";
3419
+ content: {
3420
+ type: "text";
3421
+ text: string;
3422
+ } | {
3423
+ type: "image";
3424
+ mimeType: string;
3425
+ data?: string | undefined;
3426
+ uri?: string | undefined;
3427
+ } | {
3428
+ type: "resource_link";
3429
+ name: string;
3430
+ uri: string;
3431
+ kind?: "agent" | "file" | "skill" | undefined;
3432
+ };
3433
+ } | {
3434
+ path: string;
3435
+ type: "diff";
3436
+ newText: string;
3437
+ oldText?: string | null | undefined;
3438
+ } | {
3439
+ path: string;
3440
+ type: "patch";
3441
+ diff: string;
3442
+ change: "delete" | "add" | "update";
3443
+ movePath?: string | undefined;
3444
+ } | {
3445
+ type: "terminal";
3446
+ terminalId: string;
3447
+ })[] | undefined;
3448
+ parentToolCallId?: string | undefined;
3449
+ appendOutput?: string | undefined;
3450
+ rawOutput?: unknown;
3451
+ }, {
3452
+ toolCallId: string;
3453
+ sessionUpdate: "tool_call_update";
3454
+ status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
3455
+ title?: string | undefined;
3456
+ detail?: {
3457
+ type: "mcp";
3458
+ tool: string;
3459
+ server: string;
3460
+ } | {
3461
+ type: "subagent";
3462
+ model?: string | undefined;
3463
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
3464
+ task?: string | undefined;
3465
+ agentType?: string | undefined;
3466
+ } | {
3467
+ type: "skill";
3468
+ name: string;
3469
+ description?: string | undefined;
3470
+ } | {
3471
+ type: "web_search";
3472
+ query?: string | undefined;
3473
+ } | {
3474
+ type: "image_generation";
3475
+ prompt?: string | undefined;
3476
+ } | {
3477
+ type: "compaction";
3478
+ } | {
3479
+ type: "review";
3480
+ phase: "started" | "finished";
3481
+ } | undefined;
3482
+ content?: ({
3483
+ type: "content";
3484
+ content: {
3485
+ type: "text";
3486
+ text: string;
3487
+ } | {
3488
+ type: "image";
3489
+ mimeType: string;
3490
+ data?: string | undefined;
3491
+ uri?: string | undefined;
3492
+ } | {
3493
+ type: "resource_link";
3494
+ name: string;
3495
+ uri: string;
3496
+ kind?: "agent" | "file" | "skill" | undefined;
3497
+ };
3498
+ } | {
3499
+ path: string;
3500
+ type: "diff";
3501
+ newText: string;
3502
+ oldText?: string | null | undefined;
3503
+ } | {
3504
+ path: string;
3505
+ type: "patch";
3506
+ diff: string;
3507
+ change: "delete" | "add" | "update";
3508
+ movePath?: string | undefined;
3509
+ } | {
3510
+ type: "terminal";
3511
+ terminalId: string;
3512
+ })[] | undefined;
3513
+ parentToolCallId?: string | undefined;
3514
+ appendOutput?: string | undefined;
3515
+ rawOutput?: unknown;
3516
+ }>, z.ZodObject<{
3517
+ sessionUpdate: z.ZodLiteral<"plan">;
3518
+ entries: z.ZodArray<z.ZodObject<{
3519
+ content: z.ZodString;
3520
+ priority: z.ZodDefault<z.ZodEnum<["high", "medium", "low"]>>;
3521
+ status: z.ZodEnum<["pending", "in_progress", "completed"]>;
3522
+ }, "strip", z.ZodTypeAny, {
3523
+ status: "pending" | "in_progress" | "completed";
3524
+ content: string;
3525
+ priority: "high" | "medium" | "low";
3526
+ }, {
3527
+ status: "pending" | "in_progress" | "completed";
3528
+ content: string;
3529
+ priority?: "high" | "medium" | "low" | undefined;
3530
+ }>, "many">;
3531
+ }, "strip", z.ZodTypeAny, {
3532
+ entries: {
3533
+ status: "pending" | "in_progress" | "completed";
3534
+ content: string;
3535
+ priority: "high" | "medium" | "low";
3536
+ }[];
3537
+ sessionUpdate: "plan";
3538
+ }, {
3539
+ entries: {
3540
+ status: "pending" | "in_progress" | "completed";
3541
+ content: string;
3542
+ priority?: "high" | "medium" | "low" | undefined;
3543
+ }[];
3544
+ sessionUpdate: "plan";
3545
+ }>, z.ZodObject<{
3546
+ sessionUpdate: z.ZodLiteral<"available_commands_update">;
3547
+ availableCommands: z.ZodArray<z.ZodObject<{
3548
+ name: z.ZodString;
3549
+ description: z.ZodString;
3550
+ hint: z.ZodOptional<z.ZodString>;
3551
+ }, "strip", z.ZodTypeAny, {
3552
+ name: string;
3553
+ description: string;
3554
+ hint?: string | undefined;
3555
+ }, {
3556
+ name: string;
3557
+ description: string;
3558
+ hint?: string | undefined;
3559
+ }>, "many">;
3560
+ }, "strip", z.ZodTypeAny, {
3561
+ sessionUpdate: "available_commands_update";
3562
+ availableCommands: {
3563
+ name: string;
3564
+ description: string;
3565
+ hint?: string | undefined;
3566
+ }[];
3567
+ }, {
3568
+ sessionUpdate: "available_commands_update";
3569
+ availableCommands: {
3570
+ name: string;
3571
+ description: string;
3572
+ hint?: string | undefined;
3573
+ }[];
3574
+ }>, z.ZodObject<{
3575
+ sessionUpdate: z.ZodLiteral<"current_mode_update">;
3576
+ currentModeId: z.ZodString;
3577
+ }, "strip", z.ZodTypeAny, {
3578
+ sessionUpdate: "current_mode_update";
3579
+ currentModeId: string;
3580
+ }, {
3581
+ sessionUpdate: "current_mode_update";
3582
+ currentModeId: string;
3583
+ }>, z.ZodObject<{
3584
+ sessionUpdate: z.ZodLiteral<"session_info_update">;
3585
+ title: z.ZodOptional<z.ZodString>;
3586
+ model: z.ZodOptional<z.ZodString>;
3587
+ }, "strip", z.ZodTypeAny, {
3588
+ sessionUpdate: "session_info_update";
3589
+ title?: string | undefined;
3590
+ model?: string | undefined;
3591
+ }, {
3592
+ sessionUpdate: "session_info_update";
3593
+ title?: string | undefined;
3594
+ model?: string | undefined;
3595
+ }>, z.ZodObject<{
3596
+ sessionUpdate: z.ZodLiteral<"usage_update">;
3597
+ usedTokens: z.ZodOptional<z.ZodNumber>;
3598
+ contextWindow: z.ZodOptional<z.ZodNumber>;
3599
+ }, "strip", z.ZodTypeAny, {
3600
+ sessionUpdate: "usage_update";
3601
+ usedTokens?: number | undefined;
3602
+ contextWindow?: number | undefined;
3603
+ }, {
3604
+ sessionUpdate: "usage_update";
3605
+ usedTokens?: number | undefined;
3606
+ contextWindow?: number | undefined;
3607
+ }>, z.ZodObject<{
3608
+ sessionUpdate: z.ZodLiteral<"ls_message_done">;
3609
+ parentToolCallId: z.ZodOptional<z.ZodString>;
3610
+ messageId: z.ZodString;
3611
+ role: z.ZodEnum<["agent", "thought", "user"]>;
3612
+ }, "strip", z.ZodTypeAny, {
3613
+ sessionUpdate: "ls_message_done";
3614
+ messageId: string;
3615
+ role: "agent" | "thought" | "user";
3616
+ parentToolCallId?: string | undefined;
3617
+ }, {
3618
+ sessionUpdate: "ls_message_done";
3619
+ messageId: string;
3620
+ role: "agent" | "thought" | "user";
3621
+ parentToolCallId?: string | undefined;
3622
+ }>, z.ZodObject<{
3623
+ sessionUpdate: z.ZodLiteral<"ls_config">;
3624
+ options: z.ZodArray<z.ZodObject<{
3625
+ id: z.ZodString;
3626
+ name: z.ZodString;
3627
+ category: z.ZodDefault<z.ZodEnum<["model", "mode", "effort", "other"]>>;
3628
+ current: z.ZodString;
3629
+ values: z.ZodArray<z.ZodObject<{
3630
+ value: z.ZodString;
3631
+ name: z.ZodString;
3632
+ description: z.ZodOptional<z.ZodString>;
3633
+ }, "strip", z.ZodTypeAny, {
3634
+ value: string;
3635
+ name: string;
3636
+ description?: string | undefined;
3637
+ }, {
3638
+ value: string;
3639
+ name: string;
3640
+ description?: string | undefined;
3641
+ }>, "many">;
3642
+ }, "strip", z.ZodTypeAny, {
3643
+ values: {
3644
+ value: string;
3645
+ name: string;
3646
+ description?: string | undefined;
3647
+ }[];
3648
+ id: string;
3649
+ name: string;
3650
+ category: "other" | "model" | "mode" | "effort";
3651
+ current: string;
3652
+ }, {
3653
+ values: {
3654
+ value: string;
3655
+ name: string;
3656
+ description?: string | undefined;
3657
+ }[];
3658
+ id: string;
3659
+ name: string;
3660
+ current: string;
3661
+ category?: "other" | "model" | "mode" | "effort" | undefined;
3662
+ }>, "many">;
3663
+ }, "strip", z.ZodTypeAny, {
3664
+ options: {
3665
+ values: {
3666
+ value: string;
3667
+ name: string;
3668
+ description?: string | undefined;
3669
+ }[];
3670
+ id: string;
3671
+ name: string;
3672
+ category: "other" | "model" | "mode" | "effort";
3673
+ current: string;
3674
+ }[];
3675
+ sessionUpdate: "ls_config";
3676
+ }, {
3677
+ options: {
3678
+ values: {
3679
+ value: string;
3680
+ name: string;
3681
+ description?: string | undefined;
3682
+ }[];
3683
+ id: string;
3684
+ name: string;
3685
+ current: string;
3686
+ category?: "other" | "model" | "mode" | "effort" | undefined;
3687
+ }[];
3688
+ sessionUpdate: "ls_config";
3689
+ }>, z.ZodObject<{
3690
+ sessionUpdate: z.ZodLiteral<"ls_notice">;
3691
+ level: z.ZodEnum<["info", "warning"]>;
3692
+ title: z.ZodString;
3693
+ detail: z.ZodOptional<z.ZodString>;
3694
+ }, "strip", z.ZodTypeAny, {
3695
+ title: string;
3696
+ sessionUpdate: "ls_notice";
3697
+ level: "info" | "warning";
3698
+ detail?: string | undefined;
3699
+ }, {
3700
+ title: string;
3701
+ sessionUpdate: "ls_notice";
3702
+ level: "info" | "warning";
3703
+ detail?: string | undefined;
3704
+ }>, z.ZodObject<{
3705
+ sessionUpdate: z.ZodLiteral<"ls_turn">;
3706
+ parentToolCallId: z.ZodOptional<z.ZodString>;
3707
+ state: z.ZodEnum<["started", "ended"]>;
3708
+ turnId: z.ZodOptional<z.ZodString>;
3709
+ stopReason: z.ZodOptional<z.ZodEnum<["end_turn", "cancelled", "error", "max_tokens", "refusal"]>>;
3710
+ }, "strip", z.ZodTypeAny, {
3711
+ state: "started" | "ended";
3712
+ sessionUpdate: "ls_turn";
3713
+ parentToolCallId?: string | undefined;
3714
+ turnId?: string | undefined;
3715
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
3716
+ }, {
3717
+ state: "started" | "ended";
3718
+ sessionUpdate: "ls_turn";
3719
+ parentToolCallId?: string | undefined;
3720
+ turnId?: string | undefined;
3721
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
3722
+ }>, z.ZodObject<{
3723
+ sessionUpdate: z.ZodLiteral<"ls_permission">;
3724
+ requestId: z.ZodString;
3725
+ toolCallId: z.ZodOptional<z.ZodString>;
3726
+ title: z.ZodString;
3727
+ detail: z.ZodOptional<z.ZodString>;
3728
+ options: z.ZodArray<z.ZodObject<{
3729
+ optionId: z.ZodString;
3730
+ name: z.ZodString;
3731
+ kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
3732
+ }, "strip", z.ZodTypeAny, {
3733
+ optionId: string;
3734
+ name: string;
3735
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3736
+ }, {
3737
+ optionId: string;
3738
+ name: string;
3739
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3740
+ }>, "many">;
3741
+ }, "strip", z.ZodTypeAny, {
3742
+ options: {
3743
+ optionId: string;
3744
+ name: string;
3745
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3746
+ }[];
3747
+ title: string;
3748
+ requestId: string;
3749
+ sessionUpdate: "ls_permission";
3750
+ toolCallId?: string | undefined;
3751
+ detail?: string | undefined;
3752
+ }, {
3753
+ options: {
3754
+ optionId: string;
3755
+ name: string;
3756
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3757
+ }[];
3758
+ title: string;
3759
+ requestId: string;
3760
+ sessionUpdate: "ls_permission";
3761
+ toolCallId?: string | undefined;
3762
+ detail?: string | undefined;
3763
+ }>, z.ZodObject<{
3764
+ sessionUpdate: z.ZodLiteral<"ls_permission_resolved">;
3765
+ requestId: z.ZodString;
3766
+ optionId: z.ZodOptional<z.ZodString>;
3767
+ }, "strip", z.ZodTypeAny, {
3768
+ requestId: string;
3769
+ sessionUpdate: "ls_permission_resolved";
3770
+ optionId?: string | undefined;
3771
+ }, {
3772
+ requestId: string;
3773
+ sessionUpdate: "ls_permission_resolved";
3774
+ optionId?: string | undefined;
3775
+ }>, z.ZodObject<{
3776
+ sessionUpdate: z.ZodLiteral<"ls_driver">;
3777
+ driver: z.ZodEnum<["desktop", "remote", "none"]>;
3778
+ deviceId: z.ZodOptional<z.ZodString>;
3779
+ }, "strip", z.ZodTypeAny, {
3780
+ driver: "remote" | "desktop" | "none";
3781
+ sessionUpdate: "ls_driver";
3782
+ deviceId?: string | undefined;
3783
+ }, {
3784
+ driver: "remote" | "desktop" | "none";
3785
+ sessionUpdate: "ls_driver";
3786
+ deviceId?: string | undefined;
3787
+ }>, z.ZodObject<{
3788
+ sessionUpdate: z.ZodLiteral<"ls_status">;
3789
+ state: z.ZodEnum<["idle", "running", "waiting", "error", "offline"]>;
3790
+ }, "strip", z.ZodTypeAny, {
3791
+ state: "idle" | "running" | "waiting" | "error" | "offline";
3792
+ sessionUpdate: "ls_status";
3793
+ }, {
3794
+ state: "idle" | "running" | "waiting" | "error" | "offline";
3795
+ sessionUpdate: "ls_status";
3796
+ }>, z.ZodObject<{
3797
+ sessionUpdate: z.ZodLiteral<"ls_error">;
3798
+ code: z.ZodString;
3799
+ message: z.ZodString;
3800
+ hint: z.ZodOptional<z.ZodString>;
3801
+ }, "strip", z.ZodTypeAny, {
3802
+ code: string;
3803
+ message: string;
3804
+ sessionUpdate: "ls_error";
3805
+ hint?: string | undefined;
3806
+ }, {
3807
+ code: string;
3808
+ message: string;
3809
+ sessionUpdate: "ls_error";
3810
+ hint?: string | undefined;
3811
+ }>]>;
3812
+ }, "strip", z.ZodTypeAny, {
3813
+ update: {
3814
+ content: {
3815
+ type: "text";
3816
+ text: string;
3817
+ } | {
3818
+ type: "image";
3819
+ mimeType: string;
3820
+ data?: string | undefined;
3821
+ uri?: string | undefined;
3822
+ } | {
3823
+ type: "resource_link";
3824
+ name: string;
3825
+ uri: string;
3826
+ kind?: "agent" | "file" | "skill" | undefined;
3827
+ };
3828
+ sessionUpdate: "user_message_chunk";
3829
+ messageId?: string | undefined;
3830
+ } | {
3831
+ content: {
3832
+ type: "text";
3833
+ text: string;
3834
+ } | {
3835
+ type: "image";
3836
+ mimeType: string;
3837
+ data?: string | undefined;
3838
+ uri?: string | undefined;
3839
+ } | {
3840
+ type: "resource_link";
3841
+ name: string;
3842
+ uri: string;
3843
+ kind?: "agent" | "file" | "skill" | undefined;
3844
+ };
3845
+ sessionUpdate: "agent_message_chunk";
3846
+ messageId: string;
3847
+ parentToolCallId?: string | undefined;
3848
+ } | {
3849
+ content: {
3850
+ type: "text";
3851
+ text: string;
3852
+ } | {
3853
+ type: "image";
3854
+ mimeType: string;
3855
+ data?: string | undefined;
3856
+ uri?: string | undefined;
3857
+ } | {
3858
+ type: "resource_link";
3859
+ name: string;
3860
+ uri: string;
3861
+ kind?: "agent" | "file" | "skill" | undefined;
3862
+ };
3863
+ sessionUpdate: "agent_thought_chunk";
3864
+ messageId: string;
3865
+ parentToolCallId?: string | undefined;
3866
+ } | {
3867
+ status: "pending" | "in_progress" | "completed" | "failed";
3868
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
3869
+ title: string;
3870
+ toolCallId: string;
3871
+ sessionUpdate: "tool_call";
3872
+ detail?: {
3873
+ type: "mcp";
3874
+ tool: string;
3875
+ server: string;
3876
+ } | {
3877
+ type: "subagent";
3878
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3879
+ model?: string | undefined;
3880
+ task?: string | undefined;
3881
+ agentType?: string | undefined;
3882
+ } | {
3883
+ type: "skill";
3884
+ name: string;
3885
+ description?: string | undefined;
3886
+ } | {
3887
+ type: "web_search";
3888
+ query?: string | undefined;
3889
+ } | {
3890
+ type: "image_generation";
3891
+ prompt?: string | undefined;
3892
+ } | {
3893
+ type: "compaction";
3894
+ } | {
3895
+ type: "review";
3896
+ phase: "started" | "finished";
3897
+ } | undefined;
3898
+ content?: ({
3899
+ type: "content";
3900
+ content: {
3901
+ type: "text";
3902
+ text: string;
3903
+ } | {
3904
+ type: "image";
3905
+ mimeType: string;
3906
+ data?: string | undefined;
3907
+ uri?: string | undefined;
3908
+ } | {
3909
+ type: "resource_link";
3910
+ name: string;
3911
+ uri: string;
3912
+ kind?: "agent" | "file" | "skill" | undefined;
3913
+ };
3914
+ } | {
3915
+ path: string;
3916
+ type: "diff";
3917
+ newText: string;
3918
+ oldText?: string | null | undefined;
3919
+ } | {
3920
+ path: string;
3921
+ type: "patch";
3922
+ diff: string;
3923
+ change: "delete" | "add" | "update";
3924
+ movePath?: string | undefined;
3925
+ } | {
3926
+ type: "terminal";
3927
+ terminalId: string;
3928
+ })[] | undefined;
3929
+ parentToolCallId?: string | undefined;
3930
+ rawInput?: unknown;
3931
+ locations?: {
3932
+ path: string;
3933
+ line?: number | undefined;
3934
+ }[] | undefined;
3935
+ } | {
3936
+ toolCallId: string;
3937
+ sessionUpdate: "tool_call_update";
3938
+ status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
3939
+ title?: string | undefined;
3940
+ detail?: {
3941
+ type: "mcp";
3942
+ tool: string;
3943
+ server: string;
3944
+ } | {
3945
+ type: "subagent";
3946
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3947
+ model?: string | undefined;
3948
+ task?: string | undefined;
3949
+ agentType?: string | undefined;
3950
+ } | {
3951
+ type: "skill";
3952
+ name: string;
3953
+ description?: string | undefined;
3954
+ } | {
3955
+ type: "web_search";
3956
+ query?: string | undefined;
3957
+ } | {
3958
+ type: "image_generation";
3959
+ prompt?: string | undefined;
3960
+ } | {
3961
+ type: "compaction";
3962
+ } | {
3963
+ type: "review";
3964
+ phase: "started" | "finished";
3965
+ } | undefined;
3966
+ content?: ({
3967
+ type: "content";
3968
+ content: {
3969
+ type: "text";
3970
+ text: string;
3971
+ } | {
3972
+ type: "image";
3973
+ mimeType: string;
3974
+ data?: string | undefined;
3975
+ uri?: string | undefined;
3976
+ } | {
3977
+ type: "resource_link";
3978
+ name: string;
3979
+ uri: string;
3980
+ kind?: "agent" | "file" | "skill" | undefined;
3981
+ };
3982
+ } | {
3983
+ path: string;
3984
+ type: "diff";
3985
+ newText: string;
3986
+ oldText?: string | null | undefined;
3987
+ } | {
3988
+ path: string;
3989
+ type: "patch";
3990
+ diff: string;
3991
+ change: "delete" | "add" | "update";
3992
+ movePath?: string | undefined;
3993
+ } | {
3994
+ type: "terminal";
3995
+ terminalId: string;
3996
+ })[] | undefined;
3997
+ parentToolCallId?: string | undefined;
3998
+ appendOutput?: string | undefined;
3999
+ rawOutput?: unknown;
4000
+ } | {
4001
+ entries: {
4002
+ status: "pending" | "in_progress" | "completed";
4003
+ content: string;
4004
+ priority: "high" | "medium" | "low";
4005
+ }[];
4006
+ sessionUpdate: "plan";
4007
+ } | {
4008
+ sessionUpdate: "available_commands_update";
4009
+ availableCommands: {
4010
+ name: string;
4011
+ description: string;
4012
+ hint?: string | undefined;
4013
+ }[];
4014
+ } | {
4015
+ sessionUpdate: "current_mode_update";
4016
+ currentModeId: string;
4017
+ } | {
4018
+ sessionUpdate: "session_info_update";
4019
+ title?: string | undefined;
4020
+ model?: string | undefined;
4021
+ } | {
4022
+ sessionUpdate: "usage_update";
4023
+ usedTokens?: number | undefined;
4024
+ contextWindow?: number | undefined;
4025
+ } | {
4026
+ sessionUpdate: "ls_message_done";
4027
+ messageId: string;
4028
+ role: "agent" | "thought" | "user";
4029
+ parentToolCallId?: string | undefined;
4030
+ } | {
4031
+ options: {
4032
+ values: {
4033
+ value: string;
4034
+ name: string;
4035
+ description?: string | undefined;
4036
+ }[];
4037
+ id: string;
4038
+ name: string;
4039
+ category: "other" | "model" | "mode" | "effort";
4040
+ current: string;
4041
+ }[];
4042
+ sessionUpdate: "ls_config";
4043
+ } | {
4044
+ title: string;
4045
+ sessionUpdate: "ls_notice";
4046
+ level: "info" | "warning";
4047
+ detail?: string | undefined;
4048
+ } | {
4049
+ state: "started" | "ended";
4050
+ sessionUpdate: "ls_turn";
4051
+ parentToolCallId?: string | undefined;
4052
+ turnId?: string | undefined;
4053
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
4054
+ } | {
4055
+ options: {
4056
+ optionId: string;
4057
+ name: string;
4058
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4059
+ }[];
4060
+ title: string;
4061
+ requestId: string;
4062
+ sessionUpdate: "ls_permission";
4063
+ toolCallId?: string | undefined;
4064
+ detail?: string | undefined;
4065
+ } | {
4066
+ requestId: string;
4067
+ sessionUpdate: "ls_permission_resolved";
4068
+ optionId?: string | undefined;
4069
+ } | {
4070
+ driver: "remote" | "desktop" | "none";
4071
+ sessionUpdate: "ls_driver";
4072
+ deviceId?: string | undefined;
4073
+ } | {
4074
+ state: "idle" | "running" | "waiting" | "error" | "offline";
4075
+ sessionUpdate: "ls_status";
4076
+ } | {
4077
+ code: string;
4078
+ message: string;
4079
+ sessionUpdate: "ls_error";
4080
+ hint?: string | undefined;
4081
+ };
4082
+ sessionId: string;
4083
+ seq: number;
4084
+ ts: number;
4085
+ }, {
4086
+ update: {
4087
+ content: {
4088
+ type: "text";
4089
+ text: string;
4090
+ } | {
4091
+ type: "image";
4092
+ mimeType: string;
4093
+ data?: string | undefined;
4094
+ uri?: string | undefined;
4095
+ } | {
4096
+ type: "resource_link";
4097
+ name: string;
4098
+ uri: string;
4099
+ kind?: "agent" | "file" | "skill" | undefined;
4100
+ };
4101
+ sessionUpdate: "user_message_chunk";
4102
+ messageId?: string | undefined;
4103
+ } | {
4104
+ content: {
4105
+ type: "text";
4106
+ text: string;
4107
+ } | {
4108
+ type: "image";
4109
+ mimeType: string;
4110
+ data?: string | undefined;
4111
+ uri?: string | undefined;
4112
+ } | {
4113
+ type: "resource_link";
4114
+ name: string;
4115
+ uri: string;
4116
+ kind?: "agent" | "file" | "skill" | undefined;
4117
+ };
4118
+ sessionUpdate: "agent_message_chunk";
4119
+ messageId: string;
4120
+ parentToolCallId?: string | undefined;
4121
+ } | {
4122
+ content: {
4123
+ type: "text";
4124
+ text: string;
4125
+ } | {
4126
+ type: "image";
4127
+ mimeType: string;
4128
+ data?: string | undefined;
4129
+ uri?: string | undefined;
4130
+ } | {
4131
+ type: "resource_link";
4132
+ name: string;
4133
+ uri: string;
4134
+ kind?: "agent" | "file" | "skill" | undefined;
4135
+ };
4136
+ sessionUpdate: "agent_thought_chunk";
4137
+ messageId: string;
4138
+ parentToolCallId?: string | undefined;
4139
+ } | {
4140
+ status: "pending" | "in_progress" | "completed" | "failed";
4141
+ kind: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other";
4142
+ title: string;
4143
+ toolCallId: string;
4144
+ sessionUpdate: "tool_call";
4145
+ detail?: {
4146
+ type: "mcp";
4147
+ tool: string;
4148
+ server: string;
4149
+ } | {
4150
+ type: "subagent";
4151
+ model?: string | undefined;
4152
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
4153
+ task?: string | undefined;
4154
+ agentType?: string | undefined;
4155
+ } | {
4156
+ type: "skill";
4157
+ name: string;
4158
+ description?: string | undefined;
4159
+ } | {
4160
+ type: "web_search";
4161
+ query?: string | undefined;
4162
+ } | {
4163
+ type: "image_generation";
4164
+ prompt?: string | undefined;
4165
+ } | {
4166
+ type: "compaction";
4167
+ } | {
4168
+ type: "review";
4169
+ phase: "started" | "finished";
4170
+ } | undefined;
4171
+ content?: ({
4172
+ type: "content";
4173
+ content: {
4174
+ type: "text";
4175
+ text: string;
4176
+ } | {
4177
+ type: "image";
4178
+ mimeType: string;
4179
+ data?: string | undefined;
4180
+ uri?: string | undefined;
4181
+ } | {
4182
+ type: "resource_link";
4183
+ name: string;
4184
+ uri: string;
4185
+ kind?: "agent" | "file" | "skill" | undefined;
4186
+ };
4187
+ } | {
4188
+ path: string;
4189
+ type: "diff";
4190
+ newText: string;
4191
+ oldText?: string | null | undefined;
4192
+ } | {
4193
+ path: string;
4194
+ type: "patch";
4195
+ diff: string;
4196
+ change: "delete" | "add" | "update";
4197
+ movePath?: string | undefined;
4198
+ } | {
4199
+ type: "terminal";
4200
+ terminalId: string;
4201
+ })[] | undefined;
4202
+ parentToolCallId?: string | undefined;
4203
+ rawInput?: unknown;
4204
+ locations?: {
4205
+ path: string;
4206
+ line?: number | undefined;
4207
+ }[] | undefined;
4208
+ } | {
4209
+ toolCallId: string;
4210
+ sessionUpdate: "tool_call_update";
4211
+ status?: "pending" | "in_progress" | "completed" | "failed" | undefined;
4212
+ title?: string | undefined;
4213
+ detail?: {
4214
+ type: "mcp";
4215
+ tool: string;
4216
+ server: string;
4217
+ } | {
4218
+ type: "subagent";
4219
+ model?: string | undefined;
4220
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
4221
+ task?: string | undefined;
4222
+ agentType?: string | undefined;
4223
+ } | {
4224
+ type: "skill";
4225
+ name: string;
4226
+ description?: string | undefined;
4227
+ } | {
4228
+ type: "web_search";
4229
+ query?: string | undefined;
4230
+ } | {
4231
+ type: "image_generation";
4232
+ prompt?: string | undefined;
4233
+ } | {
4234
+ type: "compaction";
4235
+ } | {
4236
+ type: "review";
4237
+ phase: "started" | "finished";
4238
+ } | undefined;
4239
+ content?: ({
4240
+ type: "content";
4241
+ content: {
4242
+ type: "text";
4243
+ text: string;
4244
+ } | {
4245
+ type: "image";
4246
+ mimeType: string;
4247
+ data?: string | undefined;
4248
+ uri?: string | undefined;
4249
+ } | {
4250
+ type: "resource_link";
4251
+ name: string;
4252
+ uri: string;
4253
+ kind?: "agent" | "file" | "skill" | undefined;
4254
+ };
4255
+ } | {
4256
+ path: string;
4257
+ type: "diff";
4258
+ newText: string;
4259
+ oldText?: string | null | undefined;
4260
+ } | {
4261
+ path: string;
4262
+ type: "patch";
4263
+ diff: string;
4264
+ change: "delete" | "add" | "update";
4265
+ movePath?: string | undefined;
4266
+ } | {
4267
+ type: "terminal";
4268
+ terminalId: string;
4269
+ })[] | undefined;
4270
+ parentToolCallId?: string | undefined;
4271
+ appendOutput?: string | undefined;
4272
+ rawOutput?: unknown;
4273
+ } | {
4274
+ entries: {
4275
+ status: "pending" | "in_progress" | "completed";
4276
+ content: string;
4277
+ priority?: "high" | "medium" | "low" | undefined;
4278
+ }[];
4279
+ sessionUpdate: "plan";
4280
+ } | {
4281
+ sessionUpdate: "available_commands_update";
4282
+ availableCommands: {
4283
+ name: string;
4284
+ description: string;
4285
+ hint?: string | undefined;
4286
+ }[];
4287
+ } | {
4288
+ sessionUpdate: "current_mode_update";
4289
+ currentModeId: string;
4290
+ } | {
4291
+ sessionUpdate: "session_info_update";
4292
+ title?: string | undefined;
4293
+ model?: string | undefined;
4294
+ } | {
4295
+ sessionUpdate: "usage_update";
4296
+ usedTokens?: number | undefined;
4297
+ contextWindow?: number | undefined;
4298
+ } | {
4299
+ sessionUpdate: "ls_message_done";
4300
+ messageId: string;
4301
+ role: "agent" | "thought" | "user";
4302
+ parentToolCallId?: string | undefined;
4303
+ } | {
4304
+ options: {
4305
+ values: {
4306
+ value: string;
4307
+ name: string;
4308
+ description?: string | undefined;
4309
+ }[];
4310
+ id: string;
4311
+ name: string;
4312
+ current: string;
4313
+ category?: "other" | "model" | "mode" | "effort" | undefined;
4314
+ }[];
4315
+ sessionUpdate: "ls_config";
4316
+ } | {
4317
+ title: string;
4318
+ sessionUpdate: "ls_notice";
4319
+ level: "info" | "warning";
4320
+ detail?: string | undefined;
4321
+ } | {
4322
+ state: "started" | "ended";
4323
+ sessionUpdate: "ls_turn";
4324
+ parentToolCallId?: string | undefined;
4325
+ turnId?: string | undefined;
4326
+ stopReason?: "error" | "end_turn" | "cancelled" | "max_tokens" | "refusal" | undefined;
4327
+ } | {
4328
+ options: {
4329
+ optionId: string;
4330
+ name: string;
4331
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4332
+ }[];
4333
+ title: string;
4334
+ requestId: string;
4335
+ sessionUpdate: "ls_permission";
4336
+ toolCallId?: string | undefined;
4337
+ detail?: string | undefined;
4338
+ } | {
4339
+ requestId: string;
4340
+ sessionUpdate: "ls_permission_resolved";
4341
+ optionId?: string | undefined;
4342
+ } | {
4343
+ driver: "remote" | "desktop" | "none";
4344
+ sessionUpdate: "ls_driver";
4345
+ deviceId?: string | undefined;
4346
+ } | {
4347
+ state: "idle" | "running" | "waiting" | "error" | "offline";
4348
+ sessionUpdate: "ls_status";
4349
+ } | {
4350
+ code: string;
4351
+ message: string;
4352
+ sessionUpdate: "ls_error";
4353
+ hint?: string | undefined;
4354
+ };
4355
+ sessionId: string;
4356
+ seq: number;
4357
+ ts: number;
4358
+ }>;
4359
+ readonly "session.summary": z.ZodObject<{
4360
+ session: z.ZodObject<{
4361
+ id: z.ZodString;
4362
+ agent: z.ZodString;
4363
+ nativeId: z.ZodString;
4364
+ title: z.ZodOptional<z.ZodString>;
4365
+ preview: z.ZodOptional<z.ZodString>;
4366
+ cwd: z.ZodString;
4367
+ state: z.ZodEnum<["idle", "running", "waiting", "error", "offline"]>;
4368
+ driver: z.ZodOptional<z.ZodEnum<["desktop", "remote", "none"]>>;
4369
+ pendingPermissions: z.ZodNumber;
4370
+ model: z.ZodOptional<z.ZodString>;
4371
+ createdAt: z.ZodNumber;
4372
+ updatedAt: z.ZodNumber;
4373
+ lastSeq: z.ZodNumber;
4374
+ archived: z.ZodBoolean;
4375
+ activity: z.ZodOptional<z.ZodObject<{
4376
+ kind: z.ZodEnum<["thinking", "responding", "tool"]>;
4377
+ title: z.ZodOptional<z.ZodString>;
4378
+ toolKind: z.ZodOptional<z.ZodEnum<["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]>>;
4379
+ }, "strip", z.ZodTypeAny, {
4380
+ kind: "thinking" | "responding" | "tool";
4381
+ title?: string | undefined;
4382
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
4383
+ }, {
4384
+ kind: "thinking" | "responding" | "tool";
4385
+ title?: string | undefined;
4386
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
4387
+ }>>;
4388
+ permission: z.ZodOptional<z.ZodObject<{
4389
+ requestId: z.ZodString;
4390
+ toolCallId: z.ZodOptional<z.ZodString>;
4391
+ title: z.ZodString;
4392
+ detail: z.ZodOptional<z.ZodString>;
4393
+ options: z.ZodArray<z.ZodObject<{
4394
+ optionId: z.ZodString;
4395
+ name: z.ZodString;
4396
+ kind: z.ZodEnum<["allow_once", "allow_always", "reject_once", "reject_always"]>;
4397
+ }, "strip", z.ZodTypeAny, {
4398
+ optionId: string;
4399
+ name: string;
4400
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4401
+ }, {
4402
+ optionId: string;
4403
+ name: string;
4404
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4405
+ }>, "many">;
4406
+ }, "strip", z.ZodTypeAny, {
4407
+ options: {
4408
+ optionId: string;
4409
+ name: string;
4410
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4411
+ }[];
4412
+ title: string;
4413
+ requestId: string;
4414
+ toolCallId?: string | undefined;
4415
+ detail?: string | undefined;
4416
+ }, {
4417
+ options: {
4418
+ optionId: string;
4419
+ name: string;
4420
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4421
+ }[];
4422
+ title: string;
4423
+ requestId: string;
4424
+ toolCallId?: string | undefined;
4425
+ detail?: string | undefined;
4426
+ }>>;
4427
+ queue: z.ZodOptional<z.ZodArray<z.ZodObject<{
4428
+ clientMessageId: z.ZodString;
4429
+ text: z.ZodString;
4430
+ images: z.ZodNumber;
4431
+ }, "strip", z.ZodTypeAny, {
4432
+ images: number;
4433
+ clientMessageId: string;
4434
+ text: string;
4435
+ }, {
4436
+ images: number;
4437
+ clientMessageId: string;
4438
+ text: string;
4439
+ }>, "many">>;
4440
+ }, "strip", z.ZodTypeAny, {
4441
+ state: "idle" | "running" | "waiting" | "error" | "offline";
4442
+ id: string;
4443
+ agent: string;
4444
+ nativeId: string;
4445
+ cwd: string;
4446
+ pendingPermissions: number;
4447
+ createdAt: number;
4448
+ updatedAt: number;
4449
+ lastSeq: number;
4450
+ archived: boolean;
4451
+ title?: string | undefined;
4452
+ preview?: string | undefined;
4453
+ driver?: "remote" | "desktop" | "none" | undefined;
4454
+ model?: string | undefined;
4455
+ activity?: {
4456
+ kind: "thinking" | "responding" | "tool";
4457
+ title?: string | undefined;
4458
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
4459
+ } | undefined;
4460
+ permission?: {
4461
+ options: {
4462
+ optionId: string;
4463
+ name: string;
4464
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4465
+ }[];
4466
+ title: string;
4467
+ requestId: string;
4468
+ toolCallId?: string | undefined;
4469
+ detail?: string | undefined;
4470
+ } | undefined;
4471
+ queue?: {
4472
+ images: number;
4473
+ clientMessageId: string;
4474
+ text: string;
4475
+ }[] | undefined;
4476
+ }, {
4477
+ state: "idle" | "running" | "waiting" | "error" | "offline";
4478
+ id: string;
4479
+ agent: string;
4480
+ nativeId: string;
4481
+ cwd: string;
4482
+ pendingPermissions: number;
4483
+ createdAt: number;
4484
+ updatedAt: number;
4485
+ lastSeq: number;
4486
+ archived: boolean;
4487
+ title?: string | undefined;
4488
+ preview?: string | undefined;
4489
+ driver?: "remote" | "desktop" | "none" | undefined;
4490
+ model?: string | undefined;
4491
+ activity?: {
4492
+ kind: "thinking" | "responding" | "tool";
4493
+ title?: string | undefined;
4494
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
4495
+ } | undefined;
4496
+ permission?: {
4497
+ options: {
4498
+ optionId: string;
4499
+ name: string;
4500
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4501
+ }[];
4502
+ title: string;
4503
+ requestId: string;
4504
+ toolCallId?: string | undefined;
4505
+ detail?: string | undefined;
4506
+ } | undefined;
4507
+ queue?: {
4508
+ images: number;
4509
+ clientMessageId: string;
4510
+ text: string;
4511
+ }[] | undefined;
4512
+ }>;
4513
+ }, "strip", z.ZodTypeAny, {
4514
+ session: {
4515
+ state: "idle" | "running" | "waiting" | "error" | "offline";
4516
+ id: string;
4517
+ agent: string;
4518
+ nativeId: string;
4519
+ cwd: string;
4520
+ pendingPermissions: number;
4521
+ createdAt: number;
4522
+ updatedAt: number;
4523
+ lastSeq: number;
4524
+ archived: boolean;
4525
+ title?: string | undefined;
4526
+ preview?: string | undefined;
4527
+ driver?: "remote" | "desktop" | "none" | undefined;
4528
+ model?: string | undefined;
4529
+ activity?: {
4530
+ kind: "thinking" | "responding" | "tool";
4531
+ title?: string | undefined;
4532
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
4533
+ } | undefined;
4534
+ permission?: {
4535
+ options: {
4536
+ optionId: string;
4537
+ name: string;
4538
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4539
+ }[];
4540
+ title: string;
4541
+ requestId: string;
4542
+ toolCallId?: string | undefined;
4543
+ detail?: string | undefined;
4544
+ } | undefined;
4545
+ queue?: {
4546
+ images: number;
4547
+ clientMessageId: string;
4548
+ text: string;
4549
+ }[] | undefined;
4550
+ };
4551
+ }, {
4552
+ session: {
4553
+ state: "idle" | "running" | "waiting" | "error" | "offline";
4554
+ id: string;
4555
+ agent: string;
4556
+ nativeId: string;
4557
+ cwd: string;
4558
+ pendingPermissions: number;
4559
+ createdAt: number;
4560
+ updatedAt: number;
4561
+ lastSeq: number;
4562
+ archived: boolean;
4563
+ title?: string | undefined;
4564
+ preview?: string | undefined;
4565
+ driver?: "remote" | "desktop" | "none" | undefined;
4566
+ model?: string | undefined;
4567
+ activity?: {
4568
+ kind: "thinking" | "responding" | "tool";
4569
+ title?: string | undefined;
4570
+ toolKind?: "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "other" | undefined;
4571
+ } | undefined;
4572
+ permission?: {
4573
+ options: {
4574
+ optionId: string;
4575
+ name: string;
4576
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4577
+ }[];
4578
+ title: string;
4579
+ requestId: string;
4580
+ toolCallId?: string | undefined;
4581
+ detail?: string | undefined;
4582
+ } | undefined;
4583
+ queue?: {
4584
+ images: number;
4585
+ clientMessageId: string;
4586
+ text: string;
4587
+ }[] | undefined;
4588
+ };
4589
+ }>;
4590
+ /** A session was deleted (from any device, or natively by the agent). */
4591
+ readonly "session.removed": z.ZodObject<{
4592
+ sessionId: z.ZodString;
4593
+ }, "strip", z.ZodTypeAny, {
4594
+ sessionId: string;
4595
+ }, {
4596
+ sessionId: string;
4597
+ }>;
4598
+ /** To a desktop shim: a device is taking over; exit the native UI, then call desktop.yielded. */
4599
+ readonly "desktop.yield": z.ZodObject<{
4600
+ sessionId: z.ZodString;
4601
+ }, "strip", z.ZodTypeAny, {
4602
+ sessionId: string;
4603
+ }, {
4604
+ sessionId: string;
4605
+ }>;
4606
+ /** To a desktop shim: progress from the remote driver, to show in the terminal. */
4607
+ readonly "desktop.remoteActivity": z.ZodObject<{
4608
+ sessionId: z.ZodString;
4609
+ line: z.ZodString;
4610
+ }, "strip", z.ZodTypeAny, {
4611
+ line: string;
4612
+ sessionId: string;
4613
+ }, {
4614
+ line: string;
4615
+ sessionId: string;
4616
+ }>;
4617
+ readonly "pairing.done": z.ZodObject<{
4618
+ device: z.ZodObject<{
4619
+ id: z.ZodString;
4620
+ name: z.ZodString;
4621
+ }, "strip", z.ZodTypeAny, {
4622
+ id: string;
4623
+ name: string;
4624
+ }, {
4625
+ id: string;
4626
+ name: string;
4627
+ }>;
4628
+ }, "strip", z.ZodTypeAny, {
4629
+ device: {
4630
+ id: string;
4631
+ name: string;
4632
+ };
4633
+ }, {
4634
+ device: {
4635
+ id: string;
4636
+ name: string;
4637
+ };
4638
+ }>;
4639
+ readonly "gateway.changed": z.ZodObject<{
4640
+ url: z.ZodOptional<z.ZodString>;
4641
+ status: z.ZodEnum<["off", "connecting", "online", "offline"]>;
4642
+ error: z.ZodOptional<z.ZodObject<{
4643
+ code: z.ZodString;
4644
+ message: z.ZodString;
4645
+ }, "strip", z.ZodTypeAny, {
4646
+ code: string;
4647
+ message: string;
4648
+ }, {
4649
+ code: string;
4650
+ message: string;
4651
+ }>>;
4652
+ machine: z.ZodOptional<z.ZodObject<{
4653
+ id: z.ZodString;
4654
+ name: z.ZodString;
4655
+ }, "strip", z.ZodTypeAny, {
4656
+ id: string;
4657
+ name: string;
4658
+ }, {
4659
+ id: string;
4660
+ name: string;
4661
+ }>>;
4662
+ account: z.ZodOptional<z.ZodObject<{
4663
+ userId: z.ZodString;
4664
+ email: z.ZodOptional<z.ZodString>;
4665
+ }, "strip", z.ZodTypeAny, {
4666
+ userId: string;
4667
+ email?: string | undefined;
4668
+ }, {
4669
+ userId: string;
4670
+ email?: string | undefined;
4671
+ }>>;
4672
+ devices: z.ZodArray<z.ZodObject<{
4673
+ id: z.ZodString;
4674
+ name: z.ZodString;
4675
+ pairedAt: z.ZodNumber;
4676
+ online: z.ZodBoolean;
4677
+ }, "strip", z.ZodTypeAny, {
4678
+ id: string;
4679
+ name: string;
4680
+ online: boolean;
4681
+ pairedAt: number;
4682
+ }, {
4683
+ id: string;
4684
+ name: string;
4685
+ online: boolean;
4686
+ pairedAt: number;
4687
+ }>, "many">;
4688
+ }, "strip", z.ZodTypeAny, {
4689
+ status: "offline" | "off" | "connecting" | "online";
4690
+ devices: {
4691
+ id: string;
4692
+ name: string;
4693
+ online: boolean;
4694
+ pairedAt: number;
4695
+ }[];
4696
+ error?: {
4697
+ code: string;
4698
+ message: string;
4699
+ } | undefined;
4700
+ url?: string | undefined;
4701
+ machine?: {
4702
+ id: string;
4703
+ name: string;
4704
+ } | undefined;
4705
+ account?: {
4706
+ userId: string;
4707
+ email?: string | undefined;
4708
+ } | undefined;
4709
+ }, {
4710
+ status: "offline" | "off" | "connecting" | "online";
4711
+ devices: {
4712
+ id: string;
4713
+ name: string;
4714
+ online: boolean;
4715
+ pairedAt: number;
4716
+ }[];
4717
+ error?: {
4718
+ code: string;
4719
+ message: string;
4720
+ } | undefined;
4721
+ url?: string | undefined;
4722
+ machine?: {
4723
+ id: string;
4724
+ name: string;
4725
+ } | undefined;
4726
+ account?: {
4727
+ userId: string;
4728
+ email?: string | undefined;
4729
+ } | undefined;
4730
+ }>;
4731
+ /** Output from an attached terminal, in order; `seq` increases by one per chunk. */
4732
+ readonly "terminal.output": z.ZodObject<{
4733
+ terminalId: z.ZodString;
4734
+ seq: z.ZodNumber;
4735
+ data: z.ZodString;
4736
+ }, "strip", z.ZodTypeAny, {
4737
+ data: string;
4738
+ terminalId: string;
4739
+ seq: number;
4740
+ }, {
4741
+ data: string;
4742
+ terminalId: string;
4743
+ seq: number;
4744
+ }>;
4745
+ /** A terminal's list entry changed (title, size, exit), or it was closed (`closed`). */
4746
+ readonly "terminal.changed": z.ZodObject<{
4747
+ terminal: z.ZodObject<{
4748
+ id: z.ZodString;
4749
+ title: z.ZodString;
4750
+ cwd: z.ZodString;
4751
+ cols: z.ZodNumber;
4752
+ rows: z.ZodNumber;
4753
+ createdAt: z.ZodNumber;
4754
+ activeAt: z.ZodNumber;
4755
+ command: z.ZodOptional<z.ZodString>;
4756
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4757
+ interrupted: z.ZodOptional<z.ZodBoolean>;
4758
+ }, "strip", z.ZodTypeAny, {
4759
+ id: string;
4760
+ title: string;
4761
+ cwd: string;
4762
+ createdAt: number;
4763
+ cols: number;
4764
+ rows: number;
4765
+ activeAt: number;
4766
+ command?: string | undefined;
4767
+ exitCode?: number | null | undefined;
4768
+ interrupted?: boolean | undefined;
4769
+ }, {
4770
+ id: string;
4771
+ title: string;
4772
+ cwd: string;
4773
+ createdAt: number;
4774
+ cols: number;
4775
+ rows: number;
4776
+ activeAt: number;
4777
+ command?: string | undefined;
4778
+ exitCode?: number | null | undefined;
4779
+ interrupted?: boolean | undefined;
4780
+ }>;
4781
+ closed: z.ZodOptional<z.ZodBoolean>;
4782
+ }, "strip", z.ZodTypeAny, {
4783
+ terminal: {
4784
+ id: string;
4785
+ title: string;
4786
+ cwd: string;
4787
+ createdAt: number;
4788
+ cols: number;
4789
+ rows: number;
4790
+ activeAt: number;
4791
+ command?: string | undefined;
4792
+ exitCode?: number | null | undefined;
4793
+ interrupted?: boolean | undefined;
4794
+ };
4795
+ closed?: boolean | undefined;
4796
+ }, {
4797
+ terminal: {
4798
+ id: string;
4799
+ title: string;
4800
+ cwd: string;
4801
+ createdAt: number;
4802
+ cols: number;
4803
+ rows: number;
4804
+ activeAt: number;
4805
+ command?: string | undefined;
4806
+ exitCode?: number | null | undefined;
4807
+ interrupted?: boolean | undefined;
4808
+ };
4809
+ closed?: boolean | undefined;
4810
+ }>;
4811
+ /** Bytes from the host's end of a `proxy.open` stream (base64), in order. */
4812
+ readonly "proxy.data": z.ZodObject<{
4813
+ streamId: z.ZodString;
4814
+ data: z.ZodString;
4815
+ }, "strip", z.ZodTypeAny, {
4816
+ data: string;
4817
+ streamId: string;
4818
+ }, {
4819
+ data: string;
4820
+ streamId: string;
4821
+ }>;
4822
+ /** The host's end of a stream closed (the server hung up, or refused). */
4823
+ readonly "proxy.closed": z.ZodObject<{
4824
+ streamId: z.ZodString;
4825
+ error: z.ZodOptional<z.ZodString>;
4826
+ }, "strip", z.ZodTypeAny, {
4827
+ streamId: string;
4828
+ error?: string | undefined;
4829
+ }, {
4830
+ streamId: string;
4831
+ error?: string | undefined;
4832
+ }>;
4833
+ };
4834
+ export type NotificationName = keyof typeof notifications;
4835
+ export type NotificationParams<N extends NotificationName> = z.infer<(typeof notifications)[N]>;