codecane 1.0.156 → 1.0.171

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 (106) 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 +64 -0
  8. package/dist/checkpoints.js +147 -0
  9. package/dist/checkpoints.js.map +1 -0
  10. package/dist/cli.d.ts +22 -16
  11. package/dist/cli.js +472 -367
  12. package/dist/cli.js.map +1 -1
  13. package/dist/client.d.ts +178 -25
  14. package/dist/client.js +252 -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 +2083 -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 +461 -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 +6 -2
  49. package/dist/common/util/file.js +30 -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 +3920 -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 +40 -2
  83. package/dist/project-files.js +95 -17
  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/logger.d.ts +1 -0
  89. package/dist/utils/logger.js +46 -0
  90. package/dist/utils/logger.js.map +1 -0
  91. package/dist/utils/process-xml-chunks.d.ts +37 -0
  92. package/dist/utils/process-xml-chunks.js +247 -0
  93. package/dist/utils/process-xml-chunks.js.map +1 -0
  94. package/dist/utils/spinner.d.ts +11 -0
  95. package/dist/utils/spinner.js +87 -0
  96. package/dist/utils/spinner.js.map +1 -0
  97. package/dist/utils/terminal.d.ts +3 -3
  98. package/dist/utils/terminal.js +23 -24
  99. package/dist/utils/terminal.js.map +1 -1
  100. package/dist/web-scraper.d.ts +1 -1
  101. package/dist/web-scraper.js +11 -7
  102. package/dist/web-scraper.js.map +1 -1
  103. package/package.json +3 -4
  104. package/dist/__tests__/browser-runner.test.js +0 -15
  105. package/dist/__tests__/browser-runner.test.js.map +0 -1
  106. /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">;
@@ -489,47 +346,20 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
489
346
  }>;
490
347
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
491
348
  type: z.ZodEnum<["patch", "file"]>;
492
- filePath: z.ZodString;
349
+ path: z.ZodString;
493
350
  content: z.ZodString;
494
351
  }, "strip", z.ZodTypeAny, {
495
- type: "file" | "patch";
496
- filePath: string;
352
+ path: string;
497
353
  content: string;
498
- }, {
499
354
  type: "file" | "patch";
500
- filePath: string;
355
+ }, {
356
+ path: string;
501
357
  content: string;
358
+ type: "file" | "patch";
502
359
  }>, "many">;
503
360
  costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "max"]>>>;
504
361
  }, "strip", z.ZodTypeAny, {
505
362
  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
363
  fileContext: {
534
364
  currentWorkingDirectory: string;
535
365
  fileTree: import("./util/file").FileTreeNode[];
@@ -557,15 +387,6 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
557
387
  }[][];
558
388
  userKnowledgeFiles?: Record<string, string> | undefined;
559
389
  };
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
390
  fingerprintId: string;
570
391
  userInputId: string;
571
392
  messages: {
@@ -584,15 +405,34 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
584
405
  type: "ephemeral";
585
406
  } | undefined;
586
407
  } | {
587
- type: "tool_result";
588
408
  content: string;
409
+ type: "tool_result";
589
410
  tool_use_id: string;
590
411
  cache_control?: {
591
412
  type: "ephemeral";
592
413
  } | undefined;
414
+ } | {
415
+ type: "image";
416
+ source: {
417
+ type: "base64";
418
+ media_type: "image/jpeg";
419
+ data: string;
420
+ };
421
+ cache_control?: {
422
+ type: "ephemeral";
423
+ } | undefined;
593
424
  })[];
594
425
  role: "user" | "assistant";
595
426
  }[];
427
+ changesAlreadyApplied: {
428
+ path: string;
429
+ content: string;
430
+ type: "file" | "patch";
431
+ }[];
432
+ costMode: "max" | "lite" | "normal";
433
+ authToken?: string | undefined;
434
+ }, {
435
+ type: "user-input";
596
436
  fileContext: {
597
437
  currentWorkingDirectory: string;
598
438
  fileTree: import("./util/file").FileTreeNode[];
@@ -620,22 +460,665 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
620
460
  }[][];
621
461
  userKnowledgeFiles?: Record<string, string> | undefined;
622
462
  };
