codebuff 1.0.218 → 1.0.220

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 (132) hide show
  1. package/dist/checkpoints/checkpoint-manager.d.ts +1 -1
  2. package/dist/checkpoints/checkpoint-manager.js +8 -6
  3. package/dist/checkpoints/checkpoint-manager.js.map +1 -1
  4. package/dist/cli-handlers/api-key.d.ts +25 -0
  5. package/dist/cli-handlers/api-key.js +66 -0
  6. package/dist/cli-handlers/api-key.js.map +1 -0
  7. package/dist/cli-handlers/checkpoint.d.ts +18 -0
  8. package/dist/cli-handlers/checkpoint.js +195 -0
  9. package/dist/cli-handlers/checkpoint.js.map +1 -0
  10. package/dist/cli-handlers/diff.d.ts +2 -0
  11. package/dist/cli-handlers/diff.js +31 -0
  12. package/dist/cli-handlers/diff.js.map +1 -0
  13. package/dist/cli-handlers/easter-egg.d.ts +1 -0
  14. package/dist/cli-handlers/easter-egg.js +126 -0
  15. package/dist/cli-handlers/easter-egg.js.map +1 -0
  16. package/dist/cli.d.ts +0 -18
  17. package/dist/cli.js +70 -397
  18. package/dist/cli.js.map +1 -1
  19. package/dist/client.d.ts +11 -11
  20. package/dist/client.js +123 -45
  21. package/dist/client.js.map +1 -1
  22. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  23. package/dist/common/actions.d.ts +288 -264
  24. package/dist/common/actions.js +10 -4
  25. package/dist/common/actions.js.map +1 -1
  26. package/dist/common/advanced-analyzer.d.ts +19 -0
  27. package/dist/common/advanced-analyzer.js +140 -0
  28. package/dist/common/advanced-analyzer.js.map +1 -0
  29. package/dist/common/billing/auto-topup.d.ts +8 -0
  30. package/dist/common/billing/auto-topup.js +192 -0
  31. package/dist/common/billing/auto-topup.js.map +1 -0
  32. package/dist/common/billing/balance-calculator.d.ts +55 -0
  33. package/dist/common/billing/balance-calculator.js +207 -0
  34. package/dist/common/billing/balance-calculator.js.map +1 -0
  35. package/dist/common/billing/check-auto-topup.d.ts +12 -0
  36. package/dist/common/billing/check-auto-topup.js +50 -0
  37. package/dist/common/billing/check-auto-topup.js.map +1 -0
  38. package/dist/common/billing/conversion.d.ts +9 -0
  39. package/dist/common/billing/conversion.js +20 -0
  40. package/dist/common/billing/conversion.js.map +1 -0
  41. package/dist/common/billing/credit-check.d.ts +8 -0
  42. package/dist/common/billing/credit-check.js +45 -0
  43. package/dist/common/billing/credit-check.js.map +1 -0
  44. package/dist/common/billing/credit-conversion.d.ts +24 -0
  45. package/dist/common/billing/credit-conversion.js +48 -0
  46. package/dist/common/billing/credit-conversion.js.map +1 -0
  47. package/dist/common/billing/grant-credits.d.ts +28 -0
  48. package/dist/common/billing/grant-credits.js +201 -0
  49. package/dist/common/billing/grant-credits.js.map +1 -0
  50. package/dist/common/billing/plans.d.ts +13 -0
  51. package/dist/common/billing/plans.js +44 -0
  52. package/dist/common/billing/plans.js.map +1 -0
  53. package/dist/common/billing/rollover-logic.d.ts +13 -0
  54. package/dist/common/billing/rollover-logic.js +174 -0
  55. package/dist/common/billing/rollover-logic.js.map +1 -0
  56. package/dist/common/billing/stripe-api.d.ts +31 -0
  57. package/dist/common/billing/stripe-api.js +104 -0
  58. package/dist/common/billing/stripe-api.js.map +1 -0
  59. package/dist/common/browser-actions.d.ts +62 -62
  60. package/dist/common/browser-actions.js +3 -3
  61. package/dist/common/browser-actions.js.map +1 -1
  62. package/dist/common/constants/grant-priorities.d.ts +2 -0
  63. package/dist/common/constants/grant-priorities.js +10 -0
  64. package/dist/common/constants/grant-priorities.js.map +1 -0
  65. package/dist/common/constants/tools.d.ts +1 -1
  66. package/dist/common/constants/tools.js +1 -1
  67. package/dist/common/constants/tools.js.map +1 -1
  68. package/dist/common/constants.d.ts +28 -1
  69. package/dist/common/constants.js +36 -7
  70. package/dist/common/constants.js.map +1 -1
  71. package/dist/common/db/schema.d.ts +323 -86
  72. package/dist/common/db/schema.js +55 -13
  73. package/dist/common/db/schema.js.map +1 -1
  74. package/dist/common/env.mjs +4 -1
  75. package/dist/common/env.mjs.map +1 -1
  76. package/dist/common/message-image-handling.d.ts +41 -0
  77. package/dist/common/message-image-handling.js +57 -0
  78. package/dist/common/message-image-handling.js.map +1 -0
  79. package/dist/common/types/agent-state.d.ts +8 -8
  80. package/dist/common/types/grant.d.ts +2 -0
  81. package/dist/common/types/grant.js +10 -0
  82. package/dist/common/types/grant.js.map +1 -0
  83. package/dist/common/types/usage.d.ts +37 -18
  84. package/dist/common/types/usage.js +9 -6
  85. package/dist/common/types/usage.js.map +1 -1
  86. package/dist/common/util/__tests__/saxy.test.d.ts +1 -0
  87. package/dist/common/util/__tests__/saxy.test.js +262 -0
  88. package/dist/common/util/__tests__/saxy.test.js.map +1 -0
  89. package/dist/common/util/credentials.d.ts +2 -2
  90. package/dist/common/util/dates.d.ts +10 -1
  91. package/dist/common/util/dates.js +11 -2
  92. package/dist/common/util/dates.js.map +1 -1
  93. package/dist/common/util/logger.js +32 -14
  94. package/dist/common/util/logger.js.map +1 -1
  95. package/dist/common/util/process-stream.d.ts +8 -0
  96. package/dist/common/util/process-stream.js +102 -0
  97. package/dist/common/util/process-stream.js.map +1 -0
  98. package/dist/common/util/promise.d.ts +1 -1
  99. package/dist/common/util/promise.js +2 -2
  100. package/dist/common/util/promise.js.map +1 -1
  101. package/dist/common/util/referral-credits.d.ts +1 -0
  102. package/dist/common/util/referral-credits.js +48 -0
  103. package/dist/common/util/referral-credits.js.map +1 -0
  104. package/dist/common/util/saxy.d.ts +8 -0
  105. package/dist/common/util/saxy.js +35 -12
  106. package/dist/common/util/saxy.js.map +1 -1
  107. package/dist/common/util/sync-failure.d.ts +1 -0
  108. package/dist/common/util/sync-failure.js +57 -0
  109. package/dist/common/util/sync-failure.js.map +1 -0
  110. package/dist/common/websockets/websocket-schema.d.ts +530 -480
  111. package/dist/index.js +1 -1
  112. package/dist/menu.js +5 -0
  113. package/dist/menu.js.map +1 -1
  114. package/dist/tool-handlers.js +1 -1
  115. package/dist/tool-handlers.js.map +1 -1
  116. package/dist/utils/__tests__/xml-stream-parser.test.js +6 -10
  117. package/dist/utils/__tests__/xml-stream-parser.test.js.map +1 -1
  118. package/dist/utils/tool-renderers.js +1 -1
  119. package/dist/utils/tool-renderers.js.map +1 -1
  120. package/package.json +1 -1
  121. package/dist/common/logger.d.ts +0 -1
  122. package/dist/common/logger.js +0 -7
  123. package/dist/common/logger.js.map +0 -1
  124. package/dist/common/util/constants.d.ts +0 -1
  125. package/dist/common/util/constants.js +0 -7
  126. package/dist/common/util/constants.js.map +0 -1
  127. package/dist/common/util/helpers.d.ts +0 -1
  128. package/dist/common/util/helpers.js +0 -6
  129. package/dist/common/util/helpers.js.map +0 -1
  130. package/dist/common/util/token-counter.d.ts +0 -3
  131. package/dist/common/util/token-counter.js +0 -27
  132. package/dist/common/util/token-counter.js.map +0 -1
@@ -4,13 +4,13 @@ export declare const FileChangeSchema: z.ZodObject<{
4
4
  path: z.ZodString;
5
5
  content: z.ZodString;
6
6
  }, "strip", z.ZodTypeAny, {
7
- path: string;
8
- type: "patch" | "file";
9
7
  content: string;
10
- }, {
11
- path: string;
12
8
  type: "patch" | "file";
9
+ path: string;
10
+ }, {
13
11
  content: string;
12
+ type: "patch" | "file";
13
+ path: string;
14
14
  }>;
