codebuff 1.0.326 → 1.0.328

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 (245) hide show
  1. package/dist/checkpoints/file-manager.js +136 -84
  2. package/dist/checkpoints/file-manager.js.map +1 -1
  3. package/dist/cli-handlers/checkpoint.js +4 -3
  4. package/dist/cli-handlers/checkpoint.js.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client.js +4 -4
  8. package/dist/client.js.map +1 -1
  9. package/dist/code-map/test-langs/test.d.ts +12 -0
  10. package/dist/code-map/test-langs/test.d.ts.map +1 -0
  11. package/dist/code-map/test-langs/test.js +23 -0
  12. package/dist/code-map/test-langs/test.js.map +1 -0
  13. package/dist/common/actions.d.ts +58 -58
  14. package/dist/common/analytics.d.ts +1 -1
  15. package/dist/common/browser-actions.d.ts +277 -277
  16. package/dist/common/db/env.d.mts +4 -0
  17. package/dist/common/db/env.mjs +26 -0
  18. package/dist/common/db/env.mjs.map +1 -0
  19. package/dist/common/env.d.mts +13 -0
  20. package/dist/common/env.mjs +43 -0
  21. package/dist/common/env.mjs.map +1 -0
  22. package/dist/common/src/actions.d.ts +2673 -0
  23. package/dist/common/src/actions.d.ts.map +1 -0
  24. package/dist/common/src/actions.js +167 -0
  25. package/dist/common/src/actions.js.map +1 -0
  26. package/dist/common/src/analytics.d.ts +6 -0
  27. package/dist/common/src/analytics.d.ts.map +1 -0
  28. package/dist/common/src/analytics.js +60 -0
  29. package/dist/common/src/analytics.js.map +1 -0
  30. package/dist/common/src/api-keys/constants.d.ts +9 -0
  31. package/dist/common/src/api-keys/constants.d.ts.map +1 -0
  32. package/dist/common/src/api-keys/constants.js +26 -0
  33. package/dist/common/src/api-keys/constants.js.map +1 -0
  34. package/dist/common/src/api-keys/crypto.d.ts +25 -0
  35. package/dist/common/src/api-keys/crypto.d.ts.map +1 -0
  36. package/dist/common/src/api-keys/crypto.js +186 -0
  37. package/dist/common/src/api-keys/crypto.js.map +1 -0
  38. package/dist/common/src/browser-actions.d.ts +4416 -0
  39. package/dist/common/src/browser-actions.d.ts.map +1 -0
  40. package/dist/common/src/browser-actions.js +343 -0
  41. package/dist/common/src/browser-actions.js.map +1 -0
  42. package/dist/common/src/constants/analytics-events.d.ts +28 -0
  43. package/dist/common/src/constants/analytics-events.d.ts.map +1 -0
  44. package/dist/common/src/constants/analytics-events.js +36 -0
  45. package/dist/common/src/constants/analytics-events.js.map +1 -0
  46. package/dist/common/src/constants/grant-priorities.d.ts +3 -0
  47. package/dist/common/src/constants/grant-priorities.d.ts.map +1 -0
  48. package/dist/common/src/constants/grant-priorities.js +11 -0
  49. package/dist/common/src/constants/grant-priorities.js.map +1 -0
  50. package/dist/common/src/constants/tools.d.ts +20 -0
  51. package/dist/common/src/constants/tools.d.ts.map +1 -0
  52. package/dist/common/src/constants/tools.js +47 -0
  53. package/dist/common/src/constants/tools.js.map +1 -0
  54. package/dist/common/src/constants.d.ts +152 -0
  55. package/dist/common/src/constants.d.ts.map +1 -0
  56. package/dist/common/src/constants.js +222 -0
  57. package/dist/common/src/constants.js.map +1 -0
  58. package/dist/common/src/db/drizzle.config.d.ts +3 -0
  59. package/dist/common/src/db/drizzle.config.d.ts.map +1 -0
  60. package/dist/common/src/db/drizzle.config.js +17 -0
  61. package/dist/common/src/db/drizzle.config.js.map +1 -0
  62. package/dist/common/src/db/index.d.ts +7 -0
  63. package/dist/common/src/db/index.d.ts.map +1 -0
  64. package/dist/common/src/db/index.js +35 -0
  65. package/dist/common/src/db/index.js.map +1 -0
  66. package/dist/common/src/db/schema.d.ts +2289 -0
  67. package/dist/common/src/db/schema.d.ts.map +1 -0
  68. package/dist/common/src/db/schema.js +296 -0
  69. package/dist/common/src/db/schema.js.map +1 -0
  70. package/dist/common/src/db/transaction.d.ts +13 -0
  71. package/dist/common/src/db/transaction.d.ts.map +1 -0
  72. package/dist/common/src/db/transaction.js +36 -0
  73. package/dist/common/src/db/transaction.js.map +1 -0
  74. package/dist/common/src/json-config/__tests__/constants.test.d.ts +2 -0
  75. package/dist/common/src/json-config/__tests__/constants.test.d.ts.map +1 -0
  76. package/dist/common/src/json-config/__tests__/constants.test.js +273 -0
  77. package/dist/common/src/json-config/__tests__/constants.test.js.map +1 -0
  78. package/dist/common/src/json-config/__tests__/stringify-schema.test.d.ts +2 -0
  79. package/dist/common/src/json-config/__tests__/stringify-schema.test.d.ts.map +1 -0
  80. package/dist/common/src/json-config/__tests__/stringify-schema.test.js +66 -0
  81. package/dist/common/src/json-config/__tests__/stringify-schema.test.js.map +1 -0
  82. package/dist/common/src/json-config/constants.d.ts +138 -0
  83. package/dist/common/src/json-config/constants.d.ts.map +1 -0
  84. package/dist/common/src/json-config/constants.js +78 -0
  85. package/dist/common/src/json-config/constants.js.map +1 -0
  86. package/dist/common/src/json-config/stringify-schema.d.ts +10 -0
  87. package/dist/common/src/json-config/stringify-schema.d.ts.map +1 -0
  88. package/dist/common/src/json-config/stringify-schema.js +131 -0
  89. package/dist/common/src/json-config/stringify-schema.js.map +1 -0
  90. package/dist/common/src/project-file-tree.d.ts +12 -0
  91. package/dist/common/src/project-file-tree.d.ts.map +1 -0
  92. package/dist/common/src/project-file-tree.js +212 -0
  93. package/dist/common/src/project-file-tree.js.map +1 -0
  94. package/dist/common/src/types/agent-state.d.ts +227 -0
  95. package/dist/common/src/types/agent-state.d.ts.map +1 -0
  96. package/dist/common/src/types/agent-state.js +34 -0
  97. package/dist/common/src/types/agent-state.js.map +1 -0
  98. package/dist/common/src/types/grant.d.ts +3 -0
  99. package/dist/common/src/types/grant.d.ts.map +1 -0
  100. package/dist/common/src/types/grant.js +11 -0
  101. package/dist/common/src/types/grant.js.map +1 -0
  102. package/dist/common/src/types/message.d.ts +320 -0
  103. package/dist/common/src/types/message.d.ts.map +1 -0
  104. package/dist/common/src/types/message.js +60 -0
  105. package/dist/common/src/types/message.js.map +1 -0
  106. package/dist/common/src/types/organization.d.ts +106 -0
  107. package/dist/common/src/types/organization.d.ts.map +1 -0
  108. package/dist/common/src/types/organization.js +3 -0
  109. package/dist/common/src/types/organization.js.map +1 -0
  110. package/dist/common/src/types/referral.d.ts +3 -0
  111. package/dist/common/src/types/referral.d.ts.map +1 -0
  112. package/dist/common/src/types/referral.js +5 -0
  113. package/dist/common/src/types/referral.js.map +1 -0
  114. package/dist/common/src/types/tools.d.ts +6 -0
  115. package/dist/common/src/types/tools.d.ts.map +1 -0
  116. package/dist/common/src/types/tools.js +3 -0
  117. package/dist/common/src/types/tools.js.map +1 -0
  118. package/dist/common/src/types/usage.d.ts +41 -0
  119. package/dist/common/src/types/usage.d.ts.map +1 -0
  120. package/dist/common/src/types/usage.js +16 -0
  121. package/dist/common/src/types/usage.js.map +1 -0
  122. package/dist/common/src/util/__tests__/messages.test.d.ts +2 -0
  123. package/dist/common/src/util/__tests__/messages.test.d.ts.map +1 -0
  124. package/dist/common/src/util/__tests__/messages.test.js +70 -0
  125. package/dist/common/src/util/__tests__/messages.test.js.map +1 -0
  126. package/dist/common/src/util/__tests__/saxy.test.d.ts +2 -0
  127. package/dist/common/src/util/__tests__/saxy.test.d.ts.map +1 -0
  128. package/dist/common/src/util/__tests__/saxy.test.js +906 -0
  129. package/dist/common/src/util/__tests__/saxy.test.js.map +1 -0
  130. package/dist/common/src/util/__tests__/string.test.d.ts +2 -0
  131. package/dist/common/src/util/__tests__/string.test.d.ts.map +1 -0
  132. package/dist/common/src/util/__tests__/string.test.js +82 -0
  133. package/dist/common/src/util/__tests__/string.test.js.map +1 -0
  134. package/dist/common/src/util/array.d.ts +7 -0
  135. package/dist/common/src/util/array.d.ts.map +1 -0
  136. package/dist/common/src/util/array.js +32 -0
  137. package/dist/common/src/util/array.js.map +1 -0
  138. package/dist/common/src/util/changes.d.ts +9 -0
  139. package/dist/common/src/util/changes.d.ts.map +1 -0
  140. package/dist/common/src/util/changes.js +87 -0
  141. package/dist/common/src/util/changes.js.map +1 -0
  142. package/dist/common/src/util/credentials.d.ts +26 -0
  143. package/dist/common/src/util/credentials.d.ts.map +1 -0
  144. package/dist/common/src/util/credentials.js +24 -0
  145. package/dist/common/src/util/credentials.js.map +1 -0
  146. package/dist/common/src/util/currency.d.ts +15 -0
  147. package/dist/common/src/util/currency.d.ts.map +1 -0
  148. package/dist/common/src/util/currency.js +23 -0
  149. package/dist/common/src/util/currency.js.map +1 -0
  150. package/dist/common/src/util/dates.d.ts +11 -0
  151. package/dist/common/src/util/dates.d.ts.map +1 -0
  152. package/dist/common/src/util/dates.js +22 -0
  153. package/dist/common/src/util/dates.js.map +1 -0
  154. package/dist/common/src/util/file.d.ts +163 -0
  155. package/dist/common/src/util/file.d.ts.map +1 -0
  156. package/dist/common/src/util/file.js +192 -0
  157. package/dist/common/src/util/file.js.map +1 -0
  158. package/dist/common/src/util/git.d.ts +7 -0
  159. package/dist/common/src/util/git.d.ts.map +1 -0
  160. package/dist/common/src/util/git.js +81 -0
  161. package/dist/common/src/util/git.js.map +1 -0
  162. package/dist/common/src/util/logger.d.ts +9 -0
  163. package/dist/common/src/util/logger.d.ts.map +1 -0
  164. package/dist/common/src/util/logger.js +52 -0
  165. package/dist/common/src/util/logger.js.map +1 -0
  166. package/dist/common/src/util/lru-cache.d.ts +31 -0
  167. package/dist/common/src/util/lru-cache.d.ts.map +1 -0
  168. package/dist/common/src/util/lru-cache.js +68 -0
  169. package/dist/common/src/util/lru-cache.js.map +1 -0
  170. package/dist/common/src/util/messages.d.ts +12 -0
  171. package/dist/common/src/util/messages.d.ts.map +1 -0
  172. package/dist/common/src/util/messages.js +81 -0
  173. package/dist/common/src/util/messages.js.map +1 -0
  174. package/dist/common/src/util/min-heap.d.ts +16 -0
  175. package/dist/common/src/util/min-heap.d.ts.map +1 -0
  176. package/dist/common/src/util/min-heap.js +73 -0
  177. package/dist/common/src/util/min-heap.js.map +1 -0
  178. package/dist/common/src/util/object.d.ts +19 -0
  179. package/dist/common/src/util/object.d.ts.map +1 -0
  180. package/dist/common/src/util/object.js +91 -0
  181. package/dist/common/src/util/object.js.map +1 -0
  182. package/dist/common/src/util/patch.d.ts +2 -0
  183. package/dist/common/src/util/patch.d.ts.map +1 -0
  184. package/dist/common/src/util/patch.js +215 -0
  185. package/dist/common/src/util/patch.js.map +1 -0
  186. package/dist/common/src/util/promise.d.ts +17 -0
  187. package/dist/common/src/util/promise.d.ts.map +1 -0
  188. package/dist/common/src/util/promise.js +51 -0
  189. package/dist/common/src/util/promise.js.map +1 -0
  190. package/dist/common/src/util/random.d.ts +2 -0
  191. package/dist/common/src/util/random.d.ts.map +1 -0
  192. package/dist/common/src/util/random.js +17 -0
  193. package/dist/common/src/util/random.js.map +1 -0
  194. package/dist/common/src/util/referral.d.ts +2 -0
  195. package/dist/common/src/util/referral.d.ts.map +1 -0
  196. package/dist/common/src/util/referral.js +6 -0
  197. package/dist/common/src/util/referral.js.map +1 -0
  198. package/dist/common/src/util/saxy.d.ts +179 -0
  199. package/dist/common/src/util/saxy.d.ts.map +1 -0
  200. package/dist/common/src/util/saxy.js +548 -0
  201. package/dist/common/src/util/saxy.js.map +1 -0
  202. package/dist/common/src/util/string.d.ts +80 -0
  203. package/dist/common/src/util/string.d.ts.map +1 -0
  204. package/dist/common/src/util/string.js +264 -0
  205. package/dist/common/src/util/string.js.map +1 -0
  206. package/dist/common/src/util/stripe.d.ts +4 -0
  207. package/dist/common/src/util/stripe.d.ts.map +1 -0
  208. package/dist/common/src/util/stripe.js +22 -0
  209. package/dist/common/src/util/stripe.js.map +1 -0
  210. package/dist/common/src/util/sync-failure.d.ts +2 -0
  211. package/dist/common/src/util/sync-failure.d.ts.map +1 -0
  212. package/dist/common/src/util/sync-failure.js +57 -0
  213. package/dist/common/src/util/sync-failure.js.map +1 -0
  214. package/dist/common/src/websockets/websocket-client.d.ts +43 -0
  215. package/dist/common/src/websockets/websocket-client.d.ts.map +1 -0
  216. package/dist/common/src/websockets/websocket-client.js +216 -0
  217. package/dist/common/src/websockets/websocket-client.js.map +1 -0
  218. package/dist/common/src/websockets/websocket-schema.d.ts +5159 -0
  219. package/dist/common/src/websockets/websocket-schema.d.ts.map +1 -0
  220. package/dist/common/src/websockets/websocket-schema.js +55 -0
  221. package/dist/common/src/websockets/websocket-schema.js.map +1 -0
  222. package/dist/common/tsconfig.tsbuildinfo +1 -0
  223. package/dist/common/types/message.d.ts +16 -16
  224. package/dist/common/util/string.d.ts +4 -4
  225. package/dist/common/util/string.d.ts.map +1 -1
  226. package/dist/common/util/string.js +18 -7
  227. package/dist/common/util/string.js.map +1 -1
  228. package/dist/common/websockets/websocket-schema.d.ts +134 -134
  229. package/dist/index.js +6 -6
  230. package/dist/project-files.js +6 -1
  231. package/dist/project-files.js.map +1 -1
  232. package/dist/terminal/base.d.ts +1 -0
  233. package/dist/terminal/base.js +43 -48
  234. package/dist/terminal/base.js.map +1 -1
  235. package/dist/tool-handlers.js +1 -1
  236. package/dist/tool-handlers.js.map +1 -1
  237. package/dist/utils/spinner.d.ts +2 -2
  238. package/dist/utils/spinner.js +4 -13
  239. package/dist/utils/spinner.js.map +1 -1
  240. package/dist/utils/tool-renderers.d.ts +5 -5
  241. package/dist/utils/tool-renderers.js +6 -3
  242. package/dist/utils/tool-renderers.js.map +1 -1
  243. package/dist/utils/xml-stream-parser.js +20 -5
  244. package/dist/utils/xml-stream-parser.js.map +1 -1
  245. package/package.json +1 -1