463
+ fingerprintId: string;
464
+ userInputId: string;
465
+ messages: {
466
+ content: string | ({
467
+ type: "text";
468
+ text: string;
469
+ cache_control?: {
470
+ type: "ephemeral";
471
+ } | undefined;
472
+ } | {
473
+ type: "tool_use";
474
+ name: string;
475
+ id: string;
476
+ input: Record<string, any>;
477
+ cache_control?: {
478
+ type: "ephemeral";
479
+ } | undefined;
480
+ } | {
481
+ content: string;
482
+ type: "tool_result";
483
+ tool_use_id: string;
484
+ cache_control?: {
485
+ type: "ephemeral";
486
+ } | undefined;
487
+ } | {
488
+ type: "image";
489
+ source: {
490
+ type: "base64";
491
+ media_type: "image/jpeg";
492
+ data: string;
493
+ };
494
+ cache_control?: {
495
+ type: "ephemeral";
496
+ } | undefined;
497
+ })[];
498
+ role: "user" | "assistant";
499
+ }[];
623
500
  changesAlreadyApplied: {
624
- type: "file" | "patch";
625
- filePath: string;
501
+ path: string;
626
502
  content: string;
503
+ type: "file" | "patch";
504
+ }[];
505
+ authToken?: string | undefined;
506
+ costMode?: "max" | "lite" | "normal" | 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
+ status: string;
529
+ diff: string;
530
+ diffCached: string;
531
+ lastCommitMessages: string;
532
+ }, {
533
+ status: string;
534
+ diff: 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
+ status: string;
579
+ diff: 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
+ status: string;
605
+ diff: 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
+ content: string;
690
+ type: "tool_result";
691
+ tool_use_id: string;
692
+ cache_control?: {
693
+ type: "ephemeral";
694
+ } | undefined;
695
+ }, {
696
+ content: string;
697
+ type: "tool_result";
698
+ tool_use_id: string;
699
+ cache_control?: {
700
+ type: "ephemeral";
701
+ } | undefined;
702
+ }>, 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
+ media_type: "image/jpeg";
711
+ data: string;
712
+ }, {
713
+ type: "base64";
714
+ media_type: "image/jpeg";
715
+ data: string;
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
+ media_type: "image/jpeg";
729
+ data: string;
730
+ };
731
+ cache_control?: {
732
+ type: "ephemeral";
733
+ } | undefined;
734
+ }, {
735
+ type: "image";
736
+ source: {
737
+ type: "base64";
738
+ media_type: "image/jpeg";
739
+ data: string;
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
+ content: string;
762
+ type: "tool_result";
763
+ tool_use_id: string;
764
+ cache_control?: {
765
+ type: "ephemeral";
766
+ } | undefined;
767
+ } | {
768
+ type: "image";
769
+ source: {
770
+ type: "base64";
771
+ media_type: "image/jpeg";
772
+ data: string;
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
+ content: string;
796
+ type: "tool_result";
797
+ tool_use_id: string;
798
+ cache_control?: {
799
+ type: "ephemeral";
800
+ } | undefined;
801
+ } | {
802
+ type: "image";
803
+ source: {
804
+ type: "base64";
805
+ media_type: "image/jpeg";
806
+ data: string;
807
+ };
808
+ cache_control?: {
809
+ type: "ephemeral";
810
+ } | undefined;
811
+ })[];
812
+ role: "user" | "assistant";
813
+ }>, "many">;
814
+ }, "strip", z.ZodTypeAny, {
815
+ agentContext: string;
816
+ fileContext: {
817
+ currentWorkingDirectory: string;
818
+ fileTree: import("./util/file").FileTreeNode[];
819
+ fileTokenScores: Record<string, Record<string, number>>;
820
+ knowledgeFiles: Record<string, string>;
821
+ gitChanges: {
822
+ status: string;
823
+ diff: string;
824
+ diffCached: string;
825
+ lastCommitMessages: string;
826
+ };
827
+ changesSinceLastChat: Record<string, string>;
828
+ shellConfigFiles: Record<string, string>;
829
+ systemInfo: {
830
+ platform: string;
831
+ shell: string;
832
+ nodeVersion: string;
833
+ arch: string;
834
+ homedir: string;
835
+ cpus: number;
836
+ };
837
+ fileVersions: {
838
+ path: string;
839
+ content: string;
840
+ }[][];
841
+ userKnowledgeFiles?: Record<string, string> | undefined;
842
+ };
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
+ content: string;
860
+ type: "tool_result";
861
+ tool_use_id: string;
862
+ cache_control?: {
863
+ type: "ephemeral";
864
+ } | undefined;
865
+ } | {
866
+ type: "image";
867
+ source: {
868
+ type: "base64";
869
+ media_type: "image/jpeg";
870
+ data: string;
871
+ };
872
+ cache_control?: {
873
+ type: "ephemeral";
874
+ } | undefined;
875
+ })[];
876
+ role: "user" | "assistant";
877
+ }[];
878
+ }, {
879
+ agentContext: string;
880
+ fileContext: {
881
+ currentWorkingDirectory: string;
882
+ fileTree: import("./util/file").FileTreeNode[];
883
+ fileTokenScores: Record<string, Record<string, number>>;
884
+ knowledgeFiles: Record<string, string>;
885
+ gitChanges: {
886
+ status: string;
887
+ diff: string;
888
+ diffCached: string;
889
+ lastCommitMessages: string;
890
+ };
891
+ changesSinceLastChat: Record<string, string>;
892
+ shellConfigFiles: Record<string, string>;
893
+ systemInfo: {
894
+ platform: string;
895
+ shell: string;
896
+ nodeVersion: string;
897
+ arch: string;
898
+ homedir: string;
899
+ cpus: number;
900
+ };
901
+ fileVersions: {
902
+ path: string;
903
+ content: string;
904
+ }[][];
905
+ userKnowledgeFiles?: Record<string, string> | undefined;
906
+ };
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
+ content: string;
924
+ type: "tool_result";
925
+ tool_use_id: string;
926
+ cache_control?: {
927
+ type: "ephemeral";
928
+ } | undefined;
929
+ } | {
930
+ type: "image";
931
+ source: {
932
+ type: "base64";
933
+ media_type: "image/jpeg";
934
+ data: string;
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: "max" | "lite" | "normal";
960
+ promptId: string;
961
+ agentState: {
962
+ agentContext: string;
963
+ fileContext: {
964
+ currentWorkingDirectory: string;
965
+ fileTree: import("./util/file").FileTreeNode[];
966
+ fileTokenScores: Record<string, Record<string, number>>;
967
+ knowledgeFiles: Record<string, string>;
968
+ gitChanges: {
969
+ status: string;
970
+ diff: string;
971
+ diffCached: string;
972
+ lastCommitMessages: string;
973
+ };
974
+ changesSinceLastChat: Record<string, string>;
975
+ shellConfigFiles: Record<string, string>;
976
+ systemInfo: {
977
+ platform: string;
978
+ shell: string;
979
+ nodeVersion: string;
980
+ arch: string;
981
+ homedir: string;
982
+ cpus: number;
983
+ };
984
+ fileVersions: {
985
+ path: string;
986
+ content: string;
987
+ }[][];
988
+ userKnowledgeFiles?: Record<string, string> | undefined;
989
+ };
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
+ content: string;
1007
+ type: "tool_result";
1008
+ tool_use_id: string;
1009
+ cache_control?: {
1010
+ type: "ephemeral";
1011
+ } | undefined;
1012
+ } | {
1013
+ type: "image";
1014
+ source: {
1015
+ type: "base64";
1016
+ media_type: "image/jpeg";
1017
+ data: string;
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
+ agentContext: string;
1039
+ fileContext: {
1040
+ currentWorkingDirectory: string;
1041
+ fileTree: import("./util/file").FileTreeNode[];
1042
+ fileTokenScores: Record<string, Record<string, number>>;
1043
+ knowledgeFiles: Record<string, string>;
1044
+ gitChanges: {
1045
+ status: string;
1046
+ diff: string;
1047
+ diffCached: string;
1048
+ lastCommitMessages: string;
1049
+ };
1050
+ changesSinceLastChat: Record<string, string>;
1051
+ shellConfigFiles: Record<string, string>;
1052
+ systemInfo: {
1053
+ platform: string;
1054
+ shell: string;
1055
+ nodeVersion: string;
1056
+ arch: string;
1057
+ homedir: string;
1058
+ cpus: number;
1059
+ };
1060
+ fileVersions: {
1061
+ path: string;
1062
+ content: string;
1063
+ }[][];
1064
+ userKnowledgeFiles?: Record<string, string> | undefined;
1065
+ };
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
+ content: string;
1083
+ type: "tool_result";
1084
+ tool_use_id: string;
1085
+ cache_control?: {
1086
+ type: "ephemeral";
1087
+ } | undefined;
1088
+ } | {
1089
+ type: "image";
1090
+ source: {
1091
+ type: "base64";
1092
+ media_type: "image/jpeg";
1093
+ data: string;
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;
627
1106
  }[];
628
1107
  authToken?: string | undefined;
629
1108
  costMode?: "max" | "lite" | "normal" | undefined;
1109
+ prompt?: string | undefined;
630
1110
  }>, z.ZodObject<{
631
1111
  type: z.ZodLiteral<"read-files-response">;
632
1112
  files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1113
+ requestId: z.ZodOptional<z.ZodString>;
633
1114
  }, "strip", z.ZodTypeAny, {
634
1115
  type: "read-files-response";
635
1116
  files: Record<string, string | null>;
1117
+ requestId?: string | undefined;
636
1118
  }, {
637
1119
  type: "read-files-response";
638
1120
  files: Record<string, string | null>;
1121
+ requestId?: string | undefined;
639
1122
  }>, z.ZodObject<{
640
1123
  type: z.ZodLiteral<"init">;
641
1124
  fingerprintId: z.ZodString;
@@ -751,7 +1234,6 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
751
1234
  }>;
752
1235
  }, "strip", z.ZodTypeAny, {
753
1236
  type: "init";
754
- fingerprintId: string;
755
1237
  fileContext: {
756
1238
  currentWorkingDirectory: string;
757
1239
  fileTree: import("./util/file").FileTreeNode[];
@@ -779,10 +1261,10 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
779
1261
  }[][];
780
1262
  userKnowledgeFiles?: Record<string, string> | undefined;
781
1263
  };
1264
+ fingerprintId: string;
782
1265
  authToken?: string | undefined;
783
1266
  }, {
784
1267
  type: "init";
785
- fingerprintId: string;
786
1268
  fileContext: {
787
1269
  currentWorkingDirectory: string;
788
1270
  fileTree: import("./util/file").FileTreeNode[];
@@ -810,6 +1292,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
810
1292
  }[][];
811
1293
  userKnowledgeFiles?: Record<string, string> | undefined;
812
1294
  };
1295
+ fingerprintId: string;
813
1296
  authToken?: string | undefined;
814
1297
  }>, z.ZodObject<{
815
1298
  type: z.ZodLiteral<"usage">;
@@ -824,49 +1307,7 @@ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
824
1307
  fingerprintId: string;
825
1308
  authToken?: string | undefined;
826
1309
  }>, 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">;
