diff --git a/assistant/src/routes/opencode/ls.ts b/assistant/src/routes/opencode/ls.ts index 380d518..7cb1592 100644 --- a/assistant/src/routes/opencode/ls.ts +++ b/assistant/src/routes/opencode/ls.ts @@ -3,6 +3,7 @@ import { createSkill, tool } from "@kevisual/router"; import { opencodeManager } from './module/open.ts' import path from "node:path"; import { execSync } from "node:child_process"; +import { useKey } from '@kevisual/use-config'; // 创建一个opencode 客户端 app.route({ @@ -67,7 +68,12 @@ app.route({ }, }).define(async (ctx) => { const url = await opencodeManager.getUrl(); - ctx.body = { content: url }; + const cnbURL = useKey('CNB_VSCODE_PROXY_URI') as string | undefined; + let content = `本地访问地址: ${url}` + if (cnbURL) { + content += `\n云端访问地址: ${cnbURL.replace('{{port}}', '5000')}`; + } + ctx.body = { content }; }).addTo(app); // 调用 path: opencode key: ls-projects app.route({