codebuff 1.0.225 → 1.0.227

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 (65) hide show
  1. package/dist/background-process-manager.d.ts +10 -3
  2. package/dist/background-process-manager.js +110 -0
  3. package/dist/background-process-manager.js.map +1 -1
  4. package/dist/cli.js +8 -19
  5. package/dist/cli.js.map +1 -1
  6. package/dist/client.d.ts +5 -5
  7. package/dist/client.js +9 -1
  8. package/dist/client.js.map +1 -1
  9. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  10. package/dist/common/actions.d.ts +134 -134
  11. package/dist/common/billing/balance-calculator.d.ts +0 -1
  12. package/dist/common/billing/balance-calculator.js +18 -11
  13. package/dist/common/billing/balance-calculator.js.map +1 -1
  14. package/dist/common/logger.d.ts +1 -0
  15. package/dist/common/logger.js +7 -0
  16. package/dist/common/logger.js.map +1 -0
  17. package/dist/common/types/usage.d.ts +2 -2
  18. package/dist/common/util/constants.d.ts +1 -0
  19. package/dist/common/util/constants.js +7 -0
  20. package/dist/common/util/constants.js.map +1 -0
  21. package/dist/common/util/helpers.d.ts +1 -0
  22. package/dist/common/util/helpers.js +6 -0
  23. package/dist/common/util/helpers.js.map +1 -0
  24. package/dist/common/util/token-counter.d.ts +3 -0
  25. package/dist/common/util/token-counter.js +27 -0
  26. package/dist/common/util/token-counter.js.map +1 -0
  27. package/dist/common/websockets/websocket-schema.d.ts +258 -258
  28. package/dist/index.js +5 -2
  29. package/dist/index.js.map +1 -1
  30. package/dist/json-config/dev-process-manager.js +10 -3
  31. package/dist/json-config/dev-process-manager.js.map +1 -1
  32. package/dist/project-files.js +5 -1
  33. package/dist/project-files.js.map +1 -1
  34. package/dist/utils/terminal.js +2 -2
  35. package/dist/utils/terminal.js.map +1 -1
  36. package/dist/utils/tool-renderers.js +18 -18
  37. package/dist/utils/tool-renderers.js.map +1 -1
  38. package/package.json +1 -1
  39. package/dist/common/advanced-analyzer.d.ts +0 -19
  40. package/dist/common/advanced-analyzer.js +0 -140
  41. package/dist/common/advanced-analyzer.js.map +0 -1
  42. package/dist/common/billing/check-auto-topup.d.ts +0 -12
  43. package/dist/common/billing/check-auto-topup.js +0 -50
  44. package/dist/common/billing/check-auto-topup.js.map +0 -1
  45. package/dist/common/billing/credit-check.d.ts +0 -8
  46. package/dist/common/billing/credit-check.js +0 -45
  47. package/dist/common/billing/credit-check.js.map +0 -1
  48. package/dist/common/billing/rollover-logic.d.ts +0 -13
  49. package/dist/common/billing/rollover-logic.js +0 -174
  50. package/dist/common/billing/rollover-logic.js.map +0 -1
  51. package/dist/common/billing/stripe-api.d.ts +0 -31
  52. package/dist/common/billing/stripe-api.js +0 -104
  53. package/dist/common/billing/stripe-api.js.map +0 -1
  54. package/dist/common/message-image-handling.d.ts +0 -41
  55. package/dist/common/message-image-handling.js +0 -57
  56. package/dist/common/message-image-handling.js.map +0 -1
  57. package/dist/common/types/billing.d.ts +0 -16
  58. package/dist/common/types/billing.js +0 -3
  59. package/dist/common/types/billing.js.map +0 -1
  60. package/dist/common/util/process-stream.d.ts +0 -8
  61. package/dist/common/util/process-stream.js +0 -102
  62. package/dist/common/util/process-stream.js.map +0 -1
  63. package/dist/common/util/referral-credits.d.ts +0 -1
  64. package/dist/common/util/referral-credits.js +0 -48
  65. package/dist/common/util/referral-credits.js.map +0 -1
@@ -207,17 +207,17 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
207
207
  type: "ephemeral";
208
208
  }>>;
