codecane 1.0.207 → 1.0.235

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 (217) hide show
  1. package/dist/code-map/languages.d.ts +0 -1
  2. package/dist/code-map/languages.js +23 -224
  3. package/dist/code-map/languages.js.map +1 -1
  4. package/dist/code-map/parse.js +1 -0
  5. package/dist/code-map/parse.js.map +1 -1
  6. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  7. package/dist/common/actions.d.ts +369 -826
  8. package/dist/common/actions.js +25 -31
  9. package/dist/common/actions.js.map +1 -1
  10. package/dist/common/api-keys/constants.d.ts +8 -0
  11. package/dist/common/api-keys/constants.js +26 -0
  12. package/dist/common/api-keys/constants.js.map +1 -0
  13. package/dist/common/api-keys/crypto.d.ts +24 -0
  14. package/dist/common/api-keys/crypto.js +186 -0
  15. package/dist/common/api-keys/crypto.js.map +1 -0
  16. package/dist/common/bigquery/client.d.ts +15 -0
  17. package/dist/common/bigquery/client.js +246 -0
  18. package/dist/common/bigquery/client.js.map +1 -0
  19. package/dist/common/bigquery/schema.d.ts +55 -0
  20. package/dist/common/bigquery/schema.js +24 -0
  21. package/dist/common/bigquery/schema.js.map +1 -0
  22. package/dist/common/billing/auto-topup.d.ts +8 -0
  23. package/dist/common/billing/auto-topup.js +192 -0
  24. package/dist/common/billing/auto-topup.js.map +1 -0
  25. package/dist/common/billing/balance-calculator.d.ts +57 -0
  26. package/dist/common/billing/balance-calculator.js +218 -0
  27. package/dist/common/billing/balance-calculator.js.map +1 -0
  28. package/dist/common/billing/conversion.d.ts +9 -0
  29. package/dist/common/billing/conversion.js +20 -0
  30. package/dist/common/billing/conversion.js.map +1 -0
  31. package/dist/common/billing/credit-conversion.d.ts +24 -0
  32. package/dist/common/billing/credit-conversion.js +48 -0
  33. package/dist/common/billing/credit-conversion.js.map +1 -0
  34. package/dist/common/billing/grant-credits.d.ts +43 -0
  35. package/dist/common/billing/grant-credits.js +266 -0
  36. package/dist/common/billing/grant-credits.js.map +1 -0
  37. package/dist/common/billing/plans.d.ts +13 -0
  38. package/dist/common/billing/plans.js +44 -0
  39. package/dist/common/billing/plans.js.map +1 -0
  40. package/dist/common/browser-actions.d.ts +1 -1
  41. package/dist/common/browser-actions.js +4 -4
  42. package/dist/common/browser-actions.js.map +1 -1
  43. package/dist/common/constants/grant-priorities.d.ts +2 -0
  44. package/dist/common/constants/grant-priorities.js +10 -0
  45. package/dist/common/constants/grant-priorities.js.map +1 -0
  46. package/dist/common/constants/tools.d.ts +2 -0
  47. package/dist/common/constants/tools.js +24 -3
  48. package/dist/common/constants/tools.js.map +1 -1
  49. package/dist/common/constants.d.ts +93 -5
  50. package/dist/common/constants.js +111 -10
  51. package/dist/common/constants.js.map +1 -1
  52. package/dist/common/db/env.mjs +5 -5
  53. package/dist/common/db/env.mjs.map +1 -1
  54. package/dist/common/db/schema.d.ts +413 -83
  55. package/dist/common/db/schema.js +70 -9
  56. package/dist/common/db/schema.js.map +1 -1
  57. package/dist/common/db/transaction.d.ts +12 -0
  58. package/dist/common/db/transaction.js +36 -0
  59. package/dist/common/db/transaction.js.map +1 -0
  60. package/dist/common/env.mjs +11 -8
  61. package/dist/common/env.mjs.map +1 -1
  62. package/dist/common/json-config/__tests__/__snapshots__/stringify-schema.test.js.snap +66 -0
  63. package/dist/common/json-config/__tests__/stringify-schema.test.js +66 -0
  64. package/dist/common/json-config/__tests__/stringify-schema.test.js.map +1 -0
  65. package/dist/common/json-config/constants.d.ts +82 -0
  66. package/dist/common/json-config/constants.js +48 -0
  67. package/dist/common/json-config/constants.js.map +1 -0
  68. package/dist/common/json-config/parser.d.ts +7 -0
  69. package/dist/common/json-config/parser.js +51 -0
  70. package/dist/common/json-config/parser.js.map +1 -0
  71. package/dist/common/json-config/stringify-schema.d.ts +10 -0
  72. package/dist/common/json-config/stringify-schema.js +102 -0
  73. package/dist/common/json-config/stringify-schema.js.map +1 -0
  74. package/dist/common/project-file-tree.d.ts +2 -1
  75. package/dist/common/project-file-tree.js +59 -27
  76. package/dist/common/project-file-tree.js.map +1 -1
  77. package/dist/common/types/agent-state.d.ts +25 -22
  78. package/dist/common/types/agent-state.js +2 -0
  79. package/dist/common/types/agent-state.js.map +1 -1
  80. package/dist/common/types/grant.d.ts +2 -0
  81. package/dist/common/types/grant.js +10 -0
  82. package/dist/common/types/grant.js.map +1 -0
  83. package/dist/common/types/usage.d.ts +37 -18
  84. package/dist/common/types/usage.js +9 -6
  85. package/dist/common/types/usage.js.map +1 -1
  86. package/dist/common/util/__tests__/saxy.test.js +262 -0
  87. package/dist/common/util/__tests__/saxy.test.js.map +1 -0
  88. package/dist/common/util/__tests__/string.test.js +2 -3
  89. package/dist/common/util/__tests__/string.test.js.map +1 -1
  90. package/dist/common/util/changes.d.ts +1 -0
  91. package/dist/common/util/changes.js +8 -2
  92. package/dist/common/util/changes.js.map +1 -1
  93. package/dist/common/util/dates.d.ts +10 -1
  94. package/dist/common/util/dates.js +11 -2
  95. package/dist/common/util/dates.js.map +1 -1
  96. package/dist/common/util/file.d.ts +10 -9
  97. package/dist/common/util/file.js +12 -4
  98. package/dist/common/util/file.js.map +1 -1
  99. package/dist/common/util/logger.d.ts +8 -0
  100. package/dist/common/util/logger.js +52 -0
  101. package/dist/common/util/logger.js.map +1 -0
  102. package/dist/common/util/lru-cache.d.ts +23 -2
  103. package/dist/common/util/lru-cache.js +44 -18
  104. package/dist/common/util/lru-cache.js.map +1 -1
  105. package/dist/common/util/messages.d.ts +3 -0
  106. package/dist/common/util/messages.js +50 -3
  107. package/dist/common/util/messages.js.map +1 -1
  108. package/dist/common/util/min-heap.js +2 -2
  109. package/dist/common/util/min-heap.js.map +1 -1
  110. package/dist/common/util/promise.d.ts +1 -1
  111. package/dist/common/util/promise.js +2 -2
  112. package/dist/common/util/promise.js.map +1 -1
  113. package/dist/common/util/saxy.d.ts +8 -0
  114. package/dist/common/util/saxy.js +35 -12
  115. package/dist/common/util/saxy.js.map +1 -1
  116. package/dist/common/util/string.d.ts +7 -1
  117. package/dist/common/util/string.js +20 -4
  118. package/dist/common/util/string.js.map +1 -1
  119. package/dist/common/util/stripe.d.ts +1 -0
  120. package/dist/common/util/stripe.js +10 -7
  121. package/dist/common/util/stripe.js.map +1 -1
  122. package/dist/common/util/sync-failure.d.ts +1 -0
  123. package/dist/common/util/sync-failure.js +57 -0
  124. package/dist/common/util/sync-failure.js.map +1 -0
  125. package/dist/common/websockets/websocket-client.d.ts +2 -1
  126. package/dist/common/websockets/websocket-client.js +34 -6
  127. package/dist/common/websockets/websocket-client.js.map +1 -1
  128. package/dist/common/websockets/websocket-schema.d.ts +1440 -2642
  129. package/dist/utils/__tests__/response-example-4-files.txt +621 -0
  130. package/package.json +20 -35
  131. package/dist/browser-runner.d.ts +0 -35
  132. package/dist/browser-runner.js +0 -674
  133. package/dist/browser-runner.js.map +0 -1
  134. package/dist/chat-storage.d.ts +0 -2
  135. package/dist/chat-storage.js +0 -93
  136. package/dist/chat-storage.js.map +0 -1
  137. package/dist/checkpoints/checkpoint-manager.d.ts +0 -73
  138. package/dist/checkpoints/checkpoint-manager.js +0 -193
  139. package/dist/checkpoints/checkpoint-manager.js.map +0 -1
  140. package/dist/checkpoints/file-manager.d.ts +0 -72
  141. package/dist/checkpoints/file-manager.js +0 -303
  142. package/dist/checkpoints/file-manager.js.map +0 -1
  143. package/dist/cli.d.ts +0 -48
  144. package/dist/cli.js +0 -604
  145. package/dist/cli.js.map +0 -1
  146. package/dist/client.d.ts +0 -229
  147. package/dist/client.js +0 -550
  148. package/dist/client.js.map +0 -1
  149. package/dist/common/billing/quota-manager.d.ts +0 -29
  150. package/dist/common/billing/quota-manager.js +0 -213
  151. package/dist/common/billing/quota-manager.js.map +0 -1
  152. package/dist/common/util/tools.d.ts +0 -2
  153. package/dist/common/util/tools.js +0 -13
  154. package/dist/common/util/tools.js.map +0 -1
  155. package/dist/config.d.ts +0 -3
  156. package/dist/config.js +0 -9
  157. package/dist/config.js.map +0 -1
  158. package/dist/create-template-project.d.ts +0 -1
  159. package/dist/create-template-project.js +0 -107
  160. package/dist/create-template-project.js.map +0 -1
  161. package/dist/credentials.d.ts +0 -4
  162. package/dist/credentials.js +0 -37
  163. package/dist/credentials.js.map +0 -1
  164. package/dist/fingerprint.d.ts +0 -1
  165. package/dist/fingerprint.js +0 -43
  166. package/dist/fingerprint.js.map +0 -1
  167. package/dist/index.d.ts +0 -2
  168. package/dist/index.js +0 -108
  169. package/dist/index.js.map +0 -1
  170. package/dist/menu.d.ts +0 -3
  171. package/dist/menu.js +0 -117
  172. package/dist/menu.js.map +0 -1
  173. package/dist/project-files.d.ts +0 -110
  174. package/dist/project-files.js +0 -490
  175. package/dist/project-files.js.map +0 -1
  176. package/dist/tool-handlers.d.ts +0 -27
  177. package/dist/tool-handlers.js +0 -217
  178. package/dist/tool-handlers.js.map +0 -1
  179. package/dist/types.d.ts +0 -7
  180. package/dist/types.js +0 -3
  181. package/dist/types.js.map +0 -1
  182. package/dist/update-codebuff.d.ts +0 -1
  183. package/dist/update-codebuff.js +0 -156
  184. package/dist/update-codebuff.js.map +0 -1
  185. package/dist/utils/__tests__/xml-stream-parser.test.js +0 -221
  186. package/dist/utils/__tests__/xml-stream-parser.test.js.map +0 -1
  187. package/dist/utils/detect-shell.d.ts +0 -1
  188. package/dist/utils/detect-shell.js +0 -60
  189. package/dist/utils/detect-shell.js.map +0 -1
  190. package/dist/utils/logger.d.ts +0 -2
  191. package/dist/utils/logger.js +0 -33
  192. package/dist/utils/logger.js.map +0 -1
  193. package/dist/utils/spinner.d.ts +0 -11
  194. package/dist/utils/spinner.js +0 -87
  195. package/dist/utils/spinner.js.map +0 -1
  196. package/dist/utils/system-info.d.ts +0 -8
  197. package/dist/utils/system-info.js +0 -22
  198. package/dist/utils/system-info.js.map +0 -1
  199. package/dist/utils/terminal.d.ts +0 -27
  200. package/dist/utils/terminal.js +0 -335
  201. package/dist/utils/terminal.js.map +0 -1
  202. package/dist/utils/tool-renderers.d.ts +0 -16
  203. package/dist/utils/tool-renderers.js +0 -117
  204. package/dist/utils/tool-renderers.js.map +0 -1
  205. package/dist/utils/xml-stream-parser.d.ts +0 -9
  206. package/dist/utils/xml-stream-parser.js +0 -128
  207. package/dist/utils/xml-stream-parser.js.map +0 -1
  208. package/dist/web-scraper.d.ts +0 -3
  209. package/dist/web-scraper.js +0 -57
  210. package/dist/web-scraper.js.map +0 -1
  211. package/dist/workers/checkpoint-worker.js +0 -47
  212. package/dist/workers/checkpoint-worker.js.map +0 -1
  213. package/dist/workers/project-context.d.ts +0 -1
  214. package/dist/workers/project-context.js +0 -17
  215. package/dist/workers/project-context.js.map +0 -1
  216. /package/dist/{utils/__tests__/xml-stream-parser.test.d.ts → common/json-config/__tests__/stringify-schema.test.d.ts} +0 -0
  217. /package/dist/{workers/checkpoint-worker.d.ts → common/util/__tests__/saxy.test.d.ts} +0 -0
