codebuff 1.0.99

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 (153) hide show
  1. package/README.md +70 -0
  2. package/dist/chat-storage.d.ts +29 -0
  3. package/dist/chat-storage.js +125 -0
  4. package/dist/chat-storage.js.map +1 -0
  5. package/dist/cli.d.ts +37 -0
  6. package/dist/cli.js +416 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/client.d.ts +41 -0
  9. package/dist/client.js +443 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/code-map/languages.d.ts +12 -0
  12. package/dist/code-map/languages.js +129 -0
  13. package/dist/code-map/languages.js.map +1 -0
  14. package/dist/code-map/parse.d.ts +11 -0
  15. package/dist/code-map/parse.js +127 -0
  16. package/dist/code-map/parse.js.map +1 -0
  17. package/dist/code-map/test-langs/test.d.ts +11 -0
  18. package/dist/code-map/test-langs/test.js +23 -0
  19. package/dist/code-map/test-langs/test.js.map +1 -0
  20. package/dist/code-map/tree-sitter-queries/readme.md +23 -0
  21. package/dist/code-map/tree-sitter-queries/tree-sitter-c-tags.scm +11 -0
  22. package/dist/code-map/tree-sitter-queries/tree-sitter-c_sharp-tags.scm +13 -0
  23. package/dist/code-map/tree-sitter-queries/tree-sitter-cpp-tags.scm +17 -0
  24. package/dist/code-map/tree-sitter-queries/tree-sitter-go-tags.scm +26 -0
  25. package/dist/code-map/tree-sitter-queries/tree-sitter-java-tags.scm +19 -0
  26. package/dist/code-map/tree-sitter-queries/tree-sitter-javascript-tags.scm +15 -0
  27. package/dist/code-map/tree-sitter-queries/tree-sitter-php-tags.scm +26 -0
  28. package/dist/code-map/tree-sitter-queries/tree-sitter-python-tags.scm +9 -0
  29. package/dist/code-map/tree-sitter-queries/tree-sitter-ruby-tags.scm +58 -0
  30. package/dist/code-map/tree-sitter-queries/tree-sitter-rust-tags.scm +26 -0
  31. package/dist/code-map/tree-sitter-queries/tree-sitter-typescript-tags.scm +15 -0
  32. package/dist/code-map/tsconfig.tsbuildinfo +1 -0
  33. package/dist/common/actions.d.ts +1062 -0
  34. package/dist/common/actions.js +180 -0
  35. package/dist/common/actions.js.map +1 -0
  36. package/dist/common/billing/quota-manager.d.ts +59 -0
  37. package/dist/common/billing/quota-manager.js +200 -0
  38. package/dist/common/billing/quota-manager.js.map +1 -0
  39. package/dist/common/constants.d.ts +24 -0
  40. package/dist/common/constants.js +73 -0
  41. package/dist/common/constants.js.map +1 -0
  42. package/dist/common/db/drizzle.config.d.ts +2 -0
  43. package/dist/common/db/drizzle.config.js +17 -0
  44. package/dist/common/db/drizzle.config.js.map +1 -0
  45. package/dist/common/db/env.d.mts +1 -0
  46. package/dist/common/db/env.mjs +26 -0
  47. package/dist/common/db/env.mjs.map +1 -0
  48. package/dist/common/db/index.d.ts +6 -0
  49. package/dist/common/db/index.js +35 -0
  50. package/dist/common/db/index.js.map +1 -0
  51. package/dist/common/db/schema.d.ts +994 -0
  52. package/dist/common/db/schema.js +113 -0
  53. package/dist/common/db/schema.js.map +1 -0
  54. package/dist/common/env.d.mts +1 -0
  55. package/dist/common/env.mjs +34 -0
  56. package/dist/common/env.mjs.map +1 -0
  57. package/dist/common/project-file-tree.d.ts +9 -0
  58. package/dist/common/project-file-tree.js +157 -0
  59. package/dist/common/project-file-tree.js.map +1 -0
  60. package/dist/common/types/referral.d.ts +2 -0
  61. package/dist/common/types/referral.js +5 -0
  62. package/dist/common/types/referral.js.map +1 -0
  63. package/dist/common/types/usage.d.ts +21 -0
  64. package/dist/common/types/usage.js +12 -0
  65. package/dist/common/types/usage.js.map +1 -0
  66. package/dist/common/util/__tests__/string.test.d.ts +1 -0
  67. package/dist/common/util/__tests__/string.test.js +83 -0
  68. package/dist/common/util/__tests__/string.test.js.map +1 -0
  69. package/dist/common/util/array.d.ts +6 -0
  70. package/dist/common/util/array.js +32 -0
  71. package/dist/common/util/array.js.map +1 -0
  72. package/dist/common/util/changes.d.ts +6 -0
  73. package/dist/common/util/changes.js +72 -0
  74. package/dist/common/util/changes.js.map +1 -0
  75. package/dist/common/util/credentials.d.ts +25 -0
  76. package/dist/common/util/credentials.js +24 -0
  77. package/dist/common/util/credentials.js.map +1 -0
  78. package/dist/common/util/dates.d.ts +1 -0
  79. package/dist/common/util/dates.js +13 -0
  80. package/dist/common/util/dates.js.map +1 -0
  81. package/dist/common/util/file.d.ts +106 -0
  82. package/dist/common/util/file.js +138 -0
  83. package/dist/common/util/file.js.map +1 -0
  84. package/dist/common/util/git.d.ts +4 -0
  85. package/dist/common/util/git.js +40 -0
  86. package/dist/common/util/git.js.map +1 -0
  87. package/dist/common/util/helpers.d.ts +1 -0
  88. package/dist/common/util/helpers.js +6 -0
  89. package/dist/common/util/helpers.js.map +1 -0
  90. package/dist/common/util/object.d.ts +18 -0
  91. package/dist/common/util/object.js +91 -0
  92. package/dist/common/util/object.js.map +1 -0
  93. package/dist/common/util/patch.d.ts +1 -0
  94. package/dist/common/util/patch.js +215 -0
  95. package/dist/common/util/patch.js.map +1 -0
  96. package/dist/common/util/promise.d.ts +1 -0
  97. package/dist/common/util/promise.js +33 -0
  98. package/dist/common/util/promise.js.map +1 -0
  99. package/dist/common/util/referral.d.ts +1 -0
  100. package/dist/common/util/referral.js +6 -0
  101. package/dist/common/util/referral.js.map +1 -0
  102. package/dist/common/util/server/referral.d.ts +14 -0
  103. package/dist/common/util/server/referral.js +85 -0
  104. package/dist/common/util/server/referral.js.map +1 -0
  105. package/dist/common/util/string.d.ts +3 -0
  106. package/dist/common/util/string.js +60 -0
  107. package/dist/common/util/string.js.map +1 -0
  108. package/dist/common/util/stripe.d.ts +2 -0
  109. package/dist/common/util/stripe.js +19 -0
  110. package/dist/common/util/stripe.js.map +1 -0
  111. package/dist/common/util/tools.d.ts +2 -0
  112. package/dist/common/util/tools.js +13 -0
  113. package/dist/common/util/tools.js.map +1 -0
  114. package/dist/common/websockets/websocket-client.d.ts +40 -0
  115. package/dist/common/websockets/websocket-client.js +187 -0
  116. package/dist/common/websockets/websocket-client.js.map +1 -0
  117. package/dist/common/websockets/websocket-schema.d.ts +2530 -0
  118. package/dist/common/websockets/websocket-schema.js +55 -0
  119. package/dist/common/websockets/websocket-schema.js.map +1 -0
  120. package/dist/config.d.ts +2 -0
  121. package/dist/config.js +8 -0
  122. package/dist/config.js.map +1 -0
  123. package/dist/credentials.d.ts +3 -0
  124. package/dist/credentials.js +33 -0
  125. package/dist/credentials.js.map +1 -0
  126. package/dist/fingerprint.d.ts +1 -0
  127. package/dist/fingerprint.js +43 -0
  128. package/dist/fingerprint.js.map +1 -0
  129. package/dist/index.d.ts +2 -0
  130. package/dist/index.js +50 -0
  131. package/dist/index.js.map +1 -0
  132. package/dist/manifold-api.d.ts +8 -0
  133. package/dist/manifold-api.js +32 -0
  134. package/dist/manifold-api.js.map +1 -0
  135. package/dist/menu.d.ts +1 -0
  136. package/dist/menu.js +92 -0
  137. package/dist/menu.js.map +1 -0
  138. package/dist/project-files.d.ts +48 -0
  139. package/dist/project-files.js +324 -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 +131 -0
  143. package/dist/tool-handlers.js.map +1 -0
  144. package/dist/update-manicode.d.ts +1 -0
  145. package/dist/update-manicode.js +151 -0
  146. package/dist/update-manicode.js.map +1 -0
  147. package/dist/web-scraper.d.ts +3 -0
  148. package/dist/web-scraper.js +79 -0
  149. package/dist/web-scraper.js.map +1 -0
  150. package/dist/worker-script-project-context.d.ts +1 -0
  151. package/dist/worker-script-project-context.js +13 -0
  152. package/dist/worker-script-project-context.js.map +1 -0
  153. package/package.json +62 -0
