codebuff 1.0.282 → 1.0.284

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 (147) hide show
  1. package/dist/cli-definitions.d.ts +9 -0
  2. package/dist/cli-definitions.js +55 -0
  3. package/dist/cli-definitions.js.map +1 -0
  4. package/dist/cli.d.ts +0 -1
  5. package/dist/cli.js +48 -51
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client.d.ts +17 -13
  8. package/dist/client.js +19 -0
  9. package/dist/client.js.map +1 -1
  10. package/dist/code-map/parse.d.ts.map +1 -1
  11. package/dist/code-map/parse.js.map +1 -1
  12. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  13. package/dist/common/actions.d.ts +84 -84
  14. package/dist/common/analytics.js +7 -1
  15. package/dist/common/analytics.js.map +1 -1
  16. package/dist/common/constants/analytics-events.d.ts +4 -2
  17. package/dist/common/constants/analytics-events.js +4 -1
  18. package/dist/common/constants/analytics-events.js.map +1 -1
  19. package/dist/common/constants/tools.d.ts +1 -0
  20. package/dist/common/constants/tools.js +1 -0
  21. package/dist/common/constants/tools.js.map +1 -1
  22. package/dist/common/db/schema.d.ts +4 -4
  23. package/dist/common/db/schema.js +1 -0
  24. package/dist/common/db/schema.js.map +1 -1
  25. package/dist/common/types/agent-state.d.ts +8 -8
  26. package/dist/common/types/grant.d.ts +1 -1
  27. package/dist/common/types/grant.js.map +1 -1
  28. package/dist/common/types/message.d.ts +6 -6
  29. package/dist/common/types/usage.d.ts +5 -5
  30. package/dist/common/types/usage.js +2 -1
  31. package/dist/common/types/usage.js.map +1 -1
  32. package/dist/common/util/__tests__/saxy.test.js +182 -48
  33. package/dist/common/util/__tests__/saxy.test.js.map +1 -1
  34. package/dist/common/util/credentials.d.ts +2 -2
  35. package/dist/common/util/random.d.ts +1 -0
  36. package/dist/common/util/random.js +17 -0
  37. package/dist/common/util/random.js.map +1 -0
  38. package/dist/common/util/saxy.d.ts +0 -1
  39. package/dist/common/util/saxy.js +4 -20
  40. package/dist/common/util/saxy.js.map +1 -1
  41. package/dist/common/util/string.js +4 -4
  42. package/dist/common/util/string.js.map +1 -1
  43. package/dist/common/websockets/websocket-schema.d.ts +154 -154
  44. package/dist/display.js.map +1 -1
  45. package/dist/index.js +25 -30
  46. package/dist/index.js.map +1 -1
  47. package/dist/menu.js +94 -52
  48. package/dist/menu.js.map +1 -1
  49. package/dist/tool-handlers.js +1 -0
  50. package/dist/tool-handlers.js.map +1 -1
  51. package/dist/utils/__tests__/tool-renderers.test.js +4 -6
  52. package/dist/utils/__tests__/tool-renderers.test.js.map +1 -1
  53. package/dist/utils/terminal.js +1 -1
  54. package/dist/utils/terminal.js.map +1 -1
  55. package/dist/utils/tool-renderers.js +3 -0
  56. package/dist/utils/tool-renderers.js.map +1 -1
  57. package/package.json +1 -1
  58. package/dist/cli-handlers/initialization-flow.d.ts +0 -1
  59. package/dist/cli-handlers/initialization-flow.js +0 -24
  60. package/dist/cli-handlers/initialization-flow.js.map +0 -1
  61. package/dist/cli-modules/command-processor.d.ts +0 -2
  62. package/dist/cli-modules/command-processor.js +0 -112
  63. package/dist/cli-modules/command-processor.js.map +0 -1
  64. package/dist/cli-modules/input-handler.d.ts +0 -4
  65. package/dist/cli-modules/input-handler.js +0 -75
  66. package/dist/cli-modules/input-handler.js.map +0 -1
  67. package/dist/cli-modules/readline-handler.d.ts +0 -11
  68. package/dist/cli-modules/readline-handler.js +0 -158
  69. package/dist/cli-modules/readline-handler.js.map +0 -1
  70. package/dist/cli-modules/signal-handler.d.ts +0 -7
  71. package/dist/cli-modules/signal-handler.js +0 -128
  72. package/dist/cli-modules/signal-handler.js.map +0 -1
  73. package/dist/cli-modules/types.d.ts +0 -51
  74. package/dist/cli-modules/types.js +0 -3
  75. package/dist/cli-modules/types.js.map +0 -1
  76. package/dist/cli-modules/websocket-handler.d.ts +0 -16
  77. package/dist/cli-modules/websocket-handler.js +0 -53
  78. package/dist/cli-modules/websocket-handler.js.map +0 -1
  79. package/dist/code-map/__mocks__/tree-sitter-typescript.d.ts +0 -12
  80. package/dist/code-map/__mocks__/tree-sitter-typescript.d.ts.map +0 -1
  81. package/dist/code-map/__mocks__/tree-sitter-typescript.js +0 -14
  82. package/dist/code-map/__mocks__/tree-sitter-typescript.js.map +0 -1
  83. package/dist/code-map/__mocks__/wasm-mock.d.ts +0 -2
  84. package/dist/code-map/__mocks__/wasm-mock.d.ts.map +0 -1
  85. package/dist/code-map/__mocks__/wasm-mock.js +0 -3
  86. package/dist/code-map/__mocks__/wasm-mock.js.map +0 -1
  87. package/dist/code-map/__tests__/parse.test.d.ts +0 -2
  88. package/dist/code-map/__tests__/parse.test.d.ts.map +0 -1
  89. package/dist/code-map/__tests__/parse.test.js +0 -231
  90. package/dist/code-map/__tests__/parse.test.js.map +0 -1
  91. package/dist/code-map/__tests__/test-langs/consumer.d.ts +0 -2
  92. package/dist/code-map/__tests__/test-langs/consumer.d.ts.map +0 -1
  93. package/dist/code-map/__tests__/test-langs/consumer.js +0 -6
  94. package/dist/code-map/__tests__/test-langs/consumer.js.map +0 -1
  95. package/dist/code-map/__tests__/test-langs/empty.d.ts +0 -1
  96. package/dist/code-map/__tests__/test-langs/empty.d.ts.map +0 -1
  97. package/dist/code-map/__tests__/test-langs/empty.js +0 -2
  98. package/dist/code-map/__tests__/test-langs/empty.js.map +0 -1
  99. package/dist/code-map/__tests__/test-langs/test.d.ts +0 -12
  100. package/dist/code-map/__tests__/test-langs/test.d.ts.map +0 -1
  101. package/dist/code-map/__tests__/test-langs/test.js +0 -23
  102. package/dist/code-map/__tests__/test-langs/test.js.map +0 -1
  103. package/dist/code-map/__tests__/test-langs/unused.d.ts +0 -2
  104. package/dist/code-map/__tests__/test-langs/unused.d.ts.map +0 -1
  105. package/dist/code-map/__tests__/test-langs/unused.js +0 -7
  106. package/dist/code-map/__tests__/test-langs/unused.js.map +0 -1
  107. package/dist/code-map/__tests__/test-langs/utils1.d.ts +0 -2
  108. package/dist/code-map/__tests__/test-langs/utils1.d.ts.map +0 -1
  109. package/dist/code-map/__tests__/test-langs/utils1.js +0 -7
  110. package/dist/code-map/__tests__/test-langs/utils1.js.map +0 -1
  111. package/dist/code-map/__tests__/test-langs/utils2.d.ts +0 -2
  112. package/dist/code-map/__tests__/test-langs/utils2.d.ts.map +0 -1
  113. package/dist/code-map/__tests__/test-langs/utils2.js +0 -8
  114. package/dist/code-map/__tests__/test-langs/utils2.js.map +0 -1
  115. package/dist/code-map/__tests__/tree-sitter-minimal.test.d.ts +0 -2
  116. package/dist/code-map/__tests__/tree-sitter-minimal.test.d.ts.map +0 -1
  117. package/dist/code-map/__tests__/tree-sitter-minimal.test.js +0 -79
  118. package/dist/code-map/__tests__/tree-sitter-minimal.test.js.map +0 -1
  119. package/dist/code-map/jest.config.d.ts +0 -4
  120. package/dist/code-map/jest.config.d.ts.map +0 -1
  121. package/dist/code-map/jest.config.js +0 -18
  122. package/dist/code-map/jest.config.js.map +0 -1
  123. package/dist/code-map/parse.test.d.ts +0 -2
  124. package/dist/code-map/parse.test.d.ts.map +0 -1
  125. package/dist/code-map/parse.test.js +0 -218
  126. package/dist/code-map/parse.test.js.map +0 -1
  127. package/dist/code-map/scripts/tree-sitter-test.cjs +0 -27
  128. package/dist/code-map/scripts/tree-sitter-test.cjs.map +0 -1
  129. package/dist/code-map/scripts/tree-sitter-test.d.cts +0 -2
  130. package/dist/code-map/scripts/tree-sitter-test.d.cts.map +0 -1
  131. package/dist/code-map/scripts/tree-sitter-test.d.ts +0 -2
  132. package/dist/code-map/scripts/tree-sitter-test.d.ts.map +0 -1
  133. package/dist/code-map/scripts/tree-sitter-test.js +0 -54
  134. package/dist/code-map/scripts/tree-sitter-test.js.map +0 -1
  135. package/dist/code-map/test-parser.d.ts +0 -2
  136. package/dist/code-map/test-parser.d.ts.map +0 -1
  137. package/dist/code-map/test-parser.js +0 -42
  138. package/dist/code-map/test-parser.js.map +0 -1
  139. package/dist/common/bigquery/client.d.ts +0 -15
  140. package/dist/common/bigquery/client.js +0 -265
  141. package/dist/common/bigquery/client.js.map +0 -1
  142. package/dist/common/bigquery/schema.d.ts +0 -55
  143. package/dist/common/bigquery/schema.js +0 -24
  144. package/dist/common/bigquery/schema.js.map +0 -1
  145. package/dist/common/util/file-metadata.d.ts +0 -9
  146. package/dist/common/util/file-metadata.js +0 -24
  147. package/dist/common/util/file-metadata.js.map +0 -1