@@ -4,13 +4,13 @@ export declare const FileChangeSchema: z.ZodObject<{
4
4
  path: z.ZodString;
5
5
  content: z.ZodString;
6
6
  }, "strip", z.ZodTypeAny, {
7
+ type: "patch" | "file";
7
8
  path: string;
8
9
  content: string;
9
- type: "file" | "patch";
10
10
  }, {
11
+ type: "patch" | "file";
11
12
  path: string;
12
13
  content: string;
13
- type: "file" | "patch";
14
14
  }>;
15
15
  export type FileChange = z.infer<typeof FileChangeSchema>;
16
16
  export declare const CHANGES: z.ZodArray<z.ZodObject<{
@@ -18,13 +18,13 @@ export declare const CHANGES: z.ZodArray<z.ZodObject<{
18
18
  path: z.ZodString;
19
19
  content: z.ZodString;
20
20
  }, "strip", z.ZodTypeAny, {
21
+ type: "patch" | "file";
21
22
  path: string;
22
23
  content: string;
23
- type: "file" | "patch";
24
24
  }, {
25
+ type: "patch" | "file";
25
26
  path: string;
26
27
  content: string;
27
- type: "file" | "patch";
28
28
  }>, "many">;
29
29
  export type FileChanges = z.infer<typeof CHANGES>;
30
30
  export declare const ToolCallSchema: z.ZodObject<{
@@ -32,485 +32,22 @@ export declare const ToolCallSchema: z.ZodObject<{
32
32
  id: z.ZodString;
33
33
  input: z.ZodRecord<z.ZodString, z.ZodAny>;
34
34
  }, "strip", z.ZodTypeAny, {
35
- name: string;
36
35
  id: string;
36
+ name: string;
37
37
  input: Record<string, any>;
38
38
  }, {
39
- name: string;
40
39
  id: string;
40
+ name: string;
41
41
  input: Record<string, any>;
42
42
  }>;
43
43
  export type ToolCall = z.infer<typeof ToolCallSchema>;
44
44
  export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
45
- type: z.ZodLiteral<"user-input">;
46
- fingerprintId: z.ZodString;
47
- authToken: z.ZodOptional<z.ZodString>;
48
- userInputId: z.ZodString;
49
- messages: z.ZodArray<z.ZodObject<{
50
- role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
51
- content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
52
- type: z.ZodLiteral<"text">;
53
- text: z.ZodString;
54
- cache_control: z.ZodOptional<z.ZodObject<{
55
- type: z.ZodLiteral<"ephemeral">;
56
- }, "strip", z.ZodTypeAny, {
57
- type: "ephemeral";
58
- }, {
59
- type: "ephemeral";
60
- }>>;
61
- }, "strip", z.ZodTypeAny, {
62
- type: "text";
63
- text: string;
64
- cache_control?: {
65
- type: "ephemeral";
66
- } | undefined;
67
- }, {
68
- type: "text";
69
- text: string;
70
- cache_control?: {
71
- type: "ephemeral";
72
- } | undefined;
73
- }>, z.ZodObject<{
74
- type: z.ZodLiteral<"tool_use">;
75
- id: z.ZodString;
76
- name: z.ZodString;
77
- input: z.ZodRecord<z.ZodString, z.ZodAny>;
78
- cache_control: z.ZodOptional<z.ZodObject<{
79
- type: z.ZodLiteral<"ephemeral">;
80
- }, "strip", z.ZodTypeAny, {
81
- type: "ephemeral";
82
- }, {
83
- type: "ephemeral";
84
- }>>;
85
- }, "strip", z.ZodTypeAny, {
86
- type: "tool_use";
87
- name: string;
88
- id: string;
89
- input: Record<string, any>;
90
- cache_control?: {
91
- type: "ephemeral";
92
- } | undefined;
93
- }, {
94
- type: "tool_use";
95
- name: string;
96
- id: string;
97
- input: Record<string, any>;
98
- cache_control?: {
99
- type: "ephemeral";
100
- } | undefined;
101
- }>, z.ZodObject<{
102
- type: z.ZodLiteral<"tool_result">;
103
- tool_use_id: z.ZodString;
104
- content: z.ZodString;
105
- cache_control: z.ZodOptional<z.ZodObject<{
106
- type: z.ZodLiteral<"ephemeral">;
107
- }, "strip", z.ZodTypeAny, {
108
- type: "ephemeral";
109
- }, {
110
- type: "ephemeral";
111
- }>>;
112
- }, "strip", z.ZodTypeAny, {
113
- content: string;
114
- type: "tool_result";
115
- tool_use_id: string;
116
- cache_control?: {
117
- type: "ephemeral";
118
- } | undefined;
119
- }, {
120
- content: string;
121
- type: "tool_result";
122
- tool_use_id: string;
123
- cache_control?: {
124
- type: "ephemeral";
125
- } | undefined;
126
- }>, z.ZodObject<{
127
- type: z.ZodLiteral<"image">;
128
- source: z.ZodObject<{
129
- type: z.ZodLiteral<"base64">;
130
- media_type: z.ZodLiteral<"image/jpeg">;
131
- data: z.ZodString;
132
- }, "strip", z.ZodTypeAny, {
133
- type: "base64";
134
- media_type: "image/jpeg";
135
- data: string;
136
- }, {
137
- type: "base64";
138
- media_type: "image/jpeg";
139
- data: string;
140
- }>;
141
- cache_control: z.ZodOptional<z.ZodObject<{
142
- type: z.ZodLiteral<"ephemeral">;
143
- }, "strip", z.ZodTypeAny, {
144
- type: "ephemeral";
145
- }, {
146
- type: "ephemeral";
147
- }>>;
148
- }, "strip", z.ZodTypeAny, {
149
- type: "image";
150
- source: {
151
- type: "base64";
152
- media_type: "image/jpeg";
153
- data: string;
154
- };
155
- cache_control?: {
156
- type: "ephemeral";
157
- } | undefined;
158
- }, {
159
- type: "image";
160
- source: {
161
- type: "base64";
162
- media_type: "image/jpeg";
163
- data: string;
164
- };
165
- cache_control?: {
166
- type: "ephemeral";
167
- } | undefined;
168
- }>]>, "many">]>;
169
- }, "strip", z.ZodTypeAny, {
170
- content: string | ({
171
- type: "text";
172
- text: string;
173
- cache_control?: {
174
- type: "ephemeral";
175
- } | undefined;
176
- } | {
177
- type: "tool_use";
178
- name: string;
179
- id: string;
180
- input: Record<string, any>;
181
- cache_control?: {
182
- type: "ephemeral";
183
- } | undefined;
184
- } | {
185
- content: string;
186
- type: "tool_result";
187
- tool_use_id: string;
188
- cache_control?: {
189
- type: "ephemeral";
190
- } | undefined;
191
- } | {
192
- type: "image";
193
- source: {
194
- type: "base64";
195
- media_type: "image/jpeg";
196
- data: string;
197
- };
198
- cache_control?: {
199
- type: "ephemeral";
200
- } | undefined;
201
- })[];
202
- role: "user" | "assistant";
203
- }, {
204
- content: string | ({
205
- type: "text";
206
- text: string;
207
- cache_control?: {
208
- type: "ephemeral";
209
- } | undefined;
210
- } | {
211
- type: "tool_use";
212
- name: string;
213
- id: string;
214
- input: Record<string, any>;
215
- cache_control?: {
216
- type: "ephemeral";
217
- } | undefined;
218
- } | {
219
- content: string;
220
- type: "tool_result";
221
- tool_use_id: string;
222
- cache_control?: {
223
- type: "ephemeral";
224
- } | undefined;
225
- } | {
226
- type: "image";
227
- source: {
228
- type: "base64";
229
- media_type: "image/jpeg";
230
- data: string;
231
- };
232
- cache_control?: {
233
- type: "ephemeral";
234
- } | undefined;
235
- })[];
236
- role: "user" | "assistant";
237
- }>, "many">;
238
- fileContext: z.ZodObject<{
239
- currentWorkingDirectory: z.ZodString;
240
- fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
241
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
242
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
243
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
244
- gitChanges: z.ZodObject<{
245
- status: z.ZodString;
246
- diff: z.ZodString;
247
- diffCached: z.ZodString;
248
- lastCommitMessages: z.ZodString;
249
- }, "strip", z.ZodTypeAny, {
250
- status: string;
251
- diff: string;
252
- diffCached: string;
253
- lastCommitMessages: string;
254
- }, {
255
- status: string;
256
- diff: string;
257
- diffCached: string;
258
- lastCommitMessages: string;
259
- }>;
260
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
261
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
262
- systemInfo: z.ZodObject<{
263
- platform: z.ZodString;
264
- shell: z.ZodString;
265
- nodeVersion: z.ZodString;
266
- arch: z.ZodString;
267
- homedir: z.ZodString;
268
- cpus: z.ZodNumber;
269
- }, "strip", z.ZodTypeAny, {
270
- platform: string;
271
- shell: string;
272
- nodeVersion: string;
273
- arch: string;
274
- homedir: string;
275
- cpus: number;
276
- }, {
277
- platform: string;
278
- shell: string;
279
- nodeVersion: string;
280
- arch: string;
281
- homedir: string;
282
- cpus: number;
283
- }>;
284
- fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
285
- path: z.ZodString;
286
- content: z.ZodString;
287
- }, "strip", z.ZodTypeAny, {
288
- path: string;
289
- content: string;
290
- }, {
291
- path: string;
292
- content: string;
293
- }>, "many">, "many">;
294
- }, "strip", z.ZodTypeAny, {
295
- currentWorkingDirectory: string;
296
- fileTree: import("./util/file").FileTreeNode[];
297
- fileTokenScores: Record<string, Record<string, number>>;
298
- knowledgeFiles: Record<string, string>;
299
- gitChanges: {
300
- status: string;
301
- diff: string;
302
- diffCached: string;
303
- lastCommitMessages: string;
304
- };
305
- changesSinceLastChat: Record<string, string>;
306
- shellConfigFiles: Record<string, string>;
307
- systemInfo: {
308
- platform: string;
309
- shell: string;
310
- nodeVersion: string;
311
- arch: string;
312
- homedir: string;
313
- cpus: number;
314
- };
315
- fileVersions: {
316
- path: string;
317
- content: string;
318
- }[][];
319
- userKnowledgeFiles?: Record<string, string> | undefined;
320
- }, {
321
- currentWorkingDirectory: string;
322
- fileTree: import("./util/file").FileTreeNode[];
323
- fileTokenScores: Record<string, Record<string, number>>;
324
- knowledgeFiles: Record<string, string>;
325
- gitChanges: {
326
- status: string;
327
- diff: string;
328
- diffCached: string;
329
- lastCommitMessages: string;
330
- };
331
- changesSinceLastChat: Record<string, string>;
332
- shellConfigFiles: Record<string, string>;
333
- systemInfo: {
334
- platform: string;
335
- shell: string;
336
- nodeVersion: string;
337
- arch: string;
338
- homedir: string;
339
- cpus: number;
340
- };
341
- fileVersions: {
342
- path: string;
343
- content: string;
344
- }[][];
345
- userKnowledgeFiles?: Record<string, string> | undefined;
346
- }>;
347
- changesAlreadyApplied: z.ZodArray<z.ZodObject<{
348
- type: z.ZodEnum<["patch", "file"]>;
349
- path: z.ZodString;
350
- content: z.ZodString;
351
- }, "strip", z.ZodTypeAny, {
352
- path: string;
353
- content: string;
354
- type: "file" | "patch";
355
- }, {
356
- path: string;
357
- content: string;
358
- type: "file" | "patch";
359
- }>, "many">;
360
- costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "max"]>>>;
361
- }, "strip", z.ZodTypeAny, {
362
- type: "user-input";
363
- fingerprintId: string;
364
- userInputId: string;
365
- messages: {
366
- content: string | ({
367
- type: "text";
368
- text: string;
369
- cache_control?: {
370
- type: "ephemeral";
371
- } | undefined;
372
- } | {
373
- type: "tool_use";
374
- name: string;
375
- id: string;
376
- input: Record<string, any>;
377
- cache_control?: {
378
- type: "ephemeral";
379
- } | undefined;
380
- } | {
381
- content: string;
382
- type: "tool_result";
383
- tool_use_id: string;
384
- cache_control?: {
385
- type: "ephemeral";
386
- } | undefined;
387
- } | {
388
- type: "image";
389
- source: {
390
- type: "base64";
391
- media_type: "image/jpeg";
392
- data: string;
393
- };
394
- cache_control?: {
395
- type: "ephemeral";
396
- } | undefined;
397
- })[];
398
- role: "user" | "assistant";
399
- }[];
400
- fileContext: {
401
- currentWorkingDirectory: string;
402
- fileTree: import("./util/file").FileTreeNode[];
403
- fileTokenScores: Record<string, Record<string, number>>;
404
- knowledgeFiles: Record<string, string>;
405
- gitChanges: {
406
- status: string;
407
- diff: string;
408
- diffCached: string;
409
- lastCommitMessages: string;
410
- };
411
- changesSinceLastChat: Record<string, string>;
412
- shellConfigFiles: Record<string, string>;
413
- systemInfo: {
414
- platform: string;
415
- shell: string;
416
- nodeVersion: string;
417
- arch: string;
418
- homedir: string;
419
- cpus: number;
420
- };
421
- fileVersions: {
422
- path: string;
423
- content: string;
424
- }[][];
425
- userKnowledgeFiles?: Record<string, string> | undefined;
426
- };
427
- changesAlreadyApplied: {
428
- path: string;
429
- content: string;
430
- type: "file" | "patch";
431
- }[];
432
- costMode: "max" | "lite" | "normal";
433
- authToken?: string | undefined;
434
- }, {
435
- type: "user-input";
436
- fingerprintId: string;
437
- userInputId: string;
438
- messages: {
439
- content: string | ({
440
- type: "text";
441
- text: string;
442
- cache_control?: {
443
- type: "ephemeral";
444
- } | undefined;
445
- } | {
446
- type: "tool_use";
447
- name: string;
448
- id: string;
449
- input: Record<string, any>;
450
- cache_control?: {
451
- type: "ephemeral";
452
- } | undefined;
453
- } | {
454
- content: string;
455
- type: "tool_result";
456
- tool_use_id: string;
457
- cache_control?: {
458
- type: "ephemeral";
459
- } | undefined;
460
- } | {
461
- type: "image";
462
- source: {
463
- type: "base64";
464
- media_type: "image/jpeg";
465
- data: string;
466
- };
467
- cache_control?: {
468
- type: "ephemeral";
469
- } | undefined;
470
- })[];
471
- role: "user" | "assistant";
472
- }[];
473
- fileContext: {
474
- currentWorkingDirectory: string;
475
- fileTree: import("./util/file").FileTreeNode[];
476
- fileTokenScores: Record<string, Record<string, number>>;
477
- knowledgeFiles: Record<string, string>;
478
- gitChanges: {
479
- status: string;
480
- diff: string;
481
- diffCached: string;
482
- lastCommitMessages: string;
483
- };
484
- changesSinceLastChat: Record<string, string>;
485
- shellConfigFiles: Record<string, string>;
486
- systemInfo: {
487
- platform: string;
488
- shell: string;
489
- nodeVersion: string;
490
- arch: string;
491
- homedir: string;
492
- cpus: number;
493
- };
494
- fileVersions: {
495
- path: string;
496
- content: string;
497
- }[][];
498
- userKnowledgeFiles?: Record<string, string> | undefined;
499
- };
500
- changesAlreadyApplied: {
501
- path: string;
502
- content: string;
503
- type: "file" | "patch";
504
- }[];
505
- authToken?: string | undefined;
506
- costMode?: "max" | "lite" | "normal" | undefined;
507
- }>, z.ZodObject<{
508
45
  type: z.ZodLiteral<"prompt">;
509
46
  promptId: z.ZodString;
510
47
  prompt: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
511
48
  fingerprintId: z.ZodString;
512
49
  authToken: z.ZodOptional<z.ZodString>;
513
- costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "max"]>>>;
50
+ costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "max", "experimental"]>>>;
514
51
  agentState: z.ZodObject<{
515
52
  agentContext: z.ZodString;
516
53
  fileContext: z.ZodObject<{
@@ -559,7 +96,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
559
96
  homedir: string;
560
97
  cpus: number;
561
98
  }>;
562
- fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
99
+ fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
563
100
  path: z.ZodString;
564
101
  content: z.ZodString;
565
102
  }, "strip", z.ZodTypeAny, {
@@ -568,7 +105,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
568
105
  }, {
569
106
  path: string;
570
107
  content: string;
571
- }>, "many">, "many">;
108
+ }>, "many">, "many">>;
572
109
  }, "strip", z.ZodTypeAny, {
573
110
  currentWorkingDirectory: string;
574
111
  fileTree: import("./util/file").FileTreeNode[];
@@ -590,11 +127,11 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
590
127
  homedir: string;
591
128
  cpus: number;
592
129
  };