@@ -6,12 +6,12 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
6
6
  clientSessionId: z.ZodString;
7
7
  }, "strip", z.ZodTypeAny, {
8
8
  type: "identify";
9
- clientSessionId: string;
10
9
  txid: number;
10
+ clientSessionId: string;
11
11
  }, {
12
12
  type: "identify";
13
- clientSessionId: string;
14
13
  txid: number;
14
+ clientSessionId: string;
15
15
  }>;
16
16
  readonly subscribe: z.ZodObject<{
17
17
  type: z.ZodLiteral<"subscribe">;
@@ -821,6 +821,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
821
821
  repoUrl: z.ZodOptional<z.ZodString>;
822
822
  }, "strip", z.ZodTypeAny, {
823
823
  type: "init";
824
+ fingerprintId: string;
824
825
  fileContext: {
825
826
  currentWorkingDirectory: string;
826
827
  fileTree: import("../util/file").FileTreeNode[];
@@ -849,11 +850,11 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
849
850
  content: string;
850
851
  }[][] | undefined;
851
852
  };
852
- fingerprintId: string;
853
853
  authToken?: string | undefined;
854
854
  repoUrl?: string | undefined;
855
855
  }, {
856
856
  type: "init";
857
+ fingerprintId: string;
857
858
  fileContext: {
858
859
  currentWorkingDirectory: string;
859
860
  fileTree: import("../util/file").FileTreeNode[];
@@ -882,7 +883,6 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
882
883
  content: string;
883
884
  }[][] | undefined;
884
885
  };
