codebuff 1.0.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +70 -0
  2. package/dist/chat-storage.d.ts +29 -0
  3. package/dist/chat-storage.js +125 -0
  4. package/dist/chat-storage.js.map +1 -0
  5. package/dist/cli.d.ts +37 -0
  6. package/dist/cli.js +416 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/client.d.ts +41 -0
  9. package/dist/client.js +443 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/code-map/languages.d.ts +12 -0
  12. package/dist/code-map/languages.js +129 -0
  13. package/dist/code-map/languages.js.map +1 -0
  14. package/dist/code-map/parse.d.ts +11 -0
  15. package/dist/code-map/parse.js +127 -0
  16. package/dist/code-map/parse.js.map +1 -0
  17. package/dist/code-map/test-langs/test.d.ts +11 -0
  18. package/dist/code-map/test-langs/test.js +23 -0
  19. package/dist/code-map/test-langs/test.js.map +1 -0
  20. package/dist/code-map/tree-sitter-queries/readme.md +23 -0
  21. package/dist/code-map/tree-sitter-queries/tree-sitter-c-tags.scm +11 -0
  22. package/dist/code-map/tree-sitter-queries/tree-sitter-c_sharp-tags.scm +13 -0
  23. package/dist/code-map/tree-sitter-queries/tree-sitter-cpp-tags.scm +17 -0
  24. package/dist/code-map/tree-sitter-queries/tree-sitter-go-tags.scm +26 -0
  25. package/dist/code-map/tree-sitter-queries/tree-sitter-java-tags.scm +19 -0
  26. package/dist/code-map/tree-sitter-queries/tree-sitter-javascript-tags.scm +15 -0
  27. package/dist/code-map/tree-sitter-queries/tree-sitter-php-tags.scm +26 -0
  28. package/dist/code-map/tree-sitter-queries/tree-sitter-python-tags.scm +9 -0
  29. package/dist/code-map/tree-sitter-queries/tree-sitter-ruby-tags.scm +58 -0
  30. package/dist/code-map/tree-sitter-queries/tree-sitter-rust-tags.scm +26 -0
  31. package/dist/code-map/tree-sitter-queries/tree-sitter-typescript-tags.scm +15 -0
  32. package/dist/code-map/tsconfig.tsbuildinfo +1 -0
  33. package/dist/common/actions.d.ts +1062 -0
  34. package/dist/common/actions.js +180 -0
  35. package/dist/common/actions.js.map +1 -0
  36. package/dist/common/billing/quota-manager.d.ts +59 -0
  37. package/dist/common/billing/quota-manager.js +200 -0
  38. package/dist/common/billing/quota-manager.js.map +1 -0
  39. package/dist/common/constants.d.ts +24 -0
  40. package/dist/common/constants.js +73 -0
  41. package/dist/common/constants.js.map +1 -0
  42. package/dist/common/db/drizzle.config.d.ts +2 -0
  43. package/dist/common/db/drizzle.config.js +17 -0
  44. package/dist/common/db/drizzle.config.js.map +1 -0
  45. package/dist/common/db/env.d.mts +1 -0
  46. package/dist/common/db/env.mjs +26 -0
  47. package/dist/common/db/env.mjs.map +1 -0
  48. package/dist/common/db/index.d.ts +6 -0
  49. package/dist/common/db/index.js +35 -0
  50. package/dist/common/db/index.js.map +1 -0
  51. package/dist/common/db/schema.d.ts +994 -0
  52. package/dist/common/db/schema.js +113 -0
  53. package/dist/common/db/schema.js.map +1 -0
  54. package/dist/common/env.d.mts +1 -0
  55. package/dist/common/env.mjs +34 -0
  56. package/dist/common/env.mjs.map +1 -0
  57. package/dist/common/project-file-tree.d.ts +9 -0
  58. package/dist/common/project-file-tree.js +157 -0
  59. package/dist/common/project-file-tree.js.map +1 -0
  60. package/dist/common/types/referral.d.ts +2 -0
  61. package/dist/common/types/referral.js +5 -0
  62. package/dist/common/types/referral.js.map +1 -0
  63. package/dist/common/types/usage.d.ts +21 -0
  64. package/dist/common/types/usage.js +12 -0
  65. package/dist/common/types/usage.js.map +1 -0
  66. package/dist/common/util/__tests__/string.test.d.ts +1 -0
  67. package/dist/common/util/__tests__/string.test.js +83 -0
  68. package/dist/common/util/__tests__/string.test.js.map +1 -0
  69. package/dist/common/util/array.d.ts +6 -0
  70. package/dist/common/util/array.js +32 -0
  71. package/dist/common/util/array.js.map +1 -0
  72. package/dist/common/util/changes.d.ts +6 -0
  73. package/dist/common/util/changes.js +72 -0
  74. package/dist/common/util/changes.js.map +1 -0
  75. package/dist/common/util/credentials.d.ts +25 -0
  76. package/dist/common/util/credentials.js +24 -0
  77. package/dist/common/util/credentials.js.map +1 -0
  78. package/dist/common/util/dates.d.ts +1 -0
  79. package/dist/common/util/dates.js +13 -0
  80. package/dist/common/util/dates.js.map +1 -0
  81. package/dist/common/util/file.d.ts +106 -0
  82. package/dist/common/util/file.js +138 -0
  83. package/dist/common/util/file.js.map +1 -0
  84. package/dist/common/util/git.d.ts +4 -0
  85. package/dist/common/util/git.js +40 -0
  86. package/dist/common/util/git.js.map +1 -0
  87. package/dist/common/util/helpers.d.ts +1 -0
  88. package/dist/common/util/helpers.js +6 -0
  89. package/dist/common/util/helpers.js.map +1 -0
  90. package/dist/common/util/object.d.ts +18 -0
  91. package/dist/common/util/object.js +91 -0
  92. package/dist/common/util/object.js.map +1 -0
  93. package/dist/common/util/patch.d.ts +1 -0
  94. package/dist/common/util/patch.js +215 -0
  95. package/dist/common/util/patch.js.map +1 -0
  96. package/dist/common/util/promise.d.ts +1 -0
  97. package/dist/common/util/promise.js +33 -0
  98. package/dist/common/util/promise.js.map +1 -0
  99. package/dist/common/util/referral.d.ts +1 -0
  100. package/dist/common/util/referral.js +6 -0
  101. package/dist/common/util/referral.js.map +1 -0
  102. package/dist/common/util/server/referral.d.ts +14 -0
  103. package/dist/common/util/server/referral.js +85 -0
  104. package/dist/common/util/server/referral.js.map +1 -0
  105. package/dist/common/util/string.d.ts +3 -0
  106. package/dist/common/util/string.js +60 -0
  107. package/dist/common/util/string.js.map +1 -0
  108. package/dist/common/util/stripe.d.ts +2 -0
  109. package/dist/common/util/stripe.js +19 -0
  110. package/dist/common/util/stripe.js.map +1 -0
  111. package/dist/common/util/tools.d.ts +2 -0
  112. package/dist/common/util/tools.js +13 -0
  113. package/dist/common/util/tools.js.map +1 -0
  114. package/dist/common/websockets/websocket-client.d.ts +40 -0
  115. package/dist/common/websockets/websocket-client.js +187 -0
  116. package/dist/common/websockets/websocket-client.js.map +1 -0
  117. package/dist/common/websockets/websocket-schema.d.ts +2530 -0
  118. package/dist/common/websockets/websocket-schema.js +55 -0
  119. package/dist/common/websockets/websocket-schema.js.map +1 -0
  120. package/dist/config.d.ts +2 -0
  121. package/dist/config.js +8 -0
  122. package/dist/config.js.map +1 -0
  123. package/dist/credentials.d.ts +3 -0
  124. package/dist/credentials.js +33 -0
  125. package/dist/credentials.js.map +1 -0
  126. package/dist/fingerprint.d.ts +1 -0
  127. package/dist/fingerprint.js +43 -0
  128. package/dist/fingerprint.js.map +1 -0
  129. package/dist/index.d.ts +2 -0
  130. package/dist/index.js +50 -0
  131. package/dist/index.js.map +1 -0
  132. package/dist/manifold-api.d.ts +8 -0
  133. package/dist/manifold-api.js +32 -0
  134. package/dist/manifold-api.js.map +1 -0
  135. package/dist/menu.d.ts +1 -0
  136. package/dist/menu.js +92 -0
  137. package/dist/menu.js.map +1 -0
  138. package/dist/project-files.d.ts +48 -0
  139. package/dist/project-files.js +324 -0
  140. package/dist/project-files.js.map +1 -0
  141. package/dist/tool-handlers.d.ts +11 -0
  142. package/dist/tool-handlers.js +131 -0
  143. package/dist/tool-handlers.js.map +1 -0
  144. package/dist/update-manicode.d.ts +1 -0
  145. package/dist/update-manicode.js +151 -0
  146. package/dist/update-manicode.js.map +1 -0
  147. package/dist/web-scraper.d.ts +3 -0
  148. package/dist/web-scraper.js +79 -0
  149. package/dist/web-scraper.js.map +1 -0
  150. package/dist/worker-script-project-context.d.ts +1 -0
  151. package/dist/worker-script-project-context.js +13 -0
  152. package/dist/worker-script-project-context.js.map +1 -0
  153. package/package.json +62 -0