593
- fileVersions: {
130
+ userKnowledgeFiles?: Record<string, string> | undefined;
131
+ fileVersions?: {
594
132
  path: string;
595
133
  content: string;
596
- }[][];
597
- userKnowledgeFiles?: Record<string, string> | undefined;
134
+ }[][] | undefined;
598
135
  }, {
599
136
  currentWorkingDirectory: string;
600
137
  fileTree: import("./util/file").FileTreeNode[];
@@ -616,11 +153,11 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
616
153
  homedir: string;
617
154
  cpus: number;
618
155
  };
619
- fileVersions: {
156
+ userKnowledgeFiles?: Record<string, string> | undefined;
157
+ fileVersions?: {
620
158
  path: string;
621
159
  content: string;
622
- }[][];
623
- userKnowledgeFiles?: Record<string, string> | undefined;
160
+ }[][] | undefined;
624
161
  }>;
625
162
  messageHistory: z.ZodArray<z.ZodObject<{
626
163
  role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
@@ -659,17 +196,17 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
659
196
  type: "ephemeral";
660
197
  }>>;
661
198
  }, "strip", z.ZodTypeAny, {
199
+ id: string;
662
200
  type: "tool_use";
663
201
  name: string;
664
- id: string;
665
202
  input: Record<string, any>;
666
203
  cache_control?: {
667
204
  type: "ephemeral";
668
205
  } | undefined;
669
206
  }, {
207
+ id: string;
670
208
  type: "tool_use";
671
209
  name: string;
672
- id: string;
673
210
  input: Record<string, any>;
674
211
  cache_control?: {
675
212
  type: "ephemeral";
@@ -686,15 +223,15 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
686
223
  type: "ephemeral";
687
224
  }>>;
688
225
  }, "strip", z.ZodTypeAny, {
689
- content: string;
690
226
  type: "tool_result";
227
+ content: string;
691
228
  tool_use_id: string;
692
229
  cache_control?: {
693
230
  type: "ephemeral";
694
231
  } | undefined;
695
232
  }, {
696
- content: string;
697
233
  type: "tool_result";
234
+ content: string;
698
235
  tool_use_id: string;
699
236
  cache_control?: {
700
237
  type: "ephemeral";
@@ -750,16 +287,16 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
750
287
  type: "ephemeral";
751
288
  } | undefined;
752
289
  } | {
290
+ id: string;
753
291
  type: "tool_use";
754
292
  name: string;
755
- id: string;
756
293
  input: Record<string, any>;
757
294
  cache_control?: {
758
295
  type: "ephemeral";
759
296
  } | undefined;
760
297
  } | {
761
- content: string;
762
298
  type: "tool_result";
299
+ content: string;
763
300
  tool_use_id: string;
764
301
  cache_control?: {
765
302
  type: "ephemeral";
@@ -784,16 +321,16 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
784
321
  type: "ephemeral";
785
322
  } | undefined;
786
323
  } | {
324
+ id: string;
787
325
  type: "tool_use";
788
326
  name: string;
789
- id: string;
790
327
  input: Record<string, any>;
791
328
  cache_control?: {
792
329
  type: "ephemeral";
793
330
  } | undefined;
794
331
  } | {
795
- content: string;
796
332
  type: "tool_result";
333
+ content: string;
797
334
  tool_use_id: string;
798
335
  cache_control?: {
799
336
  type: "ephemeral";
@@ -811,7 +348,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
811
348
  })[];
812
349
  role: "user" | "assistant";
813
350
  }>, "many">;
351
+ consecutiveAssistantMessages: z.ZodOptional<z.ZodNumber>;
814
352
  }, "strip", z.ZodTypeAny, {
353
+ agentContext: string;
815
354
  fileContext: {
816
355
  currentWorkingDirectory: string;
817
356
  fileTree: import("./util/file").FileTreeNode[];
@@ -833,13 +372,12 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
833
372
  homedir: string;
834
373
  cpus: number;
835
374
  };
836
- fileVersions: {
375
+ userKnowledgeFiles?: Record<string, string> | undefined;
376
+ fileVersions?: {
837
377
  path: string;
838
378
  content: string;
839
- }[][];
840
- userKnowledgeFiles?: Record<string, string> | undefined;
379
+ }[][] | undefined;
841
380
  };
842
- agentContext: string;
843
381
  messageHistory: {
844
382
  content: string | ({
845
383
  type: "text";
@@ -848,16 +386,16 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
848
386
  type: "ephemeral";
849
387
  } | undefined;
850
388
  } | {
389
+ id: string;
851
390
  type: "tool_use";
852
391
  name: string;
853
- id: string;
854
392
  input: Record<string, any>;
855
393
  cache_control?: {
856
394
  type: "ephemeral";
857
395
  } | undefined;
858
396
  } | {
859
- content: string;
860
397
  type: "tool_result";
398
+ content: string;
861
399
  tool_use_id: string;
862
400
  cache_control?: {
863
401
  type: "ephemeral";
@@ -875,7 +413,9 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
875
413
  })[];
876
414
  role: "user" | "assistant";
877
415
  }[];
416
+ consecutiveAssistantMessages?: number | undefined;
878
417
  }, {
418
+ agentContext: string;
879
419
  fileContext: {
880
420
  currentWorkingDirectory: string;
881
421
  fileTree: import("./util/file").FileTreeNode[];
@@ -897,13 +437,12 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
897
437
  homedir: string;
898
438
  cpus: number;
899
439
  };
900
- fileVersions: {
440
+ userKnowledgeFiles?: Record<string, string> | undefined;
441
+ fileVersions?: {
901
442
  path: string;
902
443
  content: string;
903
- }[][];
904
- userKnowledgeFiles?: Record<string, string> | undefined;
444
+ }[][] | undefined;
905
445
  };
906
- agentContext: string;
907
446
  messageHistory: {
908
447
  content: string | ({
909
448
  type: "text";
@@ -912,16 +451,16 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
912
451
  type: "ephemeral";
913
452
  } | undefined;
914
453
  } | {
454
+ id: string;
915
455
  type: "tool_use";
916
456
  name: string;
917
- id: string;
918
457
  input: Record<string, any>;
919
458
  cache_control?: {
920
459
  type: "ephemeral";
921
460
  } | undefined;
922
461
  } | {
923
- content: string;
924
462
  type: "tool_result";
463
+ content: string;
925
464
  tool_use_id: string;
926
465
  cache_control?: {
927
466
  type: "ephemeral";
@@ -939,26 +478,29 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
939
478
  })[];
940
479
  role: "user" | "assistant";
941
480
  }[];