885
- fingerprintId: string;
886
886
  authToken?: string | undefined;
887
887
  repoUrl?: string | undefined;
888
888
  }>, z.ZodObject<{
@@ -902,7 +902,6 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
902
902
  authToken?: string | undefined;
903
903
  }>]>;
904
904
  }, "strip", z.ZodTypeAny, {
905
- type: "action";
906
905
  data: {
907
906
  type: "prompt";
908
907
  promptId: string;
@@ -1011,6 +1010,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1011
1010
  requestId?: string | undefined;
1012
1011
  } | {
1013
1012
  type: "init";
1013
+ fingerprintId: string;
1014
1014
  fileContext: {
1015
1015
  currentWorkingDirectory: string;
1016
1016
  fileTree: import("../util/file").FileTreeNode[];
@@ -1039,7 +1039,6 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1039
1039
  content: string;
1040
1040
  }[][] | undefined;
1041
1041
  };
1042
- fingerprintId: string;
1043
1042
  authToken?: string | undefined;
1044
1043
  repoUrl?: string | undefined;
1045
1044
  } | {
@@ -1048,9 +1047,9 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1048
1047
  stagedChanges: string;
1049
1048
  authToken?: string | undefined;
1050
1049
  };
1050
+ type: "action";
1051
1051
  txid: number;
1052
1052
  }, {
1053
- type: "action";
1054
1053
  data: {
1055
1054
  type: "prompt";
1056
1055
  promptId: string;
@@ -1159,6 +1158,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1159
1158
  requestId?: string | undefined;
1160
1159
  } | {
1161
1160
  type: "init";
1161
+ fingerprintId: string;
1162
1162
  fileContext: {
1163
1163
  currentWorkingDirectory: string;
1164
1164
  fileTree: import("../util/file").FileTreeNode[];
@@ -1187,7 +1187,6 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1187
1187
  content: string;
1188
1188
  }[][] | undefined;
1189
1189
  };
1190
- fingerprintId: string;
1191
1190
  authToken?: string | undefined;
1192
1191
  repoUrl?: string | undefined;
1193
1192
  } | {
@@ -1196,6 +1195,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1196
1195
  stagedChanges: string;
1197
1196
  authToken?: string | undefined;
1198
1197
  };
1198
+ type: "action";
1199
1199
  txid: number;
1200
1200
  }>;
1201
1201
  };
@@ -1205,12 +1205,12 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1205
1205
  clientSessionId: z.ZodString;
1206
1206
  }, "strip", z.ZodTypeAny, {
1207
1207
  type: "identify";
1208
- clientSessionId: string;
1209
1208
  txid: number;
1209
+ clientSessionId: string;
1210
1210
  }, {
1211
1211
  type: "identify";
1212
- clientSessionId: string;
1213
1212
  txid: number;
1213
+ clientSessionId: string;
1214
1214
  }>, z.ZodObject<{
1215
1215
  type: z.ZodLiteral<"subscribe">;
1216
1216
  txid: z.ZodNumber;
@@ -2016,6 +2016,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2016
2016
  repoUrl: z.ZodOptional<z.ZodString>;
2017
2017
  }, "strip", z.ZodTypeAny, {
2018
2018
  type: "init";
2019
+ fingerprintId: string;
2019
2020
  fileContext: {
2020
2021
  currentWorkingDirectory: string;
2021
2022
  fileTree: import("../util/file").FileTreeNode[];
@@ -2044,11 +2045,11 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2044
2045
  content: string;
2045
2046
  }[][] | undefined;
2046
2047
  };
2047
- fingerprintId: string;
2048
2048
  authToken?: string | undefined;
2049
2049
  repoUrl?: string | undefined;
