This commit is contained in:
xiongxiao
2026-01-20 20:05:45 +08:00
parent ddba845ce7
commit 2eeaf991b9

View File

@@ -3,6 +3,7 @@ import { createSkill, tool } from "@kevisual/router";
import { opencodeManager } from './module/open.ts' import { opencodeManager } from './module/open.ts'
import path from "node:path"; import path from "node:path";
import { execSync } from "node:child_process"; import { execSync } from "node:child_process";
import { useKey } from '@kevisual/use-config';
// 创建一个opencode 客户端 // 创建一个opencode 客户端
app.route({ app.route({
@@ -67,7 +68,12 @@ app.route({
}, },
}).define(async (ctx) => { }).define(async (ctx) => {
const url = await opencodeManager.getUrl(); 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); }).addTo(app);
// 调用 path: opencode key: ls-projects // 调用 path: opencode key: ls-projects
app.route({ app.route({