@linkshell/host 0.1.0

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