@@ -4,12 +4,12 @@ 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
7
  type: "patch" | "file";
8
+ path: string;
9
9
  content: string;
10
10
  }, {
11
- path: string;
12
11
  type: "patch" | "file";
12
+ path: string;
13
13
  content: string;
14
14
  }>;
15
15
  export type FileChange = z.infer<typeof FileChangeSchema>;
@@ -18,12 +18,12 @@ 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
21
  type: "patch" | "file";
22
+ path: string;
23
23
  content: string;
24
24
  }, {
25
- path: string;
26
25
  type: "patch" | "file";
26
+ path: string;
27
27
  content: string;
28
28
  }>, "many">;
29
29
  export type FileChanges = z.infer<typeof CHANGES>;
@@ -199,16 +199,16 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
199
199
  type: "ephemeral";
200
200
  }>>;
201
201
  }, "strip", z.ZodTypeAny, {
202
- name: string;
203
202
  type: "tool_use";
203
+ name: string;
204
204
  id: string;
205
205
  input: Record<string, any>;
206
206
  cache_control?: {
207
207
  type: "ephemeral";
208
208
  } | undefined;
209
209
  }, {
210
- name: string;
211
210
  type: "tool_use";
211
+ name: string;
212
212
  id: string;
213
213
  input: Record<string, any>;
214
214
  cache_control?: {
@@ -290,8 +290,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
290
290
  type: "ephemeral";
291
291
  } | undefined;
292
292
  } | {
293
- name: string;
294
293
  type: "tool_use";
294
+ name: string;
295
295
  id: string;
296
296
  input: Record<string, any>;
297
297
  cache_control?: {
@@ -324,8 +324,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
324
324
  type: "ephemeral";
325
325
  } | undefined;
326
326
  } | {
327
- name: string;
328
327
  type: "tool_use";
328
+ name: string;
329
329
  id: string;
330
330
  input: Record<string, any>;
331
331
  cache_control?: {
@@ -390,8 +390,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
390
390
  type: "ephemeral";
391
391
  } | undefined;
392
392
  } | {
393
- name: string;
394
393
  type: "tool_use";
394
+ name: string;
395
395
  id: string;
396
396
  input: Record<string, any>;
397
397
  cache_control?: {
@@ -456,8 +456,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
456
456
  type: "ephemeral";
457
457
  } | undefined;
458
458
  } | {
459
- name: string;
460
459
  type: "tool_use";
460
+ name: string;
461
461
  id: string;
462
462
  input: Record<string, any>;
463
463
  cache_control?: {
@@ -504,7 +504,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
504
504
  type: "prompt";
505
505
  promptId: string;
506
506
  fingerprintId: string;
507
- costMode: "max" | "lite" | "normal" | "experimental";
507
+ costMode: "lite" | "normal" | "max" | "experimental";
508
508
  agentState: {
509
509
  agentContext: string;
510
510
  fileContext: {
@@ -543,8 +543,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
543
543
  type: "ephemeral";
544
544
  } | undefined;
545
545
  } | {
546
- name: string;
547
546
  type: "tool_use";
547
+ name: string;
548
548
  id: string;
549
549
  input: Record<string, any>;
550
550
  cache_control?: {
@@ -623,8 +623,8 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
623
623
  type: "ephemeral";
624
624
  } | undefined;
625
625
  } | {
626
- name: string;
627
626
  type: "tool_use";
627
+ name: string;
628
628
  id: string;
629
629
  input: Record<string, any>;
630
630
  cache_control?: {
@@ -659,7 +659,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
659
659
  }[];
660
660
  prompt?: string | undefined;
661
661
  authToken?: string | undefined;
662
- costMode?: "max" | "lite" | "normal" | "experimental" | undefined;
662
+ costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
663
663
  model?: string | undefined;
664
664
  cwd?: string | undefined;
665
665
  }>, z.ZodObject<{
@@ -792,6 +792,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
792
792
  }>;
793
793
  }, "strip", z.ZodTypeAny, {
794
794
  type: "init";
795
+ fingerprintId: string;
795
796
  fileContext: {
796
797
  currentWorkingDirectory: string;
797
798
  fileTree: import("./util/file").FileTreeNode[];
@@ -820,10 +821,10 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
820
821
  content: string;
821
822
  }[][] | undefined;
822
823
  };
823
- fingerprintId: string;
824
824
  authToken?: string | undefined;
825
825
  }, {
826
826
  type: "init";
827
+ fingerprintId: string;
827
828
  fileContext: {
828
829
  currentWorkingDirectory: string;
829
830
  fileTree: import("./util/file").FileTreeNode[];
@@ -852,7 +853,6 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
852
853
  content: string;
853
854
  }[][] | undefined;
854
855
  };