@@ -0,0 +1,2530 @@
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
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
211
+ path: z.ZodString;
212
+ content: z.ZodString;
213
+ }, "strip", z.ZodTypeAny, {
214
+ path: string;
215
+ content: string;
216
+ }, {
217
+ path: string;
218
+ content: string;
219
+ }>, "many">, "many">;
220
+ }, "strip", z.ZodTypeAny, {
221
+ currentWorkingDirectory: string;
222
+ fileTree: import("../util/file").FileTreeNode[];
223
+ fileTokenScores: Record<string, Record<string, number>>;
224
+ knowledgeFiles: Record<string, string>;
225
+ gitChanges: {
226
+ status: string;
227
+ diff: string;
228
+ diffCached: string;
229
+ lastCommitMessages: string;
230
+ };
231
+ changesSinceLastChat: Record<string, string>;
232
+ shellConfigFiles: Record<string, string>;
233
+ fileVersions: {
234
+ path: string;
235
+ content: string;
236
+ }[][];
237
+ }, {
238
+ currentWorkingDirectory: string;
239
+ fileTree: import("../util/file").FileTreeNode[];
240
+ fileTokenScores: Record<string, Record<string, number>>;
241
+ knowledgeFiles: Record<string, string>;
242
+ gitChanges: {
243
+ status: string;
244
+ diff: string;
245
+ diffCached: string;
246
+ lastCommitMessages: string;
247
+ };
248
+ changesSinceLastChat: Record<string, string>;
249
+ shellConfigFiles: Record<string, string>;
250
+ fileVersions: {
251
+ path: string;
252
+ content: string;
253
+ }[][];
254
+ }>;
255
+ previousChanges: z.ZodArray<z.ZodObject<{
256
+ type: z.ZodEnum<["patch", "file"]>;
257
+ filePath: z.ZodString;
258
+ content: z.ZodString;
259
+ }, "strip", z.ZodTypeAny, {
260
+ content: string;
261
+ type: "file" | "patch";
262
+ filePath: string;
263
+ }, {
264
+ content: string;
265
+ type: "file" | "patch";
266
+ filePath: string;
267
+ }>, "many">;
268
+ }, "strip", z.ZodTypeAny, {
269
+ type: "user-input";
270
+ fingerprintId: string;
271
+ userInputId: string;
272
+ messages: {
273
+ content: string | ({
274
+ type: "text";
275
+ text: string;
276
+ cache_control?: {
277
+ type: "ephemeral";
278
+ } | undefined;
279
+ } | {
280
+ type: "tool_use";
281
+ name: string;
282
+ id: string;
283
+ input: Record<string, any>;
284
+ cache_control?: {
285
+ type: "ephemeral";
286
+ } | undefined;
287
+ } | {
288
+ content: string;
289
+ type: "tool_result";
290
+ tool_use_id: string;
291
+ cache_control?: {
292
+ type: "ephemeral";
293
+ } | undefined;
294
+ })[];
295
+ role: "user" | "assistant";
296
+ }[];
297
+ fileContext: {
298
+ currentWorkingDirectory: string;
299
+ fileTree: import("../util/file").FileTreeNode[];
300
+ fileTokenScores: Record<string, Record<string, number>>;
301
+ knowledgeFiles: Record<string, string>;
302
+ gitChanges: {
303
+ status: string;
304
+ diff: string;
305
+ diffCached: string;
306
+ lastCommitMessages: string;
307
+ };
308
+ changesSinceLastChat: Record<string, string>;
309
+ shellConfigFiles: Record<string, string>;
310
+ fileVersions: {
311
+ path: string;
312
+ content: string;
313
+ }[][];
314
+ };
315
+ previousChanges: {
316
+ content: string;
317
+ type: "file" | "patch";
318
+ filePath: string;
319
+ }[];
320
+ authToken?: string | undefined;
321
+ }, {
322
+ type: "user-input";
323
+ fingerprintId: string;
324
+ userInputId: string;
325
+ messages: {
326
+ content: string | ({
327
+ type: "text";
328
+ text: string;
329
+ cache_control?: {
330
+ type: "ephemeral";
331
+ } | undefined;
332
+ } | {
333
+ type: "tool_use";
334
+ name: string;
335
+ id: string;
336
+ input: Record<string, any>;
337
+ cache_control?: {
338
+ type: "ephemeral";
339
+ } | undefined;
340
+ } | {
341
+ content: string;
342
+ type: "tool_result";
343
+ tool_use_id: string;
344
+ cache_control?: {
345
+ type: "ephemeral";
346
+ } | undefined;
347
+ })[];
348
+ role: "user" | "assistant";
349
+ }[];
350
+ fileContext: {
351
+ currentWorkingDirectory: string;
352
+ fileTree: import("../util/file").FileTreeNode[];
353
+ fileTokenScores: Record<string, Record<string, number>>;
354
+ knowledgeFiles: Record<string, string>;
355
+ gitChanges: {
356
+ status: string;
357
+ diff: string;
358
+ diffCached: string;
359
+ lastCommitMessages: string;
360
+ };
361
+ changesSinceLastChat: Record<string, string>;
362
+ shellConfigFiles: Record<string, string>;
363
+ fileVersions: {
364
+ path: string;
365
+ content: string;
366
+ }[][];
367
+ };
368
+ previousChanges: {
369
+ content: string;
370
+ type: "file" | "patch";
371
+ filePath: string;
372
+ }[];
373
+ authToken?: string | undefined;
374
+ }>, z.ZodObject<{
375
+ type: z.ZodLiteral<"read-files-response">;
376
+ files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
377
+ }, "strip", z.ZodTypeAny, {
378
+ type: "read-files-response";
379
+ files: Record<string, string | null>;
380
+ }, {
381
+ type: "read-files-response";
382
+ files: Record<string, string | null>;
383
+ }>, z.ZodObject<{
384
+ type: z.ZodLiteral<"init">;
385
+ fingerprintId: z.ZodString;
386
+ authToken: z.ZodOptional<z.ZodString>;
387
+ fileContext: z.ZodObject<{
388
+ currentWorkingDirectory: z.ZodString;
389
+ fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
390
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
391
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
392
+ gitChanges: z.ZodObject<{
393
+ status: z.ZodString;
394
+ diff: z.ZodString;
395
+ diffCached: z.ZodString;
396
+ lastCommitMessages: z.ZodString;
397
+ }, "strip", z.ZodTypeAny, {
398
+ status: string;
399
+ diff: string;
400
+ diffCached: string;
401
+ lastCommitMessages: string;
402
+ }, {
403
+ status: string;
404
+ diff: string;
405
+ diffCached: string;
406
+ lastCommitMessages: string;
407
+ }>;
408
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
409
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
410
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
411
+ path: z.ZodString;
412
+ content: z.ZodString;
413
+ }, "strip", z.ZodTypeAny, {
414
+ path: string;
415
+ content: string;
416
+ }, {
417
+ path: string;
418
+ content: string;
419
+ }>, "many">, "many">;
420
+ }, "strip", z.ZodTypeAny, {
421
+ currentWorkingDirectory: string;
422
+ fileTree: import("../util/file").FileTreeNode[];
423
+ fileTokenScores: Record<string, Record<string, number>>;
424
+ knowledgeFiles: Record<string, string>;
425
+ gitChanges: {
426
+ status: string;
427
+ diff: string;
428
+ diffCached: string;
429
+ lastCommitMessages: string;
430
+ };
431
+ changesSinceLastChat: Record<string, string>;
432
+ shellConfigFiles: Record<string, string>;
433
+ fileVersions: {
434
+ path: string;
435
+ content: string;
436
+ }[][];
437
+ }, {
438
+ currentWorkingDirectory: string;
439
+ fileTree: import("../util/file").FileTreeNode[];
440
+ fileTokenScores: Record<string, Record<string, number>>;
441
+ knowledgeFiles: Record<string, string>;
442
+ gitChanges: {
443
+ status: string;
444
+ diff: string;
445
+ diffCached: string;
446
+ lastCommitMessages: string;
447
+ };
448
+ changesSinceLastChat: Record<string, string>;
449
+ shellConfigFiles: Record<string, string>;
450
+ fileVersions: {
451
+ path: string;
452
+ content: string;
453
+ }[][];
454
+ }>;
455
+ }, "strip", z.ZodTypeAny, {
456
+ type: "init";
457
+ fingerprintId: string;
458
+ fileContext: {
459
+ currentWorkingDirectory: string;
460
+ fileTree: import("../util/file").FileTreeNode[];
461
+ fileTokenScores: Record<string, Record<string, number>>;
462
+ knowledgeFiles: Record<string, string>;
463
+ gitChanges: {
464
+ status: string;
465
+ diff: string;
466
+ diffCached: string;
467
+ lastCommitMessages: string;
468
+ };
469
+ changesSinceLastChat: Record<string, string>;
470
+ shellConfigFiles: Record<string, string>;
471
+ fileVersions: {
472
+ path: string;
473
+ content: string;
474
+ }[][];
475
+ };
476
+ authToken?: string | undefined;
477
+ }, {
478
+ type: "init";
479
+ fingerprintId: string;
480
+ fileContext: {
481
+ currentWorkingDirectory: string;
482
+ fileTree: import("../util/file").FileTreeNode[];
483
+ fileTokenScores: Record<string, Record<string, number>>;
484
+ knowledgeFiles: Record<string, string>;
485
+ gitChanges: {
486
+ status: string;
487
+ diff: string;
488
+ diffCached: string;
489
+ lastCommitMessages: string;
490
+ };
491
+ changesSinceLastChat: Record<string, string>;
492
+ shellConfigFiles: Record<string, string>;
493
+ fileVersions: {
494
+ path: string;
495
+ content: string;
496
+ }[][];
497
+ };
498
+ authToken?: string | undefined;
499
+ }>, z.ZodObject<{
500
+ type: z.ZodLiteral<"usage">;
501
+ fingerprintId: z.ZodString;
502
+ authToken: z.ZodOptional<z.ZodString>;
503
+ }, "strip", z.ZodTypeAny, {
504
+ type: "usage";
505
+ fingerprintId: string;
506
+ authToken?: string | undefined;
507
+ }, {
508
+ type: "usage";
509
+ fingerprintId: string;
510
+ authToken?: string | undefined;
511
+ }>, z.ZodObject<{
512
+ type: z.ZodLiteral<"login-code-request">;
513
+ fingerprintId: z.ZodString;
514
+ referralCode: z.ZodOptional<z.ZodString>;
515
+ }, "strip", z.ZodTypeAny, {
516
+ type: "login-code-request";
517
+ fingerprintId: string;
518
+ referralCode?: string | undefined;
519
+ }, {
520
+ type: "login-code-request";
521
+ fingerprintId: string;
522
+ referralCode?: string | undefined;
523
+ }>, z.ZodObject<{
524
+ type: z.ZodLiteral<"login-status-request">;
525
+ fingerprintId: z.ZodString;
526
+ fingerprintHash: z.ZodString;
527
+ }, "strip", z.ZodTypeAny, {
528
+ type: "login-status-request";
529
+ fingerprintId: string;
530
+ fingerprintHash: string;
531
+ }, {
532
+ type: "login-status-request";
533
+ fingerprintId: string;
534
+ fingerprintHash: string;
535
+ }>, z.ZodObject<{
536
+ type: z.ZodLiteral<"clear-auth-token">;
537
+ authToken: z.ZodString;
538
+ fingerprintId: z.ZodString;
539
+ userId: z.ZodString;
540
+ fingerprintHash: z.ZodString;
541
+ }, "strip", z.ZodTypeAny, {
542
+ type: "clear-auth-token";
543
+ authToken: string;
544
+ fingerprintId: string;
545
+ fingerprintHash: string;
546
+ userId: string;
547
+ }, {
548
+ type: "clear-auth-token";
549
+ authToken: string;
550
+ fingerprintId: string;
551
+ fingerprintHash: string;
552
+ userId: string;
553
+ }>, z.ZodObject<{
554
+ type: z.ZodLiteral<"generate-commit-message">;
555
+ fingerprintId: z.ZodString;
556
+ authToken: z.ZodOptional<z.ZodString>;
557
+ stagedChanges: z.ZodString;
558
+ }, "strip", z.ZodTypeAny, {
559
+ type: "generate-commit-message";
560
+ fingerprintId: string;
561
+ stagedChanges: string;
562
+ authToken?: string | undefined;
563
+ }, {
564
+ type: "generate-commit-message";
565
+ fingerprintId: string;
566
+ stagedChanges: string;
567
+ authToken?: string | undefined;
568
+ }>]>;
569
+ }, "strip", z.ZodTypeAny, {
570
+ type: "action";
571
+ data: {
572
+ type: "user-input";
573
+ fingerprintId: string;
574
+ userInputId: string;
575
+ messages: {
576
+ content: string | ({
577
+ type: "text";
578
+ text: string;
579
+ cache_control?: {
580
+ type: "ephemeral";
581
+ } | undefined;
582
+ } | {
583
+ type: "tool_use";
584
+ name: string;
585
+ id: string;
586
+ input: Record<string, any>;
587
+ cache_control?: {
588
+ type: "ephemeral";
589
+ } | undefined;
590
+ } | {
591
+ content: string;
592
+ type: "tool_result";
593
+ tool_use_id: string;
594
+ cache_control?: {
595
+ type: "ephemeral";
596
+ } | undefined;
597
+ })[];
598
+ role: "user" | "assistant";
599
+ }[];
600
+ fileContext: {
601
+ currentWorkingDirectory: string;
602
+ fileTree: import("../util/file").FileTreeNode[];
603
+ fileTokenScores: Record<string, Record<string, number>>;
604
+ knowledgeFiles: Record<string, string>;
605
+ gitChanges: {
606
+ status: string;
607
+ diff: string;
608
+ diffCached: string;
609
+ lastCommitMessages: string;
610
+ };
611
+ changesSinceLastChat: Record<string, string>;
612
+ shellConfigFiles: Record<string, string>;
613
+ fileVersions: {
614
+ path: string;
615
+ content: string;
616
+ }[][];
617
+ };
618
+ previousChanges: {
619
+ content: string;
620
+ type: "file" | "patch";
621
+ filePath: string;
622
+ }[];
623
+ authToken?: string | undefined;
624
+ } | {
625
+ type: "read-files-response";
626
+ files: Record<string, string | null>;
627
+ } | {
628
+ type: "init";
629
+ fingerprintId: string;
630
+ fileContext: {
631
+ currentWorkingDirectory: string;
632
+ fileTree: import("../util/file").FileTreeNode[];
633
+ fileTokenScores: Record<string, Record<string, number>>;
634
+ knowledgeFiles: Record<string, string>;
635
+ gitChanges: {
636
+ status: string;
637
+ diff: string;
638
+ diffCached: string;
639
+ lastCommitMessages: string;
640
+ };
641
+ changesSinceLastChat: Record<string, string>;
642
+ shellConfigFiles: Record<string, string>;
643
+ fileVersions: {
644
+ path: string;
645
+ content: string;
646
+ }[][];
647
+ };
648
+ authToken?: string | undefined;
649
+ } | {
650
+ type: "usage";
651
+ fingerprintId: string;
652
+ authToken?: string | undefined;
653
+ } | {
654
+ type: "login-code-request";
655
+ fingerprintId: string;
656
+ referralCode?: string | undefined;
657
+ } | {
658
+ type: "login-status-request";
659
+ fingerprintId: string;
660
+ fingerprintHash: string;
661
+ } | {
662
+ type: "clear-auth-token";
663
+ authToken: string;
664
+ fingerprintId: string;
665
+ fingerprintHash: string;
666
+ userId: string;
667
+ } | {
668
+ type: "generate-commit-message";
669
+ fingerprintId: string;
670
+ stagedChanges: string;
671
+ authToken?: string | undefined;
672
+ };
673
+ txid: number;
674
+ }, {
675
+ type: "action";
676
+ data: {
677
+ type: "user-input";
678
+ fingerprintId: string;
679
+ userInputId: string;
680
+ messages: {
681
+ content: string | ({
682
+ type: "text";
683
+ text: string;
684
+ cache_control?: {
685
+ type: "ephemeral";
686
+ } | undefined;
687
+ } | {
688
+ type: "tool_use";
689
+ name: string;
690
+ id: string;
691
+ input: Record<string, any>;
692
+ cache_control?: {
693
+ type: "ephemeral";
694
+ } | undefined;
695
+ } | {
696
+ content: string;
697
+ type: "tool_result";
698
+ tool_use_id: string;
699
+ cache_control?: {
700
+ type: "ephemeral";
701
+ } | undefined;
702
+ })[];
703
+ role: "user" | "assistant";
704
+ }[];
705
+ fileContext: {
706
+ currentWorkingDirectory: string;
707
+ fileTree: import("../util/file").FileTreeNode[];
708
+ fileTokenScores: Record<string, Record<string, number>>;
709
+ knowledgeFiles: Record<string, string>;
710
+ gitChanges: {
711
+ status: string;
712
+ diff: string;
713
+ diffCached: string;
714
+ lastCommitMessages: string;
715
+ };
716
+ changesSinceLastChat: Record<string, string>;
717
+ shellConfigFiles: Record<string, string>;
718
+ fileVersions: {
719
+ path: string;
720
+ content: string;
721
+ }[][];
722
+ };
723
+ previousChanges: {
724
+ content: string;
725
+ type: "file" | "patch";
726
+ filePath: string;
727
+ }[];
728
+ authToken?: string | undefined;
729
+ } | {
730
+ type: "read-files-response";
731
+ files: Record<string, string | null>;
732
+ } | {
733
+ type: "init";
734
+ fingerprintId: string;
735
+ fileContext: {
736
+ currentWorkingDirectory: string;
737
+ fileTree: import("../util/file").FileTreeNode[];
738
+ fileTokenScores: Record<string, Record<string, number>>;
739
+ knowledgeFiles: Record<string, string>;
740
+ gitChanges: {
741
+ status: string;
742
+ diff: string;
743
+ diffCached: string;
744
+ lastCommitMessages: string;
745
+ };
746
+ changesSinceLastChat: Record<string, string>;
747
+ shellConfigFiles: Record<string, string>;
748
+ fileVersions: {
749
+ path: string;
750
+ content: string;
751
+ }[][];
752
+ };
753
+ authToken?: string | undefined;
754
+ } | {
755
+ type: "usage";
756
+ fingerprintId: string;
757
+ authToken?: string | undefined;
758
+ } | {
759
+ type: "login-code-request";
760
+ fingerprintId: string;
761
+ referralCode?: string | undefined;
762
+ } | {
763
+ type: "login-status-request";
764
+ fingerprintId: string;
765
+ fingerprintHash: string;
766
+ } | {
767
+ type: "clear-auth-token";
768
+ authToken: string;
769
+ fingerprintId: string;
770
+ fingerprintHash: string;
771
+ userId: string;
772
+ } | {
773
+ type: "generate-commit-message";
774
+ fingerprintId: string;
775
+ stagedChanges: string;
776
+ authToken?: string | undefined;
777
+ };
778
+ txid: number;
779
+ }>;
780
+ };
781
+ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
782
+ type: z.ZodLiteral<"identify">;
783
+ txid: z.ZodNumber;
784
+ clientSessionId: z.ZodString;
785
+ }, "strip", z.ZodTypeAny, {
786
+ type: "identify";
787
+ txid: number;
788
+ clientSessionId: string;
789
+ }, {
790
+ type: "identify";
791
+ txid: number;
792
+ clientSessionId: string;
793
+ }>, z.ZodObject<{
794
+ type: z.ZodLiteral<"subscribe">;
795
+ txid: z.ZodNumber;
796
+ topics: z.ZodArray<z.ZodString, "many">;
797
+ }, "strip", z.ZodTypeAny, {
798
+ type: "subscribe";
799
+ txid: number;
800
+ topics: string[];
801
+ }, {
802
+ type: "subscribe";
803
+ txid: number;
804
+ topics: string[];
805
+ }>, z.ZodObject<{
806
+ type: z.ZodLiteral<"unsubscribe">;
807
+ txid: z.ZodNumber;
808
+ topics: z.ZodArray<z.ZodString, "many">;
809
+ }, "strip", z.ZodTypeAny, {
810
+ type: "unsubscribe";
811
+ txid: number;
812
+ topics: string[];
813
+ }, {
814
+ type: "unsubscribe";
815
+ txid: number;
816
+ topics: string[];
817
+ }>, z.ZodObject<{
818
+ type: z.ZodLiteral<"ping">;
819
+ txid: z.ZodNumber;
820
+ }, "strip", z.ZodTypeAny, {
821
+ type: "ping";
822
+ txid: number;
823
+ }, {
824
+ type: "ping";
825
+ txid: number;
826
+ }>, z.ZodObject<{
827
+ type: z.ZodLiteral<"action">;
828
+ txid: z.ZodNumber;
829
+ data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
830
+ type: z.ZodLiteral<"user-input">;
831
+ fingerprintId: z.ZodString;
832
+ authToken: z.ZodOptional<z.ZodString>;
833
+ userInputId: z.ZodString;
834
+ messages: z.ZodArray<z.ZodObject<{
835
+ role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
836
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
837
+ type: z.ZodLiteral<"text">;
838
+ text: z.ZodString;
839
+ cache_control: z.ZodOptional<z.ZodObject<{
840
+ type: z.ZodLiteral<"ephemeral">;
841
+ }, "strip", z.ZodTypeAny, {
842
+ type: "ephemeral";
843
+ }, {
844
+ type: "ephemeral";
845
+ }>>;
846
+ }, "strip", z.ZodTypeAny, {
847
+ type: "text";
848
+ text: string;
849
+ cache_control?: {
850
+ type: "ephemeral";
851
+ } | undefined;
852
+ }, {
853
+ type: "text";
854
+ text: string;
855
+ cache_control?: {
856
+ type: "ephemeral";
857
+ } | undefined;
858
+ }>, z.ZodObject<{
859
+ type: z.ZodLiteral<"tool_use">;
860
+ id: z.ZodString;
861
+ name: z.ZodString;
862
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
863
+ cache_control: z.ZodOptional<z.ZodObject<{
864
+ type: z.ZodLiteral<"ephemeral">;
865
+ }, "strip", z.ZodTypeAny, {
866
+ type: "ephemeral";
867
+ }, {
868
+ type: "ephemeral";
869
+ }>>;
870
+ }, "strip", z.ZodTypeAny, {
871
+ type: "tool_use";
872
+ name: string;
873
+ id: string;
874
+ input: Record<string, any>;
875
+ cache_control?: {
876
+ type: "ephemeral";
877
+ } | undefined;
878
+ }, {
879
+ type: "tool_use";
880
+ name: string;
881
+ id: string;
882
+ input: Record<string, any>;
883
+ cache_control?: {
884
+ type: "ephemeral";
885
+ } | undefined;
886
+ }>, z.ZodObject<{
887
+ type: z.ZodLiteral<"tool_result">;
888
+ tool_use_id: z.ZodString;
889
+ content: z.ZodString;
890
+ cache_control: z.ZodOptional<z.ZodObject<{
891
+ type: z.ZodLiteral<"ephemeral">;
892
+ }, "strip", z.ZodTypeAny, {
893
+ type: "ephemeral";
894
+ }, {
895
+ type: "ephemeral";
896
+ }>>;
897
+ }, "strip", z.ZodTypeAny, {
898
+ content: string;
899
+ type: "tool_result";
900
+ tool_use_id: string;
901
+ cache_control?: {
902
+ type: "ephemeral";
903
+ } | undefined;
904
+ }, {
905
+ content: string;
906
+ type: "tool_result";
907
+ tool_use_id: string;
908
+ cache_control?: {
909
+ type: "ephemeral";
910
+ } | undefined;
911
+ }>]>, "many">]>;
912
+ }, "strip", z.ZodTypeAny, {
913
+ content: string | ({
914
+ type: "text";
915
+ text: string;
916
+ cache_control?: {
917
+ type: "ephemeral";
918
+ } | undefined;
919
+ } | {
920
+ type: "tool_use";
921
+ name: string;
922
+ id: string;
923
+ input: Record<string, any>;
924
+ cache_control?: {
925
+ type: "ephemeral";
926
+ } | undefined;
927
+ } | {
928
+ content: string;
929
+ type: "tool_result";
930
+ tool_use_id: string;
931
+ cache_control?: {
932
+ type: "ephemeral";
933
+ } | undefined;
934
+ })[];
935
+ role: "user" | "assistant";
936
+ }, {
937
+ content: string | ({
938
+ type: "text";
939
+ text: string;
940
+ cache_control?: {
941
+ type: "ephemeral";
942
+ } | undefined;
943
+ } | {
944
+ type: "tool_use";
945
+ name: string;
946
+ id: string;
947
+ input: Record<string, any>;
948
+ cache_control?: {
949
+ type: "ephemeral";
950
+ } | undefined;
951
+ } | {
952
+ content: string;
953
+ type: "tool_result";
954
+ tool_use_id: string;
955
+ cache_control?: {
956
+ type: "ephemeral";
957
+ } | undefined;
958
+ })[];
959
+ role: "user" | "assistant";
960
+ }>, "many">;
961
+ fileContext: z.ZodObject<{
962
+ currentWorkingDirectory: z.ZodString;
963
+ fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
964
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
965
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
966
+ gitChanges: z.ZodObject<{
967
+ status: z.ZodString;
968
+ diff: z.ZodString;
969
+ diffCached: z.ZodString;
970
+ lastCommitMessages: z.ZodString;
971
+ }, "strip", z.ZodTypeAny, {
972
+ status: string;
973
+ diff: string;
974
+ diffCached: string;
975
+ lastCommitMessages: string;
976
+ }, {
977
+ status: string;
978
+ diff: string;
979
+ diffCached: string;
980
+ lastCommitMessages: string;
981
+ }>;
982
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
983
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
984
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
985
+ path: z.ZodString;
986
+ content: z.ZodString;
987
+ }, "strip", z.ZodTypeAny, {
988
+ path: string;
989
+ content: string;
990
+ }, {
991
+ path: string;
992
+ content: string;
993
+ }>, "many">, "many">;
994
+ }, "strip", z.ZodTypeAny, {
995
+ currentWorkingDirectory: string;
996
+ fileTree: import("../util/file").FileTreeNode[];
997
+ fileTokenScores: Record<string, Record<string, number>>;
998
+ knowledgeFiles: Record<string, string>;
999
+ gitChanges: {
1000
+ status: string;
1001
+ diff: string;
1002
+ diffCached: string;
1003
+ lastCommitMessages: string;
1004
+ };
1005
+ changesSinceLastChat: Record<string, string>;
1006
+ shellConfigFiles: Record<string, string>;
1007
+ fileVersions: {
1008
+ path: string;
1009
+ content: string;
1010
+ }[][];
1011
+ }, {
1012
+ currentWorkingDirectory: string;
1013
+ fileTree: import("../util/file").FileTreeNode[];
1014
+ fileTokenScores: Record<string, Record<string, number>>;
1015
+ knowledgeFiles: Record<string, string>;
1016
+ gitChanges: {
1017
+ status: string;
1018
+ diff: string;
1019
+ diffCached: string;
1020
+ lastCommitMessages: string;
1021
+ };
1022
+ changesSinceLastChat: Record<string, string>;
1023
+ shellConfigFiles: Record<string, string>;
1024
+ fileVersions: {
1025
+ path: string;
1026
+ content: string;
1027
+ }[][];
1028
+ }>;
1029
+ previousChanges: z.ZodArray<z.ZodObject<{
1030
+ type: z.ZodEnum<["patch", "file"]>;
1031
+ filePath: z.ZodString;
1032
+ content: z.ZodString;
1033
+ }, "strip", z.ZodTypeAny, {
1034
+ content: string;
1035
+ type: "file" | "patch";
1036
+ filePath: string;
1037
+ }, {
1038
+ content: string;
1039
+ type: "file" | "patch";
1040
+ filePath: string;
1041
+ }>, "many">;
1042
+ }, "strip", z.ZodTypeAny, {
1043
+ type: "user-input";
1044
+ fingerprintId: string;
1045
+ userInputId: string;
1046
+ messages: {
1047
+ content: string | ({
1048
+ type: "text";
1049
+ text: string;
1050
+ cache_control?: {
1051
+ type: "ephemeral";
1052
+ } | undefined;
1053
+ } | {
1054
+ type: "tool_use";
1055
+ name: string;
1056
+ id: string;
1057
+ input: Record<string, any>;
1058
+ cache_control?: {
1059
+ type: "ephemeral";
1060
+ } | undefined;
1061
+ } | {
1062
+ content: string;
1063
+ type: "tool_result";
1064
+ tool_use_id: string;
1065
+ cache_control?: {
1066
+ type: "ephemeral";
1067
+ } | undefined;
1068
+ })[];
1069
+ role: "user" | "assistant";
1070
+ }[];
1071
+ fileContext: {
1072
+ currentWorkingDirectory: string;
1073
+ fileTree: import("../util/file").FileTreeNode[];
1074
+ fileTokenScores: Record<string, Record<string, number>>;
1075
+ knowledgeFiles: Record<string, string>;
1076
+ gitChanges: {
1077
+ status: string;
1078
+ diff: string;
1079
+ diffCached: string;
1080
+ lastCommitMessages: string;
1081
+ };
1082
+ changesSinceLastChat: Record<string, string>;
1083
+ shellConfigFiles: Record<string, string>;
1084
+ fileVersions: {
1085
+ path: string;
1086
+ content: string;
1087
+ }[][];
1088
+ };
1089
+ previousChanges: {
1090
+ content: string;
1091
+ type: "file" | "patch";
1092
+ filePath: string;
1093
+ }[];
1094
+ authToken?: string | undefined;
1095
+ }, {
1096
+ type: "user-input";
1097
+ fingerprintId: string;
1098
+ userInputId: string;
1099
+ messages: {
1100
+ content: string | ({
1101
+ type: "text";
1102
+ text: string;
1103
+ cache_control?: {
1104
+ type: "ephemeral";
1105
+ } | undefined;
1106
+ } | {
1107
+ type: "tool_use";
1108
+ name: string;
1109
+ id: string;
1110
+ input: Record<string, any>;
1111
+ cache_control?: {
1112
+ type: "ephemeral";
1113
+ } | undefined;
1114
+ } | {
1115
+ content: string;
1116
+ type: "tool_result";
1117
+ tool_use_id: string;
1118
+ cache_control?: {
1119
+ type: "ephemeral";
1120
+ } | undefined;
1121
+ })[];
1122
+ role: "user" | "assistant";
1123
+ }[];
1124
+ fileContext: {
1125
+ currentWorkingDirectory: string;
1126
+ fileTree: import("../util/file").FileTreeNode[];
1127
+ fileTokenScores: Record<string, Record<string, number>>;
1128
+ knowledgeFiles: Record<string, string>;
1129
+ gitChanges: {
1130
+ status: string;
1131
+ diff: string;
1132
+ diffCached: string;
1133
+ lastCommitMessages: string;
1134
+ };
1135
+ changesSinceLastChat: Record<string, string>;
1136
+ shellConfigFiles: Record<string, string>;
1137
+ fileVersions: {
1138
+ path: string;
1139
+ content: string;
1140
+ }[][];
1141
+ };
1142
+ previousChanges: {
1143
+ content: string;
1144
+ type: "file" | "patch";
1145
+ filePath: string;
1146
+ }[];
1147
+ authToken?: string | undefined;
1148
+ }>, z.ZodObject<{
1149
+ type: z.ZodLiteral<"read-files-response">;
1150
+ files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1151
+ }, "strip", z.ZodTypeAny, {
1152
+ type: "read-files-response";
1153
+ files: Record<string, string | null>;
1154
+ }, {
1155
+ type: "read-files-response";
1156
+ files: Record<string, string | null>;
1157
+ }>, z.ZodObject<{
1158
+ type: z.ZodLiteral<"init">;
1159
+ fingerprintId: z.ZodString;
1160
+ authToken: z.ZodOptional<z.ZodString>;
1161
+ fileContext: z.ZodObject<{
1162
+ currentWorkingDirectory: z.ZodString;
1163
+ fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
1164
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
1165
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1166
+ gitChanges: z.ZodObject<{
1167
+ status: z.ZodString;
1168
+ diff: z.ZodString;
1169
+ diffCached: z.ZodString;
1170
+ lastCommitMessages: z.ZodString;
1171
+ }, "strip", z.ZodTypeAny, {
1172
+ status: string;
1173
+ diff: string;
1174
+ diffCached: string;
1175
+ lastCommitMessages: string;
1176
+ }, {
1177
+ status: string;
1178
+ diff: string;
1179
+ diffCached: string;
1180
+ lastCommitMessages: string;
1181
+ }>;
1182
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
1183
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1184
+ fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
1185
+ path: z.ZodString;
1186
+ content: z.ZodString;
1187
+ }, "strip", z.ZodTypeAny, {
1188
+ path: string;
1189
+ content: string;
1190
+ }, {
1191
+ path: string;
1192
+ content: string;
1193
+ }>, "many">, "many">;
1194
+ }, "strip", z.ZodTypeAny, {
1195
+ currentWorkingDirectory: string;
1196
+ fileTree: import("../util/file").FileTreeNode[];
1197
+ fileTokenScores: Record<string, Record<string, number>>;
1198
+ knowledgeFiles: Record<string, string>;
1199
+ gitChanges: {
1200
+ status: string;
1201
+ diff: string;
1202
+ diffCached: string;
1203
+ lastCommitMessages: string;
1204
+ };
1205
+ changesSinceLastChat: Record<string, string>;
1206
+ shellConfigFiles: Record<string, string>;
1207
+ fileVersions: {
1208
+ path: string;
1209
+ content: string;
1210
+ }[][];
1211
+ }, {
1212
+ currentWorkingDirectory: string;
1213
+ fileTree: import("../util/file").FileTreeNode[];
1214
+ fileTokenScores: Record<string, Record<string, number>>;
1215
+ knowledgeFiles: Record<string, string>;
1216
+ gitChanges: {
1217
+ status: string;
1218
+ diff: string;
1219
+ diffCached: string;
1220
+ lastCommitMessages: string;
1221
+ };
1222
+ changesSinceLastChat: Record<string, string>;
1223
+ shellConfigFiles: Record<string, string>;
1224
+ fileVersions: {
1225
+ path: string;
1226
+ content: string;
1227
+ }[][];
1228
+ }>;
1229
+ }, "strip", z.ZodTypeAny, {
1230
+ type: "init";
1231
+ fingerprintId: string;
1232
+ fileContext: {
1233
+ currentWorkingDirectory: string;
1234
+ fileTree: import("../util/file").FileTreeNode[];
1235
+ fileTokenScores: Record<string, Record<string, number>>;
1236
+ knowledgeFiles: Record<string, string>;
1237
+ gitChanges: {
1238
+ status: string;
1239
+ diff: string;
1240
+ diffCached: string;
1241
+ lastCommitMessages: string;
1242
+ };
1243
+ changesSinceLastChat: Record<string, string>;
1244
+ shellConfigFiles: Record<string, string>;
1245
+ fileVersions: {
1246
+ path: string;
1247
+ content: string;
1248
+ }[][];
1249
+ };
1250
+ authToken?: string | undefined;
1251
+ }, {
1252
+ type: "init";
1253
+ fingerprintId: string;
1254
+ fileContext: {
1255
+ currentWorkingDirectory: string;
1256
+ fileTree: import("../util/file").FileTreeNode[];
1257
+ fileTokenScores: Record<string, Record<string, number>>;
1258
+ knowledgeFiles: Record<string, string>;
1259
+ gitChanges: {
1260
+ status: string;
1261
+ diff: string;
1262
+ diffCached: string;
1263
+ lastCommitMessages: string;
1264
+ };
1265
+ changesSinceLastChat: Record<string, string>;
1266
+ shellConfigFiles: Record<string, string>;
1267
+ fileVersions: {
1268
+ path: string;
1269
+ content: string;
1270
+ }[][];
1271
+ };
1272
+ authToken?: string | undefined;
1273
+ }>, z.ZodObject<{
1274
+ type: z.ZodLiteral<"usage">;
1275
+ fingerprintId: z.ZodString;
1276
+ authToken: z.ZodOptional<z.ZodString>;
1277
+ }, "strip", z.ZodTypeAny, {
1278
+ type: "usage";
1279
+ fingerprintId: string;
1280
+ authToken?: string | undefined;
1281
+ }, {
1282
+ type: "usage";
1283
+ fingerprintId: string;
1284
+ authToken?: string | undefined;
1285
+ }>, z.ZodObject<{
1286
+ type: z.ZodLiteral<"login-code-request">;
1287
+ fingerprintId: z.ZodString;
1288
+ referralCode: z.ZodOptional<z.ZodString>;
1289
+ }, "strip", z.ZodTypeAny, {
1290
+ type: "login-code-request";
1291
+ fingerprintId: string;
1292
+ referralCode?: string | undefined;
1293
+ }, {
1294
+ type: "login-code-request";
1295
+ fingerprintId: string;
1296
+ referralCode?: string | undefined;
1297
+ }>, z.ZodObject<{
1298
+ type: z.ZodLiteral<"login-status-request">;
1299
+ fingerprintId: z.ZodString;
1300
+ fingerprintHash: z.ZodString;
1301
+ }, "strip", z.ZodTypeAny, {
1302
+ type: "login-status-request";
1303
+ fingerprintId: string;
1304
+ fingerprintHash: string;
1305
+ }, {
1306
+ type: "login-status-request";
1307
+ fingerprintId: string;
1308
+ fingerprintHash: string;
1309
+ }>, z.ZodObject<{
1310
+ type: z.ZodLiteral<"clear-auth-token">;
1311
+ authToken: z.ZodString;
1312
+ fingerprintId: z.ZodString;
1313
+ userId: z.ZodString;
1314
+ fingerprintHash: z.ZodString;
1315
+ }, "strip", z.ZodTypeAny, {
1316
+ type: "clear-auth-token";
1317
+ authToken: string;
1318
+ fingerprintId: string;
1319
+ fingerprintHash: string;
1320
+ userId: string;
1321
+ }, {
1322
+ type: "clear-auth-token";
1323
+ authToken: string;
1324
+ fingerprintId: string;
1325
+ fingerprintHash: string;
1326
+ userId: string;
1327
+ }>, z.ZodObject<{
1328
+ type: z.ZodLiteral<"generate-commit-message">;
1329
+ fingerprintId: z.ZodString;
1330
+ authToken: z.ZodOptional<z.ZodString>;
1331
+ stagedChanges: z.ZodString;
1332
+ }, "strip", z.ZodTypeAny, {
1333
+ type: "generate-commit-message";
1334
+ fingerprintId: string;
1335
+ stagedChanges: string;
1336
+ authToken?: string | undefined;
1337
+ }, {
1338
+ type: "generate-commit-message";
1339
+ fingerprintId: string;
1340
+ stagedChanges: string;
1341
+ authToken?: string | undefined;
1342
+ }>]>;
1343
+ }, "strip", z.ZodTypeAny, {
1344
+ type: "action";
1345
+ data: {
1346
+ type: "user-input";
1347
+ fingerprintId: string;
1348
+ userInputId: string;
1349
+ messages: {
1350
+ content: string | ({
1351
+ type: "text";
1352
+ text: string;
1353
+ cache_control?: {
1354
+ type: "ephemeral";
1355
+ } | undefined;
1356
+ } | {
1357
+ type: "tool_use";
1358
+ name: string;
1359
+ id: string;
1360
+ input: Record<string, any>;
1361
+ cache_control?: {
1362
+ type: "ephemeral";
1363
+ } | undefined;
1364
+ } | {
1365
+ content: string;
1366
+ type: "tool_result";
1367
+ tool_use_id: string;
1368
+ cache_control?: {
1369
+ type: "ephemeral";
1370
+ } | undefined;
1371
+ })[];
1372
+ role: "user" | "assistant";
1373
+ }[];
1374
+ fileContext: {
1375
+ currentWorkingDirectory: string;
1376
+ fileTree: import("../util/file").FileTreeNode[];
1377
+ fileTokenScores: Record<string, Record<string, number>>;
1378
+ knowledgeFiles: Record<string, string>;
1379
+ gitChanges: {
1380
+ status: string;
1381
+ diff: string;
1382
+ diffCached: string;
1383
+ lastCommitMessages: string;
1384
+ };
1385
+ changesSinceLastChat: Record<string, string>;
1386
+ shellConfigFiles: Record<string, string>;
1387
+ fileVersions: {
1388
+ path: string;
1389
+ content: string;
1390
+ }[][];
1391
+ };
1392
+ previousChanges: {
1393
+ content: string;
1394
+ type: "file" | "patch";
1395
+ filePath: string;
1396
+ }[];
1397
+ authToken?: string | undefined;
1398
+ } | {
1399
+ type: "read-files-response";
1400
+ files: Record<string, string | null>;
1401
+ } | {
1402
+ type: "init";
1403
+ fingerprintId: string;
1404
+ fileContext: {
1405
+ currentWorkingDirectory: string;
1406
+ fileTree: import("../util/file").FileTreeNode[];
1407
+ fileTokenScores: Record<string, Record<string, number>>;
1408
+ knowledgeFiles: Record<string, string>;
1409
+ gitChanges: {
1410
+ status: string;
1411
+ diff: string;
1412
+ diffCached: string;
1413
+ lastCommitMessages: string;
1414
+ };
1415
+ changesSinceLastChat: Record<string, string>;
1416
+ shellConfigFiles: Record<string, string>;
1417
+ fileVersions: {
1418
+ path: string;
1419
+ content: string;
1420
+ }[][];
1421
+ };
1422
+ authToken?: string | undefined;
1423
+ } | {
1424
+ type: "usage";
1425
+ fingerprintId: string;
1426
+ authToken?: string | undefined;
1427
+ } | {
1428
+ type: "login-code-request";
1429
+ fingerprintId: string;
1430
+ referralCode?: string | undefined;
1431
+ } | {
1432
+ type: "login-status-request";
1433
+ fingerprintId: string;
1434
+ fingerprintHash: string;
1435
+ } | {
1436
+ type: "clear-auth-token";
1437
+ authToken: string;
1438
+ fingerprintId: string;
1439
+ fingerprintHash: string;
1440
+ userId: string;
1441
+ } | {
1442
+ type: "generate-commit-message";
1443
+ fingerprintId: string;
1444
+ stagedChanges: string;
1445
+ authToken?: string | undefined;
1446
+ };
1447
+ txid: number;
1448
+ }, {
1449
+ type: "action";
1450
+ data: {
1451
+ type: "user-input";
1452
+ fingerprintId: string;
1453
+ userInputId: string;
1454
+ messages: {
1455
+ content: string | ({
1456
+ type: "text";
1457
+ text: string;
1458
+ cache_control?: {
1459
+ type: "ephemeral";
1460
+ } | undefined;
1461
+ } | {
1462
+ type: "tool_use";
1463
+ name: string;
1464
+ id: string;
1465
+ input: Record<string, any>;
1466
+ cache_control?: {
1467
+ type: "ephemeral";
1468
+ } | undefined;
1469
+ } | {
1470
+ content: string;
1471
+ type: "tool_result";
1472
+ tool_use_id: string;
1473
+ cache_control?: {
1474
+ type: "ephemeral";
1475
+ } | undefined;
1476
+ })[];
1477
+ role: "user" | "assistant";
1478
+ }[];
1479
+ fileContext: {
1480
+ currentWorkingDirectory: string;
1481
+ fileTree: import("../util/file").FileTreeNode[];
1482
+ fileTokenScores: Record<string, Record<string, number>>;
1483
+ knowledgeFiles: Record<string, string>;
1484
+ gitChanges: {
1485
+ status: string;
1486
+ diff: string;
1487
+ diffCached: string;
1488
+ lastCommitMessages: string;
1489
+ };
1490
+ changesSinceLastChat: Record<string, string>;
1491
+ shellConfigFiles: Record<string, string>;
1492
+ fileVersions: {
1493
+ path: string;
1494
+ content: string;
1495
+ }[][];
1496
+ };
1497
+ previousChanges: {
1498
+ content: string;
1499
+ type: "file" | "patch";
1500
+ filePath: string;
1501
+ }[];
1502
+ authToken?: string | undefined;
1503
+ } | {
1504
+ type: "read-files-response";
1505
+ files: Record<string, string | null>;
1506
+ } | {
1507
+ type: "init";
1508
+ fingerprintId: string;
1509
+ fileContext: {
1510
+ currentWorkingDirectory: string;
1511
+ fileTree: import("../util/file").FileTreeNode[];
1512
+ fileTokenScores: Record<string, Record<string, number>>;
1513
+ knowledgeFiles: Record<string, string>;
1514
+ gitChanges: {
1515
+ status: string;
1516
+ diff: string;
1517
+ diffCached: string;
1518
+ lastCommitMessages: string;
1519
+ };
1520
+ changesSinceLastChat: Record<string, string>;
1521
+ shellConfigFiles: Record<string, string>;
1522
+ fileVersions: {
1523
+ path: string;
1524
+ content: string;
1525
+ }[][];
1526
+ };
1527
+ authToken?: string | undefined;
1528
+ } | {
1529
+ type: "usage";
1530
+ fingerprintId: string;
1531
+ authToken?: string | undefined;
1532
+ } | {
1533
+ type: "login-code-request";
1534
+ fingerprintId: string;
1535
+ referralCode?: string | undefined;
1536
+ } | {
1537
+ type: "login-status-request";
1538
+ fingerprintId: string;
1539
+ fingerprintHash: string;
1540
+ } | {
1541
+ type: "clear-auth-token";
1542
+ authToken: string;
1543
+ fingerprintId: string;
1544
+ fingerprintHash: string;
1545
+ userId: string;
1546
+ } | {
1547
+ type: "generate-commit-message";
1548
+ fingerprintId: string;
1549
+ stagedChanges: string;
1550
+ authToken?: string | undefined;
1551
+ };
1552
+ txid: number;
1553
+ }>]>;
1554
+ export type ClientMessageType = keyof typeof CLIENT_MESSAGE_SCHEMAS;
1555
+ export type ClientMessage<T extends ClientMessageType = ClientMessageType> = z.infer<(typeof CLIENT_MESSAGE_SCHEMAS)[T]>;
1556
+ export declare const SERVER_MESSAGE_SCHEMAS: {
1557
+ ack: z.ZodObject<{
1558
+ type: z.ZodLiteral<"ack">;
1559
+ txid: z.ZodOptional<z.ZodNumber>;
1560
+ success: z.ZodBoolean;
1561
+ error: z.ZodOptional<z.ZodString>;
1562
+ }, "strip", z.ZodTypeAny, {
1563
+ type: "ack";
1564
+ success: boolean;
1565
+ txid?: number | undefined;
1566
+ error?: string | undefined;
1567
+ }, {
1568
+ type: "ack";
1569
+ success: boolean;
1570
+ txid?: number | undefined;
1571
+ error?: string | undefined;
1572
+ }>;
1573
+ action: z.ZodObject<{
1574
+ type: z.ZodLiteral<"action">;
1575
+ data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1576
+ type: z.ZodLiteral<"response-chunk">;
1577
+ userInputId: z.ZodString;
1578
+ chunk: z.ZodString;
1579
+ }, "strip", z.ZodTypeAny, {
1580
+ type: "response-chunk";
1581
+ userInputId: string;
1582
+ chunk: string;
1583
+ }, {
1584
+ type: "response-chunk";
1585
+ userInputId: string;
1586
+ chunk: string;
1587
+ }>, z.ZodObject<{
1588
+ type: z.ZodLiteral<"response-complete">;
1589
+ userInputId: z.ZodString;
1590
+ response: z.ZodString;
1591
+ changes: z.ZodArray<z.ZodObject<{
1592
+ type: z.ZodEnum<["patch", "file"]>;
1593
+ filePath: z.ZodString;
1594
+ content: z.ZodString;
1595
+ }, "strip", z.ZodTypeAny, {
1596
+ content: string;
1597
+ type: "file" | "patch";
1598
+ filePath: string;
1599
+ }, {
1600
+ content: string;
1601
+ type: "file" | "patch";
1602
+ filePath: string;
1603
+ }>, "many">;
1604
+ addedFileVersions: z.ZodArray<z.ZodObject<{
1605
+ path: z.ZodString;
1606
+ content: z.ZodString;
1607
+ }, "strip", z.ZodTypeAny, {
1608
+ path: string;
1609
+ content: string;
1610
+ }, {
1611
+ path: string;
1612
+ content: string;
1613
+ }>, "many">;
1614
+ resetFileVersions: z.ZodBoolean;
1615
+ usage: z.ZodOptional<z.ZodNumber>;
1616
+ limit: z.ZodOptional<z.ZodNumber>;
1617
+ subscription_active: z.ZodOptional<z.ZodBoolean>;
1618
+ referralLink: z.ZodOptional<z.ZodString>;
1619
+ }, "strip", z.ZodTypeAny, {
1620
+ type: "response-complete";
1621
+ userInputId: string;
1622
+ response: string;
1623
+ changes: {
1624
+ content: string;
1625
+ type: "file" | "patch";
1626
+ filePath: string;
1627
+ }[];
1628
+ addedFileVersions: {
1629
+ path: string;
1630
+ content: string;
1631
+ }[];
1632
+ resetFileVersions: boolean;
1633
+ usage?: number | undefined;
1634
+ limit?: number | undefined;
1635
+ subscription_active?: boolean | undefined;
1636
+ referralLink?: string | undefined;
1637
+ }, {
1638
+ type: "response-complete";
1639
+ userInputId: string;
1640
+ response: string;
1641
+ changes: {
1642
+ content: string;
1643
+ type: "file" | "patch";
1644
+ filePath: string;
1645
+ }[];
1646
+ addedFileVersions: {
1647
+ path: string;
1648
+ content: string;
1649
+ }[];
1650
+ resetFileVersions: boolean;
1651
+ usage?: number | undefined;
1652
+ limit?: number | undefined;
1653
+ subscription_active?: boolean | undefined;
1654
+ referralLink?: string | undefined;
1655
+ }>, z.ZodObject<{
1656
+ type: z.ZodLiteral<"read-files">;
1657
+ filePaths: z.ZodArray<z.ZodString, "many">;
1658
+ }, "strip", z.ZodTypeAny, {
1659
+ type: "read-files";
1660
+ filePaths: string[];
1661
+ }, {
1662
+ type: "read-files";
1663
+ filePaths: string[];
1664
+ }>, z.ZodObject<{
1665
+ type: z.ZodLiteral<"tool-call">;
1666
+ userInputId: z.ZodString;
1667
+ response: z.ZodString;
1668
+ data: z.ZodObject<{
1669
+ name: z.ZodString;
1670
+ id: z.ZodString;
1671
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
1672
+ }, "strip", z.ZodTypeAny, {
1673
+ name: string;
1674
+ id: string;
1675
+ input: Record<string, any>;
1676
+ }, {
1677
+ name: string;
1678
+ id: string;
1679
+ input: Record<string, any>;
1680
+ }>;
1681
+ changes: z.ZodArray<z.ZodObject<{
1682
+ type: z.ZodEnum<["patch", "file"]>;
1683
+ filePath: z.ZodString;
1684
+ content: z.ZodString;
1685
+ }, "strip", z.ZodTypeAny, {
1686
+ content: string;
1687
+ type: "file" | "patch";
1688
+ filePath: string;
1689
+ }, {
1690
+ content: string;
1691
+ type: "file" | "patch";
1692
+ filePath: string;
1693
+ }>, "many">;
1694
+ addedFileVersions: z.ZodArray<z.ZodObject<{
1695
+ path: z.ZodString;
1696
+ content: z.ZodString;
1697
+ }, "strip", z.ZodTypeAny, {
1698
+ path: string;
1699
+ content: string;
1700
+ }, {
1701
+ path: string;
1702
+ content: string;
1703
+ }>, "many">;
1704
+ resetFileVersions: z.ZodBoolean;
1705
+ }, "strip", z.ZodTypeAny, {
1706
+ type: "tool-call";
1707
+ userInputId: string;
1708
+ response: string;
1709
+ changes: {
1710
+ content: string;
1711
+ type: "file" | "patch";
1712
+ filePath: string;
1713
+ }[];
1714
+ addedFileVersions: {
1715
+ path: string;
1716
+ content: string;
1717
+ }[];
1718
+ resetFileVersions: boolean;
1719
+ data: {
1720
+ name: string;
1721
+ id: string;
1722
+ input: Record<string, any>;
1723
+ };
1724
+ }, {
1725
+ type: "tool-call";
1726
+ userInputId: string;
1727
+ response: string;
1728
+ changes: {
1729
+ content: string;
1730
+ type: "file" | "patch";
1731
+ filePath: string;
1732
+ }[];
1733
+ addedFileVersions: {
1734
+ path: string;
1735
+ content: string;
1736
+ }[];
1737
+ resetFileVersions: boolean;
1738
+ data: {
1739
+ name: string;
1740
+ id: string;
1741
+ input: Record<string, any>;
1742
+ };
1743
+ }>, z.ZodObject<{
1744
+ type: z.ZodLiteral<"terminal-command-result">;
1745
+ userInputId: z.ZodString;
1746
+ result: z.ZodString;
1747
+ }, "strip", z.ZodTypeAny, {
1748
+ type: "terminal-command-result";
1749
+ userInputId: string;
1750
+ result: string;
1751
+ }, {
1752
+ type: "terminal-command-result";
1753
+ userInputId: string;
1754
+ result: string;
1755
+ }>, z.ZodObject<{
1756
+ type: z.ZodLiteral<"npm-version-status">;
1757
+ isUpToDate: z.ZodBoolean;
1758
+ latestVersion: z.ZodString;
1759
+ }, "strip", z.ZodTypeAny, {
1760
+ type: "npm-version-status";
1761
+ isUpToDate: boolean;
1762
+ latestVersion: string;
1763
+ }, {
1764
+ type: "npm-version-status";
1765
+ isUpToDate: boolean;
1766
+ latestVersion: string;
1767
+ }>, z.ZodObject<{
1768
+ type: z.ZodLiteral<"init-response">;
1769
+ }, "strip", z.ZodTypeAny, {
1770
+ type: "init-response";
1771
+ }, {
1772
+ type: "init-response";
1773
+ }>, z.ZodObject<{
1774
+ type: z.ZodLiteral<"auth-result">;
1775
+ user: z.ZodOptional<z.ZodObject<{
1776
+ id: z.ZodString;
1777
+ email: z.ZodString;
1778
+ name: z.ZodNullable<z.ZodString>;
1779
+ authToken: z.ZodString;
1780
+ fingerprintId: z.ZodString;
1781
+ fingerprintHash: z.ZodString;
1782
+ }, "strip", z.ZodTypeAny, {
1783
+ email: string;
1784
+ name: string | null;
1785
+ id: string;
1786
+ authToken: string;
1787
+ fingerprintId: string;
1788
+ fingerprintHash: string;
1789
+ }, {
1790
+ email: string;
1791
+ name: string | null;
1792
+ id: string;
1793
+ authToken: string;
1794
+ fingerprintId: string;
1795
+ fingerprintHash: string;
1796
+ }>>;
1797
+ message: z.ZodString;
1798
+ }, "strip", z.ZodTypeAny, {
1799
+ message: string;
1800
+ type: "auth-result";
1801
+ user?: {
1802
+ email: string;
1803
+ name: string | null;
1804
+ id: string;
1805
+ authToken: string;
1806
+ fingerprintId: string;
1807
+ fingerprintHash: string;
1808
+ } | undefined;
1809
+ }, {
1810
+ message: string;
1811
+ type: "auth-result";
1812
+ user?: {
1813
+ email: string;
1814
+ name: string | null;
1815
+ id: string;
1816
+ authToken: string;
1817
+ fingerprintId: string;
1818
+ fingerprintHash: string;
1819
+ } | undefined;
1820
+ }>, z.ZodObject<{
1821
+ type: z.ZodLiteral<"login-code-response">;
1822
+ fingerprintId: z.ZodString;
1823
+ fingerprintHash: z.ZodString;
1824
+ loginUrl: z.ZodString;
1825
+ }, "strip", z.ZodTypeAny, {
1826
+ type: "login-code-response";
1827
+ fingerprintId: string;
1828
+ fingerprintHash: string;
1829
+ loginUrl: string;
1830
+ }, {
1831
+ type: "login-code-response";
1832
+ fingerprintId: string;
1833
+ fingerprintHash: string;
1834
+ loginUrl: string;
1835
+ }>, z.ZodObject<{
1836
+ type: z.ZodLiteral<"usage-response">;
1837
+ usage: z.ZodNumber;
1838
+ limit: z.ZodNumber;
1839
+ referralLink: z.ZodOptional<z.ZodString>;
1840
+ subscription_active: z.ZodBoolean;
1841
+ }, "strip", z.ZodTypeAny, {
1842
+ type: "usage-response";
1843
+ usage: number;
1844
+ limit: number;
1845
+ subscription_active: boolean;
1846
+ referralLink?: string | undefined;
1847
+ }, {
1848
+ type: "usage-response";
1849
+ usage: number;
1850
+ limit: number;
1851
+ subscription_active: boolean;
1852
+ referralLink?: string | undefined;
1853
+ }>, z.ZodObject<{
1854
+ type: z.ZodLiteral<"action-error">;
1855
+ message: z.ZodString;
1856
+ }, "strip", z.ZodTypeAny, {
1857
+ message: string;
1858
+ type: "action-error";
1859
+ }, {
1860
+ message: string;
1861
+ type: "action-error";
1862
+ }>, z.ZodObject<{
1863
+ type: z.ZodLiteral<"commit-message-response">;
1864
+ commitMessage: z.ZodString;
1865
+ }, "strip", z.ZodTypeAny, {
1866
+ type: "commit-message-response";
1867
+ commitMessage: string;
1868
+ }, {
1869
+ type: "commit-message-response";
1870
+ commitMessage: string;
1871
+ }>]>;
1872
+ }, "strip", z.ZodTypeAny, {
1873
+ type: "action";
1874
+ data: {
1875
+ type: "response-chunk";
1876
+ userInputId: string;
1877
+ chunk: string;
1878
+ } | {
1879
+ type: "response-complete";
1880
+ userInputId: string;
1881
+ response: string;
1882
+ changes: {
1883
+ content: string;
1884
+ type: "file" | "patch";
1885
+ filePath: string;
1886
+ }[];
1887
+ addedFileVersions: {
1888
+ path: string;
1889
+ content: string;
1890
+ }[];
1891
+ resetFileVersions: boolean;
1892
+ usage?: number | undefined;
1893
+ limit?: number | undefined;
1894
+ subscription_active?: boolean | undefined;
1895
+ referralLink?: string | undefined;
1896
+ } | {
1897
+ type: "read-files";
1898
+ filePaths: string[];
1899
+ } | {
1900
+ type: "tool-call";
1901
+ userInputId: string;
1902
+ response: string;
1903
+ changes: {
1904
+ content: string;
1905
+ type: "file" | "patch";
1906
+ filePath: string;
1907
+ }[];
1908
+ addedFileVersions: {
1909
+ path: string;
1910
+ content: string;
1911
+ }[];
1912
+ resetFileVersions: boolean;
1913
+ data: {
1914
+ name: string;
1915
+ id: string;
1916
+ input: Record<string, any>;
1917
+ };
1918
+ } | {
1919
+ type: "terminal-command-result";
1920
+ userInputId: string;
1921
+ result: string;
1922
+ } | {
1923
+ type: "npm-version-status";
1924
+ isUpToDate: boolean;
1925
+ latestVersion: string;
1926
+ } | {
1927
+ type: "init-response";
1928
+ } | {
1929
+ message: string;
1930
+ type: "auth-result";
1931
+ user?: {
1932
+ email: string;
1933
+ name: string | null;
1934
+ id: string;
1935
+ authToken: string;
1936
+ fingerprintId: string;
1937
+ fingerprintHash: string;
1938
+ } | undefined;
1939
+ } | {
1940
+ type: "login-code-response";
1941
+ fingerprintId: string;
1942
+ fingerprintHash: string;
1943
+ loginUrl: string;
1944
+ } | {
1945
+ type: "usage-response";
1946
+ usage: number;
1947
+ limit: number;
1948
+ subscription_active: boolean;
1949
+ referralLink?: string | undefined;
1950
+ } | {
1951
+ message: string;
1952
+ type: "action-error";
1953
+ } | {
1954
+ type: "commit-message-response";
1955
+ commitMessage: string;
1956
+ };
1957
+ }, {
1958
+ type: "action";
1959
+ data: {
1960
+ type: "response-chunk";
1961
+ userInputId: string;
1962
+ chunk: string;
1963
+ } | {
1964
+ type: "response-complete";
1965
+ userInputId: string;
1966
+ response: string;
1967
+ changes: {
1968
+ content: string;
1969
+ type: "file" | "patch";
1970
+ filePath: string;
1971
+ }[];
1972
+ addedFileVersions: {
1973
+ path: string;
1974
+ content: string;
1975
+ }[];
1976
+ resetFileVersions: boolean;
1977
+ usage?: number | undefined;
1978
+ limit?: number | undefined;
1979
+ subscription_active?: boolean | undefined;
1980
+ referralLink?: string | undefined;
1981
+ } | {
1982
+ type: "read-files";
1983
+ filePaths: string[];
1984
+ } | {
1985
+ type: "tool-call";
1986
+ userInputId: string;
1987
+ response: string;
1988
+ changes: {
1989
+ content: string;
1990
+ type: "file" | "patch";
1991
+ filePath: string;
1992
+ }[];
1993
+ addedFileVersions: {
1994
+ path: string;
1995
+ content: string;
1996
+ }[];
1997
+ resetFileVersions: boolean;
1998
+ data: {
1999
+ name: string;
2000
+ id: string;
2001
+ input: Record<string, any>;
2002
+ };
2003
+ } | {
2004
+ type: "terminal-command-result";
2005
+ userInputId: string;
2006
+ result: string;
2007
+ } | {
2008
+ type: "npm-version-status";
2009
+ isUpToDate: boolean;
2010
+ latestVersion: string;
2011
+ } | {
2012
+ type: "init-response";
2013
+ } | {
2014
+ message: string;
2015
+ type: "auth-result";
2016
+ user?: {
2017
+ email: string;
2018
+ name: string | null;
2019
+ id: string;
2020
+ authToken: string;
2021
+ fingerprintId: string;
2022
+ fingerprintHash: string;
2023
+ } | undefined;
2024
+ } | {
2025
+ type: "login-code-response";
2026
+ fingerprintId: string;
2027
+ fingerprintHash: string;
2028
+ loginUrl: string;
2029
+ } | {
2030
+ type: "usage-response";
2031
+ usage: number;
2032
+ limit: number;
2033
+ subscription_active: boolean;
2034
+ referralLink?: string | undefined;
2035
+ } | {
2036
+ message: string;
2037
+ type: "action-error";
2038
+ } | {
2039
+ type: "commit-message-response";
2040
+ commitMessage: string;
2041
+ };
2042
+ }>;
2043
+ };
2044
+ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2045
+ type: z.ZodLiteral<"ack">;
2046
+ txid: z.ZodOptional<z.ZodNumber>;
2047
+ success: z.ZodBoolean;
2048
+ error: z.ZodOptional<z.ZodString>;
2049
+ }, "strip", z.ZodTypeAny, {
2050
+ type: "ack";
2051
+ success: boolean;
2052
+ txid?: number | undefined;
2053
+ error?: string | undefined;
2054
+ }, {
2055
+ type: "ack";
2056
+ success: boolean;
2057
+ txid?: number | undefined;
2058
+ error?: string | undefined;
2059
+ }>, z.ZodObject<{
2060
+ type: z.ZodLiteral<"action">;
2061
+ data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2062
+ type: z.ZodLiteral<"response-chunk">;
2063
+ userInputId: z.ZodString;
2064
+ chunk: z.ZodString;
2065
+ }, "strip", z.ZodTypeAny, {
2066
+ type: "response-chunk";
2067
+ userInputId: string;
2068
+ chunk: string;
2069
+ }, {
2070
+ type: "response-chunk";
2071
+ userInputId: string;
2072
+ chunk: string;
2073
+ }>, z.ZodObject<{
2074
+ type: z.ZodLiteral<"response-complete">;
2075
+ userInputId: z.ZodString;
2076
+ response: z.ZodString;
2077
+ changes: z.ZodArray<z.ZodObject<{
2078
+ type: z.ZodEnum<["patch", "file"]>;
2079
+ filePath: z.ZodString;
2080
+ content: z.ZodString;
2081
+ }, "strip", z.ZodTypeAny, {
2082
+ content: string;
2083
+ type: "file" | "patch";
2084
+ filePath: string;
2085
+ }, {
2086
+ content: string;
2087
+ type: "file" | "patch";
2088
+ filePath: string;
2089
+ }>, "many">;
2090
+ addedFileVersions: z.ZodArray<z.ZodObject<{
2091
+ path: z.ZodString;
2092
+ content: z.ZodString;
2093
+ }, "strip", z.ZodTypeAny, {
2094
+ path: string;
2095
+ content: string;
2096
+ }, {
2097
+ path: string;
2098
+ content: string;
2099
+ }>, "many">;
2100
+ resetFileVersions: z.ZodBoolean;
2101
+ usage: z.ZodOptional<z.ZodNumber>;
2102
+ limit: z.ZodOptional<z.ZodNumber>;
2103
+ subscription_active: z.ZodOptional<z.ZodBoolean>;
2104
+ referralLink: z.ZodOptional<z.ZodString>;
2105
+ }, "strip", z.ZodTypeAny, {
2106
+ type: "response-complete";
2107
+ userInputId: string;
2108
+ response: string;
2109
+ changes: {
2110
+ content: string;
2111
+ type: "file" | "patch";
2112
+ filePath: string;
2113
+ }[];
2114
+ addedFileVersions: {
2115
+ path: string;
2116
+ content: string;
2117
+ }[];
2118
+ resetFileVersions: boolean;
2119
+ usage?: number | undefined;
2120
+ limit?: number | undefined;
2121
+ subscription_active?: boolean | undefined;
2122
+ referralLink?: string | undefined;
2123
+ }, {
2124
+ type: "response-complete";
2125
+ userInputId: string;
2126
+ response: string;
2127
+ changes: {
2128
+ content: string;
2129
+ type: "file" | "patch";
2130
+ filePath: string;
2131
+ }[];
2132
+ addedFileVersions: {
2133
+ path: string;
2134
+ content: string;
2135
+ }[];
2136
+ resetFileVersions: boolean;
2137
+ usage?: number | undefined;
2138
+ limit?: number | undefined;
2139
+ subscription_active?: boolean | undefined;
2140
+ referralLink?: string | undefined;
2141
+ }>, z.ZodObject<{
2142
+ type: z.ZodLiteral<"read-files">;
2143
+ filePaths: z.ZodArray<z.ZodString, "many">;
2144
+ }, "strip", z.ZodTypeAny, {
2145
+ type: "read-files";
2146
+ filePaths: string[];
2147
+ }, {
2148
+ type: "read-files";
2149
+ filePaths: string[];
2150
+ }>, z.ZodObject<{
2151
+ type: z.ZodLiteral<"tool-call">;
2152
+ userInputId: z.ZodString;
2153
+ response: z.ZodString;
2154
+ data: z.ZodObject<{
2155
+ name: z.ZodString;
2156
+ id: z.ZodString;
2157
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
2158
+ }, "strip", z.ZodTypeAny, {
2159
+ name: string;
2160
+ id: string;
2161
+ input: Record<string, any>;
2162
+ }, {
2163
+ name: string;
2164
+ id: string;
2165
+ input: Record<string, any>;
2166
+ }>;
2167
+ changes: z.ZodArray<z.ZodObject<{
2168
+ type: z.ZodEnum<["patch", "file"]>;
2169
+ filePath: z.ZodString;
2170
+ content: z.ZodString;
2171
+ }, "strip", z.ZodTypeAny, {
2172
+ content: string;
2173
+ type: "file" | "patch";
2174
+ filePath: string;
2175
+ }, {
2176
+ content: string;
2177
+ type: "file" | "patch";
2178
+ filePath: string;
2179
+ }>, "many">;
2180
+ addedFileVersions: z.ZodArray<z.ZodObject<{
2181
+ path: z.ZodString;
2182
+ content: z.ZodString;
2183
+ }, "strip", z.ZodTypeAny, {
2184
+ path: string;
2185
+ content: string;
2186
+ }, {
2187
+ path: string;
2188
+ content: string;
2189
+ }>, "many">;
2190
+ resetFileVersions: z.ZodBoolean;
2191
+ }, "strip", z.ZodTypeAny, {
2192
+ type: "tool-call";
2193
+ userInputId: string;
2194
+ response: string;
2195
+ changes: {
2196
+ content: string;
2197
+ type: "file" | "patch";
2198
+ filePath: string;
2199
+ }[];
2200
+ addedFileVersions: {
2201
+ path: string;
2202
+ content: string;
2203
+ }[];
2204
+ resetFileVersions: boolean;
2205
+ data: {
2206
+ name: string;
2207
+ id: string;
2208
+ input: Record<string, any>;
2209
+ };
2210
+ }, {
2211
+ type: "tool-call";
2212
+ userInputId: string;
2213
+ response: string;
2214
+ changes: {
2215
+ content: string;
2216
+ type: "file" | "patch";
2217
+ filePath: string;
2218
+ }[];
2219
+ addedFileVersions: {
2220
+ path: string;
2221
+ content: string;
2222
+ }[];
2223
+ resetFileVersions: boolean;
2224
+ data: {
2225
+ name: string;
2226
+ id: string;
2227
+ input: Record<string, any>;
2228
+ };
2229
+ }>, z.ZodObject<{
2230
+ type: z.ZodLiteral<"terminal-command-result">;
2231
+ userInputId: z.ZodString;
2232
+ result: z.ZodString;
2233
+ }, "strip", z.ZodTypeAny, {
2234
+ type: "terminal-command-result";
2235
+ userInputId: string;
2236
+ result: string;
2237
+ }, {
2238
+ type: "terminal-command-result";
2239
+ userInputId: string;
2240
+ result: string;
2241
+ }>, z.ZodObject<{
2242
+ type: z.ZodLiteral<"npm-version-status">;
2243
+ isUpToDate: z.ZodBoolean;
2244
+ latestVersion: z.ZodString;
2245
+ }, "strip", z.ZodTypeAny, {
2246
+ type: "npm-version-status";
2247
+ isUpToDate: boolean;
2248
+ latestVersion: string;
2249
+ }, {
2250
+ type: "npm-version-status";
2251
+ isUpToDate: boolean;
2252
+ latestVersion: string;
2253
+ }>, z.ZodObject<{
2254
+ type: z.ZodLiteral<"init-response">;
2255
+ }, "strip", z.ZodTypeAny, {
2256
+ type: "init-response";
2257
+ }, {
2258
+ type: "init-response";
2259
+ }>, z.ZodObject<{
2260
+ type: z.ZodLiteral<"auth-result">;
2261
+ user: z.ZodOptional<z.ZodObject<{
2262
+ id: z.ZodString;
2263
+ email: z.ZodString;
2264
+ name: z.ZodNullable<z.ZodString>;
2265
+ authToken: z.ZodString;
2266
+ fingerprintId: z.ZodString;
2267
+ fingerprintHash: z.ZodString;
2268
+ }, "strip", z.ZodTypeAny, {
2269
+ email: string;
2270
+ name: string | null;
2271
+ id: string;
2272
+ authToken: string;
2273
+ fingerprintId: string;
2274
+ fingerprintHash: string;
2275
+ }, {
2276
+ email: string;
2277
+ name: string | null;
2278
+ id: string;
2279
+ authToken: string;
2280
+ fingerprintId: string;
2281
+ fingerprintHash: string;
2282
+ }>>;
2283
+ message: z.ZodString;
2284
+ }, "strip", z.ZodTypeAny, {
2285
+ message: string;
2286
+ type: "auth-result";
2287
+ user?: {
2288
+ email: string;
2289
+ name: string | null;
2290
+ id: string;
2291
+ authToken: string;
2292
+ fingerprintId: string;
2293
+ fingerprintHash: string;
2294
+ } | undefined;
2295
+ }, {
2296
+ message: string;
2297
+ type: "auth-result";
2298
+ user?: {
2299
+ email: string;
2300
+ name: string | null;
2301
+ id: string;
2302
+ authToken: string;
2303
+ fingerprintId: string;
2304
+ fingerprintHash: string;
2305
+ } | undefined;
2306
+ }>, z.ZodObject<{
2307
+ type: z.ZodLiteral<"login-code-response">;
2308
+ fingerprintId: z.ZodString;
2309
+ fingerprintHash: z.ZodString;
2310
+ loginUrl: z.ZodString;
2311
+ }, "strip", z.ZodTypeAny, {
2312
+ type: "login-code-response";
2313
+ fingerprintId: string;
2314
+ fingerprintHash: string;
2315
+ loginUrl: string;
2316
+ }, {
2317
+ type: "login-code-response";
2318
+ fingerprintId: string;
2319
+ fingerprintHash: string;
2320
+ loginUrl: string;
2321
+ }>, z.ZodObject<{
2322
+ type: z.ZodLiteral<"usage-response">;
2323
+ usage: z.ZodNumber;
2324
+ limit: z.ZodNumber;
2325
+ referralLink: z.ZodOptional<z.ZodString>;
2326
+ subscription_active: z.ZodBoolean;
2327
+ }, "strip", z.ZodTypeAny, {
2328
+ type: "usage-response";
2329
+ usage: number;
2330
+ limit: number;
2331
+ subscription_active: boolean;
2332
+ referralLink?: string | undefined;
2333
+ }, {
2334
+ type: "usage-response";
2335
+ usage: number;
2336
+ limit: number;
2337
+ subscription_active: boolean;
2338
+ referralLink?: string | undefined;
2339
+ }>, z.ZodObject<{
2340
+ type: z.ZodLiteral<"action-error">;
2341
+ message: z.ZodString;
2342
+ }, "strip", z.ZodTypeAny, {
2343
+ message: string;
2344
+ type: "action-error";
2345
+ }, {
2346
+ message: string;
2347
+ type: "action-error";
2348
+ }>, z.ZodObject<{
2349
+ type: z.ZodLiteral<"commit-message-response">;
2350
+ commitMessage: z.ZodString;
2351
+ }, "strip", z.ZodTypeAny, {
2352
+ type: "commit-message-response";
2353
+ commitMessage: string;
2354
+ }, {
2355
+ type: "commit-message-response";
2356
+ commitMessage: string;
2357
+ }>]>;
2358
+ }, "strip", z.ZodTypeAny, {
2359
+ type: "action";
2360
+ data: {
2361
+ type: "response-chunk";
2362
+ userInputId: string;
2363
+ chunk: string;
2364
+ } | {
2365
+ type: "response-complete";
2366
+ userInputId: string;
2367
+ response: string;
2368
+ changes: {
2369
+ content: string;
2370
+ type: "file" | "patch";
2371
+ filePath: string;
2372
+ }[];
2373
+ addedFileVersions: {
2374
+ path: string;
2375
+ content: string;
2376
+ }[];
2377
+ resetFileVersions: boolean;
2378
+ usage?: number | undefined;
2379
+ limit?: number | undefined;
2380
+ subscription_active?: boolean | undefined;
2381
+ referralLink?: string | undefined;
2382
+ } | {
2383
+ type: "read-files";
2384
+ filePaths: string[];
2385
+ } | {
2386
+ type: "tool-call";
2387
+ userInputId: string;
2388
+ response: string;
2389
+ changes: {
2390
+ content: string;
2391
+ type: "file" | "patch";
2392
+ filePath: string;
2393
+ }[];
2394
+ addedFileVersions: {
2395
+ path: string;
2396
+ content: string;
2397
+ }[];
2398
+ resetFileVersions: boolean;
2399
+ data: {
2400
+ name: string;
2401
+ id: string;
2402
+ input: Record<string, any>;
2403
+ };
2404
+ } | {
2405
+ type: "terminal-command-result";
2406
+ userInputId: string;
2407
+ result: string;
2408
+ } | {
2409
+ type: "npm-version-status";
2410
+ isUpToDate: boolean;
2411
+ latestVersion: string;
2412
+ } | {
2413
+ type: "init-response";
2414
+ } | {
2415
+ message: string;
2416
+ type: "auth-result";
2417
+ user?: {
2418
+ email: string;
2419
+ name: string | null;
2420
+ id: string;
2421
+ authToken: string;
2422
+ fingerprintId: string;
2423
+ fingerprintHash: string;
2424
+ } | undefined;
2425
+ } | {
2426
+ type: "login-code-response";
2427
+ fingerprintId: string;
2428
+ fingerprintHash: string;
2429
+ loginUrl: string;
2430
+ } | {
2431
+ type: "usage-response";
2432
+ usage: number;
2433
+ limit: number;
2434
+ subscription_active: boolean;
2435
+ referralLink?: string | undefined;
2436
+ } | {
2437
+ message: string;
2438
+ type: "action-error";
2439
+ } | {
2440
+ type: "commit-message-response";
2441
+ commitMessage: string;
2442
+ };
2443
+ }, {
2444
+ type: "action";
2445
+ data: {
2446
+ type: "response-chunk";
2447
+ userInputId: string;
2448
+ chunk: string;
2449
+ } | {
2450
+ type: "response-complete";
2451
+ userInputId: string;
2452
+ response: string;
2453
+ changes: {
2454
+ content: string;
2455
+ type: "file" | "patch";
2456
+ filePath: string;
2457
+ }[];
2458
+ addedFileVersions: {
2459
+ path: string;
2460
+ content: string;
2461
+ }[];
2462
+ resetFileVersions: boolean;
2463
+ usage?: number | undefined;
2464
+ limit?: number | undefined;
2465
+ subscription_active?: boolean | undefined;
2466
+ referralLink?: string | undefined;
2467
+ } | {
2468
+ type: "read-files";
2469
+ filePaths: string[];
2470
+ } | {
2471
+ type: "tool-call";
2472
+ userInputId: string;
2473
+ response: string;
2474
+ changes: {
2475
+ content: string;
2476
+ type: "file" | "patch";
2477
+ filePath: string;
2478
+ }[];
2479
+ addedFileVersions: {
2480
+ path: string;
2481
+ content: string;
2482
+ }[];
2483
+ resetFileVersions: boolean;
2484
+ data: {
2485
+ name: string;
2486
+ id: string;
2487
+ input: Record<string, any>;
2488
+ };
2489
+ } | {
2490
+ type: "terminal-command-result";
2491
+ userInputId: string;
2492
+ result: string;
2493
+ } | {
2494
+ type: "npm-version-status";
2495
+ isUpToDate: boolean;
2496
+ latestVersion: string;
2497
+ } | {
2498
+ type: "init-response";
2499
+ } | {
2500
+ message: string;
2501
+ type: "auth-result";
2502
+ user?: {
2503
+ email: string;
2504
+ name: string | null;
2505
+ id: string;
2506
+ authToken: string;
2507
+ fingerprintId: string;
2508
+ fingerprintHash: string;
2509
+ } | undefined;
2510
+ } | {
2511
+ type: "login-code-response";
2512
+ fingerprintId: string;
2513
+ fingerprintHash: string;
2514
+ loginUrl: string;
2515
+ } | {
2516
+ type: "usage-response";
2517
+ usage: number;
2518
+ limit: number;
2519
+ subscription_active: boolean;
2520
+ referralLink?: string | undefined;
2521
+ } | {
2522
+ message: string;
2523
+ type: "action-error";
2524
+ } | {
2525
+ type: "commit-message-response";
2526
+ commitMessage: string;
2527
+ };
2528
+ }>]>;
2529
+ export type ServerMessageType = keyof typeof SERVER_MESSAGE_SCHEMAS;
2530
+ export type ServerMessage<T extends ServerMessageType = ServerMessageType> = z.infer<(typeof SERVER_MESSAGE_SCHEMAS)[T]>;