481
+ consecutiveAssistantMessages?: number | undefined;
942
482
  }>;
943
483
  toolResults: z.ZodArray<z.ZodObject<{
944
484
  name: z.ZodString;
945
485
  result: z.ZodString;
946
486
  id: z.ZodString;
947
487
  }, "strip", z.ZodTypeAny, {
948
- name: string;
949
488
  id: string;
489
+ name: string;
950
490
  result: string;
951
491
  }, {
952
- name: string;
953
492
  id: string;
493
+ name: string;
954
494
  result: string;
955
495
  }>, "many">;
496
+ model: z.ZodOptional<z.ZodString>;
956
497
  }, "strip", z.ZodTypeAny, {
957
498
  type: "prompt";
958
- fingerprintId: string;
959
- costMode: "max" | "lite" | "normal";
960
499
  promptId: string;
500
+ fingerprintId: string;
501
+ costMode: "lite" | "normal" | "max" | "experimental";
961
502
  agentState: {
503
+ agentContext: string;
962
504
  fileContext: {
963
505
  currentWorkingDirectory: string;
964
506
  fileTree: import("./util/file").FileTreeNode[];
@@ -980,13 +522,12 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
980
522
  homedir: string;
981
523
  cpus: number;
982
524
  };
983
- fileVersions: {
525
+ userKnowledgeFiles?: Record<string, string> | undefined;
526
+ fileVersions?: {
984
527
  path: string;
985
528
  content: string;
986
- }[][];
987
- userKnowledgeFiles?: Record<string, string> | undefined;
529
+ }[][] | undefined;
988
530
  };
989
- agentContext: string;
990
531
  messageHistory: {
991
532
  content: string | ({
992
533
  type: "text";
@@ -995,16 +536,16 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
995
536
  type: "ephemeral";
996
537
  } | undefined;
997
538
  } | {
539
+ id: string;
998
540
  type: "tool_use";
999
541
  name: string;
1000
- id: string;
1001
542
  input: Record<string, any>;
1002
543
  cache_control?: {
1003
544
  type: "ephemeral";
1004
545
  } | undefined;
1005
546
  } | {
1006
- content: string;
1007
547
  type: "tool_result";
548
+ content: string;
1008
549
  tool_use_id: string;
1009
550
  cache_control?: {
1010
551
  type: "ephemeral";
@@ -1022,19 +563,22 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1022
563
  })[];
1023
564
  role: "user" | "assistant";
1024
565
  }[];
566
+ consecutiveAssistantMessages?: number | undefined;
1025
567
  };
1026
568
  toolResults: {
1027
- name: string;
1028
569
  id: string;
570
+ name: string;
1029
571
  result: string;
1030
572
  }[];
1031
- authToken?: string | undefined;
573
+ model?: string | undefined;
1032
574
  prompt?: string | undefined;
575
+ authToken?: string | undefined;
1033
576
  }, {
1034
577
  type: "prompt";
1035
- fingerprintId: string;
1036
578
  promptId: string;
579
+ fingerprintId: string;
1037
580
  agentState: {
581
+ agentContext: string;
1038
582
  fileContext: {
1039
583
  currentWorkingDirectory: string;
1040
584
  fileTree: import("./util/file").FileTreeNode[];
@@ -1056,13 +600,12 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1056
600
  homedir: string;
1057
601
  cpus: number;
1058
602
  };
1059
- fileVersions: {
603
+ userKnowledgeFiles?: Record<string, string> | undefined;
604
+ fileVersions?: {
1060
605
  path: string;
1061
606
  content: string;
1062
- }[][];
1063
- userKnowledgeFiles?: Record<string, string> | undefined;
607
+ }[][] | undefined;
1064
608
  };
1065
- agentContext: string;
1066
609
  messageHistory: {
1067
610
  content: string | ({
1068
611
  type: "text";
@@ -1071,16 +614,16 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1071
614
  type: "ephemeral";
1072
615
  } | undefined;
1073
616
  } | {
617
+ id: string;
1074
618
  type: "tool_use";
1075
619
  name: string;
1076
- id: string;
1077
620
  input: Record<string, any>;
1078
621
  cache_control?: {
1079
622
  type: "ephemeral";
1080
623
  } | undefined;
1081
624
  } | {
1082
- content: string;
1083
625
  type: "tool_result";
626
+ content: string;
1084
627
  tool_use_id: string;
1085
628
  cache_control?: {
1086
629
  type: "ephemeral";
@@ -1098,15 +641,17 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1098
641
  })[];
1099
642
  role: "user" | "assistant";
1100
643
  }[];
644
+ consecutiveAssistantMessages?: number | undefined;
1101
645
  };
1102
646
  toolResults: {
1103
- name: string;
1104
647
  id: string;
648
+ name: string;
1105
649
  result: string;
1106
650
  }[];
1107
- authToken?: string | undefined;
1108
- costMode?: "max" | "lite" | "normal" | undefined;
651
+ model?: string | undefined;
1109
652
  prompt?: string | undefined;
653
+ authToken?: string | undefined;
654
+ costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
1110
655
  }>, z.ZodObject<{
1111
656
  type: z.ZodLiteral<"read-files-response">;
1112
657
  files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
@@ -1169,7 +714,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1169
714
  homedir: string;
1170
715
  cpus: number;
1171
716
  }>;
1172
- fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
717
+ fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
1173
718
  path: z.ZodString;
1174
719
  content: z.ZodString;
1175
720
  }, "strip", z.ZodTypeAny, {
@@ -1178,7 +723,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1178
723
  }, {
1179
724
  path: string;
1180
725
  content: string;
1181
- }>, "many">, "many">;
726
+ }>, "many">, "many">>;
1182
727
  }, "strip", z.ZodTypeAny, {
1183
728
  currentWorkingDirectory: string;
1184
729
  fileTree: import("./util/file").FileTreeNode[];
@@ -1200,11 +745,11 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1200
745
  homedir: string;
1201
746
  cpus: number;
1202
747
  };
1203
- fileVersions: {
748
+ userKnowledgeFiles?: Record<string, string> | undefined;
749
+ fileVersions?: {
1204
750
  path: string;
1205
751
  content: string;
1206
- }[][];
1207
- userKnowledgeFiles?: Record<string, string> | undefined;
752
+ }[][] | undefined;
1208
753
  }, {
1209
754
  currentWorkingDirectory: string;
1210
755
  fileTree: import("./util/file").FileTreeNode[];
@@ -1226,11 +771,11 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1226
771
  homedir: string;
1227
772
  cpus: number;
1228
773
  };
1229
- fileVersions: {
774
+ userKnowledgeFiles?: Record<string, string> | undefined;
775
+ fileVersions?: {
1230
776
  path: string;
1231
777
  content: string;
1232
- }[][];
1233
- userKnowledgeFiles?: Record<string, string> | undefined;
778
+ }[][] | undefined;
1234
779
  }>;
1235
780
  }, "strip", z.ZodTypeAny, {
1236
781
  type: "init";
@@ -1256,11 +801,11 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1256
801
  homedir: string;
1257
802
  cpus: number;
1258
803
  };
1259
- fileVersions: {
804
+ userKnowledgeFiles?: Record<string, string> | undefined;
805
+ fileVersions?: {
1260
806
  path: string;
1261
807
  content: string;
1262
- }[][];
1263
- userKnowledgeFiles?: Record<string, string> | undefined;
808
+ }[][] | undefined;
1264
809
  };
1265
810
  authToken?: string | undefined;
1266
811
  }, {
@@ -1287,25 +832,13 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1287
832
  homedir: string;
1288
833
  cpus: number;
1289
834
  };
1290
- fileVersions: {
835
+ userKnowledgeFiles?: Record<string, string> | undefined;
836
+ fileVersions?: {
1291
837
  path: string;
1292
838
  content: string;
1293
- }[][];
1294
- userKnowledgeFiles?: Record<string, string> | undefined;
839
+ }[][] | undefined;
1295
840
  };
1296
841
  authToken?: string | undefined;
1297
- }>, z.ZodObject<{
1298
- type: z.ZodLiteral<"usage">;
1299
- fingerprintId: z.ZodString;
1300
- authToken: z.ZodOptional<z.ZodString>;
1301
- }, "strip", z.ZodTypeAny, {
1302
- type: "usage";
1303
- fingerprintId: string;
1304
- authToken?: string | undefined;
1305
- }, {
1306
- type: "usage";
1307
- fingerprintId: string;
1308
- authToken?: string | undefined;
1309
842
  }>, z.ZodObject<{
1310
843
  type: z.ZodLiteral<"generate-commit-message">;
1311
844
  fingerprintId: z.ZodString;
@@ -1326,27 +859,27 @@ export type ClientAction = z.infer<typeof CLIENT_ACTION_SCHEMA>;
1326
859
  export declare const UsageReponseSchema: z.ZodObject<{
1327
860
  type: z.ZodLiteral<"usage-response">;
1328
861
  usage: z.ZodNumber;
1329
- limit: z.ZodNumber;
1330
- referralLink: z.ZodOptional<z.ZodString>;
1331
- subscription_active: z.ZodBoolean;
1332
- next_quota_reset: z.ZodDate;
1333
- session_credits_used: z.ZodNumber;
862
+ remainingBalance: z.ZodNumber;
863
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
864
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
865
+ nextMonthlyGrant: z.ZodNumber;
866
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
1334
867
  }, "strip", z.ZodTypeAny, {
1335
868
  type: "usage-response";
1336
869
  usage: number;
1337
- limit: number;
1338
- subscription_active: boolean;
1339
- next_quota_reset: Date;
1340
- session_credits_used: number;
1341
- referralLink?: string | undefined;
870
+ remainingBalance: number;
871
+ next_quota_reset: Date | null;
872
+ nextMonthlyGrant: number;
873
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
874
+ autoTopupAdded?: number | undefined;
1342
875
  }, {
1343
876
  type: "usage-response";
1344
877
  usage: number;
1345
- limit: number;
1346
- subscription_active: boolean;
1347
- next_quota_reset: Date;
1348
- session_credits_used: number;
1349
- referralLink?: string | undefined;
878
+ remainingBalance: number;
879
+ next_quota_reset: Date | null;
880
+ nextMonthlyGrant: number;
881
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
882
+ autoTopupAdded?: number | undefined;
1350
883
  }>;
1351
884
  export type UsageResponse = z.infer<typeof UsageReponseSchema>;
1352
885
  export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
@@ -1354,27 +887,27 @@ export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
1354
887
  }, Omit<{
1355
888
  type: z.ZodLiteral<"usage-response">;
1356
889
  usage: z.ZodNumber;
1357
- limit: z.ZodNumber;
1358
- referralLink: z.ZodOptional<z.ZodString>;
1359
- subscription_active: z.ZodBoolean;
1360
- next_quota_reset: z.ZodDate;
1361
- session_credits_used: z.ZodNumber;
890
+ remainingBalance: z.ZodNumber;
891
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
892
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
893
+ nextMonthlyGrant: z.ZodNumber;
894
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
1362
895
  }, "type">>, "strip", z.ZodTypeAny, {
1363
896
  type: "init-response";
1364
897
  usage: number;
1365
- limit: number;
1366
- subscription_active: boolean;
1367
- next_quota_reset: Date;
1368
- session_credits_used: number;
1369
- referralLink?: string | undefined;
898
+ remainingBalance: number;
899
+ next_quota_reset: Date | null;
900
+ nextMonthlyGrant: number;
901
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
902
+ autoTopupAdded?: number | undefined;
1370
903
  }, {
1371
904
  type: "init-response";
1372
905
  usage: number;
1373
- limit: number;
1374
- subscription_active: boolean;
1375
- next_quota_reset: Date;
1376
- session_credits_used: number;
1377
- referralLink?: string | undefined;
906
+ remainingBalance: number;
907
+ next_quota_reset: Date | null;
908
+ nextMonthlyGrant: number;
909
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
910
+ autoTopupAdded?: number | undefined;
1378
911
  }>;
1379
912
  export type InitResponse = z.infer<typeof InitResponseSchema>;