855
- fingerprintId: string;
856
856
  authToken?: string | undefined;
857
857
  }>, z.ZodObject<{
858
858
  type: z.ZodLiteral<"generate-commit-message">;
@@ -875,7 +875,7 @@ export declare const UsageReponseSchema: z.ZodObject<{
875
875
  type: z.ZodLiteral<"usage-response">;
876
876
  usage: z.ZodNumber;
877
877
  remainingBalance: z.ZodNumber;
878
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
878
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin")[]]>, z.ZodNumber>>;
879
879
  next_quota_reset: z.ZodNullable<z.ZodDate>;
880
880
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
881
881
  }, "strip", z.ZodTypeAny, {
@@ -883,14 +883,14 @@ export declare const UsageReponseSchema: z.ZodObject<{
883
883
  usage: number;
884
884
  remainingBalance: number;
885
885
  next_quota_reset: Date | null;
886
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
886
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
887
887
  autoTopupAdded?: number | undefined;
888
888
  }, {
889
889
  type: "usage-response";
890
890
  usage: number;
891
891
  remainingBalance: number;
892
892
  next_quota_reset: Date | null;
893
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
893
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
894
894
  autoTopupAdded?: number | undefined;
895
895
  }>;
896
896
  export type UsageResponse = z.infer<typeof UsageReponseSchema>;
@@ -900,7 +900,7 @@ export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
900
900
  type: z.ZodLiteral<"usage-response">;
901
901
  usage: z.ZodNumber;
902
902
  remainingBalance: z.ZodNumber;
903
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
903
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin")[]]>, z.ZodNumber>>;
904
904
  next_quota_reset: z.ZodNullable<z.ZodDate>;
905
905
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
906
906
  }, "type">>, "strip", z.ZodTypeAny, {
@@ -908,14 +908,14 @@ export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
908
908
  usage: number;
909
909
  remainingBalance: number;
910
910
  next_quota_reset: Date | null;
911
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
911
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
912
912
  autoTopupAdded?: number | undefined;
913
913
  }, {
914
914
  type: "init-response";
915
915
  usage: number;
916
916
  remainingBalance: number;
917
917
  next_quota_reset: Date | null;
918
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
918
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
919
919
  autoTopupAdded?: number | undefined;
920
920
  }>;
921
921
  export type InitResponse = z.infer<typeof InitResponseSchema>;
@@ -928,12 +928,12 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
928
928
  path: z.ZodString;
929
929
  content: z.ZodString;
930
930
  }, "strip", z.ZodTypeAny, {
931
- path: string;
932
931
  type: "patch" | "file";
932
+ path: string;
933
933
  content: string;
934
934
  }, {
935
- path: string;
936
935
  type: "patch" | "file";
936
+ path: string;
937
937
  content: string;
938
938
  }>, "many">;