2050
2050
  }, {
2051
2051
  type: "init";
2052
+ fingerprintId: string;
2052
2053
  fileContext: {
2053
2054
  currentWorkingDirectory: string;
2054
2055
  fileTree: import("../util/file").FileTreeNode[];
@@ -2077,7 +2078,6 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2077
2078
  content: string;
2078
2079
  }[][] | undefined;
2079
2080
  };
2080
- fingerprintId: string;
2081
2081
  authToken?: string | undefined;
2082
2082
  repoUrl?: string | undefined;
2083
2083
  }>, z.ZodObject<{
@@ -2097,7 +2097,6 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2097
2097
  authToken?: string | undefined;
2098
2098
  }>]>;
2099
2099
  }, "strip", z.ZodTypeAny, {
2100
- type: "action";
2101
2100
  data: {
2102
2101
  type: "prompt";
2103
2102
  promptId: string;
@@ -2206,6 +2205,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2206
2205
  requestId?: string | undefined;
2207
2206
  } | {
2208
2207
  type: "init";
2208
+ fingerprintId: string;
2209
2209
  fileContext: {
2210
2210
  currentWorkingDirectory: string;
2211
2211
  fileTree: import("../util/file").FileTreeNode[];
@@ -2234,7 +2234,6 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2234
2234
  content: string;
2235
2235
  }[][] | undefined;
2236
2236
  };
2237
- fingerprintId: string;
2238
2237
  authToken?: string | undefined;
2239
2238
  repoUrl?: string | undefined;
2240
2239
  } | {
@@ -2243,9 +2242,9 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2243
2242
  stagedChanges: string;
2244
2243
  authToken?: string | undefined;
2245
2244
  };
2245
+ type: "action";
2246
2246
  txid: number;
2247
2247
  }, {
2248
- type: "action";
2249
2248
  data: {
2250
2249
  type: "prompt";
2251
2250
  promptId: string;
@@ -2354,6 +2353,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2354
2353
  requestId?: string | undefined;
2355
2354
  } | {
2356
2355
  type: "init";
2356
+ fingerprintId: string;
2357
2357
  fileContext: {
2358
2358
  currentWorkingDirectory: string;
2359
2359
  fileTree: import("../util/file").FileTreeNode[];
@@ -2382,7 +2382,6 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2382
2382
  content: string;
2383
2383
  }[][] | undefined;
2384
2384
  };
2385
- fingerprintId: string;
2386
2385
  authToken?: string | undefined;
2387
2386
  repoUrl?: string | undefined;
2388
2387
  } | {
@@ -2391,6 +2390,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2391
2390
  stagedChanges: string;
2392
2391
  authToken?: string | undefined;
2393
2392
  };
2393
+ type: "action";
2394
2394
  txid: number;
2395
2395
  }>]>;
2396
2396
  export type ClientMessageType = keyof typeof CLIENT_MESSAGE_SCHEMAS;
@@ -2435,12 +2435,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2435
2435
  path: z.ZodString;
2436
2436
  content: z.ZodString;
2437
2437
  }, "strip", z.ZodTypeAny, {
2438
+ type: "patch" | "file";
2438
2439
  path: string;
2439
- type: "file" | "patch";
2440
2440
  content: string;
2441
2441
  }, {
2442
+ type: "patch" | "file";
2442
2443
  path: string;
2443
- type: "file" | "patch";
2444
2444
  content: string;
2445
2445
  }>, "many">;
2446
2446
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -2448,12 +2448,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2448
2448
  path: z.ZodString;
2449
2449
  content: z.ZodString;
2450
2450
  }, "strip", z.ZodTypeAny, {
2451
+ type: "patch" | "file";
2451
2452
  path: string;
2452
- type: "file" | "patch";
2453
2453
  content: string;
2454
2454
  }, {
2455
+ type: "patch" | "file";
2455
2456
  path: string;
2456
- type: "file" | "patch";
2457
2457
  content: string;
2458
2458
  }>, "many">;
2459
2459
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -2468,23 +2468,23 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2468
2468
  }>, "many">;
2469
2469
  resetFileVersions: z.ZodBoolean;
2470
2470
  }, {
2471
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2471
2472
  usage: z.ZodOptional<z.ZodNumber>;
2472
2473
  remainingBalance: z.ZodOptional<z.ZodNumber>;
2473
2474
  balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>>;
2474
- next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2475
2475
  autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
2476
2476
  }>, "strip", z.ZodTypeAny, {
2477
2477
  type: "response-complete";
2478
- userInputId: string;
2479
2478
  response: string;
2479
+ userInputId: string;
2480
2480
  changes: {
2481
+ type: "patch" | "file";
2481
2482
  path: string;
2482
- type: "file" | "patch";
2483
2483
  content: string;
2484
2484
  }[];
2485
2485
  changesAlreadyApplied: {
2486
+ type: "patch" | "file";
2486
2487
  path: string;
2487
- type: "file" | "patch";
2488
2488
  content: string;
2489
2489
  }[];
2490
2490
  addedFileVersions: {
@@ -2492,23 +2492,23 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2492
2492
  content: string;
2493
2493
  }[];
2494
2494
  resetFileVersions: boolean;
2495
+ next_quota_reset?: Date | null | undefined;
2495
2496
  usage?: number | undefined;
2496
2497
  remainingBalance?: number | undefined;
2497
2498
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2498
- next_quota_reset?: Date | null | undefined;
2499
2499
  autoTopupAdded?: number | undefined;
2500
2500
  }, {
2501
2501
  type: "response-complete";
2502
- userInputId: string;
2503
2502
  response: string;
2503
+ userInputId: string;
2504
2504
  changes: {
2505
+ type: "patch" | "file";
2505
2506
  path: string;
2506
- type: "file" | "patch";
2507
2507
  content: string;
2508
2508
  }[];
2509
2509
  changesAlreadyApplied: {
2510
+ type: "patch" | "file";
2510
2511
  path: string;
2511
- type: "file" | "patch";
2512
2512
  content: string;
2513
2513
  }[];
2514
2514
  addedFileVersions: {
@@ -2516,10 +2516,10 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2516
2516
  content: string;
2517
2517
  }[];
2518
2518
  resetFileVersions: boolean;
2519
+ next_quota_reset?: Date | null | undefined;
2519
2520
  usage?: number | undefined;
2520
2521
  remainingBalance?: number | undefined;
2521
2522
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2522
- next_quota_reset?: Date | null | undefined;
2523
2523
  autoTopupAdded?: number | undefined;
2524
2524
  }>, z.ZodObject<{
2525
2525
  type: z.ZodLiteral<"prompt-response">;
@@ -3197,12 +3197,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3197
3197
  path: z.ZodString;
3198
3198
  content: z.ZodString;
3199
3199
  }, "strip", z.ZodTypeAny, {
3200
+ type: "patch" | "file";
3200
3201
  path: string;
3201
- type: "file" | "patch";
3202
3202
  content: string;
3203
3203
  }, {
3204
+ type: "patch" | "file";
3204
3205
  path: string;
3205
- type: "file" | "patch";
3206
3206
  content: string;
3207
3207
  }>, "many">;
3208
3208
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -3210,12 +3210,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3210
3210
  path: z.ZodString;
3211
3211
  content: z.ZodString;