1380
913
  export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShape<{
@@ -1386,26 +919,26 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
1386
919
  path: z.ZodString;
1387
920
  content: z.ZodString;
1388
921
  }, "strip", z.ZodTypeAny, {
922
+ type: "patch" | "file";
1389
923
  path: string;
1390
924
  content: string;
1391
- type: "file" | "patch";
1392
925
  }, {
926
+ type: "patch" | "file";
1393
927
  path: string;
1394
928
  content: string;
1395
- type: "file" | "patch";
1396
929
  }>, "many">;
1397
930
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1398
931
  type: z.ZodEnum<["patch", "file"]>;
1399
932
  path: z.ZodString;
1400
933
  content: z.ZodString;
1401
934
  }, "strip", z.ZodTypeAny, {
935
+ type: "patch" | "file";
1402
936
  path: string;
1403
937
  content: string;
1404
- type: "file" | "patch";
1405
938
  }, {
939
+ type: "patch" | "file";
1406
940
  path: string;
1407
941
  content: string;
1408
- type: "file" | "patch";
1409
942
  }>, "many">;
1410
943
  addedFileVersions: z.ZodArray<z.ZodObject<{
1411
944
  path: z.ZodString;
@@ -1420,24 +953,24 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
1420
953
  resetFileVersions: z.ZodBoolean;
1421
954
  }, {
1422
955
  usage: z.ZodOptional<z.ZodNumber>;
1423
- limit: z.ZodOptional<z.ZodNumber>;
1424
- referralLink: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1425
- subscription_active: z.ZodOptional<z.ZodBoolean>;
1426
- next_quota_reset: z.ZodOptional<z.ZodDate>;
1427
- session_credits_used: z.ZodOptional<z.ZodNumber>;
956
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
957
+ balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>>;
958
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
959
+ nextMonthlyGrant: z.ZodOptional<z.ZodNumber>;
960
+ autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1428
961
  }>, "strip", z.ZodTypeAny, {
1429
962
  type: "response-complete";
1430
963
  userInputId: string;
1431
- changesAlreadyApplied: {
964
+ response: string;
965
+ changes: {
966
+ type: "patch" | "file";
1432
967
  path: string;
1433
968
  content: string;
1434
- type: "file" | "patch";
1435
969
  }[];
1436
- response: string;
1437
- changes: {
970
+ changesAlreadyApplied: {
971
+ type: "patch" | "file";
1438
972
  path: string;
1439
973
  content: string;
1440
- type: "file" | "patch";
1441
974
  }[];
1442
975
  addedFileVersions: {
1443
976
  path: string;
@@ -1445,24 +978,24 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
1445
978
  }[];
1446
979
  resetFileVersions: boolean;
1447
980
  usage?: number | undefined;
1448
- limit?: number | undefined;
1449
- referralLink?: string | undefined;
1450
- subscription_active?: boolean | undefined;
1451
- next_quota_reset?: Date | undefined;
1452
- session_credits_used?: number | undefined;
981
+ remainingBalance?: number | undefined;
982
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
983
+ next_quota_reset?: Date | null | undefined;
984
+ nextMonthlyGrant?: number | undefined;
985
+ autoTopupAdded?: number | undefined;
1453
986
  }, {
1454
987
  type: "response-complete";
1455
988
  userInputId: string;
1456
- changesAlreadyApplied: {
989
+ response: string;
990
+ changes: {
991
+ type: "patch" | "file";
1457
992
  path: string;
1458
993
  content: string;
1459
- type: "file" | "patch";
1460
994
  }[];
1461
- response: string;
1462
- changes: {
995
+ changesAlreadyApplied: {
996
+ type: "patch" | "file";
1463
997
  path: string;
1464
998
  content: string;
1465
- type: "file" | "patch";
1466
999
  }[];
1467
1000
  addedFileVersions: {
1468
1001
  path: string;
@@ -1470,13 +1003,27 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
1470
1003
  }[];
1471
1004
  resetFileVersions: boolean;
1472
1005
  usage?: number | undefined;
1473
- limit?: number | undefined;
1474
- referralLink?: string | undefined;
1475
- subscription_active?: boolean | undefined;
1476
- next_quota_reset?: Date | undefined;
1477
- session_credits_used?: number | undefined;
1006
+ remainingBalance?: number | undefined;
1007
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1008
+ next_quota_reset?: Date | null | undefined;
1009
+ nextMonthlyGrant?: number | undefined;
1010
+ autoTopupAdded?: number | undefined;
1011
+ }>;
1012
+ export declare const MessageCostResponseSchema: z.ZodObject<{
1013
+ type: z.ZodLiteral<"message-cost-response">;
1014
+ promptId: z.ZodString;
1015
+ credits: z.ZodNumber;
1016
+ }, "strip", z.ZodTypeAny, {
1017
+ type: "message-cost-response";
1018
+ promptId: string;
1019
+ credits: number;
1020
+ }, {
1021
+ type: "message-cost-response";
1022
+ promptId: string;
1023
+ credits: number;
1478
1024
  }>;
1479
- export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
1025
+ export type MessageCostResponse = z.infer<typeof MessageCostResponseSchema>;
1026
+ export declare const PromptResponseSchema: z.ZodObject<{
1480
1027
  type: z.ZodLiteral<"prompt-response">;
1481
1028
  promptId: z.ZodString;
1482
1029
  agentState: z.ZodObject<{
@@ -1527,7 +1074,7 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1527
1074
  homedir: string;
1528
1075
  cpus: number;
1529
1076
  }>;
1530
- fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
1077
+ fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
1531
1078
  path: z.ZodString;
1532
1079
  content: z.ZodString;
1533
1080
  }, "strip", z.ZodTypeAny, {
@@ -1536,7 +1083,7 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1536
1083
  }, {
1537
1084
  path: string;
1538
1085
  content: string;
1539
- }>, "many">, "many">;
1086
+ }>, "many">, "many">>;
1540
1087
  }, "strip", z.ZodTypeAny, {
1541
1088
  currentWorkingDirectory: string;
1542
1089
  fileTree: import("./util/file").FileTreeNode[];
@@ -1558,11 +1105,11 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1558
1105
  homedir: string;
1559
1106
  cpus: number;
1560
1107
  };
1561
- fileVersions: {
1108
+ userKnowledgeFiles?: Record<string, string> | undefined;
1109
+ fileVersions?: {
1562
1110
  path: string;
1563
1111
  content: string;
1564
- }[][];
1565
- userKnowledgeFiles?: Record<string, string> | undefined;
1112
+ }[][] | undefined;
1566
1113
  }, {
1567
1114
  currentWorkingDirectory: string;
1568
1115
  fileTree: import("./util/file").FileTreeNode[];
@@ -1584,11 +1131,11 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1584
1131
  homedir: string;
1585
1132
  cpus: number;
1586
1133
  };
1587
- fileVersions: {
1134
+ userKnowledgeFiles?: Record<string, string> | undefined;
1135
+ fileVersions?: {
1588
1136
  path: string;
1589
1137
  content: string;
1590
- }[][];
1591
- userKnowledgeFiles?: Record<string, string> | undefined;
1138
+ }[][] | undefined;
1592
1139
  }>;
1593
1140
  messageHistory: z.ZodArray<z.ZodObject<{
1594
1141
  role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
@@ -1627,17 +1174,17 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1627
1174
  type: "ephemeral";
1628
1175
  }>>;
1629
1176
  }, "strip", z.ZodTypeAny, {
1177
+ id: string;
1630
1178
  type: "tool_use";
1631
1179
  name: string;
1632
- id: string;
1633
1180
  input: Record<string, any>;
1634
1181
  cache_control?: {
1635
1182
  type: "ephemeral";
1636
1183
  } | undefined;
1637
1184
  }, {
1185
+ id: string;
1638
1186
  type: "tool_use";
1639
1187
  name: string;
1640
- id: string;
1641
1188
  input: Record<string, any>;
1642
1189
  cache_control?: {
1643
1190
  type: "ephemeral";
@@ -1654,15 +1201,15 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1654
1201
  type: "ephemeral";
1655
1202
  }>>;
1656
1203
  }, "strip", z.ZodTypeAny, {
1657
- content: string;
1658
1204
  type: "tool_result";
1205
+ content: string;
1659
1206
  tool_use_id: string;
1660
1207
  cache_control?: {
1661
1208
  type: "ephemeral";
1662
1209
  } | undefined;
1663
1210
  }, {
1664
- content: string;
1665
1211
  type: "tool_result";
1212
+ content: string;
1666
1213
  tool_use_id: string;
1667
1214
  cache_control?: {
1668
1215
  type: "ephemeral";
@@ -1718,16 +1265,16 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1718
1265
  type: "ephemeral";
1719
1266
  } | undefined;
1720
1267
  } | {
1268
+ id: string;
1721
1269
  type: "tool_use";
1722
1270
  name: string;
1723
- id: string;
1724
1271
  input: Record<string, any>;
1725
1272
  cache_control?: {
1726
1273
  type: "ephemeral";
1727
1274
  } | undefined;
1728
1275
  } | {
1729
- content: string;
1730
1276
  type: "tool_result";
1277
+ content: string;
1731
1278
  tool_use_id: string;
1732
1279
  cache_control?: {
1733
1280
  type: "ephemeral";
@@ -1752,16 +1299,16 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1752
1299
  type: "ephemeral";
1753
1300
  } | undefined;
1754
1301
  } | {
1302
+ id: string;
1755
1303
  type: "tool_use";
1756
1304
  name: string;
1757
- id: string;
1758
1305
  input: Record<string, any>;
1759
1306
  cache_control?: {
1760
1307
  type: "ephemeral";
1761
1308
  } | undefined;
1762
1309
  } | {
1763
- content: string;
1764
1310
  type: "tool_result";
1311
+ content: string;
1765
1312
  tool_use_id: string;
1766
1313
  cache_control?: {
1767
1314
  type: "ephemeral";
@@ -1779,7 +1326,9 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1779
1326
  })[];
1780
1327
  role: "user" | "assistant";
1781
1328
  }>, "many">;
1329
+ consecutiveAssistantMessages: z.ZodOptional<z.ZodNumber>;
1782
1330
  }, "strip", z.ZodTypeAny, {
1331
+ agentContext: string;
1783
1332
  fileContext: {
1784
1333
  currentWorkingDirectory: string;
1785
1334
  fileTree: import("./util/file").FileTreeNode[];
@@ -1801,13 +1350,12 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1801
1350
  homedir: string;
1802
1351
  cpus: number;
1803
1352
  };
1804
- fileVersions: {
1353
+ userKnowledgeFiles?: Record<string, string> | undefined;
1354
+ fileVersions?: {
1805
1355
  path: string;
1806
1356
  content: string;
1807
- }[][];
1808
- userKnowledgeFiles?: Record<string, string> | undefined;
1357
+ }[][] | undefined;
1809
1358
  };
1810
- agentContext: string;
1811
1359
  messageHistory: {
1812
1360
  content: string | ({
1813
1361
  type: "text";
@@ -1816,16 +1364,16 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1816
1364
  type: "ephemeral";
1817
1365
  } | undefined;
1818
1366
  } | {
1367
+ id: string;
1819
1368
  type: "tool_use";
1820
1369
  name: string;
1821
- id: string;
1822
1370
  input: Record<string, any>;
1823
1371
  cache_control?: {
1824
1372
  type: "ephemeral";
1825
1373
  } | undefined;
1826
1374
  } | {
1827
- content: string;
1828
1375
  type: "tool_result";
1376
+ content: string;
1829
1377
  tool_use_id: string;
1830
1378
  cache_control?: {
1831
1379
  type: "ephemeral";
@@ -1843,7 +1391,9 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1843
1391
  })[];
1844
1392
  role: "user" | "assistant";
1845
1393
  }[];
1394
+ consecutiveAssistantMessages?: number | undefined;
1846
1395
  }, {
1396
+ agentContext: string;
1847
1397
  fileContext: {
1848
1398
  currentWorkingDirectory: string;
1849
1399
  fileTree: import("./util/file").FileTreeNode[];
@@ -1865,13 +1415,12 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1865
1415
  homedir: string;
1866
1416
  cpus: number;
1867
1417
  };
1868
- fileVersions: {
1418
+ userKnowledgeFiles?: Record<string, string> | undefined;
1419
+ fileVersions?: {
1869
1420
  path: string;
1870
1421
  content: string;
1871
- }[][];
1872
- userKnowledgeFiles?: Record<string, string> | undefined;
1422
+ }[][] | undefined;
1873
1423
  };
