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