3212
3212
  }, "strip", z.ZodTypeAny, {
3213
+ type: "patch" | "file";
3213
3214
  path: string;
3214
- type: "file" | "patch";
3215
3215
  content: string;
3216
3216
  }, {
3217
+ type: "patch" | "file";
3217
3218
  path: string;
3218
- type: "file" | "patch";
3219
3219
  content: string;
3220
3220
  }>, "many">;
3221
3221
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -3230,22 +3230,22 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3230
3230
  }>, "many">;
3231
3231
  resetFileVersions: z.ZodBoolean;
3232
3232
  }, "strip", z.ZodTypeAny, {
3233
- type: "tool-call";
3234
3233
  data: {
3235
3234
  name: string;
3236
3235
  id: string;
3237
3236
  input: Record<string, any>;
3238
3237
  };
3239
- userInputId: string;
3238
+ type: "tool-call";
3240
3239
  response: string;
3240
+ userInputId: string;
3241
3241
  changes: {
3242
+ type: "patch" | "file";
3242
3243
  path: string;
3243
- type: "file" | "patch";
3244
3244
  content: string;
3245
3245
  }[];
3246
3246
  changesAlreadyApplied: {
3247
+ type: "patch" | "file";
3247
3248
  path: string;
3248
- type: "file" | "patch";
3249
3249
  content: string;
3250
3250
  }[];
3251
3251
  addedFileVersions: {
@@ -3254,22 +3254,22 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3254
3254
  }[];
3255
3255
  resetFileVersions: boolean;
3256
3256
  }, {
3257
- type: "tool-call";
3258
3257
  data: {
3259
3258
  name: string;
3260
3259
  id: string;
3261
3260
  input: Record<string, any>;
3262
3261
  };
3263
- userInputId: string;
3262
+ type: "tool-call";
3264
3263
  response: string;
3264
+ userInputId: string;
3265
3265
  changes: {
3266
+ type: "patch" | "file";
3266
3267
  path: string;
3267
- type: "file" | "patch";
3268
3268
  content: string;
3269
3269
  }[];
3270
3270
  changesAlreadyApplied: {
3271
+ type: "patch" | "file";
3271
3272
  path: string;
3272
- type: "file" | "patch";
3273
3273
  content: string;
3274
3274
  }[];
3275
3275
  addedFileVersions: {
@@ -3311,17 +3311,17 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3311
3311
  next_quota_reset: z.ZodNullable<z.ZodDate>;
3312
3312
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
3313
3313
  }, "type">>, "strip", z.ZodTypeAny, {
3314
+ next_quota_reset: Date | null;
3314
3315
  type: "init-response";
3315
3316
  usage: number;
3316
3317
  remainingBalance: number;
3317
- next_quota_reset: Date | null;
3318
3318
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3319
3319
  autoTopupAdded?: number | undefined;
3320
3320
  }, {
3321
+ next_quota_reset: Date | null;
3321
3322
  type: "init-response";
3322
3323
  usage: number;
3323
3324
  remainingBalance: number;
3324
- next_quota_reset: Date | null;
3325
3325
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3326
3326
  autoTopupAdded?: number | undefined;
3327
3327
  }>, z.ZodObject<{
@@ -3332,17 +3332,17 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3332
3332
  next_quota_reset: z.ZodNullable<z.ZodDate>;
3333
3333
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
3334
3334
  }, "strip", z.ZodTypeAny, {
3335
+ next_quota_reset: Date | null;
3335
3336
  type: "usage-response";
3336
3337
  usage: number;
3337
3338
  remainingBalance: number;
3338
- next_quota_reset: Date | null;
3339
3339
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3340
3340
  autoTopupAdded?: number | undefined;
3341
3341
  }, {
3342
+ next_quota_reset: Date | null;
3342
3343
  type: "usage-response";
3343
3344
  usage: number;
3344
3345
  remainingBalance: number;
3345
- next_quota_reset: Date | null;
3346
3346
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3347
3347
  autoTopupAdded?: number | undefined;
3348
3348
  }>, z.ZodObject<{
@@ -3351,25 +3351,25 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3351
3351
  credits: z.ZodNumber;
3352
3352
  }, "strip", z.ZodTypeAny, {
3353
3353
  type: "message-cost-response";
3354
- promptId: string;
3355
3354
  credits: number;
3355
+ promptId: string;
3356
3356
  }, {
3357
3357
  type: "message-cost-response";
3358
- promptId: string;
3359
3358
  credits: number;
3359
+ promptId: string;
3360
3360
  }>, z.ZodObject<{
3361
3361
  type: z.ZodLiteral<"action-error">;
3362
3362
  message: z.ZodString;
3363
3363
  error: z.ZodOptional<z.ZodString>;
3364
3364
  remainingBalance: z.ZodOptional<z.ZodNumber>;
3365
3365
  }, "strip", z.ZodTypeAny, {
3366
- message: string;
3367
3366
  type: "action-error";
3367
+ message: string;
3368
3368
  remainingBalance?: number | undefined;
3369
3369
  error?: string | undefined;
3370
3370
  }, {
3371
- message: string;
3372
3371
  type: "action-error";
3372
+ message: string;
3373
3373
  remainingBalance?: number | undefined;
3374
3374
  error?: string | undefined;
3375
3375
  }>, z.ZodObject<{
@@ -3389,33 +3389,32 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3389
3389
  type: "request-reconnect";
3390
3390
  }>]>;
