codecane 1.0.123

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 (156) hide show
  1. package/README.md +87 -0
  2. package/dist/__tests__/tool-handlers.test.d.ts +1 -0
  3. package/dist/__tests__/tool-handlers.test.js +32 -0
  4. package/dist/__tests__/tool-handlers.test.js.map +1 -0
  5. package/dist/chat-storage.d.ts +29 -0
  6. package/dist/chat-storage.js +125 -0
  7. package/dist/chat-storage.js.map +1 -0
  8. package/dist/cli.d.ts +38 -0
  9. package/dist/cli.js +453 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/client.d.ts +71 -0
  12. package/dist/client.js +458 -0
  13. package/dist/client.js.map +1 -0
  14. package/dist/code-map/languages.d.ts +12 -0
  15. package/dist/code-map/languages.js +129 -0
  16. package/dist/code-map/languages.js.map +1 -0
  17. package/dist/code-map/parse.d.ts +11 -0
  18. package/dist/code-map/parse.js +127 -0
  19. package/dist/code-map/parse.js.map +1 -0
  20. package/dist/code-map/test-langs/test.d.ts +11 -0
  21. package/dist/code-map/test-langs/test.js +23 -0
  22. package/dist/code-map/test-langs/test.js.map +1 -0
  23. package/dist/code-map/tree-sitter-queries/readme.md +23 -0
  24. package/dist/code-map/tree-sitter-queries/tree-sitter-c-tags.scm +11 -0
  25. package/dist/code-map/tree-sitter-queries/tree-sitter-c_sharp-tags.scm +13 -0
  26. package/dist/code-map/tree-sitter-queries/tree-sitter-cpp-tags.scm +17 -0
  27. package/dist/code-map/tree-sitter-queries/tree-sitter-go-tags.scm +26 -0
  28. package/dist/code-map/tree-sitter-queries/tree-sitter-java-tags.scm +19 -0
  29. package/dist/code-map/tree-sitter-queries/tree-sitter-javascript-tags.scm +15 -0
  30. package/dist/code-map/tree-sitter-queries/tree-sitter-php-tags.scm +26 -0
  31. package/dist/code-map/tree-sitter-queries/tree-sitter-python-tags.scm +9 -0
  32. package/dist/code-map/tree-sitter-queries/tree-sitter-ruby-tags.scm +58 -0
  33. package/dist/code-map/tree-sitter-queries/tree-sitter-rust-tags.scm +26 -0
  34. package/dist/code-map/tree-sitter-queries/tree-sitter-typescript-tags.scm +15 -0
  35. package/dist/code-map/tsconfig.tsbuildinfo +1 -0
  36. package/dist/common/actions.d.ts +1405 -0
  37. package/dist/common/actions.js +193 -0
  38. package/dist/common/actions.js.map +1 -0
  39. package/dist/common/billing/quota-manager.d.ts +29 -0
  40. package/dist/common/billing/quota-manager.js +213 -0
  41. package/dist/common/billing/quota-manager.js.map +1 -0
  42. package/dist/common/constants.d.ts +41 -0
  43. package/dist/common/constants.js +126 -0
  44. package/dist/common/constants.js.map +1 -0
  45. package/dist/common/db/drizzle.config.d.ts +2 -0
  46. package/dist/common/db/drizzle.config.js +17 -0
  47. package/dist/common/db/drizzle.config.js.map +1 -0
  48. package/dist/common/db/env.d.mts +1 -0
  49. package/dist/common/db/env.mjs +26 -0
  50. package/dist/common/db/env.mjs.map +1 -0
  51. package/dist/common/db/index.d.ts +6 -0
  52. package/dist/common/db/index.js +35 -0
  53. package/dist/common/db/index.js.map +1 -0
  54. package/dist/common/db/schema.d.ts +1089 -0
  55. package/dist/common/db/schema.js +114 -0
  56. package/dist/common/db/schema.js.map +1 -0
  57. package/dist/common/env.d.mts +1 -0
  58. package/dist/common/env.mjs +34 -0
  59. package/dist/common/env.mjs.map +1 -0
  60. package/dist/common/project-file-tree.d.ts +9 -0
  61. package/dist/common/project-file-tree.js +166 -0
  62. package/dist/common/project-file-tree.js.map +1 -0
  63. package/dist/common/types/referral.d.ts +2 -0
  64. package/dist/common/types/referral.js +5 -0
  65. package/dist/common/types/referral.js.map +1 -0
  66. package/dist/common/types/usage.d.ts +24 -0
  67. package/dist/common/types/usage.js +13 -0
  68. package/dist/common/types/usage.js.map +1 -0
  69. package/dist/common/util/__tests__/string.test.d.ts +1 -0
  70. package/dist/common/util/__tests__/string.test.js +83 -0
  71. package/dist/common/util/__tests__/string.test.js.map +1 -0
  72. package/dist/common/util/array.d.ts +6 -0
  73. package/dist/common/util/array.js +32 -0
  74. package/dist/common/util/array.js.map +1 -0
  75. package/dist/common/util/changes.d.ts +6 -0
  76. package/dist/common/util/changes.js +72 -0
  77. package/dist/common/util/changes.js.map +1 -0
  78. package/dist/common/util/credentials.d.ts +25 -0
  79. package/dist/common/util/credentials.js +24 -0
  80. package/dist/common/util/credentials.js.map +1 -0
  81. package/dist/common/util/dates.d.ts +1 -0
  82. package/dist/common/util/dates.js +13 -0
  83. package/dist/common/util/dates.js.map +1 -0
  84. package/dist/common/util/file.d.ts +151 -0
  85. package/dist/common/util/file.js +180 -0
  86. package/dist/common/util/file.js.map +1 -0
  87. package/dist/common/util/git.d.ts +6 -0
  88. package/dist/common/util/git.js +81 -0
  89. package/dist/common/util/git.js.map +1 -0
  90. package/dist/common/util/helpers.d.ts +1 -0
  91. package/dist/common/util/helpers.js +6 -0
  92. package/dist/common/util/helpers.js.map +1 -0
  93. package/dist/common/util/object.d.ts +18 -0
  94. package/dist/common/util/object.js +91 -0
  95. package/dist/common/util/object.js.map +1 -0
  96. package/dist/common/util/patch.d.ts +1 -0
  97. package/dist/common/util/patch.js +215 -0
  98. package/dist/common/util/patch.js.map +1 -0
  99. package/dist/common/util/promise.d.ts +1 -0
  100. package/dist/common/util/promise.js +33 -0
  101. package/dist/common/util/promise.js.map +1 -0
  102. package/dist/common/util/referral.d.ts +1 -0
  103. package/dist/common/util/referral.js +6 -0
  104. package/dist/common/util/referral.js.map +1 -0
  105. package/dist/common/util/server/referral.d.ts +14 -0
  106. package/dist/common/util/server/referral.js +85 -0
  107. package/dist/common/util/server/referral.js.map +1 -0
  108. package/dist/common/util/string.d.ts +9 -0
  109. package/dist/common/util/string.js +90 -0
  110. package/dist/common/util/string.js.map +1 -0
  111. package/dist/common/util/stripe.d.ts +2 -0
  112. package/dist/common/util/stripe.js +19 -0
  113. package/dist/common/util/stripe.js.map +1 -0
  114. package/dist/common/util/tools.d.ts +2 -0
  115. package/dist/common/util/tools.js +13 -0
  116. package/dist/common/util/tools.js.map +1 -0
  117. package/dist/common/websockets/websocket-client.d.ts +40 -0
  118. package/dist/common/websockets/websocket-client.js +187 -0
  119. package/dist/common/websockets/websocket-client.js.map +1 -0
  120. package/dist/common/websockets/websocket-schema.d.ts +3058 -0
  121. package/dist/common/websockets/websocket-schema.js +55 -0
  122. package/dist/common/websockets/websocket-schema.js.map +1 -0
  123. package/dist/config.d.ts +2 -0
  124. package/dist/config.js +8 -0
  125. package/dist/config.js.map +1 -0
  126. package/dist/credentials.d.ts +3 -0
  127. package/dist/credentials.js +33 -0
  128. package/dist/credentials.js.map +1 -0
  129. package/dist/fingerprint.d.ts +1 -0
  130. package/dist/fingerprint.js +43 -0
  131. package/dist/fingerprint.js.map +1 -0
  132. package/dist/index.d.ts +2 -0
  133. package/dist/index.js +75 -0
  134. package/dist/index.js.map +1 -0
  135. package/dist/menu.d.ts +1 -0
  136. package/dist/menu.js +94 -0
  137. package/dist/menu.js.map +1 -0
  138. package/dist/project-files.d.ts +64 -0
  139. package/dist/project-files.js +338 -0
  140. package/dist/project-files.js.map +1 -0
  141. package/dist/tool-handlers.d.ts +11 -0
  142. package/dist/tool-handlers.js +215 -0
  143. package/dist/tool-handlers.js.map +1 -0
  144. package/dist/types.d.ts +7 -0
  145. package/dist/types.js +3 -0
  146. package/dist/types.js.map +1 -0
  147. package/dist/update-codebuff.d.ts +1 -0
  148. package/dist/update-codebuff.js +156 -0
  149. package/dist/update-codebuff.js.map +1 -0
  150. package/dist/web-scraper.d.ts +3 -0
  151. package/dist/web-scraper.js +57 -0
  152. package/dist/web-scraper.js.map +1 -0
  153. package/dist/worker-script-project-context.d.ts +1 -0
  154. package/dist/worker-script-project-context.js +13 -0
  155. package/dist/worker-script-project-context.js.map +1 -0
  156. package/package.json +71 -0
