linkshell-cli 0.5.42 → 0.6.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 (135) hide show
  1. package/dist/cli/src/commands/host.d.ts +23 -0
  2. package/dist/cli/src/commands/host.js +264 -0
  3. package/dist/cli/src/commands/host.js.map +1 -0
  4. package/dist/cli/src/commands/pair.d.ts +1 -0
  5. package/dist/cli/src/commands/pair.js +48 -0
  6. package/dist/cli/src/commands/pair.js.map +1 -0
  7. package/dist/cli/src/index.js +68 -0
  8. package/dist/cli/src/index.js.map +1 -1
  9. package/dist/cli/src/utils/daemon.d.ts +1 -1
  10. package/dist/cli/src/utils/daemon.js +3 -2
  11. package/dist/cli/src/utils/daemon.js.map +1 -1
  12. package/dist/cli/tsconfig.tsbuildinfo +1 -1
  13. package/dist/host/src/drivers/acp/connection.d.ts +61 -0
  14. package/dist/host/src/drivers/acp/connection.js +121 -0
  15. package/dist/host/src/drivers/acp/connection.js.map +1 -0
  16. package/dist/host/src/drivers/acp/driver.d.ts +110 -0
  17. package/dist/host/src/drivers/acp/driver.js +438 -0
  18. package/dist/host/src/drivers/acp/driver.js.map +1 -0
  19. package/dist/host/src/drivers/acp/mapper.d.ts +49 -0
  20. package/dist/host/src/drivers/acp/mapper.js +411 -0
  21. package/dist/host/src/drivers/acp/mapper.js.map +1 -0
  22. package/dist/host/src/drivers/auth.d.ts +7 -0
  23. package/dist/host/src/drivers/auth.js +57 -0
  24. package/dist/host/src/drivers/auth.js.map +1 -0
  25. package/dist/host/src/drivers/claude/driver.d.ts +76 -0
  26. package/dist/host/src/drivers/claude/driver.js +331 -0
  27. package/dist/host/src/drivers/claude/driver.js.map +1 -0
  28. package/dist/host/src/drivers/claude/transcript.d.ts +335 -0
  29. package/dist/host/src/drivers/claude/transcript.js +516 -0
  30. package/dist/host/src/drivers/claude/transcript.js.map +1 -0
  31. package/dist/host/src/drivers/codex/app-server.d.ts +36 -0
  32. package/dist/host/src/drivers/codex/app-server.js +144 -0
  33. package/dist/host/src/drivers/codex/app-server.js.map +1 -0
  34. package/dist/host/src/drivers/codex/driver.d.ts +89 -0
  35. package/dist/host/src/drivers/codex/driver.js +452 -0
  36. package/dist/host/src/drivers/codex/driver.js.map +1 -0
  37. package/dist/host/src/drivers/codex/mapper.d.ts +61 -0
  38. package/dist/host/src/drivers/codex/mapper.js +623 -0
  39. package/dist/host/src/drivers/codex/mapper.js.map +1 -0
  40. package/dist/host/src/drivers/codex/settings.d.ts +51 -0
  41. package/dist/host/src/drivers/codex/settings.js +107 -0
  42. package/dist/host/src/drivers/codex/settings.js.map +1 -0
  43. package/dist/host/src/drivers/images.d.ts +11 -0
  44. package/dist/host/src/drivers/images.js +34 -0
  45. package/dist/host/src/drivers/images.js.map +1 -0
  46. package/dist/host/src/drivers/nesting.d.ts +6 -0
  47. package/dist/host/src/drivers/nesting.js +25 -0
  48. package/dist/host/src/drivers/nesting.js.map +1 -0
  49. package/dist/host/src/drivers/registry.d.ts +21 -0
  50. package/dist/host/src/drivers/registry.js +30 -0
  51. package/dist/host/src/drivers/registry.js.map +1 -0
  52. package/dist/host/src/drivers/types.d.ts +105 -0
  53. package/dist/host/src/drivers/types.js +2 -0
  54. package/dist/host/src/drivers/types.js.map +1 -0
  55. package/dist/host/src/fs.d.ts +69 -0
  56. package/dist/host/src/fs.js +198 -0
  57. package/dist/host/src/fs.js.map +1 -0
  58. package/dist/host/src/gateway.d.ts +55 -0
  59. package/dist/host/src/gateway.js +263 -0
  60. package/dist/host/src/gateway.js.map +1 -0
  61. package/dist/host/src/host.d.ts +51 -0
  62. package/dist/host/src/host.js +133 -0
  63. package/dist/host/src/host.js.map +1 -0
  64. package/dist/host/src/hub.d.ts +89 -0
  65. package/dist/host/src/hub.js +592 -0
  66. package/dist/host/src/hub.js.map +1 -0
  67. package/dist/host/src/index.d.ts +10 -0
  68. package/dist/host/src/index.js +10 -0
  69. package/dist/host/src/index.js.map +1 -0
  70. package/dist/host/src/ports.d.ts +24 -0
  71. package/dist/host/src/ports.js +201 -0
  72. package/dist/host/src/ports.js.map +1 -0
  73. package/dist/host/src/rpc/client.d.ts +9 -0
  74. package/dist/host/src/rpc/client.js +42 -0
  75. package/dist/host/src/rpc/client.js.map +1 -0
  76. package/dist/host/src/rpc/server.d.ts +52 -0
  77. package/dist/host/src/rpc/server.js +293 -0
  78. package/dist/host/src/rpc/server.js.map +1 -0
  79. package/dist/host/src/screen.d.ts +30 -0
  80. package/dist/host/src/screen.js +230 -0
  81. package/dist/host/src/screen.js.map +1 -0
  82. package/dist/host/src/shell-env.d.ts +8 -0
  83. package/dist/host/src/shell-env.js +39 -0
  84. package/dist/host/src/shell-env.js.map +1 -0
  85. package/dist/host/src/store.d.ts +75 -0
  86. package/dist/host/src/store.js +265 -0
  87. package/dist/host/src/store.js.map +1 -0
  88. package/dist/host/src/terminals.d.ts +55 -0
  89. package/dist/host/src/terminals.js +367 -0
  90. package/dist/host/src/terminals.js.map +1 -0
  91. package/dist/shared-protocol/src/index.d.ts +3345 -3345
  92. package/dist/wire/src/crypto.d.ts +65 -0
  93. package/dist/wire/src/crypto.js +253 -0
  94. package/dist/wire/src/crypto.js.map +1 -0
  95. package/dist/wire/src/index.d.ts +8 -0
  96. package/dist/wire/src/index.js +9 -0
  97. package/dist/wire/src/index.js.map +1 -0
  98. package/dist/wire/src/model.d.ts +704 -0
  99. package/dist/wire/src/model.js +163 -0
  100. package/dist/wire/src/model.js.map +1 -0
  101. package/dist/wire/src/peer.d.ts +42 -0
  102. package/dist/wire/src/peer.js +143 -0
  103. package/dist/wire/src/peer.js.map +1 -0
  104. package/dist/wire/src/relay-client.d.ts +82 -0
  105. package/dist/wire/src/relay-client.js +259 -0
  106. package/dist/wire/src/relay-client.js.map +1 -0
  107. package/dist/wire/src/relay.d.ts +481 -0
  108. package/dist/wire/src/relay.js +129 -0
  109. package/dist/wire/src/relay.js.map +1 -0
  110. package/dist/wire/src/rpc.d.ts +4170 -0
  111. package/dist/wire/src/rpc.js +332 -0
  112. package/dist/wire/src/rpc.js.map +1 -0
  113. package/dist/wire/src/shell.d.ts +2 -0
  114. package/dist/wire/src/shell.js +62 -0
  115. package/dist/wire/src/shell.js.map +1 -0
  116. package/dist/wire/src/updates.d.ts +3325 -0
  117. package/dist/wire/src/updates.js +210 -0
  118. package/dist/wire/src/updates.js.map +1 -0
  119. package/package.json +8 -3
  120. package/src/commands/host.ts +283 -0
  121. package/src/commands/pair.ts +47 -0
  122. package/src/index.ts +73 -0
  123. package/src/utils/daemon.ts +4 -3
  124. package/dist/cli/src/commands/hook.d.ts +0 -6
  125. package/dist/cli/src/commands/hook.js +0 -120
  126. package/dist/cli/src/commands/hook.js.map +0 -1
  127. package/dist/cli/src/runtime/acp/agent-workspace-git.d.ts +0 -63
  128. package/dist/cli/src/runtime/acp/agent-workspace-git.js +0 -297
  129. package/dist/cli/src/runtime/acp/agent-workspace-git.js.map +0 -1
  130. package/dist/cli/src/runtime/acp-relay.d.ts +0 -23
  131. package/dist/cli/src/runtime/acp-relay.js +0 -73
  132. package/dist/cli/src/runtime/acp-relay.js.map +0 -1
  133. package/dist/cli/src/runtime/hook-permission-server.d.ts +0 -36
  134. package/dist/cli/src/runtime/hook-permission-server.js +0 -147
  135. package/dist/cli/src/runtime/hook-permission-server.js.map +0 -1
