real life totally configurabl ai subasians

This commit is contained in:
Dax Raad
2025-07-24 21:20:43 -04:00
parent 88477b3ee7
commit 8dcd39f5b7
22 changed files with 729 additions and 122 deletions

View File

@@ -10,12 +10,22 @@ export const MultiEditTool = Tool.define({
description: DESCRIPTION,
parameters: z.object({
filePath: z.string().describe("The absolute path to the file to modify"),
edits: z.array(EditTool.parameters).describe("Array of edit operations to perform sequentially on the file"),
edits: z
.array(
z.object({
filePath: z.string().describe("The absolute path to the file to modify"),
oldString: z.string().describe("The text to replace"),
newString: z.string().describe("The text to replace it with (must be different from oldString)"),
replaceAll: z.boolean().optional().describe("Replace all occurrences of oldString (default false)"),
}),
)
.describe("Array of edit operations to perform sequentially on the file"),
}),
async execute(params, ctx) {
const tool = await EditTool()
const results = []
for (const [, edit] of params.edits.entries()) {
const result = await EditTool.execute(
const result = await tool.execute(
{
filePath: params.filePath,
oldString: edit.oldString,