1874
- agentContext: string;
1875
1424
  messageHistory: {
1876
1425
  content: string | ({
1877
1426
  type: "text";
@@ -1880,16 +1429,16 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1880
1429
  type: "ephemeral";
1881
1430
  } | undefined;
1882
1431
  } | {
1432
+ id: string;
1883
1433
  type: "tool_use";
1884
1434
  name: string;
1885
- id: string;
1886
1435
  input: Record<string, any>;
1887
1436
  cache_control?: {
1888
1437
  type: "ephemeral";
1889
1438
  } | undefined;
1890
1439
  } | {
1891
- content: string;
1892
1440
  type: "tool_result";
1441
+ content: string;
1893
1442
  tool_use_id: string;
1894
1443
  cache_control?: {
1895
1444
  type: "ephemeral";
@@ -1907,18 +1456,19 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1907
1456
  })[];
1908
1457
  role: "user" | "assistant";
1909
1458
  }[];
1459
+ consecutiveAssistantMessages?: number | undefined;
1910
1460
  }>;
1911
1461
  toolCalls: z.ZodArray<z.ZodObject<{
1912
1462
  name: z.ZodString;
1913
1463
  parameters: z.ZodRecord<z.ZodString, z.ZodString>;
1914
1464
  id: z.ZodString;
1915
1465
  }, "strip", z.ZodTypeAny, {
1916
- name: string;
1917
1466
  id: string;
1467
+ name: string;
1918
1468
  parameters: Record<string, string>;
1919
1469
  }, {
1920
- name: string;
1921
1470
  id: string;
1471
+ name: string;
1922
1472
  parameters: Record<string, string>;
1923
1473
  }>, "many">;
1924
1474
  toolResults: z.ZodArray<z.ZodObject<{
@@ -1926,25 +1476,19 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1926
1476
  result: z.ZodString;
1927
1477
  id: z.ZodString;
1928
1478
  }, "strip", z.ZodTypeAny, {
1929
- name: string;
1930
1479
  id: string;
1480
+ name: string;
1931
1481
  result: string;
1932
1482
  }, {
1933
- name: string;
1934
1483
  id: string;
1484
+ name: string;
1935
1485
  result: string;
1936
1486
  }>, "many">;
1937
- }, {
1938
- usage: z.ZodOptional<z.ZodNumber>;
1939
- limit: z.ZodOptional<z.ZodNumber>;
1940
- referralLink: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1941
- subscription_active: z.ZodOptional<z.ZodBoolean>;
1942
- next_quota_reset: z.ZodOptional<z.ZodDate>;
1943
- session_credits_used: z.ZodOptional<z.ZodNumber>;
1944
- }>, "strip", z.ZodTypeAny, {
1487
+ }, "strip", z.ZodTypeAny, {
1945
1488
  type: "prompt-response";
1946
1489
  promptId: string;
1947
1490
  agentState: {
1491
+ agentContext: string;
1948
1492
  fileContext: {
1949
1493
  currentWorkingDirectory: string;
1950
1494
  fileTree: import("./util/file").FileTreeNode[];
@@ -1966,13 +1510,12 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1966
1510
  homedir: string;
1967
1511
  cpus: number;
1968
1512
  };
1969
- fileVersions: {
1513
+ userKnowledgeFiles?: Record<string, string> | undefined;
1514
+ fileVersions?: {
1970
1515
  path: string;
1971
1516
  content: string;
1972
- }[][];
1973
- userKnowledgeFiles?: Record<string, string> | undefined;
1517
+ }[][] | undefined;
1974
1518
  };
1975
- agentContext: string;
1976
1519
  messageHistory: {
1977
1520
  content: string | ({
1978
1521
  type: "text";
@@ -1981,16 +1524,16 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
1981
1524
  type: "ephemeral";
1982
1525
  } | undefined;
1983
1526
  } | {
1527
+ id: string;
1984
1528
  type: "tool_use";
1985
1529
  name: string;
1986
- id: string;
1987
1530
  input: Record<string, any>;
1988
1531
  cache_control?: {
1989
1532
  type: "ephemeral";
1990
1533
  } | undefined;
1991
1534
  } | {
1992
- content: string;
1993
1535
  type: "tool_result";
1536
+ content: string;
1994
1537
  tool_use_id: string;
1995
1538
  cache_control?: {
1996
1539
  type: "ephemeral";
@@ -2008,27 +1551,23 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
2008
1551
  })[];
2009
1552
  role: "user" | "assistant";
2010
1553
  }[];
1554
+ consecutiveAssistantMessages?: number | undefined;
2011
1555
  };
2012
1556
  toolResults: {
2013
- name: string;
2014
1557
  id: string;
1558
+ name: string;
2015
1559
  result: string;
2016
1560
  }[];
2017
1561
  toolCalls: {
2018
- name: string;
2019
1562
  id: string;
1563
+ name: string;
2020
1564
  parameters: Record<string, string>;
2021
1565
  }[];
2022
- usage?: number | undefined;
2023
- limit?: number | undefined;
2024
- referralLink?: string | undefined;
2025
- subscription_active?: boolean | undefined;
2026
- next_quota_reset?: Date | undefined;
2027
- session_credits_used?: number | undefined;
2028
1566
  }, {
2029
1567
  type: "prompt-response";
2030
1568
  promptId: string;
2031
1569
  agentState: {
1570
+ agentContext: string;
2032
1571
  fileContext: {
2033
1572
  currentWorkingDirectory: string;
2034
1573
  fileTree: import("./util/file").FileTreeNode[];
@@ -2050,13 +1589,12 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
2050
1589
  homedir: string;
2051
1590
  cpus: number;
2052
1591
  };
2053
- fileVersions: {
1592
+ userKnowledgeFiles?: Record<string, string> | undefined;
1593
+ fileVersions?: {
2054
1594
  path: string;
2055
1595
  content: string;
2056
- }[][];
2057
- userKnowledgeFiles?: Record<string, string> | undefined;
1596
+ }[][] | undefined;
2058
1597
  };
2059
- agentContext: string;
2060
1598
  messageHistory: {
2061
1599
  content: string | ({
2062
1600
  type: "text";
@@ -2065,16 +1603,16 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
2065
1603
  type: "ephemeral";
2066
1604
  } | undefined;
2067
1605
  } | {
1606
+ id: string;
2068
1607
  type: "tool_use";
2069
1608
  name: string;
2070
- id: string;
2071
1609
  input: Record<string, any>;
2072
1610
  cache_control?: {
2073
1611
  type: "ephemeral";
2074
1612
  } | undefined;
2075
1613
  } | {
2076
- content: string;
2077
1614
  type: "tool_result";
1615
+ content: string;
2078
1616
  tool_use_id: string;
2079
1617
  cache_control?: {
2080
1618
  type: "ephemeral";
@@ -2092,23 +1630,18 @@ export declare const PromptResponseSchema: z.ZodObject<z.objectUtil.extendShape<
2092
1630
  })[];
2093
1631
  role: "user" | "assistant";
2094
1632
  }[];
1633
+ consecutiveAssistantMessages?: number | undefined;
2095
1634
  };
2096
1635
  toolResults: {
2097
- name: string;
2098
1636
  id: string;
1637
+ name: string;
2099
1638
  result: string;
2100
1639
  }[];
2101
1640
  toolCalls: {
2102
- name: string;
2103
1641
  id: string;
1642
+ name: string;
2104
1643
  parameters: Record<string, string>;
2105
1644
  }[];
2106
- usage?: number | undefined;
2107
- limit?: number | undefined;
2108
- referralLink?: string | undefined;
2109
- subscription_active?: boolean | undefined;
2110
- next_quota_reset?: Date | undefined;
2111
- session_credits_used?: number | undefined;
2112
1645
  }>;
2113
1646
  export type PromptResponse = z.infer<typeof PromptResponseSchema>;
2114
1647
  export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -2132,26 +1665,26 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2132
1665
  path: z.ZodString;
2133
1666
  content: z.ZodString;
2134
1667
  }, "strip", z.ZodTypeAny, {
1668
+ type: "patch" | "file";
2135
1669
  path: string;
2136
1670
  content: string;
2137
- type: "file" | "patch";
2138
1671
  }, {
1672
+ type: "patch" | "file";
2139
1673
  path: string;
2140
1674
  content: string;
2141
- type: "file" | "patch";
2142
1675
  }>, "many">;
2143
1676
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2144
1677
  type: z.ZodEnum<["patch", "file"]>;
2145
1678
  path: z.ZodString;
2146
1679
  content: z.ZodString;
2147
1680
  }, "strip", z.ZodTypeAny, {
1681
+ type: "patch" | "file";
2148
1682
  path: string;
2149
1683
  content: string;
2150
- type: "file" | "patch";
2151
1684
  }, {
1685
+ type: "patch" | "file";
2152
1686
  path: string;
2153
1687
  content: string;
2154
- type: "file" | "patch";
2155
1688
  }>, "many">;
2156
1689
  addedFileVersions: z.ZodArray<z.ZodObject<{
2157
1690
  path: z.ZodString;
@@ -2166,24 +1699,24 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2166
1699
  resetFileVersions: z.ZodBoolean;
2167
1700
  }, {
2168
1701
  usage: z.ZodOptional<z.ZodNumber>;
2169
- limit: z.ZodOptional<z.ZodNumber>;
2170
- referralLink: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2171
- subscription_active: z.ZodOptional<z.ZodBoolean>;
2172
- next_quota_reset: z.ZodOptional<z.ZodDate>;
2173
- session_credits_used: z.ZodOptional<z.ZodNumber>;
1702
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
1703
+ balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>>;
1704
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1705
+ nextMonthlyGrant: z.ZodOptional<z.ZodNumber>;
1706
+ autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
2174
1707
  }>, "strip", z.ZodTypeAny, {
2175
1708
  type: "response-complete";
2176
1709
  userInputId: string;
2177
- changesAlreadyApplied: {
1710
+ response: string;
1711
+ changes: {
1712
+ type: "patch" | "file";
2178
1713
  path: string;
2179
1714
  content: string;
2180
- type: "file" | "patch";
2181
1715
  }[];
2182
- response: string;
2183
- changes: {
1716
+ changesAlreadyApplied: {
1717
+ type: "patch" | "file";
2184
1718
  path: string;
2185
1719
  content: string;
2186
- type: "file" | "patch";
2187
1720
  }[];
2188
1721
  addedFileVersions: {
2189
1722
  path: string;
@@ -2191,24 +1724,24 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2191
1724
  }[];
2192
1725
  resetFileVersions: boolean;
2193
1726
  usage?: number | undefined;
2194
- limit?: number | undefined;
2195
- referralLink?: string | undefined;
2196
- subscription_active?: boolean | undefined;
2197
- next_quota_reset?: Date | undefined;
2198
- session_credits_used?: number | undefined;
1727
+ remainingBalance?: number | undefined;
1728
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1729
+ next_quota_reset?: Date | null | undefined;
1730
+ nextMonthlyGrant?: number | undefined;
1731
+ autoTopupAdded?: number | undefined;
2199
1732
  }, {
2200
1733
  type: "response-complete";
2201
1734
  userInputId: string;
2202
- changesAlreadyApplied: {
1735
+ response: string;
1736
+ changes: {
1737
+ type: "patch" | "file";
2203
1738
  path: string;
2204
1739
  content: string;
2205
- type: "file" | "patch";
2206
1740
  }[];
2207
- response: string;
2208
- changes: {
1741
+ changesAlreadyApplied: {
1742
+ type: "patch" | "file";
2209
1743
  path: string;
2210
1744
  content: string;
2211
- type: "file" | "patch";
2212
1745
  }[];
2213
1746
  addedFileVersions: {
2214
1747
  path: string;
@@ -2216,12 +1749,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2216
1749
  }[];
2217
1750
  resetFileVersions: boolean;
2218
1751
  usage?: number | undefined;
2219
- limit?: number | undefined;
2220
- referralLink?: string | undefined;
2221
- subscription_active?: boolean | undefined;
2222
- next_quota_reset?: Date | undefined;
2223
- session_credits_used?: number | undefined;
2224
- }>, z.ZodObject<z.objectUtil.extendShape<{
1752
+ remainingBalance?: number | undefined;
1753
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1754
+ next_quota_reset?: Date | null | undefined;
1755
+ nextMonthlyGrant?: number | undefined;
1756
+ autoTopupAdded?: number | undefined;
1757
+ }>, z.ZodObject<{
2225
1758
  type: z.ZodLiteral<"prompt-response">;
2226
1759
  promptId: z.ZodString;
2227
1760
  agentState: z.ZodObject<{
@@ -2272,7 +1805,7 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2272
1805
  homedir: string;
2273
1806
  cpus: number;
2274
1807
  }>;
2275
- fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
1808
+ fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
2276
1809
  path: z.ZodString;
2277
1810
  content: z.ZodString;
2278
1811
  }, "strip", z.ZodTypeAny, {
@@ -2281,7 +1814,7 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2281
1814
  }, {
2282
1815
  path: string;
2283
1816
  content: string;
2284
- }>, "many">, "many">;
1817
+ }>, "many">, "many">>;
2285
1818
  }, "strip", z.ZodTypeAny, {
2286
1819
  currentWorkingDirectory: string;
2287
1820
  fileTree: import("./util/file").FileTreeNode[];
@@ -2303,11 +1836,11 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2303
1836
  homedir: string;
2304
1837
  cpus: number;
2305
1838
  };
2306
- fileVersions: {
1839
+ userKnowledgeFiles?: Record<string, string> | undefined;
1840
+ fileVersions?: {
2307
1841
  path: string;
2308
1842
  content: string;
2309
- }[][];
2310
- userKnowledgeFiles?: Record<string, string> | undefined;
1843
+ }[][] | undefined;
2311
1844
  }, {
2312
1845
  currentWorkingDirectory: string;
2313
1846
  fileTree: import("./util/file").FileTreeNode[];
@@ -2329,11 +1862,11 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2329
1862
  homedir: string;
2330
1863
  cpus: number;
2331
1864
  };
2332
- fileVersions: {
1865
+ userKnowledgeFiles?: Record<string, string> | undefined;
1866
+ fileVersions?: {
2333
1867
  path: string;
2334
1868
  content: string;
2335
- }[][];
2336
- userKnowledgeFiles?: Record<string, string> | undefined;
1869
+ }[][] | undefined;
2337
1870
  }>;