@@ -0,0 +1,1062 @@
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
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
405
+ path: z.ZodString;
406
+ content: z.ZodString;
407
+ }, "strip", z.ZodTypeAny, {
408
+ path: string;
409
+ content: string;
410
+ }, {
411
+ path: string;
412
+ content: string;
413
+ }>, "many">, "many">;
414
+ }, "strip", z.ZodTypeAny, {
415
+ currentWorkingDirectory: string;
416
+ fileTree: import("./util/file").FileTreeNode[];
417
+ fileTokenScores: Record<string, Record<string, number>>;
418
+ knowledgeFiles: Record<string, string>;
419
+ gitChanges: {
420
+ status: string;
421
+ diff: string;
422
+ diffCached: string;
423
+ lastCommitMessages: string;
424
+ };
425
+ changesSinceLastChat: Record<string, string>;
426
+ shellConfigFiles: Record<string, string>;
427
+ fileVersions: {
428
+ path: string;
429
+ content: string;
430
+ }[][];
431
+ }, {
432
+ currentWorkingDirectory: string;
433
+ fileTree: import("./util/file").FileTreeNode[];
434
+ fileTokenScores: Record<string, Record<string, number>>;
435
+ knowledgeFiles: Record<string, string>;
436
+ gitChanges: {
437
+ status: string;
438
+ diff: string;
439
+ diffCached: string;
440
+ lastCommitMessages: string;
441
+ };
442
+ changesSinceLastChat: Record<string, string>;
443
+ shellConfigFiles: Record<string, string>;
444
+ fileVersions: {
445
+ path: string;
446
+ content: string;
447
+ }[][];
448
+ }>;
449
+ previousChanges: z.ZodArray<z.ZodObject<{
450
+ type: z.ZodEnum<["patch", "file"]>;
451
+ filePath: z.ZodString;
452
+ content: z.ZodString;
453
+ }, "strip", z.ZodTypeAny, {
454
+ content: string;
455
+ type: "file" | "patch";
456
+ filePath: string;
457
+ }, {
458
+ content: string;
459
+ type: "file" | "patch";
460
+ filePath: string;
461
+ }>, "many">;
462
+ }, "strip", z.ZodTypeAny, {
463
+ type: "user-input";
464
+ fingerprintId: string;
465
+ userInputId: string;
466
+ messages: {
467
+ content: string | ({
468
+ type: "text";
469
+ text: string;
470
+ cache_control?: {
471
+ type: "ephemeral";
472
+ } | undefined;
473
+ } | {
474
+ type: "tool_use";
475
+ name: string;
476
+ id: string;
477
+ input: Record<string, any>;
478
+ cache_control?: {
479
+ type: "ephemeral";
480
+ } | undefined;
481
+ } | {
482
+ content: string;
483
+ type: "tool_result";
484
+ tool_use_id: string;
485
+ cache_control?: {
486
+ type: "ephemeral";
487
+ } | undefined;
488
+ })[];
489
+ role: "user" | "assistant";
490
+ }[];
491
+ fileContext: {
492
+ currentWorkingDirectory: string;
493
+ fileTree: import("./util/file").FileTreeNode[];
494
+ fileTokenScores: Record<string, Record<string, number>>;
495
+ knowledgeFiles: Record<string, string>;
496
+ gitChanges: {
497
+ status: string;
498
+ diff: string;
499
+ diffCached: string;
500
+ lastCommitMessages: string;
501
+ };
502
+ changesSinceLastChat: Record<string, string>;
503
+ shellConfigFiles: Record<string, string>;
504
+ fileVersions: {
505
+ path: string;
506
+ content: string;
507
+ }[][];
508
+ };
509
+ previousChanges: {
510
+ content: string;
511
+ type: "file" | "patch";
512
+ filePath: string;
513
+ }[];
514
+ authToken?: string | undefined;
515
+ }, {
516
+ type: "user-input";
517
+ fingerprintId: string;
518
+ userInputId: string;
519
+ messages: {
520
+ content: string | ({
521
+ type: "text";
522
+ text: string;
523
+ cache_control?: {
524
+ type: "ephemeral";
525
+ } | undefined;
526
+ } | {
527
+ type: "tool_use";
528
+ name: string;
529
+ id: string;
530
+ input: Record<string, any>;
531
+ cache_control?: {
532
+ type: "ephemeral";
533
+ } | undefined;
534
+ } | {
535
+ content: string;
536
+ type: "tool_result";
537
+ tool_use_id: string;
538
+ cache_control?: {
539
+ type: "ephemeral";
540
+ } | undefined;
541
+ })[];
542
+ role: "user" | "assistant";
543
+ }[];
544
+ fileContext: {
545
+ currentWorkingDirectory: string;
546
+ fileTree: import("./util/file").FileTreeNode[];
547
+ fileTokenScores: Record<string, Record<string, number>>;
548
+ knowledgeFiles: Record<string, string>;
549
+ gitChanges: {
550
+ status: string;
551
+ diff: string;
552
+ diffCached: string;
553
+ lastCommitMessages: string;
554
+ };
555
+ changesSinceLastChat: Record<string, string>;
556
+ shellConfigFiles: Record<string, string>;
557
+ fileVersions: {
558
+ path: string;
559
+ content: string;
560
+ }[][];
561
+ };
562
+ previousChanges: {
563
+ content: string;
564
+ type: "file" | "patch";
565
+ filePath: string;
566
+ }[];
567
+ authToken?: string | undefined;
568
+ }>, z.ZodObject<{
569
+ type: z.ZodLiteral<"read-files-response">;
570
+ files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
571
+ }, "strip", z.ZodTypeAny, {
572
+ type: "read-files-response";
573
+ files: Record<string, string | null>;
574
+ }, {
575
+ type: "read-files-response";
576
+ files: Record<string, string | null>;
577
+ }>, z.ZodObject<{
578
+ type: z.ZodLiteral<"init">;
579
+ fingerprintId: z.ZodString;
580
+ authToken: z.ZodOptional<z.ZodString>;
581
+ fileContext: z.ZodObject<{
582
+ currentWorkingDirectory: z.ZodString;
583
+ fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
584
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
585
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
586
+ gitChanges: z.ZodObject<{
587
+ status: z.ZodString;
588
+ diff: z.ZodString;
589
+ diffCached: z.ZodString;
590
+ lastCommitMessages: z.ZodString;
591
+ }, "strip", z.ZodTypeAny, {
592
+ status: string;
593
+ diff: string;
594
+ diffCached: string;
595
+ lastCommitMessages: string;
596
+ }, {
597
+ status: string;
598
+ diff: string;
599
+ diffCached: string;
600
+ lastCommitMessages: string;
601
+ }>;
602
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
603
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
604
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
605
+ path: z.ZodString;
606
+ content: z.ZodString;
607
+ }, "strip", z.ZodTypeAny, {
608
+ path: string;
609
+ content: string;
610
+ }, {
611
+ path: string;
612
+ content: string;
613
+ }>, "many">, "many">;
614
+ }, "strip", z.ZodTypeAny, {
615
+ currentWorkingDirectory: string;
616
+ fileTree: import("./util/file").FileTreeNode[];
617
+ fileTokenScores: Record<string, Record<string, number>>;
618
+ knowledgeFiles: Record<string, string>;
619
+ gitChanges: {
620
+ status: string;
621
+ diff: string;
622
+ diffCached: string;
623
+ lastCommitMessages: string;
624
+ };
625
+ changesSinceLastChat: Record<string, string>;
626
+ shellConfigFiles: Record<string, string>;
627
+ fileVersions: {
628
+ path: string;
629
+ content: string;
630
+ }[][];
631
+ }, {
632
+ currentWorkingDirectory: string;
633
+ fileTree: import("./util/file").FileTreeNode[];
634
+ fileTokenScores: Record<string, Record<string, number>>;
635
+ knowledgeFiles: Record<string, string>;
636
+ gitChanges: {
637
+ status: string;
638
+ diff: string;
639
+ diffCached: string;
640
+ lastCommitMessages: string;
641
+ };
642
+ changesSinceLastChat: Record<string, string>;
643
+ shellConfigFiles: Record<string, string>;
644
+ fileVersions: {
645
+ path: string;
646
+ content: string;
647
+ }[][];
648
+ }>;
649
+ }, "strip", z.ZodTypeAny, {
650
+ type: "init";
651
+ fingerprintId: string;
652
+ fileContext: {
653
+ currentWorkingDirectory: string;
654
+ fileTree: import("./util/file").FileTreeNode[];
655
+ fileTokenScores: Record<string, Record<string, number>>;
656
+ knowledgeFiles: Record<string, string>;
657
+ gitChanges: {
658
+ status: string;
659
+ diff: string;
660
+ diffCached: string;
661
+ lastCommitMessages: string;
662
+ };
663
+ changesSinceLastChat: Record<string, string>;
664
+ shellConfigFiles: Record<string, string>;
665
+ fileVersions: {
666
+ path: string;
667
+ content: string;
668
+ }[][];
669
+ };
670
+ authToken?: string | undefined;
671
+ }, {
672
+ type: "init";
673
+ fingerprintId: string;
674
+ fileContext: {
675
+ currentWorkingDirectory: string;
676
+ fileTree: import("./util/file").FileTreeNode[];
677
+ fileTokenScores: Record<string, Record<string, number>>;
678
+ knowledgeFiles: Record<string, string>;
679
+ gitChanges: {
680
+ status: string;
681
+ diff: string;
682
+ diffCached: string;
683
+ lastCommitMessages: string;
684
+ };
685
+ changesSinceLastChat: Record<string, string>;
686
+ shellConfigFiles: Record<string, string>;
687
+ fileVersions: {
688
+ path: string;
689
+ content: string;
690
+ }[][];
691
+ };
692
+ authToken?: string | undefined;
693
+ }>, z.ZodObject<{
694
+ type: z.ZodLiteral<"usage">;
695
+ fingerprintId: z.ZodString;
696
+ authToken: z.ZodOptional<z.ZodString>;
697
+ }, "strip", z.ZodTypeAny, {
698
+ type: "usage";
699
+ fingerprintId: string;
700
+ authToken?: string | undefined;
701
+ }, {
702
+ type: "usage";
703
+ fingerprintId: string;
704
+ authToken?: string | undefined;
705
+ }>, z.ZodObject<{
706
+ type: z.ZodLiteral<"login-code-request">;
707
+ fingerprintId: z.ZodString;
708
+ referralCode: z.ZodOptional<z.ZodString>;
709
+ }, "strip", z.ZodTypeAny, {
710
+ type: "login-code-request";
711
+ fingerprintId: string;
712
+ referralCode?: string | undefined;
713
+ }, {
714
+ type: "login-code-request";
715
+ fingerprintId: string;
716
+ referralCode?: string | undefined;
717
+ }>, z.ZodObject<{
718
+ type: z.ZodLiteral<"login-status-request">;
719
+ fingerprintId: z.ZodString;
720
+ fingerprintHash: z.ZodString;
721
+ }, "strip", z.ZodTypeAny, {
722
+ type: "login-status-request";
723
+ fingerprintId: string;
724
+ fingerprintHash: string;
725
+ }, {
726
+ type: "login-status-request";
727
+ fingerprintId: string;
728
+ fingerprintHash: string;
729
+ }>, z.ZodObject<{
730
+ type: z.ZodLiteral<"clear-auth-token">;
731
+ authToken: z.ZodString;
732
+ fingerprintId: z.ZodString;
733
+ userId: z.ZodString;
734
+ fingerprintHash: z.ZodString;
735
+ }, "strip", z.ZodTypeAny, {
736
+ type: "clear-auth-token";
737
+ authToken: string;
738
+ fingerprintId: string;
739
+ fingerprintHash: string;
740
+ userId: string;
741
+ }, {
742
+ type: "clear-auth-token";
743
+ authToken: string;
744
+ fingerprintId: string;
745
+ fingerprintHash: string;
746
+ userId: string;
747
+ }>, z.ZodObject<{
748
+ type: z.ZodLiteral<"generate-commit-message">;
749
+ fingerprintId: z.ZodString;
750
+ authToken: z.ZodOptional<z.ZodString>;
751
+ stagedChanges: z.ZodString;
752
+ }, "strip", z.ZodTypeAny, {
753
+ type: "generate-commit-message";
754
+ fingerprintId: string;
755
+ stagedChanges: string;
756
+ authToken?: string | undefined;
757
+ }, {
758
+ type: "generate-commit-message";
759
+ fingerprintId: string;
760
+ stagedChanges: string;
761
+ authToken?: string | undefined;
762
+ }>]>;
763
+ export type ClientAction = z.infer<typeof CLIENT_ACTION_SCHEMA>;
764
+ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
765
+ type: z.ZodLiteral<"response-chunk">;
766
+ userInputId: z.ZodString;
767
+ chunk: z.ZodString;
768
+ }, "strip", z.ZodTypeAny, {
769
+ type: "response-chunk";
770
+ userInputId: string;
771
+ chunk: string;
772
+ }, {
773
+ type: "response-chunk";
774
+ userInputId: string;
775
+ chunk: string;
776
+ }>, z.ZodObject<{
777
+ type: z.ZodLiteral<"response-complete">;
778
+ userInputId: z.ZodString;
779
+ response: z.ZodString;
780
+ changes: z.ZodArray<z.ZodObject<{
781
+ type: z.ZodEnum<["patch", "file"]>;
782
+ filePath: z.ZodString;
783
+ content: z.ZodString;
784
+ }, "strip", z.ZodTypeAny, {
785
+ content: string;
786
+ type: "file" | "patch";
787
+ filePath: string;
788
+ }, {
789
+ content: string;
790
+ type: "file" | "patch";
791
+ filePath: string;
792
+ }>, "many">;
793
+ addedFileVersions: z.ZodArray<z.ZodObject<{
794
+ path: z.ZodString;
795
+ content: z.ZodString;
796
+ }, "strip", z.ZodTypeAny, {
797
+ path: string;
798
+ content: string;
799
+ }, {
800
+ path: string;
801
+ content: string;
802
+ }>, "many">;
803
+ resetFileVersions: z.ZodBoolean;
804
+ usage: z.ZodOptional<z.ZodNumber>;
805
+ limit: z.ZodOptional<z.ZodNumber>;
806
+ subscription_active: z.ZodOptional<z.ZodBoolean>;
807
+ referralLink: z.ZodOptional<z.ZodString>;
808
+ }, "strip", z.ZodTypeAny, {
809
+ type: "response-complete";
810
+ userInputId: string;
811
+ response: string;
812
+ changes: {
813
+ content: string;
814
+ type: "file" | "patch";
815
+ filePath: string;
816
+ }[];
817
+ addedFileVersions: {
818
+ path: string;
819
+ content: string;
820
+ }[];
821
+ resetFileVersions: boolean;
822
+ usage?: number | undefined;
823
+ limit?: number | undefined;
824
+ subscription_active?: boolean | undefined;
825
+ referralLink?: string | undefined;
826
+ }, {
827
+ type: "response-complete";
828
+ userInputId: string;
829
+ response: string;
830
+ changes: {
831
+ content: string;
832
+ type: "file" | "patch";
833
+ filePath: string;
834
+ }[];
835
+ addedFileVersions: {
836
+ path: string;
837
+ content: string;
838
+ }[];
839
+ resetFileVersions: boolean;
840
+ usage?: number | undefined;
841
+ limit?: number | undefined;
842
+ subscription_active?: boolean | undefined;
843
+ referralLink?: string | undefined;
844
+ }>, z.ZodObject<{
845
+ type: z.ZodLiteral<"read-files">;
846
+ filePaths: z.ZodArray<z.ZodString, "many">;
847
+ }, "strip", z.ZodTypeAny, {
848
+ type: "read-files";
849
+ filePaths: string[];
850
+ }, {
851
+ type: "read-files";
852
+ filePaths: string[];
853
+ }>, z.ZodObject<{
854
+ type: z.ZodLiteral<"tool-call">;
855
+ userInputId: z.ZodString;
856
+ response: z.ZodString;
857
+ data: z.ZodObject<{
858
+ name: z.ZodString;
859
+ id: z.ZodString;
860
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
861
+ }, "strip", z.ZodTypeAny, {
862
+ name: string;
863
+ id: string;
864
+ input: Record<string, any>;
865
+ }, {
866
+ name: string;
867
+ id: string;
868
+ input: Record<string, any>;
869
+ }>;
870
+ changes: z.ZodArray<z.ZodObject<{
871
+ type: z.ZodEnum<["patch", "file"]>;
872
+ filePath: z.ZodString;
873
+ content: z.ZodString;
874
+ }, "strip", z.ZodTypeAny, {
875
+ content: string;
876
+ type: "file" | "patch";
877
+ filePath: string;
878
+ }, {
879
+ content: string;
880
+ type: "file" | "patch";
881
+ filePath: string;
882
+ }>, "many">;
883
+ addedFileVersions: z.ZodArray<z.ZodObject<{
884
+ path: z.ZodString;
885
+ content: z.ZodString;
886
+ }, "strip", z.ZodTypeAny, {
887
+ path: string;
888
+ content: string;
889
+ }, {
890
+ path: string;
891
+ content: string;
892
+ }>, "many">;
893
+ resetFileVersions: z.ZodBoolean;
894
+ }, "strip", z.ZodTypeAny, {
895
+ type: "tool-call";
896
+ userInputId: string;
897
+ response: string;
898
+ changes: {
899
+ content: string;
900
+ type: "file" | "patch";
901
+ filePath: string;
902
+ }[];
903
+ addedFileVersions: {
904
+ path: string;
905
+ content: string;
906
+ }[];
907
+ resetFileVersions: boolean;
908
+ data: {
909
+ name: string;
910
+ id: string;
911
+ input: Record<string, any>;
912
+ };
913
+ }, {
914
+ type: "tool-call";
915
+ userInputId: string;
916
+ response: string;
917
+ changes: {
918
+ content: string;
919
+ type: "file" | "patch";
920
+ filePath: string;
921
+ }[];
922
+ addedFileVersions: {
923
+ path: string;
924
+ content: string;
925
+ }[];
926
+ resetFileVersions: boolean;
927
+ data: {
928
+ name: string;
929
+ id: string;
930
+ input: Record<string, any>;
931
+ };
932
+ }>, z.ZodObject<{
933
+ type: z.ZodLiteral<"terminal-command-result">;
934
+ userInputId: z.ZodString;
935
+ result: z.ZodString;
936
+ }, "strip", z.ZodTypeAny, {
937
+ type: "terminal-command-result";
938
+ userInputId: string;
939
+ result: string;
940
+ }, {
941
+ type: "terminal-command-result";
942
+ userInputId: string;
943
+ result: string;
944
+ }>, z.ZodObject<{
945
+ type: z.ZodLiteral<"npm-version-status">;
946
+ isUpToDate: z.ZodBoolean;
947
+ latestVersion: z.ZodString;
948
+ }, "strip", z.ZodTypeAny, {
949
+ type: "npm-version-status";
950
+ isUpToDate: boolean;
951
+ latestVersion: string;
952
+ }, {
953
+ type: "npm-version-status";
954
+ isUpToDate: boolean;
955
+ latestVersion: string;
956
+ }>, z.ZodObject<{
957
+ type: z.ZodLiteral<"init-response">;
958
+ }, "strip", z.ZodTypeAny, {
959
+ type: "init-response";
960
+ }, {
961
+ type: "init-response";
962
+ }>, z.ZodObject<{
963
+ type: z.ZodLiteral<"auth-result">;
964
+ user: z.ZodOptional<z.ZodObject<{
965
+ id: z.ZodString;
966
+ email: z.ZodString;
967
+ name: z.ZodNullable<z.ZodString>;
968
+ authToken: z.ZodString;
969
+ fingerprintId: z.ZodString;
970
+ fingerprintHash: z.ZodString;
971
+ }, "strip", z.ZodTypeAny, {
972
+ email: string;
973
+ name: string | null;
974
+ id: string;
975
+ authToken: string;
976
+ fingerprintId: string;
977
+ fingerprintHash: string;
978
+ }, {
979
+ email: string;
980
+ name: string | null;
981
+ id: string;
982
+ authToken: string;
983
+ fingerprintId: string;
984
+ fingerprintHash: string;
985
+ }>>;
986
+ message: z.ZodString;
987
+ }, "strip", z.ZodTypeAny, {
988
+ message: string;
989
+ type: "auth-result";
990
+ user?: {
991
+ email: string;
992
+ name: string | null;
993
+ id: string;
994
+ authToken: string;
995
+ fingerprintId: string;
996
+ fingerprintHash: string;
997
+ } | undefined;
998
+ }, {
999
+ message: string;
1000
+ type: "auth-result";
1001
+ user?: {
1002
+ email: string;
1003
+ name: string | null;
1004
+ id: string;
1005
+ authToken: string;
1006
+ fingerprintId: string;
1007
+ fingerprintHash: string;
1008
+ } | undefined;
1009
+ }>, z.ZodObject<{
1010
+ type: z.ZodLiteral<"login-code-response">;
1011
+ fingerprintId: z.ZodString;
1012
+ fingerprintHash: z.ZodString;
1013
+ loginUrl: z.ZodString;
1014
+ }, "strip", z.ZodTypeAny, {
1015
+ type: "login-code-response";
1016
+ fingerprintId: string;
1017
+ fingerprintHash: string;
1018
+ loginUrl: string;
1019
+ }, {
1020
+ type: "login-code-response";
1021
+ fingerprintId: string;
1022
+ fingerprintHash: string;
1023
+ loginUrl: string;
1024
+ }>, z.ZodObject<{
1025
+ type: z.ZodLiteral<"usage-response">;
1026
+ usage: z.ZodNumber;
1027
+ limit: z.ZodNumber;
1028
+ referralLink: z.ZodOptional<z.ZodString>;
1029
+ subscription_active: z.ZodBoolean;
1030
+ }, "strip", z.ZodTypeAny, {
1031
+ type: "usage-response";
1032
+ usage: number;
1033
+ limit: number;
1034
+ subscription_active: boolean;
1035
+ referralLink?: string | undefined;
1036
+ }, {
1037
+ type: "usage-response";
1038
+ usage: number;
1039
+ limit: number;
1040
+ subscription_active: boolean;
1041
+ referralLink?: string | undefined;
1042
+ }>, z.ZodObject<{
1043
+ type: z.ZodLiteral<"action-error">;
1044
+ message: z.ZodString;
1045
+ }, "strip", z.ZodTypeAny, {
1046
+ message: string;
1047
+ type: "action-error";
1048
+ }, {
1049
+ message: string;
1050
+ type: "action-error";
1051
+ }>, z.ZodObject<{
1052
+ type: z.ZodLiteral<"commit-message-response">;
1053
+ commitMessage: z.ZodString;
1054
+ }, "strip", z.ZodTypeAny, {
1055
+ type: "commit-message-response";
1056
+ commitMessage: string;
1057
+ }, {
1058
+ type: "commit-message-response";
1059
+ commitMessage: string;
1060
+ }>]>;
1061
+ export type ServerAction = z.infer<typeof SERVER_ACTION_SCHEMA>;
1062
+ export {};