codebuff 1.0.169 → 1.0.170

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