939
939
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -941,12 +941,12 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
941
941
  path: z.ZodString;
942
942
  content: z.ZodString;
943
943
  }, "strip", z.ZodTypeAny, {
944
- path: string;
945
944
  type: "patch" | "file";
945
+ path: string;
946
946
  content: string;
947
947
  }, {
948
- path: string;
949
948
  type: "patch" | "file";
949
+ path: string;
950
950
  content: string;
951
951
  }>, "many">;
952
952
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -963,7 +963,7 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
963
963
  }, {
964
964
  usage: z.ZodOptional<z.ZodNumber>;
965
965
  remainingBalance: z.ZodOptional<z.ZodNumber>;
966
- balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>>;
966
+ balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin")[]]>, z.ZodNumber>>>;
967
967
  next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
968
968
  autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
969
969
  }>, "strip", z.ZodTypeAny, {
@@ -971,13 +971,13 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
971
971
  userInputId: string;
972
972
  response: string;
973
973
  changes: {
974
- path: string;
975
974
  type: "patch" | "file";
975
+ path: string;
976
976
  content: string;
977
977
  }[];
978
978
  changesAlreadyApplied: {
979
- path: string;
980
979
  type: "patch" | "file";
980
+ path: string;
981
981
  content: string;
982
982
  }[];
983
983
  addedFileVersions: {
@@ -987,7 +987,7 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
987
987
  resetFileVersions: boolean;
988
988
  usage?: number | undefined;
989
989
  remainingBalance?: number | undefined;
990
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
990
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
991
991
  next_quota_reset?: Date | null | undefined;
992
992
  autoTopupAdded?: number | undefined;
993
993
  }, {
@@ -995,13 +995,13 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
995
995
  userInputId: string;
996
996
  response: string;
997
997
  changes: {
998
- path: string;
999
998
  type: "patch" | "file";
999
+ path: string;
1000
1000
  content: string;
1001
1001
  }[];
1002
1002
  changesAlreadyApplied: {
1003
- path: string;
1004
1003
  type: "patch" | "file";
1004
+ path: string;
1005
1005
  content: string;
1006
1006
  }[];
1007
1007
  addedFileVersions: {
@@ -1011,7 +1011,7 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
1011
1011
  resetFileVersions: boolean;
1012
1012
  usage?: number | undefined;
1013
1013
  remainingBalance?: number | undefined;
1014
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1014
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
1015
1015
  next_quota_reset?: Date | null | undefined;
1016
1016
  autoTopupAdded?: number | undefined;
1017
1017
  }>;
@@ -1183,16 +1183,16 @@ export declare const PromptResponseSchema: z.ZodObject<{
1183
1183
  type: "ephemeral";
1184
1184
  }>>;
1185
1185
  }, "strip", z.ZodTypeAny, {
1186
- name: string;
1187
1186
  type: "tool_use";
1187
+ name: string;
1188
1188
  id: string;
1189
1189
  input: Record<string, any>;
1190
1190
  cache_control?: {
1191
1191
  type: "ephemeral";
1192
1192
  } | undefined;
1193
1193
  }, {
1194
- name: string;
1195
1194
  type: "tool_use";
1195
+ name: string;
1196
1196
  id: string;
1197
1197
  input: Record<string, any>;
1198
1198
  cache_control?: {
@@ -1274,8 +1274,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1274
1274
  type: "ephemeral";
1275
1275
  } | undefined;
1276
1276
  } | {
1277
- name: string;
1278
1277
  type: "tool_use";
1278
+ name: string;
1279
1279
  id: string;
1280
1280
  input: Record<string, any>;
1281
1281
  cache_control?: {
@@ -1308,8 +1308,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1308
1308
  type: "ephemeral";
1309
1309
  } | undefined;
1310
1310
  } | {
1311
- name: string;
1312
1311
  type: "tool_use";
1312
+ name: string;
1313
1313
  id: string;
1314
1314
  input: Record<string, any>;
1315
1315
  cache_control?: {
@@ -1374,8 +1374,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1374
1374
  type: "ephemeral";
1375
1375
  } | undefined;
1376
1376
  } | {
1377
- name: string;
1378
1377
  type: "tool_use";
1378
+ name: string;
1379
1379
  id: string;
1380
1380
  input: Record<string, any>;
1381
1381
  cache_control?: {
@@ -1440,8 +1440,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1440
1440
  type: "ephemeral";
1441
1441
  } | undefined;
1442
1442
  } | {
1443
- name: string;
1444
1443
  type: "tool_use";
1444
+ name: string;
1445
1445
  id: string;
1446
1446
  input: Record<string, any>;
1447
1447
  cache_control?: {
@@ -1475,12 +1475,12 @@ export declare const PromptResponseSchema: z.ZodObject<{
1475
1475
  id: z.ZodString;
1476
1476
  }, "strip", z.ZodTypeAny, {
1477
1477
  name: string;
1478
- parameters: Record<string, string>;
1479
1478
  id: string;
1479
+ parameters: Record<string, string>;
1480
1480
  }, {
1481
1481
  name: string;
1482
- parameters: Record<string, string>;
1483
1482
  id: string;
1483
+ parameters: Record<string, string>;
1484
1484
  }>, "many">;
1485
1485
  toolResults: z.ZodArray<z.ZodObject<{
1486
1486
  name: z.ZodString;
@@ -1536,8 +1536,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1536
1536
  type: "ephemeral";
1537
1537
  } | undefined;
1538
1538
  } | {
1539
- name: string;
1540
1539
  type: "tool_use";
1540
+ name: string;
1541
1541
  id: string;
1542
1542
  input: Record<string, any>;
1543
1543
  cache_control?: {
@@ -1572,8 +1572,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1572
1572
  }[];
1573
1573
  toolCalls: {
1574
1574
  name: string;
1575
- parameters: Record<string, string>;
1576
1575
  id: string;
1576
+ parameters: Record<string, string>;
1577
1577
  }[];
1578
1578
  }, {
1579
1579
  type: "prompt-response";
@@ -1616,8 +1616,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1616
1616
  type: "ephemeral";
1617
1617
  } | undefined;
1618
1618
  } | {
1619
- name: string;
1620
1619
  type: "tool_use";
1620
+ name: string;
1621
1621
  id: string;
1622
1622
  input: Record<string, any>;
1623
1623
  cache_control?: {
@@ -1652,8 +1652,8 @@ export declare const PromptResponseSchema: z.ZodObject<{
1652
1652
  }[];
1653
1653
  toolCalls: {
1654
1654
  name: string;
1655
- parameters: Record<string, string>;
1656
1655
  id: string;
1656
+ parameters: Record<string, string>;
1657
1657
  }[];
1658
1658
  }>;
1659
1659
  export type PromptResponse = z.infer<typeof PromptResponseSchema>;
@@ -1678,12 +1678,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1678
1678
  path: z.ZodString;
1679
1679
  content: z.ZodString;
1680
1680
  }, "strip", z.ZodTypeAny, {
1681
- path: string;
1682
1681
  type: "patch" | "file";
1682
+ path: string;
1683
1683
  content: string;
1684
1684
  }, {
1685
- path: string;
1686
1685
  type: "patch" | "file";
1686
+ path: string;
1687
1687
  content: string;
1688
1688
  }>, "many">;
1689
1689
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -1691,12 +1691,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1691
1691
  path: z.ZodString;
1692
1692
  content: z.ZodString;
1693
1693
  }, "strip", z.ZodTypeAny, {
1694
- path: string;
1695
1694
  type: "patch" | "file";
1695
+ path: string;
1696
1696
  content: string;
1697
1697
  }, {
1698
- path: string;
1699
1698
  type: "patch" | "file";
1699
+ path: string;
1700
1700
  content: string;
1701
1701
  }>, "many">;
