moderado 0.3.7 → 0.3.8

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 (58) hide show
  1. package/README.md +215 -215
  2. package/dist/args.js +29 -29
  3. package/dist/chat_mode.d.ts +14 -0
  4. package/dist/chat_mode.d.ts.map +1 -0
  5. package/dist/chat_mode.js +13 -0
  6. package/dist/chat_mode.js.map +1 -0
  7. package/dist/commands/chat.d.ts.map +1 -1
  8. package/dist/commands/chat.js +2 -2
  9. package/dist/commands/chat.js.map +1 -1
  10. package/dist/commands/host.d.ts +4 -0
  11. package/dist/commands/host.d.ts.map +1 -0
  12. package/dist/commands/host.js +30 -0
  13. package/dist/commands/host.js.map +1 -0
  14. package/dist/commands/models.d.ts.map +1 -1
  15. package/dist/commands/models.js +2 -2
  16. package/dist/commands/models.js.map +1 -1
  17. package/dist/host/approval_queue.d.ts +9 -0
  18. package/dist/host/approval_queue.d.ts.map +1 -0
  19. package/dist/host/approval_queue.js +63 -0
  20. package/dist/host/approval_queue.js.map +1 -0
  21. package/dist/host/auto_approve.d.ts +22 -0
  22. package/dist/host/auto_approve.d.ts.map +1 -0
  23. package/dist/host/auto_approve.js +36 -0
  24. package/dist/host/auto_approve.js.map +1 -0
  25. package/dist/host/ndjson.d.ts +3 -0
  26. package/dist/host/ndjson.d.ts.map +1 -0
  27. package/dist/host/ndjson.js +68 -0
  28. package/dist/host/ndjson.js.map +1 -0
  29. package/dist/host/protocol_server.d.ts +9 -0
  30. package/dist/host/protocol_server.d.ts.map +1 -0
  31. package/dist/host/protocol_server.js +101 -0
  32. package/dist/host/protocol_server.js.map +1 -0
  33. package/dist/host/runtime.d.ts +30 -0
  34. package/dist/host/runtime.d.ts.map +1 -0
  35. package/dist/host/runtime.js +603 -0
  36. package/dist/host/runtime.js.map +1 -0
  37. package/dist/skills.js +2 -2
  38. package/dist/ui/session_screen.d.ts +32 -0
  39. package/dist/ui/session_screen.d.ts.map +1 -0
  40. package/dist/ui/session_screen.js +148 -0
  41. package/dist/ui/session_screen.js.map +1 -0
  42. package/dist/ui/session_terminal.d.ts +46 -0
  43. package/dist/ui/session_terminal.d.ts.map +1 -0
  44. package/dist/ui/session_terminal.js +342 -0
  45. package/dist/ui/session_terminal.js.map +1 -0
  46. package/dist/ui/welcome.d.ts.map +1 -1
  47. package/dist/ui/welcome.js +11 -12
  48. package/dist/ui/welcome.js.map +1 -1
  49. package/dist/vendor/contracts/host_protocol.d.ts +3545 -0
  50. package/dist/vendor/contracts/host_protocol.d.ts.map +1 -0
  51. package/dist/vendor/contracts/host_protocol.js +292 -0
  52. package/dist/vendor/contracts/host_protocol.js.map +1 -0
  53. package/dist/vendor/core/agent.js +24 -24
  54. package/dist/web_search_route.d.ts +16 -0
  55. package/dist/web_search_route.d.ts.map +1 -0
  56. package/dist/web_search_route.js +60 -0
  57. package/dist/web_search_route.js.map +1 -0
  58. package/package.json +28 -28
