@linkshell/gateway 0.4.55 → 0.5.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.
Files changed (60) hide show
  1. package/Dockerfile +11 -3
  2. package/dist/gateway/src/embedded.d.ts +5 -0
  3. package/dist/gateway/src/embedded.js +23 -25
  4. package/dist/gateway/src/embedded.js.map +1 -1
  5. package/dist/gateway/src/index.js +47 -27
  6. package/dist/gateway/src/index.js.map +1 -1
  7. package/dist/gateway/src/relay.js +0 -13
  8. package/dist/gateway/src/relay.js.map +1 -1
  9. package/dist/gateway/tsconfig.tsbuildinfo +1 -1
  10. package/dist/gateway-v2/src/accounts.d.ts +6 -0
  11. package/dist/gateway-v2/src/accounts.js +32 -0
  12. package/dist/gateway-v2/src/accounts.js.map +1 -0
  13. package/dist/gateway-v2/src/index.d.ts +3 -0
  14. package/dist/gateway-v2/src/index.js +4 -0
  15. package/dist/gateway-v2/src/index.js.map +1 -0
  16. package/dist/gateway-v2/src/main.d.ts +1 -0
  17. package/dist/gateway-v2/src/main.js +17 -0
  18. package/dist/gateway-v2/src/main.js.map +1 -0
  19. package/dist/gateway-v2/src/server.d.ts +69 -0
  20. package/dist/gateway-v2/src/server.js +387 -0
  21. package/dist/gateway-v2/src/server.js.map +1 -0
  22. package/dist/gateway-v2/src/store.d.ts +30 -0
  23. package/dist/gateway-v2/src/store.js +102 -0
  24. package/dist/gateway-v2/src/store.js.map +1 -0
  25. package/dist/shared-protocol/src/index.d.ts +1495 -1339
  26. package/dist/shared-protocol/src/index.js +6 -0
  27. package/dist/shared-protocol/src/index.js.map +1 -1
  28. package/dist/wire/src/crypto.d.ts +65 -0
  29. package/dist/wire/src/crypto.js +253 -0
  30. package/dist/wire/src/crypto.js.map +1 -0
  31. package/dist/wire/src/index.d.ts +8 -0
  32. package/dist/wire/src/index.js +9 -0
  33. package/dist/wire/src/index.js.map +1 -0
  34. package/dist/wire/src/model.d.ts +751 -0
  35. package/dist/wire/src/model.js +176 -0
  36. package/dist/wire/src/model.js.map +1 -0
  37. package/dist/wire/src/peer.d.ts +42 -0
  38. package/dist/wire/src/peer.js +143 -0
  39. package/dist/wire/src/peer.js.map +1 -0
  40. package/dist/wire/src/relay-client.d.ts +82 -0
  41. package/dist/wire/src/relay-client.js +259 -0
  42. package/dist/wire/src/relay-client.js.map +1 -0
  43. package/dist/wire/src/relay.d.ts +481 -0
  44. package/dist/wire/src/relay.js +129 -0
  45. package/dist/wire/src/relay.js.map +1 -0
  46. package/dist/wire/src/rpc.d.ts +4835 -0
  47. package/dist/wire/src/rpc.js +357 -0
  48. package/dist/wire/src/rpc.js.map +1 -0
  49. package/dist/wire/src/shell.d.ts +2 -0
  50. package/dist/wire/src/shell.js +62 -0
  51. package/dist/wire/src/shell.js.map +1 -0
  52. package/dist/wire/src/updates.d.ts +3325 -0
  53. package/dist/wire/src/updates.js +210 -0
  54. package/dist/wire/src/updates.js.map +1 -0
  55. package/package.json +7 -2
  56. package/src/embedded.ts +31 -1
  57. package/src/index.ts +45 -2
  58. package/dist/gateway/src/agent-permission-http.d.ts +0 -119
  59. package/dist/gateway/src/agent-permission-http.js +0 -234
  60. package/dist/gateway/src/agent-permission-http.js.map +0 -1