1310
+ type: z.ZodLiteral<"generate-commit-message">;
870
1311
  fingerprintId: z.ZodString;
871
1312
  authToken: z.ZodOptional<z.ZodString>;
872
1313
  stagedChanges: z.ZodString;
@@ -942,29 +1383,29 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
942
1383
  response: z.ZodString;
943
1384
  changes: z.ZodArray<z.ZodObject<{
944
1385
  type: z.ZodEnum<["patch", "file"]>;
945
- filePath: z.ZodString;
1386
+ path: z.ZodString;
946
1387
  content: z.ZodString;
947
1388
  }, "strip", z.ZodTypeAny, {
948
- type: "file" | "patch";
949
- filePath: string;
1389
+ path: string;
950
1390
  content: string;
951
- }, {
952
1391
  type: "file" | "patch";
953
- filePath: string;
1392
+ }, {
1393
+ path: string;
954
1394
  content: string;
1395
+ type: "file" | "patch";
955
1396
  }>, "many">;
956
1397
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
957
1398
  type: z.ZodEnum<["patch", "file"]>;
958
- filePath: z.ZodString;
1399
+ path: z.ZodString;
959
1400
  content: z.ZodString;
960
1401
  }, "strip", z.ZodTypeAny, {
961
- type: "file" | "patch";
962
- filePath: string;
1402
+ path: string;
963
1403
  content: string;
964
- }, {
965
1404
  type: "file" | "patch";
966
- filePath: string;
1405
+ }, {
1406
+ path: string;
967
1407
  content: string;
1408
+ type: "file" | "patch";
968
1409
  }>, "many">;