15
15
  export type FileChange = z.infer<typeof FileChangeSchema>;
16
16
  export declare const CHANGES: z.ZodArray<z.ZodObject<{
@@ -18,13 +18,13 @@ export declare const CHANGES: z.ZodArray<z.ZodObject<{
18
18
  path: z.ZodString;
19
19
  content: z.ZodString;
20
20
  }, "strip", z.ZodTypeAny, {
21
- path: string;
22
- type: "patch" | "file";
23
21
  content: string;
24
- }, {
25
- path: string;
26
22
  type: "patch" | "file";
23
+ path: string;
24
+ }, {
27
25
  content: string;
26
+ type: "patch" | "file";
27
+ path: string;
28
28
  }>, "many">;
29
29
  export type FileChanges = z.infer<typeof CHANGES>;
30
30
  export declare const ToolCallSchema: z.ZodObject<{
@@ -100,11 +100,11 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
100
100
  path: z.ZodString;
101
101
  content: z.ZodString;
102
102
  }, "strip", z.ZodTypeAny, {
103
- path: string;
104
103
  content: string;
105
- }, {
106
104
  path: string;
105
+ }, {
107
106
  content: string;
107
+ path: string;
108
108
  }>, "many">, "many">>;
109
109
  }, "strip", z.ZodTypeAny, {
110
110
  currentWorkingDirectory: string;
@@ -129,8 +129,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
129
129
  };
130
130
  userKnowledgeFiles?: Record<string, string> | undefined;
131
131
  fileVersions?: {
132
- path: string;
133
132
  content: string;
133
+ path: string;
134
134
  }[][] | undefined;
135
135
  }, {
136
136
  currentWorkingDirectory: string;
@@ -155,8 +155,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
155
155
  };
156
156
  userKnowledgeFiles?: Record<string, string> | undefined;
157
157
  fileVersions?: {
158
- path: string;
159
158
  content: string;
159
+ path: string;
160
160
  }[][] | undefined;
161
161
  }>;
162
162
  messageHistory: z.ZodArray<z.ZodObject<{
@@ -172,14 +172,14 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
172
172
  type: "ephemeral";
173
173
  }>>;
174
174
  }, "strip", z.ZodTypeAny, {
175
- type: "text";
176
175
  text: string;
176
+ type: "text";
177
177
  cache_control?: {
178
178
  type: "ephemeral";
179
179
  } | undefined;
180
180
  }, {
181
- type: "text";
182
181
  text: string;
182
+ type: "text";
183
183
  cache_control?: {
184
184
  type: "ephemeral";
185
185
  } | undefined;
@@ -223,15 +223,15 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
223
223
  type: "ephemeral";
224
224
  }>>;
