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,3058 @@
1
+ import { z } from 'zod';
2
+ export declare const CLIENT_MESSAGE_SCHEMAS: {
3
+ readonly identify: z.ZodObject<{
4
+ type: z.ZodLiteral<"identify">;
5
+ txid: z.ZodNumber;
6
+ clientSessionId: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ type: "identify";
9
+ txid: number;
10
+ clientSessionId: string;
11
+ }, {
12
+ type: "identify";
13
+ txid: number;
14
+ clientSessionId: string;
15
+ }>;
16
+ readonly subscribe: z.ZodObject<{
17
+ type: z.ZodLiteral<"subscribe">;
18
+ txid: z.ZodNumber;
19
+ topics: z.ZodArray<z.ZodString, "many">;
20
+ }, "strip", z.ZodTypeAny, {
21
+ type: "subscribe";
22
+ txid: number;
23
+ topics: string[];
24
+ }, {
25
+ type: "subscribe";
26
+ txid: number;
27
+ topics: string[];
28
+ }>;
29
+ readonly unsubscribe: z.ZodObject<{
30
+ type: z.ZodLiteral<"unsubscribe">;
31
+ txid: z.ZodNumber;
32
+ topics: z.ZodArray<z.ZodString, "many">;
33
+ }, "strip", z.ZodTypeAny, {
34
+ type: "unsubscribe";
35
+ txid: number;
36
+ topics: string[];
37
+ }, {
38
+ type: "unsubscribe";
39
+ txid: number;
40
+ topics: string[];
41
+ }>;
42
+ readonly ping: z.ZodObject<{
43
+ type: z.ZodLiteral<"ping">;
44
+ txid: z.ZodNumber;
45
+ }, "strip", z.ZodTypeAny, {
46
+ type: "ping";
47
+ txid: number;
48
+ }, {
49
+ type: "ping";
50
+ txid: number;
51
+ }>;
52
+ readonly action: z.ZodObject<{
53
+ type: z.ZodLiteral<"action">;
54
+ txid: z.ZodNumber;
55
+ data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
56
+ type: z.ZodLiteral<"user-input">;
57
+ fingerprintId: z.ZodString;
58
+ authToken: z.ZodOptional<z.ZodString>;
59
+ userInputId: z.ZodString;
60
+ messages: z.ZodArray<z.ZodObject<{
61
+ role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
62
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
63
+ type: z.ZodLiteral<"text">;
64
+ text: z.ZodString;
65
+ cache_control: z.ZodOptional<z.ZodObject<{
66
+ type: z.ZodLiteral<"ephemeral">;
67
+ }, "strip", z.ZodTypeAny, {
68
+ type: "ephemeral";
69
+ }, {
70
+ type: "ephemeral";
71
+ }>>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ type: "text";
74
+ text: string;
75
+ cache_control?: {
76
+ type: "ephemeral";
77
+ } | undefined;
78
+ }, {
79
+ type: "text";
80
+ text: string;
81
+ cache_control?: {
82
+ type: "ephemeral";
83
+ } | undefined;
84
+ }>, z.ZodObject<{
85
+ type: z.ZodLiteral<"tool_use">;
86
+ id: z.ZodString;
87
+ name: z.ZodString;
88
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
89
+ cache_control: z.ZodOptional<z.ZodObject<{
90
+ type: z.ZodLiteral<"ephemeral">;
91
+ }, "strip", z.ZodTypeAny, {
92
+ type: "ephemeral";
93
+ }, {
94
+ type: "ephemeral";
95
+ }>>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ type: "tool_use";
98
+ name: string;
99
+ id: string;
100
+ input: Record<string, any>;
101
+ cache_control?: {
102
+ type: "ephemeral";
103
+ } | undefined;
104
+ }, {
105
+ type: "tool_use";
106
+ name: string;
107
+ id: string;
108
+ input: Record<string, any>;
109
+ cache_control?: {
110
+ type: "ephemeral";
111
+ } | undefined;
112
+ }>, z.ZodObject<{
113
+ type: z.ZodLiteral<"tool_result">;
114
+ tool_use_id: z.ZodString;
115
+ content: z.ZodString;
116
+ cache_control: z.ZodOptional<z.ZodObject<{
117
+ type: z.ZodLiteral<"ephemeral">;
118
+ }, "strip", z.ZodTypeAny, {
119
+ type: "ephemeral";
120
+ }, {
121
+ type: "ephemeral";
122
+ }>>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ content: string;
125
+ type: "tool_result";
126
+ tool_use_id: string;
127
+ cache_control?: {
128
+ type: "ephemeral";
129
+ } | undefined;
130
+ }, {
131
+ content: string;
132
+ type: "tool_result";
133
+ tool_use_id: string;
134
+ cache_control?: {
135
+ type: "ephemeral";
136
+ } | undefined;
137
+ }>]>, "many">]>;
138
+ }, "strip", z.ZodTypeAny, {
139
+ content: string | ({
140
+ type: "text";
141
+ text: string;
142
+ cache_control?: {
143
+ type: "ephemeral";
144
+ } | undefined;
145
+ } | {
146
+ type: "tool_use";
147
+ name: string;
148
+ id: string;
149
+ input: Record<string, any>;
150
+ cache_control?: {
151
+ type: "ephemeral";
152
+ } | undefined;
153
+ } | {
154
+ content: string;
155
+ type: "tool_result";
156
+ tool_use_id: string;
157
+ cache_control?: {
158
+ type: "ephemeral";
159
+ } | undefined;
160
+ })[];
161
+ role: "user" | "assistant";
162
+ }, {
163
+ content: string | ({
164
+ type: "text";
165
+ text: string;
166
+ cache_control?: {
167
+ type: "ephemeral";
168
+ } | undefined;
169
+ } | {
170
+ type: "tool_use";
171
+ name: string;
172
+ id: string;
173
+ input: Record<string, any>;
174
+ cache_control?: {
175
+ type: "ephemeral";
176
+ } | undefined;
177
+ } | {
178
+ content: string;
179
+ type: "tool_result";
180
+ tool_use_id: string;
181
+ cache_control?: {
182
+ type: "ephemeral";
183
+ } | undefined;
184
+ })[];
185
+ role: "user" | "assistant";
186
+ }>, "many">;
187
+ fileContext: z.ZodObject<{
188
+ currentWorkingDirectory: z.ZodString;
189
+ fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
190
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
191
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
192
+ gitChanges: z.ZodObject<{
193
+ status: z.ZodString;
194
+ diff: z.ZodString;
195
+ diffCached: z.ZodString;
196
+ lastCommitMessages: z.ZodString;
197
+ }, "strip", z.ZodTypeAny, {
198
+ status: string;
199
+ diff: string;
200
+ diffCached: string;
201
+ lastCommitMessages: string;
202
+ }, {
203
+ status: string;
204
+ diff: string;
205
+ diffCached: string;
206
+ lastCommitMessages: string;
207
+ }>;
208
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
209
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
210
+ systemInfo: z.ZodObject<{
211
+ platform: z.ZodString;
212
+ shell: z.ZodString;
213
+ nodeVersion: z.ZodString;
214
+ arch: z.ZodString;
215
+ homedir: z.ZodString;
216
+ cpus: z.ZodNumber;
217
+ }, "strip", z.ZodTypeAny, {
218
+ platform: string;
219
+ shell: string;
220
+ nodeVersion: string;
221
+ arch: string;
222
+ homedir: string;
223
+ cpus: number;
224
+ }, {
225
+ platform: string;
226
+ shell: string;
227
+ nodeVersion: string;
228
+ arch: string;
229
+ homedir: string;
230
+ cpus: number;
231
+ }>;
232
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
233
+ path: z.ZodString;
234
+ content: z.ZodString;
235
+ }, "strip", z.ZodTypeAny, {
236
+ path: string;
237
+ content: string;
238
+ }, {
239
+ path: string;
240
+ content: string;
241
+ }>, "many">, "many">;
242
+ }, "strip", z.ZodTypeAny, {
243
+ currentWorkingDirectory: string;
244
+ fileTree: import("../util/file").FileTreeNode[];
245
+ fileTokenScores: Record<string, Record<string, number>>;
246
+ knowledgeFiles: Record<string, string>;
247
+ gitChanges: {
248
+ status: string;
249
+ diff: string;
250
+ diffCached: string;
251
+ lastCommitMessages: string;
252
+ };
253
+ changesSinceLastChat: Record<string, string>;
254
+ shellConfigFiles: Record<string, string>;
255
+ systemInfo: {
256
+ platform: string;
257
+ shell: string;
258
+ nodeVersion: string;
259
+ arch: string;
260
+ homedir: string;
261
+ cpus: number;
262
+ };
263
+ fileVersions: {
264
+ path: string;
265
+ content: string;
266
+ }[][];
267
+ }, {
268
+ currentWorkingDirectory: string;
269
+ fileTree: import("../util/file").FileTreeNode[];
270
+ fileTokenScores: Record<string, Record<string, number>>;
271
+ knowledgeFiles: Record<string, string>;
272
+ gitChanges: {
273
+ status: string;
274
+ diff: string;
275
+ diffCached: string;
276
+ lastCommitMessages: string;
277
+ };
278
+ changesSinceLastChat: Record<string, string>;
279
+ shellConfigFiles: Record<string, string>;
280
+ systemInfo: {
281
+ platform: string;
282
+ shell: string;
283
+ nodeVersion: string;
284
+ arch: string;
285
+ homedir: string;
286
+ cpus: number;
287
+ };
288
+ fileVersions: {
289
+ path: string;
290
+ content: string;
291
+ }[][];
292
+ }>;
293
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
294
+ type: z.ZodEnum<["patch", "file"]>;
295
+ filePath: z.ZodString;
296
+ content: z.ZodString;
297
+ }, "strip", z.ZodTypeAny, {
298
+ content: string;
299
+ type: "file" | "patch";
300
+ filePath: string;
301
+ }, {
302
+ content: string;
303
+ type: "file" | "patch";
304
+ filePath: string;
305
+ }>, "many">;
306
+ costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "pro"]>>>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ type: "user-input";
309
+ fingerprintId: string;
310
+ userInputId: string;
311
+ messages: {
312
+ content: string | ({
313
+ type: "text";
314
+ text: string;
315
+ cache_control?: {
316
+ type: "ephemeral";
317
+ } | undefined;
318
+ } | {
319
+ type: "tool_use";
320
+ name: string;
321
+ id: string;
322
+ input: Record<string, any>;
323
+ cache_control?: {
324
+ type: "ephemeral";
325
+ } | undefined;
326
+ } | {
327
+ content: string;
328
+ type: "tool_result";
329
+ tool_use_id: string;
330
+ cache_control?: {
331
+ type: "ephemeral";
332
+ } | undefined;
333
+ })[];
334
+ role: "user" | "assistant";
335
+ }[];
336
+ fileContext: {
337
+ currentWorkingDirectory: string;
338
+ fileTree: import("../util/file").FileTreeNode[];
339
+ fileTokenScores: Record<string, Record<string, number>>;
340
+ knowledgeFiles: Record<string, string>;
341
+ gitChanges: {
342
+ status: string;
343
+ diff: string;
344
+ diffCached: string;
345
+ lastCommitMessages: string;
346
+ };
347
+ changesSinceLastChat: Record<string, string>;
348
+ shellConfigFiles: Record<string, string>;
349
+ systemInfo: {
350
+ platform: string;
351
+ shell: string;
352
+ nodeVersion: string;
353
+ arch: string;
354
+ homedir: string;
355
+ cpus: number;
356
+ };
357
+ fileVersions: {
358
+ path: string;
359
+ content: string;
360
+ }[][];
361
+ };
362
+ changesAlreadyApplied: {
363
+ content: string;
364
+ type: "file" | "patch";
365
+ filePath: string;
366
+ }[];
367
+ costMode: "lite" | "normal" | "pro";
368
+ authToken?: string | undefined;
369
+ }, {
370
+ type: "user-input";
371
+ fingerprintId: string;
372
+ userInputId: string;
373
+ messages: {
374
+ content: string | ({
375
+ type: "text";
376
+ text: string;
377
+ cache_control?: {
378
+ type: "ephemeral";
379
+ } | undefined;
380
+ } | {
381
+ type: "tool_use";
382
+ name: string;
383
+ id: string;
384
+ input: Record<string, any>;
385
+ cache_control?: {
386
+ type: "ephemeral";
387
+ } | undefined;
388
+ } | {
389
+ content: string;
390
+ type: "tool_result";
391
+ tool_use_id: string;
392
+ cache_control?: {
393
+ type: "ephemeral";
394
+ } | undefined;
395
+ })[];
396
+ role: "user" | "assistant";
397
+ }[];
398
+ fileContext: {
399
+ currentWorkingDirectory: string;
400
+ fileTree: import("../util/file").FileTreeNode[];
401
+ fileTokenScores: Record<string, Record<string, number>>;
402
+ knowledgeFiles: Record<string, string>;
403
+ gitChanges: {
404
+ status: string;
405
+ diff: string;
406
+ diffCached: string;
407
+ lastCommitMessages: string;
408
+ };
409
+ changesSinceLastChat: Record<string, string>;
410
+ shellConfigFiles: Record<string, string>;
411
+ systemInfo: {
412
+ platform: string;
413
+ shell: string;
414
+ nodeVersion: string;
415
+ arch: string;
416
+ homedir: string;
417
+ cpus: number;
418
+ };
419
+ fileVersions: {
420
+ path: string;
421
+ content: string;
422
+ }[][];
423
+ };
424
+ changesAlreadyApplied: {
425
+ content: string;
426
+ type: "file" | "patch";
427
+ filePath: string;
428
+ }[];
429
+ authToken?: string | undefined;
430
+ costMode?: "lite" | "normal" | "pro" | undefined;
431
+ }>, z.ZodObject<{
432
+ type: z.ZodLiteral<"read-files-response">;
433
+ files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
434
+ }, "strip", z.ZodTypeAny, {
435
+ type: "read-files-response";
436
+ files: Record<string, string | null>;
437
+ }, {
438
+ type: "read-files-response";
439
+ files: Record<string, string | null>;
440
+ }>, z.ZodObject<{
441
+ type: z.ZodLiteral<"init">;
442
+ fingerprintId: z.ZodString;
443
+ authToken: z.ZodOptional<z.ZodString>;
444
+ fileContext: z.ZodObject<{
445
+ currentWorkingDirectory: z.ZodString;
446
+ fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
447
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
448
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
449
+ gitChanges: z.ZodObject<{
450
+ status: z.ZodString;
451
+ diff: z.ZodString;
452
+ diffCached: z.ZodString;
453
+ lastCommitMessages: z.ZodString;
454
+ }, "strip", z.ZodTypeAny, {
455
+ status: string;
456
+ diff: string;
457
+ diffCached: string;
458
+ lastCommitMessages: string;
459
+ }, {
460
+ status: string;
461
+ diff: string;
462
+ diffCached: string;
463
+ lastCommitMessages: string;
464
+ }>;
465
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
466
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
467
+ systemInfo: z.ZodObject<{
468
+ platform: z.ZodString;
469
+ shell: z.ZodString;
470
+ nodeVersion: z.ZodString;
471
+ arch: z.ZodString;
472
+ homedir: z.ZodString;
473
+ cpus: z.ZodNumber;
474
+ }, "strip", z.ZodTypeAny, {
475
+ platform: string;
476
+ shell: string;
477
+ nodeVersion: string;
478
+ arch: string;
479
+ homedir: string;
480
+ cpus: number;
481
+ }, {
482
+ platform: string;
483
+ shell: string;
484
+ nodeVersion: string;
485
+ arch: string;
486
+ homedir: string;
487
+ cpus: number;
488
+ }>;
489
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
490
+ path: z.ZodString;
491
+ content: z.ZodString;
492
+ }, "strip", z.ZodTypeAny, {
493
+ path: string;
494
+ content: string;
495
+ }, {
496
+ path: string;
497
+ content: string;
498
+ }>, "many">, "many">;
499
+ }, "strip", z.ZodTypeAny, {
500
+ currentWorkingDirectory: string;
501
+ fileTree: import("../util/file").FileTreeNode[];
502
+ fileTokenScores: Record<string, Record<string, number>>;
503
+ knowledgeFiles: Record<string, string>;
504
+ gitChanges: {
505
+ status: string;
506
+ diff: string;
507
+ diffCached: string;
508
+ lastCommitMessages: string;
509
+ };
510
+ changesSinceLastChat: Record<string, string>;
511
+ shellConfigFiles: Record<string, string>;
512
+ systemInfo: {
513
+ platform: string;
514
+ shell: string;
515
+ nodeVersion: string;
516
+ arch: string;
517
+ homedir: string;
518
+ cpus: number;
519
+ };
520
+ fileVersions: {
521
+ path: string;
522
+ content: string;
523
+ }[][];
524
+ }, {
525
+ currentWorkingDirectory: string;
526
+ fileTree: import("../util/file").FileTreeNode[];
527
+ fileTokenScores: Record<string, Record<string, number>>;
528
+ knowledgeFiles: Record<string, string>;
529
+ gitChanges: {
530
+ status: string;
531
+ diff: string;
532
+ diffCached: string;
533
+ lastCommitMessages: string;
534
+ };
535
+ changesSinceLastChat: Record<string, string>;
536
+ shellConfigFiles: Record<string, string>;
537
+ systemInfo: {
538
+ platform: string;
539
+ shell: string;
540
+ nodeVersion: string;
541
+ arch: string;
542
+ homedir: string;
543
+ cpus: number;
544
+ };
545
+ fileVersions: {
546
+ path: string;
547
+ content: string;
548
+ }[][];
549
+ }>;
550
+ }, "strip", z.ZodTypeAny, {
551
+ type: "init";
552
+ fingerprintId: string;
553
+ fileContext: {
554
+ currentWorkingDirectory: string;
555
+ fileTree: import("../util/file").FileTreeNode[];
556
+ fileTokenScores: Record<string, Record<string, number>>;
557
+ knowledgeFiles: Record<string, string>;
558
+ gitChanges: {
559
+ status: string;
560
+ diff: string;
561
+ diffCached: string;
562
+ lastCommitMessages: string;
563
+ };
564
+ changesSinceLastChat: Record<string, string>;
565
+ shellConfigFiles: Record<string, string>;
566
+ systemInfo: {
567
+ platform: string;
568
+ shell: string;
569
+ nodeVersion: string;
570
+ arch: string;
571
+ homedir: string;
572
+ cpus: number;
573
+ };
574
+ fileVersions: {
575
+ path: string;
576
+ content: string;
577
+ }[][];
578
+ };
579
+ authToken?: string | undefined;
580
+ }, {
581
+ type: "init";
582
+ fingerprintId: string;
583
+ fileContext: {
584
+ currentWorkingDirectory: string;
585
+ fileTree: import("../util/file").FileTreeNode[];
586
+ fileTokenScores: Record<string, Record<string, number>>;
587
+ knowledgeFiles: Record<string, string>;
588
+ gitChanges: {
589
+ status: string;
590
+ diff: string;
591
+ diffCached: string;
592
+ lastCommitMessages: string;
593
+ };
594
+ changesSinceLastChat: Record<string, string>;
595
+ shellConfigFiles: Record<string, string>;
596
+ systemInfo: {
597
+ platform: string;
598
+ shell: string;
599
+ nodeVersion: string;
600
+ arch: string;
601
+ homedir: string;
602
+ cpus: number;
603
+ };
604
+ fileVersions: {
605
+ path: string;
606
+ content: string;
607
+ }[][];
608
+ };
609
+ authToken?: string | undefined;
610
+ }>, z.ZodObject<{
611
+ type: z.ZodLiteral<"usage">;
612
+ fingerprintId: z.ZodString;
613
+ authToken: z.ZodOptional<z.ZodString>;
614
+ }, "strip", z.ZodTypeAny, {
615
+ type: "usage";
616
+ fingerprintId: string;
617
+ authToken?: string | undefined;
618
+ }, {
619
+ type: "usage";
620
+ fingerprintId: string;
621
+ authToken?: string | undefined;
622
+ }>, z.ZodObject<{
623
+ type: z.ZodLiteral<"login-code-request">;
624
+ fingerprintId: z.ZodString;
625
+ referralCode: z.ZodOptional<z.ZodString>;
626
+ }, "strip", z.ZodTypeAny, {
627
+ type: "login-code-request";
628
+ fingerprintId: string;
629
+ referralCode?: string | undefined;
630
+ }, {
631
+ type: "login-code-request";
632
+ fingerprintId: string;
633
+ referralCode?: string | undefined;
634
+ }>, z.ZodObject<{
635
+ type: z.ZodLiteral<"login-status-request">;
636
+ fingerprintId: z.ZodString;
637
+ fingerprintHash: z.ZodString;
638
+ }, "strip", z.ZodTypeAny, {
639
+ type: "login-status-request";
640
+ fingerprintId: string;
641
+ fingerprintHash: string;
642
+ }, {
643
+ type: "login-status-request";
644
+ fingerprintId: string;
645
+ fingerprintHash: string;
646
+ }>, z.ZodObject<{
647
+ type: z.ZodLiteral<"clear-auth-token">;
648
+ authToken: z.ZodString;
649
+ fingerprintId: z.ZodString;
650
+ userId: z.ZodString;
651
+ fingerprintHash: z.ZodString;
652
+ }, "strip", z.ZodTypeAny, {
653
+ type: "clear-auth-token";
654
+ userId: string;
655
+ fingerprintId: string;
656
+ authToken: string;
657
+ fingerprintHash: string;
658
+ }, {
659
+ type: "clear-auth-token";
660
+ userId: string;
661
+ fingerprintId: string;
662
+ authToken: string;
663
+ fingerprintHash: string;
664
+ }>, z.ZodObject<{
665
+ type: z.ZodLiteral<"generate-commit-message">;
666
+ fingerprintId: z.ZodString;
667
+ authToken: z.ZodOptional<z.ZodString>;
668
+ stagedChanges: z.ZodString;
669
+ }, "strip", z.ZodTypeAny, {
670
+ type: "generate-commit-message";
671
+ fingerprintId: string;
672
+ stagedChanges: string;
673
+ authToken?: string | undefined;
674
+ }, {
675
+ type: "generate-commit-message";
676
+ fingerprintId: string;
677
+ stagedChanges: string;
678
+ authToken?: string | undefined;
679
+ }>]>;
680
+ }, "strip", z.ZodTypeAny, {
681
+ type: "action";
682
+ data: {
683
+ type: "user-input";
684
+ fingerprintId: string;
685
+ userInputId: string;
686
+ messages: {
687
+ content: string | ({
688
+ type: "text";
689
+ text: string;
690
+ cache_control?: {
691
+ type: "ephemeral";
692
+ } | undefined;
693
+ } | {
694
+ type: "tool_use";
695
+ name: string;
696
+ id: string;
697
+ input: Record<string, any>;
698
+ cache_control?: {
699
+ type: "ephemeral";
700
+ } | undefined;
701
+ } | {
702
+ content: string;
703
+ type: "tool_result";
704
+ tool_use_id: string;
705
+ cache_control?: {
706
+ type: "ephemeral";
707
+ } | undefined;
708
+ })[];
709
+ role: "user" | "assistant";
710
+ }[];
711
+ fileContext: {
712
+ currentWorkingDirectory: string;
713
+ fileTree: import("../util/file").FileTreeNode[];
714
+ fileTokenScores: Record<string, Record<string, number>>;
715
+ knowledgeFiles: Record<string, string>;
716
+ gitChanges: {
717
+ status: string;
718
+ diff: string;
719
+ diffCached: string;
720
+ lastCommitMessages: string;
721
+ };
722
+ changesSinceLastChat: Record<string, string>;
723
+ shellConfigFiles: Record<string, string>;
724
+ systemInfo: {
725
+ platform: string;
726
+ shell: string;
727
+ nodeVersion: string;
728
+ arch: string;
729
+ homedir: string;
730
+ cpus: number;
731
+ };
732
+ fileVersions: {
733
+ path: string;
734
+ content: string;
735
+ }[][];
736
+ };
737
+ changesAlreadyApplied: {
738
+ content: string;
739
+ type: "file" | "patch";
740
+ filePath: string;
741
+ }[];
742
+ costMode: "lite" | "normal" | "pro";
743
+ authToken?: string | undefined;
744
+ } | {
745
+ type: "read-files-response";
746
+ files: Record<string, string | null>;
747
+ } | {
748
+ type: "init";
749
+ fingerprintId: string;
750
+ fileContext: {
751
+ currentWorkingDirectory: string;
752
+ fileTree: import("../util/file").FileTreeNode[];
753
+ fileTokenScores: Record<string, Record<string, number>>;
754
+ knowledgeFiles: Record<string, string>;
755
+ gitChanges: {
756
+ status: string;
757
+ diff: string;
758
+ diffCached: string;
759
+ lastCommitMessages: string;
760
+ };
761
+ changesSinceLastChat: Record<string, string>;
762
+ shellConfigFiles: Record<string, string>;
763
+ systemInfo: {
764
+ platform: string;
765
+ shell: string;
766
+ nodeVersion: string;
767
+ arch: string;
768
+ homedir: string;
769
+ cpus: number;
770
+ };
771
+ fileVersions: {
772
+ path: string;
773
+ content: string;
774
+ }[][];
775
+ };
776
+ authToken?: string | undefined;
777
+ } | {
778
+ type: "usage";
779
+ fingerprintId: string;
780
+ authToken?: string | undefined;
781
+ } | {
782
+ type: "login-code-request";
783
+ fingerprintId: string;
784
+ referralCode?: string | undefined;
785
+ } | {
786
+ type: "login-status-request";
787
+ fingerprintId: string;
788
+ fingerprintHash: string;
789
+ } | {
790
+ type: "clear-auth-token";
791
+ userId: string;
792
+ fingerprintId: string;
793
+ authToken: string;
794
+ fingerprintHash: string;
795
+ } | {
796
+ type: "generate-commit-message";
797
+ fingerprintId: string;
798
+ stagedChanges: string;
799
+ authToken?: string | undefined;
800
+ };
801
+ txid: number;
802
+ }, {
803
+ type: "action";
804
+ data: {
805
+ type: "user-input";
806
+ fingerprintId: string;
807
+ userInputId: string;
808
+ messages: {
809
+ content: string | ({
810
+ type: "text";
811
+ text: string;
812
+ cache_control?: {
813
+ type: "ephemeral";
814
+ } | undefined;
815
+ } | {
816
+ type: "tool_use";
817
+ name: string;
818
+ id: string;
819
+ input: Record<string, any>;
820
+ cache_control?: {
821
+ type: "ephemeral";
822
+ } | undefined;
823
+ } | {
824
+ content: string;
825
+ type: "tool_result";
826
+ tool_use_id: string;
827
+ cache_control?: {
828
+ type: "ephemeral";
829
+ } | undefined;
830
+ })[];
831
+ role: "user" | "assistant";
832
+ }[];
833
+ fileContext: {
834
+ currentWorkingDirectory: string;
835
+ fileTree: import("../util/file").FileTreeNode[];
836
+ fileTokenScores: Record<string, Record<string, number>>;
837
+ knowledgeFiles: Record<string, string>;
838
+ gitChanges: {
839
+ status: string;
840
+ diff: string;
841
+ diffCached: string;
842
+ lastCommitMessages: string;
843
+ };
844
+ changesSinceLastChat: Record<string, string>;
845
+ shellConfigFiles: Record<string, string>;
846
+ systemInfo: {
847
+ platform: string;
848
+ shell: string;
849
+ nodeVersion: string;
850
+ arch: string;
851
+ homedir: string;
852
+ cpus: number;
853
+ };
854
+ fileVersions: {
855
+ path: string;
856
+ content: string;
857
+ }[][];
858
+ };
859
+ changesAlreadyApplied: {
860
+ content: string;
861
+ type: "file" | "patch";
862
+ filePath: string;
863
+ }[];
864
+ authToken?: string | undefined;
865
+ costMode?: "lite" | "normal" | "pro" | undefined;
866
+ } | {
867
+ type: "read-files-response";
868
+ files: Record<string, string | null>;
869
+ } | {
870
+ type: "init";
871
+ fingerprintId: string;
872
+ fileContext: {
873
+ currentWorkingDirectory: string;
874
+ fileTree: import("../util/file").FileTreeNode[];
875
+ fileTokenScores: Record<string, Record<string, number>>;
876
+ knowledgeFiles: Record<string, string>;
877
+ gitChanges: {
878
+ status: string;
879
+ diff: string;
880
+ diffCached: string;
881
+ lastCommitMessages: string;
882
+ };
883
+ changesSinceLastChat: Record<string, string>;
884
+ shellConfigFiles: Record<string, string>;
885
+ systemInfo: {
886
+ platform: string;
887
+ shell: string;
888
+ nodeVersion: string;
889
+ arch: string;
890
+ homedir: string;
891
+ cpus: number;
892
+ };
893
+ fileVersions: {
894
+ path: string;
895
+ content: string;
896
+ }[][];
897
+ };
898
+ authToken?: string | undefined;
899
+ } | {
900
+ type: "usage";
901
+ fingerprintId: string;
902
+ authToken?: string | undefined;
903
+ } | {
904
+ type: "login-code-request";
905
+ fingerprintId: string;
906
+ referralCode?: string | undefined;
907
+ } | {
908
+ type: "login-status-request";
909
+ fingerprintId: string;
910
+ fingerprintHash: string;
911
+ } | {
912
+ type: "clear-auth-token";
913
+ userId: string;
914
+ fingerprintId: string;
915
+ authToken: string;
916
+ fingerprintHash: string;
917
+ } | {
918
+ type: "generate-commit-message";
919
+ fingerprintId: string;
920
+ stagedChanges: string;
921
+ authToken?: string | undefined;
922
+ };
923
+ txid: number;
924
+ }>;
925
+ };
926
+ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
927
+ type: z.ZodLiteral<"identify">;
928
+ txid: z.ZodNumber;
929
+ clientSessionId: z.ZodString;
930
+ }, "strip", z.ZodTypeAny, {
931
+ type: "identify";
932
+ txid: number;
933
+ clientSessionId: string;
934
+ }, {
935
+ type: "identify";
936
+ txid: number;
937
+ clientSessionId: string;
938
+ }>, z.ZodObject<{
939
+ type: z.ZodLiteral<"subscribe">;
940
+ txid: z.ZodNumber;
941
+ topics: z.ZodArray<z.ZodString, "many">;
942
+ }, "strip", z.ZodTypeAny, {
943
+ type: "subscribe";
944
+ txid: number;
945
+ topics: string[];
946
+ }, {
947
+ type: "subscribe";
948
+ txid: number;
949
+ topics: string[];
950
+ }>, z.ZodObject<{
951
+ type: z.ZodLiteral<"unsubscribe">;
952
+ txid: z.ZodNumber;
953
+ topics: z.ZodArray<z.ZodString, "many">;
954
+ }, "strip", z.ZodTypeAny, {
955
+ type: "unsubscribe";
956
+ txid: number;
957
+ topics: string[];
958
+ }, {
959
+ type: "unsubscribe";
960
+ txid: number;
961
+ topics: string[];
962
+ }>, z.ZodObject<{
963
+ type: z.ZodLiteral<"ping">;
964
+ txid: z.ZodNumber;
965
+ }, "strip", z.ZodTypeAny, {
966
+ type: "ping";
967
+ txid: number;
968
+ }, {
969
+ type: "ping";
970
+ txid: number;
971
+ }>, z.ZodObject<{
972
+ type: z.ZodLiteral<"action">;
973
+ txid: z.ZodNumber;
974
+ data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
975
+ type: z.ZodLiteral<"user-input">;
976
+ fingerprintId: z.ZodString;
977
+ authToken: z.ZodOptional<z.ZodString>;
978
+ userInputId: z.ZodString;
979
+ messages: z.ZodArray<z.ZodObject<{
980
+ role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
981
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
982
+ type: z.ZodLiteral<"text">;
983
+ text: z.ZodString;
984
+ cache_control: z.ZodOptional<z.ZodObject<{
985
+ type: z.ZodLiteral<"ephemeral">;
986
+ }, "strip", z.ZodTypeAny, {
987
+ type: "ephemeral";
988
+ }, {
989
+ type: "ephemeral";
990
+ }>>;
991
+ }, "strip", z.ZodTypeAny, {
992
+ type: "text";
993
+ text: string;
994
+ cache_control?: {
995
+ type: "ephemeral";
996
+ } | undefined;
997
+ }, {
998
+ type: "text";
999
+ text: string;
1000
+ cache_control?: {
1001
+ type: "ephemeral";
1002
+ } | undefined;
1003
+ }>, z.ZodObject<{
1004
+ type: z.ZodLiteral<"tool_use">;
1005
+ id: z.ZodString;
1006
+ name: z.ZodString;
1007
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
1008
+ cache_control: z.ZodOptional<z.ZodObject<{
1009
+ type: z.ZodLiteral<"ephemeral">;
1010
+ }, "strip", z.ZodTypeAny, {
1011
+ type: "ephemeral";
1012
+ }, {
1013
+ type: "ephemeral";
1014
+ }>>;
1015
+ }, "strip", z.ZodTypeAny, {
1016
+ type: "tool_use";
1017
+ name: string;
1018
+ id: string;
1019
+ input: Record<string, any>;
1020
+ cache_control?: {
1021
+ type: "ephemeral";
1022
+ } | undefined;
1023
+ }, {
1024
+ type: "tool_use";
1025
+ name: string;
1026
+ id: string;
1027
+ input: Record<string, any>;
1028
+ cache_control?: {
1029
+ type: "ephemeral";
1030
+ } | undefined;
1031
+ }>, z.ZodObject<{
1032
+ type: z.ZodLiteral<"tool_result">;
1033
+ tool_use_id: z.ZodString;
1034
+ content: z.ZodString;
1035
+ cache_control: z.ZodOptional<z.ZodObject<{
1036
+ type: z.ZodLiteral<"ephemeral">;
1037
+ }, "strip", z.ZodTypeAny, {
1038
+ type: "ephemeral";
1039
+ }, {
1040
+ type: "ephemeral";
1041
+ }>>;
1042
+ }, "strip", z.ZodTypeAny, {
1043
+ content: string;
1044
+ type: "tool_result";
1045
+ tool_use_id: string;
1046
+ cache_control?: {
1047
+ type: "ephemeral";
1048
+ } | undefined;
1049
+ }, {
1050
+ content: string;
1051
+ type: "tool_result";
1052
+ tool_use_id: string;
1053
+ cache_control?: {
1054
+ type: "ephemeral";
1055
+ } | undefined;
1056
+ }>]>, "many">]>;
1057
+ }, "strip", z.ZodTypeAny, {
1058
+ content: string | ({
1059
+ type: "text";
1060
+ text: string;
1061
+ cache_control?: {
1062
+ type: "ephemeral";
1063
+ } | undefined;
1064
+ } | {
1065
+ type: "tool_use";
1066
+ name: string;
1067
+ id: string;
1068
+ input: Record<string, any>;
1069
+ cache_control?: {
1070
+ type: "ephemeral";
1071
+ } | undefined;
1072
+ } | {
1073
+ content: string;
1074
+ type: "tool_result";
1075
+ tool_use_id: string;
1076
+ cache_control?: {
1077
+ type: "ephemeral";
1078
+ } | undefined;
1079
+ })[];
1080
+ role: "user" | "assistant";
1081
+ }, {
1082
+ content: string | ({
1083
+ type: "text";
1084
+ text: string;
1085
+ cache_control?: {
1086
+ type: "ephemeral";
1087
+ } | undefined;
1088
+ } | {
1089
+ type: "tool_use";
1090
+ name: string;
1091
+ id: string;
1092
+ input: Record<string, any>;
1093
+ cache_control?: {
1094
+ type: "ephemeral";
1095
+ } | undefined;
1096
+ } | {
1097
+ content: string;
1098
+ type: "tool_result";
1099
+ tool_use_id: string;
1100
+ cache_control?: {
1101
+ type: "ephemeral";
1102
+ } | undefined;
1103
+ })[];
1104
+ role: "user" | "assistant";
1105
+ }>, "many">;
1106
+ fileContext: z.ZodObject<{
1107
+ currentWorkingDirectory: z.ZodString;
1108
+ fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
1109
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
1110
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1111
+ gitChanges: z.ZodObject<{
1112
+ status: z.ZodString;
1113
+ diff: z.ZodString;
1114
+ diffCached: z.ZodString;
1115
+ lastCommitMessages: z.ZodString;
1116
+ }, "strip", z.ZodTypeAny, {
1117
+ status: string;
1118
+ diff: string;
1119
+ diffCached: string;
1120
+ lastCommitMessages: string;
1121
+ }, {
1122
+ status: string;
1123
+ diff: string;
1124
+ diffCached: string;
1125
+ lastCommitMessages: string;
1126
+ }>;
1127
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
1128
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1129
+ systemInfo: z.ZodObject<{
1130
+ platform: z.ZodString;
1131
+ shell: z.ZodString;
1132
+ nodeVersion: z.ZodString;
1133
+ arch: z.ZodString;
1134
+ homedir: z.ZodString;
1135
+ cpus: z.ZodNumber;
1136
+ }, "strip", z.ZodTypeAny, {
1137
+ platform: string;
1138
+ shell: string;
1139
+ nodeVersion: string;
1140
+ arch: string;
1141
+ homedir: string;
1142
+ cpus: number;
1143
+ }, {
1144
+ platform: string;
1145
+ shell: string;
1146
+ nodeVersion: string;
1147
+ arch: string;
1148
+ homedir: string;
1149
+ cpus: number;
1150
+ }>;
1151
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
1152
+ path: z.ZodString;
1153
+ content: z.ZodString;
1154
+ }, "strip", z.ZodTypeAny, {
1155
+ path: string;
1156
+ content: string;
1157
+ }, {
1158
+ path: string;
1159
+ content: string;
1160
+ }>, "many">, "many">;
1161
+ }, "strip", z.ZodTypeAny, {
1162
+ currentWorkingDirectory: string;
1163
+ fileTree: import("../util/file").FileTreeNode[];
1164
+ fileTokenScores: Record<string, Record<string, number>>;
1165
+ knowledgeFiles: Record<string, string>;
1166
+ gitChanges: {
1167
+ status: string;
1168
+ diff: string;
1169
+ diffCached: string;
1170
+ lastCommitMessages: string;
1171
+ };
1172
+ changesSinceLastChat: Record<string, string>;
1173
+ shellConfigFiles: Record<string, string>;
1174
+ systemInfo: {
1175
+ platform: string;
1176
+ shell: string;
1177
+ nodeVersion: string;
1178
+ arch: string;
1179
+ homedir: string;
1180
+ cpus: number;
1181
+ };
1182
+ fileVersions: {
1183
+ path: string;
1184
+ content: string;
1185
+ }[][];
1186
+ }, {
1187
+ currentWorkingDirectory: string;
1188
+ fileTree: import("../util/file").FileTreeNode[];
1189
+ fileTokenScores: Record<string, Record<string, number>>;
1190
+ knowledgeFiles: Record<string, string>;
1191
+ gitChanges: {
1192
+ status: string;
1193
+ diff: string;
1194
+ diffCached: string;
1195
+ lastCommitMessages: string;
1196
+ };
1197
+ changesSinceLastChat: Record<string, string>;
1198
+ shellConfigFiles: Record<string, string>;
1199
+ systemInfo: {
1200
+ platform: string;
1201
+ shell: string;
1202
+ nodeVersion: string;
1203
+ arch: string;
1204
+ homedir: string;
1205
+ cpus: number;
1206
+ };
1207
+ fileVersions: {
1208
+ path: string;
1209
+ content: string;
1210
+ }[][];
1211
+ }>;
1212
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1213
+ type: z.ZodEnum<["patch", "file"]>;
1214
+ filePath: z.ZodString;
1215
+ content: z.ZodString;
1216
+ }, "strip", z.ZodTypeAny, {
1217
+ content: string;
1218
+ type: "file" | "patch";
1219
+ filePath: string;
1220
+ }, {
1221
+ content: string;
1222
+ type: "file" | "patch";
1223
+ filePath: string;
1224
+ }>, "many">;
1225
+ costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "pro"]>>>;
1226
+ }, "strip", z.ZodTypeAny, {
1227
+ type: "user-input";
1228
+ fingerprintId: string;
1229
+ userInputId: string;
1230
+ messages: {
1231
+ content: string | ({
1232
+ type: "text";
1233
+ text: string;
1234
+ cache_control?: {
1235
+ type: "ephemeral";
1236
+ } | undefined;
1237
+ } | {
1238
+ type: "tool_use";
1239
+ name: string;
1240
+ id: string;
1241
+ input: Record<string, any>;
1242
+ cache_control?: {
1243
+ type: "ephemeral";
1244
+ } | undefined;
1245
+ } | {
1246
+ content: string;
1247
+ type: "tool_result";
1248
+ tool_use_id: string;
1249
+ cache_control?: {
1250
+ type: "ephemeral";
1251
+ } | undefined;
1252
+ })[];
1253
+ role: "user" | "assistant";
1254
+ }[];
1255
+ fileContext: {
1256
+ currentWorkingDirectory: string;
1257
+ fileTree: import("../util/file").FileTreeNode[];
1258
+ fileTokenScores: Record<string, Record<string, number>>;
1259
+ knowledgeFiles: Record<string, string>;
1260
+ gitChanges: {
1261
+ status: string;
1262
+ diff: string;
1263
+ diffCached: string;
1264
+ lastCommitMessages: string;
1265
+ };
1266
+ changesSinceLastChat: Record<string, string>;
1267
+ shellConfigFiles: Record<string, string>;
1268
+ systemInfo: {
1269
+ platform: string;
1270
+ shell: string;
1271
+ nodeVersion: string;
1272
+ arch: string;
1273
+ homedir: string;
1274
+ cpus: number;
1275
+ };
1276
+ fileVersions: {
1277
+ path: string;
1278
+ content: string;
1279
+ }[][];
1280
+ };
1281
+ changesAlreadyApplied: {
1282
+ content: string;
1283
+ type: "file" | "patch";
1284
+ filePath: string;
1285
+ }[];
1286
+ costMode: "lite" | "normal" | "pro";
1287
+ authToken?: string | undefined;
1288
+ }, {
1289
+ type: "user-input";
1290
+ fingerprintId: string;
1291
+ userInputId: string;
1292
+ messages: {
1293
+ content: string | ({
1294
+ type: "text";
1295
+ text: string;
1296
+ cache_control?: {
1297
+ type: "ephemeral";
1298
+ } | undefined;
1299
+ } | {
1300
+ type: "tool_use";
1301
+ name: string;
1302
+ id: string;
1303
+ input: Record<string, any>;
1304
+ cache_control?: {
1305
+ type: "ephemeral";
1306
+ } | undefined;
1307
+ } | {
1308
+ content: string;
1309
+ type: "tool_result";
1310
+ tool_use_id: string;
1311
+ cache_control?: {
1312
+ type: "ephemeral";
1313
+ } | undefined;
1314
+ })[];
1315
+ role: "user" | "assistant";
1316
+ }[];
1317
+ fileContext: {
1318
+ currentWorkingDirectory: string;
1319
+ fileTree: import("../util/file").FileTreeNode[];
1320
+ fileTokenScores: Record<string, Record<string, number>>;
1321
+ knowledgeFiles: Record<string, string>;
1322
+ gitChanges: {
1323
+ status: string;
1324
+ diff: string;
1325
+ diffCached: string;
1326
+ lastCommitMessages: string;
1327
+ };
1328
+ changesSinceLastChat: Record<string, string>;
1329
+ shellConfigFiles: Record<string, string>;
1330
+ systemInfo: {
1331
+ platform: string;
1332
+ shell: string;
1333
+ nodeVersion: string;
1334
+ arch: string;
1335
+ homedir: string;
1336
+ cpus: number;
1337
+ };
1338
+ fileVersions: {
1339
+ path: string;
1340
+ content: string;
1341
+ }[][];
1342
+ };
1343
+ changesAlreadyApplied: {
1344
+ content: string;
1345
+ type: "file" | "patch";
1346
+ filePath: string;
1347
+ }[];
1348
+ authToken?: string | undefined;
1349
+ costMode?: "lite" | "normal" | "pro" | undefined;
1350
+ }>, z.ZodObject<{
1351
+ type: z.ZodLiteral<"read-files-response">;
1352
+ files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1353
+ }, "strip", z.ZodTypeAny, {
1354
+ type: "read-files-response";
1355
+ files: Record<string, string | null>;
1356
+ }, {
1357
+ type: "read-files-response";
1358
+ files: Record<string, string | null>;
1359
+ }>, z.ZodObject<{
1360
+ type: z.ZodLiteral<"init">;
1361
+ fingerprintId: z.ZodString;
1362
+ authToken: z.ZodOptional<z.ZodString>;
1363
+ fileContext: z.ZodObject<{
1364
+ currentWorkingDirectory: z.ZodString;
1365
+ fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
1366
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
1367
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1368
+ gitChanges: z.ZodObject<{
1369
+ status: z.ZodString;
1370
+ diff: z.ZodString;
1371
+ diffCached: z.ZodString;
1372
+ lastCommitMessages: z.ZodString;
1373
+ }, "strip", z.ZodTypeAny, {
1374
+ status: string;
1375
+ diff: string;
1376
+ diffCached: string;
1377
+ lastCommitMessages: string;
1378
+ }, {
1379
+ status: string;
1380
+ diff: string;
1381
+ diffCached: string;
1382
+ lastCommitMessages: string;
1383
+ }>;
1384
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
1385
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1386
+ systemInfo: z.ZodObject<{
1387
+ platform: z.ZodString;
1388
+ shell: z.ZodString;
1389
+ nodeVersion: z.ZodString;
1390
+ arch: z.ZodString;
1391
+ homedir: z.ZodString;
1392
+ cpus: z.ZodNumber;
1393
+ }, "strip", z.ZodTypeAny, {
1394
+ platform: string;
1395
+ shell: string;
1396
+ nodeVersion: string;
1397
+ arch: string;
1398
+ homedir: string;
1399
+ cpus: number;
1400
+ }, {
1401
+ platform: string;
1402
+ shell: string;
1403
+ nodeVersion: string;
1404
+ arch: string;
1405
+ homedir: string;
1406
+ cpus: number;
1407
+ }>;
1408
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
1409
+ path: z.ZodString;
1410
+ content: z.ZodString;
1411
+ }, "strip", z.ZodTypeAny, {
1412
+ path: string;
1413
+ content: string;
1414
+ }, {
1415
+ path: string;
1416
+ content: string;
1417
+ }>, "many">, "many">;
1418
+ }, "strip", z.ZodTypeAny, {
1419
+ currentWorkingDirectory: string;
1420
+ fileTree: import("../util/file").FileTreeNode[];
1421
+ fileTokenScores: Record<string, Record<string, number>>;
1422
+ knowledgeFiles: Record<string, string>;
1423
+ gitChanges: {
1424
+ status: string;
1425
+ diff: string;
1426
+ diffCached: string;
1427
+ lastCommitMessages: string;
1428
+ };
1429
+ changesSinceLastChat: Record<string, string>;
1430
+ shellConfigFiles: Record<string, string>;
1431
+ systemInfo: {
1432
+ platform: string;
1433
+ shell: string;
1434
+ nodeVersion: string;
1435
+ arch: string;
1436
+ homedir: string;
1437
+ cpus: number;
1438
+ };
1439
+ fileVersions: {
1440
+ path: string;
1441
+ content: string;
1442
+ }[][];
1443
+ }, {
1444
+ currentWorkingDirectory: string;
1445
+ fileTree: import("../util/file").FileTreeNode[];
1446
+ fileTokenScores: Record<string, Record<string, number>>;
1447
+ knowledgeFiles: Record<string, string>;
1448
+ gitChanges: {
1449
+ status: string;
1450
+ diff: string;
1451
+ diffCached: string;
1452
+ lastCommitMessages: string;
1453
+ };
1454
+ changesSinceLastChat: Record<string, string>;
1455
+ shellConfigFiles: Record<string, string>;
1456
+ systemInfo: {
1457
+ platform: string;
1458
+ shell: string;
1459
+ nodeVersion: string;
1460
+ arch: string;
1461
+ homedir: string;
1462
+ cpus: number;
1463
+ };
1464
+ fileVersions: {
1465
+ path: string;
1466
+ content: string;
1467
+ }[][];
1468
+ }>;
1469
+ }, "strip", z.ZodTypeAny, {
1470
+ type: "init";
1471
+ fingerprintId: string;
1472
+ fileContext: {
1473
+ currentWorkingDirectory: string;
1474
+ fileTree: import("../util/file").FileTreeNode[];
1475
+ fileTokenScores: Record<string, Record<string, number>>;
1476
+ knowledgeFiles: Record<string, string>;
1477
+ gitChanges: {
1478
+ status: string;
1479
+ diff: string;
1480
+ diffCached: string;
1481
+ lastCommitMessages: string;
1482
+ };
1483
+ changesSinceLastChat: Record<string, string>;
1484
+ shellConfigFiles: Record<string, string>;
1485
+ systemInfo: {
1486
+ platform: string;
1487
+ shell: string;
1488
+ nodeVersion: string;
1489
+ arch: string;
1490
+ homedir: string;
1491
+ cpus: number;
1492
+ };
1493
+ fileVersions: {
1494
+ path: string;
1495
+ content: string;
1496
+ }[][];
1497
+ };
1498
+ authToken?: string | undefined;
1499
+ }, {
1500
+ type: "init";
1501
+ fingerprintId: string;
1502
+ fileContext: {
1503
+ currentWorkingDirectory: string;
1504
+ fileTree: import("../util/file").FileTreeNode[];
1505
+ fileTokenScores: Record<string, Record<string, number>>;
1506
+ knowledgeFiles: Record<string, string>;
1507
+ gitChanges: {
1508
+ status: string;
1509
+ diff: string;
1510
+ diffCached: string;
1511
+ lastCommitMessages: string;
1512
+ };
1513
+ changesSinceLastChat: Record<string, string>;
1514
+ shellConfigFiles: Record<string, string>;
1515
+ systemInfo: {
1516
+ platform: string;
1517
+ shell: string;
1518
+ nodeVersion: string;
1519
+ arch: string;
1520
+ homedir: string;
1521
+ cpus: number;
1522
+ };
1523
+ fileVersions: {
1524
+ path: string;
1525
+ content: string;
1526
+ }[][];
1527
+ };
1528
+ authToken?: string | undefined;
1529
+ }>, z.ZodObject<{
1530
+ type: z.ZodLiteral<"usage">;
1531
+ fingerprintId: z.ZodString;
1532
+ authToken: z.ZodOptional<z.ZodString>;
1533
+ }, "strip", z.ZodTypeAny, {
1534
+ type: "usage";
1535
+ fingerprintId: string;
1536
+ authToken?: string | undefined;
1537
+ }, {
1538
+ type: "usage";
1539
+ fingerprintId: string;
1540
+ authToken?: string | undefined;
1541
+ }>, z.ZodObject<{
1542
+ type: z.ZodLiteral<"login-code-request">;
1543
+ fingerprintId: z.ZodString;
1544
+ referralCode: z.ZodOptional<z.ZodString>;
1545
+ }, "strip", z.ZodTypeAny, {
1546
+ type: "login-code-request";
1547
+ fingerprintId: string;
1548
+ referralCode?: string | undefined;
1549
+ }, {
1550
+ type: "login-code-request";
1551
+ fingerprintId: string;
1552
+ referralCode?: string | undefined;
1553
+ }>, z.ZodObject<{
1554
+ type: z.ZodLiteral<"login-status-request">;
1555
+ fingerprintId: z.ZodString;
1556
+ fingerprintHash: z.ZodString;
1557
+ }, "strip", z.ZodTypeAny, {
1558
+ type: "login-status-request";
1559
+ fingerprintId: string;
1560
+ fingerprintHash: string;
1561
+ }, {
1562
+ type: "login-status-request";
1563
+ fingerprintId: string;
1564
+ fingerprintHash: string;
1565
+ }>, z.ZodObject<{
1566
+ type: z.ZodLiteral<"clear-auth-token">;
1567
+ authToken: z.ZodString;
1568
+ fingerprintId: z.ZodString;
1569
+ userId: z.ZodString;
1570
+ fingerprintHash: z.ZodString;
1571
+ }, "strip", z.ZodTypeAny, {
1572
+ type: "clear-auth-token";
1573
+ userId: string;
1574
+ fingerprintId: string;
1575
+ authToken: string;
1576
+ fingerprintHash: string;
1577
+ }, {
1578
+ type: "clear-auth-token";
1579
+ userId: string;
1580
+ fingerprintId: string;
1581
+ authToken: string;
1582
+ fingerprintHash: string;
1583
+ }>, z.ZodObject<{
1584
+ type: z.ZodLiteral<"generate-commit-message">;
1585
+ fingerprintId: z.ZodString;
1586
+ authToken: z.ZodOptional<z.ZodString>;
1587
+ stagedChanges: z.ZodString;
1588
+ }, "strip", z.ZodTypeAny, {
1589
+ type: "generate-commit-message";
1590
+ fingerprintId: string;
1591
+ stagedChanges: string;
1592
+ authToken?: string | undefined;
1593
+ }, {
1594
+ type: "generate-commit-message";
1595
+ fingerprintId: string;
1596
+ stagedChanges: string;
1597
+ authToken?: string | undefined;
1598
+ }>]>;
1599
+ }, "strip", z.ZodTypeAny, {
1600
+ type: "action";
1601
+ data: {
1602
+ type: "user-input";
1603
+ fingerprintId: string;
1604
+ userInputId: string;
1605
+ messages: {
1606
+ content: string | ({
1607
+ type: "text";
1608
+ text: string;
1609
+ cache_control?: {
1610
+ type: "ephemeral";
1611
+ } | undefined;
1612
+ } | {
1613
+ type: "tool_use";
1614
+ name: string;
1615
+ id: string;
1616
+ input: Record<string, any>;
1617
+ cache_control?: {
1618
+ type: "ephemeral";
1619
+ } | undefined;
1620
+ } | {
1621
+ content: string;
1622
+ type: "tool_result";
1623
+ tool_use_id: string;
1624
+ cache_control?: {
1625
+ type: "ephemeral";
1626
+ } | undefined;
1627
+ })[];
1628
+ role: "user" | "assistant";
1629
+ }[];
1630
+ fileContext: {
1631
+ currentWorkingDirectory: string;
1632
+ fileTree: import("../util/file").FileTreeNode[];
1633
+ fileTokenScores: Record<string, Record<string, number>>;
1634
+ knowledgeFiles: Record<string, string>;
1635
+ gitChanges: {
1636
+ status: string;
1637
+ diff: string;
1638
+ diffCached: string;
1639
+ lastCommitMessages: string;
1640
+ };
1641
+ changesSinceLastChat: Record<string, string>;
1642
+ shellConfigFiles: Record<string, string>;
1643
+ systemInfo: {
1644
+ platform: string;
1645
+ shell: string;
1646
+ nodeVersion: string;
1647
+ arch: string;
1648
+ homedir: string;
1649
+ cpus: number;
1650
+ };
1651
+ fileVersions: {
1652
+ path: string;
1653
+ content: string;
1654
+ }[][];
1655
+ };
1656
+ changesAlreadyApplied: {
1657
+ content: string;
1658
+ type: "file" | "patch";
1659
+ filePath: string;
1660
+ }[];
1661
+ costMode: "lite" | "normal" | "pro";
1662
+ authToken?: string | undefined;
1663
+ } | {
1664
+ type: "read-files-response";
1665
+ files: Record<string, string | null>;
1666
+ } | {
1667
+ type: "init";
1668
+ fingerprintId: string;
1669
+ fileContext: {
1670
+ currentWorkingDirectory: string;
1671
+ fileTree: import("../util/file").FileTreeNode[];
1672
+ fileTokenScores: Record<string, Record<string, number>>;
1673
+ knowledgeFiles: Record<string, string>;
1674
+ gitChanges: {
1675
+ status: string;
1676
+ diff: string;
1677
+ diffCached: string;
1678
+ lastCommitMessages: string;
1679
+ };
1680
+ changesSinceLastChat: Record<string, string>;
1681
+ shellConfigFiles: Record<string, string>;
1682
+ systemInfo: {
1683
+ platform: string;
1684
+ shell: string;
1685
+ nodeVersion: string;
1686
+ arch: string;
1687
+ homedir: string;
1688
+ cpus: number;
1689
+ };
1690
+ fileVersions: {
1691
+ path: string;
1692
+ content: string;
1693
+ }[][];
1694
+ };
1695
+ authToken?: string | undefined;
1696
+ } | {
1697
+ type: "usage";
1698
+ fingerprintId: string;
1699
+ authToken?: string | undefined;
1700
+ } | {
1701
+ type: "login-code-request";
1702
+ fingerprintId: string;
1703
+ referralCode?: string | undefined;
1704
+ } | {
1705
+ type: "login-status-request";
1706
+ fingerprintId: string;
1707
+ fingerprintHash: string;
1708
+ } | {
1709
+ type: "clear-auth-token";
1710
+ userId: string;
1711
+ fingerprintId: string;
1712
+ authToken: string;
1713
+ fingerprintHash: string;
1714
+ } | {
1715
+ type: "generate-commit-message";
1716
+ fingerprintId: string;
1717
+ stagedChanges: string;
1718
+ authToken?: string | undefined;
1719
+ };
1720
+ txid: number;
1721
+ }, {
1722
+ type: "action";
1723
+ data: {
1724
+ type: "user-input";
1725
+ fingerprintId: string;
1726
+ userInputId: string;
1727
+ messages: {
1728
+ content: string | ({
1729
+ type: "text";
1730
+ text: string;
1731
+ cache_control?: {
1732
+ type: "ephemeral";
1733
+ } | undefined;
1734
+ } | {
1735
+ type: "tool_use";
1736
+ name: string;
1737
+ id: string;
1738
+ input: Record<string, any>;
1739
+ cache_control?: {
1740
+ type: "ephemeral";
1741
+ } | undefined;
1742
+ } | {
1743
+ content: string;
1744
+ type: "tool_result";
1745
+ tool_use_id: string;
1746
+ cache_control?: {
1747
+ type: "ephemeral";
1748
+ } | undefined;
1749
+ })[];
1750
+ role: "user" | "assistant";
1751
+ }[];
1752
+ fileContext: {
1753
+ currentWorkingDirectory: string;
1754
+ fileTree: import("../util/file").FileTreeNode[];
1755
+ fileTokenScores: Record<string, Record<string, number>>;
1756
+ knowledgeFiles: Record<string, string>;
1757
+ gitChanges: {
1758
+ status: string;
1759
+ diff: string;
1760
+ diffCached: string;
1761
+ lastCommitMessages: string;
1762
+ };
1763
+ changesSinceLastChat: Record<string, string>;
1764
+ shellConfigFiles: Record<string, string>;
1765
+ systemInfo: {
1766
+ platform: string;
1767
+ shell: string;
1768
+ nodeVersion: string;
1769
+ arch: string;
1770
+ homedir: string;
1771
+ cpus: number;
1772
+ };
1773
+ fileVersions: {
1774
+ path: string;
1775
+ content: string;
1776
+ }[][];
1777
+ };
1778
+ changesAlreadyApplied: {
1779
+ content: string;
1780
+ type: "file" | "patch";
1781
+ filePath: string;
1782
+ }[];
1783
+ authToken?: string | undefined;
1784
+ costMode?: "lite" | "normal" | "pro" | undefined;
1785
+ } | {
1786
+ type: "read-files-response";
1787
+ files: Record<string, string | null>;
1788
+ } | {
1789
+ type: "init";
1790
+ fingerprintId: string;
1791
+ fileContext: {
1792
+ currentWorkingDirectory: string;
1793
+ fileTree: import("../util/file").FileTreeNode[];
1794
+ fileTokenScores: Record<string, Record<string, number>>;
1795
+ knowledgeFiles: Record<string, string>;
1796
+ gitChanges: {
1797
+ status: string;
1798
+ diff: string;
1799
+ diffCached: string;
1800
+ lastCommitMessages: string;
1801
+ };
1802
+ changesSinceLastChat: Record<string, string>;
1803
+ shellConfigFiles: Record<string, string>;
1804
+ systemInfo: {
1805
+ platform: string;
1806
+ shell: string;
1807
+ nodeVersion: string;
1808
+ arch: string;
1809
+ homedir: string;
1810
+ cpus: number;
1811
+ };
1812
+ fileVersions: {
1813
+ path: string;
1814
+ content: string;
1815
+ }[][];
1816
+ };
1817
+ authToken?: string | undefined;
1818
+ } | {
1819
+ type: "usage";
1820
+ fingerprintId: string;
1821
+ authToken?: string | undefined;
1822
+ } | {
1823
+ type: "login-code-request";
1824
+ fingerprintId: string;
1825
+ referralCode?: string | undefined;
1826
+ } | {
1827
+ type: "login-status-request";
1828
+ fingerprintId: string;
1829
+ fingerprintHash: string;
1830
+ } | {
1831
+ type: "clear-auth-token";
1832
+ userId: string;
1833
+ fingerprintId: string;
1834
+ authToken: string;
1835
+ fingerprintHash: string;
1836
+ } | {
1837
+ type: "generate-commit-message";
1838
+ fingerprintId: string;
1839
+ stagedChanges: string;
1840
+ authToken?: string | undefined;
1841
+ };
1842
+ txid: number;
1843
+ }>]>;
1844
+ export type ClientMessageType = keyof typeof CLIENT_MESSAGE_SCHEMAS;
1845
+ export type ClientMessage<T extends ClientMessageType = ClientMessageType> = z.infer<(typeof CLIENT_MESSAGE_SCHEMAS)[T]>;
1846
+ export declare const SERVER_MESSAGE_SCHEMAS: {
1847
+ ack: z.ZodObject<{
1848
+ type: z.ZodLiteral<"ack">;
1849
+ txid: z.ZodOptional<z.ZodNumber>;
1850
+ success: z.ZodBoolean;
1851
+ error: z.ZodOptional<z.ZodString>;
1852
+ }, "strip", z.ZodTypeAny, {
1853
+ type: "ack";
1854
+ success: boolean;
1855
+ txid?: number | undefined;
1856
+ error?: string | undefined;
1857
+ }, {
1858
+ type: "ack";
1859
+ success: boolean;
1860
+ txid?: number | undefined;
1861
+ error?: string | undefined;
1862
+ }>;
1863
+ action: z.ZodObject<{
1864
+ type: z.ZodLiteral<"action">;
1865
+ data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1866
+ type: z.ZodLiteral<"response-chunk">;
1867
+ userInputId: z.ZodString;
1868
+ chunk: z.ZodString;
1869
+ }, "strip", z.ZodTypeAny, {
1870
+ type: "response-chunk";
1871
+ userInputId: string;
1872
+ chunk: string;
1873
+ }, {
1874
+ type: "response-chunk";
1875
+ userInputId: string;
1876
+ chunk: string;
1877
+ }>, z.ZodObject<z.objectUtil.extendShape<{
1878
+ type: z.ZodLiteral<"response-complete">;
1879
+ userInputId: z.ZodString;
1880
+ response: z.ZodString;
1881
+ changes: z.ZodArray<z.ZodObject<{
1882
+ type: z.ZodEnum<["patch", "file"]>;
1883
+ filePath: z.ZodString;
1884
+ content: z.ZodString;
1885
+ }, "strip", z.ZodTypeAny, {
1886
+ content: string;
1887
+ type: "file" | "patch";
1888
+ filePath: string;
1889
+ }, {
1890
+ content: string;
1891
+ type: "file" | "patch";
1892
+ filePath: string;
1893
+ }>, "many">;
1894
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1895
+ type: z.ZodEnum<["patch", "file"]>;
1896
+ filePath: z.ZodString;
1897
+ content: z.ZodString;
1898
+ }, "strip", z.ZodTypeAny, {
1899
+ content: string;
1900
+ type: "file" | "patch";
1901
+ filePath: string;
1902
+ }, {
1903
+ content: string;
1904
+ type: "file" | "patch";
1905
+ filePath: string;
1906
+ }>, "many">;
1907
+ addedFileVersions: z.ZodArray<z.ZodObject<{
1908
+ path: z.ZodString;
1909
+ content: z.ZodString;
1910
+ }, "strip", z.ZodTypeAny, {
1911
+ path: string;
1912
+ content: string;
1913
+ }, {
1914
+ path: string;
1915
+ content: string;
1916
+ }>, "many">;
1917
+ resetFileVersions: z.ZodBoolean;
1918
+ }, {
1919
+ next_quota_reset: z.ZodOptional<z.ZodDate>;
1920
+ subscription_active: z.ZodOptional<z.ZodBoolean>;
1921
+ limit: z.ZodOptional<z.ZodNumber>;
1922
+ session_credits_used: z.ZodOptional<z.ZodNumber>;
1923
+ usage: z.ZodOptional<z.ZodNumber>;
1924
+ referralLink: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1925
+ }>, "strip", z.ZodTypeAny, {
1926
+ type: "response-complete";
1927
+ response: string;
1928
+ userInputId: string;
1929
+ changesAlreadyApplied: {
1930
+ content: string;
1931
+ type: "file" | "patch";
1932
+ filePath: string;
1933
+ }[];
1934
+ changes: {
1935
+ content: string;
1936
+ type: "file" | "patch";
1937
+ filePath: string;
1938
+ }[];
1939
+ addedFileVersions: {
1940
+ path: string;
1941
+ content: string;
1942
+ }[];
1943
+ resetFileVersions: boolean;
1944
+ next_quota_reset?: Date | undefined;
1945
+ subscription_active?: boolean | undefined;
1946
+ limit?: number | undefined;
1947
+ session_credits_used?: number | undefined;
1948
+ usage?: number | undefined;
1949
+ referralLink?: string | undefined;
1950
+ }, {
1951
+ type: "response-complete";
1952
+ response: string;
1953
+ userInputId: string;
1954
+ changesAlreadyApplied: {
1955
+ content: string;
1956
+ type: "file" | "patch";
1957
+ filePath: string;
1958
+ }[];
1959
+ changes: {
1960
+ content: string;
1961
+ type: "file" | "patch";
1962
+ filePath: string;
1963
+ }[];
1964
+ addedFileVersions: {
1965
+ path: string;
1966
+ content: string;
1967
+ }[];
1968
+ resetFileVersions: boolean;
1969
+ next_quota_reset?: Date | undefined;
1970
+ subscription_active?: boolean | undefined;
1971
+ limit?: number | undefined;
1972
+ session_credits_used?: number | undefined;
1973
+ usage?: number | undefined;
1974
+ referralLink?: string | undefined;
1975
+ }>, z.ZodObject<{
1976
+ type: z.ZodLiteral<"read-files">;
1977
+ filePaths: z.ZodArray<z.ZodString, "many">;
1978
+ }, "strip", z.ZodTypeAny, {
1979
+ type: "read-files";
1980
+ filePaths: string[];
1981
+ }, {
1982
+ type: "read-files";
1983
+ filePaths: string[];
1984
+ }>, z.ZodObject<{
1985
+ type: z.ZodLiteral<"tool-call">;
1986
+ userInputId: z.ZodString;
1987
+ response: z.ZodString;
1988
+ data: z.ZodObject<{
1989
+ name: z.ZodString;
1990
+ id: z.ZodString;
1991
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
1992
+ }, "strip", z.ZodTypeAny, {
1993
+ name: string;
1994
+ id: string;
1995
+ input: Record<string, any>;
1996
+ }, {
1997
+ name: string;
1998
+ id: string;
1999
+ input: Record<string, any>;
2000
+ }>;
2001
+ changes: z.ZodArray<z.ZodObject<{
2002
+ type: z.ZodEnum<["patch", "file"]>;
2003
+ filePath: z.ZodString;
2004
+ content: z.ZodString;
2005
+ }, "strip", z.ZodTypeAny, {
2006
+ content: string;
2007
+ type: "file" | "patch";
2008
+ filePath: string;
2009
+ }, {
2010
+ content: string;
2011
+ type: "file" | "patch";
2012
+ filePath: string;
2013
+ }>, "many">;
2014
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2015
+ type: z.ZodEnum<["patch", "file"]>;
2016
+ filePath: z.ZodString;
2017
+ content: z.ZodString;
2018
+ }, "strip", z.ZodTypeAny, {
2019
+ content: string;
2020
+ type: "file" | "patch";
2021
+ filePath: string;
2022
+ }, {
2023
+ content: string;
2024
+ type: "file" | "patch";
2025
+ filePath: string;
2026
+ }>, "many">;
2027
+ addedFileVersions: z.ZodArray<z.ZodObject<{
2028
+ path: z.ZodString;
2029
+ content: z.ZodString;
2030
+ }, "strip", z.ZodTypeAny, {
2031
+ path: string;
2032
+ content: string;
2033
+ }, {
2034
+ path: string;
2035
+ content: string;
2036
+ }>, "many">;
2037
+ resetFileVersions: z.ZodBoolean;
2038
+ }, "strip", z.ZodTypeAny, {
2039
+ type: "tool-call";
2040
+ data: {
2041
+ name: string;
2042
+ id: string;
2043
+ input: Record<string, any>;
2044
+ };
2045
+ response: string;
2046
+ userInputId: string;
2047
+ changesAlreadyApplied: {
2048
+ content: string;
2049
+ type: "file" | "patch";
2050
+ filePath: string;
2051
+ }[];
2052
+ changes: {
2053
+ content: string;
2054
+ type: "file" | "patch";
2055
+ filePath: string;
2056
+ }[];
2057
+ addedFileVersions: {
2058
+ path: string;
2059
+ content: string;
2060
+ }[];
2061
+ resetFileVersions: boolean;
2062
+ }, {
2063
+ type: "tool-call";
2064
+ data: {
2065
+ name: string;
2066
+ id: string;
2067
+ input: Record<string, any>;
2068
+ };
2069
+ response: string;
2070
+ userInputId: string;
2071
+ changesAlreadyApplied: {
2072
+ content: string;
2073
+ type: "file" | "patch";
2074
+ filePath: string;
2075
+ }[];
2076
+ changes: {
2077
+ content: string;
2078
+ type: "file" | "patch";
2079
+ filePath: string;
2080
+ }[];
2081
+ addedFileVersions: {
2082
+ path: string;
2083
+ content: string;
2084
+ }[];
2085
+ resetFileVersions: boolean;
2086
+ }>, z.ZodObject<{
2087
+ type: z.ZodLiteral<"terminal-command-result">;
2088
+ userInputId: z.ZodString;
2089
+ result: z.ZodString;
2090
+ }, "strip", z.ZodTypeAny, {
2091
+ type: "terminal-command-result";
2092
+ result: string;
2093
+ userInputId: string;
2094
+ }, {
2095
+ type: "terminal-command-result";
2096
+ result: string;
2097
+ userInputId: string;
2098
+ }>, z.ZodObject<{
2099
+ type: z.ZodLiteral<"npm-version-status">;
2100
+ isUpToDate: z.ZodBoolean;
2101
+ latestVersion: z.ZodString;
2102
+ }, "strip", z.ZodTypeAny, {
2103
+ type: "npm-version-status";
2104
+ isUpToDate: boolean;
2105
+ latestVersion: string;
2106
+ }, {
2107
+ type: "npm-version-status";
2108
+ isUpToDate: boolean;
2109
+ latestVersion: string;
2110
+ }>, z.ZodObject<z.objectUtil.extendShape<{
2111
+ type: z.ZodLiteral<"init-response">;
2112
+ }, Omit<{
2113
+ type: z.ZodLiteral<"usage-response">;
2114
+ usage: z.ZodNumber;
2115
+ limit: z.ZodNumber;
2116
+ referralLink: z.ZodOptional<z.ZodString>;
2117
+ subscription_active: z.ZodBoolean;
2118
+ next_quota_reset: z.ZodDate;
2119
+ session_credits_used: z.ZodNumber;
2120
+ }, "type">>, "strip", z.ZodTypeAny, {
2121
+ type: "init-response";
2122
+ next_quota_reset: Date;
2123
+ subscription_active: boolean;
2124
+ limit: number;
2125
+ session_credits_used: number;
2126
+ usage: number;
2127
+ referralLink?: string | undefined;
2128
+ }, {
2129
+ type: "init-response";
2130
+ next_quota_reset: Date;
2131
+ subscription_active: boolean;
2132
+ limit: number;
2133
+ session_credits_used: number;
2134
+ usage: number;
2135
+ referralLink?: string | undefined;
2136
+ }>, z.ZodObject<{
2137
+ type: z.ZodLiteral<"auth-result">;
2138
+ user: z.ZodOptional<z.ZodObject<{
2139
+ id: z.ZodString;
2140
+ email: z.ZodString;
2141
+ name: z.ZodNullable<z.ZodString>;
2142
+ authToken: z.ZodString;
2143
+ fingerprintId: z.ZodString;
2144
+ fingerprintHash: z.ZodString;
2145
+ }, "strip", z.ZodTypeAny, {
2146
+ email: string;
2147
+ name: string | null;
2148
+ id: string;
2149
+ fingerprintId: string;
2150
+ authToken: string;
2151
+ fingerprintHash: string;
2152
+ }, {
2153
+ email: string;
2154
+ name: string | null;
2155
+ id: string;
2156
+ fingerprintId: string;
2157
+ authToken: string;
2158
+ fingerprintHash: string;
2159
+ }>>;
2160
+ message: z.ZodString;
2161
+ }, "strip", z.ZodTypeAny, {
2162
+ message: string;
2163
+ type: "auth-result";
2164
+ user?: {
2165
+ email: string;
2166
+ name: string | null;
2167
+ id: string;
2168
+ fingerprintId: string;
2169
+ authToken: string;
2170
+ fingerprintHash: string;
2171
+ } | undefined;
2172
+ }, {
2173
+ message: string;
2174
+ type: "auth-result";
2175
+ user?: {
2176
+ email: string;
2177
+ name: string | null;
2178
+ id: string;
2179
+ fingerprintId: string;
2180
+ authToken: string;
2181
+ fingerprintHash: string;
2182
+ } | undefined;
2183
+ }>, z.ZodObject<{
2184
+ type: z.ZodLiteral<"login-code-response">;
2185
+ fingerprintId: z.ZodString;
2186
+ fingerprintHash: z.ZodString;
2187
+ loginUrl: z.ZodString;
2188
+ }, "strip", z.ZodTypeAny, {
2189
+ type: "login-code-response";
2190
+ fingerprintId: string;
2191
+ fingerprintHash: string;
2192
+ loginUrl: string;
2193
+ }, {
2194
+ type: "login-code-response";
2195
+ fingerprintId: string;
2196
+ fingerprintHash: string;
2197
+ loginUrl: string;
2198
+ }>, z.ZodObject<{
2199
+ type: z.ZodLiteral<"usage-response">;
2200
+ usage: z.ZodNumber;
2201
+ limit: z.ZodNumber;
2202
+ referralLink: z.ZodOptional<z.ZodString>;
2203
+ subscription_active: z.ZodBoolean;
2204
+ next_quota_reset: z.ZodDate;
2205
+ session_credits_used: z.ZodNumber;
2206
+ }, "strip", z.ZodTypeAny, {
2207
+ type: "usage-response";
2208
+ next_quota_reset: Date;
2209
+ subscription_active: boolean;
2210
+ limit: number;
2211
+ session_credits_used: number;
2212
+ usage: number;
2213
+ referralLink?: string | undefined;
2214
+ }, {
2215
+ type: "usage-response";
2216
+ next_quota_reset: Date;
2217
+ subscription_active: boolean;
2218
+ limit: number;
2219
+ session_credits_used: number;
2220
+ usage: number;
2221
+ referralLink?: string | undefined;
2222
+ }>, z.ZodObject<{
2223
+ type: z.ZodLiteral<"action-error">;
2224
+ message: z.ZodString;
2225
+ }, "strip", z.ZodTypeAny, {
2226
+ message: string;
2227
+ type: "action-error";
2228
+ }, {
2229
+ message: string;
2230
+ type: "action-error";
2231
+ }>, z.ZodObject<{
2232
+ type: z.ZodLiteral<"commit-message-response">;
2233
+ commitMessage: z.ZodString;
2234
+ }, "strip", z.ZodTypeAny, {
2235
+ type: "commit-message-response";
2236
+ commitMessage: string;
2237
+ }, {
2238
+ type: "commit-message-response";
2239
+ commitMessage: string;
2240
+ }>]>;
2241
+ }, "strip", z.ZodTypeAny, {
2242
+ type: "action";
2243
+ data: {
2244
+ type: "usage-response";
2245
+ next_quota_reset: Date;
2246
+ subscription_active: boolean;
2247
+ limit: number;
2248
+ session_credits_used: number;
2249
+ usage: number;
2250
+ referralLink?: string | undefined;
2251
+ } | {
2252
+ type: "init-response";
2253
+ next_quota_reset: Date;
2254
+ subscription_active: boolean;
2255
+ limit: number;
2256
+ session_credits_used: number;
2257
+ usage: number;
2258
+ referralLink?: string | undefined;
2259
+ } | {
2260
+ type: "response-complete";
2261
+ response: string;
2262
+ userInputId: string;
2263
+ changesAlreadyApplied: {
2264
+ content: string;
2265
+ type: "file" | "patch";
2266
+ filePath: string;
2267
+ }[];
2268
+ changes: {
2269
+ content: string;
2270
+ type: "file" | "patch";
2271
+ filePath: string;
2272
+ }[];
2273
+ addedFileVersions: {
2274
+ path: string;
2275
+ content: string;
2276
+ }[];
2277
+ resetFileVersions: boolean;
2278
+ next_quota_reset?: Date | undefined;
2279
+ subscription_active?: boolean | undefined;
2280
+ limit?: number | undefined;
2281
+ session_credits_used?: number | undefined;
2282
+ usage?: number | undefined;
2283
+ referralLink?: string | undefined;
2284
+ } | {
2285
+ type: "response-chunk";
2286
+ userInputId: string;
2287
+ chunk: string;
2288
+ } | {
2289
+ type: "read-files";
2290
+ filePaths: string[];
2291
+ } | {
2292
+ type: "tool-call";
2293
+ data: {
2294
+ name: string;
2295
+ id: string;
2296
+ input: Record<string, any>;
2297
+ };
2298
+ response: string;
2299
+ userInputId: string;
2300
+ changesAlreadyApplied: {
2301
+ content: string;
2302
+ type: "file" | "patch";
2303
+ filePath: string;
2304
+ }[];
2305
+ changes: {
2306
+ content: string;
2307
+ type: "file" | "patch";
2308
+ filePath: string;
2309
+ }[];
2310
+ addedFileVersions: {
2311
+ path: string;
2312
+ content: string;
2313
+ }[];
2314
+ resetFileVersions: boolean;
2315
+ } | {
2316
+ type: "terminal-command-result";
2317
+ result: string;
2318
+ userInputId: string;
2319
+ } | {
2320
+ type: "npm-version-status";
2321
+ isUpToDate: boolean;
2322
+ latestVersion: string;
2323
+ } | {
2324
+ message: string;
2325
+ type: "auth-result";
2326
+ user?: {
2327
+ email: string;
2328
+ name: string | null;
2329
+ id: string;
2330
+ fingerprintId: string;
2331
+ authToken: string;
2332
+ fingerprintHash: string;
2333
+ } | undefined;
2334
+ } | {
2335
+ type: "login-code-response";
2336
+ fingerprintId: string;
2337
+ fingerprintHash: string;
2338
+ loginUrl: string;
2339
+ } | {
2340
+ message: string;
2341
+ type: "action-error";
2342
+ } | {
2343
+ type: "commit-message-response";
2344
+ commitMessage: string;
2345
+ };
2346
+ }, {
2347
+ type: "action";
2348
+ data: {
2349
+ type: "usage-response";
2350
+ next_quota_reset: Date;
2351
+ subscription_active: boolean;
2352
+ limit: number;
2353
+ session_credits_used: number;
2354
+ usage: number;
2355
+ referralLink?: string | undefined;
2356
+ } | {
2357
+ type: "init-response";
2358
+ next_quota_reset: Date;
2359
+ subscription_active: boolean;
2360
+ limit: number;
2361
+ session_credits_used: number;
2362
+ usage: number;
2363
+ referralLink?: string | undefined;
2364
+ } | {
2365
+ type: "response-complete";
2366
+ response: string;
2367
+ userInputId: string;
2368
+ changesAlreadyApplied: {
2369
+ content: string;
2370
+ type: "file" | "patch";
2371
+ filePath: string;
2372
+ }[];
2373
+ changes: {
2374
+ content: string;
2375
+ type: "file" | "patch";
2376
+ filePath: string;
2377
+ }[];
2378
+ addedFileVersions: {
2379
+ path: string;
2380
+ content: string;
2381
+ }[];
2382
+ resetFileVersions: boolean;
2383
+ next_quota_reset?: Date | undefined;
2384
+ subscription_active?: boolean | undefined;
2385
+ limit?: number | undefined;
2386
+ session_credits_used?: number | undefined;
2387
+ usage?: number | undefined;
2388
+ referralLink?: string | undefined;
2389
+ } | {
2390
+ type: "response-chunk";
2391
+ userInputId: string;
2392
+ chunk: string;
2393
+ } | {
2394
+ type: "read-files";
2395
+ filePaths: string[];
2396
+ } | {
2397
+ type: "tool-call";
2398
+ data: {
2399
+ name: string;
2400
+ id: string;
2401
+ input: Record<string, any>;
2402
+ };
2403
+ response: string;
2404
+ userInputId: string;
2405
+ changesAlreadyApplied: {
2406
+ content: string;
2407
+ type: "file" | "patch";
2408
+ filePath: string;
2409
+ }[];
2410
+ changes: {
2411
+ content: string;
2412
+ type: "file" | "patch";
2413
+ filePath: string;
2414
+ }[];
2415
+ addedFileVersions: {
2416
+ path: string;
2417
+ content: string;
2418
+ }[];
2419
+ resetFileVersions: boolean;
2420
+ } | {
2421
+ type: "terminal-command-result";
2422
+ result: string;
2423
+ userInputId: string;
2424
+ } | {
2425
+ type: "npm-version-status";
2426
+ isUpToDate: boolean;
2427
+ latestVersion: string;
2428
+ } | {
2429
+ message: string;
2430
+ type: "auth-result";
2431
+ user?: {
2432
+ email: string;
2433
+ name: string | null;
2434
+ id: string;
2435
+ fingerprintId: string;
2436
+ authToken: string;
2437
+ fingerprintHash: string;
2438
+ } | undefined;
2439
+ } | {
2440
+ type: "login-code-response";
2441
+ fingerprintId: string;
2442
+ fingerprintHash: string;
2443
+ loginUrl: string;
2444
+ } | {
2445
+ message: string;
2446
+ type: "action-error";
2447
+ } | {
2448
+ type: "commit-message-response";
2449
+ commitMessage: string;
2450
+ };
2451
+ }>;
2452
+ };
2453
+ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2454
+ type: z.ZodLiteral<"ack">;
2455
+ txid: z.ZodOptional<z.ZodNumber>;
2456
+ success: z.ZodBoolean;
2457
+ error: z.ZodOptional<z.ZodString>;
2458
+ }, "strip", z.ZodTypeAny, {
2459
+ type: "ack";
2460
+ success: boolean;
2461
+ txid?: number | undefined;
2462
+ error?: string | undefined;
2463
+ }, {
2464
+ type: "ack";
2465
+ success: boolean;
2466
+ txid?: number | undefined;
2467
+ error?: string | undefined;
2468
+ }>, z.ZodObject<{
2469
+ type: z.ZodLiteral<"action">;
2470
+ data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2471
+ type: z.ZodLiteral<"response-chunk">;
2472
+ userInputId: z.ZodString;
2473
+ chunk: z.ZodString;
2474
+ }, "strip", z.ZodTypeAny, {
2475
+ type: "response-chunk";
2476
+ userInputId: string;
2477
+ chunk: string;
2478
+ }, {
2479
+ type: "response-chunk";
2480
+ userInputId: string;
2481
+ chunk: string;
2482
+ }>, z.ZodObject<z.objectUtil.extendShape<{
2483
+ type: z.ZodLiteral<"response-complete">;
2484
+ userInputId: z.ZodString;
2485
+ response: z.ZodString;
2486
+ changes: z.ZodArray<z.ZodObject<{
2487
+ type: z.ZodEnum<["patch", "file"]>;
2488
+ filePath: z.ZodString;
2489
+ content: z.ZodString;
2490
+ }, "strip", z.ZodTypeAny, {
2491
+ content: string;
2492
+ type: "file" | "patch";
2493
+ filePath: string;
2494
+ }, {
2495
+ content: string;
2496
+ type: "file" | "patch";
2497
+ filePath: string;
2498
+ }>, "many">;
2499
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2500
+ type: z.ZodEnum<["patch", "file"]>;
2501
+ filePath: z.ZodString;
2502
+ content: z.ZodString;
2503
+ }, "strip", z.ZodTypeAny, {
2504
+ content: string;
2505
+ type: "file" | "patch";
2506
+ filePath: string;
2507
+ }, {
2508
+ content: string;
2509
+ type: "file" | "patch";
2510
+ filePath: string;
2511
+ }>, "many">;
2512
+ addedFileVersions: z.ZodArray<z.ZodObject<{
2513
+ path: z.ZodString;
2514
+ content: z.ZodString;
2515
+ }, "strip", z.ZodTypeAny, {
2516
+ path: string;
2517
+ content: string;
2518
+ }, {
2519
+ path: string;
2520
+ content: string;
2521
+ }>, "many">;
2522
+ resetFileVersions: z.ZodBoolean;
2523
+ }, {
2524
+ next_quota_reset: z.ZodOptional<z.ZodDate>;
2525
+ subscription_active: z.ZodOptional<z.ZodBoolean>;
2526
+ limit: z.ZodOptional<z.ZodNumber>;
2527
+ session_credits_used: z.ZodOptional<z.ZodNumber>;
2528
+ usage: z.ZodOptional<z.ZodNumber>;
2529
+ referralLink: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2530
+ }>, "strip", z.ZodTypeAny, {
2531
+ type: "response-complete";
2532
+ response: string;
2533
+ userInputId: string;
2534
+ changesAlreadyApplied: {
2535
+ content: string;
2536
+ type: "file" | "patch";
2537
+ filePath: string;
2538
+ }[];
2539
+ changes: {
2540
+ content: string;
2541
+ type: "file" | "patch";
2542
+ filePath: string;
2543
+ }[];
2544
+ addedFileVersions: {
2545
+ path: string;
2546
+ content: string;
2547
+ }[];
2548
+ resetFileVersions: boolean;
2549
+ next_quota_reset?: Date | undefined;
2550
+ subscription_active?: boolean | undefined;
2551
+ limit?: number | undefined;
2552
+ session_credits_used?: number | undefined;
2553
+ usage?: number | undefined;
2554
+ referralLink?: string | undefined;
2555
+ }, {
2556
+ type: "response-complete";
2557
+ response: string;
2558
+ userInputId: string;
2559
+ changesAlreadyApplied: {
2560
+ content: string;
2561
+ type: "file" | "patch";
2562
+ filePath: string;
2563
+ }[];
2564
+ changes: {
2565
+ content: string;
2566
+ type: "file" | "patch";
2567
+ filePath: string;
2568
+ }[];
2569
+ addedFileVersions: {
2570
+ path: string;
2571
+ content: string;
2572
+ }[];
2573
+ resetFileVersions: boolean;
2574
+ next_quota_reset?: Date | undefined;
2575
+ subscription_active?: boolean | undefined;
2576
+ limit?: number | undefined;
2577
+ session_credits_used?: number | undefined;
2578
+ usage?: number | undefined;
2579
+ referralLink?: string | undefined;
2580
+ }>, z.ZodObject<{
2581
+ type: z.ZodLiteral<"read-files">;
2582
+ filePaths: z.ZodArray<z.ZodString, "many">;
2583
+ }, "strip", z.ZodTypeAny, {
2584
+ type: "read-files";
2585
+ filePaths: string[];
2586
+ }, {
2587
+ type: "read-files";
2588
+ filePaths: string[];
2589
+ }>, z.ZodObject<{
2590
+ type: z.ZodLiteral<"tool-call">;
2591
+ userInputId: z.ZodString;
2592
+ response: z.ZodString;
2593
+ data: z.ZodObject<{
2594
+ name: z.ZodString;
2595
+ id: z.ZodString;
2596
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
2597
+ }, "strip", z.ZodTypeAny, {
2598
+ name: string;
2599
+ id: string;
2600
+ input: Record<string, any>;
2601
+ }, {
2602
+ name: string;
2603
+ id: string;
2604
+ input: Record<string, any>;
2605
+ }>;
2606
+ changes: z.ZodArray<z.ZodObject<{
2607
+ type: z.ZodEnum<["patch", "file"]>;
2608
+ filePath: z.ZodString;
2609
+ content: z.ZodString;
2610
+ }, "strip", z.ZodTypeAny, {
2611
+ content: string;
2612
+ type: "file" | "patch";
2613
+ filePath: string;
2614
+ }, {
2615
+ content: string;
2616
+ type: "file" | "patch";
2617
+ filePath: string;
2618
+ }>, "many">;
2619
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2620
+ type: z.ZodEnum<["patch", "file"]>;
2621
+ filePath: z.ZodString;
2622
+ content: z.ZodString;
2623
+ }, "strip", z.ZodTypeAny, {
2624
+ content: string;
2625
+ type: "file" | "patch";
2626
+ filePath: string;
2627
+ }, {
2628
+ content: string;
2629
+ type: "file" | "patch";
2630
+ filePath: string;
2631
+ }>, "many">;
2632
+ addedFileVersions: z.ZodArray<z.ZodObject<{
2633
+ path: z.ZodString;
2634
+ content: z.ZodString;
2635
+ }, "strip", z.ZodTypeAny, {
2636
+ path: string;
2637
+ content: string;
2638
+ }, {
2639
+ path: string;
2640
+ content: string;
2641
+ }>, "many">;
2642
+ resetFileVersions: z.ZodBoolean;
2643
+ }, "strip", z.ZodTypeAny, {
2644
+ type: "tool-call";
2645
+ data: {
2646
+ name: string;
2647
+ id: string;
2648
+ input: Record<string, any>;
2649
+ };
2650
+ response: string;
2651
+ userInputId: string;
2652
+ changesAlreadyApplied: {
2653
+ content: string;
2654
+ type: "file" | "patch";
2655
+ filePath: string;
2656
+ }[];
2657
+ changes: {
2658
+ content: string;
2659
+ type: "file" | "patch";
2660
+ filePath: string;
2661
+ }[];
2662
+ addedFileVersions: {
2663
+ path: string;
2664
+ content: string;
2665
+ }[];
2666
+ resetFileVersions: boolean;
2667
+ }, {
2668
+ type: "tool-call";
2669
+ data: {
2670
+ name: string;
2671
+ id: string;
2672
+ input: Record<string, any>;
2673
+ };
2674
+ response: string;
2675
+ userInputId: string;
2676
+ changesAlreadyApplied: {
2677
+ content: string;
2678
+ type: "file" | "patch";
2679
+ filePath: string;
2680
+ }[];
2681
+ changes: {
2682
+ content: string;
2683
+ type: "file" | "patch";
2684
+ filePath: string;
2685
+ }[];
2686
+ addedFileVersions: {
2687
+ path: string;
2688
+ content: string;
2689
+ }[];
2690
+ resetFileVersions: boolean;
2691
+ }>, z.ZodObject<{
2692
+ type: z.ZodLiteral<"terminal-command-result">;
2693
+ userInputId: z.ZodString;
2694
+ result: z.ZodString;
2695
+ }, "strip", z.ZodTypeAny, {
2696
+ type: "terminal-command-result";
2697
+ result: string;
2698
+ userInputId: string;
2699
+ }, {
2700
+ type: "terminal-command-result";
2701
+ result: string;
2702
+ userInputId: string;
2703
+ }>, z.ZodObject<{
2704
+ type: z.ZodLiteral<"npm-version-status">;
2705
+ isUpToDate: z.ZodBoolean;
2706
+ latestVersion: z.ZodString;
2707
+ }, "strip", z.ZodTypeAny, {
2708
+ type: "npm-version-status";
2709
+ isUpToDate: boolean;
2710
+ latestVersion: string;
2711
+ }, {
2712
+ type: "npm-version-status";
2713
+ isUpToDate: boolean;
2714
+ latestVersion: string;
2715
+ }>, z.ZodObject<z.objectUtil.extendShape<{
2716
+ type: z.ZodLiteral<"init-response">;
2717
+ }, Omit<{
2718
+ type: z.ZodLiteral<"usage-response">;
2719
+ usage: z.ZodNumber;
2720
+ limit: z.ZodNumber;
2721
+ referralLink: z.ZodOptional<z.ZodString>;
2722
+ subscription_active: z.ZodBoolean;
2723
+ next_quota_reset: z.ZodDate;
2724
+ session_credits_used: z.ZodNumber;
2725
+ }, "type">>, "strip", z.ZodTypeAny, {
2726
+ type: "init-response";
2727
+ next_quota_reset: Date;
2728
+ subscription_active: boolean;
2729
+ limit: number;
2730
+ session_credits_used: number;
2731
+ usage: number;
2732
+ referralLink?: string | undefined;
2733
+ }, {
2734
+ type: "init-response";
2735
+ next_quota_reset: Date;
2736
+ subscription_active: boolean;
2737
+ limit: number;
2738
+ session_credits_used: number;
2739
+ usage: number;
2740
+ referralLink?: string | undefined;
2741
+ }>, z.ZodObject<{
2742
+ type: z.ZodLiteral<"auth-result">;
2743
+ user: z.ZodOptional<z.ZodObject<{
2744
+ id: z.ZodString;
2745
+ email: z.ZodString;
2746
+ name: z.ZodNullable<z.ZodString>;
2747
+ authToken: z.ZodString;
2748
+ fingerprintId: z.ZodString;
2749
+ fingerprintHash: z.ZodString;
2750
+ }, "strip", z.ZodTypeAny, {
2751
+ email: string;
2752
+ name: string | null;
2753
+ id: string;
2754
+ fingerprintId: string;
2755
+ authToken: string;
2756
+ fingerprintHash: string;
2757
+ }, {
2758
+ email: string;
2759
+ name: string | null;
2760
+ id: string;
2761
+ fingerprintId: string;
2762
+ authToken: string;
2763
+ fingerprintHash: string;
2764
+ }>>;
2765
+ message: z.ZodString;
2766
+ }, "strip", z.ZodTypeAny, {
2767
+ message: string;
2768
+ type: "auth-result";
2769
+ user?: {
2770
+ email: string;
2771
+ name: string | null;
2772
+ id: string;
2773
+ fingerprintId: string;
2774
+ authToken: string;
2775
+ fingerprintHash: string;
2776
+ } | undefined;
2777
+ }, {
2778
+ message: string;
2779
+ type: "auth-result";
2780
+ user?: {
2781
+ email: string;
2782
+ name: string | null;
2783
+ id: string;
2784
+ fingerprintId: string;
2785
+ authToken: string;
2786
+ fingerprintHash: string;
2787
+ } | undefined;
2788
+ }>, z.ZodObject<{
2789
+ type: z.ZodLiteral<"login-code-response">;
2790
+ fingerprintId: z.ZodString;
2791
+ fingerprintHash: z.ZodString;
2792
+ loginUrl: z.ZodString;
2793
+ }, "strip", z.ZodTypeAny, {
2794
+ type: "login-code-response";
2795
+ fingerprintId: string;
2796
+ fingerprintHash: string;
2797
+ loginUrl: string;
2798
+ }, {
2799
+ type: "login-code-response";
2800
+ fingerprintId: string;
2801
+ fingerprintHash: string;
2802
+ loginUrl: string;
2803
+ }>, z.ZodObject<{
2804
+ type: z.ZodLiteral<"usage-response">;
2805
+ usage: z.ZodNumber;
2806
+ limit: z.ZodNumber;
2807
+ referralLink: z.ZodOptional<z.ZodString>;
2808
+ subscription_active: z.ZodBoolean;
2809
+ next_quota_reset: z.ZodDate;
2810
+ session_credits_used: z.ZodNumber;
2811
+ }, "strip", z.ZodTypeAny, {
2812
+ type: "usage-response";
2813
+ next_quota_reset: Date;
2814
+ subscription_active: boolean;
2815
+ limit: number;
2816
+ session_credits_used: number;
2817
+ usage: number;
2818
+ referralLink?: string | undefined;
2819
+ }, {
2820
+ type: "usage-response";
2821
+ next_quota_reset: Date;
2822
+ subscription_active: boolean;
2823
+ limit: number;
2824
+ session_credits_used: number;
2825
+ usage: number;
2826
+ referralLink?: string | undefined;
2827
+ }>, z.ZodObject<{
2828
+ type: z.ZodLiteral<"action-error">;
2829
+ message: z.ZodString;
2830
+ }, "strip", z.ZodTypeAny, {
2831
+ message: string;
2832
+ type: "action-error";
2833
+ }, {
2834
+ message: string;
2835
+ type: "action-error";
2836
+ }>, z.ZodObject<{
2837
+ type: z.ZodLiteral<"commit-message-response">;
2838
+ commitMessage: z.ZodString;
2839
+ }, "strip", z.ZodTypeAny, {
2840
+ type: "commit-message-response";
2841
+ commitMessage: string;
2842
+ }, {
2843
+ type: "commit-message-response";
2844
+ commitMessage: string;
2845
+ }>]>;
2846
+ }, "strip", z.ZodTypeAny, {
2847
+ type: "action";
2848
+ data: {
2849
+ type: "usage-response";
2850
+ next_quota_reset: Date;
2851
+ subscription_active: boolean;
2852
+ limit: number;
2853
+ session_credits_used: number;
2854
+ usage: number;
2855
+ referralLink?: string | undefined;
2856
+ } | {
2857
+ type: "init-response";
2858
+ next_quota_reset: Date;
2859
+ subscription_active: boolean;
2860
+ limit: number;
2861
+ session_credits_used: number;
2862
+ usage: number;
2863
+ referralLink?: string | undefined;
2864
+ } | {
2865
+ type: "response-complete";
2866
+ response: string;
2867
+ userInputId: string;
2868
+ changesAlreadyApplied: {
2869
+ content: string;
2870
+ type: "file" | "patch";
2871
+ filePath: string;
2872
+ }[];
2873
+ changes: {
2874
+ content: string;
2875
+ type: "file" | "patch";
2876
+ filePath: string;
2877
+ }[];
2878
+ addedFileVersions: {
2879
+ path: string;
2880
+ content: string;
2881
+ }[];
2882
+ resetFileVersions: boolean;
2883
+ next_quota_reset?: Date | undefined;
2884
+ subscription_active?: boolean | undefined;
2885
+ limit?: number | undefined;
2886
+ session_credits_used?: number | undefined;
2887
+ usage?: number | undefined;
2888
+ referralLink?: string | undefined;
2889
+ } | {
2890
+ type: "response-chunk";
2891
+ userInputId: string;
2892
+ chunk: string;
2893
+ } | {
2894
+ type: "read-files";
2895
+ filePaths: string[];
2896
+ } | {
2897
+ type: "tool-call";
2898
+ data: {
2899
+ name: string;
2900
+ id: string;
2901
+ input: Record<string, any>;
2902
+ };
2903
+ response: string;
2904
+ userInputId: string;
2905
+ changesAlreadyApplied: {
2906
+ content: string;
2907
+ type: "file" | "patch";
2908
+ filePath: string;
2909
+ }[];
2910
+ changes: {
2911
+ content: string;
2912
+ type: "file" | "patch";
2913
+ filePath: string;
2914
+ }[];
2915
+ addedFileVersions: {
2916
+ path: string;
2917
+ content: string;
2918
+ }[];
2919
+ resetFileVersions: boolean;
2920
+ } | {
2921
+ type: "terminal-command-result";
2922
+ result: string;
2923
+ userInputId: string;
2924
+ } | {
2925
+ type: "npm-version-status";
2926
+ isUpToDate: boolean;
2927
+ latestVersion: string;
2928
+ } | {
2929
+ message: string;
2930
+ type: "auth-result";
2931
+ user?: {
2932
+ email: string;
2933
+ name: string | null;
2934
+ id: string;
2935
+ fingerprintId: string;
2936
+ authToken: string;
2937
+ fingerprintHash: string;
2938
+ } | undefined;
2939
+ } | {
2940
+ type: "login-code-response";
2941
+ fingerprintId: string;
2942
+ fingerprintHash: string;
2943
+ loginUrl: string;
2944
+ } | {
2945
+ message: string;
2946
+ type: "action-error";
2947
+ } | {
2948
+ type: "commit-message-response";
2949
+ commitMessage: string;
2950
+ };
2951
+ }, {
2952
+ type: "action";
2953
+ data: {
2954
+ type: "usage-response";
2955
+ next_quota_reset: Date;
2956
+ subscription_active: boolean;
2957
+ limit: number;
2958
+ session_credits_used: number;
2959
+ usage: number;
2960
+ referralLink?: string | undefined;
2961
+ } | {
2962
+ type: "init-response";
2963
+ next_quota_reset: Date;
2964
+ subscription_active: boolean;
2965
+ limit: number;
2966
+ session_credits_used: number;
2967
+ usage: number;
2968
+ referralLink?: string | undefined;
2969
+ } | {
2970
+ type: "response-complete";
2971
+ response: string;
2972
+ userInputId: string;
2973
+ changesAlreadyApplied: {
2974
+ content: string;
2975
+ type: "file" | "patch";
2976
+ filePath: string;
2977
+ }[];
2978
+ changes: {
2979
+ content: string;
2980
+ type: "file" | "patch";
2981
+ filePath: string;
2982
+ }[];
2983
+ addedFileVersions: {
2984
+ path: string;
2985
+ content: string;
2986
+ }[];
2987
+ resetFileVersions: boolean;
2988
+ next_quota_reset?: Date | undefined;
2989
+ subscription_active?: boolean | undefined;
2990
+ limit?: number | undefined;
2991
+ session_credits_used?: number | undefined;
2992
+ usage?: number | undefined;
2993
+ referralLink?: string | undefined;
2994
+ } | {
2995
+ type: "response-chunk";
2996
+ userInputId: string;
2997
+ chunk: string;
2998
+ } | {
2999
+ type: "read-files";
3000
+ filePaths: string[];
3001
+ } | {
3002
+ type: "tool-call";
3003
+ data: {
3004
+ name: string;
3005
+ id: string;
3006
+ input: Record<string, any>;
3007
+ };
3008
+ response: string;
3009
+ userInputId: string;
3010
+ changesAlreadyApplied: {
3011
+ content: string;
3012
+ type: "file" | "patch";
3013
+ filePath: string;
3014
+ }[];
3015
+ changes: {
3016
+ content: string;
3017
+ type: "file" | "patch";
3018
+ filePath: string;
3019
+ }[];
3020
+ addedFileVersions: {
3021
+ path: string;
3022
+ content: string;
3023
+ }[];
3024
+ resetFileVersions: boolean;
3025
+ } | {
3026
+ type: "terminal-command-result";
3027
+ result: string;
3028
+ userInputId: string;
3029
+ } | {
3030
+ type: "npm-version-status";
3031
+ isUpToDate: boolean;
3032
+ latestVersion: string;
3033
+ } | {
3034
+ message: string;
3035
+ type: "auth-result";
3036
+ user?: {
3037
+ email: string;
3038
+ name: string | null;
3039
+ id: string;
3040
+ fingerprintId: string;
3041
+ authToken: string;
3042
+ fingerprintHash: string;
3043
+ } | undefined;
3044
+ } | {
3045
+ type: "login-code-response";
3046
+ fingerprintId: string;
3047
+ fingerprintHash: string;
3048
+ loginUrl: string;
3049
+ } | {
3050
+ message: string;
3051
+ type: "action-error";
3052
+ } | {
3053
+ type: "commit-message-response";
3054
+ commitMessage: string;
3055
+ };
3056
+ }>]>;
3057
+ export type ServerMessageType = keyof typeof SERVER_MESSAGE_SCHEMAS;
3058
+ export type ServerMessage<T extends ServerMessageType = ServerMessageType> = z.infer<(typeof SERVER_MESSAGE_SCHEMAS)[T]>;