969
1410
  addedFileVersions: z.ZodArray<z.ZodObject<{
970
1411
  path: z.ZodString;
@@ -988,15 +1429,15 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
988
1429
  type: "response-complete";
989
1430
  userInputId: string;
990
1431
  changesAlreadyApplied: {
991
- type: "file" | "patch";
992
- filePath: string;
1432
+ path: string;
993
1433
  content: string;
1434
+ type: "file" | "patch";
994
1435
  }[];
995
1436
  response: string;
996
1437
  changes: {
997
- type: "file" | "patch";
998
- filePath: string;
1438
+ path: string;
999
1439
  content: string;
1440
+ type: "file" | "patch";
1000
1441
  }[];
1001
1442
  addedFileVersions: {
1002
1443
  path: string;
@@ -1013,15 +1454,15 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
1013
1454
  type: "response-complete";
1014
1455
  userInputId: string;
1015
1456
  changesAlreadyApplied: {
1016
- type: "file" | "patch";
1017
- filePath: string;
1457
+ path: string;
1018
1458
  content: string;
1459
+ type: "file" | "patch";
1019
1460
  }[];
1020
1461
  response: string;
1021
1462
  changes: {
1022
- type: "file" | "patch";
1023
- filePath: string;
1463
+ path: string;
1024
1464
  content: string;
1465
+ type: "file" | "patch";
1025
1466
  }[];
1026
1467
  addedFileVersions: {
1027
1468
  path: string;
@@ -1035,16 +1476,642 @@ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShap
1035
1476
  next_quota_reset?: Date | undefined;
1036
1477
  session_credits_used?: number | undefined;
1037
1478
  }>;
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>;
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
+ status: string;
1497
+ diff: string;
1498
+ diffCached: string;
1499
+ lastCommitMessages: string;
1500
+ }, {
1501
+ status: string;
1502
+ diff: 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
+ status: string;
1547
+ diff: 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
+ status: string;
1573
+ diff: 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
+ content: string;
1658
+ type: "tool_result";
1659
+ tool_use_id: string;
1660
+ cache_control?: {
1661
+ type: "ephemeral";
1662
+ } | undefined;
1663
+ }, {
1664
+ content: string;
1665
+ type: "tool_result";
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
+ media_type: "image/jpeg";
1679
+ data: string;
1680
+ }, {
1681
+ type: "base64";
1682
+ media_type: "image/jpeg";
1683
+ data: string;
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
+ media_type: "image/jpeg";
1697
+ data: string;
1698
+ };
1699
+ cache_control?: {
1700
+ type: "ephemeral";
1701
+ } | undefined;
1702
+ }, {
1703
+ type: "image";
1704
+ source: {
1705
+ type: "base64";
1706
+ media_type: "image/jpeg";
1707
+ data: string;
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
+ content: string;
1730
+ type: "tool_result";
1731
+ tool_use_id: string;
1732
+ cache_control?: {
1733
+ type: "ephemeral";
1734
+ } | undefined;
1735
+ } | {
1736
+ type: "image";
1737
+ source: {
1738
+ type: "base64";
1739
+ media_type: "image/jpeg";
1740
+ data: string;
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
+ content: string;
1764
+ type: "tool_result";
1765
+ tool_use_id: string;
1766
+ cache_control?: {
1767
+ type: "ephemeral";
1768
+ } | undefined;
1769
+ } | {
1770
+ type: "image";
1771
+ source: {
1772
+ type: "base64";
1773
+ media_type: "image/jpeg";
1774
+ data: string;
1775
+ };
1776
+ cache_control?: {
1777
+ type: "ephemeral";
1778
+ } | undefined;
1779
+ })[];
1780
+ role: "user" | "assistant";
1781
+ }>, "many">;
1782
+ }, "strip", z.ZodTypeAny, {
1783
+ agentContext: string;
1784
+ fileContext: {
1785
+ currentWorkingDirectory: string;
1786
+ fileTree: import("./util/file").FileTreeNode[];
1787
+ fileTokenScores: Record<string, Record<string, number>>;
1788
+ knowledgeFiles: Record<string, string>;
1789
+ gitChanges: {
1790
+ status: string;
1791
+ diff: string;
1792
+ diffCached: string;
1793
+ lastCommitMessages: string;
1794
+ };
1795
+ changesSinceLastChat: Record<string, string>;
1796
+ shellConfigFiles: Record<string, string>;
1797
+ systemInfo: {
1798
+ platform: string;
1799
+ shell: string;
1800
+ nodeVersion: string;
1801
+ arch: string;
1802
+ homedir: string;
1803
+ cpus: number;
1804
+ };
1805
+ fileVersions: {
1806
+ path: string;
1807
+ content: string;
1808
+ }[][];
1809
+ userKnowledgeFiles?: Record<string, string> | undefined;
1810
+ };
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
+ content: string;
1828
+ type: "tool_result";
1829
+ tool_use_id: string;
1830
+ cache_control?: {
1831
+ type: "ephemeral";
1832
+ } | undefined;
1833
+ } | {
1834
+ type: "image";
1835
+ source: {
1836
+ type: "base64";
1837
+ media_type: "image/jpeg";
1838
+ data: string;
1839
+ };
1840
+ cache_control?: {
1841
+ type: "ephemeral";
1842
+ } | undefined;
1843
+ })[];
1844
+ role: "user" | "assistant";
1845
+ }[];
1846
+ }, {
1847
+ agentContext: string;
1848
+ fileContext: {
1849
+ currentWorkingDirectory: string;
1850
+ fileTree: import("./util/file").FileTreeNode[];
1851
+ fileTokenScores: Record<string, Record<string, number>>;
1852
+ knowledgeFiles: Record<string, string>;
1853
+ gitChanges: {
1854
+ status: string;
1855
+ diff: string;
1856
+ diffCached: string;
1857
+ lastCommitMessages: string;
1858
+ };
1859
+ changesSinceLastChat: Record<string, string>;
1860
+ shellConfigFiles: Record<string, string>;
1861
+ systemInfo: {
1862
+ platform: string;
1863
+ shell: string;
1864
+ nodeVersion: string;
1865
+ arch: string;
1866
+ homedir: string;
1867
+ cpus: number;
1868
+ };
1869
+ fileVersions: {
1870
+ path: string;
1871
+ content: string;
1872
+ }[][];
1873
+ userKnowledgeFiles?: Record<string, string> | undefined;
1874
+ };
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
+ content: string;
1892
+ type: "tool_result";
1893
+ tool_use_id: string;
1894
+ cache_control?: {
1895
+ type: "ephemeral";
1896
+ } | undefined;
1897
+ } | {
1898
+ type: "image";
1899
+ source: {
1900
+ type: "base64";
1901
+ media_type: "image/jpeg";
1902
+ data: string;
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
+ parameters: Record<string, string>;
1918
+ id: string;
1919
+ }, {
1920
+ name: string;
1921
+ parameters: Record<string, string>;
1922
+ id: 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">;
1044
1937
  }, {
1045
- type: "read-files-response";
1046
- files: Record<string, string | null>;
1047
- }>, z.ZodObject<{
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
+ agentContext: string;
1949
+ fileContext: {
1950
+ currentWorkingDirectory: string;
1951
+ fileTree: import("./util/file").FileTreeNode[];
1952
+ fileTokenScores: Record<string, Record<string, number>>;
1953
+ knowledgeFiles: Record<string, string>;
1954
+ gitChanges: {
1955
+ status: string;
1956
+ diff: string;
1957
+ diffCached: string;
1958
+ lastCommitMessages: string;
1959
+ };
1960
+ changesSinceLastChat: Record<string, string>;
1961
+ shellConfigFiles: Record<string, string>;
1962
+ systemInfo: {
1963
+ platform: string;
1964
+ shell: string;
1965
+ nodeVersion: string;
1966
+ arch: string;
1967
+ homedir: string;
1968
+ cpus: number;
1969
+ };
1970
+ fileVersions: {
1971
+ path: string;
1972
+ content: string;
1973
+ }[][];
1974
+ userKnowledgeFiles?: Record<string, string> | undefined;
1975
+ };
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
+ content: string;
1993
+ type: "tool_result";
1994
+ tool_use_id: string;
1995
+ cache_control?: {
1996
+ type: "ephemeral";
1997
+ } | undefined;
1998
+ } | {
1999
+ type: "image";
2000
+ source: {
2001
+ type: "base64";
2002
+ media_type: "image/jpeg";
2003
+ data: string;
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
+ parameters: Record<string, string>;
2020
+ id: 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
+ agentContext: string;
2033
+ fileContext: {
2034
+ currentWorkingDirectory: string;
2035
+ fileTree: import("./util/file").FileTreeNode[];
2036
+ fileTokenScores: Record<string, Record<string, number>>;
2037
+ knowledgeFiles: Record<string, string>;
2038
+ gitChanges: {
2039
+ status: string;
2040
+ diff: string;
2041
+ diffCached: string;
2042
+ lastCommitMessages: string;
2043
+ };
2044
+ changesSinceLastChat: Record<string, string>;
2045
+ shellConfigFiles: Record<string, string>;
2046
+ systemInfo: {
2047
+ platform: string;
2048
+ shell: string;
2049
+ nodeVersion: string;
2050
+ arch: string;
2051
+ homedir: string;
2052
+ cpus: number;
2053
+ };
2054
+ fileVersions: {
2055
+ path: string;
2056
+ content: string;
2057
+ }[][];
2058
+ userKnowledgeFiles?: Record<string, string> | undefined;
2059
+ };
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
+ content: string;
2077
+ type: "tool_result";
2078
+ tool_use_id: string;
2079
+ cache_control?: {
2080
+ type: "ephemeral";
2081
+ } | undefined;
2082
+ } | {
2083
+ type: "image";
2084
+ source: {
2085
+ type: "base64";
2086
+ media_type: "image/jpeg";
2087
+ data: string;
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
+ parameters: Record<string, string>;
2104
+ id: 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>;
2114
+ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1048
2115
  type: z.ZodLiteral<"response-chunk">;
1049
2116
  userInputId: z.ZodString;
1050
2117
  chunk: z.ZodString;
@@ -1062,29 +2129,29 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1062
2129
  response: z.ZodString;
1063
2130
  changes: z.ZodArray<z.ZodObject<{
1064
2131
  type: z.ZodEnum<["patch", "file"]>;
1065
- filePath: z.ZodString;
2132
+ path: z.ZodString;
1066
2133
  content: z.ZodString;
1067
2134
  }, "strip", z.ZodTypeAny, {
1068
- type: "file" | "patch";
1069
- filePath: string;
2135
+ path: string;
1070
2136
  content: string;
1071
- }, {
1072
2137
  type: "file" | "patch";
1073
- filePath: string;
2138
+ }, {
2139
+ path: string;
1074
2140
  content: string;
2141
+ type: "file" | "patch";
1075
2142
  }>, "many">;
1076
2143
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1077
2144
  type: z.ZodEnum<["patch", "file"]>;
1078
- filePath: z.ZodString;
2145
+ path: z.ZodString;
1079
2146
  content: z.ZodString;
1080
2147
  }, "strip", z.ZodTypeAny, {
1081
- type: "file" | "patch";
1082
- filePath: string;
2148
+ path: string;
1083
2149
  content: string;
1084
- }, {
1085
2150
  type: "file" | "patch";
1086
- filePath: string;
2151
+ }, {
2152
+ path: string;
1087
2153
  content: string;
2154
+ type: "file" | "patch";
1088
2155
  }>, "many">;
1089
2156
  addedFileVersions: z.ZodArray<z.ZodObject<{
1090
2157
  path: z.ZodString;
@@ -1108,15 +2175,15 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1108
2175
  type: "response-complete";
1109
2176
  userInputId: string;
1110
2177
  changesAlreadyApplied: {
1111
- type: "file" | "patch";
1112
- filePath: string;
2178
+ path: string;
1113
2179
  content: string;
2180
+ type: "file" | "patch";
1114
2181
  }[];
1115
2182
  response: string;
1116
2183
  changes: {
1117
- type: "file" | "patch";
1118
- filePath: string;
2184
+ path: string;
1119
2185
  content: string;
2186
+ type: "file" | "patch";
1120
2187
  }[];
1121
2188
  addedFileVersions: {
1122
2189
  path: string;
@@ -1133,15 +2200,15 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1133
2200
  type: "response-complete";
1134
2201
  userInputId: string;
1135
2202
  changesAlreadyApplied: {
1136
- type: "file" | "patch";
1137
- filePath: string;
2203
+ path: string;
1138
2204
  content: string;
2205
+ type: "file" | "patch";
1139
2206
  }[];
1140
2207
  response: string;
1141
2208
  changes: {
1142
- type: "file" | "patch";
1143
- filePath: string;
2209
+ path: string;
1144
2210
  content: string;
2211
+ type: "file" | "patch";
1145
2212
  }[];
1146
2213
  addedFileVersions: {
1147
2214
  path: string;
@@ -1154,14 +2221,650 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1154
2221
  subscription_active?: boolean | undefined;
1155
2222
  next_quota_reset?: Date | undefined;
1156
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
+ status: string;
2242
+ diff: string;
2243
+ diffCached: string;
2244
+ lastCommitMessages: string;
2245
+ }, {
2246
+ status: string;
2247
+ diff: 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
+ status: string;
2292
+ diff: 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
+ status: string;
2318
+ diff: 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
+ content: string;
2403
+ type: "tool_result";
2404
+ tool_use_id: string;
2405
+ cache_control?: {
2406
+ type: "ephemeral";
2407
+ } | undefined;
2408
+ }, {
2409
+ content: string;
2410
+ type: "tool_result";
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
+ media_type: "image/jpeg";
2424
+ data: string;
2425
+ }, {
2426
+ type: "base64";
2427
+ media_type: "image/jpeg";
2428
+ data: string;
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
+ media_type: "image/jpeg";
2442
+ data: string;
2443
+ };
2444
+ cache_control?: {
2445
+ type: "ephemeral";
2446
+ } | undefined;
2447
+ }, {
2448
+ type: "image";
2449
+ source: {
2450
+ type: "base64";
2451
+ media_type: "image/jpeg";
2452
+ data: string;
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
+ content: string;
2475
+ type: "tool_result";
2476
+ tool_use_id: string;
2477
+ cache_control?: {
2478
+ type: "ephemeral";
2479
+ } | undefined;
2480
+ } | {
2481
+ type: "image";
2482
+ source: {
2483
+ type: "base64";
2484
+ media_type: "image/jpeg";
2485
+ data: string;
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
+ content: string;
2509
+ type: "tool_result";
2510
+ tool_use_id: string;
2511
+ cache_control?: {
2512
+ type: "ephemeral";
2513
+ } | undefined;
2514
+ } | {
2515
+ type: "image";
2516
+ source: {
2517
+ type: "base64";
2518
+ media_type: "image/jpeg";
2519
+ data: string;
2520
+ };
2521
+ cache_control?: {
2522
+ type: "ephemeral";
2523
+ } | undefined;
2524
+ })[];
2525
+ role: "user" | "assistant";
2526
+ }>, "many">;
2527
+ }, "strip", z.ZodTypeAny, {
2528
+ agentContext: string;
2529
+ fileContext: {
2530
+ currentWorkingDirectory: string;
2531
+ fileTree: import("./util/file").FileTreeNode[];
2532
+ fileTokenScores: Record<string, Record<string, number>>;
2533
+ knowledgeFiles: Record<string, string>;
2534
+ gitChanges: {
2535
+ status: string;
2536
+ diff: string;
2537
+ diffCached: string;
2538
+ lastCommitMessages: string;
2539
+ };
2540
+ changesSinceLastChat: Record<string, string>;
2541
+ shellConfigFiles: Record<string, string>;
2542
+ systemInfo: {
2543
+ platform: string;
2544
+ shell: string;
2545
+ nodeVersion: string;
2546
+ arch: string;
2547
+ homedir: string;
2548
+ cpus: number;
2549
+ };
2550
+ fileVersions: {
2551
+ path: string;
2552
+ content: string;
2553
+ }[][];
2554
+ userKnowledgeFiles?: Record<string, string> | undefined;
2555
+ };
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
+ content: string;
2573
+ type: "tool_result";
2574
+ tool_use_id: string;
2575
+ cache_control?: {
2576
+ type: "ephemeral";
2577
+ } | undefined;
2578
+ } | {
2579
+ type: "image";
2580
+ source: {
2581
+ type: "base64";
2582
+ media_type: "image/jpeg";
2583
+ data: string;
2584
+ };
2585
+ cache_control?: {
2586
+ type: "ephemeral";
2587
+ } | undefined;
2588
+ })[];
2589
+ role: "user" | "assistant";
2590
+ }[];
2591
+ }, {
2592
+ agentContext: string;
2593
+ fileContext: {
2594
+ currentWorkingDirectory: string;
2595
+ fileTree: import("./util/file").FileTreeNode[];
2596
+ fileTokenScores: Record<string, Record<string, number>>;
2597
+ knowledgeFiles: Record<string, string>;
2598
+ gitChanges: {
2599
+ status: string;
2600
+ diff: string;
2601
+ diffCached: string;
2602
+ lastCommitMessages: string;
2603
+ };
2604
+ changesSinceLastChat: Record<string, string>;
2605
+ shellConfigFiles: Record<string, string>;
2606
+ systemInfo: {
2607
+ platform: string;
2608
+ shell: string;
2609
+ nodeVersion: string;
2610
+ arch: string;
2611
+ homedir: string;
2612
+ cpus: number;
2613
+ };
2614
+ fileVersions: {
2615
+ path: string;
2616
+ content: string;
2617
+ }[][];
2618
+ userKnowledgeFiles?: Record<string, string> | undefined;
2619
+ };
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
+ content: string;
2637
+ type: "tool_result";
2638
+ tool_use_id: string;
2639
+ cache_control?: {
2640
+ type: "ephemeral";
2641
+ } | undefined;
2642
+ } | {
2643
+ type: "image";
2644
+ source: {
2645
+ type: "base64";
2646
+ media_type: "image/jpeg";
2647
+ data: string;
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
+ parameters: Record<string, string>;
2663
+ id: string;
2664
+ }, {
2665
+ name: string;
2666
+ parameters: Record<string, string>;
2667
+ id: 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
+ agentContext: string;
2694
+ fileContext: {
2695
+ currentWorkingDirectory: string;
2696
+ fileTree: import("./util/file").FileTreeNode[];
2697
+ fileTokenScores: Record<string, Record<string, number>>;
2698
+ knowledgeFiles: Record<string, string>;
2699
+ gitChanges: {
2700
+ status: string;
2701
+ diff: string;
2702
+ diffCached: string;
2703
+ lastCommitMessages: string;
2704
+ };
2705
+ changesSinceLastChat: Record<string, string>;
2706
+ shellConfigFiles: Record<string, string>;
2707
+ systemInfo: {
2708
+ platform: string;
2709
+ shell: string;
2710
+ nodeVersion: string;
2711
+ arch: string;
2712
+ homedir: string;
2713
+ cpus: number;
2714
+ };
2715
+ fileVersions: {
2716
+ path: string;
2717
+ content: string;
2718
+ }[][];
2719
+ userKnowledgeFiles?: Record<string, string> | undefined;
2720
+ };
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
+ content: string;
2738
+ type: "tool_result";
2739
+ tool_use_id: string;
2740
+ cache_control?: {
2741
+ type: "ephemeral";
2742
+ } | undefined;
2743
+ } | {
2744
+ type: "image";
2745
+ source: {
2746
+ type: "base64";
2747
+ media_type: "image/jpeg";
2748
+ data: string;
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
+ parameters: Record<string, string>;
2765
+ id: 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
+ agentContext: string;
2778
+ fileContext: {
2779
+ currentWorkingDirectory: string;
2780
+ fileTree: import("./util/file").FileTreeNode[];
2781
+ fileTokenScores: Record<string, Record<string, number>>;
2782
+ knowledgeFiles: Record<string, string>;
2783
+ gitChanges: {
2784
+ status: string;
2785
+ diff: string;
2786
+ diffCached: string;
2787
+ lastCommitMessages: string;
2788
+ };
2789
+ changesSinceLastChat: Record<string, string>;
2790
+ shellConfigFiles: Record<string, string>;
2791
+ systemInfo: {
2792
+ platform: string;
2793
+ shell: string;
2794
+ nodeVersion: string;
2795
+ arch: string;
2796
+ homedir: string;
2797
+ cpus: number;
2798
+ };
2799
+ fileVersions: {
2800
+ path: string;
2801
+ content: string;
2802
+ }[][];
2803
+ userKnowledgeFiles?: Record<string, string> | undefined;
2804
+ };
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
+ content: string;
2822
+ type: "tool_result";
2823
+ tool_use_id: string;
2824
+ cache_control?: {
2825
+ type: "ephemeral";
2826
+ } | undefined;
2827
+ } | {
2828
+ type: "image";
2829
+ source: {
2830
+ type: "base64";
2831
+ media_type: "image/jpeg";
2832
+ data: string;
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
+ parameters: Record<string, string>;
2849
+ id: 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;
1157
2857
  }>, z.ZodObject<{
1158
2858
  type: z.ZodLiteral<"read-files">;
1159
2859
  filePaths: z.ZodArray<z.ZodString, "many">;
2860
+ requestId: z.ZodString;
1160
2861
  }, "strip", z.ZodTypeAny, {
1161
2862
  type: "read-files";
2863
+ requestId: string;
1162
2864
  filePaths: string[];
1163
2865
  }, {
1164
2866
  type: "read-files";
2867
+ requestId: string;
1165
2868
  filePaths: string[];
1166
2869
  }>, z.ZodObject<{
1167
2870
  type: z.ZodLiteral<"tool-call">;
@@ -1182,29 +2885,29 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1182
2885
  }>;
1183
2886
  changes: z.ZodArray<z.ZodObject<{
1184
2887
  type: z.ZodEnum<["patch", "file"]>;
1185
- filePath: z.ZodString;
2888
+ path: z.ZodString;
1186
2889
  content: z.ZodString;
1187
2890
  }, "strip", z.ZodTypeAny, {
1188
- type: "file" | "patch";
1189
- filePath: string;
2891
+ path: string;
1190
2892
  content: string;
1191
- }, {
1192
2893
  type: "file" | "patch";
1193
- filePath: string;
2894
+ }, {
2895
+ path: string;
1194
2896
  content: string;
2897
+ type: "file" | "patch";
1195
2898
  }>, "many">;
1196
2899
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1197
2900
  type: z.ZodEnum<["patch", "file"]>;
1198
- filePath: z.ZodString;
2901
+ path: z.ZodString;
1199
2902
  content: z.ZodString;
1200
2903
  }, "strip", z.ZodTypeAny, {
1201
- type: "file" | "patch";
1202
- filePath: string;
2904
+ path: string;
1203
2905
  content: string;
1204
- }, {
1205
2906
  type: "file" | "patch";
1206
- filePath: string;
2907
+ }, {
2908
+ path: string;
1207
2909
  content: string;
2910
+ type: "file" | "patch";
1208
2911
  }>, "many">;
1209
2912
  addedFileVersions: z.ZodArray<z.ZodObject<{
1210
2913
  path: z.ZodString;
@@ -1219,64 +2922,64 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1219
2922
  resetFileVersions: z.ZodBoolean;
1220
2923
  }, "strip", z.ZodTypeAny, {
1221
2924
  type: "tool-call";
2925
+ data: {
2926
+ name: string;
2927
+ id: string;
2928
+ input: Record<string, any>;
2929
+ };
1222
2930
  userInputId: string;
1223
2931
  changesAlreadyApplied: {
1224
- type: "file" | "patch";
1225
- filePath: string;
2932
+ path: string;
1226
2933
  content: string;
2934
+ type: "file" | "patch";
1227
2935
  }[];
1228
2936
  response: string;
1229
2937
  changes: {
1230
- type: "file" | "patch";
1231
- filePath: string;
2938
+ path: string;
1232
2939
  content: string;
2940
+ type: "file" | "patch";
1233
2941
  }[];
1234
2942
  addedFileVersions: {
1235
2943
  path: string;
1236
2944
  content: string;
1237
2945
  }[];
1238
2946
  resetFileVersions: boolean;
2947
+ }, {
2948
+ type: "tool-call";
1239
2949
  data: {
1240
2950
  name: string;
1241
2951
  id: string;
1242
2952
  input: Record<string, any>;
1243
2953
  };
1244
- }, {
1245
- type: "tool-call";
1246
2954
  userInputId: string;
1247
2955
  changesAlreadyApplied: {
1248
- type: "file" | "patch";
1249
- filePath: string;
2956
+ path: string;
1250
2957
  content: string;
2958
+ type: "file" | "patch";
1251
2959
  }[];
1252
2960
  response: string;
1253
2961
  changes: {
1254
- type: "file" | "patch";
1255
- filePath: string;
2962
+ path: string;
1256
2963
  content: string;
2964
+ type: "file" | "patch";
1257
2965
  }[];
1258
2966
  addedFileVersions: {
1259
2967
  path: string;
1260
2968
  content: string;
1261
2969
  }[];
1262
2970
  resetFileVersions: boolean;
1263
- data: {
1264
- name: string;
1265
- id: string;
1266
- input: Record<string, any>;
1267
- };
1268
2971
  }>, z.ZodObject<{
1269
2972
  type: z.ZodLiteral<"terminal-command-result">;
1270
2973
  userInputId: z.ZodString;
1271
2974
  result: z.ZodString;
1272
2975
  }, "strip", z.ZodTypeAny, {
1273
2976
  type: "terminal-command-result";
1274
- userInputId: string;
1275
2977
  result: string;
2978
+ userInputId: string;
1276
2979
  }, {
1277
2980
  type: "terminal-command-result";
1278
- userInputId: string;
1279
2981
  result: string;
2982
+ userInputId: string;
1280
2983
  }>, z.ZodObject<{
1281
2984
  type: z.ZodLiteral<"npm-version-status">;
1282
2985
  isUpToDate: z.ZodBoolean;
@@ -1315,68 +3018,6 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1315
3018
  next_quota_reset: Date;
1316
3019
  session_credits_used: number;
1317
3020
  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
3021
  }>, z.ZodObject<{
1381
3022
  type: z.ZodLiteral<"usage-response">;
1382
3023
  usage: z.ZodNumber;
@@ -1421,4 +3062,3 @@ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.Zo
1421
3062
  commitMessage: string;
1422
3063
  }>]>;
1423
3064
  export type ServerAction = z.infer<typeof SERVER_ACTION_SCHEMA>;
1424
- export {};