codebuff 1.0.287 → 1.0.289

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 (47) hide show
  1. package/dist/cli.d.ts +2 -1
  2. package/dist/cli.js +1 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client.d.ts +5 -8
  5. package/dist/client.js +3 -4
  6. package/dist/client.js.map +1 -1
  7. package/dist/common/actions.d.ts +178 -178
  8. package/dist/common/analytics.js +1 -4
  9. package/dist/common/analytics.js.map +1 -1
  10. package/dist/common/constants.d.ts +7 -7
  11. package/dist/common/constants.js +2 -2
  12. package/dist/common/types/agent-state.d.ts +8 -8
  13. package/dist/common/types/message.d.ts +6 -6
  14. package/dist/common/types/usage.d.ts +2 -2
  15. package/dist/common/util/__tests__/saxy.test.js +75 -0
  16. package/dist/common/util/__tests__/saxy.test.js.map +1 -1
  17. package/dist/common/util/credentials.d.ts +2 -2
  18. package/dist/common/util/saxy.js +40 -42
  19. package/dist/common/util/saxy.js.map +1 -1
  20. package/dist/common/websockets/websocket-schema.d.ts +328 -328
  21. package/dist/index.js +13 -1
  22. package/dist/menu.js +8 -6
  23. package/dist/menu.js.map +1 -1
  24. package/dist/slash-commands.d.ts +7 -0
  25. package/dist/slash-commands.js +21 -0
  26. package/dist/slash-commands.js.map +1 -0
  27. package/package.json +2 -1
  28. package/dist/common/__tests__/project-file-tree.test.d.ts +0 -1
  29. package/dist/common/__tests__/project-file-tree.test.js +0 -251
  30. package/dist/common/__tests__/project-file-tree.test.js.map +0 -1
  31. package/dist/common/json-config/__tests__/__snapshots__/stringify-schema.test.js.snap +0 -119
  32. package/dist/common/util/process-stream.d.ts +0 -7
  33. package/dist/common/util/process-stream.js +0 -162
  34. package/dist/common/util/process-stream.js.map +0 -1
  35. package/dist/utils/__tests__/__snapshots__/background-process-manager.test.js.snap +0 -137
  36. package/dist/utils/__tests__/file-paths.test.d.ts +0 -1
  37. package/dist/utils/__tests__/file-paths.test.js +0 -37
  38. package/dist/utils/__tests__/file-paths.test.js.map +0 -1
  39. package/dist/utils/__tests__/path.test.d.ts +0 -1
  40. package/dist/utils/__tests__/path.test.js +0 -37
  41. package/dist/utils/__tests__/path.test.js.map +0 -1
  42. package/dist/utils/file-paths.d.ts +0 -9
  43. package/dist/utils/file-paths.js +0 -24
  44. package/dist/utils/file-paths.js.map +0 -1
  45. package/dist/utils/path.d.ts +0 -9
  46. package/dist/utils/path.js +0 -27
  47. package/dist/utils/path.js.map +0 -1
@@ -112,11 +112,11 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
112
112
  path: z.ZodString;
113
113
  content: z.ZodString;
114
114
  }, "strip", z.ZodTypeAny, {
115
- path: string;
116
115
  content: string;
117
- }, {
118
116
  path: string;
117
+ }, {
119
118
  content: string;
119
+ path: string;
120
120
  }>, "many">, "many">>;
121
121
  }, "strip", z.ZodTypeAny, {
122
122
  currentWorkingDirectory: string;
@@ -142,8 +142,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
142
142
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
143
143
  userKnowledgeFiles?: Record<string, string> | undefined;
144
144
  fileVersions?: {
145
- path: string;
146
145
  content: string;
146
+ path: string;
147
147
  }[][] | undefined;
148
148
  }, {
149
149
  currentWorkingDirectory: string;
@@ -169,8 +169,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
169
169
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
170
170
  userKnowledgeFiles?: Record<string, string> | undefined;
171
171
  fileVersions?: {
172
- path: string;
173
172
  content: string;
173
+ path: string;
174
174
  }[][] | undefined;
175
175
  }>;
176
176
  messageHistory: z.ZodArray<z.ZodObject<{
@@ -186,14 +186,14 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
186
186
  type: "ephemeral";
187
187
  }>>;
188
188
  }, "strip", z.ZodTypeAny, {
189
- type: "text";
190
189
  text: string;
190
+ type: "text";
191
191
  cache_control?: {
192
192
  type: "ephemeral";
193
193
  } | undefined;
194
194
  }, {
195
- type: "text";
196
195
  text: string;
196
+ type: "text";
197
197
  cache_control?: {
198
198
  type: "ephemeral";
199
199
  } | undefined;
@@ -210,16 +210,16 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
210
210
  type: "ephemeral";
211
211
  }>>;