209
209
  }, "strip", z.ZodTypeAny, {
210
- id: string;
211
- name: string;
212
210
  type: "tool_use";
211
+ name: string;
212
+ id: string;
213
213
  input: Record<string, any>;
214
214
  cache_control?: {
215
215
  type: "ephemeral";
216
216
  } | undefined;
217
217
  }, {
218
- id: string;
219
- name: string;
220
218
  type: "tool_use";
219
+ name: string;
220
+ id: string;
221
221
  input: Record<string, any>;
222
222
  cache_control?: {
223
223
  type: "ephemeral";
@@ -254,13 +254,13 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
254
254
  media_type: z.ZodLiteral<"image/jpeg">;
255
255
  data: z.ZodString;
256
256
  }, "strip", z.ZodTypeAny, {
257
- data: string;
258
257
  type: "base64";
259
258
  media_type: "image/jpeg";
260
- }, {
261
259
  data: string;
260
+ }, {
262
261
  type: "base64";
263
262
  media_type: "image/jpeg";
263
+ data: string;
264
264
  }>;
265
265
  cache_control: z.ZodOptional<z.ZodObject<{
266
266
  type: z.ZodLiteral<"ephemeral">;
@@ -272,9 +272,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
272
272
  }, "strip", z.ZodTypeAny, {
273
273
  type: "image";
274
274
  source: {
275
- data: string;
276
275
  type: "base64";
277
276
  media_type: "image/jpeg";
277
+ data: string;
278
278
  };
279
279
  cache_control?: {
280
280
  type: "ephemeral";
@@ -282,9 +282,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
282
282
  }, {
283
283
  type: "image";
284
284
  source: {
285
- data: string;
286
285
  type: "base64";
287
286
  media_type: "image/jpeg";
287
+ data: string;
288
288
  };
289
289
  cache_control?: {
290
290
  type: "ephemeral";
@@ -298,9 +298,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
298
298
  type: "ephemeral";
299
299
  } | undefined;
300
300
  } | {
301
- id: string;
302
- name: string;
303
301
  type: "tool_use";
302
+ name: string;
303
+ id: string;
304
304
  input: Record<string, any>;
305
305
  cache_control?: {
306
306
  type: "ephemeral";
@@ -315,9 +315,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
315
315
  } | {
316
316
  type: "image";
317
317
  source: {
318
- data: string;
319
318
  type: "base64";
320
319
  media_type: "image/jpeg";
320
+ data: string;
321
321
  };
322
322
  cache_control?: {
323
323
  type: "ephemeral";
@@ -332,9 +332,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
332
332
  type: "ephemeral";
333
333
  } | undefined;
334
334
  } | {
335
- id: string;
336
- name: string;
337
335
  type: "tool_use";
336
+ name: string;
337
+ id: string;
338
338
  input: Record<string, any>;
339
339
  cache_control?: {
340
340
  type: "ephemeral";
@@ -349,9 +349,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
349
349
  } | {
350
350
  type: "image";
351
351
  source: {
352
- data: string;
353
352
  type: "base64";
354
353
  media_type: "image/jpeg";
354
+ data: string;
355
355
  };
356
356
  cache_control?: {
357
357
  type: "ephemeral";
@@ -397,9 +397,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
397
397
  type: "ephemeral";
398
398
  } | undefined;
399
399
  } | {
400
- id: string;
401
- name: string;
402
400
  type: "tool_use";
401
+ name: string;
402
+ id: string;
403
403
  input: Record<string, any>;
404
404
  cache_control?: {
405
405
  type: "ephemeral";
@@ -414,9 +414,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
414
414
  } | {
415
415
  type: "image";
416
416
  source: {
417
- data: string;
418
417
  type: "base64";
419
418
  media_type: "image/jpeg";
419
+ data: string;
420
420
  };
421
421
  cache_control?: {
422
422
  type: "ephemeral";
@@ -462,9 +462,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
462
462
  type: "ephemeral";
463
463
  } | undefined;
464
464
  } | {
465
- id: string;
466
- name: string;
467
465
  type: "tool_use";
466
+ name: string;
467
+ id: string;
468
468
  input: Record<string, any>;
469
469
  cache_control?: {
470
470
  type: "ephemeral";
@@ -479,9 +479,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
479
479
  } | {
480
480
  type: "image";
481
481
  source: {
482
- data: string;
483
482
  type: "base64";
484
483
  media_type: "image/jpeg";
484
+ data: string;
485
485
  };
486
486
  cache_control?: {
487
487
  type: "ephemeral";
@@ -496,12 +496,12 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
496
496
  result: z.ZodString;
497
497
  id: z.ZodString;
498
498
  }, "strip", z.ZodTypeAny, {
499
- id: string;
500
499
  name: string;
500
+ id: string;
501
501
  result: string;
502
502
  }, {
503
- id: string;
504
503
  name: string;
504
+ id: string;
505
505
  result: string;
506
506
  }>, "many">;
507
507
  model: z.ZodOptional<z.ZodString>;
@@ -547,9 +547,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
547
547
  type: "ephemeral";
548
548
  } | undefined;
549
549
  } | {
550
- id: string;
551
- name: string;
552
550
  type: "tool_use";
551
+ name: string;
552
+ id: string;
553
553
  input: Record<string, any>;
554
554
  cache_control?: {
555
555
  type: "ephemeral";
@@ -564,9 +564,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
564
564
  } | {
565
565
  type: "image";
566
566
  source: {
567
- data: string;
568
567
  type: "base64";
569
568
  media_type: "image/jpeg";
569
+ data: string;
570
570
  };
571
571
  cache_control?: {
572
572
  type: "ephemeral";
@@ -577,13 +577,13 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
577
577
  consecutiveAssistantMessages?: number | undefined;
578
578
  };
579
579
  toolResults: {
580
- id: string;
581
580
  name: string;
581
+ id: string;
582
582
  result: string;
583
583
  }[];
584
- model?: string | undefined;
585
584
  prompt?: string | undefined;
586
585
  authToken?: string | undefined;
586
+ model?: string | undefined;
587
587
  }, {
588
588
  type: "prompt";
589
589
  promptId: string;
@@ -625,9 +625,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
625
625
  type: "ephemeral";
626
626
  } | undefined;
627
627
  } | {
628
- id: string;
629
- name: string;
630
628
  type: "tool_use";
629
+ name: string;
630
+ id: string;
631
631
  input: Record<string, any>;
632
632
  cache_control?: {
633
633
  type: "ephemeral";
@@ -642,9 +642,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
642
642
  } | {
643
643
  type: "image";
644
644
  source: {
645
- data: string;
646
645
  type: "base64";
647
646
  media_type: "image/jpeg";
647
+ data: string;
648
648
  };
649
649
  cache_control?: {
650
650
  type: "ephemeral";
@@ -655,14 +655,14 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
655
655
  consecutiveAssistantMessages?: number | undefined;
656
656
  };
657
657
  toolResults: {
658
- id: string;
659
658
  name: string;
659
+ id: string;
660
660
  result: string;
661
661
  }[];
662
- model?: string | undefined;
663
662
  prompt?: string | undefined;
664
663
  authToken?: string | undefined;
665
664
  costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
665
+ model?: string | undefined;
666
666
  }>, z.ZodObject<{
667
667
  type: z.ZodLiteral<"read-files-response">;
668
668
  files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
@@ -867,6 +867,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
867
867
  authToken?: string | undefined;
868
868
  }>]>;
869
869
  }, "strip", z.ZodTypeAny, {
870
+ type: "action";
870
871
  data: {
871
872
  type: "prompt";
872
873
  promptId: string;
@@ -909,9 +910,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
909
910
  type: "ephemeral";
910
911
  } | undefined;
911
912
  } | {
912
- id: string;
913
- name: string;
914
913
  type: "tool_use";
914
+ name: string;
915
+ id: string;
915
916
  input: Record<string, any>;
916
917
  cache_control?: {
917
918
  type: "ephemeral";
@@ -926,9 +927,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
926
927
  } | {
927
928
  type: "image";
928
929
  source: {
929
- data: string;
930
930
  type: "base64";
931
931
  media_type: "image/jpeg";
932
+ data: string;
932
933
  };
933
934
  cache_control?: {
934
935
  type: "ephemeral";
@@ -939,13 +940,13 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
939
940
  consecutiveAssistantMessages?: number | undefined;
940
941
  };
941
942
  toolResults: {
942
- id: string;
943
943
  name: string;
944
+ id: string;
944
945
  result: string;
945
946
  }[];
946
- model?: string | undefined;
947
947
  prompt?: string | undefined;
948
948
  authToken?: string | undefined;
949
+ model?: string | undefined;
949
950
  } | {
950
951
  type: "read-files-response";
951
952
  files: Record<string, string | null>;
@@ -987,9 +988,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
987
988
  stagedChanges: string;
988
989
  authToken?: string | undefined;
989
990
  };
990
- type: "action";
991
991
  txid: number;
992
992
  }, {
993
+ type: "action";
993
994
  data: {
994
995
  type: "prompt";
995
996
  promptId: string;
@@ -1031,9 +1032,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1031
1032
  type: "ephemeral";
1032
1033
  } | undefined;
1033
1034
  } | {
1034
- id: string;
1035
- name: string;
1036
1035
  type: "tool_use";
1036
+ name: string;
1037
+ id: string;
1037
1038
  input: Record<string, any>;
1038
1039
  cache_control?: {
1039
1040
  type: "ephemeral";
@@ -1048,9 +1049,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1048
1049
  } | {
1049
1050
  type: "image";
1050
1051
  source: {
1051
- data: string;
1052
1052
  type: "base64";
1053
1053
  media_type: "image/jpeg";
1054
+ data: string;
1054
1055
  };
1055
1056
  cache_control?: {
1056
1057
  type: "ephemeral";
@@ -1061,14 +1062,14 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1061
1062
  consecutiveAssistantMessages?: number | undefined;
1062
1063
  };
1063
1064
  toolResults: {
1064
- id: string;
1065
1065
  name: string;
1066
+ id: string;
1066
1067
  result: string;
1067
1068
  }[];
1068
- model?: string | undefined;
1069
1069
  prompt?: string | undefined;
1070
1070
  authToken?: string | undefined;
1071
1071
  costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
1072
+ model?: string | undefined;
1072
1073
  } | {
1073
1074
  type: "read-files-response";
1074
1075
  files: Record<string, string | null>;
@@ -1110,7 +1111,6 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1110
1111
  stagedChanges: string;
1111
1112
  authToken?: string | undefined;
1112
1113
  };
1113
- type: "action";
1114
1114
  txid: number;
1115
1115
  }>;
1116
1116
  };
@@ -1317,17 +1317,17 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1317
1317
  type: "ephemeral";
1318
1318
  }>>;
1319
1319
  }, "strip", z.ZodTypeAny, {
1320
- id: string;
1321
- name: string;
1322
1320
  type: "tool_use";
1321
+ name: string;
1322
+ id: string;
1323
1323
  input: Record<string, any>;
1324
1324
  cache_control?: {
1325
1325
  type: "ephemeral";
1326
1326
  } | undefined;
1327
1327
  }, {
1328
- id: string;
1329
- name: string;
1330
1328
  type: "tool_use";
1329
+ name: string;
1330
+ id: string;
1331
1331
  input: Record<string, any>;
1332
1332
  cache_control?: {
1333
1333
  type: "ephemeral";
@@ -1364,13 +1364,13 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1364
1364
  media_type: z.ZodLiteral<"image/jpeg">;
1365
1365
  data: z.ZodString;
1366
1366
  }, "strip", z.ZodTypeAny, {
1367
- data: string;
1368
1367
  type: "base64";
1369
1368
  media_type: "image/jpeg";
1370
- }, {
1371
1369
  data: string;
1370
+ }, {
1372
1371
  type: "base64";
1373
1372
  media_type: "image/jpeg";
1373
+ data: string;
1374
1374
  }>;
1375
1375
  cache_control: z.ZodOptional<z.ZodObject<{
1376
1376
  type: z.ZodLiteral<"ephemeral">;
@@ -1382,9 +1382,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1382
1382
  }, "strip", z.ZodTypeAny, {
1383
1383
  type: "image";
1384
1384
  source: {
1385
- data: string;
1386
1385
  type: "base64";
1387
1386
  media_type: "image/jpeg";
1387
+ data: string;
1388
1388
  };
1389
1389
  cache_control?: {
1390
1390
  type: "ephemeral";
@@ -1392,9 +1392,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1392
1392
  }, {
1393
1393
  type: "image";
1394
1394
  source: {
1395
- data: string;
1396
1395
  type: "base64";
1397
1396
  media_type: "image/jpeg";
1397
+ data: string;
1398
1398
  };
1399
1399
  cache_control?: {
1400
1400
  type: "ephemeral";
@@ -1408,9 +1408,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1408
1408
  type: "ephemeral";
1409
1409
  } | undefined;
1410
1410
  } | {
1411
- id: string;
1412
- name: string;
1413
1411
  type: "tool_use";
1412
+ name: string;
1413
+ id: string;
1414
1414
  input: Record<string, any>;
1415
1415
  cache_control?: {
1416
1416
  type: "ephemeral";
@@ -1425,9 +1425,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1425
1425
  } | {
1426
1426
  type: "image";
1427
1427
  source: {
1428
- data: string;
1429
1428
  type: "base64";
1430
1429
  media_type: "image/jpeg";
1430
+ data: string;
1431
1431
  };
1432
1432
  cache_control?: {
1433
1433
  type: "ephemeral";
@@ -1442,9 +1442,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1442
1442
  type: "ephemeral";
1443
1443
  } | undefined;
1444
1444
  } | {
1445
- id: string;
1446
- name: string;
1447
1445
  type: "tool_use";
1446
+ name: string;
1447
+ id: string;
1448
1448
  input: Record<string, any>;
1449
1449
  cache_control?: {
1450
1450
  type: "ephemeral";
@@ -1459,9 +1459,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1459
1459
  } | {
1460
1460
  type: "image";
1461
1461
  source: {
1462
- data: string;
1463
1462
  type: "base64";
1464
1463
  media_type: "image/jpeg";
1464
+ data: string;
1465
1465
  };
1466
1466
  cache_control?: {
1467
1467
  type: "ephemeral";
@@ -1507,9 +1507,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1507
1507
  type: "ephemeral";
1508
1508
  } | undefined;
1509
1509
  } | {
1510
- id: string;
1511
- name: string;
1512
1510
  type: "tool_use";
1511
+ name: string;
1512
+ id: string;
1513
1513
  input: Record<string, any>;
1514
1514
  cache_control?: {
1515
1515
  type: "ephemeral";
@@ -1524,9 +1524,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1524
1524
  } | {
1525
1525
  type: "image";
1526
1526
  source: {
1527
- data: string;
1528
1527
  type: "base64";
1529
1528
  media_type: "image/jpeg";
1529
+ data: string;
1530
1530
  };
1531
1531
  cache_control?: {
1532
1532
  type: "ephemeral";
@@ -1572,9 +1572,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1572
1572
  type: "ephemeral";
1573
1573
  } | undefined;
1574
1574
  } | {
1575
- id: string;
1576
- name: string;
1577
1575
  type: "tool_use";
1576
+ name: string;
1577
+ id: string;
1578
1578
  input: Record<string, any>;
1579
1579
  cache_control?: {
1580
1580
  type: "ephemeral";
@@ -1589,9 +1589,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1589
1589
  } | {
1590
1590
  type: "image";
1591
1591
  source: {
1592
- data: string;
1593
1592
  type: "base64";
1594
1593
  media_type: "image/jpeg";
1594
+ data: string;
1595
1595
  };
1596
1596
  cache_control?: {
1597
1597
  type: "ephemeral";
@@ -1606,12 +1606,12 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1606
1606
  result: z.ZodString;
1607
1607
  id: z.ZodString;
1608
1608
  }, "strip", z.ZodTypeAny, {
1609
- id: string;
1610
1609
  name: string;
1610
+ id: string;
1611
1611
  result: string;
1612
1612
  }, {
1613
- id: string;
1614
1613
  name: string;
1614
+ id: string;
1615
1615
  result: string;
1616
1616
  }>, "many">;
1617
1617
  model: z.ZodOptional<z.ZodString>;
@@ -1657,9 +1657,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1657
1657
  type: "ephemeral";
1658
1658
  } | undefined;
1659
1659
  } | {
1660
- id: string;
1661
- name: string;
1662
1660
  type: "tool_use";
1661
+ name: string;
1662
+ id: string;
1663
1663
  input: Record<string, any>;
1664
1664
  cache_control?: {
1665
1665
  type: "ephemeral";
@@ -1674,9 +1674,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1674
1674
  } | {
1675
1675
  type: "image";
1676
1676
  source: {
1677
- data: string;
1678
1677
  type: "base64";
1679
1678
  media_type: "image/jpeg";
1679
+ data: string;
1680
1680
  };
1681
1681
  cache_control?: {
1682
1682
  type: "ephemeral";
@@ -1687,13 +1687,13 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1687
1687
  consecutiveAssistantMessages?: number | undefined;
1688
1688
  };
1689
1689
  toolResults: {
1690
- id: string;
1691
1690
  name: string;
1691
+ id: string;
1692
1692
  result: string;
1693
1693
  }[];
1694
- model?: string | undefined;
1695
1694
  prompt?: string | undefined;
1696
1695
  authToken?: string | undefined;
1696
+ model?: string | undefined;
1697
1697
  }, {
1698
1698
  type: "prompt";
1699
1699
  promptId: string;
@@ -1735,9 +1735,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1735
1735
  type: "ephemeral";
1736
1736
  } | undefined;
1737
1737
  } | {
1738
- id: string;
1739
- name: string;
1740
1738
  type: "tool_use";
1739
+ name: string;
1740
+ id: string;
1741
1741
  input: Record<string, any>;
1742
1742
  cache_control?: {
1743
1743
  type: "ephemeral";
@@ -1752,9 +1752,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1752
1752
  } | {
1753
1753
  type: "image";
1754
1754
  source: {
1755
- data: string;
1756
1755
  type: "base64";
1757
1756
  media_type: "image/jpeg";
1757
+ data: string;
1758
1758
  };
1759
1759
  cache_control?: {
1760
1760
  type: "ephemeral";
@@ -1765,14 +1765,14 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1765
1765
  consecutiveAssistantMessages?: number | undefined;
1766
1766
  };
1767
1767
  toolResults: {
1768
- id: string;
1769
1768
  name: string;
1769
+ id: string;
1770
1770
  result: string;
1771
1771
  }[];
1772
- model?: string | undefined;
1773
1772
  prompt?: string | undefined;
1774
1773
  authToken?: string | undefined;
1775
1774
  costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
1775
+ model?: string | undefined;
1776
1776
  }>, z.ZodObject<{
1777
1777
  type: z.ZodLiteral<"read-files-response">;
1778
1778
  files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
@@ -1977,6 +1977,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1977
1977
  authToken?: string | undefined;
1978
1978
  }>]>;
1979
1979
  }, "strip", z.ZodTypeAny, {
1980
+ type: "action";
1980
1981
  data: {
1981
1982
  type: "prompt";
1982
1983
  promptId: string;
@@ -2019,9 +2020,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2019
2020
  type: "ephemeral";
2020
2021
  } | undefined;
2021
2022
  } | {
2022
- id: string;
2023
- name: string;
2024
2023
  type: "tool_use";
2024
+ name: string;
2025
+ id: string;
2025
2026
  input: Record<string, any>;
2026
2027
  cache_control?: {
2027
2028
  type: "ephemeral";
@@ -2036,9 +2037,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2036
2037
  } | {
2037
2038
  type: "image";
2038
2039
  source: {
2039
- data: string;
2040
2040
  type: "base64";
2041
2041
  media_type: "image/jpeg";
2042
+ data: string;
2042
2043
  };
2043
2044
  cache_control?: {
2044
2045
  type: "ephemeral";
@@ -2049,13 +2050,13 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2049
2050
  consecutiveAssistantMessages?: number | undefined;
2050
2051
  };
2051
2052
  toolResults: {
2052
- id: string;
2053
2053
  name: string;
2054
+ id: string;
2054
2055
  result: string;
2055
2056
  }[];
2056
- model?: string | undefined;
2057
2057
  prompt?: string | undefined;
2058
2058
  authToken?: string | undefined;
2059
+ model?: string | undefined;
2059
2060
  } | {
2060
2061
  type: "read-files-response";
2061
2062
  files: Record<string, string | null>;
@@ -2097,9 +2098,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2097
2098
  stagedChanges: string;
2098
2099
  authToken?: string | undefined;
2099
2100
  };
2100
- type: "action";
2101
2101
  txid: number;
2102
2102
  }, {
2103
+ type: "action";
2103
2104
  data: {
2104
2105
  type: "prompt";
2105
2106
  promptId: string;
@@ -2141,9 +2142,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2141
2142
  type: "ephemeral";
2142
2143
  } | undefined;
2143
2144
  } | {
2144
- id: string;
2145
- name: string;
2146
2145
  type: "tool_use";
2146
+ name: string;
2147
+ id: string;
2147
2148
  input: Record<string, any>;
2148
2149
  cache_control?: {
2149
2150
  type: "ephemeral";
@@ -2158,9 +2159,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2158
2159
  } | {
2159
2160
  type: "image";
2160
2161
  source: {
2161
- data: string;
2162
2162
  type: "base64";
2163
2163
  media_type: "image/jpeg";
2164
+ data: string;
2164
2165
  };
2165
2166
  cache_control?: {
2166
2167
  type: "ephemeral";
@@ -2171,14 +2172,14 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2171
2172
  consecutiveAssistantMessages?: number | undefined;
2172
2173
  };
2173
2174
  toolResults: {
2174
- id: string;
2175
2175
  name: string;
2176
+ id: string;
2176
2177
  result: string;
2177
2178
  }[];
2178
- model?: string | undefined;
2179
2179
  prompt?: string | undefined;
2180
2180
  authToken?: string | undefined;
2181
2181
  costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
2182
+ model?: string | undefined;
2182
2183
  } | {
2183
2184
  type: "read-files-response";
2184
2185
  files: Record<string, string | null>;
@@ -2220,7 +2221,6 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2220
2221
  stagedChanges: string;
2221
2222
  authToken?: string | undefined;
2222
2223
  };
2223
- type: "action";
2224
2224
  txid: number;
2225
2225
  }>]>;
2226
2226
  export type ClientMessageType = keyof typeof CLIENT_MESSAGE_SCHEMAS;
@@ -2298,16 +2298,16 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2298
2298
  }>, "many">;
2299
2299
  resetFileVersions: z.ZodBoolean;
2300
2300
  }, {
2301
- next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2302
2301
  usage: z.ZodOptional<z.ZodNumber>;
2303
2302
  remainingBalance: z.ZodOptional<z.ZodNumber>;
2304
2303
  balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("../types/grant").GrantType, ...import("../types/grant").GrantType[]]>, z.ZodNumber>>>;
2304
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2305
2305
  nextMonthlyGrant: z.ZodOptional<z.ZodNumber>;
2306
2306
  autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
2307
2307
  }>, "strip", z.ZodTypeAny, {
2308
2308
  type: "response-complete";
2309
- response: string;
2310
2309
  userInputId: string;
2310
+ response: string;
2311
2311
  changes: {
2312
2312
  type: "patch" | "file";
2313
2313
  path: string;
@@ -2323,16 +2323,16 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2323
2323
  content: string;
2324
2324
  }[];
2325
2325
  resetFileVersions: boolean;
2326
- next_quota_reset?: Date | null | undefined;
2327
2326
  usage?: number | undefined;
2328
2327
  remainingBalance?: number | undefined;
2329
2328
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
2329
+ next_quota_reset?: Date | null | undefined;
2330
2330
  nextMonthlyGrant?: number | undefined;
2331
2331
  autoTopupAdded?: number | undefined;
2332
2332
  }, {
2333
2333
  type: "response-complete";
2334
- response: string;
2335
2334
  userInputId: string;
2335
+ response: string;
2336
2336
  changes: {
2337
2337
  type: "patch" | "file";
2338
2338
  path: string;
@@ -2348,10 +2348,10 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2348
2348
  content: string;
2349
2349
  }[];
2350
2350
  resetFileVersions: boolean;
2351
- next_quota_reset?: Date | null | undefined;
2352
2351
  usage?: number | undefined;
2353
2352
  remainingBalance?: number | undefined;
2354
2353
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
2354
+ next_quota_reset?: Date | null | undefined;
2355
2355
  nextMonthlyGrant?: number | undefined;
2356
2356
  autoTopupAdded?: number | undefined;
2357
2357
  }>, z.ZodObject<{
@@ -2505,17 +2505,17 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2505
2505
  type: "ephemeral";
2506
2506
  }>>;
2507
2507
  }, "strip", z.ZodTypeAny, {
2508
- id: string;
2509
- name: string;
2510
2508
  type: "tool_use";
2509
+ name: string;
2510
+ id: string;
2511
2511
  input: Record<string, any>;
2512
2512
  cache_control?: {
2513
2513
  type: "ephemeral";
2514
2514
  } | undefined;
2515
2515
  }, {
2516
- id: string;
2517
- name: string;
2518
2516
  type: "tool_use";
2517
+ name: string;
2518
+ id: string;
2519
2519
  input: Record<string, any>;
2520
2520
  cache_control?: {
2521
2521
  type: "ephemeral";
@@ -2552,13 +2552,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2552
2552
  media_type: z.ZodLiteral<"image/jpeg">;
2553
2553
  data: z.ZodString;
2554
2554
  }, "strip", z.ZodTypeAny, {
2555
- data: string;
2556
2555
  type: "base64";
2557
2556
  media_type: "image/jpeg";
2558
- }, {
2559
2557
  data: string;
2558
+ }, {
2560
2559
  type: "base64";
2561
2560
  media_type: "image/jpeg";
2561
+ data: string;
2562
2562
  }>;
2563
2563
  cache_control: z.ZodOptional<z.ZodObject<{
2564
2564
  type: z.ZodLiteral<"ephemeral">;
@@ -2570,9 +2570,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2570
2570
  }, "strip", z.ZodTypeAny, {
2571
2571
  type: "image";
2572
2572
  source: {
2573
- data: string;
2574
2573
  type: "base64";
2575
2574
  media_type: "image/jpeg";
2575
+ data: string;
2576
2576
  };
2577
2577
  cache_control?: {
2578
2578
  type: "ephemeral";
@@ -2580,9 +2580,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2580
2580
  }, {
2581
2581
  type: "image";
2582
2582
  source: {
2583
- data: string;
2584
2583
  type: "base64";
2585
2584
  media_type: "image/jpeg";
2585
+ data: string;
2586
2586
  };
2587
2587
  cache_control?: {
2588
2588
  type: "ephemeral";
@@ -2596,9 +2596,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2596
2596
  type: "ephemeral";
2597
2597
  } | undefined;
2598
2598
  } | {
2599
- id: string;
2600
- name: string;
2601
2599
  type: "tool_use";
2600
+ name: string;
2601
+ id: string;
2602
2602
  input: Record<string, any>;
2603
2603
  cache_control?: {
2604
2604
  type: "ephemeral";
@@ -2613,9 +2613,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2613
2613
  } | {
2614
2614
  type: "image";
2615
2615
  source: {
2616
- data: string;
2617
2616
  type: "base64";
2618
2617
  media_type: "image/jpeg";
2618
+ data: string;
2619
2619
  };
2620
2620
  cache_control?: {
2621
2621
  type: "ephemeral";
@@ -2630,9 +2630,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2630
2630
  type: "ephemeral";
2631
2631
  } | undefined;
2632
2632
  } | {
2633
- id: string;
2634
- name: string;
2635
2633
  type: "tool_use";
2634
+ name: string;
2635
+ id: string;
2636
2636
  input: Record<string, any>;
2637
2637
  cache_control?: {
2638
2638
  type: "ephemeral";
@@ -2647,9 +2647,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2647
2647
  } | {
2648
2648
  type: "image";
2649
2649
  source: {
2650
- data: string;
2651
2650
  type: "base64";
2652
2651
  media_type: "image/jpeg";
2652
+ data: string;
2653
2653
  };
2654
2654
  cache_control?: {
2655
2655
  type: "ephemeral";
@@ -2695,9 +2695,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2695
2695
  type: "ephemeral";
2696
2696
  } | undefined;
2697
2697
  } | {
2698
- id: string;
2699
- name: string;
2700
2698
  type: "tool_use";
2699
+ name: string;
2700
+ id: string;
2701
2701
  input: Record<string, any>;
2702
2702
  cache_control?: {
2703
2703
  type: "ephemeral";
@@ -2712,9 +2712,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2712
2712
  } | {
2713
2713
  type: "image";
2714
2714
  source: {
2715
- data: string;
2716
2715
  type: "base64";
2717
2716
  media_type: "image/jpeg";
2717
+ data: string;
2718
2718
  };
2719
2719
  cache_control?: {
2720
2720
  type: "ephemeral";
@@ -2760,9 +2760,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2760
2760
  type: "ephemeral";
2761
2761
  } | undefined;
2762
2762
  } | {
2763
- id: string;
2764
- name: string;
2765
2763
  type: "tool_use";
2764
+ name: string;
2765
+ id: string;
2766
2766
  input: Record<string, any>;
2767
2767
  cache_control?: {
2768
2768
  type: "ephemeral";
@@ -2777,9 +2777,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2777
2777
  } | {
2778
2778
  type: "image";
2779
2779
  source: {
2780
- data: string;
2781
2780
  type: "base64";
2782
2781
  media_type: "image/jpeg";
2782
+ data: string;
2783
2783
  };
2784
2784
  cache_control?: {
2785
2785
  type: "ephemeral";
@@ -2794,12 +2794,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2794
2794
  parameters: z.ZodRecord<z.ZodString, z.ZodString>;
2795
2795
  id: z.ZodString;
2796
2796
  }, "strip", z.ZodTypeAny, {
2797
- id: string;
2798
2797
  name: string;
2798
+ id: string;
2799
2799
  parameters: Record<string, string>;
2800
2800
  }, {
2801
- id: string;
2802
2801
  name: string;
2802
+ id: string;
2803
2803
  parameters: Record<string, string>;
2804
2804
  }>, "many">;
2805
2805
  toolResults: z.ZodArray<z.ZodObject<{
@@ -2807,12 +2807,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2807
2807
  result: z.ZodString;
2808
2808
  id: z.ZodString;
2809
2809
  }, "strip", z.ZodTypeAny, {
2810
- id: string;
2811
2810
  name: string;
2811
+ id: string;
2812
2812
  result: string;
2813
2813
  }, {
2814
- id: string;
2815
2814
  name: string;
2815
+ id: string;
2816
2816
  result: string;
2817
2817
  }>, "many">;
2818
2818
  }, "strip", z.ZodTypeAny, {
@@ -2855,9 +2855,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2855
2855
  type: "ephemeral";
2856
2856
  } | undefined;
2857
2857
  } | {
2858
- id: string;
2859
- name: string;
2860
2858
  type: "tool_use";
2859
+ name: string;
2860
+ id: string;
2861
2861
  input: Record<string, any>;
2862
2862
  cache_control?: {
2863
2863
  type: "ephemeral";
@@ -2872,9 +2872,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2872
2872
  } | {
2873
2873
  type: "image";
2874
2874
  source: {
2875
- data: string;
2876
2875
  type: "base64";
2877
2876
  media_type: "image/jpeg";
2877
+ data: string;
2878
2878
  };
2879
2879
  cache_control?: {
2880
2880
  type: "ephemeral";
@@ -2885,13 +2885,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2885
2885
  consecutiveAssistantMessages?: number | undefined;
2886
2886
  };
2887
2887
  toolResults: {
2888
- id: string;
2889
2888
  name: string;
2889
+ id: string;
2890
2890
  result: string;
2891
2891
  }[];
2892
2892
  toolCalls: {
2893
- id: string;
2894
2893
  name: string;
2894
+ id: string;
2895
2895
  parameters: Record<string, string>;
2896
2896
  }[];
2897
2897
  }, {
@@ -2934,9 +2934,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2934
2934
  type: "ephemeral";
2935
2935
  } | undefined;
2936
2936
  } | {
2937
- id: string;
2938
- name: string;
2939
2937
  type: "tool_use";
2938
+ name: string;
2939
+ id: string;
2940
2940
  input: Record<string, any>;
2941
2941
  cache_control?: {
2942
2942
  type: "ephemeral";
@@ -2951,9 +2951,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2951
2951
  } | {
2952
2952
  type: "image";
2953
2953
  source: {
2954
- data: string;
2955
2954
  type: "base64";
2956
2955
  media_type: "image/jpeg";
2956
+ data: string;
2957
2957
  };
2958
2958
  cache_control?: {
2959
2959
  type: "ephemeral";
@@ -2964,13 +2964,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2964
2964
  consecutiveAssistantMessages?: number | undefined;
2965
2965
  };
2966
2966
  toolResults: {
2967
- id: string;
2968
2967
  name: string;
2968
+ id: string;
2969
2969
  result: string;
2970
2970
  }[];
2971
2971
  toolCalls: {
2972
- id: string;
2973
2972
  name: string;
2973
+ id: string;
2974
2974
  parameters: Record<string, string>;
2975
2975
  }[];
2976
2976
  }>, z.ZodObject<{
@@ -2994,12 +2994,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2994
2994
  id: z.ZodString;
2995
2995
  input: z.ZodRecord<z.ZodString, z.ZodAny>;
2996
2996
  }, "strip", z.ZodTypeAny, {
2997
- id: string;
2998
2997
  name: string;
2998
+ id: string;
2999
2999
  input: Record<string, any>;
3000
3000
  }, {
3001
- id: string;
3002
3001
  name: string;
3002
+ id: string;
3003
3003
  input: Record<string, any>;
3004
3004
  }>;
3005
3005
  changes: z.ZodArray<z.ZodObject<{
@@ -3040,14 +3040,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3040
3040
  }>, "many">;
3041
3041
  resetFileVersions: z.ZodBoolean;
3042
3042
  }, "strip", z.ZodTypeAny, {
3043
+ type: "tool-call";
3043
3044
  data: {
3044
- id: string;
3045
3045
  name: string;
3046
+ id: string;
3046
3047
  input: Record<string, any>;
3047
3048
  };
3048
- type: "tool-call";
3049
- response: string;
3050
3049
  userInputId: string;
3050
+ response: string;
3051
3051
  changes: {
3052
3052
  type: "patch" | "file";
3053
3053
  path: string;
@@ -3064,14 +3064,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3064
3064
  }[];
3065
3065
  resetFileVersions: boolean;
3066
3066
  }, {
3067
+ type: "tool-call";
3067
3068
  data: {
3068
- id: string;
3069
3069
  name: string;
3070
+ id: string;
3070
3071
  input: Record<string, any>;
3071
3072
  };
3072
- type: "tool-call";
3073
- response: string;
3074
3073
  userInputId: string;
3074
+ response: string;
3075
3075
  changes: {
3076
3076
  type: "patch" | "file";
3077
3077
  path: string;
@@ -3122,18 +3122,18 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3122
3122
  nextMonthlyGrant: z.ZodNumber;
3123
3123
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
3124
3124
  }, "type">>, "strip", z.ZodTypeAny, {
3125
- next_quota_reset: Date | null;
3126
3125
  type: "init-response";
3127
3126
  usage: number;
3128
3127
  remainingBalance: number;
3128
+ next_quota_reset: Date | null;
3129
3129
  nextMonthlyGrant: number;
3130
3130
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3131
3131
  autoTopupAdded?: number | undefined;
3132
3132
  }, {
3133
- next_quota_reset: Date | null;
3134
3133
  type: "init-response";
3135
3134
  usage: number;
3136
3135
  remainingBalance: number;
3136
+ next_quota_reset: Date | null;
3137
3137
  nextMonthlyGrant: number;
3138
3138
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3139
3139
  autoTopupAdded?: number | undefined;
@@ -3146,18 +3146,18 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3146
3146
  nextMonthlyGrant: z.ZodNumber;
3147
3147
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
3148
3148
  }, "strip", z.ZodTypeAny, {
3149
- next_quota_reset: Date | null;
3150
3149
  type: "usage-response";
3151
3150
  usage: number;
3152
3151
  remainingBalance: number;
3152
+ next_quota_reset: Date | null;
3153
3153
  nextMonthlyGrant: number;
3154
3154
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3155
3155
  autoTopupAdded?: number | undefined;
3156
3156
  }, {
3157
- next_quota_reset: Date | null;
3158
3157
  type: "usage-response";
3159
3158
  usage: number;
3160
3159
  remainingBalance: number;
3160
+ next_quota_reset: Date | null;
3161
3161
  nextMonthlyGrant: number;
3162
3162
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3163
3163
  autoTopupAdded?: number | undefined;
@@ -3167,12 +3167,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3167
3167
  credits: z.ZodNumber;
3168
3168
  }, "strip", z.ZodTypeAny, {
3169
3169
  type: "message-cost-response";
3170
- credits: number;
3171
3170
  promptId: string;
3171
+ credits: number;
3172
3172
  }, {
3173
3173
  type: "message-cost-response";
3174
- credits: number;
3175
3174
  promptId: string;
3175
+ credits: number;
3176
3176
  }>, z.ZodObject<{
3177
3177
  type: z.ZodLiteral<"action-error">;
3178
3178
  message: z.ZodString;
@@ -3181,13 +3181,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3181
3181
  }, "strip", z.ZodTypeAny, {
3182
3182
  type: "action-error";
3183
3183
  message: string;
3184
- error?: string | undefined;
3185
3184
  remainingBalance?: number | undefined;
3185
+ error?: string | undefined;
3186
3186
  }, {
3187
3187
  type: "action-error";
3188
3188
  message: string;
3189
- error?: string | undefined;
3190
3189
  remainingBalance?: number | undefined;
3190
+ error?: string | undefined;
3191
3191
  }>, z.ZodObject<{
3192
3192
  type: z.ZodLiteral<"commit-message-response">;
3193
3193
  commitMessage: z.ZodString;
@@ -3199,26 +3199,27 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3199
3199
  commitMessage: string;
3200
3200
  }>]>;
3201
3201
  }, "strip", z.ZodTypeAny, {
3202
+ type: "action";
3202
3203
  data: {
3203
- next_quota_reset: Date | null;
3204
3204
  type: "usage-response";
3205
3205
  usage: number;
3206
3206
  remainingBalance: number;
3207
+ next_quota_reset: Date | null;
3207
3208
  nextMonthlyGrant: number;
3208
3209
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3209
3210
  autoTopupAdded?: number | undefined;
3210
3211
  } | {
3211
- next_quota_reset: Date | null;
3212
3212
  type: "init-response";
3213
3213
  usage: number;
3214
3214
  remainingBalance: number;
3215
+ next_quota_reset: Date | null;
3215
3216
  nextMonthlyGrant: number;
3216
3217
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3217
3218
  autoTopupAdded?: number | undefined;
3218
3219
  } | {
3219
3220
  type: "response-complete";
3220
- response: string;
3221
3221
  userInputId: string;
3222
+ response: string;
3222
3223
  changes: {
3223
3224
  type: "patch" | "file";
3224
3225
  path: string;
@@ -3234,16 +3235,16 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3234
3235
  content: string;
3235
3236
  }[];
3236
3237
  resetFileVersions: boolean;
3237
- next_quota_reset?: Date | null | undefined;
3238
3238
  usage?: number | undefined;
3239
3239
  remainingBalance?: number | undefined;
3240
3240
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3241
+ next_quota_reset?: Date | null | undefined;
3241
3242
  nextMonthlyGrant?: number | undefined;
3242
3243
  autoTopupAdded?: number | undefined;
3243
3244
  } | {
3244
3245
  type: "message-cost-response";
3245
- credits: number;
3246
3246
  promptId: string;
3247
+ credits: number;
3247
3248
  } | {
3248
3249
  type: "prompt-response";
3249
3250
  promptId: string;
@@ -3284,9 +3285,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3284
3285
  type: "ephemeral";
3285
3286
  } | undefined;
3286
3287
  } | {
3287
- id: string;
3288
- name: string;
3289
3288
  type: "tool_use";
3289
+ name: string;
3290
+ id: string;
3290
3291
  input: Record<string, any>;
3291
3292
  cache_control?: {
3292
3293
  type: "ephemeral";
@@ -3301,9 +3302,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3301
3302
  } | {
3302
3303
  type: "image";
3303
3304
  source: {
3304
- data: string;
3305
3305
  type: "base64";
3306
3306
  media_type: "image/jpeg";
3307
+ data: string;
3307
3308
  };
3308
3309
  cache_control?: {
3309
3310
  type: "ephemeral";
@@ -3314,13 +3315,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3314
3315
  consecutiveAssistantMessages?: number | undefined;
3315
3316
  };
3316
3317
  toolResults: {
3317
- id: string;
3318
3318
  name: string;
3319
+ id: string;
3319
3320
  result: string;
3320
3321
  }[];
3321
3322
  toolCalls: {
3322
- id: string;
3323
3323
  name: string;
3324
+ id: string;
3324
3325
  parameters: Record<string, string>;
3325
3326
  }[];
3326
3327
  } | {
@@ -3332,14 +3333,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3332
3333
  requestId: string;
3333
3334
  filePaths: string[];
3334
3335
  } | {
3336
+ type: "tool-call";
3335
3337
  data: {
3336
- id: string;
3337
3338
  name: string;
3339
+ id: string;
3338
3340
  input: Record<string, any>;
3339
3341
  };
3340
- type: "tool-call";
3341
- response: string;
3342
3342
  userInputId: string;
3343
+ response: string;
3343
3344
  changes: {
3344
3345
  type: "patch" | "file";
3345
3346
  path: string;
@@ -3366,34 +3367,34 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3366
3367
  } | {
3367
3368
  type: "action-error";
3368
3369
  message: string;
3369
- error?: string | undefined;
3370
3370
  remainingBalance?: number | undefined;
3371
+ error?: string | undefined;
3371
3372
  } | {
3372
3373
  type: "commit-message-response";
3373
3374
  commitMessage: string;
3374
3375
  };
3375
- type: "action";
3376
3376
  }, {
3377
+ type: "action";
3377
3378
  data: {
3378
- next_quota_reset: Date | null;
3379
3379
  type: "usage-response";
3380
3380
  usage: number;
3381
3381
  remainingBalance: number;
3382
+ next_quota_reset: Date | null;
3382
3383
  nextMonthlyGrant: number;
3383
3384
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3384
3385
  autoTopupAdded?: number | undefined;
3385
3386
  } | {
3386
- next_quota_reset: Date | null;
3387
3387
  type: "init-response";
3388
3388
  usage: number;
3389
3389
  remainingBalance: number;
3390
+ next_quota_reset: Date | null;
3390
3391
  nextMonthlyGrant: number;
3391
3392
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3392
3393
  autoTopupAdded?: number | undefined;
3393
3394
  } | {
3394
3395
  type: "response-complete";
3395
- response: string;
3396
3396
  userInputId: string;
3397
+ response: string;
3397
3398
  changes: {
3398
3399
  type: "patch" | "file";
3399
3400
  path: string;
@@ -3409,16 +3410,16 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3409
3410
  content: string;
3410
3411
  }[];
3411
3412
  resetFileVersions: boolean;
3412
- next_quota_reset?: Date | null | undefined;
3413
3413
  usage?: number | undefined;
3414
3414
  remainingBalance?: number | undefined;
3415
3415
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3416
+ next_quota_reset?: Date | null | undefined;
3416
3417
  nextMonthlyGrant?: number | undefined;
3417
3418
  autoTopupAdded?: number | undefined;
3418
3419
  } | {
3419
3420
  type: "message-cost-response";
3420
- credits: number;
3421
3421
  promptId: string;
3422
+ credits: number;
3422
3423
  } | {
3423
3424
  type: "prompt-response";
3424
3425
  promptId: string;
@@ -3459,9 +3460,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3459
3460
  type: "ephemeral";
3460
3461
  } | undefined;
3461
3462
  } | {
3462
- id: string;
3463
- name: string;
3464
3463
  type: "tool_use";
3464
+ name: string;
3465
+ id: string;
3465
3466
  input: Record<string, any>;
3466
3467
  cache_control?: {
3467
3468
  type: "ephemeral";
@@ -3476,9 +3477,9 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3476
3477
  } | {
3477
3478
  type: "image";
3478
3479
  source: {
3479
- data: string;
3480
3480
  type: "base64";
3481
3481
  media_type: "image/jpeg";
3482
+ data: string;
3482
3483
  };
3483
3484
  cache_control?: {
3484
3485
  type: "ephemeral";
@@ -3489,13 +3490,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3489
3490
  consecutiveAssistantMessages?: number | undefined;
3490
3491
  };
3491
3492
  toolResults: {
3492
- id: string;
3493
3493
  name: string;
3494
+ id: string;
3494
3495
  result: string;
3495
3496
  }[];
3496
3497
  toolCalls: {
3497
- id: string;
3498
3498
  name: string;
3499
+ id: string;
3499
3500
  parameters: Record<string, string>;
3500
3501
  }[];
3501
3502
  } | {
@@ -3507,14 +3508,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3507
3508
  requestId: string;
3508
3509
  filePaths: string[];
3509
3510
  } | {
3511
+ type: "tool-call";
3510
3512
  data: {
3511
- id: string;
3512
3513
  name: string;
3514
+ id: string;
3513
3515
  input: Record<string, any>;
3514
3516
  };
3515
- type: "tool-call";
3516
- response: string;
3517
3517
  userInputId: string;
3518
+ response: string;
3518
3519
  changes: {
3519
3520
  type: "patch" | "file";
3520
3521
  path: string;
@@ -3541,13 +3542,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3541
3542
  } | {
3542
3543
  type: "action-error";
3543
3544
  message: string;
3544
- error?: string | undefined;
3545
3545
  remainingBalance?: number | undefined;
3546
+ error?: string | undefined;
3546
3547
  } | {
3547
3548
  type: "commit-message-response";
3548
3549
  commitMessage: string;
3549
3550
  };
3550
- type: "action";
3551
3551
  }>;
3552
3552
  };
3553
3553
  export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
@@ -3621,16 +3621,16 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3621
3621
  }>, "many">;
3622
3622
  resetFileVersions: z.ZodBoolean;
3623
3623
  }, {
3624
- next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3625
3624
  usage: z.ZodOptional<z.ZodNumber>;
3626
3625
  remainingBalance: z.ZodOptional<z.ZodNumber>;
3627
3626
  balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("../types/grant").GrantType, ...import("../types/grant").GrantType[]]>, z.ZodNumber>>>;
3627
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3628
3628
  nextMonthlyGrant: z.ZodOptional<z.ZodNumber>;
3629
3629
  autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
3630
3630
  }>, "strip", z.ZodTypeAny, {
3631
3631
  type: "response-complete";
3632
- response: string;
3633
3632
  userInputId: string;
3633
+ response: string;
3634
3634
  changes: {
3635
3635
  type: "patch" | "file";
3636
3636
  path: string;
@@ -3646,16 +3646,16 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3646
3646
  content: string;
3647
3647
  }[];
3648
3648
  resetFileVersions: boolean;
3649
- next_quota_reset?: Date | null | undefined;
3650
3649
  usage?: number | undefined;
3651
3650
  remainingBalance?: number | undefined;
3652
3651
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3652
+ next_quota_reset?: Date | null | undefined;
3653
3653
  nextMonthlyGrant?: number | undefined;
3654
3654
  autoTopupAdded?: number | undefined;
3655
3655
  }, {
3656
3656
  type: "response-complete";
3657
- response: string;
3658
3657
  userInputId: string;
3658
+ response: string;
3659
3659
  changes: {
3660
3660
  type: "patch" | "file";
3661
3661
  path: string;
@@ -3671,10 +3671,10 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3671
3671
  content: string;
3672
3672
  }[];
3673
3673
  resetFileVersions: boolean;
3674
- next_quota_reset?: Date | null | undefined;
3675
3674
  usage?: number | undefined;
3676
3675
  remainingBalance?: number | undefined;
3677
3676
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
3677
+ next_quota_reset?: Date | null | undefined;
3678
3678
  nextMonthlyGrant?: number | undefined;
3679
3679
  autoTopupAdded?: number | undefined;
3680
3680
  }>, z.ZodObject<{
@@ -3828,17 +3828,17 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3828
3828
  type: "ephemeral";
3829
3829
  }>>;
3830
3830
  }, "strip", z.ZodTypeAny, {
3831
- id: string;
3832
- name: string;
3833
3831
  type: "tool_use";
3832
+ name: string;
3833
+ id: string;
3834
3834
  input: Record<string, any>;
3835
3835
  cache_control?: {
3836
3836
  type: "ephemeral";
3837
3837
  } | undefined;
3838
3838
  }, {
3839
- id: string;
3840
- name: string;
3841
3839
  type: "tool_use";
3840
+ name: string;
3841
+ id: string;
3842
3842
  input: Record<string, any>;
3843
3843
  cache_control?: {
3844
3844
  type: "ephemeral";
@@ -3875,13 +3875,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3875
3875
  media_type: z.ZodLiteral<"image/jpeg">;
3876
3876
  data: z.ZodString;
3877
3877
  }, "strip", z.ZodTypeAny, {
3878
- data: string;
3879
3878
  type: "base64";
3880
3879
  media_type: "image/jpeg";
3881
- }, {
3882
3880
  data: string;
3881
+ }, {
3883
3882
  type: "base64";
3884
3883
  media_type: "image/jpeg";
3884
+ data: string;
3885
3885
  }>;
3886
3886
  cache_control: z.ZodOptional<z.ZodObject<{
3887
3887
  type: z.ZodLiteral<"ephemeral">;
@@ -3893,9 +3893,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3893
3893
  }, "strip", z.ZodTypeAny, {
3894
3894
  type: "image";
3895
3895
  source: {
3896
- data: string;
3897
3896
  type: "base64";
3898
3897
  media_type: "image/jpeg";
3898
+ data: string;
3899
3899
  };
3900
3900
  cache_control?: {
3901
3901
  type: "ephemeral";
@@ -3903,9 +3903,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3903
3903
  }, {
3904
3904
  type: "image";
3905
3905
  source: {
3906
- data: string;
3907
3906
  type: "base64";
3908
3907
  media_type: "image/jpeg";
3908
+ data: string;
3909
3909
  };
3910
3910
  cache_control?: {
3911
3911
  type: "ephemeral";
@@ -3919,9 +3919,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3919
3919
  type: "ephemeral";
3920
3920
  } | undefined;
3921
3921
  } | {
3922
- id: string;
3923
- name: string;
3924
3922
  type: "tool_use";
3923
+ name: string;
3924
+ id: string;
3925
3925
  input: Record<string, any>;
3926
3926
  cache_control?: {
3927
3927
  type: "ephemeral";
@@ -3936,9 +3936,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3936
3936
  } | {
3937
3937
  type: "image";
3938
3938
  source: {
3939
- data: string;
3940
3939
  type: "base64";
3941
3940
  media_type: "image/jpeg";
3941
+ data: string;
3942
3942
  };
3943
3943
  cache_control?: {
3944
3944
  type: "ephemeral";
@@ -3953,9 +3953,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3953
3953
  type: "ephemeral";
3954
3954
  } | undefined;
3955
3955
  } | {
3956
- id: string;
3957
- name: string;
3958
3956
  type: "tool_use";
3957
+ name: string;
3958
+ id: string;
3959
3959
  input: Record<string, any>;
3960
3960
  cache_control?: {
3961
3961
  type: "ephemeral";
@@ -3970,9 +3970,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3970
3970
  } | {
3971
3971
  type: "image";
3972
3972
  source: {
3973
- data: string;
3974
3973
  type: "base64";
3975
3974
  media_type: "image/jpeg";
3975
+ data: string;
3976
3976
  };
3977
3977
  cache_control?: {
3978
3978
  type: "ephemeral";
@@ -4018,9 +4018,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4018
4018
  type: "ephemeral";
4019
4019
  } | undefined;
4020
4020
  } | {
4021
- id: string;
4022
- name: string;
4023
4021
  type: "tool_use";
4022
+ name: string;
4023
+ id: string;
4024
4024
  input: Record<string, any>;
4025
4025
  cache_control?: {
4026
4026
  type: "ephemeral";
@@ -4035,9 +4035,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4035
4035
  } | {
4036
4036
  type: "image";
4037
4037
  source: {
4038
- data: string;
4039
4038
  type: "base64";
4040
4039
  media_type: "image/jpeg";
4040
+ data: string;
4041
4041
  };
4042
4042
  cache_control?: {
4043
4043
  type: "ephemeral";
@@ -4083,9 +4083,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4083
4083
  type: "ephemeral";
4084
4084
  } | undefined;
4085
4085
  } | {
4086
- id: string;
4087
- name: string;
4088
4086
  type: "tool_use";
4087
+ name: string;
4088
+ id: string;
4089
4089
  input: Record<string, any>;
4090
4090
  cache_control?: {
4091
4091
  type: "ephemeral";
@@ -4100,9 +4100,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4100
4100
  } | {
4101
4101
  type: "image";
4102
4102
  source: {
4103
- data: string;
4104
4103
  type: "base64";
4105
4104
  media_type: "image/jpeg";
4105
+ data: string;
4106
4106
  };
4107
4107
  cache_control?: {
4108
4108
  type: "ephemeral";
@@ -4117,12 +4117,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4117
4117
  parameters: z.ZodRecord<z.ZodString, z.ZodString>;
4118
4118
  id: z.ZodString;
4119
4119
  }, "strip", z.ZodTypeAny, {
4120
- id: string;
4121
4120
  name: string;
4121
+ id: string;
4122
4122
  parameters: Record<string, string>;
4123
4123
  }, {
4124
- id: string;
4125
4124
  name: string;
4125
+ id: string;
4126
4126
  parameters: Record<string, string>;
4127
4127
  }>, "many">;
4128
4128
  toolResults: z.ZodArray<z.ZodObject<{
@@ -4130,12 +4130,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4130
4130
  result: z.ZodString;
4131
4131
  id: z.ZodString;
4132
4132
  }, "strip", z.ZodTypeAny, {
4133
- id: string;
4134
4133
  name: string;
4134
+ id: string;
4135
4135
  result: string;
4136
4136
  }, {
4137
- id: string;
4138
4137
  name: string;
4138
+ id: string;
4139
4139
  result: string;
4140
4140
  }>, "many">;
4141
4141
  }, "strip", z.ZodTypeAny, {
@@ -4178,9 +4178,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4178
4178
  type: "ephemeral";
4179
4179
  } | undefined;
4180
4180
  } | {
4181
- id: string;
4182
- name: string;
4183
4181
  type: "tool_use";
4182
+ name: string;
4183
+ id: string;
4184
4184
  input: Record<string, any>;
4185
4185
  cache_control?: {
4186
4186
  type: "ephemeral";
@@ -4195,9 +4195,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4195
4195
  } | {
4196
4196
  type: "image";
4197
4197
  source: {
4198
- data: string;
4199
4198
  type: "base64";
4200
4199
  media_type: "image/jpeg";
4200
+ data: string;
4201
4201
  };
4202
4202
  cache_control?: {
4203
4203
  type: "ephemeral";
@@ -4208,13 +4208,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4208
4208
  consecutiveAssistantMessages?: number | undefined;
4209
4209
  };
4210
4210
  toolResults: {
4211
- id: string;
4212
4211
  name: string;
4212
+ id: string;
4213
4213
  result: string;
4214
4214
  }[];
4215
4215
  toolCalls: {
4216
- id: string;
4217
4216
  name: string;
4217
+ id: string;
4218
4218
  parameters: Record<string, string>;
4219
4219
  }[];
4220
4220
  }, {
@@ -4257,9 +4257,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4257
4257
  type: "ephemeral";
4258
4258
  } | undefined;
4259
4259
  } | {
4260
- id: string;
4261
- name: string;
4262
4260
  type: "tool_use";
4261
+ name: string;
4262
+ id: string;
4263
4263
  input: Record<string, any>;
4264
4264
  cache_control?: {
4265
4265
  type: "ephemeral";
@@ -4274,9 +4274,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4274
4274
  } | {
4275
4275
  type: "image";
4276
4276
  source: {
4277
- data: string;
4278
4277
  type: "base64";
4279
4278
  media_type: "image/jpeg";
4279
+ data: string;
4280
4280
  };
4281
4281
  cache_control?: {
4282
4282
  type: "ephemeral";
@@ -4287,13 +4287,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4287
4287
  consecutiveAssistantMessages?: number | undefined;
4288
4288
  };
4289
4289
  toolResults: {
4290
- id: string;
4291
4290
  name: string;
4291
+ id: string;
4292
4292
  result: string;
4293
4293
  }[];
4294
4294
  toolCalls: {
4295
- id: string;
4296
4295
  name: string;
4296
+ id: string;
4297
4297
  parameters: Record<string, string>;
4298
4298
  }[];
4299
4299
  }>, z.ZodObject<{
@@ -4317,12 +4317,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4317
4317
  id: z.ZodString;
4318
4318
  input: z.ZodRecord<z.ZodString, z.ZodAny>;
4319
4319
  }, "strip", z.ZodTypeAny, {
4320
- id: string;
4321
4320
  name: string;
4321
+ id: string;
4322
4322
  input: Record<string, any>;
4323
4323
  }, {
4324
- id: string;
4325
4324
  name: string;
4325
+ id: string;
4326
4326
  input: Record<string, any>;
4327
4327
  }>;
4328
4328
  changes: z.ZodArray<z.ZodObject<{
@@ -4363,14 +4363,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4363
4363
  }>, "many">;
4364
4364
  resetFileVersions: z.ZodBoolean;
4365
4365
  }, "strip", z.ZodTypeAny, {
4366
+ type: "tool-call";
4366
4367
  data: {
4367
- id: string;
4368
4368
  name: string;
4369
+ id: string;
4369
4370
  input: Record<string, any>;
4370
4371
  };
4371
- type: "tool-call";
4372
- response: string;
4373
4372
  userInputId: string;
4373
+ response: string;
4374
4374
  changes: {
4375
4375
  type: "patch" | "file";
4376
4376
  path: string;
@@ -4387,14 +4387,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4387
4387
  }[];
4388
4388
  resetFileVersions: boolean;
4389
4389
  }, {
4390
+ type: "tool-call";
4390
4391
  data: {
4391
- id: string;
4392
4392
  name: string;
4393
+ id: string;
4393
4394
  input: Record<string, any>;
4394
4395
  };
4395
- type: "tool-call";
4396
- response: string;
4397
4396
  userInputId: string;
4397
+ response: string;
4398
4398
  changes: {
4399
4399
  type: "patch" | "file";
4400
4400
  path: string;
@@ -4445,18 +4445,18 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4445
4445
  nextMonthlyGrant: z.ZodNumber;
4446
4446
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
4447
4447
  }, "type">>, "strip", z.ZodTypeAny, {
4448
- next_quota_reset: Date | null;
4449
4448
  type: "init-response";
4450
4449
  usage: number;
4451
4450
  remainingBalance: number;
4451
+ next_quota_reset: Date | null;
4452
4452
  nextMonthlyGrant: number;
4453
4453
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4454
4454
  autoTopupAdded?: number | undefined;
4455
4455
  }, {
4456
- next_quota_reset: Date | null;
4457
4456
  type: "init-response";
4458
4457
  usage: number;
4459
4458
  remainingBalance: number;
4459
+ next_quota_reset: Date | null;
4460
4460
  nextMonthlyGrant: number;
4461
4461
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4462
4462
  autoTopupAdded?: number | undefined;
@@ -4469,18 +4469,18 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4469
4469
  nextMonthlyGrant: z.ZodNumber;
4470
4470
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
4471
4471
  }, "strip", z.ZodTypeAny, {
4472
- next_quota_reset: Date | null;
4473
4472
  type: "usage-response";
4474
4473
  usage: number;
4475
4474
  remainingBalance: number;
4475
+ next_quota_reset: Date | null;
4476
4476
  nextMonthlyGrant: number;
4477
4477
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4478
4478
  autoTopupAdded?: number | undefined;
4479
4479
  }, {
4480
- next_quota_reset: Date | null;
4481
4480
  type: "usage-response";
4482
4481
  usage: number;
4483
4482
  remainingBalance: number;
4483
+ next_quota_reset: Date | null;
4484
4484
  nextMonthlyGrant: number;
4485
4485
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4486
4486
  autoTopupAdded?: number | undefined;
@@ -4490,12 +4490,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4490
4490
  credits: z.ZodNumber;
4491
4491
  }, "strip", z.ZodTypeAny, {
4492
4492
  type: "message-cost-response";
4493
- credits: number;
4494
4493
  promptId: string;
4494
+ credits: number;
4495
4495
  }, {
4496
4496
  type: "message-cost-response";
4497
- credits: number;
4498
4497
  promptId: string;
4498
+ credits: number;
4499
4499
  }>, z.ZodObject<{
4500
4500
  type: z.ZodLiteral<"action-error">;
4501
4501
  message: z.ZodString;
@@ -4504,13 +4504,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4504
4504
  }, "strip", z.ZodTypeAny, {
4505
4505
  type: "action-error";
4506
4506
  message: string;
4507
- error?: string | undefined;
4508
4507
  remainingBalance?: number | undefined;
4508
+ error?: string | undefined;
4509
4509
  }, {
4510
4510
  type: "action-error";
4511
4511
  message: string;
4512
- error?: string | undefined;
4513
4512
  remainingBalance?: number | undefined;
4513
+ error?: string | undefined;
4514
4514
  }>, z.ZodObject<{
4515
4515
  type: z.ZodLiteral<"commit-message-response">;
4516
4516
  commitMessage: z.ZodString;
@@ -4522,26 +4522,27 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4522
4522
  commitMessage: string;
4523
4523
  }>]>;
4524
4524
  }, "strip", z.ZodTypeAny, {
4525
+ type: "action";
4525
4526
  data: {
4526
- next_quota_reset: Date | null;
4527
4527
  type: "usage-response";
4528
4528
  usage: number;
4529
4529
  remainingBalance: number;
4530
+ next_quota_reset: Date | null;
4530
4531
  nextMonthlyGrant: number;
4531
4532
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4532
4533
  autoTopupAdded?: number | undefined;
4533
4534
  } | {
4534
- next_quota_reset: Date | null;
4535
4535
  type: "init-response";
4536
4536
  usage: number;
4537
4537
  remainingBalance: number;
4538
+ next_quota_reset: Date | null;
4538
4539
  nextMonthlyGrant: number;
4539
4540
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4540
4541
  autoTopupAdded?: number | undefined;
4541
4542
  } | {
4542
4543
  type: "response-complete";
4543
- response: string;
4544
4544
  userInputId: string;
4545
+ response: string;
4545
4546
  changes: {
4546
4547
  type: "patch" | "file";
4547
4548
  path: string;
@@ -4557,16 +4558,16 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4557
4558
  content: string;
4558
4559
  }[];
4559
4560
  resetFileVersions: boolean;
4560
- next_quota_reset?: Date | null | undefined;
4561
4561
  usage?: number | undefined;
4562
4562
  remainingBalance?: number | undefined;
4563
4563
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4564
+ next_quota_reset?: Date | null | undefined;
4564
4565
  nextMonthlyGrant?: number | undefined;
4565
4566
  autoTopupAdded?: number | undefined;
4566
4567
  } | {
4567
4568
  type: "message-cost-response";
4568
- credits: number;
4569
4569
  promptId: string;
4570
+ credits: number;
4570
4571
  } | {
4571
4572
  type: "prompt-response";
4572
4573
  promptId: string;
@@ -4607,9 +4608,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4607
4608
  type: "ephemeral";
4608
4609
  } | undefined;
4609
4610
  } | {
4610
- id: string;
4611
- name: string;
4612
4611
  type: "tool_use";
4612
+ name: string;
4613
+ id: string;
4613
4614
  input: Record<string, any>;
4614
4615
  cache_control?: {
4615
4616
  type: "ephemeral";
@@ -4624,9 +4625,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4624
4625
  } | {
4625
4626
  type: "image";
4626
4627
  source: {
4627
- data: string;
4628
4628
  type: "base64";
4629
4629
  media_type: "image/jpeg";
4630
+ data: string;
4630
4631
  };
4631
4632
  cache_control?: {
4632
4633
  type: "ephemeral";
@@ -4637,13 +4638,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4637
4638
  consecutiveAssistantMessages?: number | undefined;
4638
4639
  };
4639
4640
  toolResults: {
4640
- id: string;
4641
4641
  name: string;
4642
+ id: string;
4642
4643
  result: string;
4643
4644
  }[];
4644
4645
  toolCalls: {
4645
- id: string;
4646
4646
  name: string;
4647
+ id: string;
4647
4648
  parameters: Record<string, string>;
4648
4649
  }[];
4649
4650
  } | {
@@ -4655,14 +4656,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4655
4656
  requestId: string;
4656
4657
  filePaths: string[];
4657
4658
  } | {
4659
+ type: "tool-call";
4658
4660
  data: {
4659
- id: string;
4660
4661
  name: string;
4662
+ id: string;
4661
4663
  input: Record<string, any>;
4662
4664
  };
4663
- type: "tool-call";
4664
- response: string;
4665
4665
  userInputId: string;
4666
+ response: string;
4666
4667
  changes: {
4667
4668
  type: "patch" | "file";
4668
4669
  path: string;
@@ -4689,34 +4690,34 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4689
4690
  } | {
4690
4691
  type: "action-error";
4691
4692
  message: string;
4692
- error?: string | undefined;
4693
4693
  remainingBalance?: number | undefined;
4694
+ error?: string | undefined;
4694
4695
  } | {
4695
4696
  type: "commit-message-response";
4696
4697
  commitMessage: string;
4697
4698
  };
4698
- type: "action";
4699
4699
  }, {
4700
+ type: "action";
4700
4701
  data: {
4701
- next_quota_reset: Date | null;
4702
4702
  type: "usage-response";
4703
4703
  usage: number;
4704
4704
  remainingBalance: number;
4705
+ next_quota_reset: Date | null;
4705
4706
  nextMonthlyGrant: number;
4706
4707
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4707
4708
  autoTopupAdded?: number | undefined;
4708
4709
  } | {
4709
- next_quota_reset: Date | null;
4710
4710
  type: "init-response";
4711
4711
  usage: number;
4712
4712
  remainingBalance: number;
4713
+ next_quota_reset: Date | null;
4713
4714
  nextMonthlyGrant: number;
4714
4715
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4715
4716
  autoTopupAdded?: number | undefined;
4716
4717
  } | {
4717
4718
  type: "response-complete";
4718
- response: string;
4719
4719
  userInputId: string;
4720
+ response: string;
4720
4721
  changes: {
4721
4722
  type: "patch" | "file";
4722
4723
  path: string;
@@ -4732,16 +4733,16 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4732
4733
  content: string;
4733
4734
  }[];
4734
4735
  resetFileVersions: boolean;
4735
- next_quota_reset?: Date | null | undefined;
4736
4736
  usage?: number | undefined;
4737
4737
  remainingBalance?: number | undefined;
4738
4738
  balanceBreakdown?: Partial<Record<import("../types/grant").GrantType, number>> | undefined;
4739
+ next_quota_reset?: Date | null | undefined;
4739
4740
  nextMonthlyGrant?: number | undefined;
4740
4741
  autoTopupAdded?: number | undefined;
4741
4742
  } | {
4742
4743
  type: "message-cost-response";
4743
- credits: number;
4744
4744
  promptId: string;
4745
+ credits: number;
4745
4746
  } | {
4746
4747
  type: "prompt-response";
4747
4748
  promptId: string;
@@ -4782,9 +4783,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4782
4783
  type: "ephemeral";
4783
4784
  } | undefined;
4784
4785
  } | {
4785
- id: string;
4786
- name: string;
4787
4786
  type: "tool_use";
4787
+ name: string;
4788
+ id: string;
4788
4789
  input: Record<string, any>;
4789
4790
  cache_control?: {
4790
4791
  type: "ephemeral";
@@ -4799,9 +4800,9 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4799
4800
  } | {
4800
4801
  type: "image";
4801
4802
  source: {
4802
- data: string;
4803
4803
  type: "base64";
4804
4804
  media_type: "image/jpeg";
4805
+ data: string;
4805
4806
  };
4806
4807
  cache_control?: {
4807
4808
  type: "ephemeral";
@@ -4812,13 +4813,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4812
4813
  consecutiveAssistantMessages?: number | undefined;
4813
4814
  };
4814
4815
  toolResults: {
4815
- id: string;
4816
4816
  name: string;
4817
+ id: string;
4817
4818
  result: string;
4818
4819
  }[];
4819
4820
  toolCalls: {
4820
- id: string;
4821
4821
  name: string;
4822
+ id: string;
4822
4823
  parameters: Record<string, string>;
4823
4824
  }[];
4824
4825
  } | {
@@ -4830,14 +4831,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4830
4831
  requestId: string;
4831
4832
  filePaths: string[];
4832
4833
  } | {
4834
+ type: "tool-call";
4833
4835
  data: {
4834
- id: string;
4835
4836
  name: string;
4837
+ id: string;
4836
4838
  input: Record<string, any>;
4837
4839
  };
4838
- type: "tool-call";
4839
- response: string;
4840
4840
  userInputId: string;
4841
+ response: string;
4841
4842
  changes: {
4842
4843
  type: "patch" | "file";
4843
4844
  path: string;
@@ -4864,13 +4865,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4864
4865
  } | {
4865
4866
  type: "action-error";
4866
4867
  message: string;
4867
- error?: string | undefined;
4868
4868
  remainingBalance?: number | undefined;
4869
+ error?: string | undefined;
4869
4870
  } | {
4870
4871
  type: "commit-message-response";
4871
4872
  commitMessage: string;
4872
4873
  };
4873
- type: "action";
4874
4874
  }>]>;
4875
4875
  export type ServerMessageType = keyof typeof SERVER_MESSAGE_SCHEMAS;
4876
4876
  export type ServerMessage<T extends ServerMessageType = ServerMessageType> = z.infer<(typeof SERVER_MESSAGE_SCHEMAS)[T]>;