@@ -0,0 +1,1405 @@
1
+ import { z } from 'zod';
2
+ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
3
+ type: z.ZodLiteral<"text">;
4
+ text: z.ZodString;
5
+ cache_control: z.ZodOptional<z.ZodObject<{
6
+ type: z.ZodLiteral<"ephemeral">;
7
+ }, "strip", z.ZodTypeAny, {
8
+ type: "ephemeral";
9
+ }, {
10
+ type: "ephemeral";
11
+ }>>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ type: "text";
14
+ text: string;
15
+ cache_control?: {
16
+ type: "ephemeral";
17
+ } | undefined;
18
+ }, {
19
+ type: "text";
20
+ text: string;
21
+ cache_control?: {
22
+ type: "ephemeral";
23
+ } | undefined;
24
+ }>, z.ZodObject<{
25
+ type: z.ZodLiteral<"tool_use">;
26
+ id: z.ZodString;
27
+ name: z.ZodString;
28
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
29
+ cache_control: z.ZodOptional<z.ZodObject<{
30
+ type: z.ZodLiteral<"ephemeral">;
31
+ }, "strip", z.ZodTypeAny, {
32
+ type: "ephemeral";
33
+ }, {
34
+ type: "ephemeral";
35
+ }>>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ type: "tool_use";
38
+ name: string;
39
+ id: string;
40
+ input: Record<string, any>;
41
+ cache_control?: {
42
+ type: "ephemeral";
43
+ } | undefined;
44
+ }, {
45
+ type: "tool_use";
46
+ name: string;
47
+ id: string;
48
+ input: Record<string, any>;
49
+ cache_control?: {
50
+ type: "ephemeral";
51
+ } | undefined;
52
+ }>, z.ZodObject<{
53
+ type: z.ZodLiteral<"tool_result">;
54
+ tool_use_id: z.ZodString;
55
+ content: z.ZodString;
56
+ cache_control: z.ZodOptional<z.ZodObject<{
57
+ type: z.ZodLiteral<"ephemeral">;
58
+ }, "strip", z.ZodTypeAny, {
59
+ type: "ephemeral";
60
+ }, {
61
+ type: "ephemeral";
62
+ }>>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ content: string;
65
+ type: "tool_result";
66
+ tool_use_id: string;
67
+ cache_control?: {
68
+ type: "ephemeral";
69
+ } | undefined;
70
+ }, {
71
+ content: string;
72
+ type: "tool_result";
73
+ tool_use_id: string;
74
+ cache_control?: {
75
+ type: "ephemeral";
76
+ } | undefined;
77
+ }>]>;
78
+ declare const MessageSchema: z.ZodObject<{
79
+ role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
80
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
81
+ type: z.ZodLiteral<"text">;
82
+ text: z.ZodString;
83
+ cache_control: z.ZodOptional<z.ZodObject<{
84
+ type: z.ZodLiteral<"ephemeral">;
85
+ }, "strip", z.ZodTypeAny, {
86
+ type: "ephemeral";
87
+ }, {
88
+ type: "ephemeral";
89
+ }>>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ type: "text";
92
+ text: string;
93
+ cache_control?: {
94
+ type: "ephemeral";
95
+ } | undefined;
96
+ }, {
97
+ type: "text";
98
+ text: string;
99
+ cache_control?: {
100
+ type: "ephemeral";
101
+ } | undefined;
102
+ }>, z.ZodObject<{
103
+ type: z.ZodLiteral<"tool_use">;
104
+ id: z.ZodString;
105
+ name: z.ZodString;
106
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
107
+ cache_control: z.ZodOptional<z.ZodObject<{
108
+ type: z.ZodLiteral<"ephemeral">;
109
+ }, "strip", z.ZodTypeAny, {
110
+ type: "ephemeral";
111
+ }, {
112
+ type: "ephemeral";
113
+ }>>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ type: "tool_use";
116
+ name: string;
117
+ id: string;
118
+ input: Record<string, any>;
119
+ cache_control?: {
120
+ type: "ephemeral";
121
+ } | undefined;
122
+ }, {
123
+ type: "tool_use";
124
+ name: string;
125
+ id: string;
126
+ input: Record<string, any>;
127
+ cache_control?: {
128
+ type: "ephemeral";
129
+ } | undefined;
130
+ }>, z.ZodObject<{
131
+ type: z.ZodLiteral<"tool_result">;
132
+ tool_use_id: z.ZodString;
133
+ content: z.ZodString;
134
+ cache_control: z.ZodOptional<z.ZodObject<{
135
+ type: z.ZodLiteral<"ephemeral">;
136
+ }, "strip", z.ZodTypeAny, {
137
+ type: "ephemeral";
138
+ }, {
139
+ type: "ephemeral";
140
+ }>>;
141
+ }, "strip", z.ZodTypeAny, {
142
+ content: string;
143
+ type: "tool_result";
144
+ tool_use_id: string;
145
+ cache_control?: {
146
+ type: "ephemeral";
147
+ } | undefined;
148
+ }, {
149
+ content: string;
150
+ type: "tool_result";
151
+ tool_use_id: string;
152
+ cache_control?: {
153
+ type: "ephemeral";
154
+ } | undefined;
155
+ }>]>, "many">]>;
156
+ }, "strip", z.ZodTypeAny, {
157
+ content: string | ({
158
+ type: "text";
159
+ text: string;
160
+ cache_control?: {
161
+ type: "ephemeral";
162
+ } | undefined;
163
+ } | {
164
+ type: "tool_use";
165
+ name: string;
166
+ id: string;
167
+ input: Record<string, any>;
168
+ cache_control?: {
169
+ type: "ephemeral";
170
+ } | undefined;
171
+ } | {
172
+ content: string;
173
+ type: "tool_result";
174
+ tool_use_id: string;
175
+ cache_control?: {
176
+ type: "ephemeral";
177
+ } | undefined;
178
+ })[];
179
+ role: "user" | "assistant";
180
+ }, {
181
+ content: string | ({
182
+ type: "text";
183
+ text: string;
184
+ cache_control?: {
185
+ type: "ephemeral";
186
+ } | undefined;
187
+ } | {
188
+ type: "tool_use";
189
+ name: string;
190
+ id: string;
191
+ input: Record<string, any>;
192
+ cache_control?: {
193
+ type: "ephemeral";
194
+ } | undefined;
195
+ } | {
196
+ content: string;
197
+ type: "tool_result";
198
+ tool_use_id: string;
199
+ cache_control?: {
200
+ type: "ephemeral";
201
+ } | undefined;
202
+ })[];
203
+ role: "user" | "assistant";
204
+ }>;
205
+ export type Message = z.infer<typeof MessageSchema>;
206
+ export type MessageContentObject = z.infer<typeof MessageContentObjectSchema>;
207
+ export declare const FileChangeSchema: z.ZodObject<{
208
+ type: z.ZodEnum<["patch", "file"]>;
209
+ filePath: z.ZodString;
210
+ content: z.ZodString;
211
+ }, "strip", z.ZodTypeAny, {
212
+ content: string;
213
+ type: "file" | "patch";
214
+ filePath: string;
215
+ }, {
216
+ content: string;
217
+ type: "file" | "patch";
218
+ filePath: string;
219
+ }>;
220
+ export type FileChange = z.infer<typeof FileChangeSchema>;
221
+ export declare const CHANGES: z.ZodArray<z.ZodObject<{
222
+ type: z.ZodEnum<["patch", "file"]>;
223
+ filePath: z.ZodString;
224
+ content: z.ZodString;
225
+ }, "strip", z.ZodTypeAny, {
226
+ content: string;
227
+ type: "file" | "patch";
228
+ filePath: string;
229
+ }, {
230
+ content: string;
231
+ type: "file" | "patch";
232
+ filePath: string;
233
+ }>, "many">;
234
+ export type FileChanges = z.infer<typeof CHANGES>;
235
+ export declare const ToolCallSchema: z.ZodObject<{
236
+ name: z.ZodString;
237
+ id: z.ZodString;
238
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
239
+ }, "strip", z.ZodTypeAny, {
240
+ name: string;
241
+ id: string;
242
+ input: Record<string, any>;
243
+ }, {
244
+ name: string;
245
+ id: string;
246
+ input: Record<string, any>;
247
+ }>;
248
+ export type ToolCall = z.infer<typeof ToolCallSchema>;
249
+ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
250
+ type: z.ZodLiteral<"user-input">;
251
+ fingerprintId: z.ZodString;
252
+ authToken: z.ZodOptional<z.ZodString>;
253
+ userInputId: z.ZodString;
254
+ messages: z.ZodArray<z.ZodObject<{
255
+ role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
256
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
257
+ type: z.ZodLiteral<"text">;
258
+ text: z.ZodString;
259
+ cache_control: z.ZodOptional<z.ZodObject<{
260
+ type: z.ZodLiteral<"ephemeral">;
261
+ }, "strip", z.ZodTypeAny, {
262
+ type: "ephemeral";
263
+ }, {
264
+ type: "ephemeral";
265
+ }>>;
266
+ }, "strip", z.ZodTypeAny, {
267
+ type: "text";
268
+ text: string;
269
+ cache_control?: {
270
+ type: "ephemeral";
271
+ } | undefined;
272
+ }, {
273
+ type: "text";
274
+ text: string;
275
+ cache_control?: {
276
+ type: "ephemeral";
277
+ } | undefined;
278
+ }>, z.ZodObject<{
279
+ type: z.ZodLiteral<"tool_use">;
280
+ id: z.ZodString;
281
+ name: z.ZodString;
282
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
283
+ cache_control: z.ZodOptional<z.ZodObject<{
284
+ type: z.ZodLiteral<"ephemeral">;
285
+ }, "strip", z.ZodTypeAny, {
286
+ type: "ephemeral";
287
+ }, {
288
+ type: "ephemeral";
289
+ }>>;
290
+ }, "strip", z.ZodTypeAny, {
291
+ type: "tool_use";
292
+ name: string;
293
+ id: string;
294
+ input: Record<string, any>;
295
+ cache_control?: {
296
+ type: "ephemeral";
297
+ } | undefined;
298
+ }, {
299
+ type: "tool_use";
300
+ name: string;
301
+ id: string;
302
+ input: Record<string, any>;
303
+ cache_control?: {
304
+ type: "ephemeral";
305
+ } | undefined;
306
+ }>, z.ZodObject<{
307
+ type: z.ZodLiteral<"tool_result">;
308
+ tool_use_id: z.ZodString;
309
+ content: z.ZodString;
310
+ cache_control: z.ZodOptional<z.ZodObject<{
311
+ type: z.ZodLiteral<"ephemeral">;
312
+ }, "strip", z.ZodTypeAny, {
313
+ type: "ephemeral";
314
+ }, {
315
+ type: "ephemeral";
316
+ }>>;
317
+ }, "strip", z.ZodTypeAny, {
318
+ content: string;
319
+ type: "tool_result";
320
+ tool_use_id: string;
321
+ cache_control?: {
322
+ type: "ephemeral";
323
+ } | undefined;
324
+ }, {
325
+ content: string;
326
+ type: "tool_result";
327
+ tool_use_id: string;
328
+ cache_control?: {
329
+ type: "ephemeral";
330
+ } | undefined;
331
+ }>]>, "many">]>;
332
+ }, "strip", z.ZodTypeAny, {
333
+ content: string | ({
334
+ type: "text";
335
+ text: string;
336
+ cache_control?: {
337
+ type: "ephemeral";
338
+ } | undefined;
339
+ } | {
340
+ type: "tool_use";
341
+ name: string;
342
+ id: string;
343
+ input: Record<string, any>;
344
+ cache_control?: {
345
+ type: "ephemeral";
346
+ } | undefined;
347
+ } | {
348
+ content: string;
349
+ type: "tool_result";
350
+ tool_use_id: string;
351
+ cache_control?: {
352
+ type: "ephemeral";
353
+ } | undefined;
354
+ })[];
355
+ role: "user" | "assistant";
356
+ }, {
357
+ content: string | ({
358
+ type: "text";
359
+ text: string;
360
+ cache_control?: {
361
+ type: "ephemeral";
362
+ } | undefined;
363
+ } | {
364
+ type: "tool_use";
365
+ name: string;
366
+ id: string;
367
+ input: Record<string, any>;
368
+ cache_control?: {
369
+ type: "ephemeral";
370
+ } | undefined;
371
+ } | {
372
+ content: string;
373
+ type: "tool_result";
374
+ tool_use_id: string;
375
+ cache_control?: {
376
+ type: "ephemeral";
377
+ } | undefined;
378
+ })[];
379
+ role: "user" | "assistant";
380
+ }>, "many">;
381
+ fileContext: z.ZodObject<{
382
+ currentWorkingDirectory: z.ZodString;
383
+ fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
384
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
385
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
386
+ gitChanges: z.ZodObject<{
387
+ status: z.ZodString;
388
+ diff: z.ZodString;
389
+ diffCached: z.ZodString;
390
+ lastCommitMessages: z.ZodString;
391
+ }, "strip", z.ZodTypeAny, {
392
+ status: string;
393
+ diff: string;
394
+ diffCached: string;
395
+ lastCommitMessages: string;
396
+ }, {
397
+ status: string;
398
+ diff: string;
399
+ diffCached: string;
400
+ lastCommitMessages: string;
401
+ }>;
402
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
403
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
404
+ systemInfo: z.ZodObject<{
405
+ platform: z.ZodString;
406
+ shell: z.ZodString;
407
+ nodeVersion: z.ZodString;
408
+ arch: z.ZodString;
409
+ homedir: z.ZodString;
410
+ cpus: z.ZodNumber;
411
+ }, "strip", z.ZodTypeAny, {
412
+ platform: string;
413
+ shell: string;
414
+ nodeVersion: string;
415
+ arch: string;
416
+ homedir: string;
417
+ cpus: number;
418
+ }, {
419
+ platform: string;
420
+ shell: string;
421
+ nodeVersion: string;
422
+ arch: string;
423
+ homedir: string;
424
+ cpus: number;
425
+ }>;
426
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
427
+ path: z.ZodString;
428
+ content: z.ZodString;
429
+ }, "strip", z.ZodTypeAny, {
430
+ path: string;
431
+ content: string;
432
+ }, {
433
+ path: string;
434
+ content: string;
435
+ }>, "many">, "many">;
436
+ }, "strip", z.ZodTypeAny, {
437
+ currentWorkingDirectory: string;
438
+ fileTree: import("./util/file").FileTreeNode[];
439
+ fileTokenScores: Record<string, Record<string, number>>;
440
+ knowledgeFiles: Record<string, string>;
441
+ gitChanges: {
442
+ status: string;
443
+ diff: string;
444
+ diffCached: string;
445
+ lastCommitMessages: string;
446
+ };
447
+ changesSinceLastChat: Record<string, string>;
448
+ shellConfigFiles: Record<string, string>;
449
+ systemInfo: {
450
+ platform: string;
451
+ shell: string;
452
+ nodeVersion: string;
453
+ arch: string;
454
+ homedir: string;
455
+ cpus: number;
456
+ };
457
+ fileVersions: {
458
+ path: string;
459
+ content: string;
460
+ }[][];
461
+ }, {
462
+ currentWorkingDirectory: string;
463
+ fileTree: import("./util/file").FileTreeNode[];
464
+ fileTokenScores: Record<string, Record<string, number>>;
465
+ knowledgeFiles: Record<string, string>;
466
+ gitChanges: {
467
+ status: string;
468
+ diff: string;
469
+ diffCached: string;
470
+ lastCommitMessages: string;
471
+ };
472
+ changesSinceLastChat: Record<string, string>;
473
+ shellConfigFiles: Record<string, string>;
474
+ systemInfo: {
475
+ platform: string;
476
+ shell: string;
477
+ nodeVersion: string;
478
+ arch: string;
479
+ homedir: string;
480
+ cpus: number;
481
+ };
482
+ fileVersions: {
483
+ path: string;
484
+ content: string;
485
+ }[][];
486
+ }>;
487
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
488
+ type: z.ZodEnum<["patch", "file"]>;
489
+ filePath: z.ZodString;
490
+ content: z.ZodString;
491
+ }, "strip", z.ZodTypeAny, {
492
+ content: string;
493
+ type: "file" | "patch";
494
+ filePath: string;
495
+ }, {
496
+ content: string;
497
+ type: "file" | "patch";
498
+ filePath: string;
499
+ }>, "many">;
500
+ costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "pro"]>>>;
501
+ }, "strip", z.ZodTypeAny, {
502
+ type: "user-input";
503
+ fingerprintId: string;
504
+ userInputId: string;
505
+ messages: {
506
+ content: string | ({
507
+ type: "text";
508
+ text: string;
509
+ cache_control?: {
510
+ type: "ephemeral";
511
+ } | undefined;
512
+ } | {
513
+ type: "tool_use";
514
+ name: string;
515
+ id: string;
516
+ input: Record<string, any>;
517
+ cache_control?: {
518
+ type: "ephemeral";
519
+ } | undefined;
520
+ } | {
521
+ content: string;
522
+ type: "tool_result";
523
+ tool_use_id: string;
524
+ cache_control?: {
525
+ type: "ephemeral";
526
+ } | undefined;
527
+ })[];
528
+ role: "user" | "assistant";
529
+ }[];
530
+ fileContext: {
531
+ currentWorkingDirectory: string;
532
+ fileTree: import("./util/file").FileTreeNode[];
533
+ fileTokenScores: Record<string, Record<string, number>>;
534
+ knowledgeFiles: Record<string, string>;
535
+ gitChanges: {
536
+ status: string;
537
+ diff: string;
538
+ diffCached: string;
539
+ lastCommitMessages: string;
540
+ };
541
+ changesSinceLastChat: Record<string, string>;
542
+ shellConfigFiles: Record<string, string>;
543
+ systemInfo: {
544
+ platform: string;
545
+ shell: string;
546
+ nodeVersion: string;
547
+ arch: string;
548
+ homedir: string;
549
+ cpus: number;
550
+ };
551
+ fileVersions: {
552
+ path: string;
553
+ content: string;
554
+ }[][];
555
+ };
556
+ changesAlreadyApplied: {
557
+ content: string;
558
+ type: "file" | "patch";
559
+ filePath: string;
560
+ }[];
561
+ costMode: "lite" | "normal" | "pro";
562
+ authToken?: string | undefined;
563
+ }, {
564
+ type: "user-input";
565
+ fingerprintId: string;
566
+ userInputId: string;
567
+ messages: {
568
+ content: string | ({
569
+ type: "text";
570
+ text: string;
571
+ cache_control?: {
572
+ type: "ephemeral";
573
+ } | undefined;
574
+ } | {
575
+ type: "tool_use";
576
+ name: string;
577
+ id: string;
578
+ input: Record<string, any>;
579
+ cache_control?: {
580
+ type: "ephemeral";
581
+ } | undefined;
582
+ } | {
583
+ content: string;
584
+ type: "tool_result";
585
+ tool_use_id: string;
586
+ cache_control?: {
587
+ type: "ephemeral";
588
+ } | undefined;
589
+ })[];
590
+ role: "user" | "assistant";
591
+ }[];
592
+ fileContext: {
593
+ currentWorkingDirectory: string;
594
+ fileTree: import("./util/file").FileTreeNode[];
595
+ fileTokenScores: Record<string, Record<string, number>>;
596
+ knowledgeFiles: Record<string, string>;
597
+ gitChanges: {
598
+ status: string;
599
+ diff: string;
600
+ diffCached: string;
601
+ lastCommitMessages: string;
602
+ };
603
+ changesSinceLastChat: Record<string, string>;
604
+ shellConfigFiles: Record<string, string>;
605
+ systemInfo: {
606
+ platform: string;
607
+ shell: string;
608
+ nodeVersion: string;
609
+ arch: string;
610
+ homedir: string;
611
+ cpus: number;
612
+ };
613
+ fileVersions: {
614
+ path: string;
615
+ content: string;
616
+ }[][];
617
+ };
618
+ changesAlreadyApplied: {
619
+ content: string;
620
+ type: "file" | "patch";
621
+ filePath: string;
622
+ }[];
623
+ authToken?: string | undefined;
624
+ costMode?: "lite" | "normal" | "pro" | undefined;
625
+ }>, z.ZodObject<{
626
+ type: z.ZodLiteral<"read-files-response">;
627
+ files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
628
+ }, "strip", z.ZodTypeAny, {
629
+ type: "read-files-response";
630
+ files: Record<string, string | null>;
631
+ }, {
632
+ type: "read-files-response";
633
+ files: Record<string, string | null>;
634
+ }>, z.ZodObject<{
635
+ type: z.ZodLiteral<"init">;
636
+ fingerprintId: z.ZodString;
637
+ authToken: z.ZodOptional<z.ZodString>;
638
+ fileContext: z.ZodObject<{
639
+ currentWorkingDirectory: z.ZodString;
640
+ fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
641
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
642
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
643
+ gitChanges: z.ZodObject<{
644
+ status: z.ZodString;
645
+ diff: z.ZodString;
646
+ diffCached: z.ZodString;
647
+ lastCommitMessages: z.ZodString;
648
+ }, "strip", z.ZodTypeAny, {
649
+ status: string;
650
+ diff: string;
651
+ diffCached: string;
652
+ lastCommitMessages: string;
653
+ }, {
654
+ status: string;
655
+ diff: string;
656
+ diffCached: string;
657
+ lastCommitMessages: string;
658
+ }>;
659
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
660
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
661
+ systemInfo: z.ZodObject<{
662
+ platform: z.ZodString;
663
+ shell: z.ZodString;
664
+ nodeVersion: z.ZodString;
665
+ arch: z.ZodString;
666
+ homedir: z.ZodString;
667
+ cpus: z.ZodNumber;
668
+ }, "strip", z.ZodTypeAny, {
669
+ platform: string;
670
+ shell: string;
671
+ nodeVersion: string;
672
+ arch: string;
673
+ homedir: string;
674
+ cpus: number;
675
+ }, {
676
+ platform: string;
677
+ shell: string;
678
+ nodeVersion: string;
679
+ arch: string;
680
+ homedir: string;
681
+ cpus: number;
682
+ }>;
683
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
684
+ path: z.ZodString;
685
+ content: z.ZodString;
686
+ }, "strip", z.ZodTypeAny, {
687
+ path: string;
688
+ content: string;
689
+ }, {
690
+ path: string;
691
+ content: string;
692
+ }>, "many">, "many">;
693
+ }, "strip", z.ZodTypeAny, {
694
+ currentWorkingDirectory: string;
695
+ fileTree: import("./util/file").FileTreeNode[];
696
+ fileTokenScores: Record<string, Record<string, number>>;
697
+ knowledgeFiles: Record<string, string>;
698
+ gitChanges: {
699
+ status: string;
700
+ diff: string;
701
+ diffCached: string;
702
+ lastCommitMessages: string;
703
+ };
704
+ changesSinceLastChat: Record<string, string>;
705
+ shellConfigFiles: Record<string, string>;
706
+ systemInfo: {
707
+ platform: string;
708
+ shell: string;
709
+ nodeVersion: string;
710
+ arch: string;
711
+ homedir: string;
712
+ cpus: number;
713
+ };
714
+ fileVersions: {
715
+ path: string;
716
+ content: string;
717
+ }[][];
718
+ }, {
719
+ currentWorkingDirectory: string;
720
+ fileTree: import("./util/file").FileTreeNode[];
721
+ fileTokenScores: Record<string, Record<string, number>>;
722
+ knowledgeFiles: Record<string, string>;
723
+ gitChanges: {
724
+ status: string;
725
+ diff: string;
726
+ diffCached: string;
727
+ lastCommitMessages: string;
728
+ };
729
+ changesSinceLastChat: Record<string, string>;
730
+ shellConfigFiles: Record<string, string>;
731
+ systemInfo: {
732
+ platform: string;
733
+ shell: string;
734
+ nodeVersion: string;
735
+ arch: string;
736
+ homedir: string;
737
+ cpus: number;
738
+ };
739
+ fileVersions: {
740
+ path: string;
741
+ content: string;
742
+ }[][];
743
+ }>;
744
+ }, "strip", z.ZodTypeAny, {
745
+ type: "init";
746
+ fingerprintId: string;
747
+ fileContext: {
748
+ currentWorkingDirectory: string;
749
+ fileTree: import("./util/file").FileTreeNode[];
750
+ fileTokenScores: Record<string, Record<string, number>>;
751
+ knowledgeFiles: Record<string, string>;
752
+ gitChanges: {
753
+ status: string;
754
+ diff: string;
755
+ diffCached: string;
756
+ lastCommitMessages: string;
757
+ };
758
+ changesSinceLastChat: Record<string, string>;
759
+ shellConfigFiles: Record<string, string>;
760
+ systemInfo: {
761
+ platform: string;
762
+ shell: string;
763
+ nodeVersion: string;
764
+ arch: string;
765
+ homedir: string;
766
+ cpus: number;
767
+ };
768
+ fileVersions: {
769
+ path: string;
770
+ content: string;
771
+ }[][];
772
+ };
773
+ authToken?: string | undefined;
774
+ }, {
775
+ type: "init";
776
+ fingerprintId: string;
777
+ fileContext: {
778
+ currentWorkingDirectory: string;
779
+ fileTree: import("./util/file").FileTreeNode[];
780
+ fileTokenScores: Record<string, Record<string, number>>;
781
+ knowledgeFiles: Record<string, string>;
782
+ gitChanges: {
783
+ status: string;
784
+ diff: string;
785
+ diffCached: string;
786
+ lastCommitMessages: string;
787
+ };
788
+ changesSinceLastChat: Record<string, string>;
789
+ shellConfigFiles: Record<string, string>;
790
+ systemInfo: {
791
+ platform: string;
792
+ shell: string;
793
+ nodeVersion: string;
794
+ arch: string;
795
+ homedir: string;
796
+ cpus: number;
797
+ };
798
+ fileVersions: {
799
+ path: string;
800
+ content: string;
801
+ }[][];
802
+ };
803
+ authToken?: string | undefined;
804
+ }>, z.ZodObject<{
805
+ type: z.ZodLiteral<"usage">;
806
+ fingerprintId: z.ZodString;
807
+ authToken: z.ZodOptional<z.ZodString>;
808
+ }, "strip", z.ZodTypeAny, {
809
+ type: "usage";
810
+ fingerprintId: string;
811
+ authToken?: string | undefined;
812
+ }, {
813
+ type: "usage";
814
+ fingerprintId: string;
815
+ authToken?: string | undefined;
816
+ }>, z.ZodObject<{
817
+ type: z.ZodLiteral<"login-code-request">;
818
+ fingerprintId: z.ZodString;
819
+ referralCode: z.ZodOptional<z.ZodString>;
820
+ }, "strip", z.ZodTypeAny, {
821
+ type: "login-code-request";
822
+ fingerprintId: string;
823
+ referralCode?: string | undefined;
824
+ }, {
825
+ type: "login-code-request";
826
+ fingerprintId: string;
827
+ referralCode?: string | undefined;
828
+ }>, z.ZodObject<{
829
+ type: z.ZodLiteral<"login-status-request">;
830
+ fingerprintId: z.ZodString;
831
+ fingerprintHash: z.ZodString;
832
+ }, "strip", z.ZodTypeAny, {
833
+ type: "login-status-request";
834
+ fingerprintId: string;
835
+ fingerprintHash: string;
836
+ }, {
837
+ type: "login-status-request";
838
+ fingerprintId: string;
839
+ fingerprintHash: string;
840
+ }>, z.ZodObject<{
841
+ type: z.ZodLiteral<"clear-auth-token">;
842
+ authToken: z.ZodString;
843
+ fingerprintId: z.ZodString;
844
+ userId: z.ZodString;
845
+ fingerprintHash: z.ZodString;
846
+ }, "strip", z.ZodTypeAny, {
847
+ type: "clear-auth-token";
848
+ userId: string;
849
+ fingerprintId: string;
850
+ authToken: string;
851
+ fingerprintHash: string;
852
+ }, {
853
+ type: "clear-auth-token";
854
+ userId: string;
855
+ fingerprintId: string;
856
+ authToken: string;
857
+ fingerprintHash: string;
858
+ }>, z.ZodObject<{
859
+ type: z.ZodLiteral<"generate-commit-message">;
860
+ fingerprintId: z.ZodString;
861
+ authToken: z.ZodOptional<z.ZodString>;
862
+ stagedChanges: z.ZodString;
863
+ }, "strip", z.ZodTypeAny, {
864
+ type: "generate-commit-message";
865
+ fingerprintId: string;
866
+ stagedChanges: string;
867
+ authToken?: string | undefined;
868
+ }, {
869
+ type: "generate-commit-message";
870
+ fingerprintId: string;
871
+ stagedChanges: string;
872
+ authToken?: string | undefined;
873
+ }>]>;
874
+ export type ClientAction = z.infer<typeof CLIENT_ACTION_SCHEMA>;
875
+ export declare const UsageReponseSchema: z.ZodObject<{
876
+ type: z.ZodLiteral<"usage-response">;
877
+ usage: z.ZodNumber;
878
+ limit: z.ZodNumber;
879
+ referralLink: z.ZodOptional<z.ZodString>;
880
+ subscription_active: z.ZodBoolean;
881
+ next_quota_reset: z.ZodDate;
882
+ session_credits_used: z.ZodNumber;
883
+ }, "strip", z.ZodTypeAny, {
884
+ type: "usage-response";
885
+ next_quota_reset: Date;
886
+ subscription_active: boolean;
887
+ limit: number;
888
+ session_credits_used: number;
889
+ usage: number;
890
+ referralLink?: string | undefined;
891
+ }, {
892
+ type: "usage-response";
893
+ next_quota_reset: Date;
894
+ subscription_active: boolean;
895
+ limit: number;
896
+ session_credits_used: number;
897
+ usage: number;
898
+ referralLink?: string | undefined;
899
+ }>;
900
+ export type UsageResponse = z.infer<typeof UsageReponseSchema>;
901
+ export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
902
+ type: z.ZodLiteral<"init-response">;
903
+ }, Omit<{
904
+ type: z.ZodLiteral<"usage-response">;
905
+ usage: z.ZodNumber;
906
+ limit: z.ZodNumber;
907
+ referralLink: z.ZodOptional<z.ZodString>;
908
+ subscription_active: z.ZodBoolean;
909
+ next_quota_reset: z.ZodDate;
910
+ session_credits_used: z.ZodNumber;
911
+ }, "type">>, "strip", z.ZodTypeAny, {
912
+ type: "init-response";
913
+ next_quota_reset: Date;
914
+ subscription_active: boolean;
915
+ limit: number;
916
+ session_credits_used: number;
917
+ usage: number;
918
+ referralLink?: string | undefined;
919
+ }, {
920
+ type: "init-response";
921
+ next_quota_reset: Date;
922
+ subscription_active: boolean;
923
+ limit: number;
924
+ session_credits_used: number;
925
+ usage: number;
926
+ referralLink?: string | undefined;
927
+ }>;
928
+ export type InitResponse = z.infer<typeof InitResponseSchema>;
929
+ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShape<{
930
+ type: z.ZodLiteral<"response-complete">;
931
+ userInputId: z.ZodString;
932
+ response: z.ZodString;
933
+ changes: z.ZodArray<z.ZodObject<{
934
+ type: z.ZodEnum<["patch", "file"]>;
935
+ filePath: z.ZodString;
936
+ content: z.ZodString;
937
+ }, "strip", z.ZodTypeAny, {
938
+ content: string;
939
+ type: "file" | "patch";
940
+ filePath: string;
941
+ }, {
942
+ content: string;
943
+ type: "file" | "patch";
944
+ filePath: string;
945
+ }>, "many">;
946
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
947
+ type: z.ZodEnum<["patch", "file"]>;
948
+ filePath: z.ZodString;
949
+ content: z.ZodString;
950
+ }, "strip", z.ZodTypeAny, {
951
+ content: string;
952
+ type: "file" | "patch";
953
+ filePath: string;
954
+ }, {
955
+ content: string;
956
+ type: "file" | "patch";
957
+ filePath: string;
958
+ }>, "many">;
959
+ addedFileVersions: z.ZodArray<z.ZodObject<{
960
+ path: z.ZodString;
961
+ content: z.ZodString;
962
+ }, "strip", z.ZodTypeAny, {
963
+ path: string;
964
+ content: string;
965
+ }, {
966
+ path: string;
967
+ content: string;
968
+ }>, "many">;
969
+ resetFileVersions: z.ZodBoolean;
970
+ }, {
971
+ next_quota_reset: z.ZodOptional<z.ZodDate>;
972
+ subscription_active: z.ZodOptional<z.ZodBoolean>;
973
+ limit: z.ZodOptional<z.ZodNumber>;
974
+ session_credits_used: z.ZodOptional<z.ZodNumber>;
975
+ usage: z.ZodOptional<z.ZodNumber>;
976
+ referralLink: z.ZodOptional<z.ZodOptional<z.ZodString>>;
977
+ }>, "strip", z.ZodTypeAny, {
978
+ type: "response-complete";
979
+ response: string;
980
+ userInputId: string;
981
+ changesAlreadyApplied: {
982
+ content: string;
983
+ type: "file" | "patch";
984
+ filePath: string;
985
+ }[];
986
+ changes: {
987
+ content: string;
988
+ type: "file" | "patch";
989
+ filePath: string;
990
+ }[];
991
+ addedFileVersions: {
992
+ path: string;
993
+ content: string;
994
+ }[];
995
+ resetFileVersions: boolean;
996
+ next_quota_reset?: Date | undefined;
997
+ subscription_active?: boolean | undefined;
998
+ limit?: number | undefined;
999
+ session_credits_used?: number | undefined;
1000
+ usage?: number | undefined;
1001
+ referralLink?: string | undefined;
1002
+ }, {
1003
+ type: "response-complete";
1004
+ response: string;
1005
+ userInputId: string;
1006
+ changesAlreadyApplied: {
1007
+ content: string;
1008
+ type: "file" | "patch";
1009
+ filePath: string;
1010
+ }[];
1011
+ changes: {
1012
+ content: string;
1013
+ type: "file" | "patch";
1014
+ filePath: string;
1015
+ }[];
1016
+ addedFileVersions: {
1017
+ path: string;
1018
+ content: string;
1019
+ }[];
1020
+ resetFileVersions: boolean;
1021
+ next_quota_reset?: Date | undefined;
1022
+ subscription_active?: boolean | undefined;
1023
+ limit?: number | undefined;
1024
+ session_credits_used?: number | undefined;
1025
+ usage?: number | undefined;
1026
+ referralLink?: string | undefined;
1027
+ }>;
1028
+ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1029
+ type: z.ZodLiteral<"response-chunk">;
1030
+ userInputId: z.ZodString;
1031
+ chunk: z.ZodString;
1032
+ }, "strip", z.ZodTypeAny, {
1033
+ type: "response-chunk";
1034
+ userInputId: string;
1035
+ chunk: string;
1036
+ }, {
1037
+ type: "response-chunk";
1038
+ userInputId: string;
1039
+ chunk: string;
1040
+ }>, z.ZodObject<z.objectUtil.extendShape<{
1041
+ type: z.ZodLiteral<"response-complete">;
1042
+ userInputId: z.ZodString;
1043
+ response: z.ZodString;
1044
+ changes: z.ZodArray<z.ZodObject<{
1045
+ type: z.ZodEnum<["patch", "file"]>;
1046
+ filePath: z.ZodString;
1047
+ content: z.ZodString;
1048
+ }, "strip", z.ZodTypeAny, {
1049
+ content: string;
1050
+ type: "file" | "patch";
1051
+ filePath: string;
1052
+ }, {
1053
+ content: string;
1054
+ type: "file" | "patch";
1055
+ filePath: string;
1056
+ }>, "many">;
1057
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1058
+ type: z.ZodEnum<["patch", "file"]>;
1059
+ filePath: z.ZodString;
1060
+ content: z.ZodString;
1061
+ }, "strip", z.ZodTypeAny, {
1062
+ content: string;
1063
+ type: "file" | "patch";
1064
+ filePath: string;
1065
+ }, {
1066
+ content: string;
1067
+ type: "file" | "patch";
1068
+ filePath: string;
1069
+ }>, "many">;
1070
+ addedFileVersions: z.ZodArray<z.ZodObject<{
1071
+ path: z.ZodString;
1072
+ content: z.ZodString;
1073
+ }, "strip", z.ZodTypeAny, {
1074
+ path: string;
1075
+ content: string;
1076
+ }, {
1077
+ path: string;
1078
+ content: string;
1079
+ }>, "many">;
1080
+ resetFileVersions: z.ZodBoolean;
1081
+ }, {
1082
+ next_quota_reset: z.ZodOptional<z.ZodDate>;
1083
+ subscription_active: z.ZodOptional<z.ZodBoolean>;
1084
+ limit: z.ZodOptional<z.ZodNumber>;
1085
+ session_credits_used: z.ZodOptional<z.ZodNumber>;
1086
+ usage: z.ZodOptional<z.ZodNumber>;
1087
+ referralLink: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1088
+ }>, "strip", z.ZodTypeAny, {
1089
+ type: "response-complete";
1090
+ response: string;
1091
+ userInputId: string;
1092
+ changesAlreadyApplied: {
1093
+ content: string;
1094
+ type: "file" | "patch";
1095
+ filePath: string;
1096
+ }[];
1097
+ changes: {
1098
+ content: string;
1099
+ type: "file" | "patch";
1100
+ filePath: string;
1101
+ }[];
1102
+ addedFileVersions: {
1103
+ path: string;
1104
+ content: string;
1105
+ }[];
1106
+ resetFileVersions: boolean;
1107
+ next_quota_reset?: Date | undefined;
1108
+ subscription_active?: boolean | undefined;
1109
+ limit?: number | undefined;
1110
+ session_credits_used?: number | undefined;
1111
+ usage?: number | undefined;
1112
+ referralLink?: string | undefined;
1113
+ }, {
1114
+ type: "response-complete";
1115
+ response: string;
1116
+ userInputId: string;
1117
+ changesAlreadyApplied: {
1118
+ content: string;
1119
+ type: "file" | "patch";
1120
+ filePath: string;
1121
+ }[];
1122
+ changes: {
1123
+ content: string;
1124
+ type: "file" | "patch";
1125
+ filePath: string;
1126
+ }[];
1127
+ addedFileVersions: {
1128
+ path: string;
1129
+ content: string;
1130
+ }[];
1131
+ resetFileVersions: boolean;
1132
+ next_quota_reset?: Date | undefined;
1133
+ subscription_active?: boolean | undefined;
1134
+ limit?: number | undefined;
1135
+ session_credits_used?: number | undefined;
1136
+ usage?: number | undefined;
1137
+ referralLink?: string | undefined;
1138
+ }>, z.ZodObject<{
1139
+ type: z.ZodLiteral<"read-files">;
1140
+ filePaths: z.ZodArray<z.ZodString, "many">;
1141
+ }, "strip", z.ZodTypeAny, {
1142
+ type: "read-files";
1143
+ filePaths: string[];
1144
+ }, {
1145
+ type: "read-files";
1146
+ filePaths: string[];
1147
+ }>, z.ZodObject<{
1148
+ type: z.ZodLiteral<"tool-call">;
1149
+ userInputId: z.ZodString;
1150
+ response: z.ZodString;
1151
+ data: z.ZodObject<{
1152
+ name: z.ZodString;
1153
+ id: z.ZodString;
1154
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
1155
+ }, "strip", z.ZodTypeAny, {
1156
+ name: string;
1157
+ id: string;
1158
+ input: Record<string, any>;
1159
+ }, {
1160
+ name: string;
1161
+ id: string;
1162
+ input: Record<string, any>;
1163
+ }>;
1164
+ changes: z.ZodArray<z.ZodObject<{
1165
+ type: z.ZodEnum<["patch", "file"]>;
1166
+ filePath: z.ZodString;
1167
+ content: z.ZodString;
1168
+ }, "strip", z.ZodTypeAny, {
1169
+ content: string;
1170
+ type: "file" | "patch";
1171
+ filePath: string;
1172
+ }, {
1173
+ content: string;
1174
+ type: "file" | "patch";
1175
+ filePath: string;
1176
+ }>, "many">;
1177
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1178
+ type: z.ZodEnum<["patch", "file"]>;
1179
+ filePath: z.ZodString;
1180
+ content: z.ZodString;
1181
+ }, "strip", z.ZodTypeAny, {
1182
+ content: string;
1183
+ type: "file" | "patch";
1184
+ filePath: string;
1185
+ }, {
1186
+ content: string;
1187
+ type: "file" | "patch";
1188
+ filePath: string;
1189
+ }>, "many">;
1190
+ addedFileVersions: z.ZodArray<z.ZodObject<{
1191
+ path: z.ZodString;
1192
+ content: z.ZodString;
1193
+ }, "strip", z.ZodTypeAny, {
1194
+ path: string;
1195
+ content: string;
1196
+ }, {
1197
+ path: string;
1198
+ content: string;
1199
+ }>, "many">;
1200
+ resetFileVersions: z.ZodBoolean;
1201
+ }, "strip", z.ZodTypeAny, {
1202
+ type: "tool-call";
1203
+ data: {
1204
+ name: string;
1205
+ id: string;
1206
+ input: Record<string, any>;
1207
+ };
1208
+ response: string;
1209
+ userInputId: string;
1210
+ changesAlreadyApplied: {
1211
+ content: string;
1212
+ type: "file" | "patch";
1213
+ filePath: string;
1214
+ }[];
1215
+ changes: {
1216
+ content: string;
1217
+ type: "file" | "patch";
1218
+ filePath: string;
1219
+ }[];
1220
+ addedFileVersions: {
1221
+ path: string;
1222
+ content: string;
1223
+ }[];
1224
+ resetFileVersions: boolean;
1225
+ }, {
1226
+ type: "tool-call";
1227
+ data: {
1228
+ name: string;
1229
+ id: string;
1230
+ input: Record<string, any>;
1231
+ };
1232
+ response: string;
1233
+ userInputId: string;
1234
+ changesAlreadyApplied: {
1235
+ content: string;
1236
+ type: "file" | "patch";
1237
+ filePath: string;
1238
+ }[];
1239
+ changes: {
1240
+ content: string;
1241
+ type: "file" | "patch";
1242
+ filePath: string;
1243
+ }[];
1244
+ addedFileVersions: {
1245
+ path: string;
1246
+ content: string;
1247
+ }[];
1248
+ resetFileVersions: boolean;
1249
+ }>, z.ZodObject<{
1250
+ type: z.ZodLiteral<"terminal-command-result">;
1251
+ userInputId: z.ZodString;
1252
+ result: z.ZodString;
1253
+ }, "strip", z.ZodTypeAny, {
1254
+ type: "terminal-command-result";
1255
+ result: string;
1256
+ userInputId: string;
1257
+ }, {
1258
+ type: "terminal-command-result";
1259
+ result: string;
1260
+ userInputId: string;
1261
+ }>, z.ZodObject<{
1262
+ type: z.ZodLiteral<"npm-version-status">;
1263
+ isUpToDate: z.ZodBoolean;
1264
+ latestVersion: z.ZodString;
1265
+ }, "strip", z.ZodTypeAny, {
1266
+ type: "npm-version-status";
1267
+ isUpToDate: boolean;
1268
+ latestVersion: string;
1269
+ }, {
1270
+ type: "npm-version-status";
1271
+ isUpToDate: boolean;
1272
+ latestVersion: string;
1273
+ }>, z.ZodObject<z.objectUtil.extendShape<{
1274
+ type: z.ZodLiteral<"init-response">;
1275
+ }, Omit<{
1276
+ type: z.ZodLiteral<"usage-response">;
1277
+ usage: z.ZodNumber;
1278
+ limit: z.ZodNumber;
1279
+ referralLink: z.ZodOptional<z.ZodString>;
1280
+ subscription_active: z.ZodBoolean;
1281
+ next_quota_reset: z.ZodDate;
1282
+ session_credits_used: z.ZodNumber;
1283
+ }, "type">>, "strip", z.ZodTypeAny, {
1284
+ type: "init-response";
1285
+ next_quota_reset: Date;
1286
+ subscription_active: boolean;
1287
+ limit: number;
1288
+ session_credits_used: number;
1289
+ usage: number;
1290
+ referralLink?: string | undefined;
1291
+ }, {
1292
+ type: "init-response";
1293
+ next_quota_reset: Date;
1294
+ subscription_active: boolean;
1295
+ limit: number;
1296
+ session_credits_used: number;
1297
+ usage: number;
1298
+ referralLink?: string | undefined;
1299
+ }>, z.ZodObject<{
1300
+ type: z.ZodLiteral<"auth-result">;
1301
+ user: z.ZodOptional<z.ZodObject<{
1302
+ id: z.ZodString;
1303
+ email: z.ZodString;
1304
+ name: z.ZodNullable<z.ZodString>;
1305
+ authToken: z.ZodString;
1306
+ fingerprintId: z.ZodString;
1307
+ fingerprintHash: z.ZodString;
1308
+ }, "strip", z.ZodTypeAny, {
1309
+ email: string;
1310
+ name: string | null;
1311
+ id: string;
1312
+ fingerprintId: string;
1313
+ authToken: string;
1314
+ fingerprintHash: string;
1315
+ }, {
1316
+ email: string;
1317
+ name: string | null;
1318
+ id: string;
1319
+ fingerprintId: string;
1320
+ authToken: string;
1321
+ fingerprintHash: string;
1322
+ }>>;
1323
+ message: z.ZodString;
1324
+ }, "strip", z.ZodTypeAny, {
1325
+ message: string;
1326
+ type: "auth-result";
1327
+ user?: {
1328
+ email: string;
1329
+ name: string | null;
1330
+ id: string;
1331
+ fingerprintId: string;
1332
+ authToken: string;
1333
+ fingerprintHash: string;
1334
+ } | undefined;
1335
+ }, {
1336
+ message: string;
1337
+ type: "auth-result";
1338
+ user?: {
1339
+ email: string;
1340
+ name: string | null;
1341
+ id: string;
1342
+ fingerprintId: string;
1343
+ authToken: string;
1344
+ fingerprintHash: string;
1345
+ } | undefined;
1346
+ }>, z.ZodObject<{
1347
+ type: z.ZodLiteral<"login-code-response">;
1348
+ fingerprintId: z.ZodString;
1349
+ fingerprintHash: z.ZodString;
1350
+ loginUrl: z.ZodString;
1351
+ }, "strip", z.ZodTypeAny, {
1352
+ type: "login-code-response";
1353
+ fingerprintId: string;
1354
+ fingerprintHash: string;
1355
+ loginUrl: string;
1356
+ }, {
1357
+ type: "login-code-response";
1358
+ fingerprintId: string;
1359
+ fingerprintHash: string;
1360
+ loginUrl: string;
1361
+ }>, z.ZodObject<{
1362
+ type: z.ZodLiteral<"usage-response">;
1363
+ usage: z.ZodNumber;
1364
+ limit: z.ZodNumber;
1365
+ referralLink: z.ZodOptional<z.ZodString>;
1366
+ subscription_active: z.ZodBoolean;
1367
+ next_quota_reset: z.ZodDate;
1368
+ session_credits_used: z.ZodNumber;
1369
+ }, "strip", z.ZodTypeAny, {
1370
+ type: "usage-response";
1371
+ next_quota_reset: Date;
1372
+ subscription_active: boolean;
1373
+ limit: number;
1374
+ session_credits_used: number;
1375
+ usage: number;
1376
+ referralLink?: string | undefined;
1377
+ }, {
1378
+ type: "usage-response";
1379
+ next_quota_reset: Date;
1380
+ subscription_active: boolean;
1381
+ limit: number;
1382
+ session_credits_used: number;
1383
+ usage: number;
1384
+ referralLink?: string | undefined;
1385
+ }>, z.ZodObject<{
1386
+ type: z.ZodLiteral<"action-error">;
1387
+ message: z.ZodString;
1388
+ }, "strip", z.ZodTypeAny, {
1389
+ message: string;
1390
+ type: "action-error";
1391
+ }, {
1392
+ message: string;
1393
+ type: "action-error";
1394
+ }>, z.ZodObject<{
1395
+ type: z.ZodLiteral<"commit-message-response">;
1396
+ commitMessage: z.ZodString;
1397
+ }, "strip", z.ZodTypeAny, {
1398
+ type: "commit-message-response";
1399
+ commitMessage: string;
1400
+ }, {
1401
+ type: "commit-message-response";
1402
+ commitMessage: string;
1403
+ }>]>;
1404
+ export type ServerAction = z.infer<typeof SERVER_ACTION_SCHEMA>;
1405
+ export {};