212
212
  }, "strip", z.ZodTypeAny, {
213
- type: "tool_use";
214
213
  name: string;
214
+ type: "tool_use";
215
215
  id: string;
216
216
  input: Record<string, any>;
217
217
  cache_control?: {
218
218
  type: "ephemeral";
219
219
  } | undefined;
220
220
  }, {
221
- type: "tool_use";
222
221
  name: string;
222
+ type: "tool_use";
223
223
  id: string;
224
224
  input: Record<string, any>;
225
225
  cache_control?: {
@@ -237,15 +237,15 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
237
237
  type: "ephemeral";
238
238
  }>>;
239
239
  }, "strip", z.ZodTypeAny, {
240
- type: "tool_result";
241
240
  content: string;
241
+ type: "tool_result";
242
242
  tool_use_id: string;
243
243
  cache_control?: {
244
244
  type: "ephemeral";
245
245
  } | undefined;
246
246
  }, {
247
- type: "tool_result";
248
247
  content: string;
248
+ type: "tool_result";
249
249
  tool_use_id: string;
250
250
  cache_control?: {
251
251
  type: "ephemeral";
@@ -257,13 +257,13 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
257
257
  media_type: z.ZodLiteral<"image/jpeg">;
258
258
  data: z.ZodString;
259
259
  }, "strip", z.ZodTypeAny, {
260
+ data: string;
260
261
  type: "base64";
261
262
  media_type: "image/jpeg";
262
- data: string;
263
263
  }, {
264
+ data: string;
264
265
  type: "base64";
265
266
  media_type: "image/jpeg";
266
- data: string;
267
267
  }>;
268
268
  cache_control: z.ZodOptional<z.ZodObject<{
269
269
  type: z.ZodLiteral<"ephemeral">;
@@ -275,9 +275,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
275
275
  }, "strip", z.ZodTypeAny, {
276
276
  type: "image";
277
277
  source: {
278
+ data: string;
278
279
  type: "base64";
279
280
  media_type: "image/jpeg";
280
- data: string;
281
281
  };
282
282
  cache_control?: {
283
283
  type: "ephemeral";
@@ -285,9 +285,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
285
285
  }, {
286
286
  type: "image";
287
287
  source: {
288
+ data: string;
288
289
  type: "base64";
289
290
  media_type: "image/jpeg";
290
- data: string;
291
291
  };
292
292
  cache_control?: {
293
293
  type: "ephemeral";
@@ -295,22 +295,22 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
295
295
  }>]>, "many">]>;
296
296
  }, "strip", z.ZodTypeAny, {
297
297
  content: string | ({
298
- type: "text";
299
298
  text: string;
299
+ type: "text";
300
300
  cache_control?: {
301
301
  type: "ephemeral";
302
302
  } | undefined;
303
303
  } | {
304
- type: "tool_use";
305
304
  name: string;
305
+ type: "tool_use";
306
306
  id: string;
307
307
  input: Record<string, any>;
308
308
  cache_control?: {
309
309
  type: "ephemeral";
310
310
  } | undefined;
311
311
  } | {
312
- type: "tool_result";
313
312
  content: string;
313
+ type: "tool_result";
314
314
  tool_use_id: string;
315
315
  cache_control?: {
316
316
  type: "ephemeral";
@@ -318,9 +318,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
318
318
  } | {
319
319
  type: "image";
320
320
  source: {
321
+ data: string;
321
322
  type: "base64";
322
323
  media_type: "image/jpeg";
323
- data: string;
324
324
  };
325
325
  cache_control?: {
326
326
  type: "ephemeral";
@@ -329,22 +329,22 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
329
329
  role: "user" | "assistant";
330
330
  }, {
331
331
  content: string | ({
332
- type: "text";
333
332
  text: string;
333
+ type: "text";
334
334
  cache_control?: {
335
335
  type: "ephemeral";
336
336
  } | undefined;
337
337
  } | {
338
- type: "tool_use";
339
338
  name: string;
339
+ type: "tool_use";
340
340
  id: string;
341
341
  input: Record<string, any>;
342
342
  cache_control?: {
343
343
  type: "ephemeral";
344
344
  } | undefined;
345
345
  } | {
346
- type: "tool_result";
347
346
  content: string;
347
+ type: "tool_result";
348
348
  tool_use_id: string;
349
349
  cache_control?: {
350
350
  type: "ephemeral";
@@ -352,9 +352,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
352
352
  } | {
353
353
  type: "image";
354
354
  source: {
355
+ data: string;
355
356
  type: "base64";
356
357
  media_type: "image/jpeg";
357
- data: string;
358
358
  };
359
359
  cache_control?: {
360
360
  type: "ephemeral";
@@ -389,28 +389,28 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
389
389
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
390
390
  userKnowledgeFiles?: Record<string, string> | undefined;
391
391
  fileVersions?: {
392
- path: string;
393
392
  content: string;
393
+ path: string;
394
394
  }[][] | undefined;
395
395
  };
396
396
  messageHistory: {
397
397
  content: string | ({
398
- type: "text";
399
398
  text: string;
399
+ type: "text";
400
400
  cache_control?: {
401
401
  type: "ephemeral";
402
402
  } | undefined;
403
403
  } | {
404
- type: "tool_use";
405
404
  name: string;
405
+ type: "tool_use";
406
406
  id: string;
407
407
  input: Record<string, any>;
408
408
  cache_control?: {
409
409
  type: "ephemeral";
410
410
  } | undefined;
411
411
  } | {
412
- type: "tool_result";
413
412
  content: string;
413
+ type: "tool_result";
414
414
  tool_use_id: string;
415
415
  cache_control?: {
416
416
  type: "ephemeral";
@@ -418,9 +418,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
418
418
  } | {
419
419
  type: "image";
420
420
  source: {
421
+ data: string;
421
422
  type: "base64";
422
423
  media_type: "image/jpeg";
423
- data: string;
424
424
  };
425
425
  cache_control?: {
426
426
  type: "ephemeral";
@@ -455,28 +455,28 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
455
455
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
456
456
  userKnowledgeFiles?: Record<string, string> | undefined;
457
457
  fileVersions?: {
458
- path: string;
459
458
  content: string;
459
+ path: string;
460
460
  }[][] | undefined;
461
461
  };
462
462
  messageHistory: {
463
463
  content: string | ({
464
- type: "text";
465
464
  text: string;
465
+ type: "text";
466
466
  cache_control?: {
467
467
  type: "ephemeral";
468
468
  } | undefined;
469
469
  } | {
470
- type: "tool_use";
471
470
  name: string;
471
+ type: "tool_use";
472
472
  id: string;
473
473
  input: Record<string, any>;
474
474
  cache_control?: {
475
475
  type: "ephemeral";
476
476
  } | undefined;
477
477
  } | {
478
- type: "tool_result";
479
478
  content: string;
479
+ type: "tool_result";
480
480
  tool_use_id: string;
481
481
  cache_control?: {
482
482
  type: "ephemeral";
@@ -484,9 +484,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
484
484
  } | {
485
485
  type: "image";
486
486
  source: {
487
+ data: string;
487
488
  type: "base64";
488
489
  media_type: "image/jpeg";
489
- data: string;
490
490
  };
491
491
  cache_control?: {
492
492
  type: "ephemeral";
@@ -515,7 +515,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
515
515
  type: "prompt";
516
516
  promptId: string;
517
517
  fingerprintId: string;
518
- costMode: "max" | "lite" | "normal" | "experimental";
518
+ costMode: "lite" | "normal" | "max" | "experimental";
519
519
  agentState: {
520
520
  agentContext: string;
521
521
  fileContext: {
@@ -542,28 +542,28 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
542
542
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
543
543
  userKnowledgeFiles?: Record<string, string> | undefined;
544
544
  fileVersions?: {
545
- path: string;
546
545
  content: string;
546
+ path: string;
547
547
  }[][] | undefined;
548
548
  };
549
549
  messageHistory: {
550
550
  content: string | ({
551
- type: "text";
552
551
  text: string;
552
+ type: "text";
553
553
  cache_control?: {
554
554
  type: "ephemeral";
555
555
  } | undefined;
556
556
  } | {
557
- type: "tool_use";
558
557
  name: string;
558
+ type: "tool_use";
559
559
  id: string;
560
560
  input: Record<string, any>;
561
561
  cache_control?: {
562
562
  type: "ephemeral";
563
563
  } | undefined;
564
564
  } | {
565
- type: "tool_result";
566
565
  content: string;
566
+ type: "tool_result";
567
567
  tool_use_id: string;
568
568
  cache_control?: {
569
569
  type: "ephemeral";
@@ -571,9 +571,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
571
571
  } | {
572
572
  type: "image";
573
573
  source: {
574
+ data: string;
574
575
  type: "base64";
575
576
  media_type: "image/jpeg";
576
- data: string;
577
577
  };
578
578
  cache_control?: {
579
579
  type: "ephemeral";
@@ -622,28 +622,28 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
622
622
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
623
623
  userKnowledgeFiles?: Record<string, string> | undefined;
624
624
  fileVersions?: {
625
- path: string;
626
625
  content: string;
626
+ path: string;
627
627
  }[][] | undefined;
628
628
  };
629
629
  messageHistory: {
630
630
  content: string | ({
631
- type: "text";
632
631
  text: string;
632
+ type: "text";
633
633
  cache_control?: {
634
634
  type: "ephemeral";
635
635
  } | undefined;
636
636
  } | {
637
- type: "tool_use";
638
637
  name: string;
638
+ type: "tool_use";
639
639
  id: string;
640
640
  input: Record<string, any>;
641
641
  cache_control?: {
642
642
  type: "ephemeral";
643
643
  } | undefined;
644
644
  } | {
645
- type: "tool_result";
646
645
  content: string;
646
+ type: "tool_result";
647
647
  tool_use_id: string;
648
648
  cache_control?: {
649
649
  type: "ephemeral";
@@ -651,9 +651,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
651
651
  } | {
652
652
  type: "image";
653
653
  source: {
654
+ data: string;
654
655
  type: "base64";
655
656
  media_type: "image/jpeg";
656
- data: string;
657
657
  };
658
658
  cache_control?: {
659
659
  type: "ephemeral";
@@ -670,7 +670,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
670
670
  }[];
671
671
  prompt?: string | undefined;
672
672
  authToken?: string | undefined;
673
- costMode?: "max" | "lite" | "normal" | "experimental" | undefined;
673
+ costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
674
674
  model?: string | undefined;
675
675
  cwd?: string | undefined;
676
676
  }>, z.ZodObject<{
@@ -740,11 +740,11 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
740
740
  path: z.ZodString;
741
741
  content: z.ZodString;
742
742
  }, "strip", z.ZodTypeAny, {
743
- path: string;
744
743
  content: string;
745
- }, {
746
744
  path: string;
745
+ }, {
747
746
  content: string;
747
+ path: string;
748
748
  }>, "many">, "many">>;
749
749
  }, "strip", z.ZodTypeAny, {
750
750
  currentWorkingDirectory: string;
@@ -770,8 +770,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
770
770
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
771
771
  userKnowledgeFiles?: Record<string, string> | undefined;
772
772
  fileVersions?: {
773
- path: string;
774
773
  content: string;
774
+ path: string;
775
775
  }[][] | undefined;
776
776
  }, {
777
777
  currentWorkingDirectory: string;
@@ -797,8 +797,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
797
797
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
798
798
  userKnowledgeFiles?: Record<string, string> | undefined;
799
799
  fileVersions?: {
800
- path: string;
801
800
  content: string;
801
+ path: string;
802
802
  }[][] | undefined;
803
803
  }>;
804
804
  }, "strip", z.ZodTypeAny, {
@@ -828,8 +828,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
828
828
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
829
829
  userKnowledgeFiles?: Record<string, string> | undefined;
830
830
  fileVersions?: {
831
- path: string;
832
831
  content: string;
832
+ path: string;
833
833
  }[][] | undefined;
834
834
  };
835
835
  authToken?: string | undefined;
@@ -860,8 +860,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
860
860
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
861
861
  userKnowledgeFiles?: Record<string, string> | undefined;
862
862
  fileVersions?: {
863
- path: string;
864
863
  content: string;
864
+ path: string;
865
865
  }[][] | undefined;
866
866
  };
867
867
  authToken?: string | undefined;
@@ -882,12 +882,11 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
882
882
  authToken?: string | undefined;
883
883
  }>]>;
884
884
  }, "strip", z.ZodTypeAny, {
885
- type: "action";
886
885
  data: {
887
886
  type: "prompt";
888
887
  promptId: string;
889
888
  fingerprintId: string;
890
- costMode: "max" | "lite" | "normal" | "experimental";
889
+ costMode: "lite" | "normal" | "max" | "experimental";
891
890
  agentState: {
892
891
  agentContext: string;
893
892
  fileContext: {
@@ -914,28 +913,28 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
914
913
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
915
914
  userKnowledgeFiles?: Record<string, string> | undefined;
916
915
  fileVersions?: {
917
- path: string;
918
916
  content: string;
917
+ path: string;
919
918
  }[][] | undefined;
920
919
  };
921
920
  messageHistory: {
922
921
  content: string | ({
923
- type: "text";
924
922
  text: string;
923
+ type: "text";
925
924
  cache_control?: {
926
925
  type: "ephemeral";
927
926
  } | undefined;
928
927
  } | {
929
- type: "tool_use";
930
928
  name: string;
929
+ type: "tool_use";
931
930
  id: string;
932
931
  input: Record<string, any>;
933
932
  cache_control?: {
934
933
  type: "ephemeral";
935
934
  } | undefined;
936
935
  } | {
937
- type: "tool_result";
938
936
  content: string;
937
+ type: "tool_result";
939
938
  tool_use_id: string;
940
939
  cache_control?: {
941
940
  type: "ephemeral";
@@ -943,9 +942,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
943
942
  } | {
944
943
  type: "image";
945
944
  source: {
945
+ data: string;
946
946
  type: "base64";
947
947
  media_type: "image/jpeg";
948
- data: string;
949
948
  };
950
949
  cache_control?: {
951
950
  type: "ephemeral";
@@ -995,8 +994,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
995
994
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
996
995
  userKnowledgeFiles?: Record<string, string> | undefined;
997
996
  fileVersions?: {
998
- path: string;
999
997
  content: string;
998
+ path: string;
1000
999
  }[][] | undefined;
1001
1000
  };
1002
1001
  authToken?: string | undefined;
@@ -1006,9 +1005,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1006
1005
  stagedChanges: string;
1007
1006
  authToken?: string | undefined;
1008
1007
  };
1008
+ type: "action";
1009
1009
  txid: number;
1010
1010
  }, {
1011
- type: "action";
1012
1011
  data: {
1013
1012
  type: "prompt";
1014
1013
  promptId: string;
@@ -1039,28 +1038,28 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1039
1038
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1040
1039
  userKnowledgeFiles?: Record<string, string> | undefined;
1041
1040
  fileVersions?: {
1042
- path: string;
1043
1041
  content: string;
1042
+ path: string;
1044
1043
  }[][] | undefined;
1045
1044
  };
1046
1045
  messageHistory: {
1047
1046
  content: string | ({
1048
- type: "text";
1049
1047
  text: string;
1048
+ type: "text";
1050
1049
  cache_control?: {
1051
1050
  type: "ephemeral";
1052
1051
  } | undefined;
1053
1052
  } | {
1054
- type: "tool_use";
1055
1053
  name: string;
1054
+ type: "tool_use";
1056
1055
  id: string;
1057
1056
  input: Record<string, any>;
1058
1057
  cache_control?: {
1059
1058
  type: "ephemeral";
1060
1059
  } | undefined;
1061
1060
  } | {
1062
- type: "tool_result";
1063
1061
  content: string;
1062
+ type: "tool_result";
1064
1063
  tool_use_id: string;
1065
1064
  cache_control?: {
1066
1065
  type: "ephemeral";
@@ -1068,9 +1067,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1068
1067
  } | {
1069
1068
  type: "image";
1070
1069
  source: {
1070
+ data: string;
1071
1071
  type: "base64";
1072
1072
  media_type: "image/jpeg";
1073
- data: string;
1074
1073
  };
1075
1074
  cache_control?: {
1076
1075
  type: "ephemeral";
@@ -1087,7 +1086,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1087
1086
  }[];
1088
1087
  prompt?: string | undefined;
1089
1088
  authToken?: string | undefined;
1090
- costMode?: "max" | "lite" | "normal" | "experimental" | undefined;
1089
+ costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
1091
1090
  model?: string | undefined;
1092
1091
  cwd?: string | undefined;
1093
1092
  } | {
@@ -1121,8 +1120,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1121
1120
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1122
1121
  userKnowledgeFiles?: Record<string, string> | undefined;
1123
1122
  fileVersions?: {
1124
- path: string;
1125
1123
  content: string;
1124
+ path: string;
1126
1125
  }[][] | undefined;
1127
1126
  };
1128
1127
  authToken?: string | undefined;
@@ -1132,6 +1131,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1132
1131
  stagedChanges: string;
1133
1132
  authToken?: string | undefined;
1134
1133
  };
1134
+ type: "action";
1135
1135
  txid: number;
1136
1136
  }>;
1137
1137
  };
@@ -1243,11 +1243,11 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1243
1243
  path: z.ZodString;
1244
1244
  content: z.ZodString;
1245
1245
  }, "strip", z.ZodTypeAny, {
1246
- path: string;
1247
1246
  content: string;
1248
- }, {
1249
1247
  path: string;
1248
+ }, {
1250
1249
  content: string;
1250
+ path: string;
1251
1251
  }>, "many">, "many">>;
1252
1252
  }, "strip", z.ZodTypeAny, {
1253
1253
  currentWorkingDirectory: string;
@@ -1273,8 +1273,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1273
1273
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1274
1274
  userKnowledgeFiles?: Record<string, string> | undefined;
1275
1275
  fileVersions?: {
1276
- path: string;
1277
1276
  content: string;
1277
+ path: string;
1278
1278
  }[][] | undefined;
1279
1279
  }, {
1280
1280
  currentWorkingDirectory: string;
@@ -1300,8 +1300,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1300
1300
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1301
1301
  userKnowledgeFiles?: Record<string, string> | undefined;
1302
1302
  fileVersions?: {
1303
- path: string;
1304
1303
  content: string;
1304
+ path: string;
1305
1305
  }[][] | undefined;
1306
1306
  }>;
1307
1307
  messageHistory: z.ZodArray<z.ZodObject<{
@@ -1317,14 +1317,14 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1317
1317
  type: "ephemeral";
1318
1318
  }>>;
1319
1319
  }, "strip", z.ZodTypeAny, {
1320
- type: "text";
1321
1320
  text: string;
1321
+ type: "text";
1322
1322
  cache_control?: {
1323
1323
  type: "ephemeral";
1324
1324
  } | undefined;
1325
1325
  }, {
1326
- type: "text";
1327
1326
  text: string;
1327
+ type: "text";
1328
1328
  cache_control?: {
1329
1329
  type: "ephemeral";
1330
1330
  } | undefined;
@@ -1341,16 +1341,16 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1341
1341
  type: "ephemeral";
1342
1342
  }>>;
1343
1343
  }, "strip", z.ZodTypeAny, {
1344
- type: "tool_use";
1345
1344
  name: string;
1345
+ type: "tool_use";
1346
1346
  id: string;
1347
1347
  input: Record<string, any>;
1348
1348
  cache_control?: {
1349
1349
  type: "ephemeral";
1350
1350
  } | undefined;
1351
1351
  }, {
1352
- type: "tool_use";
1353
1352
  name: string;
1353
+ type: "tool_use";
1354
1354
  id: string;
1355
1355
  input: Record<string, any>;
1356
1356
  cache_control?: {
@@ -1368,15 +1368,15 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1368
1368
  type: "ephemeral";
1369
1369
  }>>;
1370
1370
  }, "strip", z.ZodTypeAny, {
1371
- type: "tool_result";
1372
1371
  content: string;
1372
+ type: "tool_result";
1373
1373
  tool_use_id: string;
1374
1374
  cache_control?: {
1375
1375
  type: "ephemeral";
1376
1376
  } | undefined;
1377
1377
  }, {
1378
- type: "tool_result";
1379
1378
  content: string;
1379
+ type: "tool_result";
1380
1380
  tool_use_id: string;
1381
1381
  cache_control?: {
1382
1382
  type: "ephemeral";
@@ -1388,13 +1388,13 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1388
1388
  media_type: z.ZodLiteral<"image/jpeg">;
1389
1389
  data: z.ZodString;
1390
1390
  }, "strip", z.ZodTypeAny, {
1391
+ data: string;
1391
1392
  type: "base64";
1392
1393
  media_type: "image/jpeg";
1393
- data: string;
1394
1394
  }, {
1395
+ data: string;
1395
1396
  type: "base64";
1396
1397
  media_type: "image/jpeg";
1397
- data: string;
1398
1398
  }>;
1399
1399
  cache_control: z.ZodOptional<z.ZodObject<{
1400
1400
  type: z.ZodLiteral<"ephemeral">;
@@ -1406,9 +1406,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1406
1406
  }, "strip", z.ZodTypeAny, {
1407
1407
  type: "image";
1408
1408
  source: {
1409
+ data: string;
1409
1410
  type: "base64";
1410
1411
  media_type: "image/jpeg";
1411
- data: string;
1412
1412
  };
1413
1413
  cache_control?: {
1414
1414
  type: "ephemeral";
@@ -1416,9 +1416,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1416
1416
  }, {
1417
1417
  type: "image";
1418
1418
  source: {
1419
+ data: string;
1419
1420
  type: "base64";
1420
1421
  media_type: "image/jpeg";
1421
- data: string;
1422
1422
  };
1423
1423
  cache_control?: {
1424
1424
  type: "ephemeral";
@@ -1426,22 +1426,22 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1426
1426
  }>]>, "many">]>;
1427
1427
  }, "strip", z.ZodTypeAny, {
1428
1428
  content: string | ({
1429
- type: "text";
1430
1429
  text: string;
1430
+ type: "text";
1431
1431
  cache_control?: {
1432
1432
  type: "ephemeral";
1433
1433
  } | undefined;
1434
1434
  } | {
1435
- type: "tool_use";
1436
1435
  name: string;
1436
+ type: "tool_use";
1437
1437
  id: string;
1438
1438
  input: Record<string, any>;
1439
1439
  cache_control?: {
1440
1440
  type: "ephemeral";
1441
1441
  } | undefined;
1442
1442
  } | {
1443
- type: "tool_result";
1444
1443
  content: string;
1444
+ type: "tool_result";
1445
1445
  tool_use_id: string;
1446
1446
  cache_control?: {
1447
1447
  type: "ephemeral";
@@ -1449,9 +1449,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1449
1449
  } | {
1450
1450
  type: "image";
1451
1451
  source: {
1452
+ data: string;
1452
1453
  type: "base64";
1453
1454
  media_type: "image/jpeg";
1454
- data: string;
1455
1455
  };
1456
1456
  cache_control?: {
1457
1457
  type: "ephemeral";
@@ -1460,22 +1460,22 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1460
1460
  role: "user" | "assistant";
1461
1461
  }, {
1462
1462
  content: string | ({
1463
- type: "text";
1464
1463
  text: string;
1464
+ type: "text";
1465
1465
  cache_control?: {
1466
1466
  type: "ephemeral";
1467
1467
  } | undefined;
1468
1468
  } | {
1469
- type: "tool_use";
1470
1469
  name: string;
1470
+ type: "tool_use";
1471
1471
  id: string;
1472
1472
  input: Record<string, any>;
1473
1473
  cache_control?: {
1474
1474
  type: "ephemeral";
1475
1475
  } | undefined;
1476
1476
  } | {
1477
- type: "tool_result";
1478
1477
  content: string;
1478
+ type: "tool_result";
1479
1479
  tool_use_id: string;
1480
1480
  cache_control?: {
1481
1481
  type: "ephemeral";
@@ -1483,9 +1483,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1483
1483
  } | {
1484
1484
  type: "image";
1485
1485
  source: {
1486
+ data: string;
1486
1487
  type: "base64";
1487
1488
  media_type: "image/jpeg";
1488
- data: string;
1489
1489
  };
1490
1490
  cache_control?: {
1491
1491
  type: "ephemeral";
@@ -1520,28 +1520,28 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1520
1520
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1521
1521
  userKnowledgeFiles?: Record<string, string> | undefined;
1522
1522
  fileVersions?: {
1523
- path: string;
1524
1523
  content: string;
1524
+ path: string;
1525
1525
  }[][] | undefined;
1526
1526
  };
1527
1527
  messageHistory: {
1528
1528
  content: string | ({
1529
- type: "text";
1530
1529
  text: string;
1530
+ type: "text";
1531
1531
  cache_control?: {
1532
1532
  type: "ephemeral";
1533
1533
  } | undefined;
1534
1534
  } | {
1535
- type: "tool_use";
1536
1535
  name: string;
1536
+ type: "tool_use";
1537
1537
  id: string;
1538
1538
  input: Record<string, any>;
1539
1539
  cache_control?: {
1540
1540
  type: "ephemeral";
1541
1541
  } | undefined;
1542
1542
  } | {
1543
- type: "tool_result";
1544
1543
  content: string;
1544
+ type: "tool_result";
1545
1545
  tool_use_id: string;
1546
1546
  cache_control?: {
1547
1547
  type: "ephemeral";
@@ -1549,9 +1549,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1549
1549
  } | {
1550
1550
  type: "image";
1551
1551
  source: {
1552
+ data: string;
1552
1553
  type: "base64";
1553
1554
  media_type: "image/jpeg";
1554
- data: string;
1555
1555
  };
1556
1556
  cache_control?: {
1557
1557
  type: "ephemeral";
@@ -1586,28 +1586,28 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1586
1586
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1587
1587
  userKnowledgeFiles?: Record<string, string> | undefined;
1588
1588
  fileVersions?: {
1589
- path: string;
1590
1589
  content: string;
1590
+ path: string;
1591
1591
  }[][] | undefined;
1592
1592
  };
1593
1593
  messageHistory: {
1594
1594
  content: string | ({
1595
- type: "text";
1596
1595
  text: string;
1596
+ type: "text";
1597
1597
  cache_control?: {
1598
1598
  type: "ephemeral";
1599
1599
  } | undefined;
1600
1600
  } | {
1601
- type: "tool_use";
1602
1601
  name: string;
1602
+ type: "tool_use";
1603
1603
  id: string;
1604
1604
  input: Record<string, any>;
1605
1605
  cache_control?: {
1606
1606
  type: "ephemeral";
1607
1607
  } | undefined;
1608
1608
  } | {
1609
- type: "tool_result";
1610
1609
  content: string;
1610
+ type: "tool_result";
1611
1611
  tool_use_id: string;
1612
1612
  cache_control?: {
1613
1613
  type: "ephemeral";
@@ -1615,9 +1615,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1615
1615
  } | {
1616
1616
  type: "image";
1617
1617
  source: {
1618
+ data: string;
1618
1619
  type: "base64";
1619
1620
  media_type: "image/jpeg";
1620
- data: string;
1621
1621
  };
1622
1622
  cache_control?: {
1623
1623
  type: "ephemeral";
@@ -1646,7 +1646,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1646
1646
  type: "prompt";
1647
1647
  promptId: string;
1648
1648
  fingerprintId: string;
1649
- costMode: "max" | "lite" | "normal" | "experimental";
1649
+ costMode: "lite" | "normal" | "max" | "experimental";
1650
1650
  agentState: {
1651
1651
  agentContext: string;
1652
1652
  fileContext: {
@@ -1673,28 +1673,28 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1673
1673
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1674
1674
  userKnowledgeFiles?: Record<string, string> | undefined;
1675
1675
  fileVersions?: {
1676
- path: string;
1677
1676
  content: string;
1677
+ path: string;
1678
1678
  }[][] | undefined;
1679
1679
  };
1680
1680
  messageHistory: {
1681
1681
  content: string | ({
1682
- type: "text";
1683
1682
  text: string;
1683
+ type: "text";
1684
1684
  cache_control?: {
1685
1685
  type: "ephemeral";
1686
1686
  } | undefined;
1687
1687
  } | {
1688
- type: "tool_use";
1689
1688
  name: string;
1689
+ type: "tool_use";
1690
1690
  id: string;
1691
1691
  input: Record<string, any>;
1692
1692
  cache_control?: {
1693
1693
  type: "ephemeral";
1694
1694
  } | undefined;
1695
1695
  } | {
1696
- type: "tool_result";
1697
1696
  content: string;
1697
+ type: "tool_result";
1698
1698
  tool_use_id: string;
1699
1699
  cache_control?: {
1700
1700
  type: "ephemeral";
@@ -1702,9 +1702,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1702
1702
  } | {
1703
1703
  type: "image";
1704
1704
  source: {
1705
+ data: string;
1705
1706
  type: "base64";
1706
1707
  media_type: "image/jpeg";
1707
- data: string;
1708
1708
  };
1709
1709
  cache_control?: {
1710
1710
  type: "ephemeral";
@@ -1753,28 +1753,28 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1753
1753
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1754
1754
  userKnowledgeFiles?: Record<string, string> | undefined;
1755
1755
  fileVersions?: {
1756
- path: string;
1757
1756
  content: string;
1757
+ path: string;
1758
1758
  }[][] | undefined;
1759
1759
  };
1760
1760
  messageHistory: {
1761
1761
  content: string | ({
1762
- type: "text";
1763
1762
  text: string;
1763
+ type: "text";
1764
1764
  cache_control?: {
1765
1765
  type: "ephemeral";
1766
1766
  } | undefined;
1767
1767
  } | {
1768
- type: "tool_use";
1769
1768
  name: string;
1769
+ type: "tool_use";
1770
1770
  id: string;
1771
1771
  input: Record<string, any>;
1772
1772
  cache_control?: {
1773
1773
  type: "ephemeral";
1774
1774
  } | undefined;
1775
1775
  } | {
1776
- type: "tool_result";
1777
1776
  content: string;
1777
+ type: "tool_result";
1778
1778
  tool_use_id: string;
1779
1779
  cache_control?: {
1780
1780
  type: "ephemeral";
@@ -1782,9 +1782,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1782
1782
  } | {
1783
1783
  type: "image";
1784
1784
  source: {
1785
+ data: string;
1785
1786
  type: "base64";
1786
1787
  media_type: "image/jpeg";
1787
- data: string;
1788
1788
  };
1789
1789
  cache_control?: {
1790
1790
  type: "ephemeral";
@@ -1801,7 +1801,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1801
1801
  }[];
1802
1802
  prompt?: string | undefined;
1803
1803
  authToken?: string | undefined;
1804
- costMode?: "max" | "lite" | "normal" | "experimental" | undefined;
1804
+ costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
1805
1805
  model?: string | undefined;
1806
1806
  cwd?: string | undefined;
1807
1807
  }>, z.ZodObject<{
@@ -1871,11 +1871,11 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1871
1871
  path: z.ZodString;
1872
1872
  content: z.ZodString;
1873
1873
  }, "strip", z.ZodTypeAny, {
1874
- path: string;
1875
1874
  content: string;
1876
- }, {
1877
1875
  path: string;
1876
+ }, {
1878
1877
  content: string;
1878
+ path: string;
1879
1879
  }>, "many">, "many">>;
1880
1880
  }, "strip", z.ZodTypeAny, {
1881
1881
  currentWorkingDirectory: string;
@@ -1901,8 +1901,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1901
1901
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1902
1902
  userKnowledgeFiles?: Record<string, string> | undefined;
1903
1903
  fileVersions?: {
1904
- path: string;
1905
1904
  content: string;
1905
+ path: string;
1906
1906
  }[][] | undefined;
1907
1907
  }, {
1908
1908
  currentWorkingDirectory: string;
@@ -1928,8 +1928,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1928
1928
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1929
1929
  userKnowledgeFiles?: Record<string, string> | undefined;
1930
1930
  fileVersions?: {
1931
- path: string;
1932
1931
  content: string;
1932
+ path: string;
1933
1933
  }[][] | undefined;
1934
1934
  }>;
1935
1935
  }, "strip", z.ZodTypeAny, {
@@ -1959,8 +1959,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1959
1959
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1960
1960
  userKnowledgeFiles?: Record<string, string> | undefined;
1961
1961
  fileVersions?: {
1962
- path: string;
1963
1962
  content: string;
1963
+ path: string;
1964
1964
  }[][] | undefined;
1965
1965
  };
1966
1966
  authToken?: string | undefined;
@@ -1991,8 +1991,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1991
1991
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1992
1992
  userKnowledgeFiles?: Record<string, string> | undefined;
1993
1993
  fileVersions?: {
1994
- path: string;
1995
1994
  content: string;
1995
+ path: string;
1996
1996
  }[][] | undefined;
1997
1997
  };
1998
1998
  authToken?: string | undefined;
@@ -2013,12 +2013,11 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2013
2013
  authToken?: string | undefined;
2014
2014
  }>]>;
2015
2015
  }, "strip", z.ZodTypeAny, {
2016
- type: "action";
2017
2016
  data: {
2018
2017
  type: "prompt";
2019
2018
  promptId: string;
2020
2019
  fingerprintId: string;
2021
- costMode: "max" | "lite" | "normal" | "experimental";
2020
+ costMode: "lite" | "normal" | "max" | "experimental";
2022
2021
  agentState: {
2023
2022
  agentContext: string;
2024
2023
  fileContext: {
@@ -2045,28 +2044,28 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2045
2044
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2046
2045
  userKnowledgeFiles?: Record<string, string> | undefined;
2047
2046
  fileVersions?: {
2048
- path: string;
2049
2047
  content: string;
2048
+ path: string;
2050
2049
  }[][] | undefined;
2051
2050
  };
2052
2051
  messageHistory: {
2053
2052
  content: string | ({
2054
- type: "text";
2055
2053
  text: string;
2054
+ type: "text";
2056
2055
  cache_control?: {
2057
2056
  type: "ephemeral";
2058
2057
  } | undefined;
2059
2058
  } | {
2060
- type: "tool_use";
2061
2059
  name: string;
2060
+ type: "tool_use";
2062
2061
  id: string;
2063
2062
  input: Record<string, any>;
2064
2063
  cache_control?: {
2065
2064
  type: "ephemeral";
2066
2065
  } | undefined;
2067
2066
  } | {
2068
- type: "tool_result";
2069
2067
  content: string;
2068
+ type: "tool_result";
2070
2069
  tool_use_id: string;
2071
2070
  cache_control?: {
2072
2071
  type: "ephemeral";
@@ -2074,9 +2073,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2074
2073
  } | {
2075
2074
  type: "image";
2076
2075
  source: {
2076
+ data: string;
2077
2077
  type: "base64";
2078
2078
  media_type: "image/jpeg";
2079
- data: string;
2080
2079
  };
2081
2080
  cache_control?: {
2082
2081
  type: "ephemeral";
@@ -2126,8 +2125,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2126
2125
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2127
2126
  userKnowledgeFiles?: Record<string, string> | undefined;
2128
2127
  fileVersions?: {
2129
- path: string;
2130
2128
  content: string;
2129
+ path: string;
2131
2130
  }[][] | undefined;
2132
2131
  };
2133
2132
  authToken?: string | undefined;
@@ -2137,9 +2136,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2137
2136
  stagedChanges: string;
2138
2137
  authToken?: string | undefined;
2139
2138
  };
2139
+ type: "action";
2140
2140
  txid: number;
2141
2141
  }, {
2142
- type: "action";
2143
2142
  data: {
2144
2143
  type: "prompt";
2145
2144
  promptId: string;
@@ -2170,28 +2169,28 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2170
2169
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2171
2170
  userKnowledgeFiles?: Record<string, string> | undefined;
2172
2171
  fileVersions?: {
2173
- path: string;
2174
2172
  content: string;
2173
+ path: string;
2175
2174
  }[][] | undefined;
2176
2175
  };
2177
2176
  messageHistory: {
2178
2177
  content: string | ({
2179
- type: "text";
2180
2178
  text: string;
2179
+ type: "text";
2181
2180
  cache_control?: {
2182
2181
  type: "ephemeral";
2183
2182
  } | undefined;
2184
2183
  } | {
2185
- type: "tool_use";
2186
2184
  name: string;
2185
+ type: "tool_use";
2187
2186
  id: string;
2188
2187
  input: Record<string, any>;
2189
2188
  cache_control?: {
2190
2189
  type: "ephemeral";
2191
2190
  } | undefined;
2192
2191
  } | {
2193
- type: "tool_result";
2194
2192
  content: string;
2193
+ type: "tool_result";
2195
2194
  tool_use_id: string;
2196
2195
  cache_control?: {
2197
2196
  type: "ephemeral";
@@ -2199,9 +2198,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2199
2198
  } | {
2200
2199
  type: "image";
2201
2200
  source: {
2201
+ data: string;
2202
2202
  type: "base64";
2203
2203
  media_type: "image/jpeg";
2204
- data: string;
2205
2204
  };
2206
2205
  cache_control?: {
2207
2206
  type: "ephemeral";
@@ -2218,7 +2217,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2218
2217
  }[];
2219
2218
  prompt?: string | undefined;
2220
2219
  authToken?: string | undefined;
2221
- costMode?: "max" | "lite" | "normal" | "experimental" | undefined;
2220
+ costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
2222
2221
  model?: string | undefined;
2223
2222
  cwd?: string | undefined;
2224
2223
  } | {
@@ -2252,8 +2251,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2252
2251
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2253
2252
  userKnowledgeFiles?: Record<string, string> | undefined;
2254
2253
  fileVersions?: {
2255
- path: string;
2256
2254
  content: string;
2255
+ path: string;
2257
2256
  }[][] | undefined;
2258
2257
  };
2259
2258
  authToken?: string | undefined;
@@ -2263,6 +2262,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2263
2262
  stagedChanges: string;
2264
2263
  authToken?: string | undefined;
2265
2264
  };
2265
+ type: "action";
2266
2266
  txid: number;
2267
2267
  }>]>;
2268
2268
  export type ClientMessageType = keyof typeof CLIENT_MESSAGE_SCHEMAS;
@@ -2307,36 +2307,36 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2307
2307
  path: z.ZodString;
2308
2308
  content: z.ZodString;
2309
2309
  }, "strip", z.ZodTypeAny, {
2310
+ content: string;
2310
2311
  path: string;
2311
2312
  type: "patch" | "file";
2312
- content: string;
2313
2313
  }, {
2314
+ content: string;
2314
2315
  path: string;
2315
2316
  type: "patch" | "file";
2316
- content: string;
2317
2317
  }>, "many">;
2318
2318
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2319
2319
  type: z.ZodEnum<["patch", "file"]>;
2320
2320
  path: z.ZodString;
2321
2321
  content: z.ZodString;
2322
2322
  }, "strip", z.ZodTypeAny, {
2323
+ content: string;
2323
2324
  path: string;
2324
2325
  type: "patch" | "file";
2325
- content: string;
2326
2326
  }, {
2327
+ content: string;
2327
2328
  path: string;
2328
2329
  type: "patch" | "file";
2329
- content: string;
2330
2330
  }>, "many">;
2331
2331
  addedFileVersions: z.ZodArray<z.ZodObject<{
2332
2332
  path: z.ZodString;
2333
2333
  content: z.ZodString;
2334
2334
  }, "strip", z.ZodTypeAny, {
2335
- path: string;
2336
2335
  content: string;
2337
- }, {
2338
2336
  path: string;
2337
+ }, {
2339
2338
  content: string;
2339
+ path: string;
2340
2340
  }>, "many">;
2341
2341
  resetFileVersions: z.ZodBoolean;
2342
2342
  }, {
@@ -2350,18 +2350,18 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2350
2350
  userInputId: string;
2351
2351
  response: string;
2352
2352
  changes: {
2353
+ content: string;
2353
2354
  path: string;
2354
2355
  type: "patch" | "file";
2355
- content: string;
2356
2356
  }[];
2357
2357
  changesAlreadyApplied: {
2358
+ content: string;
2358
2359
  path: string;
2359
2360
  type: "patch" | "file";
2360
- content: string;
2361
2361
  }[];
2362
2362
  addedFileVersions: {
2363
- path: string;
2364
2363
  content: string;
2364
+ path: string;
2365
2365
  }[];
2366
2366
  resetFileVersions: boolean;
2367
2367
  usage?: number | undefined;
@@ -2374,18 +2374,18 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2374
2374
  userInputId: string;
2375
2375
  response: string;
2376
2376
  changes: {
2377
+ content: string;
2377
2378
  path: string;
2378
2379
  type: "patch" | "file";
2379
- content: string;
2380
2380
  }[];
2381
2381
  changesAlreadyApplied: {
2382
+ content: string;
2382
2383
  path: string;
2383
2384
  type: "patch" | "file";
2384
- content: string;
2385
2385
  }[];
2386
2386
  addedFileVersions: {
2387
- path: string;
2388
2387
  content: string;
2388
+ path: string;
2389
2389
  }[];
2390
2390
  resetFileVersions: boolean;
2391
2391
  usage?: number | undefined;
@@ -2449,11 +2449,11 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2449
2449
  path: z.ZodString;
2450
2450
  content: z.ZodString;
2451
2451
  }, "strip", z.ZodTypeAny, {
2452
- path: string;
2453
2452
  content: string;
2454
- }, {
2455
2453
  path: string;
2454
+ }, {
2456
2455
  content: string;
2456
+ path: string;
2457
2457
  }>, "many">, "many">>;
2458
2458
  }, "strip", z.ZodTypeAny, {
2459
2459
  currentWorkingDirectory: string;
@@ -2479,8 +2479,8 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2479
2479
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2480
2480
  userKnowledgeFiles?: Record<string, string> | undefined;
2481
2481
  fileVersions?: {
2482
- path: string;
2483
2482
  content: string;
2483
+ path: string;
2484
2484
  }[][] | undefined;
2485
2485
  }, {
2486
2486
  currentWorkingDirectory: string;
@@ -2506,8 +2506,8 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2506
2506
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2507
2507
  userKnowledgeFiles?: Record<string, string> | undefined;
2508
2508
  fileVersions?: {
2509
- path: string;
2510
2509
  content: string;
2510
+ path: string;
2511
2511
  }[][] | undefined;
2512
2512
  }>;
2513
2513
  messageHistory: z.ZodArray<z.ZodObject<{
@@ -2523,14 +2523,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2523
2523
  type: "ephemeral";
2524
2524
  }>>;
2525
2525
  }, "strip", z.ZodTypeAny, {
2526
- type: "text";
2527
2526
  text: string;
2527
+ type: "text";
2528
2528
  cache_control?: {
2529
2529
  type: "ephemeral";
2530
2530
  } | undefined;
2531
2531
  }, {
2532
- type: "text";
2533
2532
  text: string;
2533
+ type: "text";
2534
2534
  cache_control?: {
2535
2535
  type: "ephemeral";
2536
2536
  } | undefined;
@@ -2547,16 +2547,16 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2547
2547
  type: "ephemeral";
2548
2548
  }>>;
2549
2549
  }, "strip", z.ZodTypeAny, {
2550
- type: "tool_use";
2551
2550
  name: string;
2551
+ type: "tool_use";
2552
2552
  id: string;
2553
2553
  input: Record<string, any>;
2554
2554
  cache_control?: {
2555
2555
  type: "ephemeral";
2556
2556
  } | undefined;
2557
2557
  }, {
2558
- type: "tool_use";
2559
2558
  name: string;
2559
+ type: "tool_use";
2560
2560
  id: string;
2561
2561
  input: Record<string, any>;
2562
2562
  cache_control?: {
@@ -2574,15 +2574,15 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2574
2574
  type: "ephemeral";
2575
2575
  }>>;
2576
2576
  }, "strip", z.ZodTypeAny, {
2577
- type: "tool_result";
2578
2577
  content: string;
2578
+ type: "tool_result";
2579
2579
  tool_use_id: string;
2580
2580
  cache_control?: {
2581
2581
  type: "ephemeral";
2582
2582
  } | undefined;
2583
2583
  }, {
2584
- type: "tool_result";
2585
2584
  content: string;
2585
+ type: "tool_result";
2586
2586
  tool_use_id: string;
2587
2587
  cache_control?: {
2588
2588
  type: "ephemeral";
@@ -2594,13 +2594,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2594
2594
  media_type: z.ZodLiteral<"image/jpeg">;
2595
2595
  data: z.ZodString;
2596
2596
  }, "strip", z.ZodTypeAny, {
2597
+ data: string;
2597
2598
  type: "base64";
2598
2599
  media_type: "image/jpeg";
2599
- data: string;
2600
2600
  }, {
2601
+ data: string;
2601
2602
  type: "base64";
2602
2603
  media_type: "image/jpeg";
2603
- data: string;
2604
2604
  }>;
2605
2605
  cache_control: z.ZodOptional<z.ZodObject<{
2606
2606
  type: z.ZodLiteral<"ephemeral">;
@@ -2612,9 +2612,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2612
2612
  }, "strip", z.ZodTypeAny, {
2613
2613
  type: "image";
2614
2614
  source: {
2615
+ data: string;
2615
2616
  type: "base64";
2616
2617
  media_type: "image/jpeg";
2617
- data: string;
2618
2618
  };
2619
2619
  cache_control?: {
2620
2620
  type: "ephemeral";
@@ -2622,9 +2622,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2622
2622
  }, {
2623
2623
  type: "image";
2624
2624
  source: {
2625
+ data: string;
2625
2626
  type: "base64";
2626
2627
  media_type: "image/jpeg";
2627
- data: string;
2628
2628
  };
2629
2629
  cache_control?: {
2630
2630
  type: "ephemeral";
@@ -2632,22 +2632,22 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2632
2632
  }>]>, "many">]>;
2633
2633
  }, "strip", z.ZodTypeAny, {
2634
2634
  content: string | ({
2635
- type: "text";
2636
2635
  text: string;
2636
+ type: "text";
2637
2637
  cache_control?: {
2638
2638
  type: "ephemeral";
2639
2639
  } | undefined;
2640
2640
  } | {
2641
- type: "tool_use";
2642
2641
  name: string;
2642
+ type: "tool_use";
2643
2643
  id: string;
2644
2644
  input: Record<string, any>;
2645
2645
  cache_control?: {
2646
2646
  type: "ephemeral";
2647
2647
  } | undefined;
2648
2648
  } | {
2649
- type: "tool_result";
2650
2649
  content: string;
2650
+ type: "tool_result";
2651
2651
  tool_use_id: string;
2652
2652
  cache_control?: {
2653
2653
  type: "ephemeral";
@@ -2655,9 +2655,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2655
2655
  } | {
2656
2656
  type: "image";
2657
2657
  source: {
2658
+ data: string;
2658
2659
  type: "base64";
2659
2660
  media_type: "image/jpeg";
2660
- data: string;
2661
2661
  };
2662
2662
  cache_control?: {
2663
2663
  type: "ephemeral";
@@ -2666,22 +2666,22 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2666
2666
  role: "user" | "assistant";
2667
2667
  }, {
2668
2668
  content: string | ({
2669
- type: "text";
2670
2669
  text: string;
2670
+ type: "text";
2671
2671
  cache_control?: {
2672
2672
  type: "ephemeral";
2673
2673
  } | undefined;
2674
2674
  } | {
2675
- type: "tool_use";
2676
2675
  name: string;
2676
+ type: "tool_use";
2677
2677
  id: string;
2678
2678
  input: Record<string, any>;
2679
2679
  cache_control?: {
2680
2680
  type: "ephemeral";
2681
2681
  } | undefined;
2682
2682
  } | {
2683
- type: "tool_result";
2684
2683
  content: string;
2684
+ type: "tool_result";
2685
2685
  tool_use_id: string;
2686
2686
  cache_control?: {
2687
2687
  type: "ephemeral";
@@ -2689,9 +2689,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2689
2689
  } | {
2690
2690
  type: "image";
2691
2691
  source: {
2692
+ data: string;
2692
2693
  type: "base64";
2693
2694
  media_type: "image/jpeg";
2694
- data: string;
2695
2695
  };
2696
2696
  cache_control?: {
2697
2697
  type: "ephemeral";
@@ -2726,28 +2726,28 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2726
2726
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2727
2727
  userKnowledgeFiles?: Record<string, string> | undefined;
2728
2728
  fileVersions?: {
2729
- path: string;
2730
2729
  content: string;
2730
+ path: string;
2731
2731
  }[][] | undefined;
2732
2732
  };
2733
2733
  messageHistory: {
2734
2734
  content: string | ({
2735
- type: "text";
2736
2735
  text: string;
2736
+ type: "text";
2737
2737
  cache_control?: {
2738
2738
  type: "ephemeral";
2739
2739
  } | undefined;
2740
2740
  } | {
2741
- type: "tool_use";
2742
2741
  name: string;
2742
+ type: "tool_use";
2743
2743
  id: string;
2744
2744
  input: Record<string, any>;
2745
2745
  cache_control?: {
2746
2746
  type: "ephemeral";
2747
2747
  } | undefined;
2748
2748
  } | {
2749
- type: "tool_result";
2750
2749
  content: string;
2750
+ type: "tool_result";
2751
2751
  tool_use_id: string;
2752
2752
  cache_control?: {
2753
2753
  type: "ephemeral";
@@ -2755,9 +2755,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2755
2755
  } | {
2756
2756
  type: "image";
2757
2757
  source: {
2758
+ data: string;
2758
2759
  type: "base64";
2759
2760
  media_type: "image/jpeg";
2760
- data: string;
2761
2761
  };
2762
2762
  cache_control?: {
2763
2763
  type: "ephemeral";
@@ -2792,28 +2792,28 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2792
2792
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2793
2793
  userKnowledgeFiles?: Record<string, string> | undefined;
2794
2794
  fileVersions?: {
2795
- path: string;
2796
2795
  content: string;
2796
+ path: string;
2797
2797
  }[][] | undefined;
2798
2798
  };
2799
2799
  messageHistory: {
2800
2800
  content: string | ({
2801
- type: "text";
2802
2801
  text: string;
2802
+ type: "text";
2803
2803
  cache_control?: {
2804
2804
  type: "ephemeral";
2805
2805
  } | undefined;
2806
2806
  } | {
2807
- type: "tool_use";
2808
2807
  name: string;
2808
+ type: "tool_use";
2809
2809
  id: string;
2810
2810
  input: Record<string, any>;
2811
2811
  cache_control?: {
2812
2812
  type: "ephemeral";
2813
2813
  } | undefined;
2814
2814
  } | {
2815
- type: "tool_result";
2816
2815
  content: string;
2816
+ type: "tool_result";
2817
2817
  tool_use_id: string;
2818
2818
  cache_control?: {
2819
2819
  type: "ephemeral";
@@ -2821,9 +2821,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2821
2821
  } | {
2822
2822
  type: "image";
2823
2823
  source: {
2824
+ data: string;
2824
2825
  type: "base64";
2825
2826
  media_type: "image/jpeg";
2826
- data: string;
2827
2827
  };
2828
2828
  cache_control?: {
2829
2829
  type: "ephemeral";
@@ -2888,28 +2888,28 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2888
2888
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2889
2889
  userKnowledgeFiles?: Record<string, string> | undefined;
2890
2890
  fileVersions?: {
2891
- path: string;
2892
2891
  content: string;
2892
+ path: string;
2893
2893
  }[][] | undefined;
2894
2894
  };
2895
2895
  messageHistory: {
2896
2896
  content: string | ({
2897
- type: "text";
2898
2897
  text: string;
2898
+ type: "text";
2899
2899
  cache_control?: {
2900
2900
  type: "ephemeral";
2901
2901
  } | undefined;
2902
2902
  } | {
2903
- type: "tool_use";
2904
2903
  name: string;
2904
+ type: "tool_use";
2905
2905
  id: string;
2906
2906
  input: Record<string, any>;
2907
2907
  cache_control?: {
2908
2908
  type: "ephemeral";
2909
2909
  } | undefined;
2910
2910
  } | {
2911
- type: "tool_result";
2912
2911
  content: string;
2912
+ type: "tool_result";
2913
2913
  tool_use_id: string;
2914
2914
  cache_control?: {
2915
2915
  type: "ephemeral";
@@ -2917,9 +2917,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2917
2917
  } | {
2918
2918
  type: "image";
2919
2919
  source: {
2920
+ data: string;
2920
2921
  type: "base64";
2921
2922
  media_type: "image/jpeg";
2922
- data: string;
2923
2923
  };
2924
2924
  cache_control?: {
2925
2925
  type: "ephemeral";
@@ -2968,28 +2968,28 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2968
2968
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2969
2969
  userKnowledgeFiles?: Record<string, string> | undefined;
2970
2970
  fileVersions?: {
2971
- path: string;
2972
2971
  content: string;
2972
+ path: string;
2973
2973
  }[][] | undefined;
2974
2974
  };
2975
2975
  messageHistory: {
2976
2976
  content: string | ({
2977
- type: "text";
2978
2977
  text: string;
2978
+ type: "text";
2979
2979
  cache_control?: {
2980
2980
  type: "ephemeral";
2981
2981
  } | undefined;
2982
2982
  } | {
2983
- type: "tool_use";
2984
2983
  name: string;
2984
+ type: "tool_use";
2985
2985
  id: string;
2986
2986
  input: Record<string, any>;
2987
2987
  cache_control?: {
2988
2988
  type: "ephemeral";
2989
2989
  } | undefined;
2990
2990
  } | {
2991
- type: "tool_result";
2992
2991
  content: string;
2992
+ type: "tool_result";
2993
2993
  tool_use_id: string;
2994
2994
  cache_control?: {
2995
2995
  type: "ephemeral";
@@ -2997,9 +2997,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2997
2997
  } | {
2998
2998
  type: "image";
2999
2999
  source: {
3000
+ data: string;
3000
3001
  type: "base64";
3001
3002
  media_type: "image/jpeg";
3002
- data: string;
3003
3003
  };
3004
3004
  cache_control?: {
3005
3005
  type: "ephemeral";
@@ -3053,84 +3053,84 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3053
3053
  path: z.ZodString;
3054
3054
  content: z.ZodString;
3055
3055
  }, "strip", z.ZodTypeAny, {
3056
+ content: string;
3056
3057
  path: string;
3057
3058
  type: "patch" | "file";
3058
- content: string;
3059
3059
  }, {
3060
+ content: string;
3060
3061
  path: string;
3061
3062
  type: "patch" | "file";
3062
- content: string;
3063
3063
  }>, "many">;
3064
3064
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
3065
3065
  type: z.ZodEnum<["patch", "file"]>;
3066
3066
  path: z.ZodString;
3067
3067
  content: z.ZodString;
3068
3068
  }, "strip", z.ZodTypeAny, {
3069
+ content: string;
3069
3070
  path: string;
3070
3071
  type: "patch" | "file";
3071
- content: string;
3072
3072
  }, {
3073
+ content: string;
3073
3074
  path: string;
3074
3075
  type: "patch" | "file";
3075
- content: string;
3076
3076
  }>, "many">;
3077
3077
  addedFileVersions: z.ZodArray<z.ZodObject<{
3078
3078
  path: z.ZodString;
3079
3079
  content: z.ZodString;
3080
3080
  }, "strip", z.ZodTypeAny, {
3081
- path: string;
3082
3081
  content: string;
3083
- }, {
3084
3082
  path: string;
3083
+ }, {
3085
3084
  content: string;
3085
+ path: string;
3086
3086
  }>, "many">;
3087
3087
  resetFileVersions: z.ZodBoolean;
3088
3088
  }, "strip", z.ZodTypeAny, {
3089
- type: "tool-call";
3090
3089
  data: {
3091
3090
  name: string;
3092
3091
  id: string;
3093
3092
  input: Record<string, any>;
3094
3093
  };
3094
+ type: "tool-call";
3095
3095
  userInputId: string;
3096
3096
  response: string;
3097
3097
  changes: {
3098
+ content: string;
3098
3099
  path: string;
3099
3100
  type: "patch" | "file";
3100
- content: string;
3101
3101
  }[];
3102
3102
  changesAlreadyApplied: {
3103
+ content: string;
3103
3104
  path: string;
3104
3105
  type: "patch" | "file";
3105
- content: string;
3106
3106
  }[];
3107
3107
  addedFileVersions: {
3108
- path: string;
3109
3108
  content: string;
3109
+ path: string;
3110
3110
  }[];
3111
3111
  resetFileVersions: boolean;
3112
3112
  }, {
3113
- type: "tool-call";
3114
3113
  data: {
3115
3114
  name: string;
3116
3115
  id: string;
3117
3116
  input: Record<string, any>;
3118
3117
  };
3118
+ type: "tool-call";
3119
3119
  userInputId: string;
3120
3120
  response: string;
3121
3121
  changes: {
3122
+ content: string;
3122
3123
  path: string;
3123
3124
  type: "patch" | "file";
3124
- content: string;
3125
3125
  }[];
3126
3126
  changesAlreadyApplied: {
3127
+ content: string;
3127
3128
  path: string;
3128
3129
  type: "patch" | "file";
3129
- content: string;
3130
3130
  }[];
3131
3131
  addedFileVersions: {
3132
- path: string;
3133
3132
  content: string;
3133
+ path: string;
3134
3134
  }[];
3135
3135
  resetFileVersions: boolean;
3136
3136
  }>, z.ZodObject<{
@@ -3219,13 +3219,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3219
3219
  error: z.ZodOptional<z.ZodString>;
3220
3220
  remainingBalance: z.ZodOptional<z.ZodNumber>;
3221
3221
  }, "strip", z.ZodTypeAny, {
3222
- message: string;
3223
3222
  type: "action-error";
3223
+ message: string;
3224
3224
  error?: string | undefined;
3225
3225
  remainingBalance?: number | undefined;
3226
3226
  }, {
3227
- message: string;
3228
3227
  type: "action-error";
3228
+ message: string;
3229
3229
  error?: string | undefined;
3230
3230
  remainingBalance?: number | undefined;
3231
3231
  }>, z.ZodObject<{
@@ -3245,7 +3245,6 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3245
3245
  type: "request-reconnect";
3246
3246
  }>]>;
3247
3247
  }, "strip", z.ZodTypeAny, {
3248
- type: "action";
3249
3248
  data: {
3250
3249
  type: "usage-response";
3251
3250
  usage: number;
@@ -3265,18 +3264,18 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3265
3264
  userInputId: string;
3266
3265
  response: string;
3267
3266
  changes: {
3267
+ content: string;
3268
3268
  path: string;
3269
3269
  type: "patch" | "file";
3270
- content: string;
3271
3270
  }[];
3272
3271
  changesAlreadyApplied: {
3272
+ content: string;
3273
3273
  path: string;
3274
3274
  type: "patch" | "file";
3275
- content: string;
3276
3275
  }[];
3277
3276
  addedFileVersions: {
3278
- path: string;
3279
3277
  content: string;
3278
+ path: string;
3280
3279
  }[];
3281
3280
  resetFileVersions: boolean;
3282
3281
  usage?: number | undefined;
@@ -3317,28 +3316,28 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3317
3316
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
3318
3317
  userKnowledgeFiles?: Record<string, string> | undefined;
3319
3318
  fileVersions?: {
3320
- path: string;
3321
3319
  content: string;
3320
+ path: string;
3322
3321
  }[][] | undefined;
3323
3322
  };
3324
3323
  messageHistory: {
3325
3324
  content: string | ({
3326
- type: "text";
3327
3325
  text: string;
3326
+ type: "text";
3328
3327
  cache_control?: {
3329
3328
  type: "ephemeral";
3330
3329
  } | undefined;
3331
3330
  } | {
3332
- type: "tool_use";
3333
3331
  name: string;
3332
+ type: "tool_use";
3334
3333
  id: string;
3335
3334
  input: Record<string, any>;
3336
3335
  cache_control?: {
3337
3336
  type: "ephemeral";
3338
3337
  } | undefined;
3339
3338
  } | {
3340
- type: "tool_result";
3341
3339
  content: string;
3340
+ type: "tool_result";
3342
3341
  tool_use_id: string;
3343
3342
  cache_control?: {
3344
3343
  type: "ephemeral";
@@ -3346,9 +3345,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3346
3345
  } | {
3347
3346
  type: "image";
3348
3347
  source: {
3348
+ data: string;
3349
3349
  type: "base64";
3350
3350
  media_type: "image/jpeg";
3351
- data: string;
3352
3351
  };
3353
3352
  cache_control?: {
3354
3353
  type: "ephemeral";
@@ -3377,27 +3376,27 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3377
3376
  requestId: string;
3378
3377
  filePaths: string[];
3379
3378
  } | {
3380
- type: "tool-call";
3381
3379
  data: {
3382
3380
  name: string;
3383
3381
  id: string;
3384
3382
  input: Record<string, any>;
3385
3383
  };
3384
+ type: "tool-call";
3386
3385
  userInputId: string;
3387
3386
  response: string;
3388
3387
  changes: {
3388
+ content: string;
3389
3389
  path: string;
3390
3390
  type: "patch" | "file";
3391
- content: string;
3392
3391
  }[];
3393
3392
  changesAlreadyApplied: {
3393
+ content: string;
3394
3394
  path: string;
3395
3395
  type: "patch" | "file";
3396
- content: string;
3397
3396
  }[];
3398
3397
  addedFileVersions: {
3399
- path: string;
3400
3398
  content: string;
3399
+ path: string;
3401
3400
  }[];
3402
3401
  resetFileVersions: boolean;
3403
3402
  } | {
@@ -3409,8 +3408,8 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3409
3408
  isUpToDate: boolean;
3410
3409
  latestVersion: string;
3411
3410
  } | {
3412
- message: string;
3413
3411
  type: "action-error";
3412
+ message: string;
3414
3413
  error?: string | undefined;
3415
3414
  remainingBalance?: number | undefined;
3416
3415
  } | {
@@ -3419,8 +3418,8 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3419
3418
  } | {
3420
3419
  type: "request-reconnect";
3421
3420
  };
3422
- }, {
3423
3421
  type: "action";
3422
+ }, {
3424
3423
  data: {
3425
3424
  type: "usage-response";
3426
3425
  usage: number;
@@ -3440,18 +3439,18 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3440
3439
  userInputId: string;
3441
3440
  response: string;
3442
3441
  changes: {
3442
+ content: string;
3443
3443
  path: string;
3444
3444
  type: "patch" | "file";
3445
- content: string;
3446
3445
  }[];
3447
3446
  changesAlreadyApplied: {
3447
+ content: string;
3448
3448
  path: string;
3449
3449
  type: "patch" | "file";
3450
- content: string;
3451
3450
  }[];
3452
3451
  addedFileVersions: {
3453
- path: string;
3454
3452
  content: string;
3453
+ path: string;
3455
3454
  }[];
3456
3455
  resetFileVersions: boolean;
3457
3456
  usage?: number | undefined;
@@ -3492,28 +3491,28 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3492
3491
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
3493
3492
  userKnowledgeFiles?: Record<string, string> | undefined;
3494
3493
  fileVersions?: {
3495
- path: string;
3496
3494
  content: string;
3495
+ path: string;
3497
3496
  }[][] | undefined;
3498
3497
  };
3499
3498
  messageHistory: {
3500
3499
  content: string | ({
3501
- type: "text";
3502
3500
  text: string;
3501
+ type: "text";
3503
3502
  cache_control?: {
3504
3503
  type: "ephemeral";
3505
3504
  } | undefined;
3506
3505
  } | {
3507
- type: "tool_use";
3508
3506
  name: string;
3507
+ type: "tool_use";
3509
3508
  id: string;
3510
3509
  input: Record<string, any>;
3511
3510
  cache_control?: {
3512
3511
  type: "ephemeral";
3513
3512
  } | undefined;
3514
3513
  } | {
3515
- type: "tool_result";
3516
3514
  content: string;
3515
+ type: "tool_result";
3517
3516
  tool_use_id: string;
3518
3517
  cache_control?: {
3519
3518
  type: "ephemeral";
@@ -3521,9 +3520,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3521
3520
  } | {
3522
3521
  type: "image";
3523
3522
  source: {
3523
+ data: string;
3524
3524
  type: "base64";
3525
3525
  media_type: "image/jpeg";
3526
- data: string;
3527
3526
  };
3528
3527
  cache_control?: {
3529
3528
  type: "ephemeral";
@@ -3552,27 +3551,27 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3552
3551
  requestId: string;
3553
3552
  filePaths: string[];
3554
3553
  } | {
3555
- type: "tool-call";
3556
3554
  data: {
3557
3555
  name: string;
3558
3556
  id: string;
3559
3557
  input: Record<string, any>;
3560
3558
  };
3559
+ type: "tool-call";
3561
3560
  userInputId: string;
3562
3561
  response: string;
3563
3562
  changes: {
3563
+ content: string;
3564
3564
  path: string;
3565
3565
  type: "patch" | "file";
3566
- content: string;
3567
3566
  }[];
3568
3567
  changesAlreadyApplied: {
3568
+ content: string;
3569
3569
  path: string;
3570
3570
  type: "patch" | "file";
3571
- content: string;
3572
3571
  }[];
3573
3572
  addedFileVersions: {
3574
- path: string;
3575
3573
  content: string;
3574
+ path: string;
3576
3575
  }[];
3577
3576
  resetFileVersions: boolean;
3578
3577
  } | {
@@ -3584,8 +3583,8 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3584
3583
  isUpToDate: boolean;
3585
3584
  latestVersion: string;
3586
3585
  } | {
3587
- message: string;
3588
3586
  type: "action-error";
3587
+ message: string;
3589
3588
  error?: string | undefined;
3590
3589
  remainingBalance?: number | undefined;
3591
3590
  } | {
@@ -3594,6 +3593,7 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3594
3593
  } | {
3595
3594
  type: "request-reconnect";
3596
3595
  };
3596
+ type: "action";
3597
3597
  }>;
3598
3598
  };
3599
3599
  export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
@@ -3634,36 +3634,36 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3634
3634
  path: z.ZodString;
3635
3635
  content: z.ZodString;
3636
3636
  }, "strip", z.ZodTypeAny, {
3637
+ content: string;
3637
3638
  path: string;
3638
3639
  type: "patch" | "file";
3639
- content: string;
3640
3640
  }, {
3641
+ content: string;
3641
3642
  path: string;
3642
3643
  type: "patch" | "file";
3643
- content: string;
3644
3644
  }>, "many">;
3645
3645
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
3646
3646
  type: z.ZodEnum<["patch", "file"]>;
3647
3647
  path: z.ZodString;
3648
3648
  content: z.ZodString;
3649
3649
  }, "strip", z.ZodTypeAny, {
3650
+ content: string;
3650
3651
  path: string;
3651
3652
  type: "patch" | "file";
3652
- content: string;
3653
3653
  }, {
3654
+ content: string;
3654
3655
  path: string;
3655
3656
  type: "patch" | "file";
3656
- content: string;
3657
3657
  }>, "many">;
3658
3658
  addedFileVersions: z.ZodArray<z.ZodObject<{
3659
3659
  path: z.ZodString;
3660
3660
  content: z.ZodString;
3661
3661
  }, "strip", z.ZodTypeAny, {
3662
- path: string;
3663
3662
  content: string;
3664
- }, {
3665
3663
  path: string;
3664
+ }, {
3666
3665
  content: string;
3666
+ path: string;
3667
3667
  }>, "many">;
3668
3668
  resetFileVersions: z.ZodBoolean;
3669
3669
  }, {
@@ -3677,18 +3677,18 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3677
3677
  userInputId: string;
3678
3678
  response: string;
3679
3679
  changes: {
3680
+ content: string;
3680
3681
  path: string;
3681
3682
  type: "patch" | "file";
3682
- content: string;
3683
3683
  }[];
3684
3684
  changesAlreadyApplied: {
3685
+ content: string;
3685
3686
  path: string;
3686
3687
  type: "patch" | "file";
3687
- content: string;
3688
3688
  }[];
3689
3689
  addedFileVersions: {
3690
- path: string;
3691
3690
  content: string;
3691
+ path: string;
3692
3692
  }[];
3693
3693
  resetFileVersions: boolean;
3694
3694
  usage?: number | undefined;
@@ -3701,18 +3701,18 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3701
3701
  userInputId: string;
3702
3702
  response: string;
3703
3703
  changes: {
3704
+ content: string;
3704
3705
  path: string;
3705
3706
  type: "patch" | "file";
3706
- content: string;
3707
3707
  }[];
3708
3708
  changesAlreadyApplied: {
3709
+ content: string;
3709
3710
  path: string;
3710
3711
  type: "patch" | "file";
3711
- content: string;
3712
3712
  }[];
3713
3713
  addedFileVersions: {
3714
- path: string;
3715
3714
  content: string;
3715
+ path: string;
3716
3716
  }[];
3717
3717
  resetFileVersions: boolean;
3718
3718
  usage?: number | undefined;
@@ -3776,11 +3776,11 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3776
3776
  path: z.ZodString;
3777
3777
  content: z.ZodString;
3778
3778
  }, "strip", z.ZodTypeAny, {
3779
- path: string;
3780
3779
  content: string;
3781
- }, {
3782
3780
  path: string;
3781
+ }, {
3783
3782
  content: string;
3783
+ path: string;
3784
3784
  }>, "many">, "many">>;
3785
3785
  }, "strip", z.ZodTypeAny, {
3786
3786
  currentWorkingDirectory: string;
@@ -3806,8 +3806,8 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3806
3806
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
3807
3807
  userKnowledgeFiles?: Record<string, string> | undefined;
3808
3808
  fileVersions?: {
3809
- path: string;
3810
3809
  content: string;
3810
+ path: string;
3811
3811
  }[][] | undefined;
3812
3812
  }, {
3813
3813
  currentWorkingDirectory: string;
@@ -3833,8 +3833,8 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3833
3833
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
3834
3834
  userKnowledgeFiles?: Record<string, string> | undefined;
3835
3835
  fileVersions?: {
3836
- path: string;
3837
3836
  content: string;
3837
+ path: string;
3838
3838
  }[][] | undefined;
3839
3839
  }>;
3840
3840
  messageHistory: z.ZodArray<z.ZodObject<{
@@ -3850,14 +3850,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3850
3850
  type: "ephemeral";
3851
3851
  }>>;
3852
3852
  }, "strip", z.ZodTypeAny, {
3853
- type: "text";
3854
3853
  text: string;
3854
+ type: "text";
3855
3855
  cache_control?: {
3856
3856
  type: "ephemeral";
3857
3857
  } | undefined;
3858
3858
  }, {
3859
- type: "text";
3860
3859
  text: string;
3860
+ type: "text";
3861
3861
  cache_control?: {
3862
3862
  type: "ephemeral";
3863
3863
  } | undefined;
@@ -3874,16 +3874,16 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3874
3874
  type: "ephemeral";
3875
3875
  }>>;
3876
3876
  }, "strip", z.ZodTypeAny, {
3877
- type: "tool_use";
3878
3877
  name: string;
3878
+ type: "tool_use";
3879
3879
  id: string;
3880
3880
  input: Record<string, any>;
3881
3881
  cache_control?: {
3882
3882
  type: "ephemeral";
3883
3883
  } | undefined;
3884
3884
  }, {
3885
- type: "tool_use";
3886
3885
  name: string;
3886
+ type: "tool_use";
3887
3887
  id: string;
3888
3888
  input: Record<string, any>;
3889
3889
  cache_control?: {
@@ -3901,15 +3901,15 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3901
3901
  type: "ephemeral";
3902
3902
  }>>;
3903
3903
  }, "strip", z.ZodTypeAny, {
3904
- type: "tool_result";
3905
3904
  content: string;
3905
+ type: "tool_result";
3906
3906
  tool_use_id: string;
3907
3907
  cache_control?: {
3908
3908
  type: "ephemeral";
3909
3909
  } | undefined;
3910
3910
  }, {
3911
- type: "tool_result";
3912
3911
  content: string;
3912
+ type: "tool_result";
3913
3913
  tool_use_id: string;
3914
3914
  cache_control?: {
3915
3915
  type: "ephemeral";
@@ -3921,13 +3921,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3921
3921
  media_type: z.ZodLiteral<"image/jpeg">;
3922
3922
  data: z.ZodString;
3923
3923
  }, "strip", z.ZodTypeAny, {
3924
+ data: string;
3924
3925
  type: "base64";
3925
3926
  media_type: "image/jpeg";
3926
- data: string;
3927
3927
  }, {
3928
+ data: string;
3928
3929
  type: "base64";
3929
3930
  media_type: "image/jpeg";
3930
- data: string;
3931
3931
  }>;
3932
3932
  cache_control: z.ZodOptional<z.ZodObject<{
3933
3933
  type: z.ZodLiteral<"ephemeral">;
@@ -3939,9 +3939,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3939
3939
  }, "strip", z.ZodTypeAny, {
3940
3940
  type: "image";
3941
3941
  source: {
3942
+ data: string;
3942
3943
  type: "base64";
3943
3944
  media_type: "image/jpeg";
3944
- data: string;
3945
3945
  };
3946
3946
  cache_control?: {
3947
3947
  type: "ephemeral";
@@ -3949,9 +3949,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3949
3949
  }, {
3950
3950
  type: "image";
3951
3951
  source: {
3952
+ data: string;
3952
3953
  type: "base64";
3953
3954
  media_type: "image/jpeg";
3954
- data: string;
3955
3955
  };
3956
3956
  cache_control?: {
3957
3957
  type: "ephemeral";
@@ -3959,22 +3959,22 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3959
3959
  }>]>, "many">]>;
3960
3960
  }, "strip", z.ZodTypeAny, {
3961
3961
  content: string | ({
3962
- type: "text";
3963
3962
  text: string;
3963
+ type: "text";
3964
3964
  cache_control?: {
3965
3965
  type: "ephemeral";
3966
3966
  } | undefined;
3967
3967
  } | {
3968
- type: "tool_use";
3969
3968
  name: string;
3969
+ type: "tool_use";
3970
3970
  id: string;
3971
3971
  input: Record<string, any>;
3972
3972
  cache_control?: {
3973
3973
  type: "ephemeral";
3974
3974
  } | undefined;
3975
3975
  } | {
3976
- type: "tool_result";
3977
3976
  content: string;
3977
+ type: "tool_result";
3978
3978
  tool_use_id: string;
3979
3979
  cache_control?: {
3980
3980
  type: "ephemeral";
@@ -3982,9 +3982,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3982
3982
  } | {
3983
3983
  type: "image";
3984
3984
  source: {
3985
+ data: string;
3985
3986
  type: "base64";
3986
3987
  media_type: "image/jpeg";
3987
- data: string;
3988
3988
  };
3989
3989
  cache_control?: {
3990
3990
  type: "ephemeral";
@@ -3993,22 +3993,22 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3993
3993
  role: "user" | "assistant";
3994
3994
  }, {
3995
3995
  content: string | ({
3996
- type: "text";
3997
3996
  text: string;
3997
+ type: "text";
3998
3998
  cache_control?: {
3999
3999
  type: "ephemeral";
4000
4000
  } | undefined;
4001
4001
  } | {
4002
- type: "tool_use";
4003
4002
  name: string;
4003
+ type: "tool_use";
4004
4004
  id: string;
4005
4005
  input: Record<string, any>;
4006
4006
  cache_control?: {
4007
4007
  type: "ephemeral";
4008
4008
  } | undefined;
4009
4009
  } | {
4010
- type: "tool_result";
4011
4010
  content: string;
4011
+ type: "tool_result";
4012
4012
  tool_use_id: string;
4013
4013
  cache_control?: {
4014
4014
  type: "ephemeral";
@@ -4016,9 +4016,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4016
4016
  } | {
4017
4017
  type: "image";
4018
4018
  source: {
4019
+ data: string;
4019
4020
  type: "base64";
4020
4021
  media_type: "image/jpeg";
4021
- data: string;
4022
4022
  };
4023
4023
  cache_control?: {
4024
4024
  type: "ephemeral";
@@ -4053,28 +4053,28 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4053
4053
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
4054
4054
  userKnowledgeFiles?: Record<string, string> | undefined;
4055
4055
  fileVersions?: {
4056
- path: string;
4057
4056
  content: string;
4057
+ path: string;
4058
4058
  }[][] | undefined;
4059
4059
  };
4060
4060
  messageHistory: {
4061
4061
  content: string | ({
4062
- type: "text";
4063
4062
  text: string;
4063
+ type: "text";
4064
4064
  cache_control?: {
4065
4065
  type: "ephemeral";
4066
4066
  } | undefined;
4067
4067
  } | {
4068
- type: "tool_use";
4069
4068
  name: string;
4069
+ type: "tool_use";
4070
4070
  id: string;
4071
4071
  input: Record<string, any>;
4072
4072
  cache_control?: {
4073
4073
  type: "ephemeral";
4074
4074
  } | undefined;
4075
4075
  } | {
4076
- type: "tool_result";
4077
4076
  content: string;
4077
+ type: "tool_result";
4078
4078
  tool_use_id: string;
4079
4079
  cache_control?: {
4080
4080
  type: "ephemeral";
@@ -4082,9 +4082,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4082
4082
  } | {
4083
4083
  type: "image";
4084
4084
  source: {
4085
+ data: string;
4085
4086
  type: "base64";
4086
4087
  media_type: "image/jpeg";
4087
- data: string;
4088
4088
  };
4089
4089
  cache_control?: {
4090
4090
  type: "ephemeral";
@@ -4119,28 +4119,28 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4119
4119
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
4120
4120
  userKnowledgeFiles?: Record<string, string> | undefined;
4121
4121
  fileVersions?: {
4122
- path: string;
4123
4122
  content: string;
4123
+ path: string;
4124
4124
  }[][] | undefined;
4125
4125
  };
4126
4126
  messageHistory: {
4127
4127
  content: string | ({
4128
- type: "text";
4129
4128
  text: string;
4129
+ type: "text";
4130
4130
  cache_control?: {
4131
4131
  type: "ephemeral";
4132
4132
  } | undefined;
4133
4133
  } | {
4134
- type: "tool_use";
4135
4134
  name: string;
4135
+ type: "tool_use";
4136
4136
  id: string;
4137
4137
  input: Record<string, any>;
4138
4138
  cache_control?: {
4139
4139
  type: "ephemeral";
4140
4140
  } | undefined;
4141
4141
  } | {
4142
- type: "tool_result";
4143
4142
  content: string;
4143
+ type: "tool_result";
4144
4144
  tool_use_id: string;
4145
4145
  cache_control?: {
4146
4146
  type: "ephemeral";
@@ -4148,9 +4148,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4148
4148
  } | {
4149
4149
  type: "image";
4150
4150
  source: {
4151
+ data: string;
4151
4152
  type: "base64";
4152
4153
  media_type: "image/jpeg";
4153
- data: string;
4154
4154
  };
4155
4155
  cache_control?: {
4156
4156
  type: "ephemeral";
@@ -4215,28 +4215,28 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4215
4215
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
4216
4216
  userKnowledgeFiles?: Record<string, string> | undefined;
4217
4217
  fileVersions?: {
4218
- path: string;
4219
4218
  content: string;
4219
+ path: string;
4220
4220
  }[][] | undefined;
4221
4221
  };
4222
4222
  messageHistory: {
4223
4223
  content: string | ({
4224
- type: "text";
4225
4224
  text: string;
4225
+ type: "text";
4226
4226
  cache_control?: {
4227
4227
  type: "ephemeral";
4228
4228
  } | undefined;
4229
4229
  } | {
4230
- type: "tool_use";
4231
4230
  name: string;
4231
+ type: "tool_use";
4232
4232
  id: string;
4233
4233
  input: Record<string, any>;
4234
4234
  cache_control?: {
4235
4235
  type: "ephemeral";
4236
4236
  } | undefined;
4237
4237
  } | {
4238
- type: "tool_result";
4239
4238
  content: string;
4239
+ type: "tool_result";
4240
4240
  tool_use_id: string;
4241
4241
  cache_control?: {
4242
4242
  type: "ephemeral";
@@ -4244,9 +4244,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4244
4244
  } | {
4245
4245
  type: "image";
4246
4246
  source: {
4247
+ data: string;
4247
4248
  type: "base64";
4248
4249
  media_type: "image/jpeg";
4249
- data: string;
4250
4250
  };
4251
4251
  cache_control?: {
4252
4252
  type: "ephemeral";
@@ -4295,28 +4295,28 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4295
4295
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
4296
4296
  userKnowledgeFiles?: Record<string, string> | undefined;
4297
4297
  fileVersions?: {
4298
- path: string;
4299
4298
  content: string;
4299
+ path: string;
4300
4300
  }[][] | undefined;
4301
4301
  };
4302
4302
  messageHistory: {
4303
4303
  content: string | ({
4304
- type: "text";
4305
4304
  text: string;
4305
+ type: "text";
4306
4306
  cache_control?: {
4307
4307
  type: "ephemeral";
4308
4308
  } | undefined;
4309
4309
  } | {
4310
- type: "tool_use";
4311
4310
  name: string;
4311
+ type: "tool_use";
4312
4312
  id: string;
4313
4313
  input: Record<string, any>;
4314
4314
  cache_control?: {
4315
4315
  type: "ephemeral";
4316
4316
  } | undefined;
4317
4317
  } | {
4318
- type: "tool_result";
4319
4318
  content: string;
4319
+ type: "tool_result";
4320
4320
  tool_use_id: string;
4321
4321
  cache_control?: {
4322
4322
  type: "ephemeral";
@@ -4324,9 +4324,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4324
4324
  } | {
4325
4325
  type: "image";
4326
4326
  source: {
4327
+ data: string;
4327
4328
  type: "base64";
4328
4329
  media_type: "image/jpeg";
4329
- data: string;
4330
4330
  };
4331
4331
  cache_control?: {
4332
4332
  type: "ephemeral";
@@ -4380,84 +4380,84 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4380
4380
  path: z.ZodString;
4381
4381
  content: z.ZodString;
4382
4382
  }, "strip", z.ZodTypeAny, {
4383
+ content: string;
4383
4384
  path: string;
4384
4385
  type: "patch" | "file";
4385
- content: string;
4386
4386
  }, {
4387
+ content: string;
4387
4388
  path: string;
4388
4389
  type: "patch" | "file";
4389
- content: string;
4390
4390
  }>, "many">;
4391
4391
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
4392
4392
  type: z.ZodEnum<["patch", "file"]>;
4393
4393
  path: z.ZodString;
4394
4394
  content: z.ZodString;
4395
4395
  }, "strip", z.ZodTypeAny, {
4396
+ content: string;
4396
4397
  path: string;
4397
4398
  type: "patch" | "file";
4398
- content: string;
4399
4399
  }, {
4400
+ content: string;
4400
4401
  path: string;
4401
4402
  type: "patch" | "file";
4402
- content: string;
4403
4403
  }>, "many">;
4404
4404
  addedFileVersions: z.ZodArray<z.ZodObject<{
4405
4405
  path: z.ZodString;
4406
4406
  content: z.ZodString;
4407
4407
  }, "strip", z.ZodTypeAny, {
4408
- path: string;
4409
4408
  content: string;
4410
- }, {
4411
4409
  path: string;
4410
+ }, {
4412
4411
  content: string;
4412
+ path: string;
4413
4413
  }>, "many">;
4414
4414
  resetFileVersions: z.ZodBoolean;
4415
4415
  }, "strip", z.ZodTypeAny, {
4416
- type: "tool-call";
4417
4416
  data: {
4418
4417
  name: string;
4419
4418
  id: string;
4420
4419
  input: Record<string, any>;
4421
4420
  };
4421
+ type: "tool-call";
4422
4422
  userInputId: string;
4423
4423
  response: string;
4424
4424
  changes: {
4425
+ content: string;
4425
4426
  path: string;
4426
4427
  type: "patch" | "file";
4427
- content: string;
4428
4428
  }[];
4429
4429
  changesAlreadyApplied: {
4430
+ content: string;
4430
4431
  path: string;
4431
4432
  type: "patch" | "file";
4432
- content: string;
4433
4433
  }[];
4434
4434
  addedFileVersions: {
4435
- path: string;
4436
4435
  content: string;
4436
+ path: string;
4437
4437
  }[];
4438
4438
  resetFileVersions: boolean;
4439
4439
  }, {
4440
- type: "tool-call";
4441
4440
  data: {
4442
4441
  name: string;
4443
4442
  id: string;
4444
4443
  input: Record<string, any>;
4445
4444
  };
4445
+ type: "tool-call";
4446
4446
  userInputId: string;
4447
4447
  response: string;
4448
4448
  changes: {
4449
+ content: string;
4449
4450
  path: string;
4450
4451
  type: "patch" | "file";
4451
- content: string;
4452
4452
  }[];
4453
4453
  changesAlreadyApplied: {
4454
+ content: string;
4454
4455
  path: string;
4455
4456
  type: "patch" | "file";
4456
- content: string;
4457
4457
  }[];
4458
4458
  addedFileVersions: {
4459
- path: string;
4460
4459
  content: string;
4460
+ path: string;
4461
4461
  }[];
4462
4462
  resetFileVersions: boolean;
4463
4463
  }>, z.ZodObject<{
@@ -4546,13 +4546,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4546
4546
  error: z.ZodOptional<z.ZodString>;
4547
4547
  remainingBalance: z.ZodOptional<z.ZodNumber>;
4548
4548
  }, "strip", z.ZodTypeAny, {
4549
- message: string;
4550
4549
  type: "action-error";
4550
+ message: string;
4551
4551
  error?: string | undefined;
4552
4552
  remainingBalance?: number | undefined;
4553
4553
  }, {
4554
- message: string;
4555
4554
  type: "action-error";
4555
+ message: string;
4556
4556
  error?: string | undefined;
4557
4557
  remainingBalance?: number | undefined;
4558
4558
  }>, z.ZodObject<{
@@ -4572,7 +4572,6 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4572
4572
  type: "request-reconnect";
4573
4573
  }>]>;
4574
4574
  }, "strip", z.ZodTypeAny, {
4575
- type: "action";
4576
4575
  data: {
4577
4576
  type: "usage-response";
4578
4577
  usage: number;
@@ -4592,18 +4591,18 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4592
4591
  userInputId: string;
4593
4592
  response: string;
4594
4593
  changes: {
4594
+ content: string;
4595
4595
  path: string;
4596
4596
  type: "patch" | "file";
4597
- content: string;
4598
4597
  }[];
4599
4598
  changesAlreadyApplied: {
4599
+ content: string;
4600
4600
  path: string;
4601
4601
  type: "patch" | "file";
4602
- content: string;
4603
4602
  }[];
4604
4603
  addedFileVersions: {
4605
- path: string;
4606
4604
  content: string;
4605
+ path: string;
4607
4606
  }[];
4608
4607
  resetFileVersions: boolean;
4609
4608
  usage?: number | undefined;
@@ -4644,28 +4643,28 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4644
4643
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
4645
4644
  userKnowledgeFiles?: Record<string, string> | undefined;
4646
4645
  fileVersions?: {
4647
- path: string;
4648
4646
  content: string;
4647
+ path: string;
4649
4648
  }[][] | undefined;
4650
4649
  };
4651
4650
  messageHistory: {
4652
4651
  content: string | ({
4653
- type: "text";
4654
4652
  text: string;
4653
+ type: "text";
4655
4654
  cache_control?: {
4656
4655
  type: "ephemeral";
4657
4656
  } | undefined;
4658
4657
  } | {
4659
- type: "tool_use";
4660
4658
  name: string;
4659
+ type: "tool_use";
4661
4660
  id: string;
4662
4661
  input: Record<string, any>;
4663
4662
  cache_control?: {
4664
4663
  type: "ephemeral";
4665
4664
  } | undefined;
4666
4665
  } | {
4667
- type: "tool_result";
4668
4666
  content: string;
4667
+ type: "tool_result";
4669
4668
  tool_use_id: string;
4670
4669
  cache_control?: {
4671
4670
  type: "ephemeral";
@@ -4673,9 +4672,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4673
4672
  } | {
4674
4673
  type: "image";
4675
4674
  source: {
4675
+ data: string;
4676
4676
  type: "base64";
4677
4677
  media_type: "image/jpeg";
4678
- data: string;
4679
4678
  };
4680
4679
  cache_control?: {
4681
4680
  type: "ephemeral";
@@ -4704,27 +4703,27 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4704
4703
  requestId: string;
4705
4704
  filePaths: string[];
4706
4705
  } | {
4707
- type: "tool-call";
4708
4706
  data: {
4709
4707
  name: string;
4710
4708
  id: string;
4711
4709
  input: Record<string, any>;
4712
4710
  };
4711
+ type: "tool-call";
4713
4712
  userInputId: string;
4714
4713
  response: string;
4715
4714
  changes: {
4715
+ content: string;
4716
4716
  path: string;
4717
4717
  type: "patch" | "file";
4718
- content: string;
4719
4718
  }[];
4720
4719
  changesAlreadyApplied: {
4720
+ content: string;
4721
4721
  path: string;
4722
4722
  type: "patch" | "file";
4723
- content: string;
4724
4723
  }[];
4725
4724
  addedFileVersions: {
4726
- path: string;
4727
4725
  content: string;
4726
+ path: string;
4728
4727
  }[];
4729
4728
  resetFileVersions: boolean;
4730
4729
  } | {
@@ -4736,8 +4735,8 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4736
4735
  isUpToDate: boolean;
4737
4736
  latestVersion: string;
4738
4737
  } | {
4739
- message: string;
4740
4738
  type: "action-error";
4739
+ message: string;
4741
4740
  error?: string | undefined;
4742
4741
  remainingBalance?: number | undefined;
4743
4742
  } | {
@@ -4746,8 +4745,8 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4746
4745
  } | {
4747
4746
  type: "request-reconnect";
4748
4747
  };
4749
- }, {
4750
4748
  type: "action";
4749
+ }, {
4751
4750
  data: {
4752
4751
  type: "usage-response";
4753
4752
  usage: number;
@@ -4767,18 +4766,18 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4767
4766
  userInputId: string;
4768
4767
  response: string;
4769
4768
  changes: {
4769
+ content: string;
4770
4770
  path: string;
4771
4771
  type: "patch" | "file";
4772
- content: string;
4773
4772
  }[];
4774
4773
  changesAlreadyApplied: {
4774
+ content: string;
4775
4775
  path: string;
4776
4776
  type: "patch" | "file";
4777
- content: string;
4778
4777
  }[];
4779
4778
  addedFileVersions: {
4780
- path: string;
4781
4779
  content: string;
4780
+ path: string;
4782
4781
  }[];
4783
4782
  resetFileVersions: boolean;
4784
4783
  usage?: number | undefined;
@@ -4819,28 +4818,28 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4819
4818
  tokenCallers?: Record<string, Record<string, string[]>> | undefined;
4820
4819
  userKnowledgeFiles?: Record<string, string> | undefined;
4821
4820
  fileVersions?: {
4822
- path: string;
4823
4821
  content: string;
4822
+ path: string;
4824
4823
  }[][] | undefined;
4825
4824
  };
4826
4825
  messageHistory: {
4827
4826
  content: string | ({
4828
- type: "text";
4829
4827
  text: string;
4828
+ type: "text";
4830
4829
  cache_control?: {
4831
4830
  type: "ephemeral";
4832
4831
  } | undefined;
4833
4832
  } | {
4834
- type: "tool_use";
4835
4833
  name: string;
4834
+ type: "tool_use";
4836
4835
  id: string;
4837
4836
  input: Record<string, any>;
4838
4837
  cache_control?: {
4839
4838
  type: "ephemeral";
4840
4839
  } | undefined;
4841
4840
  } | {
4842
- type: "tool_result";
4843
4841
  content: string;
4842
+ type: "tool_result";
4844
4843
  tool_use_id: string;
4845
4844
  cache_control?: {
4846
4845
  type: "ephemeral";
@@ -4848,9 +4847,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4848
4847
  } | {
4849
4848
  type: "image";
4850
4849
  source: {
4850
+ data: string;
4851
4851
  type: "base64";
4852
4852
  media_type: "image/jpeg";
4853
- data: string;
4854
4853
  };
4855
4854
  cache_control?: {
4856
4855
  type: "ephemeral";
@@ -4879,27 +4878,27 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4879
4878
  requestId: string;
4880
4879
  filePaths: string[];
4881
4880
  } | {
4882
- type: "tool-call";
4883
4881
  data: {
4884
4882
  name: string;
4885
4883
  id: string;
4886
4884
  input: Record<string, any>;
4887
4885
  };
4886
+ type: "tool-call";
4888
4887
  userInputId: string;
4889
4888
  response: string;
4890
4889
  changes: {
4890
+ content: string;
4891
4891
  path: string;
4892
4892
  type: "patch" | "file";
4893
- content: string;
4894
4893
  }[];
4895
4894
  changesAlreadyApplied: {
4895
+ content: string;
4896
4896
  path: string;
4897
4897
  type: "patch" | "file";
4898
- content: string;
4899
4898
  }[];
4900
4899
  addedFileVersions: {
4901
- path: string;
4902
4900
  content: string;
4901
+ path: string;
4903
4902
  }[];
4904
4903
  resetFileVersions: boolean;
4905
4904
  } | {
@@ -4911,8 +4910,8 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4911
4910
  isUpToDate: boolean;
4912
4911
  latestVersion: string;
4913
4912
  } | {
4914
- message: string;
4915
4913
  type: "action-error";
4914
+ message: string;
4916
4915
  error?: string | undefined;
4917
4916
  remainingBalance?: number | undefined;
4918
4917
  } | {
@@ -4921,6 +4920,7 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4921
4920
  } | {
4922
4921
  type: "request-reconnect";
4923
4922
  };
4923
+ type: "action";
4924
4924
  }>]>;
4925
4925
  export type ServerMessageType = keyof typeof SERVER_MESSAGE_SCHEMAS;
4926
4926
  export type ServerMessage<T extends ServerMessageType = ServerMessageType> = z.infer<(typeof SERVER_MESSAGE_SCHEMAS)[T]>;