225
225
  }, "strip", z.ZodTypeAny, {
226
- type: "tool_result";
227
226
  content: string;
227
+ type: "tool_result";
228
228
  tool_use_id: string;
229
229
  cache_control?: {
230
230
  type: "ephemeral";
231
231
  } | undefined;
232
232
  }, {
233
- type: "tool_result";
234
233
  content: string;
234
+ type: "tool_result";
235
235
  tool_use_id: string;
236
236
  cache_control?: {
237
237
  type: "ephemeral";
@@ -243,13 +243,13 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
243
243
  media_type: z.ZodLiteral<"image/jpeg">;
244
244
  data: z.ZodString;
245
245
  }, "strip", z.ZodTypeAny, {
246
+ data: string;
246
247
  type: "base64";
247
248
  media_type: "image/jpeg";
248
- data: string;
249
249
  }, {
250
+ data: string;
250
251
  type: "base64";
251
252
  media_type: "image/jpeg";
252
- data: string;
253
253
  }>;
254
254
  cache_control: z.ZodOptional<z.ZodObject<{
255
255
  type: z.ZodLiteral<"ephemeral">;
@@ -261,9 +261,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
261
261
  }, "strip", z.ZodTypeAny, {
262
262
  type: "image";
263
263
  source: {
264
+ data: string;
264
265
  type: "base64";
265
266
  media_type: "image/jpeg";
266
- data: string;
267
267
  };
268
268
  cache_control?: {
269
269
  type: "ephemeral";
@@ -271,9 +271,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
271
271
  }, {
272
272
  type: "image";
273
273
  source: {
274
+ data: string;
274
275
  type: "base64";
275
276
  media_type: "image/jpeg";
276
- data: string;
277
277
  };
278
278
  cache_control?: {
279
279
  type: "ephemeral";
@@ -281,8 +281,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
281
281
  }>]>, "many">]>;
282
282
  }, "strip", z.ZodTypeAny, {
283
283
  content: string | ({
284
- type: "text";
285
284
  text: string;
285
+ type: "text";
286
286
  cache_control?: {
287
287
  type: "ephemeral";
288
288
  } | undefined;
@@ -295,8 +295,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
295
295
  type: "ephemeral";
296
296
  } | undefined;
297
297
  } | {
298
- type: "tool_result";
299
298
  content: string;
299
+ type: "tool_result";
300
300
  tool_use_id: string;
301
301
  cache_control?: {
302
302
  type: "ephemeral";
@@ -304,9 +304,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
304
304
  } | {
305
305
  type: "image";
306
306
  source: {
307
+ data: string;
307
308
  type: "base64";
308
309
  media_type: "image/jpeg";
309
- data: string;
310
310
  };
311
311
  cache_control?: {
312
312
  type: "ephemeral";
@@ -315,8 +315,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
315
315
  role: "user" | "assistant";
316
316
  }, {
317
317
  content: string | ({
318
- type: "text";
319
318
  text: string;
319
+ type: "text";
320
320
  cache_control?: {
321
321
  type: "ephemeral";
322
322
  } | undefined;
@@ -329,8 +329,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
329
329
  type: "ephemeral";
330
330
  } | undefined;
331
331
  } | {
332
- type: "tool_result";
333
332
  content: string;
333
+ type: "tool_result";
334
334
  tool_use_id: string;
335
335
  cache_control?: {
336
336
  type: "ephemeral";
@@ -338,9 +338,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
338
338
  } | {
339
339
  type: "image";
340
340
  source: {
341
+ data: string;
341
342
  type: "base64";
342
343
  media_type: "image/jpeg";
343
- data: string;
344
344
  };
345
345
  cache_control?: {
346
346
  type: "ephemeral";
@@ -374,14 +374,14 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
374
374
  };
375
375
  userKnowledgeFiles?: Record<string, string> | undefined;
376
376
  fileVersions?: {
377
- path: string;
378
377
  content: string;
378
+ path: string;
379
379
  }[][] | undefined;
380
380
  };
381
381
  messageHistory: {
382
382
  content: string | ({
383
- type: "text";
384
383
  text: string;
384
+ type: "text";
385
385
  cache_control?: {
386
386
  type: "ephemeral";
387
387
  } | undefined;
@@ -394,8 +394,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
394
394
  type: "ephemeral";
395
395
  } | undefined;
396
396
  } | {
397
- type: "tool_result";
398
397
  content: string;
398
+ type: "tool_result";
399
399
  tool_use_id: string;
400
400
  cache_control?: {
401
401
  type: "ephemeral";
@@ -403,9 +403,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
403
403
  } | {
404
404
  type: "image";
405
405
  source: {
406
+ data: string;
406
407
  type: "base64";
407
408
  media_type: "image/jpeg";
408
- data: string;
409
409
  };
410
410
  cache_control?: {
411
411
  type: "ephemeral";
@@ -439,14 +439,14 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
439
439
  };
440
440
  userKnowledgeFiles?: Record<string, string> | undefined;
441
441
  fileVersions?: {
442
- path: string;
443
442
  content: string;
443
+ path: string;
444
444
  }[][] | undefined;
445
445
  };
446
446
  messageHistory: {
447
447
  content: string | ({
448
- type: "text";
449
448
  text: string;
449
+ type: "text";
450
450
  cache_control?: {
451
451
  type: "ephemeral";
452
452
  } | undefined;
@@ -459,8 +459,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
459
459
  type: "ephemeral";
460
460
  } | undefined;
461
461
  } | {
462
- type: "tool_result";
463
462
  content: string;
463
+ type: "tool_result";
464
464
  tool_use_id: string;
465
465
  cache_control?: {
466
466
  type: "ephemeral";
@@ -468,9 +468,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
468
468
  } | {
469
469
  type: "image";
470
470
  source: {
471
+ data: string;
471
472
  type: "base64";
472
473
  media_type: "image/jpeg";
473
- data: string;
474
474
  };
475
475
  cache_control?: {
476
476
  type: "ephemeral";
@@ -498,7 +498,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
498
498
  type: "prompt";
499
499
  promptId: string;
500
500
  fingerprintId: string;
501
- costMode: "max" | "lite" | "normal" | "experimental";
501
+ costMode: "lite" | "normal" | "max" | "experimental";
502
502
  agentState: {
503
503
  agentContext: string;
504
504
  fileContext: {
@@ -524,14 +524,14 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
524
524
  };
525
525
  userKnowledgeFiles?: Record<string, string> | undefined;
526
526
  fileVersions?: {
527
- path: string;
528
527
  content: string;
528
+ path: string;
529
529
  }[][] | undefined;
530
530
  };
531
531
  messageHistory: {
532
532
  content: string | ({
533
- type: "text";
534
533
  text: string;
534
+ type: "text";
535
535
  cache_control?: {
536
536
  type: "ephemeral";
537
537
  } | undefined;
@@ -544,8 +544,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
544
544
  type: "ephemeral";
545
545
  } | undefined;
546
546
  } | {
547
- type: "tool_result";
548
547
  content: string;
548
+ type: "tool_result";
549
549
  tool_use_id: string;
550
550
  cache_control?: {
551
551
  type: "ephemeral";
@@ -553,9 +553,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
553
553
  } | {
554
554
  type: "image";
555
555
  source: {
556
+ data: string;
556
557
  type: "base64";
557
558
  media_type: "image/jpeg";
558
- data: string;
559
559
  };
560
560
  cache_control?: {
561
561
  type: "ephemeral";
@@ -602,14 +602,14 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
602
602
  };
603
603
  userKnowledgeFiles?: Record<string, string> | undefined;
604
604
  fileVersions?: {
605
- path: string;
606
605
  content: string;
606
+ path: string;
607
607
  }[][] | undefined;
608
608
  };
609
609
  messageHistory: {
610
610
  content: string | ({
611
- type: "text";
612
611
  text: string;
612
+ type: "text";
613
613
  cache_control?: {
614
614
  type: "ephemeral";
615
615
  } | undefined;
@@ -622,8 +622,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
622
622
  type: "ephemeral";
623
623
  } | undefined;
624
624
  } | {
625
- type: "tool_result";
626
625
  content: string;
626
+ type: "tool_result";
627
627
  tool_use_id: string;
628
628
  cache_control?: {
629
629
  type: "ephemeral";
@@ -631,9 +631,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
631
631
  } | {
632
632
  type: "image";
633
633
  source: {
634
+ data: string;
634
635
  type: "base64";
635
636
  media_type: "image/jpeg";
636
- data: string;
637
637
  };
638
638
  cache_control?: {
639
639
  type: "ephemeral";
@@ -650,7 +650,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
650
650
  }[];
651
651
  prompt?: string | undefined;
652
652
  authToken?: string | undefined;
653
- costMode?: "max" | "lite" | "normal" | "experimental" | undefined;
653
+ costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
654
654
  model?: string | undefined;
655
655
  }>, z.ZodObject<{
656
656
  type: z.ZodLiteral<"read-files-response">;
@@ -718,11 +718,11 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
718
718
  path: z.ZodString;
719
719
  content: z.ZodString;
720
720
  }, "strip", z.ZodTypeAny, {
721
- path: string;
722
721
  content: string;
723
- }, {
724
722
  path: string;
723
+ }, {
725
724
  content: string;
725
+ path: string;
726
726
  }>, "many">, "many">>;
727
727
  }, "strip", z.ZodTypeAny, {
728
728
  currentWorkingDirectory: string;
@@ -747,8 +747,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
747
747
  };
748
748
  userKnowledgeFiles?: Record<string, string> | undefined;
749
749
  fileVersions?: {
750
- path: string;
751
750
  content: string;
751
+ path: string;
752
752
  }[][] | undefined;
753
753
  }, {
754
754
  currentWorkingDirectory: string;
@@ -773,12 +773,13 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
773
773
  };
774
774
  userKnowledgeFiles?: Record<string, string> | undefined;
775
775
  fileVersions?: {
776
- path: string;
777
776
  content: string;
777
+ path: string;
778
778
  }[][] | undefined;
779
779
  }>;
780
780
  }, "strip", z.ZodTypeAny, {
781
781
  type: "init";
782
+ fingerprintId: string;
782
783
  fileContext: {
783
784
  currentWorkingDirectory: string;
784
785
  fileTree: import("./util/file").FileTreeNode[];
@@ -802,14 +803,14 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
802
803
  };
803
804
  userKnowledgeFiles?: Record<string, string> | undefined;
804
805
  fileVersions?: {
805
- path: string;
806
806
  content: string;
807
+ path: string;
807
808
  }[][] | undefined;
808
809
  };
809
- fingerprintId: string;
810
810
  authToken?: string | undefined;
811
811
  }, {
812
812
  type: "init";
813
+ fingerprintId: string;
813
814
  fileContext: {
814
815
  currentWorkingDirectory: string;
815
816
  fileTree: import("./util/file").FileTreeNode[];
@@ -833,11 +834,10 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
833
834
  };
834
835
  userKnowledgeFiles?: Record<string, string> | undefined;
835
836
  fileVersions?: {
836
- path: string;
837
837
  content: string;
838
+ path: string;
838
839
  }[][] | undefined;
839
840
  };
840
- fingerprintId: string;
841
841
  authToken?: string | undefined;
842
842
  }>, z.ZodObject<{
843
843
  type: z.ZodLiteral<"generate-commit-message">;
@@ -859,24 +859,27 @@ export type ClientAction = z.infer<typeof CLIENT_ACTION_SCHEMA>;
859
859
  export declare const UsageReponseSchema: z.ZodObject<{
860
860
  type: z.ZodLiteral<"usage-response">;
861
861
  usage: z.ZodNumber;
862
- limit: z.ZodNumber;
863
- subscription_active: z.ZodBoolean;
864
- next_quota_reset: z.ZodDate;
865
- session_credits_used: z.ZodNumber;
862
+ remainingBalance: z.ZodNumber;
863
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
864
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
865
+ nextMonthlyGrant: z.ZodNumber;
866
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
866
867
  }, "strip", z.ZodTypeAny, {
867
868
  type: "usage-response";
868
869
  usage: number;
869
- limit: number;
870
- subscription_active: boolean;
871
- next_quota_reset: Date;
872
- session_credits_used: number;
870
+ remainingBalance: number;
871
+ next_quota_reset: Date | null;
872
+ nextMonthlyGrant: number;
873
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
874
+ autoTopupAdded?: number | undefined;
873
875
  }, {
874
876
  type: "usage-response";
875
877
  usage: number;
876
- limit: number;
877
- subscription_active: boolean;
878
- next_quota_reset: Date;
879
- session_credits_used: number;
878
+ remainingBalance: number;
879
+ next_quota_reset: Date | null;
880
+ nextMonthlyGrant: number;
881
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
882
+ autoTopupAdded?: number | undefined;
880
883
  }>;
881
884
  export type UsageResponse = z.infer<typeof UsageReponseSchema>;
882
885
  export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
@@ -884,24 +887,27 @@ export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
884
887
  }, Omit<{
885
888
  type: z.ZodLiteral<"usage-response">;
886
889
  usage: z.ZodNumber;
887
- limit: z.ZodNumber;
888
- subscription_active: z.ZodBoolean;
889
- next_quota_reset: z.ZodDate;
890
- session_credits_used: z.ZodNumber;
890
+ remainingBalance: z.ZodNumber;
891
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
892
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
893
+ nextMonthlyGrant: z.ZodNumber;
894
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
891
895
  }, "type">>, "strip", z.ZodTypeAny, {
892
896
  type: "init-response";
893
897
  usage: number;
894
- limit: number;
895
- subscription_active: boolean;
896
- next_quota_reset: Date;
897
- session_credits_used: number;
898
+ remainingBalance: number;
899
+ next_quota_reset: Date | null;
900
+ nextMonthlyGrant: number;
901
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
902
+ autoTopupAdded?: number | undefined;
898
903
  }, {
899
904
  type: "init-response";
900
905
  usage: number;
901
- limit: number;
902
- subscription_active: boolean;
903
- next_quota_reset: Date;
904
- session_credits_used: number;
906
+ remainingBalance: number;
907
+ next_quota_reset: Date | null;
908
+ nextMonthlyGrant: number;
909
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
910
+ autoTopupAdded?: number | undefined;
905
911
  }>;
906
912
  export type InitResponse = z.infer<typeof InitResponseSchema>;
907
913
  export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShape<{
@@ -913,92 +919,95 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
913
919
  path: z.ZodString;
914
920
  content: z.ZodString;
915
921
  }, "strip", z.ZodTypeAny, {
916
- path: string;
917
- type: "patch" | "file";
918
922
  content: string;
919
- }, {
920
- path: string;
921
923
  type: "patch" | "file";
924
+ path: string;
925
+ }, {
922
926
  content: string;
927
+ type: "patch" | "file";
928
+ path: string;
923
929
  }>, "many">;
924
930
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
925
931
  type: z.ZodEnum<["patch", "file"]>;
926
932
  path: z.ZodString;
927
933
  content: z.ZodString;
928
934
  }, "strip", z.ZodTypeAny, {
929
- path: string;
930
- type: "patch" | "file";
931
935
  content: string;
932
- }, {
933
- path: string;
934
936
  type: "patch" | "file";
937
+ path: string;
938
+ }, {
935
939
  content: string;
940
+ type: "patch" | "file";
941
+ path: string;
936
942
  }>, "many">;
937
943
  addedFileVersions: z.ZodArray<z.ZodObject<{
938
944
  path: z.ZodString;
939
945
  content: z.ZodString;
940
946
  }, "strip", z.ZodTypeAny, {
941
- path: string;
942
947
  content: string;
943
- }, {
944
948
  path: string;
949
+ }, {
945
950
  content: string;
951
+ path: string;
946
952
  }>, "many">;
947
953
  resetFileVersions: z.ZodBoolean;
948
954
  }, {
949
955
  usage: z.ZodOptional<z.ZodNumber>;
950
- limit: z.ZodOptional<z.ZodNumber>;
951
- subscription_active: z.ZodOptional<z.ZodBoolean>;
952
- next_quota_reset: z.ZodOptional<z.ZodDate>;
953
- session_credits_used: z.ZodOptional<z.ZodNumber>;
956
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
957
+ balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>>;
958
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
959
+ nextMonthlyGrant: z.ZodOptional<z.ZodNumber>;
960
+ autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
954
961
  }>, "strip", z.ZodTypeAny, {
955
962
  type: "response-complete";
956
963
  userInputId: string;
957
964
  response: string;
958
965
  changes: {
959
- path: string;
960
- type: "patch" | "file";
961
966
  content: string;
967
+ type: "patch" | "file";
968
+ path: string;
962
969
  }[];
963
970
  changesAlreadyApplied: {
964
- path: string;
965
- type: "patch" | "file";
966
971
  content: string;
972
+ type: "patch" | "file";
973
+ path: string;
967
974
  }[];
968
975
  addedFileVersions: {
969
- path: string;
970
976
  content: string;
977
+ path: string;
971
978
  }[];
972
979
  resetFileVersions: boolean;
973
980
  usage?: number | undefined;
974
- limit?: number | undefined;
975
- subscription_active?: boolean | undefined;
976
- next_quota_reset?: Date | undefined;
977
- session_credits_used?: number | undefined;
981
+ remainingBalance?: number | undefined;
982
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
983
+ next_quota_reset?: Date | null | undefined;
984
+ nextMonthlyGrant?: number | undefined;
985
+ autoTopupAdded?: number | undefined;
978
986
  }, {
979
987
  type: "response-complete";
980
988
  userInputId: string;
981
989
  response: string;
982
990
  changes: {
983
- path: string;
984
- type: "patch" | "file";
985
991
  content: string;
992
+ type: "patch" | "file";
993
+ path: string;
986
994
  }[];
987
995
  changesAlreadyApplied: {
988
- path: string;
989
- type: "patch" | "file";
990
996
  content: string;
997
+ type: "patch" | "file";
998
+ path: string;
991
999
  }[];
992
1000
  addedFileVersions: {
993
- path: string;
994
1001
  content: string;
1002
+ path: string;
995
1003
  }[];
996
1004
  resetFileVersions: boolean;
997
1005
  usage?: number | undefined;
998
- limit?: number | undefined;
999
- subscription_active?: boolean | undefined;
1000
- next_quota_reset?: Date | undefined;
1001
- session_credits_used?: number | undefined;
1006
+ remainingBalance?: number | undefined;
1007
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1008
+ next_quota_reset?: Date | null | undefined;
1009
+ nextMonthlyGrant?: number | undefined;
1010
+ autoTopupAdded?: number | undefined;
1002
1011
  }>;
1003
1012
  export declare const MessageCostResponseSchema: z.ZodObject<{
1004
1013
  type: z.ZodLiteral<"message-cost-response">;
@@ -1069,11 +1078,11 @@ export declare const PromptResponseSchema: z.ZodObject<{
1069
1078
  path: z.ZodString;
1070
1079
  content: z.ZodString;
1071
1080
  }, "strip", z.ZodTypeAny, {
1072
- path: string;
1073
1081
  content: string;
1074
- }, {
1075
1082
  path: string;
1083
+ }, {
1076
1084
  content: string;
1085
+ path: string;
1077
1086
  }>, "many">, "many">>;
1078
1087
  }, "strip", z.ZodTypeAny, {
1079
1088
  currentWorkingDirectory: string;
@@ -1098,8 +1107,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1098
1107
  };
1099
1108
  userKnowledgeFiles?: Record<string, string> | undefined;
1100
1109
  fileVersions?: {
1101
- path: string;
1102
1110
  content: string;
1111
+ path: string;
1103
1112
  }[][] | undefined;
1104
1113
  }, {
1105
1114
  currentWorkingDirectory: string;
@@ -1124,8 +1133,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1124
1133
  };
1125
1134
  userKnowledgeFiles?: Record<string, string> | undefined;
1126
1135
  fileVersions?: {
1127
- path: string;
1128
1136
  content: string;
1137
+ path: string;
1129
1138
  }[][] | undefined;
1130
1139
  }>;
1131
1140
  messageHistory: z.ZodArray<z.ZodObject<{
@@ -1141,14 +1150,14 @@ export declare const PromptResponseSchema: z.ZodObject<{
1141
1150
  type: "ephemeral";
1142
1151
  }>>;
1143
1152
  }, "strip", z.ZodTypeAny, {
1144
- type: "text";
1145
1153
  text: string;
1154
+ type: "text";
1146
1155
  cache_control?: {
1147
1156
  type: "ephemeral";
1148
1157
  } | undefined;
1149
1158
  }, {
1150
- type: "text";
1151
1159
  text: string;
1160
+ type: "text";
1152
1161
  cache_control?: {
1153
1162
  type: "ephemeral";
1154
1163
  } | undefined;
@@ -1192,15 +1201,15 @@ export declare const PromptResponseSchema: z.ZodObject<{
1192
1201
  type: "ephemeral";
1193
1202
  }>>;
1194
1203
  }, "strip", z.ZodTypeAny, {
1195
- type: "tool_result";
1196
1204
  content: string;
1205
+ type: "tool_result";
1197
1206
  tool_use_id: string;
1198
1207
  cache_control?: {
1199
1208
  type: "ephemeral";
1200
1209
  } | undefined;
1201
1210
  }, {
1202
- type: "tool_result";
1203
1211
  content: string;
1212
+ type: "tool_result";
1204
1213
  tool_use_id: string;
1205
1214
  cache_control?: {
1206
1215
  type: "ephemeral";
@@ -1212,13 +1221,13 @@ export declare const PromptResponseSchema: z.ZodObject<{
1212
1221
  media_type: z.ZodLiteral<"image/jpeg">;
1213
1222
  data: z.ZodString;
1214
1223
  }, "strip", z.ZodTypeAny, {
1224
+ data: string;
1215
1225
  type: "base64";
1216
1226
  media_type: "image/jpeg";
1217
- data: string;
1218
1227
  }, {
1228
+ data: string;
1219
1229
  type: "base64";
1220
1230
  media_type: "image/jpeg";
1221
- data: string;
1222
1231
  }>;
1223
1232
  cache_control: z.ZodOptional<z.ZodObject<{
1224
1233
  type: z.ZodLiteral<"ephemeral">;
@@ -1230,9 +1239,9 @@ export declare const PromptResponseSchema: z.ZodObject<{
1230
1239
  }, "strip", z.ZodTypeAny, {
1231
1240
  type: "image";
1232
1241
  source: {
1242
+ data: string;
1233
1243
  type: "base64";
1234
1244
  media_type: "image/jpeg";
1235
- data: string;
1236
1245
  };
1237
1246
  cache_control?: {
1238
1247
  type: "ephemeral";
@@ -1240,9 +1249,9 @@ export declare const PromptResponseSchema: z.ZodObject<{
1240
1249
  }, {
1241
1250
  type: "image";
1242
1251
  source: {
1252
+ data: string;
1243
1253
  type: "base64";
1244
1254
  media_type: "image/jpeg";
1245
- data: string;
1246
1255
  };
1247
1256
  cache_control?: {
1248
1257
  type: "ephemeral";
@@ -1250,8 +1259,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1250
1259
  }>]>, "many">]>;
1251
1260
  }, "strip", z.ZodTypeAny, {
1252
1261
  content: string | ({
1253
- type: "text";
1254
1262
  text: string;
1263
+ type: "text";
1255
1264
  cache_control?: {
1256
1265
  type: "ephemeral";
1257
1266
  } | undefined;
@@ -1264,8 +1273,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1264
1273
  type: "ephemeral";
1265
1274
  } | undefined;
1266
1275
  } | {
1267
- type: "tool_result";
1268
1276
  content: string;
1277
+ type: "tool_result";
1269
1278
  tool_use_id: string;
1270
1279
  cache_control?: {
1271
1280
  type: "ephemeral";
@@ -1273,9 +1282,9 @@ export declare const PromptResponseSchema: z.ZodObject<{
1273
1282
  } | {
1274
1283
  type: "image";
1275
1284
  source: {
1285
+ data: string;
1276
1286
  type: "base64";
1277
1287
  media_type: "image/jpeg";
1278
- data: string;
1279
1288
  };
1280
1289
  cache_control?: {
1281
1290
  type: "ephemeral";
@@ -1284,8 +1293,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1284
1293
  role: "user" | "assistant";
1285
1294
  }, {
1286
1295
  content: string | ({
1287
- type: "text";
1288
1296
  text: string;
1297
+ type: "text";
1289
1298
  cache_control?: {
1290
1299
  type: "ephemeral";
1291
1300
  } | undefined;
@@ -1298,8 +1307,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1298
1307
  type: "ephemeral";
1299
1308
  } | undefined;
1300
1309
  } | {
1301
- type: "tool_result";
1302
1310
  content: string;
1311
+ type: "tool_result";
1303
1312
  tool_use_id: string;
1304
1313
  cache_control?: {
1305
1314
  type: "ephemeral";
@@ -1307,9 +1316,9 @@ export declare const PromptResponseSchema: z.ZodObject<{
1307
1316
  } | {
1308
1317
  type: "image";
1309
1318
  source: {
1319
+ data: string;
1310
1320
  type: "base64";
1311
1321
  media_type: "image/jpeg";
1312
- data: string;
1313
1322
  };
1314
1323
  cache_control?: {
1315
1324
  type: "ephemeral";
@@ -1343,14 +1352,14 @@ export declare const PromptResponseSchema: z.ZodObject<{
1343
1352
  };
1344
1353
  userKnowledgeFiles?: Record<string, string> | undefined;
1345
1354
  fileVersions?: {
1346
- path: string;
1347
1355
  content: string;
1356
+ path: string;
1348
1357
  }[][] | undefined;
1349
1358
  };
1350
1359
  messageHistory: {
1351
1360
  content: string | ({
1352
- type: "text";
1353
1361
  text: string;
1362
+ type: "text";
1354
1363
  cache_control?: {
1355
1364
  type: "ephemeral";
1356
1365
  } | undefined;
@@ -1363,8 +1372,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1363
1372
  type: "ephemeral";
1364
1373
  } | undefined;
1365
1374
  } | {
1366
- type: "tool_result";
1367
1375
  content: string;
1376
+ type: "tool_result";
1368
1377
  tool_use_id: string;
1369
1378
  cache_control?: {
1370
1379
  type: "ephemeral";
@@ -1372,9 +1381,9 @@ export declare const PromptResponseSchema: z.ZodObject<{
1372
1381
  } | {
1373
1382
  type: "image";
1374
1383
  source: {
1384
+ data: string;
1375
1385
  type: "base64";
1376
1386
  media_type: "image/jpeg";
1377
- data: string;
1378
1387
  };
1379
1388
  cache_control?: {
1380
1389
  type: "ephemeral";
@@ -1408,14 +1417,14 @@ export declare const PromptResponseSchema: z.ZodObject<{
1408
1417
  };
1409
1418
  userKnowledgeFiles?: Record<string, string> | undefined;
1410
1419
  fileVersions?: {
1411
- path: string;
1412
1420
  content: string;
1421
+ path: string;
1413
1422
  }[][] | undefined;
1414
1423
  };
1415
1424
  messageHistory: {
1416
1425
  content: string | ({
1417
- type: "text";
1418
1426
  text: string;
1427
+ type: "text";
1419
1428
  cache_control?: {
1420
1429
  type: "ephemeral";
1421
1430
  } | undefined;
@@ -1428,8 +1437,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1428
1437
  type: "ephemeral";
1429
1438
  } | undefined;
1430
1439
  } | {
1431
- type: "tool_result";
1432
1440
  content: string;
1441
+ type: "tool_result";
1433
1442
  tool_use_id: string;
1434
1443
  cache_control?: {
1435
1444
  type: "ephemeral";
@@ -1437,9 +1446,9 @@ export declare const PromptResponseSchema: z.ZodObject<{
1437
1446
  } | {
1438
1447
  type: "image";
1439
1448
  source: {
1449
+ data: string;
1440
1450
  type: "base64";
1441
1451
  media_type: "image/jpeg";
1442
- data: string;
1443
1452
  };
1444
1453
  cache_control?: {
1445
1454
  type: "ephemeral";
@@ -1455,12 +1464,12 @@ export declare const PromptResponseSchema: z.ZodObject<{
1455
1464
  id: z.ZodString;
1456
1465
  }, "strip", z.ZodTypeAny, {
1457
1466
  name: string;
1458
- parameters: Record<string, string>;
1459
1467
  id: string;
1468
+ parameters: Record<string, string>;
1460
1469
  }, {
1461
1470
  name: string;
1462
- parameters: Record<string, string>;
1463
1471
  id: string;
1472
+ parameters: Record<string, string>;
1464
1473
  }>, "many">;
1465
1474
  toolResults: z.ZodArray<z.ZodObject<{
1466
1475
  name: z.ZodString;
@@ -1503,14 +1512,14 @@ export declare const PromptResponseSchema: z.ZodObject<{
1503
1512
  };
1504
1513
  userKnowledgeFiles?: Record<string, string> | undefined;
1505
1514
  fileVersions?: {
1506
- path: string;
1507
1515
  content: string;
1516
+ path: string;
1508
1517
  }[][] | undefined;
1509
1518
  };
1510
1519
  messageHistory: {
1511
1520
  content: string | ({
1512
- type: "text";
1513
1521
  text: string;
1522
+ type: "text";
1514
1523
  cache_control?: {
1515
1524
  type: "ephemeral";
1516
1525
  } | undefined;
@@ -1523,8 +1532,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1523
1532
  type: "ephemeral";
1524
1533
  } | undefined;
1525
1534
  } | {
1526
- type: "tool_result";
1527
1535
  content: string;
1536
+ type: "tool_result";
1528
1537
  tool_use_id: string;
1529
1538
  cache_control?: {
1530
1539
  type: "ephemeral";
@@ -1532,9 +1541,9 @@ export declare const PromptResponseSchema: z.ZodObject<{
1532
1541
  } | {
1533
1542
  type: "image";
1534
1543
  source: {
1544
+ data: string;
1535
1545
  type: "base64";
1536
1546
  media_type: "image/jpeg";
1537
- data: string;
1538
1547
  };
1539
1548
  cache_control?: {
1540
1549
  type: "ephemeral";
@@ -1551,8 +1560,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1551
1560
  }[];
1552
1561
  toolCalls: {
1553
1562
  name: string;
1554
- parameters: Record<string, string>;
1555
1563
  id: string;
1564
+ parameters: Record<string, string>;
1556
1565
  }[];
1557
1566
  }, {
1558
1567
  type: "prompt-response";
@@ -1582,14 +1591,14 @@ export declare const PromptResponseSchema: z.ZodObject<{
1582
1591
  };
1583
1592
  userKnowledgeFiles?: Record<string, string> | undefined;
1584
1593
  fileVersions?: {
1585
- path: string;
1586
1594
  content: string;
1595
+ path: string;
1587
1596
  }[][] | undefined;
1588
1597
  };
1589
1598
  messageHistory: {
1590
1599
  content: string | ({
1591
- type: "text";
1592
1600
  text: string;
1601
+ type: "text";
1593
1602
  cache_control?: {
1594
1603
  type: "ephemeral";
1595
1604
  } | undefined;
@@ -1602,8 +1611,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1602
1611
  type: "ephemeral";
1603
1612
  } | undefined;
1604
1613
  } | {
1605
- type: "tool_result";
1606
1614
  content: string;
1615
+ type: "tool_result";
1607
1616
  tool_use_id: string;
1608
1617
  cache_control?: {
1609
1618
  type: "ephemeral";
@@ -1611,9 +1620,9 @@ export declare const PromptResponseSchema: z.ZodObject<{
1611
1620
  } | {
1612
1621
  type: "image";
1613
1622
  source: {
1623
+ data: string;
1614
1624
  type: "base64";
1615
1625
  media_type: "image/jpeg";
1616
- data: string;
1617
1626
  };
1618
1627
  cache_control?: {
1619
1628
  type: "ephemeral";
@@ -1630,8 +1639,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1630
1639
  }[];
1631
1640
  toolCalls: {
1632
1641
  name: string;
1633
- parameters: Record<string, string>;
1634
1642
  id: string;
1643
+ parameters: Record<string, string>;
1635
1644
  }[];
1636
1645
  }>;
1637
1646
  export type PromptResponse = z.infer<typeof PromptResponseSchema>;
@@ -1656,92 +1665,95 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1656
1665
  path: z.ZodString;
1657
1666
  content: z.ZodString;
1658
1667
  }, "strip", z.ZodTypeAny, {
1659
- path: string;
1660
- type: "patch" | "file";
1661
1668
  content: string;
1662
- }, {
1663
- path: string;
1664
1669
  type: "patch" | "file";
1670
+ path: string;
1671
+ }, {
1665
1672
  content: string;
1673
+ type: "patch" | "file";
1674
+ path: string;
1666
1675
  }>, "many">;
1667
1676
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1668
1677
  type: z.ZodEnum<["patch", "file"]>;
1669
1678
  path: z.ZodString;
1670
1679
  content: z.ZodString;
1671
1680
  }, "strip", z.ZodTypeAny, {
1672
- path: string;
1673
- type: "patch" | "file";
1674
1681
  content: string;
1675
- }, {
1676
- path: string;
1677
1682
  type: "patch" | "file";
1683
+ path: string;
1684
+ }, {
1678
1685
  content: string;
1686
+ type: "patch" | "file";
1687
+ path: string;
1679
1688
  }>, "many">;
1680
1689
  addedFileVersions: z.ZodArray<z.ZodObject<{
1681
1690
  path: z.ZodString;
1682
1691
  content: z.ZodString;
1683
1692
  }, "strip", z.ZodTypeAny, {
1684
- path: string;
1685
1693
  content: string;
1686
- }, {
1687
1694
  path: string;
1695
+ }, {
1688
1696
  content: string;
1697
+ path: string;
1689
1698
  }>, "many">;
1690
1699
  resetFileVersions: z.ZodBoolean;
1691
1700
  }, {
1692
1701
  usage: z.ZodOptional<z.ZodNumber>;
1693
- limit: z.ZodOptional<z.ZodNumber>;
1694
- subscription_active: z.ZodOptional<z.ZodBoolean>;
1695
- next_quota_reset: z.ZodOptional<z.ZodDate>;
1696
- session_credits_used: z.ZodOptional<z.ZodNumber>;
1702
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
1703
+ balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>>;
1704
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1705
+ nextMonthlyGrant: z.ZodOptional<z.ZodNumber>;
1706
+ autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1697
1707
  }>, "strip", z.ZodTypeAny, {
1698
1708
  type: "response-complete";
1699
1709
  userInputId: string;
1700
1710
  response: string;
1701
1711
  changes: {
1702
- path: string;
1703
- type: "patch" | "file";
1704
1712
  content: string;
1713
+ type: "patch" | "file";
1714
+ path: string;
1705
1715
  }[];
1706
1716
  changesAlreadyApplied: {
1707
- path: string;
1708
- type: "patch" | "file";
1709
1717
  content: string;
1718
+ type: "patch" | "file";
1719
+ path: string;
1710
1720
  }[];
1711
1721
  addedFileVersions: {
1712
- path: string;
1713
1722
  content: string;
1723
+ path: string;
1714
1724
  }[];
1715
1725
  resetFileVersions: boolean;
1716
1726
  usage?: number | undefined;
1717
- limit?: number | undefined;
1718
- subscription_active?: boolean | undefined;
1719
- next_quota_reset?: Date | undefined;
1720
- session_credits_used?: number | undefined;
1727
+ remainingBalance?: number | undefined;
1728
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1729
+ next_quota_reset?: Date | null | undefined;
1730
+ nextMonthlyGrant?: number | undefined;
1731
+ autoTopupAdded?: number | undefined;
1721
1732
  }, {
1722
1733
  type: "response-complete";
1723
1734
  userInputId: string;
1724
1735
  response: string;
1725
1736
  changes: {
1726
- path: string;
1727
- type: "patch" | "file";
1728
1737
  content: string;
1738
+ type: "patch" | "file";
1739
+ path: string;
1729
1740
  }[];
1730
1741
  changesAlreadyApplied: {
1731
- path: string;
1732
- type: "patch" | "file";
1733
1742
  content: string;
1743
+ type: "patch" | "file";
1744
+ path: string;
1734
1745
  }[];
1735
1746
  addedFileVersions: {
1736
- path: string;
1737
1747
  content: string;
1748
+ path: string;
1738
1749
  }[];
1739
1750
  resetFileVersions: boolean;
1740
1751
  usage?: number | undefined;
1741
- limit?: number | undefined;
1742
- subscription_active?: boolean | undefined;
1743
- next_quota_reset?: Date | undefined;
1744
- session_credits_used?: number | undefined;
1752
+ remainingBalance?: number | undefined;
1753
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1754
+ next_quota_reset?: Date | null | undefined;
1755
+ nextMonthlyGrant?: number | undefined;
1756
+ autoTopupAdded?: number | undefined;
1745
1757
  }>, z.ZodObject<{
1746
1758
  type: z.ZodLiteral<"prompt-response">;
1747
1759
  promptId: z.ZodString;
@@ -1797,11 +1809,11 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1797
1809
  path: z.ZodString;
1798
1810
  content: z.ZodString;
1799
1811
  }, "strip", z.ZodTypeAny, {
1800
- path: string;
1801
1812
  content: string;
1802
- }, {
1803
1813
  path: string;
1814
+ }, {
1804
1815
  content: string;
1816
+ path: string;
1805
1817
  }>, "many">, "many">>;
1806
1818
  }, "strip", z.ZodTypeAny, {
1807
1819
  currentWorkingDirectory: string;
@@ -1826,8 +1838,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1826
1838
  };
1827
1839
  userKnowledgeFiles?: Record<string, string> | undefined;
1828
1840
  fileVersions?: {
1829
- path: string;
1830
1841
  content: string;
1842
+ path: string;
1831
1843
  }[][] | undefined;
1832
1844
  }, {
1833
1845
  currentWorkingDirectory: string;
@@ -1852,8 +1864,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1852
1864
  };
1853
1865
  userKnowledgeFiles?: Record<string, string> | undefined;
1854
1866
  fileVersions?: {
1855
- path: string;
1856
1867
  content: string;
1868
+ path: string;
1857
1869
  }[][] | undefined;
1858
1870
  }>;
1859
1871
  messageHistory: z.ZodArray<z.ZodObject<{
@@ -1869,14 +1881,14 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1869
1881
  type: "ephemeral";
1870
1882
  }>>;
1871
1883
  }, "strip", z.ZodTypeAny, {
1872
- type: "text";
1873
1884
  text: string;
1885
+ type: "text";
1874
1886
  cache_control?: {
1875
1887
  type: "ephemeral";
1876
1888
  } | undefined;
1877
1889
  }, {
1878
- type: "text";
1879
1890
  text: string;
1891
+ type: "text";
1880
1892
  cache_control?: {
1881
1893
  type: "ephemeral";
1882
1894
  } | undefined;
@@ -1920,15 +1932,15 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1920
1932
  type: "ephemeral";
1921
1933
  }>>;
1922
1934
  }, "strip", z.ZodTypeAny, {
1923
- type: "tool_result";
1924
1935
  content: string;
1936
+ type: "tool_result";
1925
1937
  tool_use_id: string;
1926
1938
  cache_control?: {
1927
1939
  type: "ephemeral";
1928
1940
  } | undefined;
1929
1941
  }, {
1930
- type: "tool_result";
1931
1942
  content: string;
1943
+ type: "tool_result";
1932
1944
  tool_use_id: string;
1933
1945
  cache_control?: {
1934
1946
  type: "ephemeral";
@@ -1940,13 +1952,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1940
1952
  media_type: z.ZodLiteral<"image/jpeg">;
1941
1953
  data: z.ZodString;
1942
1954
  }, "strip", z.ZodTypeAny, {
1955
+ data: string;
1943
1956
  type: "base64";
1944
1957
  media_type: "image/jpeg";
1945
- data: string;
1946
1958
  }, {
1959
+ data: string;
1947
1960
  type: "base64";
1948
1961
  media_type: "image/jpeg";
1949
- data: string;
1950
1962
  }>;
1951
1963
  cache_control: z.ZodOptional<z.ZodObject<{
1952
1964
  type: z.ZodLiteral<"ephemeral">;
@@ -1958,9 +1970,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1958
1970
  }, "strip", z.ZodTypeAny, {
1959
1971
  type: "image";
1960
1972
  source: {
1973
+ data: string;
1961
1974
  type: "base64";
1962
1975
  media_type: "image/jpeg";
1963
- data: string;
1964
1976
  };
1965
1977
  cache_control?: {
1966
1978
  type: "ephemeral";
@@ -1968,9 +1980,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1968
1980
  }, {
1969
1981
  type: "image";
1970
1982
  source: {
1983
+ data: string;
1971
1984
  type: "base64";
1972
1985
  media_type: "image/jpeg";
1973
- data: string;
1974
1986
  };
1975
1987
  cache_control?: {
1976
1988
  type: "ephemeral";
@@ -1978,8 +1990,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1978
1990
  }>]>, "many">]>;
1979
1991
  }, "strip", z.ZodTypeAny, {
1980
1992
  content: string | ({
1981
- type: "text";
1982
1993
  text: string;
1994
+ type: "text";
1983
1995
  cache_control?: {
1984
1996
  type: "ephemeral";
1985
1997
  } | undefined;
@@ -1992,8 +2004,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1992
2004
  type: "ephemeral";
1993
2005
  } | undefined;
1994
2006
  } | {
1995
- type: "tool_result";
1996
2007
  content: string;
2008
+ type: "tool_result";
1997
2009
  tool_use_id: string;
1998
2010
  cache_control?: {
1999
2011
  type: "ephemeral";
@@ -2001,9 +2013,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2001
2013
  } | {
2002
2014
  type: "image";
2003
2015
  source: {
2016
+ data: string;
2004
2017
  type: "base64";
2005
2018
  media_type: "image/jpeg";
2006
- data: string;
2007
2019
  };
2008
2020
  cache_control?: {
2009
2021
  type: "ephemeral";
@@ -2012,8 +2024,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2012
2024
  role: "user" | "assistant";
2013
2025
  }, {
2014
2026
  content: string | ({
2015
- type: "text";
2016
2027
  text: string;
2028
+ type: "text";
2017
2029
  cache_control?: {
2018
2030
  type: "ephemeral";
2019
2031
  } | undefined;
@@ -2026,8 +2038,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2026
2038
  type: "ephemeral";
2027
2039
  } | undefined;
2028
2040
  } | {
2029
- type: "tool_result";
2030
2041
  content: string;
2042
+ type: "tool_result";
2031
2043
  tool_use_id: string;
2032
2044
  cache_control?: {
2033
2045
  type: "ephemeral";
@@ -2035,9 +2047,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2035
2047
  } | {
2036
2048
  type: "image";
2037
2049
  source: {
2050
+ data: string;
2038
2051
  type: "base64";
2039
2052
  media_type: "image/jpeg";
2040
- data: string;
2041
2053
  };
2042
2054
  cache_control?: {
2043
2055
  type: "ephemeral";
@@ -2071,14 +2083,14 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2071
2083
  };
2072
2084
  userKnowledgeFiles?: Record<string, string> | undefined;
2073
2085
  fileVersions?: {
2074
- path: string;
2075
2086
  content: string;
2087
+ path: string;
2076
2088
  }[][] | undefined;
2077
2089
  };
2078
2090
  messageHistory: {
2079
2091
  content: string | ({
2080
- type: "text";
2081
2092
  text: string;
2093
+ type: "text";
2082
2094
  cache_control?: {
2083
2095
  type: "ephemeral";
2084
2096
  } | undefined;
@@ -2091,8 +2103,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2091
2103
  type: "ephemeral";
2092
2104
  } | undefined;
2093
2105
  } | {
2094
- type: "tool_result";
2095
2106
  content: string;
2107
+ type: "tool_result";
2096
2108
  tool_use_id: string;
2097
2109
  cache_control?: {
2098
2110
  type: "ephemeral";
@@ -2100,9 +2112,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2100
2112
  } | {
2101
2113
  type: "image";
2102
2114
  source: {
2115
+ data: string;
2103
2116
  type: "base64";
2104
2117
  media_type: "image/jpeg";
2105
- data: string;
2106
2118
  };
2107
2119
  cache_control?: {
2108
2120
  type: "ephemeral";
@@ -2136,14 +2148,14 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2136
2148
  };
2137
2149
  userKnowledgeFiles?: Record<string, string> | undefined;
2138
2150
  fileVersions?: {
2139
- path: string;
2140
2151
  content: string;
2152
+ path: string;
2141
2153
  }[][] | undefined;
2142
2154
  };
2143
2155
  messageHistory: {
2144
2156
  content: string | ({
2145
- type: "text";
2146
2157
  text: string;
2158
+ type: "text";
2147
2159
  cache_control?: {
2148
2160
  type: "ephemeral";
2149
2161
  } | undefined;
@@ -2156,8 +2168,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2156
2168
  type: "ephemeral";
2157
2169
  } | undefined;
2158
2170
  } | {
2159
- type: "tool_result";
2160
2171
  content: string;
2172
+ type: "tool_result";
2161
2173
  tool_use_id: string;
2162
2174
  cache_control?: {
2163
2175
  type: "ephemeral";
@@ -2165,9 +2177,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2165
2177
  } | {
2166
2178
  type: "image";
2167
2179
  source: {
2180
+ data: string;
2168
2181
  type: "base64";
2169
2182
  media_type: "image/jpeg";
2170
- data: string;
2171
2183
  };
2172
2184
  cache_control?: {
2173
2185
  type: "ephemeral";
@@ -2183,12 +2195,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2183
2195
  id: z.ZodString;
2184
2196
  }, "strip", z.ZodTypeAny, {
2185
2197
  name: string;
2186
- parameters: Record<string, string>;
2187
2198
  id: string;
2199
+ parameters: Record<string, string>;
2188
2200
  }, {
2189
2201
  name: string;
2190
- parameters: Record<string, string>;
2191
2202
  id: string;
2203
+ parameters: Record<string, string>;
2192
2204
  }>, "many">;
2193
2205
  toolResults: z.ZodArray<z.ZodObject<{
2194
2206
  name: z.ZodString;
@@ -2231,14 +2243,14 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2231
2243
  };
2232
2244
  userKnowledgeFiles?: Record<string, string> | undefined;
2233
2245
  fileVersions?: {
2234
- path: string;
2235
2246
  content: string;
2247
+ path: string;
2236
2248
  }[][] | undefined;
2237
2249
  };
2238
2250
  messageHistory: {
2239
2251
  content: string | ({
2240
- type: "text";
2241
2252
  text: string;
2253
+ type: "text";
2242
2254
  cache_control?: {
2243
2255
  type: "ephemeral";
2244
2256
  } | undefined;
@@ -2251,8 +2263,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2251
2263
  type: "ephemeral";
2252
2264
  } | undefined;
2253
2265
  } | {
2254
- type: "tool_result";
2255
2266
  content: string;
2267
+ type: "tool_result";
2256
2268
  tool_use_id: string;
2257
2269
  cache_control?: {
2258
2270
  type: "ephemeral";
@@ -2260,9 +2272,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2260
2272
  } | {
2261
2273
  type: "image";
2262
2274
  source: {
2275
+ data: string;
2263
2276
  type: "base64";
2264
2277
  media_type: "image/jpeg";
2265
- data: string;
2266
2278
  };
2267
2279
  cache_control?: {
2268
2280
  type: "ephemeral";
@@ -2279,8 +2291,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2279
2291
  }[];
2280
2292
  toolCalls: {
2281
2293
  name: string;
2282
- parameters: Record<string, string>;
2283
2294
  id: string;
2295
+ parameters: Record<string, string>;
2284
2296
  }[];
2285
2297
  }, {
2286
2298
  type: "prompt-response";
@@ -2310,14 +2322,14 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2310
2322
  };
2311
2323
  userKnowledgeFiles?: Record<string, string> | undefined;
2312
2324
  fileVersions?: {
2313
- path: string;
2314
2325
  content: string;
2326
+ path: string;
2315
2327
  }[][] | undefined;
2316
2328
  };
2317
2329
  messageHistory: {
2318
2330
  content: string | ({
2319
- type: "text";
2320
2331
  text: string;
2332
+ type: "text";
2321
2333
  cache_control?: {
2322
2334
  type: "ephemeral";
2323
2335
  } | undefined;
@@ -2330,8 +2342,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2330
2342
  type: "ephemeral";
2331
2343
  } | undefined;
2332
2344
  } | {
2333
- type: "tool_result";
2334
2345
  content: string;
2346
+ type: "tool_result";
2335
2347
  tool_use_id: string;
2336
2348
  cache_control?: {
2337
2349
  type: "ephemeral";
@@ -2339,9 +2351,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2339
2351
  } | {
2340
2352
  type: "image";
2341
2353
  source: {
2354
+ data: string;
2342
2355
  type: "base64";
2343
2356
  media_type: "image/jpeg";
2344
- data: string;
2345
2357
  };
2346
2358
  cache_control?: {
2347
2359
  type: "ephemeral";
@@ -2358,8 +2370,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2358
2370
  }[];
2359
2371
  toolCalls: {
2360
2372
  name: string;
2361
- parameters: Record<string, string>;
2362
2373
  id: string;
2374
+ parameters: Record<string, string>;
2363
2375
  }[];
2364
2376
  }>, z.ZodObject<{
2365
2377
  type: z.ZodLiteral<"read-files">;
@@ -2395,84 +2407,84 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2395
2407
  path: z.ZodString;
2396
2408
  content: z.ZodString;
2397
2409
  }, "strip", z.ZodTypeAny, {
2398
- path: string;
2399
- type: "patch" | "file";
2400
2410
  content: string;
2401
- }, {
2402
- path: string;
2403
2411
  type: "patch" | "file";
2412
+ path: string;
2413
+ }, {
2404
2414
  content: string;
2415
+ type: "patch" | "file";
2416
+ path: string;
2405
2417
  }>, "many">;
2406
2418
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2407
2419
  type: z.ZodEnum<["patch", "file"]>;
2408
2420
  path: z.ZodString;
2409
2421
  content: z.ZodString;
2410
2422
  }, "strip", z.ZodTypeAny, {
2411
- path: string;
2412
- type: "patch" | "file";
2413
2423
  content: string;
2414
- }, {
2415
- path: string;
2416
2424
  type: "patch" | "file";
2425
+ path: string;
2426
+ }, {
2417
2427
  content: string;
2428
+ type: "patch" | "file";
2429
+ path: string;
2418
2430
  }>, "many">;
2419
2431
  addedFileVersions: z.ZodArray<z.ZodObject<{
2420
2432
  path: z.ZodString;
2421
2433
  content: z.ZodString;
2422
2434
  }, "strip", z.ZodTypeAny, {
2423
- path: string;
2424
2435
  content: string;
2425
- }, {
2426
2436
  path: string;
2437
+ }, {
2427
2438
  content: string;
2439
+ path: string;
2428
2440
  }>, "many">;
2429
2441
  resetFileVersions: z.ZodBoolean;
2430
2442
  }, "strip", z.ZodTypeAny, {
2431
- type: "tool-call";
2432
2443
  data: {
2433
2444
  name: string;
2434
2445
  id: string;
2435
2446
  input: Record<string, any>;
2436
2447
  };
2448
+ type: "tool-call";
2437
2449
  userInputId: string;
2438
2450
  response: string;
2439
2451
  changes: {
2440
- path: string;
2441
- type: "patch" | "file";
2442
2452
  content: string;
2453
+ type: "patch" | "file";
2454
+ path: string;
2443
2455
  }[];
2444
2456
  changesAlreadyApplied: {
2445
- path: string;
2446
- type: "patch" | "file";
2447
2457
  content: string;
2458
+ type: "patch" | "file";
2459
+ path: string;
2448
2460
  }[];
2449
2461
  addedFileVersions: {
2450
- path: string;
2451
2462
  content: string;
2463
+ path: string;
2452
2464
  }[];
2453
2465
  resetFileVersions: boolean;
2454
2466
  }, {
2455
- type: "tool-call";
2456
2467
  data: {
2457
2468
  name: string;
2458
2469
  id: string;
2459
2470
  input: Record<string, any>;
2460
2471
  };
2472
+ type: "tool-call";
2461
2473
  userInputId: string;
2462
2474
  response: string;
2463
2475
  changes: {
2464
- path: string;
2465
- type: "patch" | "file";
2466
2476
  content: string;
2477
+ type: "patch" | "file";
2478
+ path: string;
2467
2479
  }[];
2468
2480
  changesAlreadyApplied: {
2469
- path: string;
2470
- type: "patch" | "file";
2471
2481
  content: string;
2482
+ type: "patch" | "file";
2483
+ path: string;
2472
2484
  }[];
2473
2485
  addedFileVersions: {
2474
- path: string;
2475
2486
  content: string;
2487
+ path: string;
2476
2488
  }[];
2477
2489
  resetFileVersions: boolean;
2478
2490
  }>, z.ZodObject<{
@@ -2504,45 +2516,51 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2504
2516
  }, Omit<{
2505
2517
  type: z.ZodLiteral<"usage-response">;
2506
2518
  usage: z.ZodNumber;
2507
- limit: z.ZodNumber;
2508
- subscription_active: z.ZodBoolean;
2509
- next_quota_reset: z.ZodDate;
2510
- session_credits_used: z.ZodNumber;
2519
+ remainingBalance: z.ZodNumber;
2520
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
2521
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
2522
+ nextMonthlyGrant: z.ZodNumber;
2523
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
2511
2524
  }, "type">>, "strip", z.ZodTypeAny, {
2512
2525
  type: "init-response";
2513
2526
  usage: number;
2514
- limit: number;
2515
- subscription_active: boolean;
2516
- next_quota_reset: Date;
2517
- session_credits_used: number;
2527
+ remainingBalance: number;
2528
+ next_quota_reset: Date | null;
2529
+ nextMonthlyGrant: number;
2530
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2531
+ autoTopupAdded?: number | undefined;
2518
2532
  }, {
2519
2533
  type: "init-response";
2520
2534
  usage: number;
2521
- limit: number;
2522
- subscription_active: boolean;
2523
- next_quota_reset: Date;
2524
- session_credits_used: number;
2535
+ remainingBalance: number;
2536
+ next_quota_reset: Date | null;
2537
+ nextMonthlyGrant: number;
2538
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2539
+ autoTopupAdded?: number | undefined;
2525
2540
  }>, z.ZodObject<{
2526
2541
  type: z.ZodLiteral<"usage-response">;
2527
2542
  usage: z.ZodNumber;
2528
- limit: z.ZodNumber;
2529
- subscription_active: z.ZodBoolean;
2530
- next_quota_reset: z.ZodDate;
2531
- session_credits_used: z.ZodNumber;
2543
+ remainingBalance: z.ZodNumber;
2544
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
2545
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
2546
+ nextMonthlyGrant: z.ZodNumber;
2547
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
2532
2548
  }, "strip", z.ZodTypeAny, {
2533
2549
  type: "usage-response";
2534
2550
  usage: number;
2535
- limit: number;
2536
- subscription_active: boolean;
2537
- next_quota_reset: Date;
2538
- session_credits_used: number;
2551
+ remainingBalance: number;
2552
+ next_quota_reset: Date | null;
2553
+ nextMonthlyGrant: number;
2554
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2555
+ autoTopupAdded?: number | undefined;
2539
2556
  }, {
2540
2557
  type: "usage-response";
2541
2558
  usage: number;
2542
- limit: number;
2543
- subscription_active: boolean;
2544
- next_quota_reset: Date;
2545
- session_credits_used: number;
2559
+ remainingBalance: number;
2560
+ next_quota_reset: Date | null;
2561
+ nextMonthlyGrant: number;
2562
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2563
+ autoTopupAdded?: number | undefined;
2546
2564
  }>, z.ZodObject<{
2547
2565
  type: z.ZodLiteral<"message-cost-response">;
2548
2566
  promptId: z.ZodString;
@@ -2558,12 +2576,18 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2558
2576
  }>, z.ZodObject<{
2559
2577
  type: z.ZodLiteral<"action-error">;
2560
2578
  message: z.ZodString;
2579
+ error: z.ZodOptional<z.ZodString>;
2580
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
2561
2581
  }, "strip", z.ZodTypeAny, {
2562
- message: string;
2563
2582
  type: "action-error";
2564
- }, {
2565
2583
  message: string;
2584
+ error?: string | undefined;
2585
+ remainingBalance?: number | undefined;
2586
+ }, {
2566
2587
  type: "action-error";
2588
+ message: string;
2589
+ error?: string | undefined;
2590
+ remainingBalance?: number | undefined;
2567
2591
  }>, z.ZodObject<{
2568
2592
  type: z.ZodLiteral<"commit-message-response">;
2569
2593
  commitMessage: z.ZodString;