@@ -0,0 +1,3545 @@
1
+ import { z } from 'zod';
2
+ export declare function isSyntacticallySafeRelativePath(p: string): boolean;
3
+ export declare const HostChatSelectionContextSchema: z.ZodEffects<z.ZodObject<{
4
+ relativePath: z.ZodEffects<z.ZodString, string, string>;
5
+ startLine: z.ZodNumber;
6
+ endLine: z.ZodNumber;
7
+ text: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ endLine: number;
10
+ relativePath: string;
11
+ startLine: number;
12
+ text?: string | undefined;
13
+ }, {
14
+ endLine: number;
15
+ relativePath: string;
16
+ startLine: number;
17
+ text?: string | undefined;
18
+ }>, {
19
+ endLine: number;
20
+ relativePath: string;
21
+ startLine: number;
22
+ text?: string | undefined;
23
+ }, {
24
+ endLine: number;
25
+ relativePath: string;
26
+ startLine: number;
27
+ text?: string | undefined;
28
+ }>;
29
+ export type HostChatSelectionContext = z.infer<typeof HostChatSelectionContextSchema>;
30
+ export declare const HostChatContextSchema: z.ZodObject<{
31
+ selection: z.ZodOptional<z.ZodEffects<z.ZodObject<{
32
+ relativePath: z.ZodEffects<z.ZodString, string, string>;
33
+ startLine: z.ZodNumber;
34
+ endLine: z.ZodNumber;
35
+ text: z.ZodOptional<z.ZodString>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ endLine: number;
38
+ relativePath: string;
39
+ startLine: number;
40
+ text?: string | undefined;
41
+ }, {
42
+ endLine: number;
43
+ relativePath: string;
44
+ startLine: number;
45
+ text?: string | undefined;
46
+ }>, {
47
+ endLine: number;
48
+ relativePath: string;
49
+ startLine: number;
50
+ text?: string | undefined;
51
+ }, {
52
+ endLine: number;
53
+ relativePath: string;
54
+ startLine: number;
55
+ text?: string | undefined;
56
+ }>>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ selection?: {
59
+ endLine: number;
60
+ relativePath: string;
61
+ startLine: number;
62
+ text?: string | undefined;
63
+ } | undefined;
64
+ }, {
65
+ selection?: {
66
+ endLine: number;
67
+ relativePath: string;
68
+ startLine: number;
69
+ text?: string | undefined;
70
+ } | undefined;
71
+ }>;
72
+ export type HostChatContext = z.infer<typeof HostChatContextSchema>;
73
+ export declare const HOST_PROTOCOL_VERSION = 1;
74
+ export type HostProtocolVersion = typeof HOST_PROTOCOL_VERSION;
75
+ export declare const MAX_HOST_LINE_BYTES: number;
76
+ export declare const InitializeParamsSchema: z.ZodObject<{
77
+ protocolVersion: z.ZodLiteral<1>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ protocolVersion: 1;
80
+ }, {
81
+ protocolVersion: 1;
82
+ }>;
83
+ export type InitializeParams = z.infer<typeof InitializeParamsSchema>;
84
+ export declare const InitializeRequestSchema: z.ZodObject<{
85
+ type: z.ZodLiteral<"request">;
86
+ id: z.ZodString;
87
+ method: z.ZodLiteral<"initialize">;
88
+ params: z.ZodObject<{
89
+ protocolVersion: z.ZodLiteral<1>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ protocolVersion: 1;
92
+ }, {
93
+ protocolVersion: 1;
94
+ }>;
95
+ }, "strip", z.ZodTypeAny, {
96
+ params: {
97
+ protocolVersion: 1;
98
+ };
99
+ type: "request";
100
+ id: string;
101
+ method: "initialize";
102
+ }, {
103
+ params: {
104
+ protocolVersion: 1;
105
+ };
106
+ type: "request";
107
+ id: string;
108
+ method: "initialize";
109
+ }>;
110
+ export type InitializeRequest = z.infer<typeof InitializeRequestSchema>;
111
+ /**
112
+ * Per-turn agent mode. `plan` runs the turn with a read-only policy and a
113
+ * planning instruction; `act` is the normal turn. Optional so an older client
114
+ * that omits it keeps working and is treated as `act`.
115
+ */
116
+ export declare const ChatModeSchema: z.ZodEnum<["plan", "act"]>;
117
+ export type ChatMode = z.infer<typeof ChatModeSchema>;
118
+ export declare const ChatSendParamsSchema: z.ZodObject<{
119
+ sessionId: z.ZodString;
120
+ text: z.ZodString;
121
+ context: z.ZodOptional<z.ZodObject<{
122
+ selection: z.ZodOptional<z.ZodEffects<z.ZodObject<{
123
+ relativePath: z.ZodEffects<z.ZodString, string, string>;
124
+ startLine: z.ZodNumber;
125
+ endLine: z.ZodNumber;
126
+ text: z.ZodOptional<z.ZodString>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ endLine: number;
129
+ relativePath: string;
130
+ startLine: number;
131
+ text?: string | undefined;
132
+ }, {
133
+ endLine: number;
134
+ relativePath: string;
135
+ startLine: number;
136
+ text?: string | undefined;
137
+ }>, {
138
+ endLine: number;
139
+ relativePath: string;
140
+ startLine: number;
141
+ text?: string | undefined;
142
+ }, {
143
+ endLine: number;
144
+ relativePath: string;
145
+ startLine: number;
146
+ text?: string | undefined;
147
+ }>>;
148
+ }, "strip", z.ZodTypeAny, {
149
+ selection?: {
150
+ endLine: number;
151
+ relativePath: string;
152
+ startLine: number;
153
+ text?: string | undefined;
154
+ } | undefined;
155
+ }, {
156
+ selection?: {
157
+ endLine: number;
158
+ relativePath: string;
159
+ startLine: number;
160
+ text?: string | undefined;
161
+ } | undefined;
162
+ }>>;
163
+ /** Defaults to `act` when absent. */
164
+ mode: z.ZodOptional<z.ZodEnum<["plan", "act"]>>;
165
+ /**
166
+ * Which tool categories this turn may run without asking. Sent per turn rather
167
+ * than held as host state so a toggle flipped in the settings sheet takes
168
+ * effect on the next message with no round trip, and so a turn can never be
169
+ * approved by a setting the user changed while it was already running.
170
+ * Omitted means the defaults: reads and web fetch only.
171
+ */
172
+ autoApprove: z.ZodOptional<z.ZodDefault<z.ZodObject<{
173
+ read: z.ZodDefault<z.ZodBoolean>;
174
+ edit: z.ZodDefault<z.ZodBoolean>;
175
+ command: z.ZodDefault<z.ZodBoolean>;
176
+ web: z.ZodDefault<z.ZodBoolean>;
177
+ mcp: z.ZodDefault<z.ZodBoolean>;
178
+ }, "strip", z.ZodTypeAny, {
179
+ command: boolean;
180
+ read: boolean;
181
+ edit: boolean;
182
+ web: boolean;
183
+ mcp: boolean;
184
+ }, {
185
+ command?: boolean | undefined;
186
+ read?: boolean | undefined;
187
+ edit?: boolean | undefined;
188
+ web?: boolean | undefined;
189
+ mcp?: boolean | undefined;
190
+ }>>>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ sessionId: string;
193
+ text: string;
194
+ context?: {
195
+ selection?: {
196
+ endLine: number;
197
+ relativePath: string;
198
+ startLine: number;
199
+ text?: string | undefined;
200
+ } | undefined;
201
+ } | undefined;
202
+ mode?: "plan" | "act" | undefined;
203
+ autoApprove?: {
204
+ command: boolean;
205
+ read: boolean;
206
+ edit: boolean;
207
+ web: boolean;
208
+ mcp: boolean;
209
+ } | undefined;
210
+ }, {
211
+ sessionId: string;
212
+ text: string;
213
+ context?: {
214
+ selection?: {
215
+ endLine: number;
216
+ relativePath: string;
217
+ startLine: number;
218
+ text?: string | undefined;
219
+ } | undefined;
220
+ } | undefined;
221
+ mode?: "plan" | "act" | undefined;
222
+ autoApprove?: {
223
+ command?: boolean | undefined;
224
+ read?: boolean | undefined;
225
+ edit?: boolean | undefined;
226
+ web?: boolean | undefined;
227
+ mcp?: boolean | undefined;
228
+ } | undefined;
229
+ }>;
230
+ export type ChatSendParams = z.infer<typeof ChatSendParamsSchema>;
231
+ export declare const ChatSendRequestSchema: z.ZodObject<{
232
+ type: z.ZodLiteral<"request">;
233
+ id: z.ZodString;
234
+ method: z.ZodLiteral<"chat.send">;
235
+ params: z.ZodObject<{
236
+ sessionId: z.ZodString;
237
+ text: z.ZodString;
238
+ context: z.ZodOptional<z.ZodObject<{
239
+ selection: z.ZodOptional<z.ZodEffects<z.ZodObject<{
240
+ relativePath: z.ZodEffects<z.ZodString, string, string>;
241
+ startLine: z.ZodNumber;
242
+ endLine: z.ZodNumber;
243
+ text: z.ZodOptional<z.ZodString>;
244
+ }, "strip", z.ZodTypeAny, {
245
+ endLine: number;
246
+ relativePath: string;
247
+ startLine: number;
248
+ text?: string | undefined;
249
+ }, {
250
+ endLine: number;
251
+ relativePath: string;
252
+ startLine: number;
253
+ text?: string | undefined;
254
+ }>, {
255
+ endLine: number;
256
+ relativePath: string;
257
+ startLine: number;
258
+ text?: string | undefined;
259
+ }, {
260
+ endLine: number;
261
+ relativePath: string;
262
+ startLine: number;
263
+ text?: string | undefined;
264
+ }>>;
265
+ }, "strip", z.ZodTypeAny, {
266
+ selection?: {
267
+ endLine: number;
268
+ relativePath: string;
269
+ startLine: number;
270
+ text?: string | undefined;
271
+ } | undefined;
272
+ }, {
273
+ selection?: {
274
+ endLine: number;
275
+ relativePath: string;
276
+ startLine: number;
277
+ text?: string | undefined;
278
+ } | undefined;
279
+ }>>;
280
+ /** Defaults to `act` when absent. */
281
+ mode: z.ZodOptional<z.ZodEnum<["plan", "act"]>>;
282
+ /**
283
+ * Which tool categories this turn may run without asking. Sent per turn rather
284
+ * than held as host state so a toggle flipped in the settings sheet takes
285
+ * effect on the next message with no round trip, and so a turn can never be
286
+ * approved by a setting the user changed while it was already running.
287
+ * Omitted means the defaults: reads and web fetch only.
288
+ */
289
+ autoApprove: z.ZodOptional<z.ZodDefault<z.ZodObject<{
290
+ read: z.ZodDefault<z.ZodBoolean>;
291
+ edit: z.ZodDefault<z.ZodBoolean>;
292
+ command: z.ZodDefault<z.ZodBoolean>;
293
+ web: z.ZodDefault<z.ZodBoolean>;
294
+ mcp: z.ZodDefault<z.ZodBoolean>;
295
+ }, "strip", z.ZodTypeAny, {
296
+ command: boolean;
297
+ read: boolean;
298
+ edit: boolean;
299
+ web: boolean;
300
+ mcp: boolean;
301
+ }, {
302
+ command?: boolean | undefined;
303
+ read?: boolean | undefined;
304
+ edit?: boolean | undefined;
305
+ web?: boolean | undefined;
306
+ mcp?: boolean | undefined;
307
+ }>>>;
308
+ }, "strip", z.ZodTypeAny, {
309
+ sessionId: string;
310
+ text: string;
311
+ context?: {
312
+ selection?: {
313
+ endLine: number;
314
+ relativePath: string;
315
+ startLine: number;
316
+ text?: string | undefined;
317
+ } | undefined;
318
+ } | undefined;
319
+ mode?: "plan" | "act" | undefined;
320
+ autoApprove?: {
321
+ command: boolean;
322
+ read: boolean;
323
+ edit: boolean;
324
+ web: boolean;
325
+ mcp: boolean;
326
+ } | undefined;
327
+ }, {
328
+ sessionId: string;
329
+ text: string;
330
+ context?: {
331
+ selection?: {
332
+ endLine: number;
333
+ relativePath: string;
334
+ startLine: number;
335
+ text?: string | undefined;
336
+ } | undefined;
337
+ } | undefined;
338
+ mode?: "plan" | "act" | undefined;
339
+ autoApprove?: {
340
+ command?: boolean | undefined;
341
+ read?: boolean | undefined;
342
+ edit?: boolean | undefined;
343
+ web?: boolean | undefined;
344
+ mcp?: boolean | undefined;
345
+ } | undefined;
346
+ }>;
347
+ }, "strip", z.ZodTypeAny, {
348
+ params: {
349
+ sessionId: string;
350
+ text: string;
351
+ context?: {
352
+ selection?: {
353
+ endLine: number;
354
+ relativePath: string;
355
+ startLine: number;
356
+ text?: string | undefined;
357
+ } | undefined;
358
+ } | undefined;
359
+ mode?: "plan" | "act" | undefined;
360
+ autoApprove?: {
361
+ command: boolean;
362
+ read: boolean;
363
+ edit: boolean;
364
+ web: boolean;
365
+ mcp: boolean;
366
+ } | undefined;
367
+ };
368
+ type: "request";
369
+ id: string;
370
+ method: "chat.send";
371
+ }, {
372
+ params: {
373
+ sessionId: string;
374
+ text: string;
375
+ context?: {
376
+ selection?: {
377
+ endLine: number;
378
+ relativePath: string;
379
+ startLine: number;
380
+ text?: string | undefined;
381
+ } | undefined;
382
+ } | undefined;
383
+ mode?: "plan" | "act" | undefined;
384
+ autoApprove?: {
385
+ command?: boolean | undefined;
386
+ read?: boolean | undefined;
387
+ edit?: boolean | undefined;
388
+ web?: boolean | undefined;
389
+ mcp?: boolean | undefined;
390
+ } | undefined;
391
+ };
392
+ type: "request";
393
+ id: string;
394
+ method: "chat.send";
395
+ }>;
396
+ export type ChatSendRequest = z.infer<typeof ChatSendRequestSchema>;
397
+ export declare const ChatCancelParamsSchema: z.ZodObject<{
398
+ sessionId: z.ZodString;
399
+ /** Omit to abort whichever generation is currently in flight. */
400
+ targetRequestId: z.ZodOptional<z.ZodString>;
401
+ }, "strip", z.ZodTypeAny, {
402
+ sessionId: string;
403
+ targetRequestId?: string | undefined;
404
+ }, {
405
+ sessionId: string;
406
+ targetRequestId?: string | undefined;
407
+ }>;
408
+ export type ChatCancelParams = z.infer<typeof ChatCancelParamsSchema>;
409
+ export declare const ChatCancelRequestSchema: z.ZodObject<{
410
+ type: z.ZodLiteral<"request">;
411
+ id: z.ZodString;
412
+ method: z.ZodLiteral<"chat.cancel">;
413
+ params: z.ZodObject<{
414
+ sessionId: z.ZodString;
415
+ /** Omit to abort whichever generation is currently in flight. */
416
+ targetRequestId: z.ZodOptional<z.ZodString>;
417
+ }, "strip", z.ZodTypeAny, {
418
+ sessionId: string;
419
+ targetRequestId?: string | undefined;
420
+ }, {
421
+ sessionId: string;
422
+ targetRequestId?: string | undefined;
423
+ }>;
424
+ }, "strip", z.ZodTypeAny, {
425
+ params: {
426
+ sessionId: string;
427
+ targetRequestId?: string | undefined;
428
+ };
429
+ type: "request";
430
+ id: string;
431
+ method: "chat.cancel";
432
+ }, {
433
+ params: {
434
+ sessionId: string;
435
+ targetRequestId?: string | undefined;
436
+ };
437
+ type: "request";
438
+ id: string;
439
+ method: "chat.cancel";
440
+ }>;
441
+ export type ChatCancelRequest = z.infer<typeof ChatCancelRequestSchema>;
442
+ export declare const ApprovalRespondParamsSchema: z.ZodObject<{
443
+ sessionId: z.ZodString;
444
+ requestId: z.ZodString;
445
+ status: z.ZodEnum<["approved", "denied", "aborted"]>;
446
+ }, "strip", z.ZodTypeAny, {
447
+ status: "approved" | "denied" | "aborted";
448
+ requestId: string;
449
+ sessionId: string;
450
+ }, {
451
+ status: "approved" | "denied" | "aborted";
452
+ requestId: string;
453
+ sessionId: string;
454
+ }>;
455
+ export type ApprovalRespondParams = z.infer<typeof ApprovalRespondParamsSchema>;
456
+ export declare const ApprovalRespondRequestSchema: z.ZodObject<{
457
+ type: z.ZodLiteral<"request">;
458
+ id: z.ZodString;
459
+ method: z.ZodLiteral<"approval.respond">;
460
+ params: z.ZodObject<{
461
+ sessionId: z.ZodString;
462
+ requestId: z.ZodString;
463
+ status: z.ZodEnum<["approved", "denied", "aborted"]>;
464
+ }, "strip", z.ZodTypeAny, {
465
+ status: "approved" | "denied" | "aborted";
466
+ requestId: string;
467
+ sessionId: string;
468
+ }, {
469
+ status: "approved" | "denied" | "aborted";
470
+ requestId: string;
471
+ sessionId: string;
472
+ }>;
473
+ }, "strip", z.ZodTypeAny, {
474
+ params: {
475
+ status: "approved" | "denied" | "aborted";
476
+ requestId: string;
477
+ sessionId: string;
478
+ };
479
+ type: "request";
480
+ id: string;
481
+ method: "approval.respond";
482
+ }, {
483
+ params: {
484
+ status: "approved" | "denied" | "aborted";
485
+ requestId: string;
486
+ sessionId: string;
487
+ };
488
+ type: "request";
489
+ id: string;
490
+ method: "approval.respond";
491
+ }>;
492
+ export type ApprovalRespondRequest = z.infer<typeof ApprovalRespondRequestSchema>;
493
+ export declare const SessionNewParamsSchema: z.ZodObject<{
494
+ sessionId: z.ZodString;
495
+ }, "strip", z.ZodTypeAny, {
496
+ sessionId: string;
497
+ }, {
498
+ sessionId: string;
499
+ }>;
500
+ export type SessionNewParams = z.infer<typeof SessionNewParamsSchema>;
501
+ export declare const SessionNewRequestSchema: z.ZodObject<{
502
+ type: z.ZodLiteral<"request">;
503
+ id: z.ZodString;
504
+ method: z.ZodLiteral<"session.new">;
505
+ params: z.ZodObject<{
506
+ sessionId: z.ZodString;
507
+ }, "strip", z.ZodTypeAny, {
508
+ sessionId: string;
509
+ }, {
510
+ sessionId: string;
511
+ }>;
512
+ }, "strip", z.ZodTypeAny, {
513
+ params: {
514
+ sessionId: string;
515
+ };
516
+ type: "request";
517
+ id: string;
518
+ method: "session.new";
519
+ }, {
520
+ params: {
521
+ sessionId: string;
522
+ };
523
+ type: "request";
524
+ id: string;
525
+ method: "session.new";
526
+ }>;
527
+ export type SessionNewRequest = z.infer<typeof SessionNewRequestSchema>;
528
+ export declare const SessionResumeParamsSchema: z.ZodObject<{
529
+ sessionId: z.ZodString;
530
+ targetSessionId: z.ZodString;
531
+ }, "strip", z.ZodTypeAny, {
532
+ sessionId: string;
533
+ targetSessionId: string;
534
+ }, {
535
+ sessionId: string;
536
+ targetSessionId: string;
537
+ }>;
538
+ export type SessionResumeParams = z.infer<typeof SessionResumeParamsSchema>;
539
+ export declare const SessionResumeRequestSchema: z.ZodObject<{
540
+ type: z.ZodLiteral<"request">;
541
+ id: z.ZodString;
542
+ method: z.ZodLiteral<"session.resume">;
543
+ params: z.ZodObject<{
544
+ sessionId: z.ZodString;
545
+ targetSessionId: z.ZodString;
546
+ }, "strip", z.ZodTypeAny, {
547
+ sessionId: string;
548
+ targetSessionId: string;
549
+ }, {
550
+ sessionId: string;
551
+ targetSessionId: string;
552
+ }>;
553
+ }, "strip", z.ZodTypeAny, {
554
+ params: {
555
+ sessionId: string;
556
+ targetSessionId: string;
557
+ };
558
+ type: "request";
559
+ id: string;
560
+ method: "session.resume";
561
+ }, {
562
+ params: {
563
+ sessionId: string;
564
+ targetSessionId: string;
565
+ };
566
+ type: "request";
567
+ id: string;
568
+ method: "session.resume";
569
+ }>;
570
+ export type SessionResumeRequest = z.infer<typeof SessionResumeRequestSchema>;
571
+ /**
572
+ * Permanently remove stored sessions from this workspace.
573
+ *
574
+ * Ids are validated as UUIDs and resolved inside the workspace's own session
575
+ * directory, so a crafted id can never name a file elsewhere on disk. The
576
+ * running session is refused by the host rather than here: the id set is
577
+ * client-supplied, and only the host knows which session is live.
578
+ */
579
+ export declare const SessionDeleteParamsSchema: z.ZodObject<{
580
+ sessionId: z.ZodString;
581
+ targetSessionIds: z.ZodArray<z.ZodString, "many">;
582
+ }, "strip", z.ZodTypeAny, {
583
+ sessionId: string;
584
+ targetSessionIds: string[];
585
+ }, {
586
+ sessionId: string;
587
+ targetSessionIds: string[];
588
+ }>;
589
+ export type SessionDeleteParams = z.infer<typeof SessionDeleteParamsSchema>;
590
+ export declare const SessionDeleteRequestSchema: z.ZodObject<{
591
+ type: z.ZodLiteral<"request">;
592
+ id: z.ZodString;
593
+ method: z.ZodLiteral<"session.delete">;
594
+ params: z.ZodObject<{
595
+ sessionId: z.ZodString;
596
+ targetSessionIds: z.ZodArray<z.ZodString, "many">;
597
+ }, "strip", z.ZodTypeAny, {
598
+ sessionId: string;
599
+ targetSessionIds: string[];
600
+ }, {
601
+ sessionId: string;
602
+ targetSessionIds: string[];
603
+ }>;
604
+ }, "strip", z.ZodTypeAny, {
605
+ params: {
606
+ sessionId: string;
607
+ targetSessionIds: string[];
608
+ };
609
+ type: "request";
610
+ id: string;
611
+ method: "session.delete";
612
+ }, {
613
+ params: {
614
+ sessionId: string;
615
+ targetSessionIds: string[];
616
+ };
617
+ type: "request";
618
+ id: string;
619
+ method: "session.delete";
620
+ }>;
621
+ export type SessionDeleteRequest = z.infer<typeof SessionDeleteRequestSchema>;
622
+ /** Safe identifier shape shared by provider ids entering the host boundary. */
623
+ export declare const ProviderIdSchema: z.ZodString;
624
+ export declare const ProviderListParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
625
+ export type ProviderListParams = z.infer<typeof ProviderListParamsSchema>;
626
+ export declare const ProviderListRequestSchema: z.ZodObject<{
627
+ type: z.ZodLiteral<"request">;
628
+ id: z.ZodString;
629
+ method: z.ZodLiteral<"provider.list">;
630
+ params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
631
+ }, "strip", z.ZodTypeAny, {
632
+ params: {};
633
+ type: "request";
634
+ id: string;
635
+ method: "provider.list";
636
+ }, {
637
+ params: {};
638
+ type: "request";
639
+ id: string;
640
+ method: "provider.list";
641
+ }>;
642
+ export type ProviderListRequest = z.infer<typeof ProviderListRequestSchema>;
643
+ /** A provider the sidecar can route to, with connection state (never secrets). */
644
+ export declare const ProviderInfoSchema: z.ZodObject<{
645
+ id: z.ZodString;
646
+ label: z.ZodString;
647
+ description: z.ZodOptional<z.ZodString>;
648
+ /** Local-only providers (Ollama, LM Studio) work without any API key. */
649
+ requiresApiKey: z.ZodBoolean;
650
+ hasApiKey: z.ZodBoolean;
651
+ isActive: z.ZodBoolean;
652
+ }, "strip", z.ZodTypeAny, {
653
+ id: string;
654
+ label: string;
655
+ requiresApiKey: boolean;
656
+ hasApiKey: boolean;
657
+ isActive: boolean;
658
+ description?: string | undefined;
659
+ }, {
660
+ id: string;
661
+ label: string;
662
+ requiresApiKey: boolean;
663
+ hasApiKey: boolean;
664
+ isActive: boolean;
665
+ description?: string | undefined;
666
+ }>;
667
+ export type ProviderInfo = z.infer<typeof ProviderInfoSchema>;
668
+ export declare const ProviderListResultSchema: z.ZodObject<{
669
+ providers: z.ZodArray<z.ZodObject<{
670
+ id: z.ZodString;
671
+ label: z.ZodString;
672
+ description: z.ZodOptional<z.ZodString>;
673
+ /** Local-only providers (Ollama, LM Studio) work without any API key. */
674
+ requiresApiKey: z.ZodBoolean;
675
+ hasApiKey: z.ZodBoolean;
676
+ isActive: z.ZodBoolean;
677
+ }, "strip", z.ZodTypeAny, {
678
+ id: string;
679
+ label: string;
680
+ requiresApiKey: boolean;
681
+ hasApiKey: boolean;
682
+ isActive: boolean;
683
+ description?: string | undefined;
684
+ }, {
685
+ id: string;
686
+ label: string;
687
+ requiresApiKey: boolean;
688
+ hasApiKey: boolean;
689
+ isActive: boolean;
690
+ description?: string | undefined;
691
+ }>, "many">;
692
+ activeProviderId: z.ZodOptional<z.ZodString>;
693
+ }, "strip", z.ZodTypeAny, {
694
+ providers: {
695
+ id: string;
696
+ label: string;
697
+ requiresApiKey: boolean;
698
+ hasApiKey: boolean;
699
+ isActive: boolean;
700
+ description?: string | undefined;
701
+ }[];
702
+ activeProviderId?: string | undefined;
703
+ }, {
704
+ providers: {
705
+ id: string;
706
+ label: string;
707
+ requiresApiKey: boolean;
708
+ hasApiKey: boolean;
709
+ isActive: boolean;
710
+ description?: string | undefined;
711
+ }[];
712
+ activeProviderId?: string | undefined;
713
+ }>;
714
+ export type ProviderListResult = z.infer<typeof ProviderListResultSchema>;
715
+ export declare const ProviderConnectParamsSchema: z.ZodObject<{
716
+ providerId: z.ZodString;
717
+ /** Absent means "activate a provider whose key is already stored". */
718
+ apiKey: z.ZodOptional<z.ZodString>;
719
+ }, "strip", z.ZodTypeAny, {
720
+ providerId: string;
721
+ apiKey?: string | undefined;
722
+ }, {
723
+ providerId: string;
724
+ apiKey?: string | undefined;
725
+ }>;
726
+ export type ProviderConnectParams = z.infer<typeof ProviderConnectParamsSchema>;
727
+ export declare const ProviderConnectRequestSchema: z.ZodObject<{
728
+ type: z.ZodLiteral<"request">;
729
+ id: z.ZodString;
730
+ method: z.ZodLiteral<"provider.connect">;
731
+ params: z.ZodObject<{
732
+ providerId: z.ZodString;
733
+ /** Absent means "activate a provider whose key is already stored". */
734
+ apiKey: z.ZodOptional<z.ZodString>;
735
+ }, "strip", z.ZodTypeAny, {
736
+ providerId: string;
737
+ apiKey?: string | undefined;
738
+ }, {
739
+ providerId: string;
740
+ apiKey?: string | undefined;
741
+ }>;
742
+ }, "strip", z.ZodTypeAny, {
743
+ params: {
744
+ providerId: string;
745
+ apiKey?: string | undefined;
746
+ };
747
+ type: "request";
748
+ id: string;
749
+ method: "provider.connect";
750
+ }, {
751
+ params: {
752
+ providerId: string;
753
+ apiKey?: string | undefined;
754
+ };
755
+ type: "request";
756
+ id: string;
757
+ method: "provider.connect";
758
+ }>;
759
+ export type ProviderConnectRequest = z.infer<typeof ProviderConnectRequestSchema>;
760
+ export declare const ProviderConnectResultSchema: z.ZodObject<{
761
+ providerId: z.ZodString;
762
+ connected: z.ZodLiteral<true>;
763
+ }, "strip", z.ZodTypeAny, {
764
+ providerId: string;
765
+ connected: true;
766
+ }, {
767
+ providerId: string;
768
+ connected: true;
769
+ }>;
770
+ export type ProviderConnectResult = z.infer<typeof ProviderConnectResultSchema>;
771
+ export declare const ModelListParamsSchema: z.ZodObject<{
772
+ providerId: z.ZodOptional<z.ZodString>;
773
+ /**
774
+ * Bypass the provider adapter's catalog cache. Adapters memoise `/models`
775
+ * (NVIDIA NIM for 15 minutes) and the sidecar is a long-lived process, so
776
+ * without this the list is frozen for the whole session and the user has no
777
+ * way to pick up a newly published model.
778
+ */
779
+ refresh: z.ZodOptional<z.ZodBoolean>;
780
+ }, "strip", z.ZodTypeAny, {
781
+ providerId?: string | undefined;
782
+ refresh?: boolean | undefined;
783
+ }, {
784
+ providerId?: string | undefined;
785
+ refresh?: boolean | undefined;
786
+ }>;
787
+ export type ModelListParams = z.infer<typeof ModelListParamsSchema>;
788
+ export declare const ModelListRequestSchema: z.ZodObject<{
789
+ type: z.ZodLiteral<"request">;
790
+ id: z.ZodString;
791
+ method: z.ZodLiteral<"model.list">;
792
+ params: z.ZodObject<{
793
+ providerId: z.ZodOptional<z.ZodString>;
794
+ /**
795
+ * Bypass the provider adapter's catalog cache. Adapters memoise `/models`
796
+ * (NVIDIA NIM for 15 minutes) and the sidecar is a long-lived process, so
797
+ * without this the list is frozen for the whole session and the user has no
798
+ * way to pick up a newly published model.
799
+ */
800
+ refresh: z.ZodOptional<z.ZodBoolean>;
801
+ }, "strip", z.ZodTypeAny, {
802
+ providerId?: string | undefined;
803
+ refresh?: boolean | undefined;
804
+ }, {
805
+ providerId?: string | undefined;
806
+ refresh?: boolean | undefined;
807
+ }>;
808
+ }, "strip", z.ZodTypeAny, {
809
+ params: {
810
+ providerId?: string | undefined;
811
+ refresh?: boolean | undefined;
812
+ };
813
+ type: "request";
814
+ id: string;
815
+ method: "model.list";
816
+ }, {
817
+ params: {
818
+ providerId?: string | undefined;
819
+ refresh?: boolean | undefined;
820
+ };
821
+ type: "request";
822
+ id: string;
823
+ method: "model.list";
824
+ }>;
825
+ export type ModelListRequest = z.infer<typeof ModelListRequestSchema>;
826
+ export declare const ModelOptionSchema: z.ZodObject<{
827
+ id: z.ZodString;
828
+ isFree: z.ZodBoolean;
829
+ ownedBy: z.ZodOptional<z.ZodString>;
830
+ }, "strip", z.ZodTypeAny, {
831
+ id: string;
832
+ isFree: boolean;
833
+ ownedBy?: string | undefined;
834
+ }, {
835
+ id: string;
836
+ isFree: boolean;
837
+ ownedBy?: string | undefined;
838
+ }>;
839
+ export type ModelOption = z.infer<typeof ModelOptionSchema>;
840
+ export declare const ModelListResultSchema: z.ZodObject<{
841
+ providerId: z.ZodString;
842
+ models: z.ZodArray<z.ZodObject<{
843
+ id: z.ZodString;
844
+ isFree: z.ZodBoolean;
845
+ ownedBy: z.ZodOptional<z.ZodString>;
846
+ }, "strip", z.ZodTypeAny, {
847
+ id: string;
848
+ isFree: boolean;
849
+ ownedBy?: string | undefined;
850
+ }, {
851
+ id: string;
852
+ isFree: boolean;
853
+ ownedBy?: string | undefined;
854
+ }>, "many">;
855
+ /** True when the catalog exceeded the response cap and was cut. */
856
+ truncated: z.ZodOptional<z.ZodBoolean>;
857
+ }, "strip", z.ZodTypeAny, {
858
+ providerId: string;
859
+ models: {
860
+ id: string;
861
+ isFree: boolean;
862
+ ownedBy?: string | undefined;
863
+ }[];
864
+ truncated?: boolean | undefined;
865
+ }, {
866
+ providerId: string;
867
+ models: {
868
+ id: string;
869
+ isFree: boolean;
870
+ ownedBy?: string | undefined;
871
+ }[];
872
+ truncated?: boolean | undefined;
873
+ }>;
874
+ export type ModelListResult = z.infer<typeof ModelListResultSchema>;
875
+ export declare const HostRequestSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObject<{
876
+ type: z.ZodLiteral<"request">;
877
+ id: z.ZodString;
878
+ method: z.ZodLiteral<"initialize">;
879
+ params: z.ZodObject<{
880
+ protocolVersion: z.ZodLiteral<1>;
881
+ }, "strip", z.ZodTypeAny, {
882
+ protocolVersion: 1;
883
+ }, {
884
+ protocolVersion: 1;
885
+ }>;
886
+ }, "strip", z.ZodTypeAny, {
887
+ params: {
888
+ protocolVersion: 1;
889
+ };
890
+ type: "request";
891
+ id: string;
892
+ method: "initialize";
893
+ }, {
894
+ params: {
895
+ protocolVersion: 1;
896
+ };
897
+ type: "request";
898
+ id: string;
899
+ method: "initialize";
900
+ }>, z.ZodObject<{
901
+ type: z.ZodLiteral<"request">;
902
+ id: z.ZodString;
903
+ method: z.ZodLiteral<"chat.send">;
904
+ params: z.ZodObject<{
905
+ sessionId: z.ZodString;
906
+ text: z.ZodString;
907
+ context: z.ZodOptional<z.ZodObject<{
908
+ selection: z.ZodOptional<z.ZodEffects<z.ZodObject<{
909
+ relativePath: z.ZodEffects<z.ZodString, string, string>;
910
+ startLine: z.ZodNumber;
911
+ endLine: z.ZodNumber;
912
+ text: z.ZodOptional<z.ZodString>;
913
+ }, "strip", z.ZodTypeAny, {
914
+ endLine: number;
915
+ relativePath: string;
916
+ startLine: number;
917
+ text?: string | undefined;
918
+ }, {
919
+ endLine: number;
920
+ relativePath: string;
921
+ startLine: number;
922
+ text?: string | undefined;
923
+ }>, {
924
+ endLine: number;
925
+ relativePath: string;
926
+ startLine: number;
927
+ text?: string | undefined;
928
+ }, {
929
+ endLine: number;
930
+ relativePath: string;
931
+ startLine: number;
932
+ text?: string | undefined;
933
+ }>>;
934
+ }, "strip", z.ZodTypeAny, {
935
+ selection?: {
936
+ endLine: number;
937
+ relativePath: string;
938
+ startLine: number;
939
+ text?: string | undefined;
940
+ } | undefined;
941
+ }, {
942
+ selection?: {
943
+ endLine: number;
944
+ relativePath: string;
945
+ startLine: number;
946
+ text?: string | undefined;
947
+ } | undefined;
948
+ }>>;
949
+ /** Defaults to `act` when absent. */
950
+ mode: z.ZodOptional<z.ZodEnum<["plan", "act"]>>;
951
+ /**
952
+ * Which tool categories this turn may run without asking. Sent per turn rather
953
+ * than held as host state so a toggle flipped in the settings sheet takes
954
+ * effect on the next message with no round trip, and so a turn can never be
955
+ * approved by a setting the user changed while it was already running.
956
+ * Omitted means the defaults: reads and web fetch only.
957
+ */
958
+ autoApprove: z.ZodOptional<z.ZodDefault<z.ZodObject<{
959
+ read: z.ZodDefault<z.ZodBoolean>;
960
+ edit: z.ZodDefault<z.ZodBoolean>;
961
+ command: z.ZodDefault<z.ZodBoolean>;
962
+ web: z.ZodDefault<z.ZodBoolean>;
963
+ mcp: z.ZodDefault<z.ZodBoolean>;
964
+ }, "strip", z.ZodTypeAny, {
965
+ command: boolean;
966
+ read: boolean;
967
+ edit: boolean;
968
+ web: boolean;
969
+ mcp: boolean;
970
+ }, {
971
+ command?: boolean | undefined;
972
+ read?: boolean | undefined;
973
+ edit?: boolean | undefined;
974
+ web?: boolean | undefined;
975
+ mcp?: boolean | undefined;
976
+ }>>>;
977
+ }, "strip", z.ZodTypeAny, {
978
+ sessionId: string;
979
+ text: string;
980
+ context?: {
981
+ selection?: {
982
+ endLine: number;
983
+ relativePath: string;
984
+ startLine: number;
985
+ text?: string | undefined;
986
+ } | undefined;
987
+ } | undefined;
988
+ mode?: "plan" | "act" | undefined;
989
+ autoApprove?: {
990
+ command: boolean;
991
+ read: boolean;
992
+ edit: boolean;
993
+ web: boolean;
994
+ mcp: boolean;
995
+ } | undefined;
996
+ }, {
997
+ sessionId: string;
998
+ text: string;
999
+ context?: {
1000
+ selection?: {
1001
+ endLine: number;
1002
+ relativePath: string;
1003
+ startLine: number;
1004
+ text?: string | undefined;
1005
+ } | undefined;
1006
+ } | undefined;
1007
+ mode?: "plan" | "act" | undefined;
1008
+ autoApprove?: {
1009
+ command?: boolean | undefined;
1010
+ read?: boolean | undefined;
1011
+ edit?: boolean | undefined;
1012
+ web?: boolean | undefined;
1013
+ mcp?: boolean | undefined;
1014
+ } | undefined;
1015
+ }>;
1016
+ }, "strip", z.ZodTypeAny, {
1017
+ params: {
1018
+ sessionId: string;
1019
+ text: string;
1020
+ context?: {
1021
+ selection?: {
1022
+ endLine: number;
1023
+ relativePath: string;
1024
+ startLine: number;
1025
+ text?: string | undefined;
1026
+ } | undefined;
1027
+ } | undefined;
1028
+ mode?: "plan" | "act" | undefined;
1029
+ autoApprove?: {
1030
+ command: boolean;
1031
+ read: boolean;
1032
+ edit: boolean;
1033
+ web: boolean;
1034
+ mcp: boolean;
1035
+ } | undefined;
1036
+ };
1037
+ type: "request";
1038
+ id: string;
1039
+ method: "chat.send";
1040
+ }, {
1041
+ params: {
1042
+ sessionId: string;
1043
+ text: string;
1044
+ context?: {
1045
+ selection?: {
1046
+ endLine: number;
1047
+ relativePath: string;
1048
+ startLine: number;
1049
+ text?: string | undefined;
1050
+ } | undefined;
1051
+ } | undefined;
1052
+ mode?: "plan" | "act" | undefined;
1053
+ autoApprove?: {
1054
+ command?: boolean | undefined;
1055
+ read?: boolean | undefined;
1056
+ edit?: boolean | undefined;
1057
+ web?: boolean | undefined;
1058
+ mcp?: boolean | undefined;
1059
+ } | undefined;
1060
+ };
1061
+ type: "request";
1062
+ id: string;
1063
+ method: "chat.send";
1064
+ }>, z.ZodObject<{
1065
+ type: z.ZodLiteral<"request">;
1066
+ id: z.ZodString;
1067
+ method: z.ZodLiteral<"chat.cancel">;
1068
+ params: z.ZodObject<{
1069
+ sessionId: z.ZodString;
1070
+ /** Omit to abort whichever generation is currently in flight. */
1071
+ targetRequestId: z.ZodOptional<z.ZodString>;
1072
+ }, "strip", z.ZodTypeAny, {
1073
+ sessionId: string;
1074
+ targetRequestId?: string | undefined;
1075
+ }, {
1076
+ sessionId: string;
1077
+ targetRequestId?: string | undefined;
1078
+ }>;
1079
+ }, "strip", z.ZodTypeAny, {
1080
+ params: {
1081
+ sessionId: string;
1082
+ targetRequestId?: string | undefined;
1083
+ };
1084
+ type: "request";
1085
+ id: string;
1086
+ method: "chat.cancel";
1087
+ }, {
1088
+ params: {
1089
+ sessionId: string;
1090
+ targetRequestId?: string | undefined;
1091
+ };
1092
+ type: "request";
1093
+ id: string;
1094
+ method: "chat.cancel";
1095
+ }>, z.ZodObject<{
1096
+ type: z.ZodLiteral<"request">;
1097
+ id: z.ZodString;
1098
+ method: z.ZodLiteral<"approval.respond">;
1099
+ params: z.ZodObject<{
1100
+ sessionId: z.ZodString;
1101
+ requestId: z.ZodString;
1102
+ status: z.ZodEnum<["approved", "denied", "aborted"]>;
1103
+ }, "strip", z.ZodTypeAny, {
1104
+ status: "approved" | "denied" | "aborted";
1105
+ requestId: string;
1106
+ sessionId: string;
1107
+ }, {
1108
+ status: "approved" | "denied" | "aborted";
1109
+ requestId: string;
1110
+ sessionId: string;
1111
+ }>;
1112
+ }, "strip", z.ZodTypeAny, {
1113
+ params: {
1114
+ status: "approved" | "denied" | "aborted";
1115
+ requestId: string;
1116
+ sessionId: string;
1117
+ };
1118
+ type: "request";
1119
+ id: string;
1120
+ method: "approval.respond";
1121
+ }, {
1122
+ params: {
1123
+ status: "approved" | "denied" | "aborted";
1124
+ requestId: string;
1125
+ sessionId: string;
1126
+ };
1127
+ type: "request";
1128
+ id: string;
1129
+ method: "approval.respond";
1130
+ }>, z.ZodObject<{
1131
+ type: z.ZodLiteral<"request">;
1132
+ id: z.ZodString;
1133
+ method: z.ZodLiteral<"session.new">;
1134
+ params: z.ZodObject<{
1135
+ sessionId: z.ZodString;
1136
+ }, "strip", z.ZodTypeAny, {
1137
+ sessionId: string;
1138
+ }, {
1139
+ sessionId: string;
1140
+ }>;
1141
+ }, "strip", z.ZodTypeAny, {
1142
+ params: {
1143
+ sessionId: string;
1144
+ };
1145
+ type: "request";
1146
+ id: string;
1147
+ method: "session.new";
1148
+ }, {
1149
+ params: {
1150
+ sessionId: string;
1151
+ };
1152
+ type: "request";
1153
+ id: string;
1154
+ method: "session.new";
1155
+ }>, z.ZodObject<{
1156
+ type: z.ZodLiteral<"request">;
1157
+ id: z.ZodString;
1158
+ method: z.ZodLiteral<"session.resume">;
1159
+ params: z.ZodObject<{
1160
+ sessionId: z.ZodString;
1161
+ targetSessionId: z.ZodString;
1162
+ }, "strip", z.ZodTypeAny, {
1163
+ sessionId: string;
1164
+ targetSessionId: string;
1165
+ }, {
1166
+ sessionId: string;
1167
+ targetSessionId: string;
1168
+ }>;
1169
+ }, "strip", z.ZodTypeAny, {
1170
+ params: {
1171
+ sessionId: string;
1172
+ targetSessionId: string;
1173
+ };
1174
+ type: "request";
1175
+ id: string;
1176
+ method: "session.resume";
1177
+ }, {
1178
+ params: {
1179
+ sessionId: string;
1180
+ targetSessionId: string;
1181
+ };
1182
+ type: "request";
1183
+ id: string;
1184
+ method: "session.resume";
1185
+ }>, z.ZodObject<{
1186
+ type: z.ZodLiteral<"request">;
1187
+ id: z.ZodString;
1188
+ method: z.ZodLiteral<"session.delete">;
1189
+ params: z.ZodObject<{
1190
+ sessionId: z.ZodString;
1191
+ targetSessionIds: z.ZodArray<z.ZodString, "many">;
1192
+ }, "strip", z.ZodTypeAny, {
1193
+ sessionId: string;
1194
+ targetSessionIds: string[];
1195
+ }, {
1196
+ sessionId: string;
1197
+ targetSessionIds: string[];
1198
+ }>;
1199
+ }, "strip", z.ZodTypeAny, {
1200
+ params: {
1201
+ sessionId: string;
1202
+ targetSessionIds: string[];
1203
+ };
1204
+ type: "request";
1205
+ id: string;
1206
+ method: "session.delete";
1207
+ }, {
1208
+ params: {
1209
+ sessionId: string;
1210
+ targetSessionIds: string[];
1211
+ };
1212
+ type: "request";
1213
+ id: string;
1214
+ method: "session.delete";
1215
+ }>, z.ZodObject<{
1216
+ type: z.ZodLiteral<"request">;
1217
+ id: z.ZodString;
1218
+ method: z.ZodLiteral<"provider.list">;
1219
+ params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1220
+ }, "strip", z.ZodTypeAny, {
1221
+ params: {};
1222
+ type: "request";
1223
+ id: string;
1224
+ method: "provider.list";
1225
+ }, {
1226
+ params: {};
1227
+ type: "request";
1228
+ id: string;
1229
+ method: "provider.list";
1230
+ }>, z.ZodObject<{
1231
+ type: z.ZodLiteral<"request">;
1232
+ id: z.ZodString;
1233
+ method: z.ZodLiteral<"provider.connect">;
1234
+ params: z.ZodObject<{
1235
+ providerId: z.ZodString;
1236
+ /** Absent means "activate a provider whose key is already stored". */
1237
+ apiKey: z.ZodOptional<z.ZodString>;
1238
+ }, "strip", z.ZodTypeAny, {
1239
+ providerId: string;
1240
+ apiKey?: string | undefined;
1241
+ }, {
1242
+ providerId: string;
1243
+ apiKey?: string | undefined;
1244
+ }>;
1245
+ }, "strip", z.ZodTypeAny, {
1246
+ params: {
1247
+ providerId: string;
1248
+ apiKey?: string | undefined;
1249
+ };
1250
+ type: "request";
1251
+ id: string;
1252
+ method: "provider.connect";
1253
+ }, {
1254
+ params: {
1255
+ providerId: string;
1256
+ apiKey?: string | undefined;
1257
+ };
1258
+ type: "request";
1259
+ id: string;
1260
+ method: "provider.connect";
1261
+ }>, z.ZodObject<{
1262
+ type: z.ZodLiteral<"request">;
1263
+ id: z.ZodString;
1264
+ method: z.ZodLiteral<"model.list">;
1265
+ params: z.ZodObject<{
1266
+ providerId: z.ZodOptional<z.ZodString>;
1267
+ /**
1268
+ * Bypass the provider adapter's catalog cache. Adapters memoise `/models`
1269
+ * (NVIDIA NIM for 15 minutes) and the sidecar is a long-lived process, so
1270
+ * without this the list is frozen for the whole session and the user has no
1271
+ * way to pick up a newly published model.
1272
+ */
1273
+ refresh: z.ZodOptional<z.ZodBoolean>;
1274
+ }, "strip", z.ZodTypeAny, {
1275
+ providerId?: string | undefined;
1276
+ refresh?: boolean | undefined;
1277
+ }, {
1278
+ providerId?: string | undefined;
1279
+ refresh?: boolean | undefined;
1280
+ }>;
1281
+ }, "strip", z.ZodTypeAny, {
1282
+ params: {
1283
+ providerId?: string | undefined;
1284
+ refresh?: boolean | undefined;
1285
+ };
1286
+ type: "request";
1287
+ id: string;
1288
+ method: "model.list";
1289
+ }, {
1290
+ params: {
1291
+ providerId?: string | undefined;
1292
+ refresh?: boolean | undefined;
1293
+ };
1294
+ type: "request";
1295
+ id: string;
1296
+ method: "model.list";
1297
+ }>]>;
1298
+ export type HostRequest = z.infer<typeof HostRequestSchema>;
1299
+ export declare const ResumableSessionSchema: z.ZodObject<{
1300
+ sessionId: z.ZodString;
1301
+ title: z.ZodOptional<z.ZodString>;
1302
+ updatedAt: z.ZodNumber;
1303
+ }, "strip", z.ZodTypeAny, {
1304
+ sessionId: string;
1305
+ updatedAt: number;
1306
+ title?: string | undefined;
1307
+ }, {
1308
+ sessionId: string;
1309
+ updatedAt: number;
1310
+ title?: string | undefined;
1311
+ }>;
1312
+ export type ResumableSession = z.infer<typeof ResumableSessionSchema>;
1313
+ export declare const InitializeResultSchema: z.ZodObject<{
1314
+ protocolVersion: z.ZodLiteral<1>;
1315
+ sessionId: z.ZodString;
1316
+ workspaceName: z.ZodString;
1317
+ resumableSessions: z.ZodArray<z.ZodObject<{
1318
+ sessionId: z.ZodString;
1319
+ title: z.ZodOptional<z.ZodString>;
1320
+ updatedAt: z.ZodNumber;
1321
+ }, "strip", z.ZodTypeAny, {
1322
+ sessionId: string;
1323
+ updatedAt: number;
1324
+ title?: string | undefined;
1325
+ }, {
1326
+ sessionId: string;
1327
+ updatedAt: number;
1328
+ title?: string | undefined;
1329
+ }>, "many">;
1330
+ }, "strip", z.ZodTypeAny, {
1331
+ protocolVersion: 1;
1332
+ sessionId: string;
1333
+ workspaceName: string;
1334
+ resumableSessions: {
1335
+ sessionId: string;
1336
+ updatedAt: number;
1337
+ title?: string | undefined;
1338
+ }[];
1339
+ }, {
1340
+ protocolVersion: 1;
1341
+ sessionId: string;
1342
+ workspaceName: string;
1343
+ resumableSessions: {
1344
+ sessionId: string;
1345
+ updatedAt: number;
1346
+ title?: string | undefined;
1347
+ }[];
1348
+ }>;
1349
+ export type InitializeResult = z.infer<typeof InitializeResultSchema>;
1350
+ export declare const ChatSendResultSchema: z.ZodObject<{
1351
+ accepted: z.ZodLiteral<true>;
1352
+ }, "strip", z.ZodTypeAny, {
1353
+ accepted: true;
1354
+ }, {
1355
+ accepted: true;
1356
+ }>;
1357
+ export type ChatSendResult = z.infer<typeof ChatSendResultSchema>;
1358
+ export declare const ChatCancelResultSchema: z.ZodObject<{
1359
+ cancelled: z.ZodLiteral<true>;
1360
+ }, "strip", z.ZodTypeAny, {
1361
+ cancelled: true;
1362
+ }, {
1363
+ cancelled: true;
1364
+ }>;
1365
+ export type ChatCancelResult = z.infer<typeof ChatCancelResultSchema>;
1366
+ export declare const ApprovalRespondResultSchema: z.ZodObject<{
1367
+ resolved: z.ZodLiteral<true>;
1368
+ }, "strip", z.ZodTypeAny, {
1369
+ resolved: true;
1370
+ }, {
1371
+ resolved: true;
1372
+ }>;
1373
+ export type ApprovalRespondResult = z.infer<typeof ApprovalRespondResultSchema>;
1374
+ export declare const SessionNewResultSchema: z.ZodObject<{
1375
+ sessionId: z.ZodString;
1376
+ }, "strip", z.ZodTypeAny, {
1377
+ sessionId: string;
1378
+ }, {
1379
+ sessionId: string;
1380
+ }>;
1381
+ export type SessionNewResult = z.infer<typeof SessionNewResultSchema>;
1382
+ export declare const SessionResumeResultSchema: z.ZodObject<{
1383
+ sessionId: z.ZodString;
1384
+ }, "strip", z.ZodTypeAny, {
1385
+ sessionId: string;
1386
+ }, {
1387
+ sessionId: string;
1388
+ }>;
1389
+ export type SessionResumeResult = z.infer<typeof SessionResumeResultSchema>;
1390
+ /**
1391
+ * The outcome of a delete, carrying the full remaining list.
1392
+ *
1393
+ * The survivors are returned rather than only the deleted ids so the panel can
1394
+ * replace its RECENT list from the same authoritative read that performed the
1395
+ * deletion, instead of guessing which rows to remove locally and risking a list
1396
+ * that disagrees with disk.
1397
+ */
1398
+ export declare const SessionDeleteResultSchema: z.ZodObject<{
1399
+ deleted: z.ZodArray<z.ZodString, "many">;
1400
+ /** Ids that did not exist; already absent counts as not deleted. */
1401
+ notFound: z.ZodArray<z.ZodString, "many">;
1402
+ sessions: z.ZodArray<z.ZodObject<{
1403
+ sessionId: z.ZodString;
1404
+ title: z.ZodOptional<z.ZodString>;
1405
+ updatedAt: z.ZodNumber;
1406
+ }, "strip", z.ZodTypeAny, {
1407
+ sessionId: string;
1408
+ updatedAt: number;
1409
+ title?: string | undefined;
1410
+ }, {
1411
+ sessionId: string;
1412
+ updatedAt: number;
1413
+ title?: string | undefined;
1414
+ }>, "many">;
1415
+ }, "strip", z.ZodTypeAny, {
1416
+ deleted: string[];
1417
+ notFound: string[];
1418
+ sessions: {
1419
+ sessionId: string;
1420
+ updatedAt: number;
1421
+ title?: string | undefined;
1422
+ }[];
1423
+ }, {
1424
+ deleted: string[];
1425
+ notFound: string[];
1426
+ sessions: {
1427
+ sessionId: string;
1428
+ updatedAt: number;
1429
+ title?: string | undefined;
1430
+ }[];
1431
+ }>;
1432
+ export type SessionDeleteResult = z.infer<typeof SessionDeleteResultSchema>;
1433
+ export declare const HostErrorCodeSchema: z.ZodEnum<["INVALID_REQUEST", "UNSUPPORTED_VERSION", "WORKSPACE_DENIED", "SESSION_NOT_FOUND", "APPROVAL_STALE", "BUSY", "INTERNAL_ERROR"]>;
1434
+ export type HostErrorCode = z.infer<typeof HostErrorCodeSchema>;
1435
+ export declare const HostErrorSchema: z.ZodObject<{
1436
+ code: z.ZodEnum<["INVALID_REQUEST", "UNSUPPORTED_VERSION", "WORKSPACE_DENIED", "SESSION_NOT_FOUND", "APPROVAL_STALE", "BUSY", "INTERNAL_ERROR"]>;
1437
+ message: z.ZodString;
1438
+ }, "strip", z.ZodTypeAny, {
1439
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1440
+ message: string;
1441
+ }, {
1442
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1443
+ message: string;
1444
+ }>;
1445
+ export type HostError = z.infer<typeof HostErrorSchema>;
1446
+ export declare const HostSuccessResponseSchema: z.ZodObject<{
1447
+ type: z.ZodLiteral<"response">;
1448
+ id: z.ZodString;
1449
+ ok: z.ZodLiteral<true>;
1450
+ result: z.ZodOptional<z.ZodUnknown>;
1451
+ }, "strip", z.ZodTypeAny, {
1452
+ type: "response";
1453
+ id: string;
1454
+ ok: true;
1455
+ result?: unknown;
1456
+ }, {
1457
+ type: "response";
1458
+ id: string;
1459
+ ok: true;
1460
+ result?: unknown;
1461
+ }>;
1462
+ export type HostSuccessResponse = z.infer<typeof HostSuccessResponseSchema>;
1463
+ export declare const HostErrorResponseSchema: z.ZodObject<{
1464
+ type: z.ZodLiteral<"response">;
1465
+ id: z.ZodString;
1466
+ ok: z.ZodLiteral<false>;
1467
+ error: z.ZodObject<{
1468
+ code: z.ZodEnum<["INVALID_REQUEST", "UNSUPPORTED_VERSION", "WORKSPACE_DENIED", "SESSION_NOT_FOUND", "APPROVAL_STALE", "BUSY", "INTERNAL_ERROR"]>;
1469
+ message: z.ZodString;
1470
+ }, "strip", z.ZodTypeAny, {
1471
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1472
+ message: string;
1473
+ }, {
1474
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1475
+ message: string;
1476
+ }>;
1477
+ }, "strip", z.ZodTypeAny, {
1478
+ type: "response";
1479
+ id: string;
1480
+ error: {
1481
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1482
+ message: string;
1483
+ };
1484
+ ok: false;
1485
+ }, {
1486
+ type: "response";
1487
+ id: string;
1488
+ error: {
1489
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1490
+ message: string;
1491
+ };
1492
+ ok: false;
1493
+ }>;
1494
+ export type HostErrorResponse = z.infer<typeof HostErrorResponseSchema>;
1495
+ export declare const HostResponseSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
1496
+ type: z.ZodLiteral<"response">;
1497
+ id: z.ZodString;
1498
+ ok: z.ZodLiteral<true>;
1499
+ result: z.ZodOptional<z.ZodUnknown>;
1500
+ }, "strip", z.ZodTypeAny, {
1501
+ type: "response";
1502
+ id: string;
1503
+ ok: true;
1504
+ result?: unknown;
1505
+ }, {
1506
+ type: "response";
1507
+ id: string;
1508
+ ok: true;
1509
+ result?: unknown;
1510
+ }>, z.ZodObject<{
1511
+ type: z.ZodLiteral<"response">;
1512
+ id: z.ZodString;
1513
+ ok: z.ZodLiteral<false>;
1514
+ error: z.ZodObject<{
1515
+ code: z.ZodEnum<["INVALID_REQUEST", "UNSUPPORTED_VERSION", "WORKSPACE_DENIED", "SESSION_NOT_FOUND", "APPROVAL_STALE", "BUSY", "INTERNAL_ERROR"]>;
1516
+ message: z.ZodString;
1517
+ }, "strip", z.ZodTypeAny, {
1518
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1519
+ message: string;
1520
+ }, {
1521
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1522
+ message: string;
1523
+ }>;
1524
+ }, "strip", z.ZodTypeAny, {
1525
+ type: "response";
1526
+ id: string;
1527
+ error: {
1528
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1529
+ message: string;
1530
+ };
1531
+ ok: false;
1532
+ }, {
1533
+ type: "response";
1534
+ id: string;
1535
+ error: {
1536
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
1537
+ message: string;
1538
+ };
1539
+ ok: false;
1540
+ }>]>;
1541
+ export type HostResponse = z.infer<typeof HostResponseSchema>;
1542
+ export declare const HostNotificationSchema: z.ZodObject<{
1543
+ type: z.ZodLiteral<"event">;
1544
+ envelope: z.ZodObject<{
1545
+ protocolVersion: z.ZodLiteral<1>;
1546
+ sessionId: z.ZodString;
1547
+ sequence: z.ZodNumber;
1548
+ timestamp: z.ZodNumber;
1549
+ event: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1550
+ type: z.ZodLiteral<"progress">;
1551
+ step: z.ZodNumber;
1552
+ maxSteps: z.ZodNumber;
1553
+ status: z.ZodString;
1554
+ timestamp: z.ZodNumber;
1555
+ }, "strip", z.ZodTypeAny, {
1556
+ type: "progress";
1557
+ status: string;
1558
+ timestamp: number;
1559
+ step: number;
1560
+ maxSteps: number;
1561
+ }, {
1562
+ type: "progress";
1563
+ status: string;
1564
+ timestamp: number;
1565
+ step: number;
1566
+ maxSteps: number;
1567
+ }>, z.ZodObject<{
1568
+ type: z.ZodLiteral<"model_change">;
1569
+ previousModelId: z.ZodOptional<z.ZodString>;
1570
+ newModelId: z.ZodString;
1571
+ reason: z.ZodEnum<["initial_selection", "fallback_rate_limit", "fallback_unavailable", "user_pinned"]>;
1572
+ accessClass: z.ZodEnum<["free_trial", "paid", "local", "unknown"]>;
1573
+ timestamp: z.ZodNumber;
1574
+ }, "strip", z.ZodTypeAny, {
1575
+ type: "model_change";
1576
+ timestamp: number;
1577
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
1578
+ newModelId: string;
1579
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
1580
+ previousModelId?: string | undefined;
1581
+ }, {
1582
+ type: "model_change";
1583
+ timestamp: number;
1584
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
1585
+ newModelId: string;
1586
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
1587
+ previousModelId?: string | undefined;
1588
+ }>, z.ZodObject<{
1589
+ type: z.ZodLiteral<"assistant_delta">;
1590
+ delta: z.ZodString;
1591
+ timestamp: z.ZodNumber;
1592
+ }, "strip", z.ZodTypeAny, {
1593
+ type: "assistant_delta";
1594
+ timestamp: number;
1595
+ delta: string;
1596
+ }, {
1597
+ type: "assistant_delta";
1598
+ timestamp: number;
1599
+ delta: string;
1600
+ }>, z.ZodObject<{
1601
+ type: z.ZodLiteral<"reasoning_delta">;
1602
+ delta: z.ZodString;
1603
+ timestamp: z.ZodNumber;
1604
+ }, "strip", z.ZodTypeAny, {
1605
+ type: "reasoning_delta";
1606
+ timestamp: number;
1607
+ delta: string;
1608
+ }, {
1609
+ type: "reasoning_delta";
1610
+ timestamp: number;
1611
+ delta: string;
1612
+ }>, z.ZodObject<{
1613
+ type: z.ZodLiteral<"tool_call_initiated">;
1614
+ toolCallId: z.ZodString;
1615
+ toolName: z.ZodString;
1616
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1617
+ timestamp: z.ZodNumber;
1618
+ }, "strip", z.ZodTypeAny, {
1619
+ type: "tool_call_initiated";
1620
+ toolName: string;
1621
+ timestamp: number;
1622
+ toolCallId: string;
1623
+ parameters: Record<string, unknown>;
1624
+ }, {
1625
+ type: "tool_call_initiated";
1626
+ toolName: string;
1627
+ timestamp: number;
1628
+ toolCallId: string;
1629
+ parameters: Record<string, unknown>;
1630
+ }>, z.ZodObject<{
1631
+ type: z.ZodLiteral<"approval_request">;
1632
+ request: z.ZodObject<{
1633
+ requestId: z.ZodString;
1634
+ toolName: z.ZodString;
1635
+ actionSummary: z.ZodString;
1636
+ exactPayload: z.ZodObject<{
1637
+ targetFile: z.ZodOptional<z.ZodString>;
1638
+ diffPreview: z.ZodOptional<z.ZodString>;
1639
+ contentPreview: z.ZodOptional<z.ZodString>;
1640
+ command: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1641
+ cwd: z.ZodOptional<z.ZodString>;
1642
+ }, "strip", z.ZodTypeAny, {
1643
+ targetFile?: string | undefined;
1644
+ diffPreview?: string | undefined;
1645
+ contentPreview?: string | undefined;
1646
+ command?: string[] | undefined;
1647
+ cwd?: string | undefined;
1648
+ }, {
1649
+ targetFile?: string | undefined;
1650
+ diffPreview?: string | undefined;
1651
+ contentPreview?: string | undefined;
1652
+ command?: string[] | undefined;
1653
+ cwd?: string | undefined;
1654
+ }>;
1655
+ timestamp: z.ZodNumber;
1656
+ }, "strip", z.ZodTypeAny, {
1657
+ requestId: string;
1658
+ toolName: string;
1659
+ actionSummary: string;
1660
+ exactPayload: {
1661
+ targetFile?: string | undefined;
1662
+ diffPreview?: string | undefined;
1663
+ contentPreview?: string | undefined;
1664
+ command?: string[] | undefined;
1665
+ cwd?: string | undefined;
1666
+ };
1667
+ timestamp: number;
1668
+ }, {
1669
+ requestId: string;
1670
+ toolName: string;
1671
+ actionSummary: string;
1672
+ exactPayload: {
1673
+ targetFile?: string | undefined;
1674
+ diffPreview?: string | undefined;
1675
+ contentPreview?: string | undefined;
1676
+ command?: string[] | undefined;
1677
+ cwd?: string | undefined;
1678
+ };
1679
+ timestamp: number;
1680
+ }>;
1681
+ timestamp: z.ZodNumber;
1682
+ }, "strip", z.ZodTypeAny, {
1683
+ type: "approval_request";
1684
+ timestamp: number;
1685
+ request: {
1686
+ requestId: string;
1687
+ toolName: string;
1688
+ actionSummary: string;
1689
+ exactPayload: {
1690
+ targetFile?: string | undefined;
1691
+ diffPreview?: string | undefined;
1692
+ contentPreview?: string | undefined;
1693
+ command?: string[] | undefined;
1694
+ cwd?: string | undefined;
1695
+ };
1696
+ timestamp: number;
1697
+ };
1698
+ }, {
1699
+ type: "approval_request";
1700
+ timestamp: number;
1701
+ request: {
1702
+ requestId: string;
1703
+ toolName: string;
1704
+ actionSummary: string;
1705
+ exactPayload: {
1706
+ targetFile?: string | undefined;
1707
+ diffPreview?: string | undefined;
1708
+ contentPreview?: string | undefined;
1709
+ command?: string[] | undefined;
1710
+ cwd?: string | undefined;
1711
+ };
1712
+ timestamp: number;
1713
+ };
1714
+ }>, z.ZodObject<{
1715
+ type: z.ZodLiteral<"approval_resolved">;
1716
+ requestId: z.ZodString;
1717
+ status: z.ZodEnum<["approved", "denied", "aborted"]>;
1718
+ reason: z.ZodOptional<z.ZodString>;
1719
+ timestamp: z.ZodNumber;
1720
+ }, "strip", z.ZodTypeAny, {
1721
+ type: "approval_resolved";
1722
+ status: "approved" | "denied" | "aborted";
1723
+ requestId: string;
1724
+ timestamp: number;
1725
+ reason?: string | undefined;
1726
+ }, {
1727
+ type: "approval_resolved";
1728
+ status: "approved" | "denied" | "aborted";
1729
+ requestId: string;
1730
+ timestamp: number;
1731
+ reason?: string | undefined;
1732
+ }>, z.ZodObject<{
1733
+ type: z.ZodLiteral<"tool_result">;
1734
+ toolCallId: z.ZodString;
1735
+ result: z.ZodObject<{
1736
+ toolName: z.ZodString;
1737
+ status: z.ZodEnum<["success", "error", "denied"]>;
1738
+ output: z.ZodString;
1739
+ truncated: z.ZodOptional<z.ZodBoolean>;
1740
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1741
+ }, "strip", z.ZodTypeAny, {
1742
+ status: "denied" | "success" | "error";
1743
+ toolName: string;
1744
+ output: string;
1745
+ truncated?: boolean | undefined;
1746
+ metadata?: Record<string, unknown> | undefined;
1747
+ }, {
1748
+ status: "denied" | "success" | "error";
1749
+ toolName: string;
1750
+ output: string;
1751
+ truncated?: boolean | undefined;
1752
+ metadata?: Record<string, unknown> | undefined;
1753
+ }>;
1754
+ timestamp: z.ZodNumber;
1755
+ }, "strip", z.ZodTypeAny, {
1756
+ type: "tool_result";
1757
+ timestamp: number;
1758
+ toolCallId: string;
1759
+ result: {
1760
+ status: "denied" | "success" | "error";
1761
+ toolName: string;
1762
+ output: string;
1763
+ truncated?: boolean | undefined;
1764
+ metadata?: Record<string, unknown> | undefined;
1765
+ };
1766
+ }, {
1767
+ type: "tool_result";
1768
+ timestamp: number;
1769
+ toolCallId: string;
1770
+ result: {
1771
+ status: "denied" | "success" | "error";
1772
+ toolName: string;
1773
+ output: string;
1774
+ truncated?: boolean | undefined;
1775
+ metadata?: Record<string, unknown> | undefined;
1776
+ };
1777
+ }>, z.ZodObject<{
1778
+ type: z.ZodLiteral<"diagnostic_result">;
1779
+ toolCallId: z.ZodString;
1780
+ diagnostics: z.ZodArray<z.ZodObject<{
1781
+ severity: z.ZodEnum<["error", "warning", "info"]>;
1782
+ message: z.ZodString;
1783
+ file: z.ZodOptional<z.ZodString>;
1784
+ line: z.ZodOptional<z.ZodNumber>;
1785
+ column: z.ZodOptional<z.ZodNumber>;
1786
+ code: z.ZodOptional<z.ZodString>;
1787
+ }, "strip", z.ZodTypeAny, {
1788
+ message: string;
1789
+ severity: "error" | "warning" | "info";
1790
+ code?: string | undefined;
1791
+ line?: number | undefined;
1792
+ column?: number | undefined;
1793
+ file?: string | undefined;
1794
+ }, {
1795
+ message: string;
1796
+ severity: "error" | "warning" | "info";
1797
+ code?: string | undefined;
1798
+ line?: number | undefined;
1799
+ column?: number | undefined;
1800
+ file?: string | undefined;
1801
+ }>, "many">;
1802
+ exitCode: z.ZodNumber;
1803
+ timestamp: z.ZodNumber;
1804
+ }, "strip", z.ZodTypeAny, {
1805
+ type: "diagnostic_result";
1806
+ timestamp: number;
1807
+ toolCallId: string;
1808
+ diagnostics: {
1809
+ message: string;
1810
+ severity: "error" | "warning" | "info";
1811
+ code?: string | undefined;
1812
+ line?: number | undefined;
1813
+ column?: number | undefined;
1814
+ file?: string | undefined;
1815
+ }[];
1816
+ exitCode: number;
1817
+ }, {
1818
+ type: "diagnostic_result";
1819
+ timestamp: number;
1820
+ toolCallId: string;
1821
+ diagnostics: {
1822
+ message: string;
1823
+ severity: "error" | "warning" | "info";
1824
+ code?: string | undefined;
1825
+ line?: number | undefined;
1826
+ column?: number | undefined;
1827
+ file?: string | undefined;
1828
+ }[];
1829
+ exitCode: number;
1830
+ }>, z.ZodObject<{
1831
+ type: z.ZodLiteral<"completion">;
1832
+ status: z.ZodEnum<["completed", "step_limit_reached", "timeout", "cancelled", "failed"]>;
1833
+ totalSteps: z.ZodNumber;
1834
+ summary: z.ZodOptional<z.ZodString>;
1835
+ timestamp: z.ZodNumber;
1836
+ }, "strip", z.ZodTypeAny, {
1837
+ type: "completion";
1838
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
1839
+ timestamp: number;
1840
+ totalSteps: number;
1841
+ summary?: string | undefined;
1842
+ }, {
1843
+ type: "completion";
1844
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
1845
+ timestamp: number;
1846
+ totalSteps: number;
1847
+ summary?: string | undefined;
1848
+ }>, z.ZodObject<{
1849
+ type: z.ZodLiteral<"session_usage">;
1850
+ totalTokens: z.ZodNumber;
1851
+ contextWindow: z.ZodOptional<z.ZodNumber>;
1852
+ modelId: z.ZodOptional<z.ZodString>;
1853
+ timestamp: z.ZodNumber;
1854
+ }, "strip", z.ZodTypeAny, {
1855
+ type: "session_usage";
1856
+ timestamp: number;
1857
+ totalTokens: number;
1858
+ modelId?: string | undefined;
1859
+ contextWindow?: number | undefined;
1860
+ }, {
1861
+ type: "session_usage";
1862
+ timestamp: number;
1863
+ totalTokens: number;
1864
+ modelId?: string | undefined;
1865
+ contextWindow?: number | undefined;
1866
+ }>, z.ZodObject<{
1867
+ type: z.ZodLiteral<"error">;
1868
+ code: z.ZodString;
1869
+ message: z.ZodString;
1870
+ recoverable: z.ZodDefault<z.ZodBoolean>;
1871
+ timestamp: z.ZodNumber;
1872
+ }, "strip", z.ZodTypeAny, {
1873
+ code: string;
1874
+ message: string;
1875
+ type: "error";
1876
+ timestamp: number;
1877
+ recoverable: boolean;
1878
+ }, {
1879
+ code: string;
1880
+ message: string;
1881
+ type: "error";
1882
+ timestamp: number;
1883
+ recoverable?: boolean | undefined;
1884
+ }>, z.ZodObject<{
1885
+ type: z.ZodLiteral<"cancellation">;
1886
+ reason: z.ZodString;
1887
+ timestamp: z.ZodNumber;
1888
+ }, "strip", z.ZodTypeAny, {
1889
+ type: "cancellation";
1890
+ timestamp: number;
1891
+ reason: string;
1892
+ }, {
1893
+ type: "cancellation";
1894
+ timestamp: number;
1895
+ reason: string;
1896
+ }>]>;
1897
+ }, "strip", z.ZodTypeAny, {
1898
+ timestamp: number;
1899
+ protocolVersion: 1;
1900
+ sessionId: string;
1901
+ sequence: number;
1902
+ event: {
1903
+ type: "progress";
1904
+ status: string;
1905
+ timestamp: number;
1906
+ step: number;
1907
+ maxSteps: number;
1908
+ } | {
1909
+ type: "model_change";
1910
+ timestamp: number;
1911
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
1912
+ newModelId: string;
1913
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
1914
+ previousModelId?: string | undefined;
1915
+ } | {
1916
+ type: "assistant_delta";
1917
+ timestamp: number;
1918
+ delta: string;
1919
+ } | {
1920
+ type: "reasoning_delta";
1921
+ timestamp: number;
1922
+ delta: string;
1923
+ } | {
1924
+ type: "tool_call_initiated";
1925
+ toolName: string;
1926
+ timestamp: number;
1927
+ toolCallId: string;
1928
+ parameters: Record<string, unknown>;
1929
+ } | {
1930
+ type: "approval_request";
1931
+ timestamp: number;
1932
+ request: {
1933
+ requestId: string;
1934
+ toolName: string;
1935
+ actionSummary: string;
1936
+ exactPayload: {
1937
+ targetFile?: string | undefined;
1938
+ diffPreview?: string | undefined;
1939
+ contentPreview?: string | undefined;
1940
+ command?: string[] | undefined;
1941
+ cwd?: string | undefined;
1942
+ };
1943
+ timestamp: number;
1944
+ };
1945
+ } | {
1946
+ type: "approval_resolved";
1947
+ status: "approved" | "denied" | "aborted";
1948
+ requestId: string;
1949
+ timestamp: number;
1950
+ reason?: string | undefined;
1951
+ } | {
1952
+ type: "tool_result";
1953
+ timestamp: number;
1954
+ toolCallId: string;
1955
+ result: {
1956
+ status: "denied" | "success" | "error";
1957
+ toolName: string;
1958
+ output: string;
1959
+ truncated?: boolean | undefined;
1960
+ metadata?: Record<string, unknown> | undefined;
1961
+ };
1962
+ } | {
1963
+ type: "diagnostic_result";
1964
+ timestamp: number;
1965
+ toolCallId: string;
1966
+ diagnostics: {
1967
+ message: string;
1968
+ severity: "error" | "warning" | "info";
1969
+ code?: string | undefined;
1970
+ line?: number | undefined;
1971
+ column?: number | undefined;
1972
+ file?: string | undefined;
1973
+ }[];
1974
+ exitCode: number;
1975
+ } | {
1976
+ type: "completion";
1977
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
1978
+ timestamp: number;
1979
+ totalSteps: number;
1980
+ summary?: string | undefined;
1981
+ } | {
1982
+ type: "session_usage";
1983
+ timestamp: number;
1984
+ totalTokens: number;
1985
+ modelId?: string | undefined;
1986
+ contextWindow?: number | undefined;
1987
+ } | {
1988
+ code: string;
1989
+ message: string;
1990
+ type: "error";
1991
+ timestamp: number;
1992
+ recoverable: boolean;
1993
+ } | {
1994
+ type: "cancellation";
1995
+ timestamp: number;
1996
+ reason: string;
1997
+ };
1998
+ }, {
1999
+ timestamp: number;
2000
+ protocolVersion: 1;
2001
+ sessionId: string;
2002
+ sequence: number;
2003
+ event: {
2004
+ type: "progress";
2005
+ status: string;
2006
+ timestamp: number;
2007
+ step: number;
2008
+ maxSteps: number;
2009
+ } | {
2010
+ type: "model_change";
2011
+ timestamp: number;
2012
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
2013
+ newModelId: string;
2014
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
2015
+ previousModelId?: string | undefined;
2016
+ } | {
2017
+ type: "assistant_delta";
2018
+ timestamp: number;
2019
+ delta: string;
2020
+ } | {
2021
+ type: "reasoning_delta";
2022
+ timestamp: number;
2023
+ delta: string;
2024
+ } | {
2025
+ type: "tool_call_initiated";
2026
+ toolName: string;
2027
+ timestamp: number;
2028
+ toolCallId: string;
2029
+ parameters: Record<string, unknown>;
2030
+ } | {
2031
+ type: "approval_request";
2032
+ timestamp: number;
2033
+ request: {
2034
+ requestId: string;
2035
+ toolName: string;
2036
+ actionSummary: string;
2037
+ exactPayload: {
2038
+ targetFile?: string | undefined;
2039
+ diffPreview?: string | undefined;
2040
+ contentPreview?: string | undefined;
2041
+ command?: string[] | undefined;
2042
+ cwd?: string | undefined;
2043
+ };
2044
+ timestamp: number;
2045
+ };
2046
+ } | {
2047
+ type: "approval_resolved";
2048
+ status: "approved" | "denied" | "aborted";
2049
+ requestId: string;
2050
+ timestamp: number;
2051
+ reason?: string | undefined;
2052
+ } | {
2053
+ type: "tool_result";
2054
+ timestamp: number;
2055
+ toolCallId: string;
2056
+ result: {
2057
+ status: "denied" | "success" | "error";
2058
+ toolName: string;
2059
+ output: string;
2060
+ truncated?: boolean | undefined;
2061
+ metadata?: Record<string, unknown> | undefined;
2062
+ };
2063
+ } | {
2064
+ type: "diagnostic_result";
2065
+ timestamp: number;
2066
+ toolCallId: string;
2067
+ diagnostics: {
2068
+ message: string;
2069
+ severity: "error" | "warning" | "info";
2070
+ code?: string | undefined;
2071
+ line?: number | undefined;
2072
+ column?: number | undefined;
2073
+ file?: string | undefined;
2074
+ }[];
2075
+ exitCode: number;
2076
+ } | {
2077
+ type: "completion";
2078
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
2079
+ timestamp: number;
2080
+ totalSteps: number;
2081
+ summary?: string | undefined;
2082
+ } | {
2083
+ type: "session_usage";
2084
+ timestamp: number;
2085
+ totalTokens: number;
2086
+ modelId?: string | undefined;
2087
+ contextWindow?: number | undefined;
2088
+ } | {
2089
+ code: string;
2090
+ message: string;
2091
+ type: "error";
2092
+ timestamp: number;
2093
+ recoverable?: boolean | undefined;
2094
+ } | {
2095
+ type: "cancellation";
2096
+ timestamp: number;
2097
+ reason: string;
2098
+ };
2099
+ }>;
2100
+ }, "strip", z.ZodTypeAny, {
2101
+ type: "event";
2102
+ envelope: {
2103
+ timestamp: number;
2104
+ protocolVersion: 1;
2105
+ sessionId: string;
2106
+ sequence: number;
2107
+ event: {
2108
+ type: "progress";
2109
+ status: string;
2110
+ timestamp: number;
2111
+ step: number;
2112
+ maxSteps: number;
2113
+ } | {
2114
+ type: "model_change";
2115
+ timestamp: number;
2116
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
2117
+ newModelId: string;
2118
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
2119
+ previousModelId?: string | undefined;
2120
+ } | {
2121
+ type: "assistant_delta";
2122
+ timestamp: number;
2123
+ delta: string;
2124
+ } | {
2125
+ type: "reasoning_delta";
2126
+ timestamp: number;
2127
+ delta: string;
2128
+ } | {
2129
+ type: "tool_call_initiated";
2130
+ toolName: string;
2131
+ timestamp: number;
2132
+ toolCallId: string;
2133
+ parameters: Record<string, unknown>;
2134
+ } | {
2135
+ type: "approval_request";
2136
+ timestamp: number;
2137
+ request: {
2138
+ requestId: string;
2139
+ toolName: string;
2140
+ actionSummary: string;
2141
+ exactPayload: {
2142
+ targetFile?: string | undefined;
2143
+ diffPreview?: string | undefined;
2144
+ contentPreview?: string | undefined;
2145
+ command?: string[] | undefined;
2146
+ cwd?: string | undefined;
2147
+ };
2148
+ timestamp: number;
2149
+ };
2150
+ } | {
2151
+ type: "approval_resolved";
2152
+ status: "approved" | "denied" | "aborted";
2153
+ requestId: string;
2154
+ timestamp: number;
2155
+ reason?: string | undefined;
2156
+ } | {
2157
+ type: "tool_result";
2158
+ timestamp: number;
2159
+ toolCallId: string;
2160
+ result: {
2161
+ status: "denied" | "success" | "error";
2162
+ toolName: string;
2163
+ output: string;
2164
+ truncated?: boolean | undefined;
2165
+ metadata?: Record<string, unknown> | undefined;
2166
+ };
2167
+ } | {
2168
+ type: "diagnostic_result";
2169
+ timestamp: number;
2170
+ toolCallId: string;
2171
+ diagnostics: {
2172
+ message: string;
2173
+ severity: "error" | "warning" | "info";
2174
+ code?: string | undefined;
2175
+ line?: number | undefined;
2176
+ column?: number | undefined;
2177
+ file?: string | undefined;
2178
+ }[];
2179
+ exitCode: number;
2180
+ } | {
2181
+ type: "completion";
2182
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
2183
+ timestamp: number;
2184
+ totalSteps: number;
2185
+ summary?: string | undefined;
2186
+ } | {
2187
+ type: "session_usage";
2188
+ timestamp: number;
2189
+ totalTokens: number;
2190
+ modelId?: string | undefined;
2191
+ contextWindow?: number | undefined;
2192
+ } | {
2193
+ code: string;
2194
+ message: string;
2195
+ type: "error";
2196
+ timestamp: number;
2197
+ recoverable: boolean;
2198
+ } | {
2199
+ type: "cancellation";
2200
+ timestamp: number;
2201
+ reason: string;
2202
+ };
2203
+ };
2204
+ }, {
2205
+ type: "event";
2206
+ envelope: {
2207
+ timestamp: number;
2208
+ protocolVersion: 1;
2209
+ sessionId: string;
2210
+ sequence: number;
2211
+ event: {
2212
+ type: "progress";
2213
+ status: string;
2214
+ timestamp: number;
2215
+ step: number;
2216
+ maxSteps: number;
2217
+ } | {
2218
+ type: "model_change";
2219
+ timestamp: number;
2220
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
2221
+ newModelId: string;
2222
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
2223
+ previousModelId?: string | undefined;
2224
+ } | {
2225
+ type: "assistant_delta";
2226
+ timestamp: number;
2227
+ delta: string;
2228
+ } | {
2229
+ type: "reasoning_delta";
2230
+ timestamp: number;
2231
+ delta: string;
2232
+ } | {
2233
+ type: "tool_call_initiated";
2234
+ toolName: string;
2235
+ timestamp: number;
2236
+ toolCallId: string;
2237
+ parameters: Record<string, unknown>;
2238
+ } | {
2239
+ type: "approval_request";
2240
+ timestamp: number;
2241
+ request: {
2242
+ requestId: string;
2243
+ toolName: string;
2244
+ actionSummary: string;
2245
+ exactPayload: {
2246
+ targetFile?: string | undefined;
2247
+ diffPreview?: string | undefined;
2248
+ contentPreview?: string | undefined;
2249
+ command?: string[] | undefined;
2250
+ cwd?: string | undefined;
2251
+ };
2252
+ timestamp: number;
2253
+ };
2254
+ } | {
2255
+ type: "approval_resolved";
2256
+ status: "approved" | "denied" | "aborted";
2257
+ requestId: string;
2258
+ timestamp: number;
2259
+ reason?: string | undefined;
2260
+ } | {
2261
+ type: "tool_result";
2262
+ timestamp: number;
2263
+ toolCallId: string;
2264
+ result: {
2265
+ status: "denied" | "success" | "error";
2266
+ toolName: string;
2267
+ output: string;
2268
+ truncated?: boolean | undefined;
2269
+ metadata?: Record<string, unknown> | undefined;
2270
+ };
2271
+ } | {
2272
+ type: "diagnostic_result";
2273
+ timestamp: number;
2274
+ toolCallId: string;
2275
+ diagnostics: {
2276
+ message: string;
2277
+ severity: "error" | "warning" | "info";
2278
+ code?: string | undefined;
2279
+ line?: number | undefined;
2280
+ column?: number | undefined;
2281
+ file?: string | undefined;
2282
+ }[];
2283
+ exitCode: number;
2284
+ } | {
2285
+ type: "completion";
2286
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
2287
+ timestamp: number;
2288
+ totalSteps: number;
2289
+ summary?: string | undefined;
2290
+ } | {
2291
+ type: "session_usage";
2292
+ timestamp: number;
2293
+ totalTokens: number;
2294
+ modelId?: string | undefined;
2295
+ contextWindow?: number | undefined;
2296
+ } | {
2297
+ code: string;
2298
+ message: string;
2299
+ type: "error";
2300
+ timestamp: number;
2301
+ recoverable?: boolean | undefined;
2302
+ } | {
2303
+ type: "cancellation";
2304
+ timestamp: number;
2305
+ reason: string;
2306
+ };
2307
+ };
2308
+ }>;
2309
+ export type HostNotification = z.infer<typeof HostNotificationSchema>;
2310
+ export declare const HostMessageSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"method", [z.ZodObject<{
2311
+ type: z.ZodLiteral<"request">;
2312
+ id: z.ZodString;
2313
+ method: z.ZodLiteral<"initialize">;
2314
+ params: z.ZodObject<{
2315
+ protocolVersion: z.ZodLiteral<1>;
2316
+ }, "strip", z.ZodTypeAny, {
2317
+ protocolVersion: 1;
2318
+ }, {
2319
+ protocolVersion: 1;
2320
+ }>;
2321
+ }, "strip", z.ZodTypeAny, {
2322
+ params: {
2323
+ protocolVersion: 1;
2324
+ };
2325
+ type: "request";
2326
+ id: string;
2327
+ method: "initialize";
2328
+ }, {
2329
+ params: {
2330
+ protocolVersion: 1;
2331
+ };
2332
+ type: "request";
2333
+ id: string;
2334
+ method: "initialize";
2335
+ }>, z.ZodObject<{
2336
+ type: z.ZodLiteral<"request">;
2337
+ id: z.ZodString;
2338
+ method: z.ZodLiteral<"chat.send">;
2339
+ params: z.ZodObject<{
2340
+ sessionId: z.ZodString;
2341
+ text: z.ZodString;
2342
+ context: z.ZodOptional<z.ZodObject<{
2343
+ selection: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2344
+ relativePath: z.ZodEffects<z.ZodString, string, string>;
2345
+ startLine: z.ZodNumber;
2346
+ endLine: z.ZodNumber;
2347
+ text: z.ZodOptional<z.ZodString>;
2348
+ }, "strip", z.ZodTypeAny, {
2349
+ endLine: number;
2350
+ relativePath: string;
2351
+ startLine: number;
2352
+ text?: string | undefined;
2353
+ }, {
2354
+ endLine: number;
2355
+ relativePath: string;
2356
+ startLine: number;
2357
+ text?: string | undefined;
2358
+ }>, {
2359
+ endLine: number;
2360
+ relativePath: string;
2361
+ startLine: number;
2362
+ text?: string | undefined;
2363
+ }, {
2364
+ endLine: number;
2365
+ relativePath: string;
2366
+ startLine: number;
2367
+ text?: string | undefined;
2368
+ }>>;
2369
+ }, "strip", z.ZodTypeAny, {
2370
+ selection?: {
2371
+ endLine: number;
2372
+ relativePath: string;
2373
+ startLine: number;
2374
+ text?: string | undefined;
2375
+ } | undefined;
2376
+ }, {
2377
+ selection?: {
2378
+ endLine: number;
2379
+ relativePath: string;
2380
+ startLine: number;
2381
+ text?: string | undefined;
2382
+ } | undefined;
2383
+ }>>;
2384
+ /** Defaults to `act` when absent. */
2385
+ mode: z.ZodOptional<z.ZodEnum<["plan", "act"]>>;
2386
+ /**
2387
+ * Which tool categories this turn may run without asking. Sent per turn rather
2388
+ * than held as host state so a toggle flipped in the settings sheet takes
2389
+ * effect on the next message with no round trip, and so a turn can never be
2390
+ * approved by a setting the user changed while it was already running.
2391
+ * Omitted means the defaults: reads and web fetch only.
2392
+ */
2393
+ autoApprove: z.ZodOptional<z.ZodDefault<z.ZodObject<{
2394
+ read: z.ZodDefault<z.ZodBoolean>;
2395
+ edit: z.ZodDefault<z.ZodBoolean>;
2396
+ command: z.ZodDefault<z.ZodBoolean>;
2397
+ web: z.ZodDefault<z.ZodBoolean>;
2398
+ mcp: z.ZodDefault<z.ZodBoolean>;
2399
+ }, "strip", z.ZodTypeAny, {
2400
+ command: boolean;
2401
+ read: boolean;
2402
+ edit: boolean;
2403
+ web: boolean;
2404
+ mcp: boolean;
2405
+ }, {
2406
+ command?: boolean | undefined;
2407
+ read?: boolean | undefined;
2408
+ edit?: boolean | undefined;
2409
+ web?: boolean | undefined;
2410
+ mcp?: boolean | undefined;
2411
+ }>>>;
2412
+ }, "strip", z.ZodTypeAny, {
2413
+ sessionId: string;
2414
+ text: string;
2415
+ context?: {
2416
+ selection?: {
2417
+ endLine: number;
2418
+ relativePath: string;
2419
+ startLine: number;
2420
+ text?: string | undefined;
2421
+ } | undefined;
2422
+ } | undefined;
2423
+ mode?: "plan" | "act" | undefined;
2424
+ autoApprove?: {
2425
+ command: boolean;
2426
+ read: boolean;
2427
+ edit: boolean;
2428
+ web: boolean;
2429
+ mcp: boolean;
2430
+ } | undefined;
2431
+ }, {
2432
+ sessionId: string;
2433
+ text: string;
2434
+ context?: {
2435
+ selection?: {
2436
+ endLine: number;
2437
+ relativePath: string;
2438
+ startLine: number;
2439
+ text?: string | undefined;
2440
+ } | undefined;
2441
+ } | undefined;
2442
+ mode?: "plan" | "act" | undefined;
2443
+ autoApprove?: {
2444
+ command?: boolean | undefined;
2445
+ read?: boolean | undefined;
2446
+ edit?: boolean | undefined;
2447
+ web?: boolean | undefined;
2448
+ mcp?: boolean | undefined;
2449
+ } | undefined;
2450
+ }>;
2451
+ }, "strip", z.ZodTypeAny, {
2452
+ params: {
2453
+ sessionId: string;
2454
+ text: string;
2455
+ context?: {
2456
+ selection?: {
2457
+ endLine: number;
2458
+ relativePath: string;
2459
+ startLine: number;
2460
+ text?: string | undefined;
2461
+ } | undefined;
2462
+ } | undefined;
2463
+ mode?: "plan" | "act" | undefined;
2464
+ autoApprove?: {
2465
+ command: boolean;
2466
+ read: boolean;
2467
+ edit: boolean;
2468
+ web: boolean;
2469
+ mcp: boolean;
2470
+ } | undefined;
2471
+ };
2472
+ type: "request";
2473
+ id: string;
2474
+ method: "chat.send";
2475
+ }, {
2476
+ params: {
2477
+ sessionId: string;
2478
+ text: string;
2479
+ context?: {
2480
+ selection?: {
2481
+ endLine: number;
2482
+ relativePath: string;
2483
+ startLine: number;
2484
+ text?: string | undefined;
2485
+ } | undefined;
2486
+ } | undefined;
2487
+ mode?: "plan" | "act" | undefined;
2488
+ autoApprove?: {
2489
+ command?: boolean | undefined;
2490
+ read?: boolean | undefined;
2491
+ edit?: boolean | undefined;
2492
+ web?: boolean | undefined;
2493
+ mcp?: boolean | undefined;
2494
+ } | undefined;
2495
+ };
2496
+ type: "request";
2497
+ id: string;
2498
+ method: "chat.send";
2499
+ }>, z.ZodObject<{
2500
+ type: z.ZodLiteral<"request">;
2501
+ id: z.ZodString;
2502
+ method: z.ZodLiteral<"chat.cancel">;
2503
+ params: z.ZodObject<{
2504
+ sessionId: z.ZodString;
2505
+ /** Omit to abort whichever generation is currently in flight. */
2506
+ targetRequestId: z.ZodOptional<z.ZodString>;
2507
+ }, "strip", z.ZodTypeAny, {
2508
+ sessionId: string;
2509
+ targetRequestId?: string | undefined;
2510
+ }, {
2511
+ sessionId: string;
2512
+ targetRequestId?: string | undefined;
2513
+ }>;
2514
+ }, "strip", z.ZodTypeAny, {
2515
+ params: {
2516
+ sessionId: string;
2517
+ targetRequestId?: string | undefined;
2518
+ };
2519
+ type: "request";
2520
+ id: string;
2521
+ method: "chat.cancel";
2522
+ }, {
2523
+ params: {
2524
+ sessionId: string;
2525
+ targetRequestId?: string | undefined;
2526
+ };
2527
+ type: "request";
2528
+ id: string;
2529
+ method: "chat.cancel";
2530
+ }>, z.ZodObject<{
2531
+ type: z.ZodLiteral<"request">;
2532
+ id: z.ZodString;
2533
+ method: z.ZodLiteral<"approval.respond">;
2534
+ params: z.ZodObject<{
2535
+ sessionId: z.ZodString;
2536
+ requestId: z.ZodString;
2537
+ status: z.ZodEnum<["approved", "denied", "aborted"]>;
2538
+ }, "strip", z.ZodTypeAny, {
2539
+ status: "approved" | "denied" | "aborted";
2540
+ requestId: string;
2541
+ sessionId: string;
2542
+ }, {
2543
+ status: "approved" | "denied" | "aborted";
2544
+ requestId: string;
2545
+ sessionId: string;
2546
+ }>;
2547
+ }, "strip", z.ZodTypeAny, {
2548
+ params: {
2549
+ status: "approved" | "denied" | "aborted";
2550
+ requestId: string;
2551
+ sessionId: string;
2552
+ };
2553
+ type: "request";
2554
+ id: string;
2555
+ method: "approval.respond";
2556
+ }, {
2557
+ params: {
2558
+ status: "approved" | "denied" | "aborted";
2559
+ requestId: string;
2560
+ sessionId: string;
2561
+ };
2562
+ type: "request";
2563
+ id: string;
2564
+ method: "approval.respond";
2565
+ }>, z.ZodObject<{
2566
+ type: z.ZodLiteral<"request">;
2567
+ id: z.ZodString;
2568
+ method: z.ZodLiteral<"session.new">;
2569
+ params: z.ZodObject<{
2570
+ sessionId: z.ZodString;
2571
+ }, "strip", z.ZodTypeAny, {
2572
+ sessionId: string;
2573
+ }, {
2574
+ sessionId: string;
2575
+ }>;
2576
+ }, "strip", z.ZodTypeAny, {
2577
+ params: {
2578
+ sessionId: string;
2579
+ };
2580
+ type: "request";
2581
+ id: string;
2582
+ method: "session.new";
2583
+ }, {
2584
+ params: {
2585
+ sessionId: string;
2586
+ };
2587
+ type: "request";
2588
+ id: string;
2589
+ method: "session.new";
2590
+ }>, z.ZodObject<{
2591
+ type: z.ZodLiteral<"request">;
2592
+ id: z.ZodString;
2593
+ method: z.ZodLiteral<"session.resume">;
2594
+ params: z.ZodObject<{
2595
+ sessionId: z.ZodString;
2596
+ targetSessionId: z.ZodString;
2597
+ }, "strip", z.ZodTypeAny, {
2598
+ sessionId: string;
2599
+ targetSessionId: string;
2600
+ }, {
2601
+ sessionId: string;
2602
+ targetSessionId: string;
2603
+ }>;
2604
+ }, "strip", z.ZodTypeAny, {
2605
+ params: {
2606
+ sessionId: string;
2607
+ targetSessionId: string;
2608
+ };
2609
+ type: "request";
2610
+ id: string;
2611
+ method: "session.resume";
2612
+ }, {
2613
+ params: {
2614
+ sessionId: string;
2615
+ targetSessionId: string;
2616
+ };
2617
+ type: "request";
2618
+ id: string;
2619
+ method: "session.resume";
2620
+ }>, z.ZodObject<{
2621
+ type: z.ZodLiteral<"request">;
2622
+ id: z.ZodString;
2623
+ method: z.ZodLiteral<"session.delete">;
2624
+ params: z.ZodObject<{
2625
+ sessionId: z.ZodString;
2626
+ targetSessionIds: z.ZodArray<z.ZodString, "many">;
2627
+ }, "strip", z.ZodTypeAny, {
2628
+ sessionId: string;
2629
+ targetSessionIds: string[];
2630
+ }, {
2631
+ sessionId: string;
2632
+ targetSessionIds: string[];
2633
+ }>;
2634
+ }, "strip", z.ZodTypeAny, {
2635
+ params: {
2636
+ sessionId: string;
2637
+ targetSessionIds: string[];
2638
+ };
2639
+ type: "request";
2640
+ id: string;
2641
+ method: "session.delete";
2642
+ }, {
2643
+ params: {
2644
+ sessionId: string;
2645
+ targetSessionIds: string[];
2646
+ };
2647
+ type: "request";
2648
+ id: string;
2649
+ method: "session.delete";
2650
+ }>, z.ZodObject<{
2651
+ type: z.ZodLiteral<"request">;
2652
+ id: z.ZodString;
2653
+ method: z.ZodLiteral<"provider.list">;
2654
+ params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
2655
+ }, "strip", z.ZodTypeAny, {
2656
+ params: {};
2657
+ type: "request";
2658
+ id: string;
2659
+ method: "provider.list";
2660
+ }, {
2661
+ params: {};
2662
+ type: "request";
2663
+ id: string;
2664
+ method: "provider.list";
2665
+ }>, z.ZodObject<{
2666
+ type: z.ZodLiteral<"request">;
2667
+ id: z.ZodString;
2668
+ method: z.ZodLiteral<"provider.connect">;
2669
+ params: z.ZodObject<{
2670
+ providerId: z.ZodString;
2671
+ /** Absent means "activate a provider whose key is already stored". */
2672
+ apiKey: z.ZodOptional<z.ZodString>;
2673
+ }, "strip", z.ZodTypeAny, {
2674
+ providerId: string;
2675
+ apiKey?: string | undefined;
2676
+ }, {
2677
+ providerId: string;
2678
+ apiKey?: string | undefined;
2679
+ }>;
2680
+ }, "strip", z.ZodTypeAny, {
2681
+ params: {
2682
+ providerId: string;
2683
+ apiKey?: string | undefined;
2684
+ };
2685
+ type: "request";
2686
+ id: string;
2687
+ method: "provider.connect";
2688
+ }, {
2689
+ params: {
2690
+ providerId: string;
2691
+ apiKey?: string | undefined;
2692
+ };
2693
+ type: "request";
2694
+ id: string;
2695
+ method: "provider.connect";
2696
+ }>, z.ZodObject<{
2697
+ type: z.ZodLiteral<"request">;
2698
+ id: z.ZodString;
2699
+ method: z.ZodLiteral<"model.list">;
2700
+ params: z.ZodObject<{
2701
+ providerId: z.ZodOptional<z.ZodString>;
2702
+ /**
2703
+ * Bypass the provider adapter's catalog cache. Adapters memoise `/models`
2704
+ * (NVIDIA NIM for 15 minutes) and the sidecar is a long-lived process, so
2705
+ * without this the list is frozen for the whole session and the user has no
2706
+ * way to pick up a newly published model.
2707
+ */
2708
+ refresh: z.ZodOptional<z.ZodBoolean>;
2709
+ }, "strip", z.ZodTypeAny, {
2710
+ providerId?: string | undefined;
2711
+ refresh?: boolean | undefined;
2712
+ }, {
2713
+ providerId?: string | undefined;
2714
+ refresh?: boolean | undefined;
2715
+ }>;
2716
+ }, "strip", z.ZodTypeAny, {
2717
+ params: {
2718
+ providerId?: string | undefined;
2719
+ refresh?: boolean | undefined;
2720
+ };
2721
+ type: "request";
2722
+ id: string;
2723
+ method: "model.list";
2724
+ }, {
2725
+ params: {
2726
+ providerId?: string | undefined;
2727
+ refresh?: boolean | undefined;
2728
+ };
2729
+ type: "request";
2730
+ id: string;
2731
+ method: "model.list";
2732
+ }>]>, z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
2733
+ type: z.ZodLiteral<"response">;
2734
+ id: z.ZodString;
2735
+ ok: z.ZodLiteral<true>;
2736
+ result: z.ZodOptional<z.ZodUnknown>;
2737
+ }, "strip", z.ZodTypeAny, {
2738
+ type: "response";
2739
+ id: string;
2740
+ ok: true;
2741
+ result?: unknown;
2742
+ }, {
2743
+ type: "response";
2744
+ id: string;
2745
+ ok: true;
2746
+ result?: unknown;
2747
+ }>, z.ZodObject<{
2748
+ type: z.ZodLiteral<"response">;
2749
+ id: z.ZodString;
2750
+ ok: z.ZodLiteral<false>;
2751
+ error: z.ZodObject<{
2752
+ code: z.ZodEnum<["INVALID_REQUEST", "UNSUPPORTED_VERSION", "WORKSPACE_DENIED", "SESSION_NOT_FOUND", "APPROVAL_STALE", "BUSY", "INTERNAL_ERROR"]>;
2753
+ message: z.ZodString;
2754
+ }, "strip", z.ZodTypeAny, {
2755
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
2756
+ message: string;
2757
+ }, {
2758
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
2759
+ message: string;
2760
+ }>;
2761
+ }, "strip", z.ZodTypeAny, {
2762
+ type: "response";
2763
+ id: string;
2764
+ error: {
2765
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
2766
+ message: string;
2767
+ };
2768
+ ok: false;
2769
+ }, {
2770
+ type: "response";
2771
+ id: string;
2772
+ error: {
2773
+ code: "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "WORKSPACE_DENIED" | "SESSION_NOT_FOUND" | "APPROVAL_STALE" | "BUSY" | "INTERNAL_ERROR";
2774
+ message: string;
2775
+ };
2776
+ ok: false;
2777
+ }>]>, z.ZodObject<{
2778
+ type: z.ZodLiteral<"event">;
2779
+ envelope: z.ZodObject<{
2780
+ protocolVersion: z.ZodLiteral<1>;
2781
+ sessionId: z.ZodString;
2782
+ sequence: z.ZodNumber;
2783
+ timestamp: z.ZodNumber;
2784
+ event: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2785
+ type: z.ZodLiteral<"progress">;
2786
+ step: z.ZodNumber;
2787
+ maxSteps: z.ZodNumber;
2788
+ status: z.ZodString;
2789
+ timestamp: z.ZodNumber;
2790
+ }, "strip", z.ZodTypeAny, {
2791
+ type: "progress";
2792
+ status: string;
2793
+ timestamp: number;
2794
+ step: number;
2795
+ maxSteps: number;
2796
+ }, {
2797
+ type: "progress";
2798
+ status: string;
2799
+ timestamp: number;
2800
+ step: number;
2801
+ maxSteps: number;
2802
+ }>, z.ZodObject<{
2803
+ type: z.ZodLiteral<"model_change">;
2804
+ previousModelId: z.ZodOptional<z.ZodString>;
2805
+ newModelId: z.ZodString;
2806
+ reason: z.ZodEnum<["initial_selection", "fallback_rate_limit", "fallback_unavailable", "user_pinned"]>;
2807
+ accessClass: z.ZodEnum<["free_trial", "paid", "local", "unknown"]>;
2808
+ timestamp: z.ZodNumber;
2809
+ }, "strip", z.ZodTypeAny, {
2810
+ type: "model_change";
2811
+ timestamp: number;
2812
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
2813
+ newModelId: string;
2814
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
2815
+ previousModelId?: string | undefined;
2816
+ }, {
2817
+ type: "model_change";
2818
+ timestamp: number;
2819
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
2820
+ newModelId: string;
2821
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
2822
+ previousModelId?: string | undefined;
2823
+ }>, z.ZodObject<{
2824
+ type: z.ZodLiteral<"assistant_delta">;
2825
+ delta: z.ZodString;
2826
+ timestamp: z.ZodNumber;
2827
+ }, "strip", z.ZodTypeAny, {
2828
+ type: "assistant_delta";
2829
+ timestamp: number;
2830
+ delta: string;
2831
+ }, {
2832
+ type: "assistant_delta";
2833
+ timestamp: number;
2834
+ delta: string;
2835
+ }>, z.ZodObject<{
2836
+ type: z.ZodLiteral<"reasoning_delta">;
2837
+ delta: z.ZodString;
2838
+ timestamp: z.ZodNumber;
2839
+ }, "strip", z.ZodTypeAny, {
2840
+ type: "reasoning_delta";
2841
+ timestamp: number;
2842
+ delta: string;
2843
+ }, {
2844
+ type: "reasoning_delta";
2845
+ timestamp: number;
2846
+ delta: string;
2847
+ }>, z.ZodObject<{
2848
+ type: z.ZodLiteral<"tool_call_initiated">;
2849
+ toolCallId: z.ZodString;
2850
+ toolName: z.ZodString;
2851
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2852
+ timestamp: z.ZodNumber;
2853
+ }, "strip", z.ZodTypeAny, {
2854
+ type: "tool_call_initiated";
2855
+ toolName: string;
2856
+ timestamp: number;
2857
+ toolCallId: string;
2858
+ parameters: Record<string, unknown>;
2859
+ }, {
2860
+ type: "tool_call_initiated";
2861
+ toolName: string;
2862
+ timestamp: number;
2863
+ toolCallId: string;
2864
+ parameters: Record<string, unknown>;
2865
+ }>, z.ZodObject<{
2866
+ type: z.ZodLiteral<"approval_request">;
2867
+ request: z.ZodObject<{
2868
+ requestId: z.ZodString;
2869
+ toolName: z.ZodString;
2870
+ actionSummary: z.ZodString;
2871
+ exactPayload: z.ZodObject<{
2872
+ targetFile: z.ZodOptional<z.ZodString>;
2873
+ diffPreview: z.ZodOptional<z.ZodString>;
2874
+ contentPreview: z.ZodOptional<z.ZodString>;
2875
+ command: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2876
+ cwd: z.ZodOptional<z.ZodString>;
2877
+ }, "strip", z.ZodTypeAny, {
2878
+ targetFile?: string | undefined;
2879
+ diffPreview?: string | undefined;
2880
+ contentPreview?: string | undefined;
2881
+ command?: string[] | undefined;
2882
+ cwd?: string | undefined;
2883
+ }, {
2884
+ targetFile?: string | undefined;
2885
+ diffPreview?: string | undefined;
2886
+ contentPreview?: string | undefined;
2887
+ command?: string[] | undefined;
2888
+ cwd?: string | undefined;
2889
+ }>;
2890
+ timestamp: z.ZodNumber;
2891
+ }, "strip", z.ZodTypeAny, {
2892
+ requestId: string;
2893
+ toolName: string;
2894
+ actionSummary: string;
2895
+ exactPayload: {
2896
+ targetFile?: string | undefined;
2897
+ diffPreview?: string | undefined;
2898
+ contentPreview?: string | undefined;
2899
+ command?: string[] | undefined;
2900
+ cwd?: string | undefined;
2901
+ };
2902
+ timestamp: number;
2903
+ }, {
2904
+ requestId: string;
2905
+ toolName: string;
2906
+ actionSummary: string;
2907
+ exactPayload: {
2908
+ targetFile?: string | undefined;
2909
+ diffPreview?: string | undefined;
2910
+ contentPreview?: string | undefined;
2911
+ command?: string[] | undefined;
2912
+ cwd?: string | undefined;
2913
+ };
2914
+ timestamp: number;
2915
+ }>;
2916
+ timestamp: z.ZodNumber;
2917
+ }, "strip", z.ZodTypeAny, {
2918
+ type: "approval_request";
2919
+ timestamp: number;
2920
+ request: {
2921
+ requestId: string;
2922
+ toolName: string;
2923
+ actionSummary: string;
2924
+ exactPayload: {
2925
+ targetFile?: string | undefined;
2926
+ diffPreview?: string | undefined;
2927
+ contentPreview?: string | undefined;
2928
+ command?: string[] | undefined;
2929
+ cwd?: string | undefined;
2930
+ };
2931
+ timestamp: number;
2932
+ };
2933
+ }, {
2934
+ type: "approval_request";
2935
+ timestamp: number;
2936
+ request: {
2937
+ requestId: string;
2938
+ toolName: string;
2939
+ actionSummary: string;
2940
+ exactPayload: {
2941
+ targetFile?: string | undefined;
2942
+ diffPreview?: string | undefined;
2943
+ contentPreview?: string | undefined;
2944
+ command?: string[] | undefined;
2945
+ cwd?: string | undefined;
2946
+ };
2947
+ timestamp: number;
2948
+ };
2949
+ }>, z.ZodObject<{
2950
+ type: z.ZodLiteral<"approval_resolved">;
2951
+ requestId: z.ZodString;
2952
+ status: z.ZodEnum<["approved", "denied", "aborted"]>;
2953
+ reason: z.ZodOptional<z.ZodString>;
2954
+ timestamp: z.ZodNumber;
2955
+ }, "strip", z.ZodTypeAny, {
2956
+ type: "approval_resolved";
2957
+ status: "approved" | "denied" | "aborted";
2958
+ requestId: string;
2959
+ timestamp: number;
2960
+ reason?: string | undefined;
2961
+ }, {
2962
+ type: "approval_resolved";
2963
+ status: "approved" | "denied" | "aborted";
2964
+ requestId: string;
2965
+ timestamp: number;
2966
+ reason?: string | undefined;
2967
+ }>, z.ZodObject<{
2968
+ type: z.ZodLiteral<"tool_result">;
2969
+ toolCallId: z.ZodString;
2970
+ result: z.ZodObject<{
2971
+ toolName: z.ZodString;
2972
+ status: z.ZodEnum<["success", "error", "denied"]>;
2973
+ output: z.ZodString;
2974
+ truncated: z.ZodOptional<z.ZodBoolean>;
2975
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2976
+ }, "strip", z.ZodTypeAny, {
2977
+ status: "denied" | "success" | "error";
2978
+ toolName: string;
2979
+ output: string;
2980
+ truncated?: boolean | undefined;
2981
+ metadata?: Record<string, unknown> | undefined;
2982
+ }, {
2983
+ status: "denied" | "success" | "error";
2984
+ toolName: string;
2985
+ output: string;
2986
+ truncated?: boolean | undefined;
2987
+ metadata?: Record<string, unknown> | undefined;
2988
+ }>;
2989
+ timestamp: z.ZodNumber;
2990
+ }, "strip", z.ZodTypeAny, {
2991
+ type: "tool_result";
2992
+ timestamp: number;
2993
+ toolCallId: string;
2994
+ result: {
2995
+ status: "denied" | "success" | "error";
2996
+ toolName: string;
2997
+ output: string;
2998
+ truncated?: boolean | undefined;
2999
+ metadata?: Record<string, unknown> | undefined;
3000
+ };
3001
+ }, {
3002
+ type: "tool_result";
3003
+ timestamp: number;
3004
+ toolCallId: string;
3005
+ result: {
3006
+ status: "denied" | "success" | "error";
3007
+ toolName: string;
3008
+ output: string;
3009
+ truncated?: boolean | undefined;
3010
+ metadata?: Record<string, unknown> | undefined;
3011
+ };
3012
+ }>, z.ZodObject<{
3013
+ type: z.ZodLiteral<"diagnostic_result">;
3014
+ toolCallId: z.ZodString;
3015
+ diagnostics: z.ZodArray<z.ZodObject<{
3016
+ severity: z.ZodEnum<["error", "warning", "info"]>;
3017
+ message: z.ZodString;
3018
+ file: z.ZodOptional<z.ZodString>;
3019
+ line: z.ZodOptional<z.ZodNumber>;
3020
+ column: z.ZodOptional<z.ZodNumber>;
3021
+ code: z.ZodOptional<z.ZodString>;
3022
+ }, "strip", z.ZodTypeAny, {
3023
+ message: string;
3024
+ severity: "error" | "warning" | "info";
3025
+ code?: string | undefined;
3026
+ line?: number | undefined;
3027
+ column?: number | undefined;
3028
+ file?: string | undefined;
3029
+ }, {
3030
+ message: string;
3031
+ severity: "error" | "warning" | "info";
3032
+ code?: string | undefined;
3033
+ line?: number | undefined;
3034
+ column?: number | undefined;
3035
+ file?: string | undefined;
3036
+ }>, "many">;
3037
+ exitCode: z.ZodNumber;
3038
+ timestamp: z.ZodNumber;
3039
+ }, "strip", z.ZodTypeAny, {
3040
+ type: "diagnostic_result";
3041
+ timestamp: number;
3042
+ toolCallId: string;
3043
+ diagnostics: {
3044
+ message: string;
3045
+ severity: "error" | "warning" | "info";
3046
+ code?: string | undefined;
3047
+ line?: number | undefined;
3048
+ column?: number | undefined;
3049
+ file?: string | undefined;
3050
+ }[];
3051
+ exitCode: number;
3052
+ }, {
3053
+ type: "diagnostic_result";
3054
+ timestamp: number;
3055
+ toolCallId: string;
3056
+ diagnostics: {
3057
+ message: string;
3058
+ severity: "error" | "warning" | "info";
3059
+ code?: string | undefined;
3060
+ line?: number | undefined;
3061
+ column?: number | undefined;
3062
+ file?: string | undefined;
3063
+ }[];
3064
+ exitCode: number;
3065
+ }>, z.ZodObject<{
3066
+ type: z.ZodLiteral<"completion">;
3067
+ status: z.ZodEnum<["completed", "step_limit_reached", "timeout", "cancelled", "failed"]>;
3068
+ totalSteps: z.ZodNumber;
3069
+ summary: z.ZodOptional<z.ZodString>;
3070
+ timestamp: z.ZodNumber;
3071
+ }, "strip", z.ZodTypeAny, {
3072
+ type: "completion";
3073
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
3074
+ timestamp: number;
3075
+ totalSteps: number;
3076
+ summary?: string | undefined;
3077
+ }, {
3078
+ type: "completion";
3079
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
3080
+ timestamp: number;
3081
+ totalSteps: number;
3082
+ summary?: string | undefined;
3083
+ }>, z.ZodObject<{
3084
+ type: z.ZodLiteral<"session_usage">;
3085
+ totalTokens: z.ZodNumber;
3086
+ contextWindow: z.ZodOptional<z.ZodNumber>;
3087
+ modelId: z.ZodOptional<z.ZodString>;
3088
+ timestamp: z.ZodNumber;
3089
+ }, "strip", z.ZodTypeAny, {
3090
+ type: "session_usage";
3091
+ timestamp: number;
3092
+ totalTokens: number;
3093
+ modelId?: string | undefined;
3094
+ contextWindow?: number | undefined;
3095
+ }, {
3096
+ type: "session_usage";
3097
+ timestamp: number;
3098
+ totalTokens: number;
3099
+ modelId?: string | undefined;
3100
+ contextWindow?: number | undefined;
3101
+ }>, z.ZodObject<{
3102
+ type: z.ZodLiteral<"error">;
3103
+ code: z.ZodString;
3104
+ message: z.ZodString;
3105
+ recoverable: z.ZodDefault<z.ZodBoolean>;
3106
+ timestamp: z.ZodNumber;
3107
+ }, "strip", z.ZodTypeAny, {
3108
+ code: string;
3109
+ message: string;
3110
+ type: "error";
3111
+ timestamp: number;
3112
+ recoverable: boolean;
3113
+ }, {
3114
+ code: string;
3115
+ message: string;
3116
+ type: "error";
3117
+ timestamp: number;
3118
+ recoverable?: boolean | undefined;
3119
+ }>, z.ZodObject<{
3120
+ type: z.ZodLiteral<"cancellation">;
3121
+ reason: z.ZodString;
3122
+ timestamp: z.ZodNumber;
3123
+ }, "strip", z.ZodTypeAny, {
3124
+ type: "cancellation";
3125
+ timestamp: number;
3126
+ reason: string;
3127
+ }, {
3128
+ type: "cancellation";
3129
+ timestamp: number;
3130
+ reason: string;
3131
+ }>]>;
3132
+ }, "strip", z.ZodTypeAny, {
3133
+ timestamp: number;
3134
+ protocolVersion: 1;
3135
+ sessionId: string;
3136
+ sequence: number;
3137
+ event: {
3138
+ type: "progress";
3139
+ status: string;
3140
+ timestamp: number;
3141
+ step: number;
3142
+ maxSteps: number;
3143
+ } | {
3144
+ type: "model_change";
3145
+ timestamp: number;
3146
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
3147
+ newModelId: string;
3148
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
3149
+ previousModelId?: string | undefined;
3150
+ } | {
3151
+ type: "assistant_delta";
3152
+ timestamp: number;
3153
+ delta: string;
3154
+ } | {
3155
+ type: "reasoning_delta";
3156
+ timestamp: number;
3157
+ delta: string;
3158
+ } | {
3159
+ type: "tool_call_initiated";
3160
+ toolName: string;
3161
+ timestamp: number;
3162
+ toolCallId: string;
3163
+ parameters: Record<string, unknown>;
3164
+ } | {
3165
+ type: "approval_request";
3166
+ timestamp: number;
3167
+ request: {
3168
+ requestId: string;
3169
+ toolName: string;
3170
+ actionSummary: string;
3171
+ exactPayload: {
3172
+ targetFile?: string | undefined;
3173
+ diffPreview?: string | undefined;
3174
+ contentPreview?: string | undefined;
3175
+ command?: string[] | undefined;
3176
+ cwd?: string | undefined;
3177
+ };
3178
+ timestamp: number;
3179
+ };
3180
+ } | {
3181
+ type: "approval_resolved";
3182
+ status: "approved" | "denied" | "aborted";
3183
+ requestId: string;
3184
+ timestamp: number;
3185
+ reason?: string | undefined;
3186
+ } | {
3187
+ type: "tool_result";
3188
+ timestamp: number;
3189
+ toolCallId: string;
3190
+ result: {
3191
+ status: "denied" | "success" | "error";
3192
+ toolName: string;
3193
+ output: string;
3194
+ truncated?: boolean | undefined;
3195
+ metadata?: Record<string, unknown> | undefined;
3196
+ };
3197
+ } | {
3198
+ type: "diagnostic_result";
3199
+ timestamp: number;
3200
+ toolCallId: string;
3201
+ diagnostics: {
3202
+ message: string;
3203
+ severity: "error" | "warning" | "info";
3204
+ code?: string | undefined;
3205
+ line?: number | undefined;
3206
+ column?: number | undefined;
3207
+ file?: string | undefined;
3208
+ }[];
3209
+ exitCode: number;
3210
+ } | {
3211
+ type: "completion";
3212
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
3213
+ timestamp: number;
3214
+ totalSteps: number;
3215
+ summary?: string | undefined;
3216
+ } | {
3217
+ type: "session_usage";
3218
+ timestamp: number;
3219
+ totalTokens: number;
3220
+ modelId?: string | undefined;
3221
+ contextWindow?: number | undefined;
3222
+ } | {
3223
+ code: string;
3224
+ message: string;
3225
+ type: "error";
3226
+ timestamp: number;
3227
+ recoverable: boolean;
3228
+ } | {
3229
+ type: "cancellation";
3230
+ timestamp: number;
3231
+ reason: string;
3232
+ };
3233
+ }, {
3234
+ timestamp: number;
3235
+ protocolVersion: 1;
3236
+ sessionId: string;
3237
+ sequence: number;
3238
+ event: {
3239
+ type: "progress";
3240
+ status: string;
3241
+ timestamp: number;
3242
+ step: number;
3243
+ maxSteps: number;
3244
+ } | {
3245
+ type: "model_change";
3246
+ timestamp: number;
3247
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
3248
+ newModelId: string;
3249
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
3250
+ previousModelId?: string | undefined;
3251
+ } | {
3252
+ type: "assistant_delta";
3253
+ timestamp: number;
3254
+ delta: string;
3255
+ } | {
3256
+ type: "reasoning_delta";
3257
+ timestamp: number;
3258
+ delta: string;
3259
+ } | {
3260
+ type: "tool_call_initiated";
3261
+ toolName: string;
3262
+ timestamp: number;
3263
+ toolCallId: string;
3264
+ parameters: Record<string, unknown>;
3265
+ } | {
3266
+ type: "approval_request";
3267
+ timestamp: number;
3268
+ request: {
3269
+ requestId: string;
3270
+ toolName: string;
3271
+ actionSummary: string;
3272
+ exactPayload: {
3273
+ targetFile?: string | undefined;
3274
+ diffPreview?: string | undefined;
3275
+ contentPreview?: string | undefined;
3276
+ command?: string[] | undefined;
3277
+ cwd?: string | undefined;
3278
+ };
3279
+ timestamp: number;
3280
+ };
3281
+ } | {
3282
+ type: "approval_resolved";
3283
+ status: "approved" | "denied" | "aborted";
3284
+ requestId: string;
3285
+ timestamp: number;
3286
+ reason?: string | undefined;
3287
+ } | {
3288
+ type: "tool_result";
3289
+ timestamp: number;
3290
+ toolCallId: string;
3291
+ result: {
3292
+ status: "denied" | "success" | "error";
3293
+ toolName: string;
3294
+ output: string;
3295
+ truncated?: boolean | undefined;
3296
+ metadata?: Record<string, unknown> | undefined;
3297
+ };
3298
+ } | {
3299
+ type: "diagnostic_result";
3300
+ timestamp: number;
3301
+ toolCallId: string;
3302
+ diagnostics: {
3303
+ message: string;
3304
+ severity: "error" | "warning" | "info";
3305
+ code?: string | undefined;
3306
+ line?: number | undefined;
3307
+ column?: number | undefined;
3308
+ file?: string | undefined;
3309
+ }[];
3310
+ exitCode: number;
3311
+ } | {
3312
+ type: "completion";
3313
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
3314
+ timestamp: number;
3315
+ totalSteps: number;
3316
+ summary?: string | undefined;
3317
+ } | {
3318
+ type: "session_usage";
3319
+ timestamp: number;
3320
+ totalTokens: number;
3321
+ modelId?: string | undefined;
3322
+ contextWindow?: number | undefined;
3323
+ } | {
3324
+ code: string;
3325
+ message: string;
3326
+ type: "error";
3327
+ timestamp: number;
3328
+ recoverable?: boolean | undefined;
3329
+ } | {
3330
+ type: "cancellation";
3331
+ timestamp: number;
3332
+ reason: string;
3333
+ };
3334
+ }>;
3335
+ }, "strip", z.ZodTypeAny, {
3336
+ type: "event";
3337
+ envelope: {
3338
+ timestamp: number;
3339
+ protocolVersion: 1;
3340
+ sessionId: string;
3341
+ sequence: number;
3342
+ event: {
3343
+ type: "progress";
3344
+ status: string;
3345
+ timestamp: number;
3346
+ step: number;
3347
+ maxSteps: number;
3348
+ } | {
3349
+ type: "model_change";
3350
+ timestamp: number;
3351
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
3352
+ newModelId: string;
3353
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
3354
+ previousModelId?: string | undefined;
3355
+ } | {
3356
+ type: "assistant_delta";
3357
+ timestamp: number;
3358
+ delta: string;
3359
+ } | {
3360
+ type: "reasoning_delta";
3361
+ timestamp: number;
3362
+ delta: string;
3363
+ } | {
3364
+ type: "tool_call_initiated";
3365
+ toolName: string;
3366
+ timestamp: number;
3367
+ toolCallId: string;
3368
+ parameters: Record<string, unknown>;
3369
+ } | {
3370
+ type: "approval_request";
3371
+ timestamp: number;
3372
+ request: {
3373
+ requestId: string;
3374
+ toolName: string;
3375
+ actionSummary: string;
3376
+ exactPayload: {
3377
+ targetFile?: string | undefined;
3378
+ diffPreview?: string | undefined;
3379
+ contentPreview?: string | undefined;
3380
+ command?: string[] | undefined;
3381
+ cwd?: string | undefined;
3382
+ };
3383
+ timestamp: number;
3384
+ };
3385
+ } | {
3386
+ type: "approval_resolved";
3387
+ status: "approved" | "denied" | "aborted";
3388
+ requestId: string;
3389
+ timestamp: number;
3390
+ reason?: string | undefined;
3391
+ } | {
3392
+ type: "tool_result";
3393
+ timestamp: number;
3394
+ toolCallId: string;
3395
+ result: {
3396
+ status: "denied" | "success" | "error";
3397
+ toolName: string;
3398
+ output: string;
3399
+ truncated?: boolean | undefined;
3400
+ metadata?: Record<string, unknown> | undefined;
3401
+ };
3402
+ } | {
3403
+ type: "diagnostic_result";
3404
+ timestamp: number;
3405
+ toolCallId: string;
3406
+ diagnostics: {
3407
+ message: string;
3408
+ severity: "error" | "warning" | "info";
3409
+ code?: string | undefined;
3410
+ line?: number | undefined;
3411
+ column?: number | undefined;
3412
+ file?: string | undefined;
3413
+ }[];
3414
+ exitCode: number;
3415
+ } | {
3416
+ type: "completion";
3417
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
3418
+ timestamp: number;
3419
+ totalSteps: number;
3420
+ summary?: string | undefined;
3421
+ } | {
3422
+ type: "session_usage";
3423
+ timestamp: number;
3424
+ totalTokens: number;
3425
+ modelId?: string | undefined;
3426
+ contextWindow?: number | undefined;
3427
+ } | {
3428
+ code: string;
3429
+ message: string;
3430
+ type: "error";
3431
+ timestamp: number;
3432
+ recoverable: boolean;
3433
+ } | {
3434
+ type: "cancellation";
3435
+ timestamp: number;
3436
+ reason: string;
3437
+ };
3438
+ };
3439
+ }, {
3440
+ type: "event";
3441
+ envelope: {
3442
+ timestamp: number;
3443
+ protocolVersion: 1;
3444
+ sessionId: string;
3445
+ sequence: number;
3446
+ event: {
3447
+ type: "progress";
3448
+ status: string;
3449
+ timestamp: number;
3450
+ step: number;
3451
+ maxSteps: number;
3452
+ } | {
3453
+ type: "model_change";
3454
+ timestamp: number;
3455
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
3456
+ newModelId: string;
3457
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
3458
+ previousModelId?: string | undefined;
3459
+ } | {
3460
+ type: "assistant_delta";
3461
+ timestamp: number;
3462
+ delta: string;
3463
+ } | {
3464
+ type: "reasoning_delta";
3465
+ timestamp: number;
3466
+ delta: string;
3467
+ } | {
3468
+ type: "tool_call_initiated";
3469
+ toolName: string;
3470
+ timestamp: number;
3471
+ toolCallId: string;
3472
+ parameters: Record<string, unknown>;
3473
+ } | {
3474
+ type: "approval_request";
3475
+ timestamp: number;
3476
+ request: {
3477
+ requestId: string;
3478
+ toolName: string;
3479
+ actionSummary: string;
3480
+ exactPayload: {
3481
+ targetFile?: string | undefined;
3482
+ diffPreview?: string | undefined;
3483
+ contentPreview?: string | undefined;
3484
+ command?: string[] | undefined;
3485
+ cwd?: string | undefined;
3486
+ };
3487
+ timestamp: number;
3488
+ };
3489
+ } | {
3490
+ type: "approval_resolved";
3491
+ status: "approved" | "denied" | "aborted";
3492
+ requestId: string;
3493
+ timestamp: number;
3494
+ reason?: string | undefined;
3495
+ } | {
3496
+ type: "tool_result";
3497
+ timestamp: number;
3498
+ toolCallId: string;
3499
+ result: {
3500
+ status: "denied" | "success" | "error";
3501
+ toolName: string;
3502
+ output: string;
3503
+ truncated?: boolean | undefined;
3504
+ metadata?: Record<string, unknown> | undefined;
3505
+ };
3506
+ } | {
3507
+ type: "diagnostic_result";
3508
+ timestamp: number;
3509
+ toolCallId: string;
3510
+ diagnostics: {
3511
+ message: string;
3512
+ severity: "error" | "warning" | "info";
3513
+ code?: string | undefined;
3514
+ line?: number | undefined;
3515
+ column?: number | undefined;
3516
+ file?: string | undefined;
3517
+ }[];
3518
+ exitCode: number;
3519
+ } | {
3520
+ type: "completion";
3521
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
3522
+ timestamp: number;
3523
+ totalSteps: number;
3524
+ summary?: string | undefined;
3525
+ } | {
3526
+ type: "session_usage";
3527
+ timestamp: number;
3528
+ totalTokens: number;
3529
+ modelId?: string | undefined;
3530
+ contextWindow?: number | undefined;
3531
+ } | {
3532
+ code: string;
3533
+ message: string;
3534
+ type: "error";
3535
+ timestamp: number;
3536
+ recoverable?: boolean | undefined;
3537
+ } | {
3538
+ type: "cancellation";
3539
+ timestamp: number;
3540
+ reason: string;
3541
+ };
3542
+ };
3543
+ }>]>;
3544
+ export type HostMessage = z.infer<typeof HostMessageSchema>;
3545
+ //# sourceMappingURL=host_protocol.d.ts.map