mirror of
https://github.com/sst/opencode.git
synced 2025-09-01 02:37:23 +00:00
21 lines
516 B
TypeScript
21 lines
516 B
TypeScript
import { App } from "../src/app";
|
|
import path from "path";
|
|
import { edit } from "../src/tool";
|
|
import { FileTimes } from "../src/tool/util/file-times";
|
|
|
|
await App.provide({ directory: process.cwd() }, async () => {
|
|
const file = path.join(process.cwd(), "example/broken.ts");
|
|
FileTimes.read(file);
|
|
const tool = await edit.execute(
|
|
{
|
|
file_path: file,
|
|
old_string: "x:",
|
|
new_string: "x:",
|
|
},
|
|
{
|
|
toolCallId: "test",
|
|
messages: [],
|
|
},
|
|
);
|
|
console.log(tool.output);
|
|
});
|