@@ -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
+ id?: string | number | undefined;
41
+ error?: {
42
+ code: number;
43
+ message: string;
44
+ data?: unknown;
45
+ } | undefined;
46
+ method?: string | undefined;
47
+ result?: unknown;
48
+ }, {
49
+ jsonrpc: "2.0";
50
+ params?: unknown;
51
+ id?: string | number | undefined;
52
+ error?: {
53
+ code: number;
54
+ message: string;
55
+ data?: unknown;
56
+ } | undefined;
57
+ method?: string | 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
+ models: boolean;
121
+ modes: boolean;
122
+ steer: boolean;
123
+ interrupt: boolean;
124
+ permissions: boolean;
125
+ images: boolean;
126
+ fork: boolean;
127
+ }, {
128
+ models: boolean;
129
+ modes: boolean;
130
+ steer: boolean;
131
+ interrupt: boolean;
132
+ permissions: boolean;
133
+ images: boolean;
134
+ fork: boolean;
135
+ }>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ id: string;
138
+ label: string;
139
+ capabilities: {
140
+ models: boolean;
141
+ modes: boolean;
142
+ steer: boolean;
143
+ interrupt: boolean;
144
+ permissions: boolean;
145
+ images: boolean;
146
+ fork: boolean;
147
+ };
148
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
149
+ installed: boolean;
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
+ capabilities: {
161
+ models: boolean;
162
+ modes: boolean;
163
+ steer: boolean;
164
+ interrupt: boolean;
165
+ permissions: boolean;
166
+ images: boolean;
167
+ fork: boolean;
168
+ };
169
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
170
+ installed: boolean;
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
+ capabilities: {
188
+ models: boolean;
189
+ modes: boolean;
190
+ steer: boolean;
191
+ interrupt: boolean;
192
+ permissions: boolean;
193
+ images: boolean;
194
+ fork: boolean;
195
+ };
196
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
197
+ installed: boolean;
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
+ capabilities: {
216
+ models: boolean;
217
+ modes: boolean;
218
+ steer: boolean;
219
+ interrupt: boolean;
220
+ permissions: boolean;
221
+ images: boolean;
222
+ fork: boolean;
223
+ };
224
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
225
+ installed: boolean;
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
+ cwd: string;
253
+ name: string;
254
+ lastActiveAt: number;
255
+ sessionCount: number;
256
+ }, {
257
+ cwd: string;
258
+ name: string;
259
+ lastActiveAt: number;
260
+ sessionCount: number;
261
+ }>, "many">;
262
+ }, "strip", z.ZodTypeAny, {
263
+ projects: {
264
+ cwd: string;
265
+ name: string;
266
+ lastActiveAt: number;
267
+ sessionCount: number;
268
+ }[];
269
+ }, {
270
+ projects: {
271
+ cwd: string;
272
+ name: 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
+ includeArchived?: boolean | undefined;
286
+ limit?: number | undefined;
287
+ before?: number | undefined;
288
+ }, {
289
+ includeArchived?: boolean | undefined;
290
+ limit?: number | undefined;
291
+ before?: number | 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" | "tool" | "responding";
315
+ title?: string | undefined;
316
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
317
+ }, {
318
+ kind: "thinking" | "tool" | "responding";
319
+ title?: string | undefined;
320
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | 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
+ name: string;
333
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
334
+ optionId: string;
335
+ }, {
336
+ name: string;
337
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
338
+ optionId: string;
339
+ }>, "many">;
340
+ }, "strip", z.ZodTypeAny, {
341
+ options: {
342
+ name: string;
343
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
344
+ optionId: string;
345
+ }[];
346
+ requestId: string;
347
+ title: string;
348
+ detail?: string | undefined;
349
+ toolCallId?: string | undefined;
350
+ }, {
351
+ options: {
352
+ name: string;
353
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
354
+ optionId: string;
355
+ }[];
356
+ requestId: string;
357
+ title: string;
358
+ detail?: string | undefined;
359
+ toolCallId?: 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
+ text: string;
367
+ clientMessageId: string;
368
+ images: number;
369
+ }, {
370
+ text: string;
371
+ clientMessageId: string;
372
+ images: number;
373
+ }>, "many">>;
374
+ }, "strip", z.ZodTypeAny, {
375
+ id: string;
376
+ cwd: string;
377
+ createdAt: number;
378
+ pendingPermissions: number;
379
+ updatedAt: number;
380
+ archived: boolean;
381
+ state: "idle" | "error" | "running" | "waiting" | "offline";
382
+ agent: string;
383
+ nativeId: string;
384
+ lastSeq: number;
385
+ title?: string | undefined;
386
+ model?: string | undefined;
387
+ permission?: {
388
+ options: {
389
+ name: string;
390
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
391
+ optionId: string;
392
+ }[];
393
+ requestId: string;
394
+ title: string;
395
+ detail?: string | undefined;
396
+ toolCallId?: string | undefined;
397
+ } | undefined;
398
+ preview?: string | undefined;
399
+ driver?: "none" | "remote" | "desktop" | undefined;
400
+ activity?: {
401
+ kind: "thinking" | "tool" | "responding";
402
+ title?: string | undefined;
403
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
404
+ } | undefined;
405
+ queue?: {
406
+ text: string;
407
+ clientMessageId: string;
408
+ images: number;
409
+ }[] | undefined;
410
+ }, {
411
+ id: string;
412
+ cwd: string;
413
+ createdAt: number;
414
+ pendingPermissions: number;
415
+ updatedAt: number;
416
+ archived: boolean;
417
+ state: "idle" | "error" | "running" | "waiting" | "offline";
418
+ agent: string;
419
+ nativeId: string;
420
+ lastSeq: number;
421
+ title?: string | undefined;
422
+ model?: string | undefined;
423
+ permission?: {
424
+ options: {
425
+ name: string;
426
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
427
+ optionId: string;
428
+ }[];
429
+ requestId: string;
430
+ title: string;
431
+ detail?: string | undefined;
432
+ toolCallId?: string | undefined;
433
+ } | undefined;
434
+ preview?: string | undefined;
435
+ driver?: "none" | "remote" | "desktop" | undefined;
436
+ activity?: {
437
+ kind: "thinking" | "tool" | "responding";
438
+ title?: string | undefined;
439
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
440
+ } | undefined;
441
+ queue?: {
442
+ text: string;
443
+ clientMessageId: string;
444
+ images: number;
445
+ }[] | undefined;
446
+ }>, "many">;
447
+ nextBefore: z.ZodOptional<z.ZodNumber>;
448
+ }, "strip", z.ZodTypeAny, {
449
+ sessions: {
450
+ id: string;
451
+ cwd: string;
452
+ createdAt: number;
453
+ pendingPermissions: number;
454
+ updatedAt: number;
455
+ archived: boolean;
456
+ state: "idle" | "error" | "running" | "waiting" | "offline";
457
+ agent: string;
458
+ nativeId: string;
459
+ lastSeq: number;
460
+ title?: string | undefined;
461
+ model?: string | undefined;
462
+ permission?: {
463
+ options: {
464
+ name: string;
465
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
466
+ optionId: string;
467
+ }[];
468
+ requestId: string;
469
+ title: string;
470
+ detail?: string | undefined;
471
+ toolCallId?: string | undefined;
472
+ } | undefined;
473
+ preview?: string | undefined;
474
+ driver?: "none" | "remote" | "desktop" | undefined;
475
+ activity?: {
476
+ kind: "thinking" | "tool" | "responding";
477
+ title?: string | undefined;
478
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
479
+ } | undefined;
480
+ queue?: {
481
+ text: string;
482
+ clientMessageId: string;
483
+ images: number;
484
+ }[] | undefined;
485
+ }[];
486
+ nextBefore?: number | undefined;
487
+ }, {
488
+ sessions: {
489
+ id: string;
490
+ cwd: string;
491
+ createdAt: number;
492
+ pendingPermissions: number;
493
+ updatedAt: number;
494
+ archived: boolean;
495
+ state: "idle" | "error" | "running" | "waiting" | "offline";
496
+ agent: string;
497
+ nativeId: string;
498
+ lastSeq: number;
499
+ title?: string | undefined;
500
+ model?: string | undefined;
501
+ permission?: {
502
+ options: {
503
+ name: string;
504
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
505
+ optionId: string;
506
+ }[];
507
+ requestId: string;
508
+ title: string;
509
+ detail?: string | undefined;
510
+ toolCallId?: string | undefined;
511
+ } | undefined;
512
+ preview?: string | undefined;
513
+ driver?: "none" | "remote" | "desktop" | undefined;
514
+ activity?: {
515
+ kind: "thinking" | "tool" | "responding";
516
+ title?: string | undefined;
517
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
518
+ } | undefined;
519
+ queue?: {
520
+ text: string;
521
+ clientMessageId: string;
522
+ images: number;
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
+ cwd: string;
576
+ agent: string;
577
+ prompt?: ({
578
+ type: "text";
579
+ text: string;
580
+ } | {
581
+ type: "image";
582
+ mimeType: string;
583
+ data?: string | undefined;
584
+ uri?: string | undefined;
585
+ } | {
586
+ type: "resource_link";
587
+ name: string;
588
+ uri: string;
589
+ kind?: "agent" | "file" | "skill" | undefined;
590
+ })[] | undefined;
591
+ clientMessageId?: string | undefined;
592
+ model?: string | undefined;
593
+ }, {
594
+ cwd: string;
595
+ agent: string;
596
+ prompt?: ({
597
+ type: "text";
598
+ text: string;
599
+ } | {
600
+ type: "image";
601
+ mimeType: string;
602
+ data?: string | undefined;
603
+ uri?: string | undefined;
604
+ } | {
605
+ type: "resource_link";
606
+ name: string;
607
+ uri: string;
608
+ kind?: "agent" | "file" | "skill" | undefined;
609
+ })[] | undefined;
610
+ clientMessageId?: string | undefined;
611
+ model?: string | 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" | "tool" | "responding";
635
+ title?: string | undefined;
636
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
637
+ }, {
638
+ kind: "thinking" | "tool" | "responding";
639
+ title?: string | undefined;
640
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | 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
+ name: string;
653
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
654
+ optionId: string;
655
+ }, {
656
+ name: string;
657
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
658
+ optionId: string;
659
+ }>, "many">;
660
+ }, "strip", z.ZodTypeAny, {
661
+ options: {
662
+ name: string;
663
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
664
+ optionId: string;
665
+ }[];
666
+ requestId: string;
667
+ title: string;
668
+ detail?: string | undefined;
669
+ toolCallId?: string | undefined;
670
+ }, {
671
+ options: {
672
+ name: string;
673
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
674
+ optionId: string;
675
+ }[];
676
+ requestId: string;
677
+ title: string;
678
+ detail?: string | undefined;
679
+ toolCallId?: 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
+ text: string;
687
+ clientMessageId: string;
688
+ images: number;
689
+ }, {
690
+ text: string;
691
+ clientMessageId: string;
692
+ images: number;
693
+ }>, "many">>;
694
+ }, "strip", z.ZodTypeAny, {
695
+ id: string;
696
+ cwd: string;
697
+ createdAt: number;
698
+ pendingPermissions: number;
699
+ updatedAt: number;
700
+ archived: boolean;
701
+ state: "idle" | "error" | "running" | "waiting" | "offline";
702
+ agent: string;
703
+ nativeId: string;
704
+ lastSeq: number;
705
+ title?: string | undefined;
706
+ model?: string | undefined;
707
+ permission?: {
708
+ options: {
709
+ name: string;
710
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
711
+ optionId: string;
712
+ }[];
713
+ requestId: string;
714
+ title: string;
715
+ detail?: string | undefined;
716
+ toolCallId?: string | undefined;
717
+ } | undefined;
718
+ preview?: string | undefined;
719
+ driver?: "none" | "remote" | "desktop" | undefined;
720
+ activity?: {
721
+ kind: "thinking" | "tool" | "responding";
722
+ title?: string | undefined;
723
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
724
+ } | undefined;
725
+ queue?: {
726
+ text: string;
727
+ clientMessageId: string;
728
+ images: number;
729
+ }[] | undefined;
730
+ }, {
731
+ id: string;
732
+ cwd: string;
733
+ createdAt: number;
734
+ pendingPermissions: number;
735
+ updatedAt: number;
736
+ archived: boolean;
737
+ state: "idle" | "error" | "running" | "waiting" | "offline";
738
+ agent: string;
739
+ nativeId: string;
740
+ lastSeq: number;
741
+ title?: string | undefined;
742
+ model?: string | undefined;
743
+ permission?: {
744
+ options: {
745
+ name: string;
746
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
747
+ optionId: string;
748
+ }[];
749
+ requestId: string;
750
+ title: string;
751
+ detail?: string | undefined;
752
+ toolCallId?: string | undefined;
753
+ } | undefined;
754
+ preview?: string | undefined;
755
+ driver?: "none" | "remote" | "desktop" | undefined;
756
+ activity?: {
757
+ kind: "thinking" | "tool" | "responding";
758
+ title?: string | undefined;
759
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
760
+ } | undefined;
761
+ queue?: {
762
+ text: string;
763
+ clientMessageId: string;
764
+ images: number;
765
+ }[] | undefined;
766
+ }>;
767
+ }, "strip", z.ZodTypeAny, {
768
+ session: {
769
+ id: string;
770
+ cwd: string;
771
+ createdAt: number;
772
+ pendingPermissions: number;
773
+ updatedAt: number;
774
+ archived: boolean;
775
+ state: "idle" | "error" | "running" | "waiting" | "offline";
776
+ agent: string;
777
+ nativeId: string;
778
+ lastSeq: number;
779
+ title?: string | undefined;
780
+ model?: string | undefined;
781
+ permission?: {
782
+ options: {
783
+ name: string;
784
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
785
+ optionId: string;
786
+ }[];
787
+ requestId: string;
788
+ title: string;
789
+ detail?: string | undefined;
790
+ toolCallId?: string | undefined;
791
+ } | undefined;
792
+ preview?: string | undefined;
793
+ driver?: "none" | "remote" | "desktop" | undefined;
794
+ activity?: {
795
+ kind: "thinking" | "tool" | "responding";
796
+ title?: string | undefined;
797
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
798
+ } | undefined;
799
+ queue?: {
800
+ text: string;
801
+ clientMessageId: string;
802
+ images: number;
803
+ }[] | undefined;
804
+ };
805
+ }, {
806
+ session: {
807
+ id: string;
808
+ cwd: string;
809
+ createdAt: number;
810
+ pendingPermissions: number;
811
+ updatedAt: number;
812
+ archived: boolean;
813
+ state: "idle" | "error" | "running" | "waiting" | "offline";
814
+ agent: string;
815
+ nativeId: string;
816
+ lastSeq: number;
817
+ title?: string | undefined;
818
+ model?: string | undefined;
819
+ permission?: {
820
+ options: {
821
+ name: string;
822
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
823
+ optionId: string;
824
+ }[];
825
+ requestId: string;
826
+ title: string;
827
+ detail?: string | undefined;
828
+ toolCallId?: string | undefined;
829
+ } | undefined;
830
+ preview?: string | undefined;
831
+ driver?: "none" | "remote" | "desktop" | undefined;
832
+ activity?: {
833
+ kind: "thinking" | "tool" | "responding";
834
+ title?: string | undefined;
835
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
836
+ } | undefined;
837
+ queue?: {
838
+ text: string;
839
+ clientMessageId: string;
840
+ images: number;
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" | "tool" | "responding";
879
+ title?: string | undefined;
880
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
881
+ }, {
882
+ kind: "thinking" | "tool" | "responding";
883
+ title?: string | undefined;
884
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | 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
+ name: string;
897
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
898
+ optionId: string;
899
+ }, {
900
+ name: string;
901
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
902
+ optionId: string;
903
+ }>, "many">;
904
+ }, "strip", z.ZodTypeAny, {
905
+ options: {
906
+ name: string;
907
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
908
+ optionId: string;
909
+ }[];
910
+ requestId: string;
911
+ title: string;
912
+ detail?: string | undefined;
913
+ toolCallId?: string | undefined;
914
+ }, {
915
+ options: {
916
+ name: string;
917
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
918
+ optionId: string;
919
+ }[];
920
+ requestId: string;
921
+ title: string;
922
+ detail?: string | undefined;
923
+ toolCallId?: 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
+ text: string;
931
+ clientMessageId: string;
932
+ images: number;
933
+ }, {
934
+ text: string;
935
+ clientMessageId: string;
936
+ images: number;
937
+ }>, "many">>;
938
+ }, "strip", z.ZodTypeAny, {
939
+ id: string;
940
+ cwd: string;
941
+ createdAt: number;
942
+ pendingPermissions: number;
943
+ updatedAt: number;
944
+ archived: boolean;
945
+ state: "idle" | "error" | "running" | "waiting" | "offline";
946
+ agent: string;
947
+ nativeId: string;
948
+ lastSeq: number;
949
+ title?: string | undefined;
950
+ model?: string | undefined;
951
+ permission?: {
952
+ options: {
953
+ name: string;
954
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
955
+ optionId: string;
956
+ }[];
957
+ requestId: string;
958
+ title: string;
959
+ detail?: string | undefined;
960
+ toolCallId?: string | undefined;
961
+ } | undefined;
962
+ preview?: string | undefined;
963
+ driver?: "none" | "remote" | "desktop" | undefined;
964
+ activity?: {
965
+ kind: "thinking" | "tool" | "responding";
966
+ title?: string | undefined;
967
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
968
+ } | undefined;
969
+ queue?: {
970
+ text: string;
971
+ clientMessageId: string;
972
+ images: number;
973
+ }[] | undefined;
974
+ }, {
975
+ id: string;
976
+ cwd: string;
977
+ createdAt: number;
978
+ pendingPermissions: number;
979
+ updatedAt: number;
980
+ archived: boolean;
981
+ state: "idle" | "error" | "running" | "waiting" | "offline";
982
+ agent: string;
983
+ nativeId: string;
984
+ lastSeq: number;
985
+ title?: string | undefined;
986
+ model?: string | undefined;
987
+ permission?: {
988
+ options: {
989
+ name: string;
990
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
991
+ optionId: string;
992
+ }[];
993
+ requestId: string;
994
+ title: string;
995
+ detail?: string | undefined;
996
+ toolCallId?: string | undefined;
997
+ } | undefined;
998
+ preview?: string | undefined;
999
+ driver?: "none" | "remote" | "desktop" | undefined;
1000
+ activity?: {
1001
+ kind: "thinking" | "tool" | "responding";
1002
+ title?: string | undefined;
1003
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1004
+ } | undefined;
1005
+ queue?: {
1006
+ text: string;
1007
+ clientMessageId: string;
1008
+ images: number;
1009
+ }[] | undefined;
1010
+ }>;
1011
+ }, "strip", z.ZodTypeAny, {
1012
+ session: {
1013
+ id: string;
1014
+ cwd: string;
1015
+ createdAt: number;
1016
+ pendingPermissions: number;
1017
+ updatedAt: number;
1018
+ archived: boolean;
1019
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1020
+ agent: string;
1021
+ nativeId: string;
1022
+ lastSeq: number;
1023
+ title?: string | undefined;
1024
+ model?: string | undefined;
1025
+ permission?: {
1026
+ options: {
1027
+ name: string;
1028
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1029
+ optionId: string;
1030
+ }[];
1031
+ requestId: string;
1032
+ title: string;
1033
+ detail?: string | undefined;
1034
+ toolCallId?: string | undefined;
1035
+ } | undefined;
1036
+ preview?: string | undefined;
1037
+ driver?: "none" | "remote" | "desktop" | undefined;
1038
+ activity?: {
1039
+ kind: "thinking" | "tool" | "responding";
1040
+ title?: string | undefined;
1041
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1042
+ } | undefined;
1043
+ queue?: {
1044
+ text: string;
1045
+ clientMessageId: string;
1046
+ images: number;
1047
+ }[] | undefined;
1048
+ };
1049
+ }, {
1050
+ session: {
1051
+ id: string;
1052
+ cwd: string;
1053
+ createdAt: number;
1054
+ pendingPermissions: number;
1055
+ updatedAt: number;
1056
+ archived: boolean;
1057
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1058
+ agent: string;
1059
+ nativeId: string;
1060
+ lastSeq: number;
1061
+ title?: string | undefined;
1062
+ model?: string | undefined;
1063
+ permission?: {
1064
+ options: {
1065
+ name: string;
1066
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1067
+ optionId: string;
1068
+ }[];
1069
+ requestId: string;
1070
+ title: string;
1071
+ detail?: string | undefined;
1072
+ toolCallId?: string | undefined;
1073
+ } | undefined;
1074
+ preview?: string | undefined;
1075
+ driver?: "none" | "remote" | "desktop" | undefined;
1076
+ activity?: {
1077
+ kind: "thinking" | "tool" | "responding";
1078
+ title?: string | undefined;
1079
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1080
+ } | undefined;
1081
+ queue?: {
1082
+ text: string;
1083
+ clientMessageId: string;
1084
+ images: number;
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
+ sessionId: 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
+ clientMessageId: string;
1161
+ }, {
1162
+ sessionId: 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
+ clientMessageId: 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
+ sessionId: string;
1205
+ requestId: string;
1206
+ optionId: string;
1207
+ }, {
1208
+ sessionId: string;
1209
+ requestId: string;
1210
+ optionId: 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
+ sessionId: string;
1222
+ optionId: string;
1223
+ }, {
1224
+ value: string;
1225
+ sessionId: string;
1226
+ optionId: 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
+ sessionId: string;
1237
+ clientMessageId: string;
1238
+ }, {
1239
+ sessionId: string;
1240
+ clientMessageId: 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
+ sessionId: string;
1257
+ archived: boolean;
1258
+ }, {
1259
+ sessionId: string;
1260
+ archived: boolean;
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" | "tool" | "responding";
1284
+ title?: string | undefined;
1285
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1286
+ }, {
1287
+ kind: "thinking" | "tool" | "responding";
1288
+ title?: string | undefined;
1289
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | 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
+ name: string;
1302
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1303
+ optionId: string;
1304
+ }, {
1305
+ name: string;
1306
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1307
+ optionId: string;
1308
+ }>, "many">;
1309
+ }, "strip", z.ZodTypeAny, {
1310
+ options: {
1311
+ name: string;
1312
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1313
+ optionId: string;
1314
+ }[];
1315
+ requestId: string;
1316
+ title: string;
1317
+ detail?: string | undefined;
1318
+ toolCallId?: string | undefined;
1319
+ }, {
1320
+ options: {
1321
+ name: string;
1322
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1323
+ optionId: string;
1324
+ }[];
1325
+ requestId: string;
1326
+ title: string;
1327
+ detail?: string | undefined;
1328
+ toolCallId?: 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
+ text: string;
1336
+ clientMessageId: string;
1337
+ images: number;
1338
+ }, {
1339
+ text: string;
1340
+ clientMessageId: string;
1341
+ images: number;
1342
+ }>, "many">>;
1343
+ }, "strip", z.ZodTypeAny, {
1344
+ id: string;
1345
+ cwd: string;
1346
+ createdAt: number;
1347
+ pendingPermissions: number;
1348
+ updatedAt: number;
1349
+ archived: boolean;
1350
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1351
+ agent: string;
1352
+ nativeId: string;
1353
+ lastSeq: number;
1354
+ title?: string | undefined;
1355
+ model?: string | undefined;
1356
+ permission?: {
1357
+ options: {
1358
+ name: string;
1359
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1360
+ optionId: string;
1361
+ }[];
1362
+ requestId: string;
1363
+ title: string;
1364
+ detail?: string | undefined;
1365
+ toolCallId?: string | undefined;
1366
+ } | undefined;
1367
+ preview?: string | undefined;
1368
+ driver?: "none" | "remote" | "desktop" | undefined;
1369
+ activity?: {
1370
+ kind: "thinking" | "tool" | "responding";
1371
+ title?: string | undefined;
1372
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1373
+ } | undefined;
1374
+ queue?: {
1375
+ text: string;
1376
+ clientMessageId: string;
1377
+ images: number;
1378
+ }[] | undefined;
1379
+ }, {
1380
+ id: string;
1381
+ cwd: string;
1382
+ createdAt: number;
1383
+ pendingPermissions: number;
1384
+ updatedAt: number;
1385
+ archived: boolean;
1386
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1387
+ agent: string;
1388
+ nativeId: string;
1389
+ lastSeq: number;
1390
+ title?: string | undefined;
1391
+ model?: string | undefined;
1392
+ permission?: {
1393
+ options: {
1394
+ name: string;
1395
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1396
+ optionId: string;
1397
+ }[];
1398
+ requestId: string;
1399
+ title: string;
1400
+ detail?: string | undefined;
1401
+ toolCallId?: string | undefined;
1402
+ } | undefined;
1403
+ preview?: string | undefined;
1404
+ driver?: "none" | "remote" | "desktop" | undefined;
1405
+ activity?: {
1406
+ kind: "thinking" | "tool" | "responding";
1407
+ title?: string | undefined;
1408
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1409
+ } | undefined;
1410
+ queue?: {
1411
+ text: string;
1412
+ clientMessageId: string;
1413
+ images: number;
1414
+ }[] | undefined;
1415
+ }>;
1416
+ }, "strip", z.ZodTypeAny, {
1417
+ session: {
1418
+ id: string;
1419
+ cwd: string;
1420
+ createdAt: number;
1421
+ pendingPermissions: number;
1422
+ updatedAt: number;
1423
+ archived: boolean;
1424
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1425
+ agent: string;
1426
+ nativeId: string;
1427
+ lastSeq: number;
1428
+ title?: string | undefined;
1429
+ model?: string | undefined;
1430
+ permission?: {
1431
+ options: {
1432
+ name: string;
1433
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1434
+ optionId: string;
1435
+ }[];
1436
+ requestId: string;
1437
+ title: string;
1438
+ detail?: string | undefined;
1439
+ toolCallId?: string | undefined;
1440
+ } | undefined;
1441
+ preview?: string | undefined;
1442
+ driver?: "none" | "remote" | "desktop" | undefined;
1443
+ activity?: {
1444
+ kind: "thinking" | "tool" | "responding";
1445
+ title?: string | undefined;
1446
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1447
+ } | undefined;
1448
+ queue?: {
1449
+ text: string;
1450
+ clientMessageId: string;
1451
+ images: number;
1452
+ }[] | undefined;
1453
+ };
1454
+ }, {
1455
+ session: {
1456
+ id: string;
1457
+ cwd: string;
1458
+ createdAt: number;
1459
+ pendingPermissions: number;
1460
+ updatedAt: number;
1461
+ archived: boolean;
1462
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1463
+ agent: string;
1464
+ nativeId: string;
1465
+ lastSeq: number;
1466
+ title?: string | undefined;
1467
+ model?: string | undefined;
1468
+ permission?: {
1469
+ options: {
1470
+ name: string;
1471
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1472
+ optionId: string;
1473
+ }[];
1474
+ requestId: string;
1475
+ title: string;
1476
+ detail?: string | undefined;
1477
+ toolCallId?: string | undefined;
1478
+ } | undefined;
1479
+ preview?: string | undefined;
1480
+ driver?: "none" | "remote" | "desktop" | undefined;
1481
+ activity?: {
1482
+ kind: "thinking" | "tool" | "responding";
1483
+ title?: string | undefined;
1484
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1485
+ } | undefined;
1486
+ queue?: {
1487
+ text: string;
1488
+ clientMessageId: string;
1489
+ images: number;
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
+ sessionId: string;
1501
+ title: string;
1502
+ }, {
1503
+ sessionId: string;
1504
+ title: 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" | "tool" | "responding";
1528
+ title?: string | undefined;
1529
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1530
+ }, {
1531
+ kind: "thinking" | "tool" | "responding";
1532
+ title?: string | undefined;
1533
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | 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
+ name: string;
1546
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1547
+ optionId: string;
1548
+ }, {
1549
+ name: string;
1550
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1551
+ optionId: string;
1552
+ }>, "many">;
1553
+ }, "strip", z.ZodTypeAny, {
1554
+ options: {
1555
+ name: string;
1556
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1557
+ optionId: string;
1558
+ }[];
1559
+ requestId: string;
1560
+ title: string;
1561
+ detail?: string | undefined;
1562
+ toolCallId?: string | undefined;
1563
+ }, {
1564
+ options: {
1565
+ name: string;
1566
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1567
+ optionId: string;
1568
+ }[];
1569
+ requestId: string;
1570
+ title: string;
1571
+ detail?: string | undefined;
1572
+ toolCallId?: 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
+ text: string;
1580
+ clientMessageId: string;
1581
+ images: number;
1582
+ }, {
1583
+ text: string;
1584
+ clientMessageId: string;
1585
+ images: number;
1586
+ }>, "many">>;
1587
+ }, "strip", z.ZodTypeAny, {
1588
+ id: string;
1589
+ cwd: string;
1590
+ createdAt: number;
1591
+ pendingPermissions: number;
1592
+ updatedAt: number;
1593
+ archived: boolean;
1594
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1595
+ agent: string;
1596
+ nativeId: string;
1597
+ lastSeq: number;
1598
+ title?: string | undefined;
1599
+ model?: string | undefined;
1600
+ permission?: {
1601
+ options: {
1602
+ name: string;
1603
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1604
+ optionId: string;
1605
+ }[];
1606
+ requestId: string;
1607
+ title: string;
1608
+ detail?: string | undefined;
1609
+ toolCallId?: string | undefined;
1610
+ } | undefined;
1611
+ preview?: string | undefined;
1612
+ driver?: "none" | "remote" | "desktop" | undefined;
1613
+ activity?: {
1614
+ kind: "thinking" | "tool" | "responding";
1615
+ title?: string | undefined;
1616
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1617
+ } | undefined;
1618
+ queue?: {
1619
+ text: string;
1620
+ clientMessageId: string;
1621
+ images: number;
1622
+ }[] | undefined;
1623
+ }, {
1624
+ id: string;
1625
+ cwd: string;
1626
+ createdAt: number;
1627
+ pendingPermissions: number;
1628
+ updatedAt: number;
1629
+ archived: boolean;
1630
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1631
+ agent: string;
1632
+ nativeId: string;
1633
+ lastSeq: number;
1634
+ title?: string | undefined;
1635
+ model?: string | undefined;
1636
+ permission?: {
1637
+ options: {
1638
+ name: string;
1639
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1640
+ optionId: string;
1641
+ }[];
1642
+ requestId: string;
1643
+ title: string;
1644
+ detail?: string | undefined;
1645
+ toolCallId?: string | undefined;
1646
+ } | undefined;
1647
+ preview?: string | undefined;
1648
+ driver?: "none" | "remote" | "desktop" | undefined;
1649
+ activity?: {
1650
+ kind: "thinking" | "tool" | "responding";
1651
+ title?: string | undefined;
1652
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1653
+ } | undefined;
1654
+ queue?: {
1655
+ text: string;
1656
+ clientMessageId: string;
1657
+ images: number;
1658
+ }[] | undefined;
1659
+ }>;
1660
+ }, "strip", z.ZodTypeAny, {
1661
+ session: {
1662
+ id: string;
1663
+ cwd: string;
1664
+ createdAt: number;
1665
+ pendingPermissions: number;
1666
+ updatedAt: number;
1667
+ archived: boolean;
1668
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1669
+ agent: string;
1670
+ nativeId: string;
1671
+ lastSeq: number;
1672
+ title?: string | undefined;
1673
+ model?: string | undefined;
1674
+ permission?: {
1675
+ options: {
1676
+ name: string;
1677
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1678
+ optionId: string;
1679
+ }[];
1680
+ requestId: string;
1681
+ title: string;
1682
+ detail?: string | undefined;
1683
+ toolCallId?: string | undefined;
1684
+ } | undefined;
1685
+ preview?: string | undefined;
1686
+ driver?: "none" | "remote" | "desktop" | undefined;
1687
+ activity?: {
1688
+ kind: "thinking" | "tool" | "responding";
1689
+ title?: string | undefined;
1690
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1691
+ } | undefined;
1692
+ queue?: {
1693
+ text: string;
1694
+ clientMessageId: string;
1695
+ images: number;
1696
+ }[] | undefined;
1697
+ };
1698
+ }, {
1699
+ session: {
1700
+ id: string;
1701
+ cwd: string;
1702
+ createdAt: number;
1703
+ pendingPermissions: number;
1704
+ updatedAt: number;
1705
+ archived: boolean;
1706
+ state: "idle" | "error" | "running" | "waiting" | "offline";
1707
+ agent: string;
1708
+ nativeId: string;
1709
+ lastSeq: number;
1710
+ title?: string | undefined;
1711
+ model?: string | undefined;
1712
+ permission?: {
1713
+ options: {
1714
+ name: string;
1715
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
1716
+ optionId: string;
1717
+ }[];
1718
+ requestId: string;
1719
+ title: string;
1720
+ detail?: string | undefined;
1721
+ toolCallId?: string | undefined;
1722
+ } | undefined;
1723
+ preview?: string | undefined;
1724
+ driver?: "none" | "remote" | "desktop" | undefined;
1725
+ activity?: {
1726
+ kind: "thinking" | "tool" | "responding";
1727
+ title?: string | undefined;
1728
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
1729
+ } | undefined;
1730
+ queue?: {
1731
+ text: string;
1732
+ clientMessageId: string;
1733
+ images: number;
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?: "none" | "remote" | "desktop" | undefined;
1764
+ }, {
1765
+ driver?: "none" | "remote" | "desktop" | 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?: "none" | "remote" | "desktop" | undefined;
1780
+ }, {
1781
+ driver?: "none" | "remote" | "desktop" | 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
+ args: string[];
1800
+ agent: string;
1801
+ sessionId?: string | undefined;
1802
+ cwd?: string | undefined;
1803
+ env?: Record<string, string> | undefined;
1804
+ }, {
1805
+ agent: string;
1806
+ sessionId?: string | undefined;
1807
+ cwd?: 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: "connecting" | "off" | "offline" | "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: "connecting" | "off" | "offline" | "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
+ expiresAt: number;
1972
+ link: string;
1973
+ gateway: string;
1974
+ }, {
1975
+ code: string;
1976
+ expiresAt: number;
1977
+ link: string;
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
+ size: number;
2065
+ modifiedAt: number;
2066
+ truncated: boolean;
2067
+ kind: "text" | "image" | "binary";
2068
+ data?: string | undefined;
2069
+ text?: string | undefined;
2070
+ mimeType?: string | undefined;
2071
+ }, {
2072
+ path: string;
2073
+ size: number;
2074
+ modifiedAt: number;
2075
+ truncated: boolean;
2076
+ kind: "text" | "image" | "binary";
2077
+ data?: string | undefined;
2078
+ text?: string | undefined;
2079
+ mimeType?: 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
+ data: string;
2094
+ name: string;
2095
+ dir: string;
2096
+ }, {
2097
+ data: string;
2098
+ name: 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
+ limit: number;
2139
+ query: string;
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
+ cols: number;
2193
+ rows: number;
2194
+ cwd: string;
2195
+ createdAt: number;
2196
+ title: string;
2197
+ activeAt: number;
2198
+ exitCode?: number | null | undefined;
2199
+ command?: string | undefined;
2200
+ interrupted?: boolean | undefined;
2201
+ }, {
2202
+ id: string;
2203
+ cols: number;
2204
+ rows: number;
2205
+ cwd: string;
2206
+ createdAt: number;
2207
+ title: string;
2208
+ activeAt: number;
2209
+ exitCode?: number | null | undefined;
2210
+ command?: string | undefined;
2211
+ interrupted?: boolean | undefined;
2212
+ }>, "many">;
2213
+ }, "strip", z.ZodTypeAny, {
2214
+ terminals: {
2215
+ id: string;
2216
+ cols: number;
2217
+ rows: number;
2218
+ cwd: string;
2219
+ createdAt: number;
2220
+ title: string;
2221
+ activeAt: number;
2222
+ exitCode?: number | null | undefined;
2223
+ command?: string | undefined;
2224
+ interrupted?: boolean | undefined;
2225
+ }[];
2226
+ }, {
2227
+ terminals: {
2228
+ id: string;
2229
+ cols: number;
2230
+ rows: number;
2231
+ cwd: string;
2232
+ createdAt: number;
2233
+ title: string;
2234
+ activeAt: number;
2235
+ exitCode?: number | null | undefined;
2236
+ command?: string | 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
+ cols?: number | undefined;
2255
+ rows?: number | undefined;
2256
+ cwd?: string | 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
+ cols: number;
2274
+ rows: number;
2275
+ cwd: string;
2276
+ createdAt: number;
2277
+ title: string;
2278
+ activeAt: number;
2279
+ exitCode?: number | null | undefined;
2280
+ command?: string | undefined;
2281
+ interrupted?: boolean | undefined;
2282
+ }, {
2283
+ id: string;
2284
+ cols: number;
2285
+ rows: number;
2286
+ cwd: string;
2287
+ createdAt: number;
2288
+ title: string;
2289
+ activeAt: number;
2290
+ exitCode?: number | null | undefined;
2291
+ command?: string | undefined;
2292
+ interrupted?: boolean | undefined;
2293
+ }>;
2294
+ }, "strip", z.ZodTypeAny, {
2295
+ terminal: {
2296
+ id: string;
2297
+ cols: number;
2298
+ rows: number;
2299
+ cwd: string;
2300
+ createdAt: number;
2301
+ title: string;
2302
+ activeAt: number;
2303
+ exitCode?: number | null | undefined;
2304
+ command?: string | undefined;
2305
+ interrupted?: boolean | undefined;
2306
+ };
2307
+ }, {
2308
+ terminal: {
2309
+ id: string;
2310
+ cols: number;
2311
+ rows: number;
2312
+ cwd: string;
2313
+ createdAt: number;
2314
+ title: string;
2315
+ activeAt: number;
2316
+ exitCode?: number | null | undefined;
2317
+ command?: string | 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
+ cols: number;
2353
+ rows: number;
2354
+ cwd: string;
2355
+ createdAt: number;
2356
+ title: string;
2357
+ activeAt: number;
2358
+ exitCode?: number | null | undefined;
2359
+ command?: string | undefined;
2360
+ interrupted?: boolean | undefined;
2361
+ }, {
2362
+ id: string;
2363
+ cols: number;
2364
+ rows: number;
2365
+ cwd: string;
2366
+ createdAt: number;
2367
+ title: string;
2368
+ activeAt: number;
2369
+ exitCode?: number | null | undefined;
2370
+ command?: string | 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
+ seq: number;
2381
+ terminal: {
2382
+ id: string;
2383
+ cols: number;
2384
+ rows: number;
2385
+ cwd: string;
2386
+ createdAt: number;
2387
+ title: string;
2388
+ activeAt: number;
2389
+ exitCode?: number | null | undefined;
2390
+ command?: string | undefined;
2391
+ interrupted?: boolean | undefined;
2392
+ };
2393
+ replay: string;
2394
+ reset: boolean;
2395
+ }, {
2396
+ seq: number;
2397
+ terminal: {
2398
+ id: string;
2399
+ cols: number;
2400
+ rows: number;
2401
+ cwd: string;
2402
+ createdAt: number;
2403
+ title: string;
2404
+ activeAt: number;
2405
+ exitCode?: number | null | undefined;
2406
+ command?: string | undefined;
2407
+ interrupted?: boolean | undefined;
2408
+ };
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
+ terminalId: string;
2429
+ data: string;
2430
+ }, {
2431
+ terminalId: string;
2432
+ data: 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
+ terminalId: string;
2443
+ cols: number;
2444
+ rows: number;
2445
+ }, {
2446
+ terminalId: string;
2447
+ cols: number;
2448
+ rows: number;
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
+ cwd?: string | undefined;
2478
+ title?: string | undefined;
2479
+ pid?: number | undefined;
2480
+ }, {
2481
+ port: number;
2482
+ process: string;
2483
+ http: boolean;
2484
+ cwd?: string | undefined;
2485
+ title?: string | undefined;
2486
+ pid?: number | undefined;
2487
+ }>, "many">;
2488
+ }, "strip", z.ZodTypeAny, {
2489
+ ports: {
2490
+ port: number;
2491
+ process: string;
2492
+ http: boolean;
2493
+ cwd?: string | undefined;
2494
+ title?: string | undefined;
2495
+ pid?: number | undefined;
2496
+ }[];
2497
+ }, {
2498
+ ports: {
2499
+ port: number;
2500
+ process: string;
2501
+ http: boolean;
2502
+ cwd?: string | undefined;
2503
+ title?: 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" | "completed" | "failed" | "in_progress";
3049
+ kind: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
3050
+ title: string;
3051
+ toolCallId: string;
3052
+ sessionUpdate: "tool_call";
3053
+ content?: ({
3054
+ type: "content";
3055
+ content: {
3056
+ type: "text";
3057
+ text: string;
3058
+ } | {
3059
+ type: "image";
3060
+ mimeType: string;
3061
+ data?: string | undefined;
3062
+ uri?: string | undefined;
3063
+ } | {
3064
+ type: "resource_link";
3065
+ name: string;
3066
+ uri: string;
3067
+ kind?: "agent" | "file" | "skill" | undefined;
3068
+ };
3069
+ } | {
3070
+ path: string;
3071
+ type: "diff";
3072
+ newText: string;
3073
+ oldText?: string | null | undefined;
3074
+ } | {
3075
+ path: string;
3076
+ type: "patch";
3077
+ diff: string;
3078
+ change: "delete" | "add" | "update";
3079
+ movePath?: string | undefined;
3080
+ } | {
3081
+ type: "terminal";
3082
+ terminalId: string;
3083
+ })[] | undefined;
3084
+ detail?: {
3085
+ type: "mcp";
3086
+ tool: string;
3087
+ server: string;
3088
+ } | {
3089
+ type: "subagent";
3090
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3091
+ model?: string | undefined;
3092
+ task?: string | undefined;
3093
+ agentType?: string | undefined;
3094
+ } | {
3095
+ type: "skill";
3096
+ name: string;
3097
+ description?: string | undefined;
3098
+ } | {
3099
+ type: "web_search";
3100
+ query?: string | undefined;
3101
+ } | {
3102
+ type: "image_generation";
3103
+ prompt?: string | undefined;
3104
+ } | {
3105
+ type: "compaction";
3106
+ } | {
3107
+ type: "review";
3108
+ phase: "started" | "finished";
3109
+ } | undefined;
3110
+ parentToolCallId?: string | undefined;
3111
+ rawInput?: unknown;
3112
+ locations?: {
3113
+ path: string;
3114
+ line?: number | undefined;
3115
+ }[] | undefined;
3116
+ }, {
3117
+ status: "pending" | "completed" | "failed" | "in_progress";
3118
+ kind: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
3119
+ title: string;
3120
+ toolCallId: string;
3121
+ sessionUpdate: "tool_call";
3122
+ content?: ({
3123
+ type: "content";
3124
+ content: {
3125
+ type: "text";
3126
+ text: string;
3127
+ } | {
3128
+ type: "image";
3129
+ mimeType: string;
3130
+ data?: string | undefined;
3131
+ uri?: string | undefined;
3132
+ } | {
3133
+ type: "resource_link";
3134
+ name: string;
3135
+ uri: string;
3136
+ kind?: "agent" | "file" | "skill" | undefined;
3137
+ };
3138
+ } | {
3139
+ path: string;
3140
+ type: "diff";
3141
+ newText: string;
3142
+ oldText?: string | null | undefined;
3143
+ } | {
3144
+ path: string;
3145
+ type: "patch";
3146
+ diff: string;
3147
+ change: "delete" | "add" | "update";
3148
+ movePath?: string | undefined;
3149
+ } | {
3150
+ type: "terminal";
3151
+ terminalId: string;
3152
+ })[] | undefined;
3153
+ detail?: {
3154
+ type: "mcp";
3155
+ tool: string;
3156
+ server: string;
3157
+ } | {
3158
+ type: "subagent";
3159
+ model?: string | undefined;
3160
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
3161
+ task?: string | undefined;
3162
+ agentType?: string | undefined;
3163
+ } | {
3164
+ type: "skill";
3165
+ name: string;
3166
+ description?: string | undefined;
3167
+ } | {
3168
+ type: "web_search";
3169
+ query?: string | undefined;
3170
+ } | {
3171
+ type: "image_generation";
3172
+ prompt?: string | undefined;
3173
+ } | {
3174
+ type: "compaction";
3175
+ } | {
3176
+ type: "review";
3177
+ phase: "started" | "finished";
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" | "completed" | "failed" | "in_progress" | undefined;
3390
+ content?: ({
3391
+ type: "content";
3392
+ content: {
3393
+ type: "text";
3394
+ text: string;
3395
+ } | {
3396
+ type: "image";
3397
+ mimeType: string;
3398
+ data?: string | undefined;
3399
+ uri?: string | undefined;
3400
+ } | {
3401
+ type: "resource_link";
3402
+ name: string;
3403
+ uri: string;
3404
+ kind?: "agent" | "file" | "skill" | undefined;
3405
+ };
3406
+ } | {
3407
+ path: string;
3408
+ type: "diff";
3409
+ newText: string;
3410
+ oldText?: string | null | undefined;
3411
+ } | {
3412
+ path: string;
3413
+ type: "patch";
3414
+ diff: string;
3415
+ change: "delete" | "add" | "update";
3416
+ movePath?: string | undefined;
3417
+ } | {
3418
+ type: "terminal";
3419
+ terminalId: string;
3420
+ })[] | undefined;
3421
+ title?: string | undefined;
3422
+ detail?: {
3423
+ type: "mcp";
3424
+ tool: string;
3425
+ server: string;
3426
+ } | {
3427
+ type: "subagent";
3428
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3429
+ model?: string | undefined;
3430
+ task?: string | undefined;
3431
+ agentType?: string | undefined;
3432
+ } | {
3433
+ type: "skill";
3434
+ name: string;
3435
+ description?: string | undefined;
3436
+ } | {
3437
+ type: "web_search";
3438
+ query?: string | undefined;
3439
+ } | {
3440
+ type: "image_generation";
3441
+ prompt?: string | undefined;
3442
+ } | {
3443
+ type: "compaction";
3444
+ } | {
3445
+ type: "review";
3446
+ phase: "started" | "finished";
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" | "completed" | "failed" | "in_progress" | undefined;
3455
+ content?: ({
3456
+ type: "content";
3457
+ content: {
3458
+ type: "text";
3459
+ text: string;
3460
+ } | {
3461
+ type: "image";
3462
+ mimeType: string;
3463
+ data?: string | undefined;
3464
+ uri?: string | undefined;
3465
+ } | {
3466
+ type: "resource_link";
3467
+ name: string;
3468
+ uri: string;
3469
+ kind?: "agent" | "file" | "skill" | undefined;
3470
+ };
3471
+ } | {
3472
+ path: string;
3473
+ type: "diff";
3474
+ newText: string;
3475
+ oldText?: string | null | undefined;
3476
+ } | {
3477
+ path: string;
3478
+ type: "patch";
3479
+ diff: string;
3480
+ change: "delete" | "add" | "update";
3481
+ movePath?: string | undefined;
3482
+ } | {
3483
+ type: "terminal";
3484
+ terminalId: string;
3485
+ })[] | undefined;
3486
+ title?: string | undefined;
3487
+ detail?: {
3488
+ type: "mcp";
3489
+ tool: string;
3490
+ server: string;
3491
+ } | {
3492
+ type: "subagent";
3493
+ model?: string | undefined;
3494
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
3495
+ task?: string | undefined;
3496
+ agentType?: string | undefined;
3497
+ } | {
3498
+ type: "skill";
3499
+ name: string;
3500
+ description?: string | undefined;
3501
+ } | {
3502
+ type: "web_search";
3503
+ query?: string | undefined;
3504
+ } | {
3505
+ type: "image_generation";
3506
+ prompt?: string | undefined;
3507
+ } | {
3508
+ type: "compaction";
3509
+ } | {
3510
+ type: "review";
3511
+ phase: "started" | "finished";
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" | "completed" | "in_progress";
3524
+ content: string;
3525
+ priority: "low" | "medium" | "high";
3526
+ }, {
3527
+ status: "pending" | "completed" | "in_progress";
3528
+ content: string;
3529
+ priority?: "low" | "medium" | "high" | undefined;
3530
+ }>, "many">;
3531
+ }, "strip", z.ZodTypeAny, {
3532
+ entries: {
3533
+ status: "pending" | "completed" | "in_progress";
3534
+ content: string;
3535
+ priority: "low" | "medium" | "high";
3536
+ }[];
3537
+ sessionUpdate: "plan";
3538
+ }, {
3539
+ entries: {
3540
+ status: "pending" | "completed" | "in_progress";
3541
+ content: string;
3542
+ priority?: "low" | "medium" | "high" | 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
+ contextWindow?: number | undefined;
3602
+ usedTokens?: number | undefined;
3603
+ }, {
3604
+ sessionUpdate: "usage_update";
3605
+ contextWindow?: number | undefined;
3606
+ usedTokens?: 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
+ role: "user" | "agent" | "thought";
3614
+ sessionUpdate: "ls_message_done";
3615
+ messageId: string;
3616
+ parentToolCallId?: string | undefined;
3617
+ }, {
3618
+ role: "user" | "agent" | "thought";
3619
+ sessionUpdate: "ls_message_done";
3620
+ messageId: string;
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: "mode" | "other" | "model" | "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?: "mode" | "other" | "model" | "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: "mode" | "other" | "model" | "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?: "mode" | "other" | "model" | "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
+ turnId?: string | undefined;
3714
+ parentToolCallId?: string | undefined;
3715
+ stopReason?: "error" | "cancelled" | "end_turn" | "max_tokens" | "refusal" | undefined;
3716
+ }, {
3717
+ state: "started" | "ended";
3718
+ sessionUpdate: "ls_turn";
3719
+ turnId?: string | undefined;
3720
+ parentToolCallId?: string | undefined;
3721
+ stopReason?: "error" | "cancelled" | "end_turn" | "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
+ name: string;
3734
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3735
+ optionId: string;
3736
+ }, {
3737
+ name: string;
3738
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3739
+ optionId: string;
3740
+ }>, "many">;
3741
+ }, "strip", z.ZodTypeAny, {
3742
+ options: {
3743
+ name: string;
3744
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3745
+ optionId: string;
3746
+ }[];
3747
+ requestId: string;
3748
+ title: string;
3749
+ sessionUpdate: "ls_permission";
3750
+ detail?: string | undefined;
3751
+ toolCallId?: string | undefined;
3752
+ }, {
3753
+ options: {
3754
+ name: string;
3755
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3756
+ optionId: string;
3757
+ }[];
3758
+ requestId: string;
3759
+ title: string;
3760
+ sessionUpdate: "ls_permission";
3761
+ detail?: string | undefined;
3762
+ toolCallId?: 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: "none" | "remote" | "desktop";
3781
+ sessionUpdate: "ls_driver";
3782
+ deviceId?: string | undefined;
3783
+ }, {
3784
+ driver: "none" | "remote" | "desktop";
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" | "error" | "running" | "waiting" | "offline";
3792
+ sessionUpdate: "ls_status";
3793
+ }, {
3794
+ state: "idle" | "error" | "running" | "waiting" | "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
+ sessionId: string;
3814
+ seq: number;
3815
+ ts: number;
3816
+ update: {
3817
+ content: {
3818
+ type: "text";
3819
+ text: string;
3820
+ } | {
3821
+ type: "image";
3822
+ mimeType: string;
3823
+ data?: string | undefined;
3824
+ uri?: string | undefined;
3825
+ } | {
3826
+ type: "resource_link";
3827
+ name: string;
3828
+ uri: string;
3829
+ kind?: "agent" | "file" | "skill" | undefined;
3830
+ };
3831
+ sessionUpdate: "user_message_chunk";
3832
+ messageId?: string | undefined;
3833
+ } | {
3834
+ content: {
3835
+ type: "text";
3836
+ text: string;
3837
+ } | {
3838
+ type: "image";
3839
+ mimeType: string;
3840
+ data?: string | undefined;
3841
+ uri?: string | undefined;
3842
+ } | {
3843
+ type: "resource_link";
3844
+ name: string;
3845
+ uri: string;
3846
+ kind?: "agent" | "file" | "skill" | undefined;
3847
+ };
3848
+ sessionUpdate: "agent_message_chunk";
3849
+ messageId: string;
3850
+ parentToolCallId?: string | undefined;
3851
+ } | {
3852
+ content: {
3853
+ type: "text";
3854
+ text: string;
3855
+ } | {
3856
+ type: "image";
3857
+ mimeType: string;
3858
+ data?: string | undefined;
3859
+ uri?: string | undefined;
3860
+ } | {
3861
+ type: "resource_link";
3862
+ name: string;
3863
+ uri: string;
3864
+ kind?: "agent" | "file" | "skill" | undefined;
3865
+ };
3866
+ sessionUpdate: "agent_thought_chunk";
3867
+ messageId: string;
3868
+ parentToolCallId?: string | undefined;
3869
+ } | {
3870
+ status: "pending" | "completed" | "failed" | "in_progress";
3871
+ kind: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
3872
+ title: string;
3873
+ toolCallId: string;
3874
+ sessionUpdate: "tool_call";
3875
+ content?: ({
3876
+ type: "content";
3877
+ content: {
3878
+ type: "text";
3879
+ text: string;
3880
+ } | {
3881
+ type: "image";
3882
+ mimeType: string;
3883
+ data?: string | undefined;
3884
+ uri?: string | undefined;
3885
+ } | {
3886
+ type: "resource_link";
3887
+ name: string;
3888
+ uri: string;
3889
+ kind?: "agent" | "file" | "skill" | undefined;
3890
+ };
3891
+ } | {
3892
+ path: string;
3893
+ type: "diff";
3894
+ newText: string;
3895
+ oldText?: string | null | undefined;
3896
+ } | {
3897
+ path: string;
3898
+ type: "patch";
3899
+ diff: string;
3900
+ change: "delete" | "add" | "update";
3901
+ movePath?: string | undefined;
3902
+ } | {
3903
+ type: "terminal";
3904
+ terminalId: string;
3905
+ })[] | undefined;
3906
+ detail?: {
3907
+ type: "mcp";
3908
+ tool: string;
3909
+ server: string;
3910
+ } | {
3911
+ type: "subagent";
3912
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3913
+ model?: string | undefined;
3914
+ task?: string | undefined;
3915
+ agentType?: string | undefined;
3916
+ } | {
3917
+ type: "skill";
3918
+ name: string;
3919
+ description?: string | undefined;
3920
+ } | {
3921
+ type: "web_search";
3922
+ query?: string | undefined;
3923
+ } | {
3924
+ type: "image_generation";
3925
+ prompt?: string | undefined;
3926
+ } | {
3927
+ type: "compaction";
3928
+ } | {
3929
+ type: "review";
3930
+ phase: "started" | "finished";
3931
+ } | undefined;
3932
+ parentToolCallId?: string | undefined;
3933
+ rawInput?: unknown;
3934
+ locations?: {
3935
+ path: string;
3936
+ line?: number | undefined;
3937
+ }[] | undefined;
3938
+ } | {
3939
+ toolCallId: string;
3940
+ sessionUpdate: "tool_call_update";
3941
+ status?: "pending" | "completed" | "failed" | "in_progress" | undefined;
3942
+ content?: ({
3943
+ type: "content";
3944
+ content: {
3945
+ type: "text";
3946
+ text: string;
3947
+ } | {
3948
+ type: "image";
3949
+ mimeType: string;
3950
+ data?: string | undefined;
3951
+ uri?: string | undefined;
3952
+ } | {
3953
+ type: "resource_link";
3954
+ name: string;
3955
+ uri: string;
3956
+ kind?: "agent" | "file" | "skill" | undefined;
3957
+ };
3958
+ } | {
3959
+ path: string;
3960
+ type: "diff";
3961
+ newText: string;
3962
+ oldText?: string | null | undefined;
3963
+ } | {
3964
+ path: string;
3965
+ type: "patch";
3966
+ diff: string;
3967
+ change: "delete" | "add" | "update";
3968
+ movePath?: string | undefined;
3969
+ } | {
3970
+ type: "terminal";
3971
+ terminalId: string;
3972
+ })[] | undefined;
3973
+ title?: string | undefined;
3974
+ detail?: {
3975
+ type: "mcp";
3976
+ tool: string;
3977
+ server: string;
3978
+ } | {
3979
+ type: "subagent";
3980
+ action: "message" | "spawn" | "wait" | "stop" | "resume" | "list";
3981
+ model?: string | undefined;
3982
+ task?: string | undefined;
3983
+ agentType?: string | undefined;
3984
+ } | {
3985
+ type: "skill";
3986
+ name: string;
3987
+ description?: string | undefined;
3988
+ } | {
3989
+ type: "web_search";
3990
+ query?: string | undefined;
3991
+ } | {
3992
+ type: "image_generation";
3993
+ prompt?: string | undefined;
3994
+ } | {
3995
+ type: "compaction";
3996
+ } | {
3997
+ type: "review";
3998
+ phase: "started" | "finished";
3999
+ } | undefined;
4000
+ parentToolCallId?: string | undefined;
4001
+ appendOutput?: string | undefined;
4002
+ rawOutput?: unknown;
4003
+ } | {
4004
+ entries: {
4005
+ status: "pending" | "completed" | "in_progress";
4006
+ content: string;
4007
+ priority: "low" | "medium" | "high";
4008
+ }[];
4009
+ sessionUpdate: "plan";
4010
+ } | {
4011
+ sessionUpdate: "available_commands_update";
4012
+ availableCommands: {
4013
+ name: string;
4014
+ description: string;
4015
+ hint?: string | undefined;
4016
+ }[];
4017
+ } | {
4018
+ sessionUpdate: "current_mode_update";
4019
+ currentModeId: string;
4020
+ } | {
4021
+ sessionUpdate: "session_info_update";
4022
+ title?: string | undefined;
4023
+ model?: string | undefined;
4024
+ } | {
4025
+ sessionUpdate: "usage_update";
4026
+ contextWindow?: number | undefined;
4027
+ usedTokens?: number | undefined;
4028
+ } | {
4029
+ role: "user" | "agent" | "thought";
4030
+ sessionUpdate: "ls_message_done";
4031
+ messageId: string;
4032
+ parentToolCallId?: string | undefined;
4033
+ } | {
4034
+ options: {
4035
+ values: {
4036
+ value: string;
4037
+ name: string;
4038
+ description?: string | undefined;
4039
+ }[];
4040
+ id: string;
4041
+ name: string;
4042
+ category: "mode" | "other" | "model" | "effort";
4043
+ current: string;
4044
+ }[];
4045
+ sessionUpdate: "ls_config";
4046
+ } | {
4047
+ title: string;
4048
+ sessionUpdate: "ls_notice";
4049
+ level: "info" | "warning";
4050
+ detail?: string | undefined;
4051
+ } | {
4052
+ state: "started" | "ended";
4053
+ sessionUpdate: "ls_turn";
4054
+ turnId?: string | undefined;
4055
+ parentToolCallId?: string | undefined;
4056
+ stopReason?: "error" | "cancelled" | "end_turn" | "max_tokens" | "refusal" | undefined;
4057
+ } | {
4058
+ options: {
4059
+ name: string;
4060
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4061
+ optionId: string;
4062
+ }[];
4063
+ requestId: string;
4064
+ title: string;
4065
+ sessionUpdate: "ls_permission";
4066
+ detail?: string | undefined;
4067
+ toolCallId?: string | undefined;
4068
+ } | {
4069
+ requestId: string;
4070
+ sessionUpdate: "ls_permission_resolved";
4071
+ optionId?: string | undefined;
4072
+ } | {
4073
+ driver: "none" | "remote" | "desktop";
4074
+ sessionUpdate: "ls_driver";
4075
+ deviceId?: string | undefined;
4076
+ } | {
4077
+ state: "idle" | "error" | "running" | "waiting" | "offline";
4078
+ sessionUpdate: "ls_status";
4079
+ } | {
4080
+ code: string;
4081
+ message: string;
4082
+ sessionUpdate: "ls_error";
4083
+ hint?: string | undefined;
4084
+ };
4085
+ }, {
4086
+ sessionId: string;
4087
+ seq: number;
4088
+ ts: number;
4089
+ update: {
4090
+ content: {
4091
+ type: "text";
4092
+ text: string;
4093
+ } | {
4094
+ type: "image";
4095
+ mimeType: string;
4096
+ data?: string | undefined;
4097
+ uri?: string | undefined;
4098
+ } | {
4099
+ type: "resource_link";
4100
+ name: string;
4101
+ uri: string;
4102
+ kind?: "agent" | "file" | "skill" | undefined;
4103
+ };
4104
+ sessionUpdate: "user_message_chunk";
4105
+ messageId?: string | undefined;
4106
+ } | {
4107
+ content: {
4108
+ type: "text";
4109
+ text: string;
4110
+ } | {
4111
+ type: "image";
4112
+ mimeType: string;
4113
+ data?: string | undefined;
4114
+ uri?: string | undefined;
4115
+ } | {
4116
+ type: "resource_link";
4117
+ name: string;
4118
+ uri: string;
4119
+ kind?: "agent" | "file" | "skill" | undefined;
4120
+ };
4121
+ sessionUpdate: "agent_message_chunk";
4122
+ messageId: string;
4123
+ parentToolCallId?: string | undefined;
4124
+ } | {
4125
+ content: {
4126
+ type: "text";
4127
+ text: string;
4128
+ } | {
4129
+ type: "image";
4130
+ mimeType: string;
4131
+ data?: string | undefined;
4132
+ uri?: string | undefined;
4133
+ } | {
4134
+ type: "resource_link";
4135
+ name: string;
4136
+ uri: string;
4137
+ kind?: "agent" | "file" | "skill" | undefined;
4138
+ };
4139
+ sessionUpdate: "agent_thought_chunk";
4140
+ messageId: string;
4141
+ parentToolCallId?: string | undefined;
4142
+ } | {
4143
+ status: "pending" | "completed" | "failed" | "in_progress";
4144
+ kind: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch";
4145
+ title: string;
4146
+ toolCallId: string;
4147
+ sessionUpdate: "tool_call";
4148
+ content?: ({
4149
+ type: "content";
4150
+ content: {
4151
+ type: "text";
4152
+ text: string;
4153
+ } | {
4154
+ type: "image";
4155
+ mimeType: string;
4156
+ data?: string | undefined;
4157
+ uri?: string | undefined;
4158
+ } | {
4159
+ type: "resource_link";
4160
+ name: string;
4161
+ uri: string;
4162
+ kind?: "agent" | "file" | "skill" | undefined;
4163
+ };
4164
+ } | {
4165
+ path: string;
4166
+ type: "diff";
4167
+ newText: string;
4168
+ oldText?: string | null | undefined;
4169
+ } | {
4170
+ path: string;
4171
+ type: "patch";
4172
+ diff: string;
4173
+ change: "delete" | "add" | "update";
4174
+ movePath?: string | undefined;
4175
+ } | {
4176
+ type: "terminal";
4177
+ terminalId: string;
4178
+ })[] | undefined;
4179
+ detail?: {
4180
+ type: "mcp";
4181
+ tool: string;
4182
+ server: string;
4183
+ } | {
4184
+ type: "subagent";
4185
+ model?: string | undefined;
4186
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
4187
+ task?: string | undefined;
4188
+ agentType?: string | undefined;
4189
+ } | {
4190
+ type: "skill";
4191
+ name: string;
4192
+ description?: string | undefined;
4193
+ } | {
4194
+ type: "web_search";
4195
+ query?: string | undefined;
4196
+ } | {
4197
+ type: "image_generation";
4198
+ prompt?: string | undefined;
4199
+ } | {
4200
+ type: "compaction";
4201
+ } | {
4202
+ type: "review";
4203
+ phase: "started" | "finished";
4204
+ } | undefined;
4205
+ parentToolCallId?: string | undefined;
4206
+ rawInput?: unknown;
4207
+ locations?: {
4208
+ path: string;
4209
+ line?: number | undefined;
4210
+ }[] | undefined;
4211
+ } | {
4212
+ toolCallId: string;
4213
+ sessionUpdate: "tool_call_update";
4214
+ status?: "pending" | "completed" | "failed" | "in_progress" | undefined;
4215
+ content?: ({
4216
+ type: "content";
4217
+ content: {
4218
+ type: "text";
4219
+ text: string;
4220
+ } | {
4221
+ type: "image";
4222
+ mimeType: string;
4223
+ data?: string | undefined;
4224
+ uri?: string | undefined;
4225
+ } | {
4226
+ type: "resource_link";
4227
+ name: string;
4228
+ uri: string;
4229
+ kind?: "agent" | "file" | "skill" | undefined;
4230
+ };
4231
+ } | {
4232
+ path: string;
4233
+ type: "diff";
4234
+ newText: string;
4235
+ oldText?: string | null | undefined;
4236
+ } | {
4237
+ path: string;
4238
+ type: "patch";
4239
+ diff: string;
4240
+ change: "delete" | "add" | "update";
4241
+ movePath?: string | undefined;
4242
+ } | {
4243
+ type: "terminal";
4244
+ terminalId: string;
4245
+ })[] | undefined;
4246
+ title?: string | undefined;
4247
+ detail?: {
4248
+ type: "mcp";
4249
+ tool: string;
4250
+ server: string;
4251
+ } | {
4252
+ type: "subagent";
4253
+ model?: string | undefined;
4254
+ action?: "message" | "spawn" | "wait" | "stop" | "resume" | "list" | undefined;
4255
+ task?: string | undefined;
4256
+ agentType?: string | undefined;
4257
+ } | {
4258
+ type: "skill";
4259
+ name: string;
4260
+ description?: string | undefined;
4261
+ } | {
4262
+ type: "web_search";
4263
+ query?: string | undefined;
4264
+ } | {
4265
+ type: "image_generation";
4266
+ prompt?: string | undefined;
4267
+ } | {
4268
+ type: "compaction";
4269
+ } | {
4270
+ type: "review";
4271
+ phase: "started" | "finished";
4272
+ } | undefined;
4273
+ parentToolCallId?: string | undefined;
4274
+ appendOutput?: string | undefined;
4275
+ rawOutput?: unknown;
4276
+ } | {
4277
+ entries: {
4278
+ status: "pending" | "completed" | "in_progress";
4279
+ content: string;
4280
+ priority?: "low" | "medium" | "high" | undefined;
4281
+ }[];
4282
+ sessionUpdate: "plan";
4283
+ } | {
4284
+ sessionUpdate: "available_commands_update";
4285
+ availableCommands: {
4286
+ name: string;
4287
+ description: string;
4288
+ hint?: string | undefined;
4289
+ }[];
4290
+ } | {
4291
+ sessionUpdate: "current_mode_update";
4292
+ currentModeId: string;
4293
+ } | {
4294
+ sessionUpdate: "session_info_update";
4295
+ title?: string | undefined;
4296
+ model?: string | undefined;
4297
+ } | {
4298
+ sessionUpdate: "usage_update";
4299
+ contextWindow?: number | undefined;
4300
+ usedTokens?: number | undefined;
4301
+ } | {
4302
+ role: "user" | "agent" | "thought";
4303
+ sessionUpdate: "ls_message_done";
4304
+ messageId: string;
4305
+ parentToolCallId?: string | undefined;
4306
+ } | {
4307
+ options: {
4308
+ values: {
4309
+ value: string;
4310
+ name: string;
4311
+ description?: string | undefined;
4312
+ }[];
4313
+ id: string;
4314
+ name: string;
4315
+ current: string;
4316
+ category?: "mode" | "other" | "model" | "effort" | undefined;
4317
+ }[];
4318
+ sessionUpdate: "ls_config";
4319
+ } | {
4320
+ title: string;
4321
+ sessionUpdate: "ls_notice";
4322
+ level: "info" | "warning";
4323
+ detail?: string | undefined;
4324
+ } | {
4325
+ state: "started" | "ended";
4326
+ sessionUpdate: "ls_turn";
4327
+ turnId?: string | undefined;
4328
+ parentToolCallId?: string | undefined;
4329
+ stopReason?: "error" | "cancelled" | "end_turn" | "max_tokens" | "refusal" | undefined;
4330
+ } | {
4331
+ options: {
4332
+ name: string;
4333
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4334
+ optionId: string;
4335
+ }[];
4336
+ requestId: string;
4337
+ title: string;
4338
+ sessionUpdate: "ls_permission";
4339
+ detail?: string | undefined;
4340
+ toolCallId?: string | undefined;
4341
+ } | {
4342
+ requestId: string;
4343
+ sessionUpdate: "ls_permission_resolved";
4344
+ optionId?: string | undefined;
4345
+ } | {
4346
+ driver: "none" | "remote" | "desktop";
4347
+ sessionUpdate: "ls_driver";
4348
+ deviceId?: string | undefined;
4349
+ } | {
4350
+ state: "idle" | "error" | "running" | "waiting" | "offline";
4351
+ sessionUpdate: "ls_status";
4352
+ } | {
4353
+ code: string;
4354
+ message: string;
4355
+ sessionUpdate: "ls_error";
4356
+ hint?: string | undefined;
4357
+ };
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" | "tool" | "responding";
4381
+ title?: string | undefined;
4382
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
4383
+ }, {
4384
+ kind: "thinking" | "tool" | "responding";
4385
+ title?: string | undefined;
4386
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | 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
+ name: string;
4399
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4400
+ optionId: string;
4401
+ }, {
4402
+ name: string;
4403
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4404
+ optionId: string;
4405
+ }>, "many">;
4406
+ }, "strip", z.ZodTypeAny, {
4407
+ options: {
4408
+ name: string;
4409
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4410
+ optionId: string;
4411
+ }[];
4412
+ requestId: string;
4413
+ title: string;
4414
+ detail?: string | undefined;
4415
+ toolCallId?: string | undefined;
4416
+ }, {
4417
+ options: {
4418
+ name: string;
4419
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4420
+ optionId: string;
4421
+ }[];
4422
+ requestId: string;
4423
+ title: string;
4424
+ detail?: string | undefined;
4425
+ toolCallId?: 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
+ text: string;
4433
+ clientMessageId: string;
4434
+ images: number;
4435
+ }, {
4436
+ text: string;
4437
+ clientMessageId: string;
4438
+ images: number;
4439
+ }>, "many">>;
4440
+ }, "strip", z.ZodTypeAny, {
4441
+ id: string;
4442
+ cwd: string;
4443
+ createdAt: number;
4444
+ pendingPermissions: number;
4445
+ updatedAt: number;
4446
+ archived: boolean;
4447
+ state: "idle" | "error" | "running" | "waiting" | "offline";
4448
+ agent: string;
4449
+ nativeId: string;
4450
+ lastSeq: number;
4451
+ title?: string | undefined;
4452
+ model?: string | undefined;
4453
+ permission?: {
4454
+ options: {
4455
+ name: string;
4456
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4457
+ optionId: string;
4458
+ }[];
4459
+ requestId: string;
4460
+ title: string;
4461
+ detail?: string | undefined;
4462
+ toolCallId?: string | undefined;
4463
+ } | undefined;
4464
+ preview?: string | undefined;
4465
+ driver?: "none" | "remote" | "desktop" | undefined;
4466
+ activity?: {
4467
+ kind: "thinking" | "tool" | "responding";
4468
+ title?: string | undefined;
4469
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
4470
+ } | undefined;
4471
+ queue?: {
4472
+ text: string;
4473
+ clientMessageId: string;
4474
+ images: number;
4475
+ }[] | undefined;
4476
+ }, {
4477
+ id: string;
4478
+ cwd: string;
4479
+ createdAt: number;
4480
+ pendingPermissions: number;
4481
+ updatedAt: number;
4482
+ archived: boolean;
4483
+ state: "idle" | "error" | "running" | "waiting" | "offline";
4484
+ agent: string;
4485
+ nativeId: string;
4486
+ lastSeq: number;
4487
+ title?: string | undefined;
4488
+ model?: string | undefined;
4489
+ permission?: {
4490
+ options: {
4491
+ name: string;
4492
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4493
+ optionId: string;
4494
+ }[];
4495
+ requestId: string;
4496
+ title: string;
4497
+ detail?: string | undefined;
4498
+ toolCallId?: string | undefined;
4499
+ } | undefined;
4500
+ preview?: string | undefined;
4501
+ driver?: "none" | "remote" | "desktop" | undefined;
4502
+ activity?: {
4503
+ kind: "thinking" | "tool" | "responding";
4504
+ title?: string | undefined;
4505
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
4506
+ } | undefined;
4507
+ queue?: {
4508
+ text: string;
4509
+ clientMessageId: string;
4510
+ images: number;
4511
+ }[] | undefined;
4512
+ }>;
4513
+ }, "strip", z.ZodTypeAny, {
4514
+ session: {
4515
+ id: string;
4516
+ cwd: string;
4517
+ createdAt: number;
4518
+ pendingPermissions: number;
4519
+ updatedAt: number;
4520
+ archived: boolean;
4521
+ state: "idle" | "error" | "running" | "waiting" | "offline";
4522
+ agent: string;
4523
+ nativeId: string;
4524
+ lastSeq: number;
4525
+ title?: string | undefined;
4526
+ model?: string | undefined;
4527
+ permission?: {
4528
+ options: {
4529
+ name: string;
4530
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4531
+ optionId: string;
4532
+ }[];
4533
+ requestId: string;
4534
+ title: string;
4535
+ detail?: string | undefined;
4536
+ toolCallId?: string | undefined;
4537
+ } | undefined;
4538
+ preview?: string | undefined;
4539
+ driver?: "none" | "remote" | "desktop" | undefined;
4540
+ activity?: {
4541
+ kind: "thinking" | "tool" | "responding";
4542
+ title?: string | undefined;
4543
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
4544
+ } | undefined;
4545
+ queue?: {
4546
+ text: string;
4547
+ clientMessageId: string;
4548
+ images: number;
4549
+ }[] | undefined;
4550
+ };
4551
+ }, {
4552
+ session: {
4553
+ id: string;
4554
+ cwd: string;
4555
+ createdAt: number;
4556
+ pendingPermissions: number;
4557
+ updatedAt: number;
4558
+ archived: boolean;
4559
+ state: "idle" | "error" | "running" | "waiting" | "offline";
4560
+ agent: string;
4561
+ nativeId: string;
4562
+ lastSeq: number;
4563
+ title?: string | undefined;
4564
+ model?: string | undefined;
4565
+ permission?: {
4566
+ options: {
4567
+ name: string;
4568
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
4569
+ optionId: string;
4570
+ }[];
4571
+ requestId: string;
4572
+ title: string;
4573
+ detail?: string | undefined;
4574
+ toolCallId?: string | undefined;
4575
+ } | undefined;
4576
+ preview?: string | undefined;
4577
+ driver?: "none" | "remote" | "desktop" | undefined;
4578
+ activity?: {
4579
+ kind: "thinking" | "tool" | "responding";
4580
+ title?: string | undefined;
4581
+ toolKind?: "other" | "delete" | "read" | "edit" | "move" | "search" | "execute" | "think" | "fetch" | undefined;
4582
+ } | undefined;
4583
+ queue?: {
4584
+ text: string;
4585
+ clientMessageId: string;
4586
+ images: number;
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
+ sessionId: string;
4612
+ line: string;
4613
+ }, {
4614
+ sessionId: string;
4615
+ line: 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: "connecting" | "off" | "offline" | "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: "connecting" | "off" | "offline" | "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
+ terminalId: string;
4738
+ seq: number;
4739
+ data: string;
4740
+ }, {
4741
+ terminalId: string;
4742
+ seq: number;
4743
+ data: string;
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
+ cols: number;
4761
+ rows: number;
4762
+ cwd: string;
4763
+ createdAt: number;
4764
+ title: string;
4765
+ activeAt: number;
4766
+ exitCode?: number | null | undefined;
4767
+ command?: string | undefined;
4768
+ interrupted?: boolean | undefined;
4769
+ }, {
4770
+ id: string;
4771
+ cols: number;
4772
+ rows: number;
4773
+ cwd: string;
4774
+ createdAt: number;
4775
+ title: string;
4776
+ activeAt: number;
4777
+ exitCode?: number | null | undefined;
4778
+ command?: string | undefined;
4779
+ interrupted?: boolean | undefined;
4780
+ }>;
4781
+ closed: z.ZodOptional<z.ZodBoolean>;
4782
+ }, "strip", z.ZodTypeAny, {
4783
+ terminal: {
4784
+ id: string;
4785
+ cols: number;
4786
+ rows: number;
4787
+ cwd: string;
4788
+ createdAt: number;
4789
+ title: string;
4790
+ activeAt: number;
4791
+ exitCode?: number | null | undefined;
4792
+ command?: string | undefined;
4793
+ interrupted?: boolean | undefined;
4794
+ };
4795
+ closed?: boolean | undefined;
4796
+ }, {
4797
+ terminal: {
4798
+ id: string;
4799
+ cols: number;
4800
+ rows: number;
4801
+ cwd: string;
4802
+ createdAt: number;
4803
+ title: string;
4804
+ activeAt: number;
4805
+ exitCode?: number | null | undefined;
4806
+ command?: string | 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]>;