codebuff 1.0.168 → 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.
- package/dist/browser-runner.js +17 -7
- package/dist/browser-runner.js.map +1 -1
- package/dist/chat-storage.d.ts +2 -27
- package/dist/chat-storage.js +73 -139
- package/dist/chat-storage.js.map +1 -1
- package/dist/checkpoint-file-manager.d.ts +8 -0
- package/dist/checkpoint-file-manager.js +125 -0
- package/dist/checkpoint-file-manager.js.map +1 -0
- package/dist/checkpoints.d.ts +61 -0
- package/dist/checkpoints.js +171 -0
- package/dist/checkpoints.js.map +1 -0
- package/dist/cli.d.ts +7 -8
- package/dist/cli.js +138 -157
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +179 -28
- package/dist/client.js +158 -152
- package/dist/client.js.map +1 -1
- package/dist/code-map/languages.js +17 -7
- package/dist/code-map/languages.js.map +1 -1
- package/dist/code-map/parse.js +17 -7
- package/dist/code-map/parse.js.map +1 -1
- package/dist/code-map/tsconfig.tsbuildinfo +1 -1
- package/dist/common/actions.d.ts +2136 -575
- package/dist/common/actions.js +58 -81
- package/dist/common/actions.js.map +1 -1
- package/dist/common/browser-actions.d.ts +62 -62
- package/dist/common/constants/tools.d.ts +13 -0
- package/dist/common/constants/tools.js +22 -0
- package/dist/common/constants/tools.js.map +1 -0
- package/dist/common/constants.d.ts +0 -1
- package/dist/common/constants.js +3 -3
- package/dist/common/constants.js.map +1 -1
- package/dist/common/logger.d.ts +1 -0
- package/dist/common/logger.js +7 -0
- package/dist/common/logger.js.map +1 -0
- package/dist/common/types/agent-state.d.ts +26 -26
- package/dist/common/types/message.d.ts +14 -14
- package/dist/common/util/changes.js +3 -3
- package/dist/common/util/changes.js.map +1 -1
- package/dist/common/util/constants.d.ts +1 -0
- package/dist/common/util/constants.js +7 -0
- package/dist/common/util/constants.js.map +1 -0
- package/dist/common/util/credentials.d.ts +2 -2
- package/dist/common/util/file.d.ts +6 -2
- package/dist/common/util/file.js +25 -24
- package/dist/common/util/file.js.map +1 -1
- package/dist/common/util/git.js +1 -1
- package/dist/common/util/git.js.map +1 -1
- package/dist/common/util/helpers.d.ts +1 -0
- package/dist/common/util/helpers.js +6 -0
- package/dist/common/util/helpers.js.map +1 -0
- package/dist/common/util/messages.d.ts +1 -1
- package/dist/common/util/promise.d.ts +8 -0
- package/dist/common/util/promise.js +25 -2
- package/dist/common/util/promise.js.map +1 -1
- package/dist/common/util/saxy.d.ts +158 -0
- package/dist/common/util/saxy.js +450 -0
- package/dist/common/util/saxy.js.map +1 -0
- package/dist/common/util/string.d.ts +13 -0
- package/dist/common/util/string.js +21 -1
- package/dist/common/util/string.js.map +1 -1
- package/dist/common/util/token-counter.d.ts +3 -0
- package/dist/common/util/token-counter.js +27 -0
- package/dist/common/util/token-counter.js.map +1 -0
- package/dist/common/websockets/websocket-schema.d.ts +4073 -957
- package/dist/create-template-project.js +17 -7
- package/dist/create-template-project.js.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/menu.js +31 -19
- package/dist/menu.js.map +1 -1
- package/dist/project-files.d.ts +40 -2
- package/dist/project-files.js +94 -34
- package/dist/project-files.js.map +1 -1
- package/dist/tool-handlers.d.ts +21 -7
- package/dist/tool-handlers.js +99 -37
- package/dist/tool-handlers.js.map +1 -1
- package/dist/utils/__tests__/xml-stream-parser.test.js +221 -0
- package/dist/utils/__tests__/xml-stream-parser.test.js.map +1 -0
- package/dist/utils/spinner.d.ts +1 -0
- package/dist/utils/spinner.js +28 -7
- package/dist/utils/spinner.js.map +1 -1
- package/dist/utils/terminal.d.ts +23 -3
- package/dist/utils/terminal.js +68 -44
- package/dist/utils/terminal.js.map +1 -1
- package/dist/utils/tool-renderers.d.ts +16 -0
- package/dist/utils/tool-renderers.js +105 -0
- package/dist/utils/tool-renderers.js.map +1 -0
- package/dist/utils/xml-stream-parser.d.ts +9 -0
- package/dist/utils/xml-stream-parser.js +128 -0
- package/dist/utils/xml-stream-parser.js.map +1 -0
- package/dist/worker-script-project-context.js +1 -1
- package/dist/worker-script-project-context.js.map +1 -1
- package/package.json +2 -1
- package/dist/__tests__/browser-runner.test.js +0 -15
- package/dist/__tests__/browser-runner.test.js.map +0 -1
- package/dist/common/advanced-analyzer.d.ts +0 -19
- package/dist/common/advanced-analyzer.js +0 -140
- package/dist/common/advanced-analyzer.js.map +0 -1
- package/dist/common/message-image-handling.d.ts +0 -41
- package/dist/common/message-image-handling.js +0 -57
- package/dist/common/message-image-handling.js.map +0 -1
- /package/dist/{__tests__/browser-runner.test.d.ts → utils/__tests__/xml-stream-parser.test.d.ts} +0 -0
|
@@ -5,12 +5,12 @@ export declare const ToolCallSchema: z.ZodObject<{
|
|
|
5
5
|
parameters: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
6
6
|
id: z.ZodString;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
id: string;
|
|
9
8
|
name: string;
|
|
9
|
+
id: string;
|
|
10
10
|
parameters: Record<string, string>;
|
|
11
11
|
}, {
|
|
12
|
-
id: string;
|
|
13
12
|
name: string;
|
|
13
|
+
id: string;
|
|
14
14
|
parameters: Record<string, string>;
|
|
15
15
|
}>;
|
|
16
16
|
export type ToolCall = z.infer<typeof ToolCallSchema>;
|
|
@@ -19,12 +19,12 @@ export declare const ToolResultSchema: z.ZodObject<{
|
|
|
19
19
|
result: z.ZodString;
|
|
20
20
|
id: z.ZodString;
|
|
21
21
|
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
id: string;
|
|
23
22
|
name: string;
|
|
23
|
+
id: string;
|
|
24
24
|
result: string;
|
|
25
25
|
}, {
|
|
26
|
-
id: string;
|
|
27
26
|
name: string;
|
|
27
|
+
id: string;
|
|
28
28
|
result: string;
|
|
29
29
|
}>;
|
|
30
30
|
export type ToolResult = z.infer<typeof ToolResultSchema>;
|
|
@@ -42,13 +42,13 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
42
42
|
diffCached: z.ZodString;
|
|
43
43
|
lastCommitMessages: z.ZodString;
|
|
44
44
|
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
diff: string;
|
|
46
45
|
status: string;
|
|
46
|
+
diff: string;
|
|
47
47
|
diffCached: string;
|
|
48
48
|
lastCommitMessages: string;
|
|
49
49
|
}, {
|
|
50
|
-
diff: string;
|
|
51
50
|
status: string;
|
|
51
|
+
diff: string;
|
|
52
52
|
diffCached: string;
|
|
53
53
|
lastCommitMessages: string;
|
|
54
54
|
}>;
|
|
@@ -92,8 +92,8 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
92
92
|
fileTokenScores: Record<string, Record<string, number>>;
|
|
93
93
|
knowledgeFiles: Record<string, string>;
|
|
94
94
|
gitChanges: {
|
|
95
|
-
diff: string;
|
|
96
95
|
status: string;
|
|
96
|
+
diff: string;
|
|
97
97
|
diffCached: string;
|
|
98
98
|
lastCommitMessages: string;
|
|
99
99
|
};
|
|
@@ -118,8 +118,8 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
118
118
|
fileTokenScores: Record<string, Record<string, number>>;
|
|
119
119
|
knowledgeFiles: Record<string, string>;
|
|
120
120
|
gitChanges: {
|
|
121
|
-
diff: string;
|
|
122
121
|
status: string;
|
|
122
|
+
diff: string;
|
|
123
123
|
diffCached: string;
|
|
124
124
|
lastCommitMessages: string;
|
|
125
125
|
};
|
|
@@ -177,16 +177,16 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
177
177
|
}>>;
|
|
178
178
|
}, "strip", z.ZodTypeAny, {
|
|
179
179
|
type: "tool_use";
|
|
180
|
-
id: string;
|
|
181
180
|
name: string;
|
|
181
|
+
id: string;
|
|
182
182
|
input: Record<string, any>;
|
|
183
183
|
cache_control?: {
|
|
184
184
|
type: "ephemeral";
|
|
185
185
|
} | undefined;
|
|
186
186
|
}, {
|
|
187
187
|
type: "tool_use";
|
|
188
|
-
id: string;
|
|
189
188
|
name: string;
|
|
189
|
+
id: string;
|
|
190
190
|
input: Record<string, any>;
|
|
191
191
|
cache_control?: {
|
|
192
192
|
type: "ephemeral";
|
|
@@ -203,15 +203,15 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
203
203
|
type: "ephemeral";
|
|
204
204
|
}>>;
|
|
205
205
|
}, "strip", z.ZodTypeAny, {
|
|
206
|
-
type: "tool_result";
|
|
207
206
|
content: string;
|
|
207
|
+
type: "tool_result";
|
|
208
208
|
tool_use_id: string;
|
|
209
209
|
cache_control?: {
|
|
210
210
|
type: "ephemeral";
|
|
211
211
|
} | undefined;
|
|
212
212
|
}, {
|
|
213
|
-
type: "tool_result";
|
|
214
213
|
content: string;
|
|
214
|
+
type: "tool_result";
|
|
215
215
|
tool_use_id: string;
|
|
216
216
|
cache_control?: {
|
|
217
217
|
type: "ephemeral";
|
|
@@ -260,7 +260,6 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
260
260
|
} | undefined;
|
|
261
261
|
}>]>, "many">]>;
|
|
262
262
|
}, "strip", z.ZodTypeAny, {
|
|
263
|
-
role: "user" | "assistant";
|
|
264
263
|
content: string | ({
|
|
265
264
|
type: "text";
|
|
266
265
|
text: string;
|
|
@@ -269,15 +268,15 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
269
268
|
} | undefined;
|
|
270
269
|
} | {
|
|
271
270
|
type: "tool_use";
|
|
272
|
-
id: string;
|
|
273
271
|
name: string;
|
|
272
|
+
id: string;
|
|
274
273
|
input: Record<string, any>;
|
|
275
274
|
cache_control?: {
|
|
276
275
|
type: "ephemeral";
|
|
277
276
|
} | undefined;
|
|
278
277
|
} | {
|
|
279
|
-
type: "tool_result";
|
|
280
278
|
content: string;
|
|
279
|
+
type: "tool_result";
|
|
281
280
|
tool_use_id: string;
|
|
282
281
|
cache_control?: {
|
|
283
282
|
type: "ephemeral";
|
|
@@ -293,8 +292,8 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
293
292
|
type: "ephemeral";
|
|
294
293
|
} | undefined;
|
|
295
294
|
})[];
|
|
296
|
-
}, {
|
|
297
295
|
role: "user" | "assistant";
|
|
296
|
+
}, {
|
|
298
297
|
content: string | ({
|
|
299
298
|
type: "text";
|
|
300
299
|
text: string;
|
|
@@ -303,15 +302,15 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
303
302
|
} | undefined;
|
|
304
303
|
} | {
|
|
305
304
|
type: "tool_use";
|
|
306
|
-
id: string;
|
|
307
305
|
name: string;
|
|
306
|
+
id: string;
|
|
308
307
|
input: Record<string, any>;
|
|
309
308
|
cache_control?: {
|
|
310
309
|
type: "ephemeral";
|
|
311
310
|
} | undefined;
|
|
312
311
|
} | {
|
|
313
|
-
type: "tool_result";
|
|
314
312
|
content: string;
|
|
313
|
+
type: "tool_result";
|
|
315
314
|
tool_use_id: string;
|
|
316
315
|
cache_control?: {
|
|
317
316
|
type: "ephemeral";
|
|
@@ -327,6 +326,7 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
327
326
|
type: "ephemeral";
|
|
328
327
|
} | undefined;
|
|
329
328
|
})[];
|
|
329
|
+
role: "user" | "assistant";
|
|
330
330
|
}>, "many">;
|
|
331
331
|
}, "strip", z.ZodTypeAny, {
|
|
332
332
|
agentContext: string;
|
|
@@ -336,8 +336,8 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
336
336
|
fileTokenScores: Record<string, Record<string, number>>;
|
|
337
337
|
knowledgeFiles: Record<string, string>;
|
|
338
338
|
gitChanges: {
|
|
339
|
-
diff: string;
|
|
340
339
|
status: string;
|
|
340
|
+
diff: string;
|
|
341
341
|
diffCached: string;
|
|
342
342
|
lastCommitMessages: string;
|
|
343
343
|
};
|
|
@@ -358,7 +358,6 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
358
358
|
userKnowledgeFiles?: Record<string, string> | undefined;
|
|
359
359
|
};
|
|
360
360
|
messageHistory: {
|
|
361
|
-
role: "user" | "assistant";
|
|
362
361
|
content: string | ({
|
|
363
362
|
type: "text";
|
|
364
363
|
text: string;
|
|
@@ -367,15 +366,15 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
367
366
|
} | undefined;
|
|
368
367
|
} | {
|
|
369
368
|
type: "tool_use";
|
|
370
|
-
id: string;
|
|
371
369
|
name: string;
|
|
370
|
+
id: string;
|
|
372
371
|
input: Record<string, any>;
|
|
373
372
|
cache_control?: {
|
|
374
373
|
type: "ephemeral";
|
|
375
374
|
} | undefined;
|
|
376
375
|
} | {
|
|
377
|
-
type: "tool_result";
|
|
378
376
|
content: string;
|
|
377
|
+
type: "tool_result";
|
|
379
378
|
tool_use_id: string;
|
|
380
379
|
cache_control?: {
|
|
381
380
|
type: "ephemeral";
|
|
@@ -391,6 +390,7 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
391
390
|
type: "ephemeral";
|
|
392
391
|
} | undefined;
|
|
393
392
|
})[];
|
|
393
|
+
role: "user" | "assistant";
|
|
394
394
|
}[];
|
|
395
395
|
}, {
|
|
396
396
|
agentContext: string;
|
|
@@ -400,8 +400,8 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
400
400
|
fileTokenScores: Record<string, Record<string, number>>;
|
|
401
401
|
knowledgeFiles: Record<string, string>;
|
|
402
402
|
gitChanges: {
|
|
403
|
-
diff: string;
|
|
404
403
|
status: string;
|
|
404
|
+
diff: string;
|
|
405
405
|
diffCached: string;
|
|
406
406
|
lastCommitMessages: string;
|
|
407
407
|
};
|
|
@@ -422,7 +422,6 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
422
422
|
userKnowledgeFiles?: Record<string, string> | undefined;
|
|
423
423
|
};
|
|
424
424
|
messageHistory: {
|
|
425
|
-
role: "user" | "assistant";
|
|
426
425
|
content: string | ({
|
|
427
426
|
type: "text";
|
|
428
427
|
text: string;
|
|
@@ -431,15 +430,15 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
431
430
|
} | undefined;
|
|
432
431
|
} | {
|
|
433
432
|
type: "tool_use";
|
|
434
|
-
id: string;
|
|
435
433
|
name: string;
|
|
434
|
+
id: string;
|
|
436
435
|
input: Record<string, any>;
|
|
437
436
|
cache_control?: {
|
|
438
437
|
type: "ephemeral";
|
|
439
438
|
} | undefined;
|
|
440
439
|
} | {
|
|
441
|
-
type: "tool_result";
|
|
442
440
|
content: string;
|
|
441
|
+
type: "tool_result";
|
|
443
442
|
tool_use_id: string;
|
|
444
443
|
cache_control?: {
|
|
445
444
|
type: "ephemeral";
|
|
@@ -455,6 +454,7 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
455
454
|
type: "ephemeral";
|
|
456
455
|
} | undefined;
|
|
457
456
|
})[];
|
|
457
|
+
role: "user" | "assistant";
|
|
458
458
|
}[];
|
|
459
459
|
}>;
|
|
460
460
|
export type AgentState = z.infer<typeof AgentStateSchema>;
|
|
@@ -35,16 +35,16 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
35
35
|
}>>;
|
|
36
36
|
}, "strip", z.ZodTypeAny, {
|
|
37
37
|
type: "tool_use";
|
|
38
|
-
id: string;
|
|
39
38
|
name: string;
|
|
39
|
+
id: string;
|
|
40
40
|
input: Record<string, any>;
|
|
41
41
|
cache_control?: {
|
|
42
42
|
type: "ephemeral";
|
|
43
43
|
} | undefined;
|
|
44
44
|
}, {
|
|
45
45
|
type: "tool_use";
|
|
46
|
-
id: string;
|
|
47
46
|
name: string;
|
|
47
|
+
id: string;
|
|
48
48
|
input: Record<string, any>;
|
|
49
49
|
cache_control?: {
|
|
50
50
|
type: "ephemeral";
|
|
@@ -61,15 +61,15 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
61
61
|
type: "ephemeral";
|
|
62
62
|
}>>;
|
|
63
63
|
}, "strip", z.ZodTypeAny, {
|
|
64
|
-
type: "tool_result";
|
|
65
64
|
content: string;
|
|
65
|
+
type: "tool_result";
|
|
66
66
|
tool_use_id: string;
|
|
67
67
|
cache_control?: {
|
|
68
68
|
type: "ephemeral";
|
|
69
69
|
} | undefined;
|
|
70
70
|
}, {
|
|
71
|
-
type: "tool_result";
|
|
72
71
|
content: string;
|
|
72
|
+
type: "tool_result";
|
|
73
73
|
tool_use_id: string;
|
|
74
74
|
cache_control?: {
|
|
75
75
|
type: "ephemeral";
|
|
@@ -155,16 +155,16 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
155
155
|
}>>;
|
|
156
156
|
}, "strip", z.ZodTypeAny, {
|
|
157
157
|
type: "tool_use";
|
|
158
|
-
id: string;
|
|
159
158
|
name: string;
|
|
159
|
+
id: string;
|
|
160
160
|
input: Record<string, any>;
|
|
161
161
|
cache_control?: {
|
|
162
162
|
type: "ephemeral";
|
|
163
163
|
} | undefined;
|
|
164
164
|
}, {
|
|
165
165
|
type: "tool_use";
|
|
166
|
-
id: string;
|
|
167
166
|
name: string;
|
|
167
|
+
id: string;
|
|
168
168
|
input: Record<string, any>;
|
|
169
169
|
cache_control?: {
|
|
170
170
|
type: "ephemeral";
|
|
@@ -181,15 +181,15 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
181
181
|
type: "ephemeral";
|
|
182
182
|
}>>;
|
|
183
183
|
}, "strip", z.ZodTypeAny, {
|
|
184
|
-
type: "tool_result";
|
|
185
184
|
content: string;
|
|
185
|
+
type: "tool_result";
|
|
186
186
|
tool_use_id: string;
|
|
187
187
|
cache_control?: {
|
|
188
188
|
type: "ephemeral";
|
|
189
189
|
} | undefined;
|
|
190
190
|
}, {
|
|
191
|
-
type: "tool_result";
|
|
192
191
|
content: string;
|
|
192
|
+
type: "tool_result";
|
|
193
193
|
tool_use_id: string;
|
|
194
194
|
cache_control?: {
|
|
195
195
|
type: "ephemeral";
|
|
@@ -238,7 +238,6 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
238
238
|
} | undefined;
|
|
239
239
|
}>]>, "many">]>;
|
|
240
240
|
}, "strip", z.ZodTypeAny, {
|
|
241
|
-
role: "user" | "assistant";
|
|
242
241
|
content: string | ({
|
|
243
242
|
type: "text";
|
|
244
243
|
text: string;
|
|
@@ -247,15 +246,15 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
247
246
|
} | undefined;
|
|
248
247
|
} | {
|
|
249
248
|
type: "tool_use";
|
|
250
|
-
id: string;
|
|
251
249
|
name: string;
|
|
250
|
+
id: string;
|
|
252
251
|
input: Record<string, any>;
|
|
253
252
|
cache_control?: {
|
|
254
253
|
type: "ephemeral";
|
|
255
254
|
} | undefined;
|
|
256
255
|
} | {
|
|
257
|
-
type: "tool_result";
|
|
258
256
|
content: string;
|
|
257
|
+
type: "tool_result";
|
|
259
258
|
tool_use_id: string;
|
|
260
259
|
cache_control?: {
|
|
261
260
|
type: "ephemeral";
|
|
@@ -271,8 +270,8 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
271
270
|
type: "ephemeral";
|
|
272
271
|
} | undefined;
|
|
273
272
|
})[];
|
|
274
|
-
}, {
|
|
275
273
|
role: "user" | "assistant";
|
|
274
|
+
}, {
|
|
276
275
|
content: string | ({
|
|
277
276
|
type: "text";
|
|
278
277
|
text: string;
|
|
@@ -281,15 +280,15 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
281
280
|
} | undefined;
|
|
282
281
|
} | {
|
|
283
282
|
type: "tool_use";
|
|
284
|
-
id: string;
|
|
285
283
|
name: string;
|
|
284
|
+
id: string;
|
|
286
285
|
input: Record<string, any>;
|
|
287
286
|
cache_control?: {
|
|
288
287
|
type: "ephemeral";
|
|
289
288
|
} | undefined;
|
|
290
289
|
} | {
|
|
291
|
-
type: "tool_result";
|
|
292
290
|
content: string;
|
|
291
|
+
type: "tool_result";
|
|
293
292
|
tool_use_id: string;
|
|
294
293
|
cache_control?: {
|
|
295
294
|
type: "ephemeral";
|
|
@@ -305,6 +304,7 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
305
304
|
type: "ephemeral";
|
|
306
305
|
} | undefined;
|
|
307
306
|
})[];
|
|
307
|
+
role: "user" | "assistant";
|
|
308
308
|
}>;
|
|
309
309
|
export type Message = z.infer<typeof MessageSchema>;
|
|
310
310
|
export type MessageContentObject = z.infer<typeof MessageContentObjectSchema>;
|
|
@@ -12,7 +12,7 @@ function applyChanges(projectRoot, changes) {
|
|
|
12
12
|
const created = [];
|
|
13
13
|
const modified = [];
|
|
14
14
|
for (const change of changes) {
|
|
15
|
-
const { filePath, content, type } = change;
|
|
15
|
+
const { path: filePath, content, type } = change;
|
|
16
16
|
const fullPath = path_1.default.join(projectRoot, filePath);
|
|
17
17
|
try {
|
|
18
18
|
const fileExists = fs_1.default.existsSync(fullPath);
|
|
@@ -37,13 +37,13 @@ function applyChanges(projectRoot, changes) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
catch (error) {
|
|
40
|
-
console.error(`Failed to apply patch to ${
|
|
40
|
+
console.error(`Failed to apply patch to ${path_1.default}:`, error, content);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
return { created, modified };
|
|
44
44
|
}
|
|
45
45
|
async function applyAndRevertChanges(projectRoot, changes, onApply) {
|
|
46
|
-
const filesChanged = changes.map((change) => change.
|
|
46
|
+
const filesChanged = changes.map((change) => change.path);
|
|
47
47
|
const files = Object.fromEntries(filesChanged.map((filePath) => {
|
|
48
48
|
const fullPath = path_1.default.join(projectRoot, filePath);
|
|
49
49
|
const oldContent = fs_1.default.existsSync(fullPath)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../../src/util/changes.ts"],"names":[],"mappings":";;;;;AAKA,oCAiCC;AAED,sDA8BC;AAtED,4CAAmB;AACnB,gDAAuB;AAEvB,mCAAoC;AAEpC,SAAgB,YAAY,CAAC,WAAmB,EAAE,OAAoB;IACpE,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAA;IAE7B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,EAAE,QAAQ,EAAE,OAAO,EAA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CAAC;QAC3D,IAAI,UAAU,KAAK,kBAAkB,EAAE,CAAC;YACtC,IAAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;gBACpD,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAA;YACjD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,YAAE,CAAC,aAAa,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAA;QAChE,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getModelForMode(mode: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/util/constants.ts"],"names":[],"mappings":";;AAAA,0CAEC;AAFD,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,iBAAiB,CAAA;AAC1B,CAAC"}
|
|
@@ -10,15 +10,15 @@ export declare const userSchema: z.ZodObject<{
|
|
|
10
10
|
email: string;
|
|
11
11
|
name: string | null;
|
|
12
12
|
id: string;
|
|
13
|
-
authToken: string;
|
|
14
13
|
fingerprintId: string;
|
|
14
|
+
authToken: string;
|
|
15
15
|
fingerprintHash: string;
|
|
16
16
|
}, {
|
|
17
17
|
email: string;
|
|
18
18
|
name: string | null;
|
|
19
19
|
id: string;
|
|
20
|
-
authToken: string;
|
|
21
20
|
fingerprintId: string;
|
|
21
|
+
authToken: string;
|
|
22
22
|
fingerprintHash: string;
|
|
23
23
|
}>;
|
|
24
24
|
export type User = z.infer<typeof userSchema>;
|
|
@@ -137,15 +137,19 @@ export declare const ProjectFileContextSchema: z.ZodObject<{
|
|
|
137
137
|
}>;
|
|
138
138
|
export type ProjectFileContext = z.infer<typeof ProjectFileContextSchema>;
|
|
139
139
|
export declare const createFileBlock: (filePath: string, content: string) => string;
|
|
140
|
-
export declare const createFileBlockWithoutPath: (content: string) => string;
|
|
141
140
|
export declare const fileRegex: RegExp;
|
|
142
141
|
export declare const fileWithNoPathRegex: RegExp;
|
|
143
142
|
export declare const parseFileBlocks: (fileBlocks: string) => Record<string, string>;
|
|
144
|
-
export declare const parseFileBlocksWithoutPath: (fileBlocks: string) => string[];
|
|
145
143
|
export declare const createMarkdownFileBlock: (filePath: string, content: string) => string;
|
|
146
144
|
export declare const createSearchReplaceBlock: (search: string, replace: string) => string;
|
|
147
145
|
export declare function printFileTree(nodes: FileTreeNode[], depth?: number): string;
|
|
148
146
|
export declare function printFileTreeWithTokens(nodes: FileTreeNode[], fileTokenScores: Record<string, Record<string, number>>, path?: string[]): string;
|
|
147
|
+
/**
|
|
148
|
+
* Ensures the given file contents ends with a newline character.
|
|
149
|
+
* @param contents - The file contents
|
|
150
|
+
* @returns the file contents with a newline character.
|
|
151
|
+
*/
|
|
152
|
+
export declare const ensureEndsWithNewline: (contents: string | null) => string | null;
|
|
149
153
|
export declare const ensureDirectoryExists: (baseDir: string) => void;
|
|
150
154
|
/**
|
|
151
155
|
* Removes markdown code block syntax if present, including any language tag
|
package/dist/common/util/file.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.cleanMarkdownCodeBlock = exports.ensureDirectoryExists = exports.
|
|
26
|
+
exports.cleanMarkdownCodeBlock = exports.ensureDirectoryExists = exports.ensureEndsWithNewline = exports.createSearchReplaceBlock = exports.createMarkdownFileBlock = exports.parseFileBlocks = exports.fileWithNoPathRegex = exports.fileRegex = exports.createFileBlock = exports.ProjectFileContextSchema = exports.FileVersionSchema = exports.FileTreeNodeSchema = void 0;
|
|
27
27
|
exports.printFileTree = printFileTree;
|
|
28
28
|
exports.printFileTreeWithTokens = printFileTreeWithTokens;
|
|
29
29
|
exports.isValidFilePath = isValidFilePath;
|
|
@@ -64,23 +64,18 @@ exports.ProjectFileContextSchema = zod_1.z.object({
|
|
|
64
64
|
fileVersions: zod_1.z.array(zod_1.z.array(exports.FileVersionSchema)),
|
|
65
65
|
});
|
|
66
66
|
const createFileBlock = (filePath, content) => {
|
|
67
|
+
const tagName = 'write_file';
|
|
67
68
|
return ('<' +
|
|
68
|
-
|
|
69
|
+
`${tagName}>
|
|
70
|
+
<path>${filePath}</path>
|
|
71
|
+
<content>
|
|
69
72
|
${content}
|
|
70
|
-
</
|
|
71
|
-
|
|
73
|
+
</content>
|
|
74
|
+
</${tagName}>`);
|
|
72
75
|
};
|
|
73
76
|
exports.createFileBlock = createFileBlock;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
`edit_file>
|
|
77
|
-
${content}
|
|
78
|
-
</edit_file` +
|
|
79
|
-
'>');
|
|
80
|
-
};
|
|
81
|
-
exports.createFileBlockWithoutPath = createFileBlockWithoutPath;
|
|
82
|
-
exports.fileRegex = /<edit_file path="([^"]+)">([\s\S]*?)<\/edit_file>/g;
|
|
83
|
-
exports.fileWithNoPathRegex = /<edit_file>([\s\S]*?)<\/edit_file>/g;
|
|
77
|
+
exports.fileRegex = /<write_file>\s*<path>([^<]+)<\/path>\s*<content>([\s\S]*?)<\/content>\s*<\/write_file>/g;
|
|
78
|
+
exports.fileWithNoPathRegex = /<write_file>([\s\S]*?)<\/write_file>/g;
|
|
84
79
|
const parseFileBlocks = (fileBlocks) => {
|
|
85
80
|
let fileMatch;
|
|
86
81
|
const files = {};
|
|
@@ -93,16 +88,6 @@ const parseFileBlocks = (fileBlocks) => {
|
|
|
93
88
|
return files;
|
|
94
89
|
};
|
|
95
90
|
exports.parseFileBlocks = parseFileBlocks;
|
|
96
|
-
const parseFileBlocksWithoutPath = (fileBlocks) => {
|
|
97
|
-
let fileMatch;
|
|
98
|
-
const files = [];
|
|
99
|
-
while ((fileMatch = exports.fileWithNoPathRegex.exec(fileBlocks)) !== null) {
|
|
100
|
-
const [, fileContent] = fileMatch;
|
|
101
|
-
files.push(fileContent.startsWith('\n') ? fileContent.slice(1) : fileContent);
|
|
102
|
-
}
|
|
103
|
-
return files;
|
|
104
|
-
};
|
|
105
|
-
exports.parseFileBlocksWithoutPath = parseFileBlocksWithoutPath;
|
|
106
91
|
const createMarkdownFileBlock = (filePath, content) => {
|
|
107
92
|
return `\`\`\`${filePath}\n${content}\n\`\`\``;
|
|
108
93
|
};
|
|
@@ -152,6 +137,22 @@ function printFileTreeWithTokens(nodes, fileTokenScores, path = []) {
|
|
|
152
137
|
}
|
|
153
138
|
return result;
|
|
154
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Ensures the given file contents ends with a newline character.
|
|
142
|
+
* @param contents - The file contents
|
|
143
|
+
* @returns the file contents with a newline character.
|
|
144
|
+
*/
|
|
145
|
+
const ensureEndsWithNewline = (contents) => {
|
|
146
|
+
if (contents === null || contents === '') {
|
|
147
|
+
// Leave empty file as is
|
|
148
|
+
return contents;
|
|
149
|
+
}
|
|
150
|
+
if (contents.endsWith('\n')) {
|
|
151
|
+
return contents;
|
|
152
|
+
}
|
|
153
|
+
return contents + '\n';
|
|
154
|
+
};
|
|
155
|
+
exports.ensureEndsWithNewline = ensureEndsWithNewline;
|
|
155
156
|
const ensureDirectoryExists = (baseDir) => {
|
|
156
157
|
if (!fs.existsSync(baseDir)) {
|
|
157
158
|
fs.mkdirSync(baseDir, { recursive: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/util/file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/util/file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,sCAaC;AAED,0DAmCC;AAoCD,0CAWC;AApMD,uCAAwB;AACxB,6BAAuB;AAEV,QAAA,kBAAkB,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AAA;IAEvB,uBAAuB;IACvB,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IAEjC,+BAA+B;IAC/B,MAAM,YAAY,GAAG,qBAAqB,CAAA;IAC1C,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IAEzC,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/common/util/git.js
CHANGED
|
@@ -65,7 +65,7 @@ function stageAllChanges() {
|
|
|
65
65
|
}
|
|
66
66
|
function stagePatches(dir, changes) {
|
|
67
67
|
try {
|
|
68
|
-
const fileNames = changes.map((change) => change.
|
|
68
|
+
const fileNames = changes.map((change) => change.path);
|
|
69
69
|
const existingFileNames = fileNames.filter((filePath) => fs.existsSync(path.join(dir, filePath)));
|
|
70
70
|
if (existingFileNames.length === 0) {
|
|
71
71
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/util/git.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,4CAOC;AAED,4CAMC;AAED,sCAIC;AAED,0CAOC;AAED,oCAiBC;AAtDD,iDAAwC;AACxC,uCAAwB;AACxB,2CAA4B;AAG5B,SAAgB,gBAAgB;IAC9B,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,2BAA2B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC1D,OAAO,KAAK,CAAA;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,SAAgB,gBAAgB;IAC9B,IAAI,CAAC;QACH,OAAO,IAAA,wBAAQ,EAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE,CAAA;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,SAAgB,aAAa,CA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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/util/helpers.ts"],"names":[],"mappings":";;;AAAO,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAA7D,QAAA,KAAK,SAAwD"}
|
|
@@ -7,3 +7,11 @@ export declare function withRetry<T>(operation: () => Promise<T>, options?: {
|
|
|
7
7
|
}): Promise<T>;
|
|
8
8
|
export declare const mapAsync: <T, U>(items: T[], f: (item: T, index: number) => Promise<U>, maxConcurrentRequests?: number) => Promise<U[]>;
|
|
9
9
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a promise with a timeout
|
|
12
|
+
* @param promise The promise to wrap
|
|
13
|
+
* @param timeoutMs Timeout in milliseconds
|
|
14
|
+
* @param timeoutMessage Optional message for the timeout error
|
|
15
|
+
* @returns A promise that resolves with the result of the original promise or rejects with a timeout error
|
|
16
|
+
*/
|
|
17
|
+
export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, timeoutMessage?: string): Promise<T>;
|