3391
3391
  }, "strip", z.ZodTypeAny, {
3392
- type: "action";
3393
3392
  data: {
3393
+ next_quota_reset: Date | null;
3394
3394
  type: "usage-response";
3395
3395
  usage: number;
3396
3396
  remainingBalance: number;
3397
- next_quota_reset: Date | null;
3398
3397
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3399
3398
  autoTopupAdded?: number | undefined;
3400
3399
  } | {
3400
+ next_quota_reset: Date | null;
3401
3401
  type: "init-response";
3402
3402
  usage: number;
3403
3403
  remainingBalance: number;
3404
- next_quota_reset: Date | null;
3405
3404
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3406
3405
  autoTopupAdded?: number | undefined;
3407
3406
  } | {
3408
3407
  type: "response-complete";
3409
- userInputId: string;
3410
3408
  response: string;
3409
+ userInputId: string;
3411
3410
  changes: {
3411
+ type: "patch" | "file";
3412
3412
  path: string;
3413
- type: "file" | "patch";
3414
3413
  content: string;
3415
3414
  }[];
3416
3415
  changesAlreadyApplied: {
3416
+ type: "patch" | "file";
3417
3417
  path: string;
3418
- type: "file" | "patch";
3419
3418
  content: string;
3420
3419
  }[];
3421
3420
  addedFileVersions: {
@@ -3423,15 +3422,15 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3423
3422
  content: string;
3424
3423
  }[];
3425
3424
  resetFileVersions: boolean;
3425
+ next_quota_reset?: Date | null | undefined;
3426
3426
  usage?: number | undefined;
3427
3427
  remainingBalance?: number | undefined;
3428
3428
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3429
- next_quota_reset?: Date | null | undefined;
3430
3429
  autoTopupAdded?: number | undefined;
3431
3430
  } | {
3432
3431
  type: "message-cost-response";
3433
- promptId: string;
3434
3432
  credits: number;
3433
+ promptId: string;
3435
3434
  } | {
3436
3435
  type: "prompt-response";
3437
3436
  promptId: string;
@@ -3539,22 +3538,22 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3539
3538
  requestId: string;
3540
3539
  filePaths: string[];
3541
3540
  } | {
3542
- type: "tool-call";
3543
3541
  data: {
3544
3542
  name: string;
3545
3543
  id: string;
3546
3544
  input: Record<string, any>;
3547
3545
  };
3548
- userInputId: string;
3546
+ type: "tool-call";
3549
3547
  response: string;
3548
+ userInputId: string;
3550
3549
  changes: {
3550
+ type: "patch" | "file";
3551
3551
  path: string;
3552
- type: "file" | "patch";
3553
3552
  content: string;
3554
3553
  }[];
3555
3554
  changesAlreadyApplied: {
3555
+ type: "patch" | "file";
3556
3556
  path: string;
3557
- type: "file" | "patch";
3558
3557
  content: string;
3559
3558
  }[];
3560
3559
  addedFileVersions: {
@@ -3571,8 +3570,8 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3571
3570
  isUpToDate: boolean;
3572
3571
  latestVersion: string;
3573
3572
  } | {
3574
- message: string;
3575
3573
  type: "action-error";
3574
+ message: string;
3576
3575
  remainingBalance?: number | undefined;
3577
3576
  error?: string | undefined;
3578
3577
  } | {
@@ -3581,34 +3580,34 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3581
3580
  } | {
3582
3581
  type: "request-reconnect";
3583
3582
  };
3584
- }, {
3585
3583
  type: "action";
3584
+ }, {
3586
3585
  data: {
3586
+ next_quota_reset: Date | null;
3587
3587
  type: "usage-response";
3588
3588
  usage: number;
3589
3589
  remainingBalance: number;
3590
- next_quota_reset: Date | null;
3591
3590
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3592
3591
  autoTopupAdded?: number | undefined;
3593
3592
  } | {
3593
+ next_quota_reset: Date | null;
3594
3594
  type: "init-response";
3595
3595
  usage: number;
3596
3596
  remainingBalance: number;
3597
- next_quota_reset: Date | null;
3598
3597
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3599
3598
  autoTopupAdded?: number | undefined;
3600
3599
  } | {
3601
3600
  type: "response-complete";
3602
- userInputId: string;
3603
3601
  response: string;
3602
+ userInputId: string;
3604
3603
  changes: {
3604
+ type: "patch" | "file";
3605
3605
  path: string;
3606
- type: "file" | "patch";
3607
3606
  content: string;
3608
3607
  }[];
3609
3608
  changesAlreadyApplied: {
3609
+ type: "patch" | "file";
3610
3610
  path: string;
3611
- type: "file" | "patch";
3612
3611
  content: string;
3613
3612
  }[];
3614
3613
  addedFileVersions: {
@@ -3616,15 +3615,15 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3616
3615
  content: string;
3617
3616
  }[];
3618
3617
  resetFileVersions: boolean;
3618
+ next_quota_reset?: Date | null | undefined;
3619
3619
  usage?: number | undefined;
3620
3620
  remainingBalance?: number | undefined;
3621
3621
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3622
- next_quota_reset?: Date | null | undefined;
3623
3622
  autoTopupAdded?: number | undefined;
3624
3623
  } | {
3625
3624
  type: "message-cost-response";
3626
- promptId: string;
3627
3625
  credits: number;
3626
+ promptId: string;
3628
3627
  } | {
3629
3628
  type: "prompt-response";
3630
3629
  promptId: string;
@@ -3732,22 +3731,22 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3732
3731
  requestId: string;
3733
3732
  filePaths: string[];
3734
3733
  } | {
3735
- type: "tool-call";
3736
3734
  data: {
3737
3735
  name: string;
3738
3736
  id: string;
3739
3737
  input: Record<string, any>;
3740
3738
  };
3741
- userInputId: string;
3739
+ type: "tool-call";
3742
3740
  response: string;
3741
+ userInputId: string;
3743
3742
  changes: {
3743
+ type: "patch" | "file";
3744
3744
  path: string;
3745
- type: "file" | "patch";
3746
3745
  content: string;
3747
3746
  }[];
3748
3747
  changesAlreadyApplied: {
3748
+ type: "patch" | "file";
3749
3749
  path: string;
3750
- type: "file" | "patch";
3751
3750
  content: string;
3752
3751
  }[];
3753
3752
  addedFileVersions: {
@@ -3764,8 +3763,8 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3764
3763
  isUpToDate: boolean;
3765
3764
  latestVersion: string;
3766
3765
  } | {
3767
- message: string;
3768
3766
  type: "action-error";
3767
+ message: string;
3769
3768
  remainingBalance?: number | undefined;
3770
3769
  error?: string | undefined;
3771
3770
  } | {
@@ -3774,6 +3773,7 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3774
3773
  } | {
3775
3774
  type: "request-reconnect";
3776
3775
  };
3776
+ type: "action";
3777
3777
  }>;
3778
3778
  };
3779
3779
  export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
@@ -3814,12 +3814,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3814
3814
  path: z.ZodString;
3815
3815
  content: z.ZodString;
3816
3816
  }, "strip", z.ZodTypeAny, {
3817
+ type: "patch" | "file";
3817
3818
  path: string;
3818
- type: "file" | "patch";
3819
3819
  content: string;
3820
3820
  }, {
3821
+ type: "patch" | "file";
3821
3822
  path: string;
3822
- type: "file" | "patch";
3823
3823
  content: string;
3824
3824
  }>, "many">;
3825
3825
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -3827,12 +3827,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3827
3827
  path: z.ZodString;
3828
3828
  content: z.ZodString;
3829
3829
  }, "strip", z.ZodTypeAny, {
3830
+ type: "patch" | "file";
3830
3831
  path: string;
3831
- type: "file" | "patch";
3832
3832
  content: string;
3833
3833
  }, {
3834
+ type: "patch" | "file";
3834
3835
  path: string;
3835
- type: "file" | "patch";
3836
3836
  content: string;
3837
3837
  }>, "many">;
3838
3838
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -3847,23 +3847,23 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3847
3847
  }>, "many">;
3848
3848
  resetFileVersions: z.ZodBoolean;
