diff --git a/agent/routes/cnb-env/vscode.ts b/agent/routes/cnb-env/vscode.ts index ed45bca..7deec42 100644 --- a/agent/routes/cnb-env/vscode.ts +++ b/agent/routes/cnb-env/vscode.ts @@ -19,12 +19,12 @@ app.route({ title: '获取当前cnb工作空间的port代理uri', summary: '获取当前cnb工作空间的port代理uri,用于端口转发', args: { - port: tool.schema.number().optional().describe('端口号,默认为4096'), + port: tool.schema.number().optional().describe('端口号,默认为51515'), } }) } }).define(async (ctx) => { - const port = ctx.query?.port || 4096; + const port = ctx.query?.port || 51515; const uri = CNB_ENV?.CNB_VSCODE_PROXY_URI as string || ''; const finalUri = uri.replace('{{port}}', port.toString()); let content = ` diff --git a/agent/routes/issues/list.ts b/agent/routes/issues/list.ts index 9a701fe..e4e27c8 100644 --- a/agent/routes/issues/list.ts +++ b/agent/routes/issues/list.ts @@ -1,5 +1,6 @@ import { createSkill, tool } from '@kevisual/router'; import { app, cnb } from '../../app.ts'; +import { useKey } from '@kevisual/context'; // 查询 Issue 列表 repo是 kevisual/kevisual app.route({ @@ -25,7 +26,7 @@ app.route({ }) } }).define(async (ctx) => { - const repo = ctx.query?.repo; + const repo = ctx.query?.repo || useKey('CNB_REPO_SLUG_LOWERCASE'); const state = ctx.query?.state; const keyword = ctx.query?.keyword; const labels = ctx.query?.labels; diff --git a/agent/routes/knowledge/ai.ts b/agent/routes/knowledge/ai.ts index 622daf9..325f42b 100644 --- a/agent/routes/knowledge/ai.ts +++ b/agent/routes/knowledge/ai.ts @@ -1,6 +1,7 @@ import { createSkill, tool } from '@kevisual/router'; import { app, cnb } from '../../app.ts'; import { CNBChat } from '@kevisual/ai/browser' +import { useKey } from '@kevisual/context'; /** @@ -107,7 +108,7 @@ app.route({ ctx.body = { content: '请提供有效的消息内容' }; return; } - let repo = ctx.query?.repo; + let repo = ctx.query?.repo || useKey('CNB_REPO_SLUG_LOWERCASE'); if (!repo) { // 如果未指定知识库仓库ID,则使用默认知识库 const res = await cnb.repo.getRepoList({ flags: 'KnowledgeBase' }); diff --git a/agent/routes/repo/repo.ts b/agent/routes/repo/repo.ts index 36af2fc..cdd5699 100644 --- a/agent/routes/repo/repo.ts +++ b/agent/routes/repo/repo.ts @@ -45,7 +45,7 @@ app.route({ app.route({ path: 'cnb', key: 'create-repo-file', - description: '在代码仓库中创建文件, repoName, filePath, content, encoding', + description: '在代码仓库中创建文件, repoName, filePath, content, encoding。使用CNB_COOKIE进行鉴权', middleware: ['admin-auth'], metadata: { tags: ['opencode'],