feat: 更新端口默认值为51515,添加useKey以获取默认仓库ID,更新创建文件描述信息

This commit is contained in:
2026-03-06 02:39:45 +08:00
parent 841ed6ffa7
commit 8465ba7182
4 changed files with 7 additions and 5 deletions

View File

@@ -19,12 +19,12 @@ app.route({
title: '获取当前cnb工作空间的port代理uri', title: '获取当前cnb工作空间的port代理uri',
summary: '获取当前cnb工作空间的port代理uri用于端口转发', summary: '获取当前cnb工作空间的port代理uri用于端口转发',
args: { args: {
port: tool.schema.number().optional().describe('端口号,默认为4096'), port: tool.schema.number().optional().describe('端口号,默认为51515'),
} }
}) })
} }
}).define(async (ctx) => { }).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 uri = CNB_ENV?.CNB_VSCODE_PROXY_URI as string || '';
const finalUri = uri.replace('{{port}}', port.toString()); const finalUri = uri.replace('{{port}}', port.toString());
let content = ` let content = `

View File

@@ -1,5 +1,6 @@
import { createSkill, tool } from '@kevisual/router'; import { createSkill, tool } from '@kevisual/router';
import { app, cnb } from '../../app.ts'; import { app, cnb } from '../../app.ts';
import { useKey } from '@kevisual/context';
// 查询 Issue 列表 repo是 kevisual/kevisual // 查询 Issue 列表 repo是 kevisual/kevisual
app.route({ app.route({
@@ -25,7 +26,7 @@ app.route({
}) })
} }
}).define(async (ctx) => { }).define(async (ctx) => {
const repo = ctx.query?.repo; const repo = ctx.query?.repo || useKey('CNB_REPO_SLUG_LOWERCASE');
const state = ctx.query?.state; const state = ctx.query?.state;
const keyword = ctx.query?.keyword; const keyword = ctx.query?.keyword;
const labels = ctx.query?.labels; const labels = ctx.query?.labels;

View File

@@ -1,6 +1,7 @@
import { createSkill, tool } from '@kevisual/router'; import { createSkill, tool } from '@kevisual/router';
import { app, cnb } from '../../app.ts'; import { app, cnb } from '../../app.ts';
import { CNBChat } from '@kevisual/ai/browser' import { CNBChat } from '@kevisual/ai/browser'
import { useKey } from '@kevisual/context';
/** /**
@@ -107,7 +108,7 @@ app.route({
ctx.body = { content: '请提供有效的消息内容' }; ctx.body = { content: '请提供有效的消息内容' };
return; return;
} }
let repo = ctx.query?.repo; let repo = ctx.query?.repo || useKey('CNB_REPO_SLUG_LOWERCASE');
if (!repo) { if (!repo) {
// 如果未指定知识库仓库ID则使用默认知识库 // 如果未指定知识库仓库ID则使用默认知识库
const res = await cnb.repo.getRepoList({ flags: 'KnowledgeBase' }); const res = await cnb.repo.getRepoList({ flags: 'KnowledgeBase' });

View File

@@ -45,7 +45,7 @@ app.route({
app.route({ app.route({
path: 'cnb', path: 'cnb',
key: 'create-repo-file', key: 'create-repo-file',
description: '在代码仓库中创建文件, repoName, filePath, content, encoding', description: '在代码仓库中创建文件, repoName, filePath, content, encoding。使用CNB_COOKIE进行鉴权',
middleware: ['admin-auth'], middleware: ['admin-auth'],
metadata: { metadata: {
tags: ['opencode'], tags: ['opencode'],