2338
1871
  messageHistory: z.ZodArray<z.ZodObject<{
2339
1872
  role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
@@ -2372,17 +1905,17 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2372
1905
  type: "ephemeral";
2373
1906
  }>>;
2374
1907
  }, "strip", z.ZodTypeAny, {
1908
+ id: string;
2375
1909
  type: "tool_use";
2376
1910
  name: string;
2377
- id: string;
2378
1911
  input: Record<string, any>;
2379
1912
  cache_control?: {
2380
1913
  type: "ephemeral";
2381
1914
  } | undefined;
2382
1915
  }, {
1916
+ id: string;
2383
1917
  type: "tool_use";
2384
1918
  name: string;
2385
- id: string;
2386
1919
  input: Record<string, any>;
2387
1920
  cache_control?: {
2388
1921
  type: "ephemeral";
@@ -2399,15 +1932,15 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2399
1932
  type: "ephemeral";
2400
1933
  }>>;
2401
1934
  }, "strip", z.ZodTypeAny, {
2402
- content: string;
2403
1935
  type: "tool_result";
1936
+ content: string;
2404
1937
  tool_use_id: string;
2405
1938
  cache_control?: {
2406
1939
  type: "ephemeral";
2407
1940
  } | undefined;
2408
1941
  }, {
2409
- content: string;
2410
1942
  type: "tool_result";
1943
+ content: string;
2411
1944
  tool_use_id: string;
2412
1945
  cache_control?: {
2413
1946
  type: "ephemeral";
@@ -2463,16 +1996,16 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2463
1996
  type: "ephemeral";
2464
1997
  } | undefined;
2465
1998
  } | {
1999
+ id: string;
2466
2000
  type: "tool_use";
2467
2001
  name: string;
2468
- id: string;
2469
2002
  input: Record<string, any>;
2470
2003
  cache_control?: {
2471
2004
  type: "ephemeral";
2472
2005
  } | undefined;
2473
2006
  } | {
2474
- content: string;
2475
2007
  type: "tool_result";
2008
+ content: string;
2476
2009
  tool_use_id: string;
2477
2010
  cache_control?: {
2478
2011
  type: "ephemeral";
@@ -2497,16 +2030,16 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2497
2030
  type: "ephemeral";
2498
2031
  } | undefined;
2499
2032
  } | {
2033
+ id: string;
2500
2034
  type: "tool_use";
2501
2035
  name: string;
2502
- id: string;
2503
2036
  input: Record<string, any>;
2504
2037
  cache_control?: {
2505
2038
  type: "ephemeral";
2506
2039
  } | undefined;
2507
2040
  } | {
2508
- content: string;
2509
2041
  type: "tool_result";
2042
+ content: string;
2510
2043
  tool_use_id: string;
2511
2044
  cache_control?: {
2512
2045
  type: "ephemeral";
@@ -2524,7 +2057,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2524
2057
  })[];
2525
2058
  role: "user" | "assistant";
2526
2059
  }>, "many">;
2060
+ consecutiveAssistantMessages: z.ZodOptional<z.ZodNumber>;
2527
2061
  }, "strip", z.ZodTypeAny, {
2062
+ agentContext: string;
2528
2063
  fileContext: {
2529
2064
  currentWorkingDirectory: string;
2530
2065
  fileTree: import("./util/file").FileTreeNode[];
@@ -2546,13 +2081,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2546
2081
  homedir: string;
2547
2082
  cpus: number;
2548
2083
  };
2549
- fileVersions: {
2084
+ userKnowledgeFiles?: Record<string, string> | undefined;
2085
+ fileVersions?: {
2550
2086
  path: string;
2551
2087
  content: string;
2552
- }[][];
2553
- userKnowledgeFiles?: Record<string, string> | undefined;
2088
+ }[][] | undefined;
2554
2089
  };
2555
- agentContext: string;
2556
2090
  messageHistory: {
2557
2091
  content: string | ({
2558
2092
  type: "text";
@@ -2561,16 +2095,16 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2561
2095
  type: "ephemeral";
2562
2096
  } | undefined;
2563
2097
  } | {
2098
+ id: string;
2564
2099
  type: "tool_use";
2565
2100
  name: string;
2566
- id: string;
2567
2101
  input: Record<string, any>;
2568
2102
  cache_control?: {
2569
2103
  type: "ephemeral";
2570
2104
  } | undefined;
2571
2105
  } | {
2572
- content: string;
2573
2106
  type: "tool_result";
2107
+ content: string;
2574
2108
  tool_use_id: string;
2575
2109
  cache_control?: {
2576
2110
  type: "ephemeral";
@@ -2588,7 +2122,9 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2588
2122
  })[];
2589
2123
  role: "user" | "assistant";
2590
2124
  }[];
2125
+ consecutiveAssistantMessages?: number | undefined;
2591
2126
  }, {
2127
+ agentContext: string;
2592
2128
  fileContext: {
2593
2129
  currentWorkingDirectory: string;
2594
2130
  fileTree: import("./util/file").FileTreeNode[];
@@ -2610,13 +2146,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2610
2146
  homedir: string;
2611
2147
  cpus: number;
2612
2148
  };
2613
- fileVersions: {
2149
+ userKnowledgeFiles?: Record<string, string> | undefined;
2150
+ fileVersions?: {
2614
2151
  path: string;
2615
2152
  content: string;
2616
- }[][];
2617
- userKnowledgeFiles?: Record<string, string> | undefined;
2153
+ }[][] | undefined;
2618
2154
  };
2619
- agentContext: string;
2620
2155
  messageHistory: {
2621
2156
  content: string | ({
2622
2157
  type: "text";
@@ -2625,16 +2160,16 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2625
2160
  type: "ephemeral";
2626
2161
  } | undefined;
2627
2162
  } | {
2163
+ id: string;
2628
2164
  type: "tool_use";
2629
2165
  name: string;
2630
- id: string;
2631
2166
  input: Record<string, any>;
2632
2167
  cache_control?: {
2633
2168
  type: "ephemeral";
2634
2169
  } | undefined;
2635
2170
  } | {
2636
- content: string;
2637
2171
  type: "tool_result";
2172
+ content: string;
2638
2173
  tool_use_id: string;
2639
2174
  cache_control?: {
2640
2175
  type: "ephemeral";
@@ -2652,18 +2187,19 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2652
2187
  })[];
2653
2188
  role: "user" | "assistant";
2654
2189
  }[];
2190
+ consecutiveAssistantMessages?: number | undefined;
2655
2191
  }>;
2656
2192
  toolCalls: z.ZodArray<z.ZodObject<{
2657
2193
  name: z.ZodString;
2658
2194
  parameters: z.ZodRecord<z.ZodString, z.ZodString>;
2659
2195
  id: z.ZodString;
2660
2196
  }, "strip", z.ZodTypeAny, {
2661
- name: string;
2662
2197
  id: string;
2198
+ name: string;
2663
2199
  parameters: Record<string, string>;
2664
2200
  }, {
2665
- name: string;
2666
2201
  id: string;
2202
+ name: string;
2667
2203
  parameters: Record<string, string>;
2668
2204
  }>, "many">;
2669
2205
  toolResults: z.ZodArray<z.ZodObject<{
@@ -2671,25 +2207,19 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2671
2207
  result: z.ZodString;
2672
2208
  id: z.ZodString;
2673
2209
  }, "strip", z.ZodTypeAny, {
2674
- name: string;
2675
2210
  id: string;
2211
+ name: string;
2676
2212
  result: string;
2677
2213
  }, {
2678
- name: string;
2679
2214
  id: string;
2215
+ name: string;
2680
2216
  result: string;
2681
2217
  }>, "many">;
2682
- }, {
2683
- usage: z.ZodOptional<z.ZodNumber>;
2684
- limit: z.ZodOptional<z.ZodNumber>;
2685
- referralLink: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2686
- subscription_active: z.ZodOptional<z.ZodBoolean>;
2687
- next_quota_reset: z.ZodOptional<z.ZodDate>;
2688
- session_credits_used: z.ZodOptional<z.ZodNumber>;
2689
- }>, "strip", z.ZodTypeAny, {
2218
+ }, "strip", z.ZodTypeAny, {
2690
2219
  type: "prompt-response";
2691
2220
  promptId: string;
2692
2221
  agentState: {
2222
+ agentContext: string;
2693
2223
  fileContext: {
2694
2224
  currentWorkingDirectory: string;
2695
2225
  fileTree: import("./util/file").FileTreeNode[];
@@ -2711,13 +2241,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2711
2241
  homedir: string;
2712
2242
  cpus: number;
2713
2243
  };
2714
- fileVersions: {
2244
+ userKnowledgeFiles?: Record<string, string> | undefined;
2245
+ fileVersions?: {
2715
2246
  path: string;
2716
2247
  content: string;
2717
- }[][];
2718
- userKnowledgeFiles?: Record<string, string> | undefined;
2248
+ }[][] | undefined;
2719
2249
  };
2720
- agentContext: string;
2721
2250
  messageHistory: {
2722
2251
  content: string | ({
2723
2252
  type: "text";
@@ -2726,16 +2255,16 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2726
2255
  type: "ephemeral";
2727
2256
  } | undefined;
2728
2257
  } | {
2258
+ id: string;
2729
2259
  type: "tool_use";
2730
2260
  name: string;
2731
- id: string;
2732
2261
  input: Record<string, any>;
2733
2262
  cache_control?: {
2734
2263
  type: "ephemeral";
2735
2264
  } | undefined;
2736
2265
  } | {
2737
- content: string;
2738
2266
  type: "tool_result";
2267
+ content: string;
2739
2268
  tool_use_id: string;
2740
2269
  cache_control?: {
2741
2270
  type: "ephemeral";
@@ -2753,27 +2282,23 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2753
2282
  })[];
2754
2283
  role: "user" | "assistant";
2755
2284
  }[];
2285
+ consecutiveAssistantMessages?: number | undefined;
2756
2286
  };
2757
2287
  toolResults: {
2758
- name: string;
2759
2288
  id: string;
2289
+ name: string;
2760
2290
  result: string;
2761
2291
  }[];
2762
2292
  toolCalls: {
2763
- name: string;
2764
2293
  id: string;
2294
+ name: string;
2765
2295
  parameters: Record<string, string>;
2766
2296
  }[];