3849
3849
  }, {
3850
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3850
3851
  usage: z.ZodOptional<z.ZodNumber>;
3851
3852
  remainingBalance: z.ZodOptional<z.ZodNumber>;
3852
3853
  balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>>;
3853
- next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3854
3854
  autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
3855
3855
  }>, "strip", z.ZodTypeAny, {
3856
3856
  type: "response-complete";
3857
- userInputId: string;
3858
3857
  response: string;
3858
+ userInputId: string;
3859
3859
  changes: {
3860
+ type: "patch" | "file";
3860
3861
  path: string;
3861
- type: "file" | "patch";
3862
3862
  content: string;
3863
3863
  }[];
3864
3864
  changesAlreadyApplied: {
3865
+ type: "patch" | "file";
3865
3866
  path: string;
3866
- type: "file" | "patch";
3867
3867
  content: string;
3868
3868
  }[];
3869
3869
  addedFileVersions: {
@@ -3871,23 +3871,23 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3871
3871
  content: string;
3872
3872
  }[];
3873
3873
  resetFileVersions: boolean;
3874
+ next_quota_reset?: Date | null | undefined;
3874
3875
  usage?: number | undefined;
3875
3876
  remainingBalance?: number | undefined;
3876
3877
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3877
- next_quota_reset?: Date | null | undefined;
3878
3878
  autoTopupAdded?: number | undefined;
3879
3879
  }, {
3880
3880
  type: "response-complete";
3881
- userInputId: string;
3882
3881
  response: string;
3882
+ userInputId: string;
3883
3883
  changes: {
3884
+ type: "patch" | "file";
3884
3885
  path: string;
3885
- type: "file" | "patch";
3886
3886
  content: string;
3887
3887
  }[];
3888
3888
  changesAlreadyApplied: {
3889
+ type: "patch" | "file";
3889
3890
  path: string;
3890
- type: "file" | "patch";
3891
3891
  content: string;
3892
3892
  }[];
3893
3893
  addedFileVersions: {
@@ -3895,10 +3895,10 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3895
3895
  content: string;
3896
3896
  }[];
3897
3897
  resetFileVersions: boolean;
3898
+ next_quota_reset?: Date | null | undefined;
3898
3899
  usage?: number | undefined;
3899
3900
  remainingBalance?: number | undefined;
3900
3901
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3901
- next_quota_reset?: Date | null | undefined;
3902
3902
  autoTopupAdded?: number | undefined;
3903
3903
  }>, z.ZodObject<{
3904
3904
  type: z.ZodLiteral<"prompt-response">;
@@ -4576,12 +4576,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4576
4576
  path: z.ZodString;
4577
4577
  content: z.ZodString;
4578
4578
  }, "strip", z.ZodTypeAny, {
4579
+ type: "patch" | "file";
4579
4580
  path: string;
4580
- type: "file" | "patch";
4581
4581
  content: string;
4582
4582
  }, {
4583
+ type: "patch" | "file";
4583
4584
  path: string;
4584
- type: "file" | "patch";
4585
4585
  content: string;
4586
4586
  }>, "many">;
4587
4587
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -4589,12 +4589,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4589
4589
  path: z.ZodString;
4590
4590
  content: z.ZodString;
4591
4591
  }, "strip", z.ZodTypeAny, {
4592
+ type: "patch" | "file";
4592
4593
  path: string;
4593
- type: "file" | "patch";
4594
4594
  content: string;
4595
4595
  }, {
4596
+ type: "patch" | "file";
4596
4597
  path: string;
4597
- type: "file" | "patch";
4598
4598
  content: string;
4599
4599
  }>, "many">;
4600
4600
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -4609,22 +4609,22 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4609
4609
  }>, "many">;
4610
4610
  resetFileVersions: z.ZodBoolean;
4611
4611
  }, "strip", z.ZodTypeAny, {
4612
- type: "tool-call";
4613
4612
  data: {
4614
4613
  name: string;
4615
4614
  id: string;
4616
4615
  input: Record<string, any>;
4617
4616
  };
4618
- userInputId: string;
4617
+ type: "tool-call";
4619
4618
  response: string;
4619
+ userInputId: string;
4620
4620
  changes: {
4621
+ type: "patch" | "file";
4621
4622
  path: string;
4622
- type: "file" | "patch";
4623
4623
  content: string;
4624
4624
  }[];
4625
4625
  changesAlreadyApplied: {
4626
+ type: "patch" | "file";
4626
4627
  path: string;
4627
- type: "file" | "patch";
4628
4628
  content: string;
4629
4629
  }[];
4630
4630
  addedFileVersions: {
@@ -4633,22 +4633,22 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4633
4633
  }[];
4634
4634
  resetFileVersions: boolean;
4635
4635
  }, {
4636
- type: "tool-call";
4637
4636
  data: {
4638
4637
  name: string;
4639
4638
  id: string;
4640
4639
  input: Record<string, any>;
4641
4640
  };
4642
- userInputId: string;
4641
+ type: "tool-call";
4643
4642
  response: string;
4643
+ userInputId: string;
4644
4644
  changes: {
4645
+ type: "patch" | "file";
4645
4646
  path: string;
4646
- type: "file" | "patch";
4647
4647
  content: string;
4648
4648
  }[];
4649
4649
  changesAlreadyApplied: {
4650
+ type: "patch" | "file";
4650
4651
  path: string;
4651
- type: "file" | "patch";
4652
4652
  content: string;
4653
4653
  }[];
4654
4654
  addedFileVersions: {
@@ -4690,17 +4690,17 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4690
4690
  next_quota_reset: z.ZodNullable<z.ZodDate>;
4691
4691
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
4692
4692
  }, "type">>, "strip", z.ZodTypeAny, {
4693
+ next_quota_reset: Date | null;
4693
4694
  type: "init-response";
4694
4695
  usage: number;
4695
4696
  remainingBalance: number;
4696
- next_quota_reset: Date | null;
4697
4697
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
4698
4698
  autoTopupAdded?: number | undefined;
4699
4699
  }, {
4700
+ next_quota_reset: Date | null;
4700
4701
  type: "init-response";
4701
4702
  usage: number;
4702
4703
  remainingBalance: number;
4703
- next_quota_reset: Date | null;
4704
4704
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
4705
4705
  autoTopupAdded?: number | undefined;
4706
4706
  }>, z.ZodObject<{
@@ -4711,17 +4711,17 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4711
4711
  next_quota_reset: z.ZodNullable<z.ZodDate>;
4712
4712
  autoTopupAdded: z.ZodOptional<z.ZodNumber>;
4713
4713
  }, "strip", z.ZodTypeAny, {
4714
+ next_quota_reset: Date | null;
4714
4715
  type: "usage-response";
4715
4716
  usage: number;
4716
4717
  remainingBalance: number;
4717
- next_quota_reset: Date | null;
4718
4718
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
4719
4719
  autoTopupAdded?: number | undefined;
4720
4720
  }, {
4721
+ next_quota_reset: Date | null;
4721
4722
  type: "usage-response";
4722
4723
  usage: number;
4723
4724
  remainingBalance: number;
4724
- next_quota_reset: Date | null;
4725
4725
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
4726
4726
  autoTopupAdded?: number | undefined;
4727
4727
  }>, z.ZodObject<{
@@ -4730,25 +4730,25 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4730
4730
  credits: z.ZodNumber;
4731
4731
  }, "strip", z.ZodTypeAny, {
4732
4732
  type: "message-cost-response";
4733
- promptId: string;
4734
4733
  credits: number;
4734
+ promptId: string;
4735
4735
  }, {
4736
4736
  type: "message-cost-response";
4737
- promptId: string;
4738
4737
  credits: number;
4738
+ promptId: string;
4739
4739
  }>, z.ZodObject<{
4740
4740
  type: z.ZodLiteral<"action-error">;
4741
4741
  message: z.ZodString;
4742
4742
  error: z.ZodOptional<z.ZodString>;
4743
4743
  remainingBalance: z.ZodOptional<z.ZodNumber>;
4744
4744
  }, "strip", z.ZodTypeAny, {
4745
- message: string;
4746
4745
  type: "action-error";
4746
+ message: string;
4747
4747
  remainingBalance?: number | undefined;
4748
4748
  error?: string | undefined;
4749
4749
  }, {
4750
- message: string;
4751
4750
  type: "action-error";
4751
+ message: string;
4752
4752
  remainingBalance?: number | undefined;
4753
4753
  error?: string | undefined;
4754
4754
  }>, z.ZodObject<{
@@ -4768,33 +4768,32 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4768
4768
  type: "request-reconnect";
4769
4769
  }>]>;