1702
1702
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -1713,7 +1713,7 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1713
1713
  }, {
1714
1714
  usage: z.ZodOptional<z.ZodNumber>;
1715
1715
  remainingBalance: z.ZodOptional<z.ZodNumber>;
1716
- balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>>;
1716
+ balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin")[]]>, z.ZodNumber>>>;
1717
1717
  next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1718
1718
  autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1719
1719
  }>, "strip", z.ZodTypeAny, {
@@ -1721,13 +1721,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1721
1721
  userInputId: string;
1722
1722
  response: string;
1723
1723
  changes: {
1724
- path: string;
1725
1724
  type: "patch" | "file";
1725
+ path: string;
1726
1726
  content: string;
1727
1727
  }[];
1728
1728
  changesAlreadyApplied: {
1729
- path: string;
1730
1729
  type: "patch" | "file";
1730
+ path: string;
1731
1731
  content: string;
1732
1732
  }[];
1733
1733
  addedFileVersions: {
@@ -1737,7 +1737,7 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1737
1737
  resetFileVersions: boolean;
1738
1738
  usage?: number | undefined;
1739
1739
  remainingBalance?: number | undefined;
1740
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1740
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
1741
1741
  next_quota_reset?: Date | null | undefined;
1742
1742
  autoTopupAdded?: number | undefined;
1743
1743
  }, {
@@ -1745,13 +1745,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1745
1745
  userInputId: string;
1746
1746
  response: string;
1747
1747
  changes: {
1748
- path: string;
1749
1748
  type: "patch" | "file";
1749
+ path: string;
1750
1750
  content: string;
1751
1751
  }[];
1752
1752
  changesAlreadyApplied: {
1753
- path: string;
1754
1753
  type: "patch" | "file";
1754
+ path: string;
1755
1755
  content: string;
1756
1756
  }[];
1757
1757
  addedFileVersions: {
@@ -1761,7 +1761,7 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1761
1761
  resetFileVersions: boolean;
1762
1762
  usage?: number | undefined;
1763
1763
  remainingBalance?: number | undefined;
1764
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1764
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
1765
1765
  next_quota_reset?: Date | null | undefined;
1766
1766
  autoTopupAdded?: number | undefined;
1767
1767
  }>, z.ZodObject<{
@@ -1918,16 +1918,16 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1918
1918
  type: "ephemeral";
1919
1919
  }>>;
1920
1920
  }, "strip", z.ZodTypeAny, {
1921
- name: string;
1922
1921
  type: "tool_use";
1922
+ name: string;
1923
1923
  id: string;
1924
1924
  input: Record<string, any>;
1925
1925
  cache_control?: {
1926
1926
  type: "ephemeral";
1927
1927
  } | undefined;
1928
1928
  }, {
1929
- name: string;
1930
1929
  type: "tool_use";
1930
+ name: string;
1931
1931
  id: string;
1932
1932
  input: Record<string, any>;
1933
1933
  cache_control?: {
@@ -2009,8 +2009,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2009
2009
  type: "ephemeral";
2010
2010
  } | undefined;
2011
2011
  } | {
2012
- name: string;
2013
2012
  type: "tool_use";
2013
+ name: string;
2014
2014
  id: string;
2015
2015
  input: Record<string, any>;
2016
2016
  cache_control?: {
@@ -2043,8 +2043,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2043
2043
  type: "ephemeral";
2044
2044
  } | undefined;
2045
2045
  } | {
2046
- name: string;
2047
2046
  type: "tool_use";
2047
+ name: string;
2048
2048
  id: string;
2049
2049
  input: Record<string, any>;
2050
2050
  cache_control?: {
@@ -2109,8 +2109,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2109
2109
  type: "ephemeral";
2110
2110
  } | undefined;
2111
2111
  } | {
2112
- name: string;
2113
2112
  type: "tool_use";
2113
+ name: string;
2114
2114
  id: string;
2115
2115
  input: Record<string, any>;
2116
2116
  cache_control?: {
@@ -2175,8 +2175,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2175
2175
  type: "ephemeral";
2176
2176
  } | undefined;
2177
2177
  } | {
2178
- name: string;
2179
2178
  type: "tool_use";
2179
+ name: string;
2180
2180
  id: string;
2181
2181
  input: Record<string, any>;
2182
2182
  cache_control?: {
@@ -2210,12 +2210,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2210
2210
  id: z.ZodString;
2211
2211
  }, "strip", z.ZodTypeAny, {
2212
2212
  name: string;
2213
- parameters: Record<string, string>;
2214
2213
  id: string;
2214
+ parameters: Record<string, string>;
2215
2215
  }, {
2216
2216
  name: string;
2217
- parameters: Record<string, string>;
2218
2217
  id: string;
2218
+ parameters: Record<string, string>;
2219
2219
  }>, "many">;
2220
2220
  toolResults: z.ZodArray<z.ZodObject<{
2221
2221
  name: z.ZodString;
@@ -2271,8 +2271,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2271
2271
  type: "ephemeral";
2272
2272
  } | undefined;
2273
2273
  } | {
2274
- name: string;
2275
2274
  type: "tool_use";
2275
+ name: string;
2276
2276
  id: string;
2277
2277
  input: Record<string, any>;
2278
2278
  cache_control?: {
@@ -2307,8 +2307,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2307
2307
  }[];
2308
2308
  toolCalls: {
2309
2309
  name: string;
2310
- parameters: Record<string, string>;
2311
2310
  id: string;
2311
+ parameters: Record<string, string>;
2312
2312
  }[];
2313
2313
  }, {
2314
2314
  type: "prompt-response";
@@ -2351,8 +2351,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2351
2351
  type: "ephemeral";
2352
2352
  } | undefined;
2353
2353
  } | {
2354
- name: string;
2355
2354
  type: "tool_use";
2355
+ name: string;
2356
2356
  id: string;
2357
2357
  input: Record<string, any>;
2358
2358
  cache_control?: {
@@ -2387,8 +2387,8 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2387
2387
  }[];
2388
2388
  toolCalls: {
2389
2389
  name: string;
2390
- parameters: Record<string, string>;
2391
2390
  id: string;
2391
+ parameters: Record<string, string>;
2392
2392
  }[];
2393
2393
  }>, z.ZodObject<{
2394
2394
  type: z.ZodLiteral<"read-files">;
@@ -2424,12 +2424,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2424
2424
  path: z.ZodString;
2425
2425
  content: z.ZodString;
2426
2426
  }, "strip", z.ZodTypeAny, {
2427
- path: string;
2428
2427
  type: "patch" | "file";
2428
+ path: string;
2429
2429
  content: string;
2430
2430
  }, {
2431
- path: string;
2432
2431
  type: "patch" | "file";
2432
+ path: string;
2433
2433
  content: string;
2434
2434
  }>, "many">;
