mirror of
https://fastgit.cc/https://github.com/anomalyco/opencode
synced 2026-04-30 13:51:48 +08:00
chore: generate
This commit is contained in:
committed by
Aiden Cline
parent
8113a4360e
commit
894e638914
@@ -151,17 +151,15 @@ export const ApplyPatchTool = Tool.define(
|
||||
}
|
||||
|
||||
case "delete": {
|
||||
const source = yield* Bom
|
||||
.readFile(afs, filePath)
|
||||
.pipe(
|
||||
Effect.catch((error) =>
|
||||
Effect.fail(
|
||||
new Error(
|
||||
`apply_patch verification failed: ${error instanceof Error ? error.message : String(error)}`,
|
||||
),
|
||||
const source = yield* Bom.readFile(afs, filePath).pipe(
|
||||
Effect.catch((error) =>
|
||||
Effect.fail(
|
||||
new Error(
|
||||
`apply_patch verification failed: ${error instanceof Error ? error.message : String(error)}`,
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
)
|
||||
const contentToDelete = source.text
|
||||
const deleteDiff = trimDiff(createTwoFilesPatch(filePath, filePath, contentToDelete, ""))
|
||||
|
||||
|
||||
@@ -206,7 +206,8 @@ describe("tool.apply_patch freeform", () => {
|
||||
const target = path.join(fixture.path, "example.cs")
|
||||
await fs.writeFile(target, `${bom}using System;\n\nclass Test {}\n`, "utf-8")
|
||||
|
||||
const patchText = "*** Begin Patch\n*** Update File: example.cs\n@@\n class Test {}\n+class Next {}\n*** End Patch"
|
||||
const patchText =
|
||||
"*** Begin Patch\n*** Update File: example.cs\n@@\n class Test {}\n+class Next {}\n*** End Patch"
|
||||
|
||||
await execute({ patchText }, ctx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user