2767
- usage?: number | undefined;
2768
- limit?: number | undefined;
2769
- referralLink?: string | undefined;
2770
- subscription_active?: boolean | undefined;
2771
- next_quota_reset?: Date | undefined;
2772
- session_credits_used?: number | undefined;
2773
2297
  }, {
2774
2298
  type: "prompt-response";
2775
2299
  promptId: string;
2776
2300
  agentState: {
2301
+ agentContext: string;
2777
2302
  fileContext: {
2778
2303
  currentWorkingDirectory: string;
2779
2304
  fileTree: import("./util/file").FileTreeNode[];
@@ -2795,13 +2320,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2795
2320
  homedir: string;
2796
2321
  cpus: number;
2797
2322
  };
2798
- fileVersions: {
2323
+ userKnowledgeFiles?: Record<string, string> | undefined;
2324
+ fileVersions?: {
2799
2325
  path: string;
2800
2326
  content: string;
2801
- }[][];
2802
- userKnowledgeFiles?: Record<string, string> | undefined;
2327
+ }[][] | undefined;
2803
2328
  };
2804
- agentContext: string;
2805
2329
  messageHistory: {
2806
2330
  content: string | ({
2807
2331
  type: "text";
@@ -2810,16 +2334,16 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2810
2334
  type: "ephemeral";
2811
2335
  } | undefined;
2812
2336
  } | {
2337
+ id: string;
2813
2338
  type: "tool_use";
2814
2339
  name: string;
2815
- id: string;
2816
2340
  input: Record<string, any>;
2817
2341
  cache_control?: {
2818
2342
  type: "ephemeral";
2819
2343
  } | undefined;
2820
2344
  } | {
2821
- content: string;
2822
2345
  type: "tool_result";
2346
+ content: string;
2823
2347
  tool_use_id: string;
2824
2348
  cache_control?: {
2825
2349
  type: "ephemeral";
@@ -2837,23 +2361,18 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2837
2361
  })[];
2838
2362
  role: "user" | "assistant";
2839
2363
  }[];
2364
+ consecutiveAssistantMessages?: number | undefined;
2840
2365
  };
2841
2366
  toolResults: {
2842
- name: string;
2843
2367
  id: string;
2368
+ name: string;
2844
2369
  result: string;
2845
2370
  }[];
2846
2371
  toolCalls: {
2847
- name: string;
2848
2372
  id: string;
2373
+ name: string;
2849
2374
  parameters: Record<string, string>;
2850
2375
  }[];
2851
- usage?: number | undefined;
2852
- limit?: number | undefined;
2853
- referralLink?: string | undefined;
2854
- subscription_active?: boolean | undefined;
2855
- next_quota_reset?: Date | undefined;
2856
- session_credits_used?: number | undefined;
2857
2376
  }>, z.ZodObject<{
2858
2377
  type: z.ZodLiteral<"read-files">;
2859
2378
  filePaths: z.ZodArray<z.ZodString, "many">;
@@ -2875,12 +2394,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2875
2394
  id: z.ZodString;
2876
2395
  input: z.ZodRecord<z.ZodString, z.ZodAny>;
2877
2396
  }, "strip", z.ZodTypeAny, {
2878
- name: string;
2879
2397
  id: string;
2398
+ name: string;
2880
2399
  input: Record<string, any>;
2881
2400
  }, {
2882
- name: string;
2883
2401
  id: string;
2402
+ name: string;
2884
2403
  input: Record<string, any>;
2885
2404
  }>;
2886
2405
  changes: z.ZodArray<z.ZodObject<{
@@ -2888,26 +2407,26 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2888
2407
  path: z.ZodString;
2889
2408
  content: z.ZodString;
2890
2409
  }, "strip", z.ZodTypeAny, {
2410
+ type: "patch" | "file";
2891
2411
  path: string;
2892
2412
  content: string;
2893
- type: "file" | "patch";
2894
2413
  }, {
2414
+ type: "patch" | "file";
2895
2415
  path: string;
2896
2416
  content: string;
2897
- type: "file" | "patch";
2898
2417
  }>, "many">;
2899
2418
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2900
2419
  type: z.ZodEnum<["patch", "file"]>;
2901
2420
  path: z.ZodString;
2902
2421
  content: z.ZodString;
2903
2422
  }, "strip", z.ZodTypeAny, {
2423
+ type: "patch" | "file";
2904
2424
  path: string;
2905
2425
  content: string;
2906
- type: "file" | "patch";
2907
2426
  }, {
2427
+ type: "patch" | "file";
2908
2428
  path: string;
2909
2429
  content: string;
2910
- type: "file" | "patch";
2911
2430
  }>, "many">;
2912
2431
  addedFileVersions: z.ZodArray<z.ZodObject<{
2913
2432
  path: z.ZodString;
@@ -2922,22 +2441,22 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2922
2441
  resetFileVersions: z.ZodBoolean;
2923
2442
  }, "strip", z.ZodTypeAny, {
2924
2443
  type: "tool-call";
2925
- userInputId: string;
2926
2444
  data: {
2927
- name: string;
2928
2445
  id: string;
2446
+ name: string;
2929
2447
  input: Record<string, any>;
2930
2448
  };
2931
- changesAlreadyApplied: {
2449
+ userInputId: string;
2450
+ response: string;
2451
+ changes: {
2452
+ type: "patch" | "file";
2932
2453
  path: string;
2933
2454
  content: string;
2934
- type: "file" | "patch";
2935
2455
  }[];
2936
- response: string;
2937
- changes: {
2456
+ changesAlreadyApplied: {
2457
+ type: "patch" | "file";
2938
2458
  path: string;
2939
2459
  content: string;
2940
- type: "file" | "patch";
2941
2460
  }[];
2942
2461
  addedFileVersions: {
2943
2462
  path: string;
@@ -2946,22 +2465,22 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2946
2465
  resetFileVersions: boolean;
2947
2466
  }, {
2948
2467
  type: "tool-call";
2949
- userInputId: string;
2950
2468
  data: {
2951
- name: string;
2952
2469
  id: string;
2470
+ name: string;
2953
2471
  input: Record<string, any>;
2954
2472
  };
2955
- changesAlreadyApplied: {
2473
+ userInputId: string;
2474
+ response: string;
2475
+ changes: {
2476
+ type: "patch" | "file";
2956
2477
  path: string;
2957
2478
  content: string;
2958
- type: "file" | "patch";
2959
2479
  }[];
2960
- response: string;
2961
- changes: {
2480
+ changesAlreadyApplied: {
2481
+ type: "patch" | "file";
2962
2482
  path: string;
2963
2483
  content: string;
2964
- type: "file" | "patch";
2965
2484
  }[];
2966
2485
  addedFileVersions: {
2967
2486
  path: string;
@@ -2974,12 +2493,12 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2974
2493
  result: z.ZodString;
2975
2494
  }, "strip", z.ZodTypeAny, {
2976
2495
  type: "terminal-command-result";
2977
- userInputId: string;
2978
2496
  result: string;
2497
+ userInputId: string;
2979
2498
  }, {
2980
2499
  type: "terminal-command-result";
2981
- userInputId: string;
2982
2500
  result: string;
2501
+ userInputId: string;
2983
2502
  }>, z.ZodObject<{
2984
2503
  type: z.ZodLiteral<"npm-version-status">;
2985
2504
  isUpToDate: z.ZodBoolean;
@@ -2997,60 +2516,78 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
2997
2516
  }, Omit<{
2998
2517
  type: z.ZodLiteral<"usage-response">;
2999
2518
  usage: z.ZodNumber;
3000
- limit: z.ZodNumber;
3001
- referralLink: z.ZodOptional<z.ZodString>;
3002
- subscription_active: z.ZodBoolean;
3003
- next_quota_reset: z.ZodDate;
3004
- session_credits_used: z.ZodNumber;
2519
+ remainingBalance: z.ZodNumber;
2520
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
2521
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
2522
+ nextMonthlyGrant: z.ZodNumber;
2523
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
3005
2524
  }, "type">>, "strip", z.ZodTypeAny, {
3006
2525
  type: "init-response";
3007
2526
  usage: number;
3008
- limit: number;
3009
- subscription_active: boolean;
3010
- next_quota_reset: Date;
3011
- session_credits_used: number;
3012
- referralLink?: string | undefined;
2527
+ remainingBalance: number;
2528
+ next_quota_reset: Date | null;
2529
+ nextMonthlyGrant: number;
2530
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2531
+ autoTopupAdded?: number | undefined;
3013
2532
  }, {
3014
2533
  type: "init-response";
3015
2534
  usage: number;
3016
- limit: number;
3017
- subscription_active: boolean;
3018
- next_quota_reset: Date;
3019
- session_credits_used: number;
3020
- referralLink?: string | undefined;
2535
+ remainingBalance: number;
2536
+ next_quota_reset: Date | null;
2537
+ nextMonthlyGrant: number;
2538
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2539
+ autoTopupAdded?: number | undefined;
3021
2540
  }>, z.ZodObject<{
3022
2541
  type: z.ZodLiteral<"usage-response">;
3023
2542
  usage: z.ZodNumber;
3024
- limit: z.ZodNumber;
3025
- referralLink: z.ZodOptional<z.ZodString>;
3026
- subscription_active: z.ZodBoolean;
3027
- next_quota_reset: z.ZodDate;
3028
- session_credits_used: z.ZodNumber;
2543
+ remainingBalance: z.ZodNumber;
2544
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
2545
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
2546
+ nextMonthlyGrant: z.ZodNumber;
2547
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
3029
2548
  }, "strip", z.ZodTypeAny, {
3030
2549
  type: "usage-response";
3031
2550
  usage: number;
3032
- limit: number;
3033
- subscription_active: boolean;
3034
- next_quota_reset: Date;
3035
- session_credits_used: number;
3036
- referralLink?: string | undefined;
2551
+ remainingBalance: number;
2552
+ next_quota_reset: Date | null;
2553
+ nextMonthlyGrant: number;
2554
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2555
+ autoTopupAdded?: number | undefined;
3037
2556
  }, {
3038
2557
  type: "usage-response";
3039
2558
  usage: number;
3040
- limit: number;
3041
- subscription_active: boolean;
3042
- next_quota_reset: Date;
3043
- session_credits_used: number;
3044
- referralLink?: string | undefined;
2559
+ remainingBalance: number;
2560
+ next_quota_reset: Date | null;
2561
+ nextMonthlyGrant: number;
2562
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2563
+ autoTopupAdded?: number | undefined;
2564
+ }>, z.ZodObject<{
2565
+ type: z.ZodLiteral<"message-cost-response">;
2566
+ promptId: z.ZodString;
2567
+ credits: z.ZodNumber;
2568
+ }, "strip", z.ZodTypeAny, {
2569
+ type: "message-cost-response";
2570
+ promptId: string;
2571
+ credits: number;
2572
+ }, {
2573
+ type: "message-cost-response";
2574
+ promptId: string;
2575
+ credits: number;
3045
2576
  }>, z.ZodObject<{
3046
2577
  type: z.ZodLiteral<"action-error">;
3047
2578
  message: z.ZodString;
2579
+ error: z.ZodOptional<z.ZodString>;
2580
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
3048
2581
  }, "strip", z.ZodTypeAny, {
3049
- message: string;
3050
2582
  type: "action-error";
3051
- }, {
3052
2583
  message: string;
2584
+ error?: string | undefined;
2585
+ remainingBalance?: number | undefined;
2586
+ }, {
3053
2587
  type: "action-error";
2588
+ message: string;
2589
+ error?: string | undefined;
2590
+ remainingBalance?: number | undefined;
3054
2591
  }>, z.ZodObject<{
3055
2592
  type: z.ZodLiteral<"commit-message-response">;
3056
2593
  commitMessage: z.ZodString;
@@ -3060,5 +2597,11 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
3060
2597
  }, {
3061
2598
  type: "commit-message-response";
3062
2599
  commitMessage: string;
2600
+ }>, z.ZodObject<{
2601
+ type: z.ZodLiteral<"request-reconnect">;
2602
+ }, "strip", z.ZodTypeAny, {
2603
+ type: "request-reconnect";
2604
+ }, {
2605
+ type: "request-reconnect";
3063
2606
  }>]>;
3064
2607
  export type ServerAction = z.infer<typeof SERVER_ACTION_SCHEMA>;