2435
2435
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -2437,12 +2437,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2437
2437
  path: z.ZodString;
2438
2438
  content: z.ZodString;
2439
2439
  }, "strip", z.ZodTypeAny, {
2440
- path: string;
2441
2440
  type: "patch" | "file";
2441
+ path: string;
2442
2442
  content: string;
2443
2443
  }, {
2444
- path: string;
2445
2444
  type: "patch" | "file";
2445
+ path: string;
2446
2446
  content: string;
2447
2447
  }>, "many">;
2448
2448
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -2466,13 +2466,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2466
2466
  userInputId: string;
2467
2467
  response: string;
2468
2468
  changes: {
2469
- path: string;
2470
2469
  type: "patch" | "file";
2470
+ path: string;
2471
2471
  content: string;
2472
2472
  }[];
2473
2473
  changesAlreadyApplied: {
2474
- path: string;
2475
2474
  type: "patch" | "file";
2475
+ path: string;
2476
2476
  content: string;
2477
2477
  }[];
2478
2478
  addedFileVersions: {
@@ -2490,13 +2490,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2490
2490
  userInputId: string;
2491
2491
  response: string;
2492
2492
  changes: {
2493
- path: string;
2494
2493
  type: "patch" | "file";
2494
+ path: string;
2495
2495
  content: string;
2496
2496
  }[];
2497
2497
  changesAlreadyApplied: {
2498
- path: string;
2499
2498
  type: "patch" | "file";
2499
+ path: string;
2500
2500
  content: string;
2501
2501
  }[];
2502
2502
  addedFileVersions: {
@@ -2534,7 +2534,7 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2534
2534
  type: z.ZodLiteral<"usage-response">;
2535
2535
  usage: z.ZodNumber;
2536
2536
  remainingBalance: z.ZodNumber;
2537
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
2537
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin")[]]>, z.ZodNumber>>;
2538
2538
  next_quota_reset: z.ZodNullable<z.ZodDate>;
2539
2539
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
2540
2540
  }, "type">>, "strip", z.ZodTypeAny, {
@@ -2542,20 +2542,20 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2542
2542
  usage: number;
2543
2543
  remainingBalance: number;
2544
2544
  next_quota_reset: Date | null;
2545
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2545
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
2546
2546
  autoTopupAdded?: number | undefined;
2547
2547
  }, {
2548
2548
  type: "init-response";
2549
2549
  usage: number;
2550
2550
  remainingBalance: number;
2551
2551
  next_quota_reset: Date | null;
2552
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2552
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
2553
2553
  autoTopupAdded?: number | undefined;
2554
2554
  }>, z.ZodObject<{
2555
2555
  type: z.ZodLiteral<"usage-response">;
2556
2556
  usage: z.ZodNumber;
2557
2557
  remainingBalance: z.ZodNumber;
2558
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
2558
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin")[]]>, z.ZodNumber>>;
2559
2559
  next_quota_reset: z.ZodNullable<z.ZodDate>;
2560
2560
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
2561
2561
  }, "strip", z.ZodTypeAny, {
@@ -2563,14 +2563,14 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2563
2563
  usage: number;
2564
2564
  remainingBalance: number;
2565
2565
  next_quota_reset: Date | null;
2566
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2566
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
2567
2567
  autoTopupAdded?: number | undefined;
2568
2568
  }, {
2569
2569
  type: "usage-response";
2570
2570
  usage: number;
2571
2571
  remainingBalance: number;
2572
2572
  next_quota_reset: Date | null;
2573
- balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2573
+ balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin", number>> | undefined;
2574
2574
  autoTopupAdded?: number | undefined;
2575
2575
  }>, z.ZodObject<{
2576
2576
  type: z.ZodLiteral<"message-cost-response">;
@@ -2590,13 +2590,13 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2590
2590
  error: z.ZodOptional<z.ZodString>;
2591
2591
  remainingBalance: z.ZodOptional<z.ZodNumber>;
2592
2592
  }, "strip", z.ZodTypeAny, {
2593
- message: string;
2594
2593
  type: "action-error";
2594
+ message: string;
2595
2595
  remainingBalance?: number | undefined;
2596
2596
  error?: string | undefined;
2597
2597
  }, {
2598
- message: string;
2599
2598
  type: "action-error";
2599
+ message: string;
2600
2600
  remainingBalance?: number | undefined;
2601
2601
  error?: string | undefined;
2602
2602
  }>, z.ZodObject<{