From 8465ba71822c1e4132182116938d999ec7d72d69 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Fri, 6 Mar 2026 02:39:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=BA51515=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0useKey=E4=BB=A5=E8=8E=B7=E5=8F=96=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=BB=93=E5=BA=93ID=EF=BC=8C=E6=9B=B4=E6=96=B0=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=96=87=E4=BB=B6=E6=8F=8F=E8=BF=B0=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agent/routes/cnb-env/vscode.ts | 4 ++-- agent/routes/issues/list.ts | 3 ++- agent/routes/knowledge/ai.ts | 3 ++- agent/routes/repo/repo.ts | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) 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'],