@@ -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
+ method?: string | undefined;
40
+ params?: unknown;
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
+ method?: string | undefined;
51
+ params?: unknown;
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
+ models: boolean;
120
+ modes: boolean;
121
+ steer: boolean;
122
+ images: boolean;
123
+ fork: boolean;
124
+ permissions: boolean;
125
+ interrupt: boolean;
126
+ }, {
127
+ models: boolean;
128
+ modes: boolean;
129
+ steer: boolean;
130
+ images: boolean;
131
+ fork: boolean;
132
+ permissions: boolean;
133
+ interrupt: boolean;
134
+ }>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ id: string;
137
+ label: string;
138
+ capabilities: {
139
+ models: boolean;
140
+ modes: boolean;
141
+ steer: boolean;
142
+ images: boolean;
143
+ fork: boolean;
144
+ permissions: boolean;
145
+ interrupt: boolean;
146
+ };
147
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
148
+ installed: boolean;
149
+ auth?: {
150
+ state: "unknown" | "ok" | "missing";
151
+ method?: string | undefined;
152
+ hint?: string | undefined;
153
+ } | undefined;
154
+ version?: string | undefined;
155
+ problem?: string | undefined;
156
+ }, {
157
+ id: string;
158
+ label: string;
159
+ capabilities: {
160
+ models: boolean;
161
+ modes: boolean;
162
+ steer: boolean;
163
+ images: boolean;
164
+ fork: boolean;
165
+ permissions: boolean;
166
+ interrupt: boolean;
167
+ };
168
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
169
+ installed: boolean;
170
+ auth?: {
171
+ state: "unknown" | "ok" | "missing";
172
+ method?: string | undefined;
173
+ hint?: string | undefined;
174
+ } | undefined;
175
+ version?: string | undefined;
176
+ problem?: string | undefined;
177
+ }>, "many">;
178
+ }, "strip", z.ZodTypeAny, {
179
+ machineId: string;
180
+ hostname: string;
181
+ platform: string;
182
+ agents: {
183
+ id: string;
184
+ label: string;
185
+ capabilities: {
186
+ models: boolean;
187
+ modes: boolean;
188
+ steer: boolean;
189
+ images: boolean;
190
+ fork: boolean;
191
+ permissions: boolean;
192
+ interrupt: boolean;
193
+ };
194
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
195
+ installed: boolean;
196
+ auth?: {
197
+ state: "unknown" | "ok" | "missing";
198
+ method?: string | undefined;
199
+ hint?: string | undefined;
200
+ } | undefined;
201
+ version?: string | undefined;
202
+ problem?: string | undefined;
203
+ }[];
204
+ hostVersion: string;
205
+ }, {
206
+ machineId: string;
207
+ hostname: string;
208
+ platform: string;
209
+ agents: {
210
+ id: string;
211
+ label: string;
212
+ capabilities: {
213
+ models: boolean;
214
+ modes: boolean;
215
+ steer: boolean;
216
+ images: boolean;
217
+ fork: boolean;
218
+ permissions: boolean;
219
+ interrupt: boolean;
220
+ };
221
+ tier: "multi_client" | "handoff" | "remote" | "terminal";
222
+ installed: boolean;
223
+ auth?: {
224
+ state: "unknown" | "ok" | "missing";
225
+ method?: string | undefined;
226
+ hint?: string | undefined;
227
+ } | undefined;
228
+ version?: string | undefined;
229
+ problem?: string | undefined;
230
+ }[];
231
+ hostVersion: string;
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
+ cwd: string;
250
+ name: string;
251
+ lastActiveAt: number;
252
+ sessionCount: number;
253
+ }, {
254
+ cwd: string;
255
+ name: string;
256
+ lastActiveAt: number;
257
+ sessionCount: number;
258
+ }>, "many">;
259
+ }, "strip", z.ZodTypeAny, {
260
+ projects: {
261
+ cwd: string;
262
+ name: string;
263
+ lastActiveAt: number;
264
+ sessionCount: number;
265
+ }[];
266
+ }, {
267
+ projects: {
268
+ cwd: string;
269
+ name: 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
+ includeArchived?: boolean | undefined;
283
+ limit?: number | undefined;
284
+ before?: number | undefined;
285
+ }, {
286
+ includeArchived?: boolean | undefined;
287
+ limit?: number | undefined;
288
+ before?: number | 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" | "tool" | "responding";
312
+ title?: string | undefined;
313
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
314
+ }, {
315
+ kind: "thinking" | "tool" | "responding";
316
+ title?: string | undefined;
317
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | 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
+ name: string;
330
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
331
+ optionId: string;
332
+ }, {
333
+ name: string;
334
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
335
+ optionId: string;
336
+ }>, "many">;
337
+ }, "strip", z.ZodTypeAny, {
338
+ options: {
339
+ name: string;
340
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
341
+ optionId: string;
342
+ }[];
343
+ requestId: string;
344
+ title: string;
345
+ detail?: string | undefined;
346
+ toolCallId?: string | undefined;
347
+ }, {
348
+ options: {
349
+ name: string;
350
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
351
+ optionId: string;
352
+ }[];
353
+ requestId: string;
354
+ title: string;
355
+ detail?: string | undefined;
356
+ toolCallId?: string | undefined;
357
+ }>>;
358
+ }, "strip", z.ZodTypeAny, {
359
+ id: string;
360
+ cwd: string;
361
+ createdAt: number;
362
+ pendingPermissions: number;
363
+ updatedAt: number;
364
+ archived: boolean;
365
+ state: "idle" | "error" | "running" | "waiting" | "offline";
366
+ agent: string;
367
+ nativeId: string;
368
+ lastSeq: number;
369
+ title?: string | undefined;
370
+ model?: string | undefined;
371
+ permission?: {
372
+ options: {
373
+ name: string;
374
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
375
+ optionId: string;
376
+ }[];
377
+ requestId: string;
378
+ title: string;
379
+ detail?: string | undefined;
380
+ toolCallId?: string | undefined;
381
+ } | undefined;
382
+ preview?: string | undefined;
383
+ driver?: "none" | "desktop" | "remote" | undefined;
384
+ activity?: {
385
+ kind: "thinking" | "tool" | "responding";
386
+ title?: string | undefined;
387
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
388
+ } | undefined;
389
+ }, {
390
+ id: string;
391
+ cwd: string;
392
+ createdAt: number;
393
+ pendingPermissions: number;
394
+ updatedAt: number;
395
+ archived: boolean;
396
+ state: "idle" | "error" | "running" | "waiting" | "offline";
397
+ agent: string;
398
+ nativeId: string;
399
+ lastSeq: number;
400
+ title?: string | undefined;
401
+ model?: string | undefined;
402
+ permission?: {
403
+ options: {
404
+ name: string;
405
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
406
+ optionId: string;
407
+ }[];
408
+ requestId: string;
409
+ title: string;
410
+ detail?: string | undefined;
411
+ toolCallId?: string | undefined;
412
+ } | undefined;
413
+ preview?: string | undefined;
414
+ driver?: "none" | "desktop" | "remote" | undefined;
415
+ activity?: {
416
+ kind: "thinking" | "tool" | "responding";
417
+ title?: string | undefined;
418
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
419
+ } | undefined;
420
+ }>, "many">;
421
+ nextBefore: z.ZodOptional<z.ZodNumber>;
422
+ }, "strip", z.ZodTypeAny, {
423
+ sessions: {
424
+ id: string;
425
+ cwd: string;
426
+ createdAt: number;
427
+ pendingPermissions: number;
428
+ updatedAt: number;
429
+ archived: boolean;
430
+ state: "idle" | "error" | "running" | "waiting" | "offline";
431
+ agent: string;
432
+ nativeId: string;
433
+ lastSeq: number;
434
+ title?: string | undefined;
435
+ model?: string | undefined;
436
+ permission?: {
437
+ options: {
438
+ name: string;
439
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
440
+ optionId: string;
441
+ }[];
442
+ requestId: string;
443
+ title: string;
444
+ detail?: string | undefined;
445
+ toolCallId?: string | undefined;
446
+ } | undefined;
447
+ preview?: string | undefined;
448
+ driver?: "none" | "desktop" | "remote" | undefined;
449
+ activity?: {
450
+ kind: "thinking" | "tool" | "responding";
451
+ title?: string | undefined;
452
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
453
+ } | undefined;
454
+ }[];
455
+ nextBefore?: number | undefined;
456
+ }, {
457
+ sessions: {
458
+ id: string;
459
+ cwd: string;
460
+ createdAt: number;
461
+ pendingPermissions: number;
462
+ updatedAt: number;
463
+ archived: boolean;
464
+ state: "idle" | "error" | "running" | "waiting" | "offline";
465
+ agent: string;
466
+ nativeId: string;
467
+ lastSeq: number;
468
+ title?: string | undefined;
469
+ model?: string | undefined;
470
+ permission?: {
471
+ options: {
472
+ name: string;
473
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
474
+ optionId: string;
475
+ }[];
476
+ requestId: string;
477
+ title: string;
478
+ detail?: string | undefined;
479
+ toolCallId?: string | undefined;
480
+ } | undefined;
481
+ preview?: string | undefined;
482
+ driver?: "none" | "desktop" | "remote" | undefined;
483
+ activity?: {
484
+ kind: "thinking" | "tool" | "responding";
485
+ title?: string | undefined;
486
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | 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?: "file" | "agent" | "skill" | undefined;
530
+ }, {
531
+ type: "resource_link";
532
+ name: string;
533
+ uri: string;
534
+ kind?: "file" | "agent" | "skill" | undefined;
535
+ }>]>, "many">>;
536
+ clientMessageId: z.ZodOptional<z.ZodString>;
537
+ model: z.ZodOptional<z.ZodString>;
538
+ }, "strip", z.ZodTypeAny, {
539
+ cwd: string;
540
+ agent: string;
541
+ prompt?: ({
542
+ type: "text";
543
+ text: string;
544
+ } | {
545
+ type: "image";
546
+ mimeType: string;
547
+ data?: string | undefined;
548
+ uri?: string | undefined;
549
+ } | {
550
+ type: "resource_link";
551
+ name: string;
552
+ uri: string;
553
+ kind?: "file" | "agent" | "skill" | undefined;
554
+ })[] | undefined;
555
+ clientMessageId?: string | undefined;
556
+ model?: string | undefined;
557
+ }, {
558
+ cwd: string;
559
+ agent: string;
560
+ prompt?: ({
561
+ type: "text";
562
+ text: string;
563
+ } | {
564
+ type: "image";
565
+ mimeType: string;
566
+ data?: string | undefined;
567
+ uri?: string | undefined;
568
+ } | {
569
+ type: "resource_link";
570
+ name: string;
571
+ uri: string;
572
+ kind?: "file" | "agent" | "skill" | undefined;
573
+ })[] | undefined;
574
+ clientMessageId?: string | undefined;
575
+ model?: 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" | "tool" | "responding";
599
+ title?: string | undefined;
600
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
601
+ }, {
602
+ kind: "thinking" | "tool" | "responding";
603
+ title?: string | undefined;
604
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | 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
+ name: string;
617
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
618
+ optionId: string;
619
+ }, {
620
+ name: string;
621
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
622
+ optionId: string;
623
+ }>, "many">;
624
+ }, "strip", z.ZodTypeAny, {
625
+ options: {
626
+ name: string;
627
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
628
+ optionId: string;
629
+ }[];
630
+ requestId: string;
631
+ title: string;
632
+ detail?: string | undefined;
633
+ toolCallId?: string | undefined;
634
+ }, {
635
+ options: {
636
+ name: string;
637
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
638
+ optionId: string;
639
+ }[];
640
+ requestId: string;
641
+ title: string;
642
+ detail?: string | undefined;
643
+ toolCallId?: string | undefined;
644
+ }>>;
645
+ }, "strip", z.ZodTypeAny, {
646
+ id: string;
647
+ cwd: string;
648
+ createdAt: number;
649
+ pendingPermissions: number;
650
+ updatedAt: number;
651
+ archived: boolean;
652
+ state: "idle" | "error" | "running" | "waiting" | "offline";
653
+ agent: string;
654
+ nativeId: string;
655
+ lastSeq: number;
656
+ title?: string | undefined;
657
+ model?: string | undefined;
658
+ permission?: {
659
+ options: {
660
+ name: string;
661
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
662
+ optionId: string;
663
+ }[];
664
+ requestId: string;
665
+ title: string;
666
+ detail?: string | undefined;
667
+ toolCallId?: string | undefined;
668
+ } | undefined;
669
+ preview?: string | undefined;
670
+ driver?: "none" | "desktop" | "remote" | undefined;
671
+ activity?: {
672
+ kind: "thinking" | "tool" | "responding";
673
+ title?: string | undefined;
674
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
675
+ } | undefined;
676
+ }, {
677
+ id: string;
678
+ cwd: string;
679
+ createdAt: number;
680
+ pendingPermissions: number;
681
+ updatedAt: number;
682
+ archived: boolean;
683
+ state: "idle" | "error" | "running" | "waiting" | "offline";
684
+ agent: string;
685
+ nativeId: string;
686
+ lastSeq: number;
687
+ title?: string | undefined;
688
+ model?: string | undefined;
689
+ permission?: {
690
+ options: {
691
+ name: string;
692
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
693
+ optionId: string;
694
+ }[];
695
+ requestId: string;
696
+ title: string;
697
+ detail?: string | undefined;
698
+ toolCallId?: string | undefined;
699
+ } | undefined;
700
+ preview?: string | undefined;
701
+ driver?: "none" | "desktop" | "remote" | undefined;
702
+ activity?: {
703
+ kind: "thinking" | "tool" | "responding";
704
+ title?: string | undefined;
705
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
706
+ } | undefined;
707
+ }>;
708
+ }, "strip", z.ZodTypeAny, {
709
+ session: {
710
+ id: string;
711
+ cwd: string;
712
+ createdAt: number;
713
+ pendingPermissions: number;
714
+ updatedAt: number;
715
+ archived: boolean;
716
+ state: "idle" | "error" | "running" | "waiting" | "offline";
717
+ agent: string;
718
+ nativeId: string;
719
+ lastSeq: number;
720
+ title?: string | undefined;
721
+ model?: string | undefined;
722
+ permission?: {
723
+ options: {
724
+ name: string;
725
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
726
+ optionId: string;
727
+ }[];
728
+ requestId: string;
729
+ title: string;
730
+ detail?: string | undefined;
731
+ toolCallId?: string | undefined;
732
+ } | undefined;
733
+ preview?: string | undefined;
734
+ driver?: "none" | "desktop" | "remote" | undefined;
735
+ activity?: {
736
+ kind: "thinking" | "tool" | "responding";
737
+ title?: string | undefined;
738
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
739
+ } | undefined;
740
+ };
741
+ }, {
742
+ session: {
743
+ id: string;
744
+ cwd: string;
745
+ createdAt: number;
746
+ pendingPermissions: number;
747
+ updatedAt: number;
748
+ archived: boolean;
749
+ state: "idle" | "error" | "running" | "waiting" | "offline";
750
+ agent: string;
751
+ nativeId: string;
752
+ lastSeq: number;
753
+ title?: string | undefined;
754
+ model?: string | undefined;
755
+ permission?: {
756
+ options: {
757
+ name: string;
758
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
759
+ optionId: string;
760
+ }[];
761
+ requestId: string;
762
+ title: string;
763
+ detail?: string | undefined;
764
+ toolCallId?: string | undefined;
765
+ } | undefined;
766
+ preview?: string | undefined;
767
+ driver?: "none" | "desktop" | "remote" | undefined;
768
+ activity?: {
769
+ kind: "thinking" | "tool" | "responding";
770
+ title?: string | undefined;
771
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | 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" | "tool" | "responding";
810
+ title?: string | undefined;
811
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
812
+ }, {
813
+ kind: "thinking" | "tool" | "responding";
814
+ title?: string | undefined;
815
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | 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
+ name: string;
828
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
829
+ optionId: string;
830
+ }, {
831
+ name: string;
832
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
833
+ optionId: string;
834
+ }>, "many">;
835
+ }, "strip", z.ZodTypeAny, {
836
+ options: {
837
+ name: string;
838
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
839
+ optionId: string;
840
+ }[];
841
+ requestId: string;
842
+ title: string;
843
+ detail?: string | undefined;
844
+ toolCallId?: string | undefined;
845
+ }, {
846
+ options: {
847
+ name: string;
848
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
849
+ optionId: string;
850
+ }[];
851
+ requestId: string;
852
+ title: string;
853
+ detail?: string | undefined;
854
+ toolCallId?: string | undefined;
855
+ }>>;
856
+ }, "strip", z.ZodTypeAny, {
857
+ id: string;
858
+ cwd: string;
859
+ createdAt: number;
860
+ pendingPermissions: number;
861
+ updatedAt: number;
862
+ archived: boolean;
863
+ state: "idle" | "error" | "running" | "waiting" | "offline";
864
+ agent: string;
865
+ nativeId: string;
866
+ lastSeq: number;
867
+ title?: string | undefined;
868
+ model?: string | undefined;
869
+ permission?: {
870
+ options: {
871
+ name: string;
872
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
873
+ optionId: string;
874
+ }[];
875
+ requestId: string;
876
+ title: string;
877
+ detail?: string | undefined;
878
+ toolCallId?: string | undefined;
879
+ } | undefined;
880
+ preview?: string | undefined;
881
+ driver?: "none" | "desktop" | "remote" | undefined;
882
+ activity?: {
883
+ kind: "thinking" | "tool" | "responding";
884
+ title?: string | undefined;
885
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
886
+ } | undefined;
887
+ }, {
888
+ id: string;
889
+ cwd: string;
890
+ createdAt: number;
891
+ pendingPermissions: number;
892
+ updatedAt: number;
893
+ archived: boolean;
894
+ state: "idle" | "error" | "running" | "waiting" | "offline";
895
+ agent: string;
896
+ nativeId: string;
897
+ lastSeq: number;
898
+ title?: string | undefined;
899
+ model?: string | undefined;
900
+ permission?: {
901
+ options: {
902
+ name: string;
903
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
904
+ optionId: string;
905
+ }[];
906
+ requestId: string;
907
+ title: string;
908
+ detail?: string | undefined;
909
+ toolCallId?: string | undefined;
910
+ } | undefined;
911
+ preview?: string | undefined;
912
+ driver?: "none" | "desktop" | "remote" | undefined;
913
+ activity?: {
914
+ kind: "thinking" | "tool" | "responding";
915
+ title?: string | undefined;
916
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
917
+ } | undefined;
918
+ }>;
919
+ }, "strip", z.ZodTypeAny, {
920
+ session: {
921
+ id: string;
922
+ cwd: string;
923
+ createdAt: number;
924
+ pendingPermissions: number;
925
+ updatedAt: number;
926
+ archived: boolean;
927
+ state: "idle" | "error" | "running" | "waiting" | "offline";
928
+ agent: string;
929
+ nativeId: string;
930
+ lastSeq: number;
931
+ title?: string | undefined;
932
+ model?: string | undefined;
933
+ permission?: {
934
+ options: {
935
+ name: string;
936
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
937
+ optionId: string;
938
+ }[];
939
+ requestId: string;
940
+ title: string;
941
+ detail?: string | undefined;
942
+ toolCallId?: string | undefined;
943
+ } | undefined;
944
+ preview?: string | undefined;
945
+ driver?: "none" | "desktop" | "remote" | undefined;
946
+ activity?: {
947
+ kind: "thinking" | "tool" | "responding";
948
+ title?: string | undefined;
949
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
950
+ } | undefined;
951
+ };
952
+ }, {
953
+ session: {
954
+ id: string;
955
+ cwd: string;
956
+ createdAt: number;
957
+ pendingPermissions: number;
958
+ updatedAt: number;
959
+ archived: boolean;
960
+ state: "idle" | "error" | "running" | "waiting" | "offline";
961
+ agent: string;
962
+ nativeId: string;
963
+ lastSeq: number;
964
+ title?: string | undefined;
965
+ model?: string | undefined;
966
+ permission?: {
967
+ options: {
968
+ name: string;
969
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
970
+ optionId: string;
971
+ }[];
972
+ requestId: string;
973
+ title: string;
974
+ detail?: string | undefined;
975
+ toolCallId?: string | undefined;
976
+ } | undefined;
977
+ preview?: string | undefined;
978
+ driver?: "none" | "desktop" | "remote" | undefined;
979
+ activity?: {
980
+ kind: "thinking" | "tool" | "responding";
981
+ title?: string | undefined;
982
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | 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?: "file" | "agent" | "skill" | undefined;
1036
+ }, {
1037
+ type: "resource_link";
1038
+ name: string;
1039
+ uri: string;
1040
+ kind?: "file" | "agent" | "skill" | undefined;
1041
+ }>]>, "many">;
1042
+ }, "strip", z.ZodTypeAny, {
1043
+ sessionId: string;
1044
+ content: ({
1045
+ type: "text";
1046
+ text: string;
1047
+ } | {
1048
+ type: "image";
1049
+ mimeType: string;
1050
+ data?: string | undefined;
1051
+ uri?: string | undefined;
1052
+ } | {
1053
+ type: "resource_link";
1054
+ name: string;
1055
+ uri: string;
1056
+ kind?: "file" | "agent" | "skill" | undefined;
1057
+ })[];
1058
+ clientMessageId: string;
1059
+ }, {
1060
+ sessionId: string;
1061
+ content: ({
1062
+ type: "text";
1063
+ text: string;
1064
+ } | {
1065
+ type: "image";
1066
+ mimeType: string;
1067
+ data?: string | undefined;
1068
+ uri?: string | undefined;
1069
+ } | {
1070
+ type: "resource_link";
1071
+ name: string;
1072
+ uri: string;
1073
+ kind?: "file" | "agent" | "skill" | undefined;
1074
+ })[];
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: "queued" | "started" | "steered" | "duplicate";
1082
+ }, {
1083
+ delivery: "queued" | "started" | "steered" | "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
+ sessionId: string;
1103
+ requestId: string;
1104
+ optionId: string;
1105
+ }, {
1106
+ sessionId: string;
1107
+ requestId: string;
1108
+ optionId: 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
+ sessionId: string;
1120
+ optionId: string;
1121
+ }, {
1122
+ value: string;
1123
+ sessionId: string;
1124
+ optionId: 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?: "none" | "desktop" | "remote" | undefined;
1140
+ }, {
1141
+ driver?: "none" | "desktop" | "remote" | 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?: "none" | "desktop" | "remote" | undefined;
1156
+ }, {
1157
+ driver?: "none" | "desktop" | "remote" | 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
+ args: string[];
1176
+ agent: string;
1177
+ sessionId?: string | undefined;
1178
+ cwd?: string | undefined;
1179
+ env?: Record<string, string> | undefined;
1180
+ }, {
1181
+ agent: string;
1182
+ sessionId?: string | undefined;
1183
+ cwd?: 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: "connecting" | "off" | "offline" | "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: "connecting" | "off" | "offline" | "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
+ link: string;
1347
+ code: string;
1348
+ expiresAt: number;
1349
+ gateway: string;
1350
+ }, {
1351
+ link: string;
1352
+ code: 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
+ size: number;
1441
+ modifiedAt: number;
1442
+ truncated: boolean;
1443
+ kind: "binary" | "text" | "image";
1444
+ data?: string | undefined;
1445
+ text?: string | undefined;
1446
+ mimeType?: string | undefined;
1447
+ }, {
1448
+ path: string;
1449
+ size: number;
1450
+ modifiedAt: number;
1451
+ truncated: boolean;
1452
+ kind: "binary" | "text" | "image";
1453
+ data?: string | undefined;
1454
+ text?: string | undefined;
1455
+ mimeType?: 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
+ data: string;
1470
+ name: string;
1471
+ dir: string;
1472
+ }, {
1473
+ data: string;
1474
+ name: 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
+ limit: number;
1515
+ query: string;
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
+ cols: number;
1569
+ rows: number;
1570
+ cwd: string;
1571
+ createdAt: number;
1572
+ title: string;
1573
+ activeAt: number;
1574
+ exitCode?: number | null | undefined;
1575
+ command?: string | undefined;
1576
+ interrupted?: boolean | undefined;
1577
+ }, {
1578
+ id: string;
1579
+ cols: number;
1580
+ rows: number;
1581
+ cwd: string;
1582
+ createdAt: number;
1583
+ title: string;
1584
+ activeAt: number;
1585
+ exitCode?: number | null | undefined;
1586
+ command?: string | undefined;
1587
+ interrupted?: boolean | undefined;
1588
+ }>, "many">;
1589
+ }, "strip", z.ZodTypeAny, {
1590
+ terminals: {
1591
+ id: string;
1592
+ cols: number;
1593
+ rows: number;
1594
+ cwd: string;
1595
+ createdAt: number;
1596
+ title: string;
1597
+ activeAt: number;
1598
+ exitCode?: number | null | undefined;
1599
+ command?: string | undefined;
1600
+ interrupted?: boolean | undefined;
1601
+ }[];
1602
+ }, {
1603
+ terminals: {
1604
+ id: string;
1605
+ cols: number;
1606
+ rows: number;
1607
+ cwd: string;
1608
+ createdAt: number;
1609
+ title: string;
1610
+ activeAt: number;
1611
+ exitCode?: number | null | undefined;
1612
+ command?: string | 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
+ cols?: number | undefined;
1631
+ rows?: number | undefined;
1632
+ cwd?: string | 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
+ cols: number;
1650
+ rows: number;
1651
+ cwd: string;
1652
+ createdAt: number;
1653
+ title: string;
1654
+ activeAt: number;
1655
+ exitCode?: number | null | undefined;
1656
+ command?: string | undefined;
1657
+ interrupted?: boolean | undefined;
1658
+ }, {
1659
+ id: string;
1660
+ cols: number;
1661
+ rows: number;
1662
+ cwd: string;
1663
+ createdAt: number;
1664
+ title: string;
1665
+ activeAt: number;
1666
+ exitCode?: number | null | undefined;
1667
+ command?: string | undefined;
1668
+ interrupted?: boolean | undefined;
1669
+ }>;
1670
+ }, "strip", z.ZodTypeAny, {
1671
+ terminal: {
1672
+ id: string;
1673
+ cols: number;
1674
+ rows: number;
1675
+ cwd: string;
1676
+ createdAt: number;
1677
+ title: string;
1678
+ activeAt: number;
1679
+ exitCode?: number | null | undefined;
1680
+ command?: string | undefined;
1681
+ interrupted?: boolean | undefined;
1682
+ };
1683
+ }, {
1684
+ terminal: {
1685
+ id: string;
1686
+ cols: number;
1687
+ rows: number;
1688
+ cwd: string;
1689
+ createdAt: number;
1690
+ title: string;
1691
+ activeAt: number;
1692
+ exitCode?: number | null | undefined;
1693
+ command?: string | 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
+ cols: number;
1729
+ rows: number;
1730
+ cwd: string;
1731
+ createdAt: number;
1732
+ title: string;
1733
+ activeAt: number;
1734
+ exitCode?: number | null | undefined;
1735
+ command?: string | undefined;
1736
+ interrupted?: boolean | undefined;
1737
+ }, {
1738
+ id: string;
1739
+ cols: number;
1740
+ rows: number;
1741
+ cwd: string;
1742
+ createdAt: number;
1743
+ title: string;
1744
+ activeAt: number;
1745
+ exitCode?: number | null | undefined;
1746
+ command?: string | 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
+ seq: number;
1757
+ reset: boolean;
1758
+ terminal: {
1759
+ id: string;
1760
+ cols: number;
1761
+ rows: number;
1762
+ cwd: string;
1763
+ createdAt: number;
1764
+ title: string;
1765
+ activeAt: number;
1766
+ exitCode?: number | null | undefined;
1767
+ command?: string | undefined;
1768
+ interrupted?: boolean | undefined;
1769
+ };
1770
+ replay: string;
1771
+ }, {
1772
+ seq: number;
1773
+ reset: boolean;
1774
+ terminal: {
1775
+ id: string;
1776
+ cols: number;
1777
+ rows: number;
1778
+ cwd: string;
1779
+ createdAt: number;
1780
+ title: string;
1781
+ activeAt: number;
1782
+ exitCode?: number | null | undefined;
1783
+ command?: string | undefined;
1784
+ interrupted?: boolean | undefined;
1785
+ };
1786
+ replay: string;
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
+ terminalId: string;
1805
+ data: string;
1806
+ }, {
1807
+ terminalId: string;
1808
+ data: 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
+ terminalId: string;
1819
+ cols: number;
1820
+ rows: number;
1821
+ }, {
1822
+ terminalId: string;
1823
+ cols: number;
1824
+ rows: number;
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
+ cwd?: string | undefined;
1854
+ title?: string | undefined;
1855
+ pid?: number | undefined;
1856
+ }, {
1857
+ port: number;
1858
+ process: string;
1859
+ http: boolean;
1860
+ cwd?: string | undefined;
1861
+ title?: string | undefined;
1862
+ pid?: number | undefined;
1863
+ }>, "many">;
1864
+ }, "strip", z.ZodTypeAny, {
1865
+ ports: {
1866
+ port: number;
1867
+ process: string;
1868
+ http: boolean;
1869
+ cwd?: string | undefined;
1870
+ title?: string | undefined;
1871
+ pid?: number | undefined;
1872
+ }[];
1873
+ }, {
1874
+ ports: {
1875
+ port: number;
1876
+ process: string;
1877
+ http: boolean;
1878
+ cwd?: string | undefined;
1879
+ title?: 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?: "file" | "agent" | "skill" | undefined;
2012
+ }, {
2013
+ type: "resource_link";
2014
+ name: string;
2015
+ uri: string;
2016
+ kind?: "file" | "agent" | "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?: "file" | "agent" | "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?: "file" | "agent" | "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?: "file" | "agent" | "skill" | undefined;
2090
+ }, {
2091
+ type: "resource_link";
2092
+ name: string;
2093
+ uri: string;
2094
+ kind?: "file" | "agent" | "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?: "file" | "agent" | "skill" | undefined;
2110
+ };
2111
+ messageId: string;
2112
+ sessionUpdate: "agent_message_chunk";
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?: "file" | "agent" | "skill" | undefined;
2128
+ };
2129
+ messageId: string;
2130
+ sessionUpdate: "agent_message_chunk";
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?: "file" | "agent" | "skill" | undefined;
2170
+ }, {
2171
+ type: "resource_link";
2172
+ name: string;
2173
+ uri: string;
2174
+ kind?: "file" | "agent" | "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?: "file" | "agent" | "skill" | undefined;
2190
+ };
2191
+ messageId: string;
2192
+ sessionUpdate: "agent_thought_chunk";
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?: "file" | "agent" | "skill" | undefined;
2208
+ };
2209
+ messageId: string;
2210
+ sessionUpdate: "agent_thought_chunk";
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?: "file" | "agent" | "skill" | undefined;
2256
+ }, {
2257
+ type: "resource_link";
2258
+ name: string;
2259
+ uri: string;
2260
+ kind?: "file" | "agent" | "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?: "file" | "agent" | "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?: "file" | "agent" | "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: "add" | "update" | "delete";
2320
+ movePath?: string | undefined;
2321
+ }, {
2322
+ path: string;
2323
+ type: "patch";
2324
+ diff: string;
2325
+ change: "add" | "update" | "delete";
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" | "resume" | "stop" | "wait" | "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" | "resume" | "stop" | "wait" | "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: "finished" | "started";
2419
+ }, {
2420
+ type: "review";
2421
+ phase: "finished" | "started";
2422
+ }>]>>;
2423
+ }, "strip", z.ZodTypeAny, {
2424
+ status: "pending" | "completed" | "failed" | "in_progress";
2425
+ kind: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch";
2426
+ title: string;
2427
+ toolCallId: string;
2428
+ sessionUpdate: "tool_call";
2429
+ content?: ({
2430
+ type: "content";
2431
+ content: {
2432
+ type: "text";
2433
+ text: string;
2434
+ } | {
2435
+ type: "image";
2436
+ mimeType: string;
2437
+ data?: string | undefined;
2438
+ uri?: string | undefined;
2439
+ } | {
2440
+ type: "resource_link";
2441
+ name: string;
2442
+ uri: string;
2443
+ kind?: "file" | "agent" | "skill" | undefined;
2444
+ };
2445
+ } | {
2446
+ path: string;
2447
+ type: "diff";
2448
+ newText: string;
2449
+ oldText?: string | null | undefined;
2450
+ } | {
2451
+ path: string;
2452
+ type: "patch";
2453
+ diff: string;
2454
+ change: "add" | "update" | "delete";
2455
+ movePath?: string | undefined;
2456
+ } | {
2457
+ type: "terminal";
2458
+ terminalId: string;
2459
+ })[] | undefined;
2460
+ detail?: {
2461
+ type: "mcp";
2462
+ tool: string;
2463
+ server: string;
2464
+ } | {
2465
+ type: "subagent";
2466
+ action: "message" | "spawn" | "resume" | "stop" | "wait" | "list";
2467
+ model?: string | undefined;
2468
+ task?: string | undefined;
2469
+ agentType?: string | undefined;
2470
+ } | {
2471
+ type: "skill";
2472
+ name: string;
2473
+ description?: string | undefined;
2474
+ } | {
2475
+ type: "web_search";
2476
+ query?: string | undefined;
2477
+ } | {
2478
+ type: "image_generation";
2479
+ prompt?: string | undefined;
2480
+ } | {
2481
+ type: "compaction";
2482
+ } | {
2483
+ type: "review";
2484
+ phase: "finished" | "started";
2485
+ } | undefined;
2486
+ rawInput?: unknown;
2487
+ parentToolCallId?: string | undefined;
2488
+ locations?: {
2489
+ path: string;
2490
+ line?: number | undefined;
2491
+ }[] | undefined;
2492
+ }, {
2493
+ status: "pending" | "completed" | "failed" | "in_progress";
2494
+ kind: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch";
2495
+ title: string;
2496
+ toolCallId: string;
2497
+ sessionUpdate: "tool_call";
2498
+ content?: ({
2499
+ type: "content";
2500
+ content: {
2501
+ type: "text";
2502
+ text: string;
2503
+ } | {
2504
+ type: "image";
2505
+ mimeType: string;
2506
+ data?: string | undefined;
2507
+ uri?: string | undefined;
2508
+ } | {
2509
+ type: "resource_link";
2510
+ name: string;
2511
+ uri: string;
2512
+ kind?: "file" | "agent" | "skill" | undefined;
2513
+ };
2514
+ } | {
2515
+ path: string;
2516
+ type: "diff";
2517
+ newText: string;
2518
+ oldText?: string | null | undefined;
2519
+ } | {
2520
+ path: string;
2521
+ type: "patch";
2522
+ diff: string;
2523
+ change: "add" | "update" | "delete";
2524
+ movePath?: string | undefined;
2525
+ } | {
2526
+ type: "terminal";
2527
+ terminalId: string;
2528
+ })[] | undefined;
2529
+ detail?: {
2530
+ type: "mcp";
2531
+ tool: string;
2532
+ server: string;
2533
+ } | {
2534
+ type: "subagent";
2535
+ model?: string | undefined;
2536
+ action?: "message" | "spawn" | "resume" | "stop" | "wait" | "list" | undefined;
2537
+ task?: string | undefined;
2538
+ agentType?: string | undefined;
2539
+ } | {
2540
+ type: "skill";
2541
+ name: string;
2542
+ description?: string | undefined;
2543
+ } | {
2544
+ type: "web_search";
2545
+ query?: string | undefined;
2546
+ } | {
2547
+ type: "image_generation";
2548
+ prompt?: string | undefined;
2549
+ } | {
2550
+ type: "compaction";
2551
+ } | {
2552
+ type: "review";
2553
+ phase: "finished" | "started";
2554
+ } | undefined;
2555
+ rawInput?: unknown;
2556
+ parentToolCallId?: string | undefined;
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" | "resume" | "stop" | "wait" | "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" | "resume" | "stop" | "wait" | "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: "finished" | "started";
2639
+ }, {
2640
+ type: "review";
2641
+ phase: "finished" | "started";
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?: "file" | "agent" | "skill" | undefined;
2679
+ }, {
2680
+ type: "resource_link";
2681
+ name: string;
2682
+ uri: string;
2683
+ kind?: "file" | "agent" | "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?: "file" | "agent" | "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?: "file" | "agent" | "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: "add" | "update" | "delete";
2743
+ movePath?: string | undefined;
2744
+ }, {
2745
+ path: string;
2746
+ type: "patch";
2747
+ diff: string;
2748
+ change: "add" | "update" | "delete";
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" | "completed" | "failed" | "in_progress" | undefined;
2766
+ content?: ({
2767
+ type: "content";
2768
+ content: {
2769
+ type: "text";
2770
+ text: string;
2771
+ } | {
2772
+ type: "image";
2773
+ mimeType: string;
2774
+ data?: string | undefined;
2775
+ uri?: string | undefined;
2776
+ } | {
2777
+ type: "resource_link";
2778
+ name: string;
2779
+ uri: string;
2780
+ kind?: "file" | "agent" | "skill" | undefined;
2781
+ };
2782
+ } | {
2783
+ path: string;
2784
+ type: "diff";
2785
+ newText: string;
2786
+ oldText?: string | null | undefined;
2787
+ } | {
2788
+ path: string;
2789
+ type: "patch";
2790
+ diff: string;
2791
+ change: "add" | "update" | "delete";
2792
+ movePath?: string | undefined;
2793
+ } | {
2794
+ type: "terminal";
2795
+ terminalId: string;
2796
+ })[] | undefined;
2797
+ title?: string | undefined;
2798
+ detail?: {
2799
+ type: "mcp";
2800
+ tool: string;
2801
+ server: string;
2802
+ } | {
2803
+ type: "subagent";
2804
+ action: "message" | "spawn" | "resume" | "stop" | "wait" | "list";
2805
+ model?: string | undefined;
2806
+ task?: string | undefined;
2807
+ agentType?: string | undefined;
2808
+ } | {
2809
+ type: "skill";
2810
+ name: string;
2811
+ description?: string | undefined;
2812
+ } | {
2813
+ type: "web_search";
2814
+ query?: string | undefined;
2815
+ } | {
2816
+ type: "image_generation";
2817
+ prompt?: string | undefined;
2818
+ } | {
2819
+ type: "compaction";
2820
+ } | {
2821
+ type: "review";
2822
+ phase: "finished" | "started";
2823
+ } | undefined;
2824
+ rawOutput?: unknown;
2825
+ parentToolCallId?: string | undefined;
2826
+ appendOutput?: string | undefined;
2827
+ }, {
2828
+ toolCallId: string;
2829
+ sessionUpdate: "tool_call_update";
2830
+ status?: "pending" | "completed" | "failed" | "in_progress" | undefined;
2831
+ content?: ({
2832
+ type: "content";
2833
+ content: {
2834
+ type: "text";
2835
+ text: string;
2836
+ } | {
2837
+ type: "image";
2838
+ mimeType: string;
2839
+ data?: string | undefined;
2840
+ uri?: string | undefined;
2841
+ } | {
2842
+ type: "resource_link";
2843
+ name: string;
2844
+ uri: string;
2845
+ kind?: "file" | "agent" | "skill" | undefined;
2846
+ };
2847
+ } | {
2848
+ path: string;
2849
+ type: "diff";
2850
+ newText: string;
2851
+ oldText?: string | null | undefined;
2852
+ } | {
2853
+ path: string;
2854
+ type: "patch";
2855
+ diff: string;
2856
+ change: "add" | "update" | "delete";
2857
+ movePath?: string | undefined;
2858
+ } | {
2859
+ type: "terminal";
2860
+ terminalId: string;
2861
+ })[] | undefined;
2862
+ title?: string | undefined;
2863
+ detail?: {
2864
+ type: "mcp";
2865
+ tool: string;
2866
+ server: string;
2867
+ } | {
2868
+ type: "subagent";
2869
+ model?: string | undefined;
2870
+ action?: "message" | "spawn" | "resume" | "stop" | "wait" | "list" | undefined;
2871
+ task?: string | undefined;
2872
+ agentType?: string | undefined;
2873
+ } | {
2874
+ type: "skill";
2875
+ name: string;
2876
+ description?: string | undefined;
2877
+ } | {
2878
+ type: "web_search";
2879
+ query?: string | undefined;
2880
+ } | {
2881
+ type: "image_generation";
2882
+ prompt?: string | undefined;
2883
+ } | {
2884
+ type: "compaction";
2885
+ } | {
2886
+ type: "review";
2887
+ phase: "finished" | "started";
2888
+ } | undefined;
2889
+ rawOutput?: unknown;
2890
+ parentToolCallId?: string | undefined;
2891
+ appendOutput?: string | undefined;
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" | "completed" | "in_progress";
2900
+ content: string;
2901
+ priority: "low" | "medium" | "high";
2902
+ }, {
2903
+ status: "pending" | "completed" | "in_progress";
2904
+ content: string;
2905
+ priority?: "low" | "medium" | "high" | undefined;
2906
+ }>, "many">;
2907
+ }, "strip", z.ZodTypeAny, {
2908
+ entries: {
2909
+ status: "pending" | "completed" | "in_progress";
2910
+ content: string;
2911
+ priority: "low" | "medium" | "high";
2912
+ }[];
2913
+ sessionUpdate: "plan";
2914
+ }, {
2915
+ entries: {
2916
+ status: "pending" | "completed" | "in_progress";
2917
+ content: string;
2918
+ priority?: "low" | "medium" | "high" | 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
+ contextWindow?: number | undefined;
2978
+ usedTokens?: number | undefined;
2979
+ }, {
2980
+ sessionUpdate: "usage_update";
2981
+ contextWindow?: number | undefined;
2982
+ usedTokens?: 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
+ role: "user" | "agent" | "thought";
2990
+ messageId: string;
2991
+ sessionUpdate: "ls_message_done";
2992
+ parentToolCallId?: string | undefined;
2993
+ }, {
2994
+ role: "user" | "agent" | "thought";
2995
+ messageId: string;
2996
+ sessionUpdate: "ls_message_done";
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: "mode" | "other" | "model" | "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?: "mode" | "other" | "model" | "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: "mode" | "other" | "model" | "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?: "mode" | "other" | "model" | "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
+ turnId?: string | undefined;
3090
+ parentToolCallId?: string | undefined;
3091
+ stopReason?: "error" | "cancelled" | "end_turn" | "max_tokens" | "refusal" | undefined;
3092
+ }, {
3093
+ state: "started" | "ended";
3094
+ sessionUpdate: "ls_turn";
3095
+ turnId?: string | undefined;
3096
+ parentToolCallId?: string | undefined;
3097
+ stopReason?: "error" | "cancelled" | "end_turn" | "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
+ name: string;
3110
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3111
+ optionId: string;
3112
+ }, {
3113
+ name: string;
3114
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3115
+ optionId: string;
3116
+ }>, "many">;
3117
+ }, "strip", z.ZodTypeAny, {
3118
+ options: {
3119
+ name: string;
3120
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3121
+ optionId: string;
3122
+ }[];
3123
+ requestId: string;
3124
+ title: string;
3125
+ sessionUpdate: "ls_permission";
3126
+ detail?: string | undefined;
3127
+ toolCallId?: string | undefined;
3128
+ }, {
3129
+ options: {
3130
+ name: string;
3131
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3132
+ optionId: string;
3133
+ }[];
3134
+ requestId: string;
3135
+ title: string;
3136
+ sessionUpdate: "ls_permission";
3137
+ detail?: string | undefined;
3138
+ toolCallId?: 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
+ sessionUpdate: "ls_driver";
3157
+ driver: "none" | "desktop" | "remote";
3158
+ deviceId?: string | undefined;
3159
+ }, {
3160
+ sessionUpdate: "ls_driver";
3161
+ driver: "none" | "desktop" | "remote";
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" | "error" | "running" | "waiting" | "offline";
3168
+ sessionUpdate: "ls_status";
3169
+ }, {
3170
+ state: "idle" | "error" | "running" | "waiting" | "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
+ sessionId: string;
3190
+ seq: number;
3191
+ ts: number;
3192
+ update: {
3193
+ content: {
3194
+ type: "text";
3195
+ text: string;
3196
+ } | {
3197
+ type: "image";
3198
+ mimeType: string;
3199
+ data?: string | undefined;
3200
+ uri?: string | undefined;
3201
+ } | {
3202
+ type: "resource_link";
3203
+ name: string;
3204
+ uri: string;
3205
+ kind?: "file" | "agent" | "skill" | undefined;
3206
+ };
3207
+ sessionUpdate: "user_message_chunk";
3208
+ messageId?: string | undefined;
3209
+ } | {
3210
+ content: {
3211
+ type: "text";
3212
+ text: string;
3213
+ } | {
3214
+ type: "image";
3215
+ mimeType: string;
3216
+ data?: string | undefined;
3217
+ uri?: string | undefined;
3218
+ } | {
3219
+ type: "resource_link";
3220
+ name: string;
3221
+ uri: string;
3222
+ kind?: "file" | "agent" | "skill" | undefined;
3223
+ };
3224
+ messageId: string;
3225
+ sessionUpdate: "agent_message_chunk";
3226
+ parentToolCallId?: string | undefined;
3227
+ } | {
3228
+ content: {
3229
+ type: "text";
3230
+ text: string;
3231
+ } | {
3232
+ type: "image";
3233
+ mimeType: string;
3234
+ data?: string | undefined;
3235
+ uri?: string | undefined;
3236
+ } | {
3237
+ type: "resource_link";
3238
+ name: string;
3239
+ uri: string;
3240
+ kind?: "file" | "agent" | "skill" | undefined;
3241
+ };
3242
+ messageId: string;
3243
+ sessionUpdate: "agent_thought_chunk";
3244
+ parentToolCallId?: string | undefined;
3245
+ } | {
3246
+ status: "pending" | "completed" | "failed" | "in_progress";
3247
+ kind: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch";
3248
+ title: string;
3249
+ toolCallId: string;
3250
+ sessionUpdate: "tool_call";
3251
+ content?: ({
3252
+ type: "content";
3253
+ content: {
3254
+ type: "text";
3255
+ text: string;
3256
+ } | {
3257
+ type: "image";
3258
+ mimeType: string;
3259
+ data?: string | undefined;
3260
+ uri?: string | undefined;
3261
+ } | {
3262
+ type: "resource_link";
3263
+ name: string;
3264
+ uri: string;
3265
+ kind?: "file" | "agent" | "skill" | undefined;
3266
+ };
3267
+ } | {
3268
+ path: string;
3269
+ type: "diff";
3270
+ newText: string;
3271
+ oldText?: string | null | undefined;
3272
+ } | {
3273
+ path: string;
3274
+ type: "patch";
3275
+ diff: string;
3276
+ change: "add" | "update" | "delete";
3277
+ movePath?: string | undefined;
3278
+ } | {
3279
+ type: "terminal";
3280
+ terminalId: string;
3281
+ })[] | undefined;
3282
+ detail?: {
3283
+ type: "mcp";
3284
+ tool: string;
3285
+ server: string;
3286
+ } | {
3287
+ type: "subagent";
3288
+ action: "message" | "spawn" | "resume" | "stop" | "wait" | "list";
3289
+ model?: string | undefined;
3290
+ task?: string | undefined;
3291
+ agentType?: string | undefined;
3292
+ } | {
3293
+ type: "skill";
3294
+ name: string;
3295
+ description?: string | undefined;
3296
+ } | {
3297
+ type: "web_search";
3298
+ query?: string | undefined;
3299
+ } | {
3300
+ type: "image_generation";
3301
+ prompt?: string | undefined;
3302
+ } | {
3303
+ type: "compaction";
3304
+ } | {
3305
+ type: "review";
3306
+ phase: "finished" | "started";
3307
+ } | undefined;
3308
+ rawInput?: unknown;
3309
+ parentToolCallId?: string | undefined;
3310
+ locations?: {
3311
+ path: string;
3312
+ line?: number | undefined;
3313
+ }[] | undefined;
3314
+ } | {
3315
+ toolCallId: string;
3316
+ sessionUpdate: "tool_call_update";
3317
+ status?: "pending" | "completed" | "failed" | "in_progress" | undefined;
3318
+ content?: ({
3319
+ type: "content";
3320
+ content: {
3321
+ type: "text";
3322
+ text: string;
3323
+ } | {
3324
+ type: "image";
3325
+ mimeType: string;
3326
+ data?: string | undefined;
3327
+ uri?: string | undefined;
3328
+ } | {
3329
+ type: "resource_link";
3330
+ name: string;
3331
+ uri: string;
3332
+ kind?: "file" | "agent" | "skill" | undefined;
3333
+ };
3334
+ } | {
3335
+ path: string;
3336
+ type: "diff";
3337
+ newText: string;
3338
+ oldText?: string | null | undefined;
3339
+ } | {
3340
+ path: string;
3341
+ type: "patch";
3342
+ diff: string;
3343
+ change: "add" | "update" | "delete";
3344
+ movePath?: string | undefined;
3345
+ } | {
3346
+ type: "terminal";
3347
+ terminalId: string;
3348
+ })[] | undefined;
3349
+ title?: string | undefined;
3350
+ detail?: {
3351
+ type: "mcp";
3352
+ tool: string;
3353
+ server: string;
3354
+ } | {
3355
+ type: "subagent";
3356
+ action: "message" | "spawn" | "resume" | "stop" | "wait" | "list";
3357
+ model?: string | undefined;
3358
+ task?: string | undefined;
3359
+ agentType?: string | undefined;
3360
+ } | {
3361
+ type: "skill";
3362
+ name: string;
3363
+ description?: string | undefined;
3364
+ } | {
3365
+ type: "web_search";
3366
+ query?: string | undefined;
3367
+ } | {
3368
+ type: "image_generation";
3369
+ prompt?: string | undefined;
3370
+ } | {
3371
+ type: "compaction";
3372
+ } | {
3373
+ type: "review";
3374
+ phase: "finished" | "started";
3375
+ } | undefined;
3376
+ rawOutput?: unknown;
3377
+ parentToolCallId?: string | undefined;
3378
+ appendOutput?: string | undefined;
3379
+ } | {
3380
+ entries: {
3381
+ status: "pending" | "completed" | "in_progress";
3382
+ content: string;
3383
+ priority: "low" | "medium" | "high";
3384
+ }[];
3385
+ sessionUpdate: "plan";
3386
+ } | {
3387
+ sessionUpdate: "available_commands_update";
3388
+ availableCommands: {
3389
+ name: string;
3390
+ description: string;
3391
+ hint?: string | undefined;
3392
+ }[];
3393
+ } | {
3394
+ sessionUpdate: "current_mode_update";
3395
+ currentModeId: string;
3396
+ } | {
3397
+ sessionUpdate: "session_info_update";
3398
+ title?: string | undefined;
3399
+ model?: string | undefined;
3400
+ } | {
3401
+ sessionUpdate: "usage_update";
3402
+ contextWindow?: number | undefined;
3403
+ usedTokens?: number | undefined;
3404
+ } | {
3405
+ role: "user" | "agent" | "thought";
3406
+ messageId: string;
3407
+ sessionUpdate: "ls_message_done";
3408
+ parentToolCallId?: string | undefined;
3409
+ } | {
3410
+ options: {
3411
+ values: {
3412
+ value: string;
3413
+ name: string;
3414
+ description?: string | undefined;
3415
+ }[];
3416
+ id: string;
3417
+ name: string;
3418
+ category: "mode" | "other" | "model" | "effort";
3419
+ current: string;
3420
+ }[];
3421
+ sessionUpdate: "ls_config";
3422
+ } | {
3423
+ title: string;
3424
+ sessionUpdate: "ls_notice";
3425
+ level: "info" | "warning";
3426
+ detail?: string | undefined;
3427
+ } | {
3428
+ state: "started" | "ended";
3429
+ sessionUpdate: "ls_turn";
3430
+ turnId?: string | undefined;
3431
+ parentToolCallId?: string | undefined;
3432
+ stopReason?: "error" | "cancelled" | "end_turn" | "max_tokens" | "refusal" | undefined;
3433
+ } | {
3434
+ options: {
3435
+ name: string;
3436
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3437
+ optionId: string;
3438
+ }[];
3439
+ requestId: string;
3440
+ title: string;
3441
+ sessionUpdate: "ls_permission";
3442
+ detail?: string | undefined;
3443
+ toolCallId?: string | undefined;
3444
+ } | {
3445
+ requestId: string;
3446
+ sessionUpdate: "ls_permission_resolved";
3447
+ optionId?: string | undefined;
3448
+ } | {
3449
+ sessionUpdate: "ls_driver";
3450
+ driver: "none" | "desktop" | "remote";
3451
+ deviceId?: string | undefined;
3452
+ } | {
3453
+ state: "idle" | "error" | "running" | "waiting" | "offline";
3454
+ sessionUpdate: "ls_status";
3455
+ } | {
3456
+ code: string;
3457
+ message: string;
3458
+ sessionUpdate: "ls_error";
3459
+ hint?: string | undefined;
3460
+ };
3461
+ }, {
3462
+ sessionId: string;
3463
+ seq: number;
3464
+ ts: number;
3465
+ update: {
3466
+ content: {
3467
+ type: "text";
3468
+ text: string;
3469
+ } | {
3470
+ type: "image";
3471
+ mimeType: string;
3472
+ data?: string | undefined;
3473
+ uri?: string | undefined;
3474
+ } | {
3475
+ type: "resource_link";
3476
+ name: string;
3477
+ uri: string;
3478
+ kind?: "file" | "agent" | "skill" | undefined;
3479
+ };
3480
+ sessionUpdate: "user_message_chunk";
3481
+ messageId?: string | undefined;
3482
+ } | {
3483
+ content: {
3484
+ type: "text";
3485
+ text: string;
3486
+ } | {
3487
+ type: "image";
3488
+ mimeType: string;
3489
+ data?: string | undefined;
3490
+ uri?: string | undefined;
3491
+ } | {
3492
+ type: "resource_link";
3493
+ name: string;
3494
+ uri: string;
3495
+ kind?: "file" | "agent" | "skill" | undefined;
3496
+ };
3497
+ messageId: string;
3498
+ sessionUpdate: "agent_message_chunk";
3499
+ parentToolCallId?: string | undefined;
3500
+ } | {
3501
+ content: {
3502
+ type: "text";
3503
+ text: string;
3504
+ } | {
3505
+ type: "image";
3506
+ mimeType: string;
3507
+ data?: string | undefined;
3508
+ uri?: string | undefined;
3509
+ } | {
3510
+ type: "resource_link";
3511
+ name: string;
3512
+ uri: string;
3513
+ kind?: "file" | "agent" | "skill" | undefined;
3514
+ };
3515
+ messageId: string;
3516
+ sessionUpdate: "agent_thought_chunk";
3517
+ parentToolCallId?: string | undefined;
3518
+ } | {
3519
+ status: "pending" | "completed" | "failed" | "in_progress";
3520
+ kind: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch";
3521
+ title: string;
3522
+ toolCallId: string;
3523
+ sessionUpdate: "tool_call";
3524
+ content?: ({
3525
+ type: "content";
3526
+ content: {
3527
+ type: "text";
3528
+ text: string;
3529
+ } | {
3530
+ type: "image";
3531
+ mimeType: string;
3532
+ data?: string | undefined;
3533
+ uri?: string | undefined;
3534
+ } | {
3535
+ type: "resource_link";
3536
+ name: string;
3537
+ uri: string;
3538
+ kind?: "file" | "agent" | "skill" | undefined;
3539
+ };
3540
+ } | {
3541
+ path: string;
3542
+ type: "diff";
3543
+ newText: string;
3544
+ oldText?: string | null | undefined;
3545
+ } | {
3546
+ path: string;
3547
+ type: "patch";
3548
+ diff: string;
3549
+ change: "add" | "update" | "delete";
3550
+ movePath?: string | undefined;
3551
+ } | {
3552
+ type: "terminal";
3553
+ terminalId: string;
3554
+ })[] | undefined;
3555
+ detail?: {
3556
+ type: "mcp";
3557
+ tool: string;
3558
+ server: string;
3559
+ } | {
3560
+ type: "subagent";
3561
+ model?: string | undefined;
3562
+ action?: "message" | "spawn" | "resume" | "stop" | "wait" | "list" | undefined;
3563
+ task?: string | undefined;
3564
+ agentType?: string | undefined;
3565
+ } | {
3566
+ type: "skill";
3567
+ name: string;
3568
+ description?: string | undefined;
3569
+ } | {
3570
+ type: "web_search";
3571
+ query?: string | undefined;
3572
+ } | {
3573
+ type: "image_generation";
3574
+ prompt?: string | undefined;
3575
+ } | {
3576
+ type: "compaction";
3577
+ } | {
3578
+ type: "review";
3579
+ phase: "finished" | "started";
3580
+ } | undefined;
3581
+ rawInput?: unknown;
3582
+ parentToolCallId?: string | undefined;
3583
+ locations?: {
3584
+ path: string;
3585
+ line?: number | undefined;
3586
+ }[] | undefined;
3587
+ } | {
3588
+ toolCallId: string;
3589
+ sessionUpdate: "tool_call_update";
3590
+ status?: "pending" | "completed" | "failed" | "in_progress" | undefined;
3591
+ content?: ({
3592
+ type: "content";
3593
+ content: {
3594
+ type: "text";
3595
+ text: string;
3596
+ } | {
3597
+ type: "image";
3598
+ mimeType: string;
3599
+ data?: string | undefined;
3600
+ uri?: string | undefined;
3601
+ } | {
3602
+ type: "resource_link";
3603
+ name: string;
3604
+ uri: string;
3605
+ kind?: "file" | "agent" | "skill" | undefined;
3606
+ };
3607
+ } | {
3608
+ path: string;
3609
+ type: "diff";
3610
+ newText: string;
3611
+ oldText?: string | null | undefined;
3612
+ } | {
3613
+ path: string;
3614
+ type: "patch";
3615
+ diff: string;
3616
+ change: "add" | "update" | "delete";
3617
+ movePath?: string | undefined;
3618
+ } | {
3619
+ type: "terminal";
3620
+ terminalId: string;
3621
+ })[] | undefined;
3622
+ title?: string | undefined;
3623
+ detail?: {
3624
+ type: "mcp";
3625
+ tool: string;
3626
+ server: string;
3627
+ } | {
3628
+ type: "subagent";
3629
+ model?: string | undefined;
3630
+ action?: "message" | "spawn" | "resume" | "stop" | "wait" | "list" | undefined;
3631
+ task?: string | undefined;
3632
+ agentType?: string | undefined;
3633
+ } | {
3634
+ type: "skill";
3635
+ name: string;
3636
+ description?: string | undefined;
3637
+ } | {
3638
+ type: "web_search";
3639
+ query?: string | undefined;
3640
+ } | {
3641
+ type: "image_generation";
3642
+ prompt?: string | undefined;
3643
+ } | {
3644
+ type: "compaction";
3645
+ } | {
3646
+ type: "review";
3647
+ phase: "finished" | "started";
3648
+ } | undefined;
3649
+ rawOutput?: unknown;
3650
+ parentToolCallId?: string | undefined;
3651
+ appendOutput?: string | undefined;
3652
+ } | {
3653
+ entries: {
3654
+ status: "pending" | "completed" | "in_progress";
3655
+ content: string;
3656
+ priority?: "low" | "medium" | "high" | undefined;
3657
+ }[];
3658
+ sessionUpdate: "plan";
3659
+ } | {
3660
+ sessionUpdate: "available_commands_update";
3661
+ availableCommands: {
3662
+ name: string;
3663
+ description: string;
3664
+ hint?: string | undefined;
3665
+ }[];
3666
+ } | {
3667
+ sessionUpdate: "current_mode_update";
3668
+ currentModeId: string;
3669
+ } | {
3670
+ sessionUpdate: "session_info_update";
3671
+ title?: string | undefined;
3672
+ model?: string | undefined;
3673
+ } | {
3674
+ sessionUpdate: "usage_update";
3675
+ contextWindow?: number | undefined;
3676
+ usedTokens?: number | undefined;
3677
+ } | {
3678
+ role: "user" | "agent" | "thought";
3679
+ messageId: string;
3680
+ sessionUpdate: "ls_message_done";
3681
+ parentToolCallId?: string | undefined;
3682
+ } | {
3683
+ options: {
3684
+ values: {
3685
+ value: string;
3686
+ name: string;
3687
+ description?: string | undefined;
3688
+ }[];
3689
+ id: string;
3690
+ name: string;
3691
+ current: string;
3692
+ category?: "mode" | "other" | "model" | "effort" | undefined;
3693
+ }[];
3694
+ sessionUpdate: "ls_config";
3695
+ } | {
3696
+ title: string;
3697
+ sessionUpdate: "ls_notice";
3698
+ level: "info" | "warning";
3699
+ detail?: string | undefined;
3700
+ } | {
3701
+ state: "started" | "ended";
3702
+ sessionUpdate: "ls_turn";
3703
+ turnId?: string | undefined;
3704
+ parentToolCallId?: string | undefined;
3705
+ stopReason?: "error" | "cancelled" | "end_turn" | "max_tokens" | "refusal" | undefined;
3706
+ } | {
3707
+ options: {
3708
+ name: string;
3709
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3710
+ optionId: string;
3711
+ }[];
3712
+ requestId: string;
3713
+ title: string;
3714
+ sessionUpdate: "ls_permission";
3715
+ detail?: string | undefined;
3716
+ toolCallId?: string | undefined;
3717
+ } | {
3718
+ requestId: string;
3719
+ sessionUpdate: "ls_permission_resolved";
3720
+ optionId?: string | undefined;
3721
+ } | {
3722
+ sessionUpdate: "ls_driver";
3723
+ driver: "none" | "desktop" | "remote";
3724
+ deviceId?: string | undefined;
3725
+ } | {
3726
+ state: "idle" | "error" | "running" | "waiting" | "offline";
3727
+ sessionUpdate: "ls_status";
3728
+ } | {
3729
+ code: string;
3730
+ message: string;
3731
+ sessionUpdate: "ls_error";
3732
+ hint?: string | undefined;
3733
+ };
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" | "tool" | "responding";
3757
+ title?: string | undefined;
3758
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
3759
+ }, {
3760
+ kind: "thinking" | "tool" | "responding";
3761
+ title?: string | undefined;
3762
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | 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
+ name: string;
3775
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3776
+ optionId: string;
3777
+ }, {
3778
+ name: string;
3779
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3780
+ optionId: string;
3781
+ }>, "many">;
3782
+ }, "strip", z.ZodTypeAny, {
3783
+ options: {
3784
+ name: string;
3785
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3786
+ optionId: string;
3787
+ }[];
3788
+ requestId: string;
3789
+ title: string;
3790
+ detail?: string | undefined;
3791
+ toolCallId?: string | undefined;
3792
+ }, {
3793
+ options: {
3794
+ name: string;
3795
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3796
+ optionId: string;
3797
+ }[];
3798
+ requestId: string;
3799
+ title: string;
3800
+ detail?: string | undefined;
3801
+ toolCallId?: string | undefined;
3802
+ }>>;
3803
+ }, "strip", z.ZodTypeAny, {
3804
+ id: string;
3805
+ cwd: string;
3806
+ createdAt: number;
3807
+ pendingPermissions: number;
3808
+ updatedAt: number;
3809
+ archived: boolean;
3810
+ state: "idle" | "error" | "running" | "waiting" | "offline";
3811
+ agent: string;
3812
+ nativeId: string;
3813
+ lastSeq: number;
3814
+ title?: string | undefined;
3815
+ model?: string | undefined;
3816
+ permission?: {
3817
+ options: {
3818
+ name: string;
3819
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3820
+ optionId: string;
3821
+ }[];
3822
+ requestId: string;
3823
+ title: string;
3824
+ detail?: string | undefined;
3825
+ toolCallId?: string | undefined;
3826
+ } | undefined;
3827
+ preview?: string | undefined;
3828
+ driver?: "none" | "desktop" | "remote" | undefined;
3829
+ activity?: {
3830
+ kind: "thinking" | "tool" | "responding";
3831
+ title?: string | undefined;
3832
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
3833
+ } | undefined;
3834
+ }, {
3835
+ id: string;
3836
+ cwd: string;
3837
+ createdAt: number;
3838
+ pendingPermissions: number;
3839
+ updatedAt: number;
3840
+ archived: boolean;
3841
+ state: "idle" | "error" | "running" | "waiting" | "offline";
3842
+ agent: string;
3843
+ nativeId: string;
3844
+ lastSeq: number;
3845
+ title?: string | undefined;
3846
+ model?: string | undefined;
3847
+ permission?: {
3848
+ options: {
3849
+ name: string;
3850
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3851
+ optionId: string;
3852
+ }[];
3853
+ requestId: string;
3854
+ title: string;
3855
+ detail?: string | undefined;
3856
+ toolCallId?: string | undefined;
3857
+ } | undefined;
3858
+ preview?: string | undefined;
3859
+ driver?: "none" | "desktop" | "remote" | undefined;
3860
+ activity?: {
3861
+ kind: "thinking" | "tool" | "responding";
3862
+ title?: string | undefined;
3863
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
3864
+ } | undefined;
3865
+ }>;
3866
+ }, "strip", z.ZodTypeAny, {
3867
+ session: {
3868
+ id: string;
3869
+ cwd: string;
3870
+ createdAt: number;
3871
+ pendingPermissions: number;
3872
+ updatedAt: number;
3873
+ archived: boolean;
3874
+ state: "idle" | "error" | "running" | "waiting" | "offline";
3875
+ agent: string;
3876
+ nativeId: string;
3877
+ lastSeq: number;
3878
+ title?: string | undefined;
3879
+ model?: string | undefined;
3880
+ permission?: {
3881
+ options: {
3882
+ name: string;
3883
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3884
+ optionId: string;
3885
+ }[];
3886
+ requestId: string;
3887
+ title: string;
3888
+ detail?: string | undefined;
3889
+ toolCallId?: string | undefined;
3890
+ } | undefined;
3891
+ preview?: string | undefined;
3892
+ driver?: "none" | "desktop" | "remote" | undefined;
3893
+ activity?: {
3894
+ kind: "thinking" | "tool" | "responding";
3895
+ title?: string | undefined;
3896
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | undefined;
3897
+ } | undefined;
3898
+ };
3899
+ }, {
3900
+ session: {
3901
+ id: string;
3902
+ cwd: string;
3903
+ createdAt: number;
3904
+ pendingPermissions: number;
3905
+ updatedAt: number;
3906
+ archived: boolean;
3907
+ state: "idle" | "error" | "running" | "waiting" | "offline";
3908
+ agent: string;
3909
+ nativeId: string;
3910
+ lastSeq: number;
3911
+ title?: string | undefined;
3912
+ model?: string | undefined;
3913
+ permission?: {
3914
+ options: {
3915
+ name: string;
3916
+ kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
3917
+ optionId: string;
3918
+ }[];
3919
+ requestId: string;
3920
+ title: string;
3921
+ detail?: string | undefined;
3922
+ toolCallId?: string | undefined;
3923
+ } | undefined;
3924
+ preview?: string | undefined;
3925
+ driver?: "none" | "desktop" | "remote" | undefined;
3926
+ activity?: {
3927
+ kind: "thinking" | "tool" | "responding";
3928
+ title?: string | undefined;
3929
+ toolKind?: "search" | "other" | "read" | "edit" | "delete" | "move" | "execute" | "think" | "fetch" | 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
+ sessionId: string;
3947
+ line: string;
3948
+ }, {
3949
+ sessionId: string;
3950
+ line: 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: "connecting" | "off" | "offline" | "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: "connecting" | "off" | "offline" | "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
+ terminalId: string;
4073
+ seq: number;
4074
+ data: string;
4075
+ }, {
4076
+ terminalId: string;
4077
+ seq: number;
4078
+ data: string;
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
+ cols: number;
4096
+ rows: number;
4097
+ cwd: string;
4098
+ createdAt: number;
4099
+ title: string;
4100
+ activeAt: number;
4101
+ exitCode?: number | null | undefined;
4102
+ command?: string | undefined;
4103
+ interrupted?: boolean | undefined;
4104
+ }, {
4105
+ id: string;
4106
+ cols: number;
4107
+ rows: number;
4108
+ cwd: string;
4109
+ createdAt: number;
4110
+ title: string;
4111
+ activeAt: number;
4112
+ exitCode?: number | null | undefined;
4113
+ command?: string | undefined;
4114
+ interrupted?: boolean | undefined;
4115
+ }>;
4116
+ closed: z.ZodOptional<z.ZodBoolean>;
4117
+ }, "strip", z.ZodTypeAny, {
4118
+ terminal: {
4119
+ id: string;
4120
+ cols: number;
4121
+ rows: number;
4122
+ cwd: string;
4123
+ createdAt: number;
4124
+ title: string;
4125
+ activeAt: number;
4126
+ exitCode?: number | null | undefined;
4127
+ command?: string | undefined;
4128
+ interrupted?: boolean | undefined;
4129
+ };
4130
+ closed?: boolean | undefined;
4131
+ }, {
4132
+ terminal: {
4133
+ id: string;
4134
+ cols: number;
4135
+ rows: number;
4136
+ cwd: string;
4137
+ createdAt: number;
4138
+ title: string;
4139
+ activeAt: number;
4140
+ exitCode?: number | null | undefined;
4141
+ command?: string | 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]>;