4770
4770
  }, "strip", z.ZodTypeAny, {
4771
- type: "action";
4772
4771
  data: {
4772
+ next_quota_reset: Date | null;
4773
4773
  type: "usage-response";
4774
4774
  usage: number;
4775
4775
  remainingBalance: number;
4776
- next_quota_reset: Date | null;
4777
4776
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
4778
4777
  autoTopupAdded?: number | undefined;
4779
4778
  } | {
4779
+ next_quota_reset: Date | null;
4780
4780
  type: "init-response";
4781
4781
  usage: number;
4782
4782
  remainingBalance: number;
4783
- next_quota_reset: Date | null;
4784
4783
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
4785
4784
  autoTopupAdded?: number | undefined;
4786
4785
  } | {
4787
4786
  type: "response-complete";
4788
- userInputId: string;
4789
4787
  response: string;
4788
+ userInputId: string;
4790
4789
  changes: {
4790
+ type: "patch" | "file";
4791
4791
  path: string;
4792
- type: "file" | "patch";
4793
4792
  content: string;
4794
4793
  }[];
4795
4794
  changesAlreadyApplied: {
4795
+ type: "patch" | "file";
4796
4796
  path: string;
4797
- type: "file" | "patch";
4798
4797
  content: string;
4799
4798
  }[];
4800
4799
  addedFileVersions: {
@@ -4802,15 +4801,15 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4802
4801
  content: string;
4803
4802
  }[];
4804
4803
  resetFileVersions: boolean;
4804
+ next_quota_reset?: Date | null | undefined;
4805
4805
  usage?: number | undefined;
4806
4806
  remainingBalance?: number | undefined;
4807
4807
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
4808
- next_quota_reset?: Date | null | undefined;
4809
4808
  autoTopupAdded?: number | undefined;
4810
4809
  } | {
4811
4810
  type: "message-cost-response";
4812
- promptId: string;
4813
4811
  credits: number;
4812
+ promptId: string;
4814
4813
  } | {
4815
4814
  type: "prompt-response";
4816
4815
  promptId: string;
@@ -4918,22 +4917,22 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4918
4917
  requestId: string;
4919
4918
  filePaths: string[];
4920
4919
  } | {
4921
- type: "tool-call";
4922
4920
  data: {
4923
4921
  name: string;
4924
4922
  id: string;
4925
4923
  input: Record<string, any>;
4926
4924
  };
4927
- userInputId: string;
4925
+ type: "tool-call";
4928
4926
  response: string;
4927
+ userInputId: string;
4929
4928
  changes: {
4929
+ type: "patch" | "file";
4930
4930
  path: string;
4931
- type: "file" | "patch";
4932
4931
  content: string;
4933
4932
  }[];
4934
4933
  changesAlreadyApplied: {
4934
+ type: "patch" | "file";
4935
4935
  path: string;
4936
- type: "file" | "patch";
4937
4936
  content: string;
4938
4937
  }[];
4939
4938
  addedFileVersions: {
@@ -4950,8 +4949,8 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4950
4949
  isUpToDate: boolean;
4951
4950
  latestVersion: string;
4952
4951
  } | {
4953
- message: string;
4954
4952
  type: "action-error";
4953
+ message: string;
4955
4954
  remainingBalance?: number | undefined;
4956
4955
  error?: string | undefined;
4957
4956
  } | {
@@ -4960,34 +4959,34 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4960
4959
  } | {
4961
4960
  type: "request-reconnect";
4962
4961
  };
4963
- }, {
4964
4962
  type: "action";
4963
+ }, {
4965
4964
  data: {
4965
+ next_quota_reset: Date | null;
4966
4966
  type: "usage-response";
4967
4967
  usage: number;
4968
4968
  remainingBalance: number;
4969
- next_quota_reset: Date | null;
4970
4969
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
4971
4970
  autoTopupAdded?: number | undefined;
4972
4971
  } | {
4972
+ next_quota_reset: Date | null;
4973
4973
  type: "init-response";
4974
4974
  usage: number;
4975
4975
  remainingBalance: number;
4976
- next_quota_reset: Date | null;
4977
4976
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
4978
4977
  autoTopupAdded?: number | undefined;
4979
4978
  } | {
4980
4979
  type: "response-complete";
4981
- userInputId: string;
4982
4980
  response: string;
4981
+ userInputId: string;
4983
4982
  changes: {
4983
+ type: "patch" | "file";
4984
4984
  path: string;
4985
- type: "file" | "patch";
4986
4985
  content: string;
4987
4986
  }[];
4988
4987
  changesAlreadyApplied: {
4988
+ type: "patch" | "file";
4989
4989
  path: string;
4990
- type: "file" | "patch";
4991
4990
  content: string;
4992
4991
  }[];
4993
4992
  addedFileVersions: {
@@ -4995,15 +4994,15 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4995
4994
  content: string;
4996
4995
  }[];
4997
4996
  resetFileVersions: boolean;
4997
+ next_quota_reset?: Date | null | undefined;
4998
4998
  usage?: number | undefined;
4999
4999
  remainingBalance?: number | undefined;
5000
5000
  balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
5001
- next_quota_reset?: Date | null | undefined;
5002
5001
  autoTopupAdded?: number | undefined;
5003
5002
  } | {
5004
5003
  type: "message-cost-response";
5005
- promptId: string;
5006
5004
  credits: number;
5005
+ promptId: string;
5007
5006
  } | {
5008
5007
  type: "prompt-response";
5009
5008
  promptId: string;
@@ -5111,22 +5110,22 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
5111
5110
  requestId: string;
5112
5111
  filePaths: string[];
5113
5112
  } | {
5114
- type: "tool-call";
5115
5113
  data: {
5116
5114
  name: string;
5117
5115
  id: string;
5118
5116
  input: Record<string, any>;
5119
5117
  };
5120
- userInputId: string;
5118
+ type: "tool-call";
5121
5119
  response: string;
5120
+ userInputId: string;
5122
5121
  changes: {
5122
+ type: "patch" | "file";
5123
5123
  path: string;
5124
- type: "file" | "patch";
5125
5124
  content: string;
5126
5125
  }[];
5127
5126
  changesAlreadyApplied: {
5127
+ type: "patch" | "file";
5128
5128
  path: string;
5129
- type: "file" | "patch";
5130
5129
  content: string;
5131
5130
  }[];
5132
5131
  addedFileVersions: {
@@ -5143,8 +5142,8 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
5143
5142
  isUpToDate: boolean;
5144
5143
  latestVersion: string;
5145
5144
  } | {
5146
- message: string;
5147
5145
  type: "action-error";
5146
+ message: string;
5148
5147
  remainingBalance?: number | undefined;
5149
5148
  error?: string | undefined;
5150
5149
  } | {
@@ -5153,6 +5152,7 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
5153
5152
  } | {
5154
5153
  type: "request-reconnect";
5155
5154
  };
5155
+ type: "action";
5156
5156
  }>]>;
5157
5157
  export type ServerMessageType = keyof typeof SERVER_MESSAGE_SCHEMAS;
5158
5158
  export type ServerMessage<T extends ServerMessageType = ServerMessageType> = z.infer<(typeof SERVER_MESSAGE_SCHEMAS)[T]>;