diff --git a/.opencode/plugin/agenat.ts b/.opencode/plugin/agenat.ts new file mode 100644 index 0000000..39ff257 --- /dev/null +++ b/.opencode/plugin/agenat.ts @@ -0,0 +1 @@ +export { AgentPlugin } from "../../assistant/src/main.ts"; \ No newline at end of file diff --git a/assistant/src/module/assistant/config/index.ts b/assistant/src/module/assistant/config/index.ts index e61fa41..d93d1b8 100644 --- a/assistant/src/module/assistant/config/index.ts +++ b/assistant/src/module/assistant/config/index.ts @@ -392,7 +392,8 @@ export const parseHomeArg = (homedir?: string) => { } else if (options.root) { _configDir = options.root; } - const isOpencode = execPath.includes('.opencode') || execPath.includes('opencode.exe'); + const checkUrl = ['.opencode', 'bin/opencode', 'opencode.exe'] + const isOpencode = checkUrl.some((item) => execPath.includes(item)) return { isOpencode, options, diff --git a/assistant/src/routes/opencode/ls.ts b/assistant/src/routes/opencode/ls.ts index a402dc4..380d518 100644 --- a/assistant/src/routes/opencode/ls.ts +++ b/assistant/src/routes/opencode/ls.ts @@ -66,7 +66,7 @@ app.route({ }) }, }).define(async (ctx) => { - const url = opencodeManager.getUrl(); + const url = await opencodeManager.getUrl(); ctx.body = { content: url }; }).addTo(app); // 调用 path: opencode key: ls-projects