feat: update package dependencies and add new routes for CNB environment management

- Updated package.json and pnpm-lock.yaml with new dependencies and versions.
- Removed outdated readme files from requirements.
- Enhanced CNB environment configuration in cnb-env.ts with new VS Code remote SSH settings.
- Modified KnowledgeBase class to return structured results.
- Updated Workspace class to return structured results.
- Implemented new routes for managing CNB cookies and VS Code proxy URIs.
- Added AI chat functionality for querying knowledge base.
- Created skills for cleaning up closed workspaces.
This commit is contained in:
xiongxiao
2026-01-27 04:02:34 +08:00
parent da7b06e519
commit 50332fe2f4
23 changed files with 665 additions and 201 deletions

View File

@@ -0,0 +1,48 @@
import { createSkill, tool } from '@kevisual/router';
import { app, cnb } from '../../app.ts';
// 设置 CNB_COOKIE环境变量和获取环境变量,用于界面操作定制模块功能
app.route({
path: 'cnb',
key: 'set-cnb-cookie',
description: '设置当前cnb工作空间的cookie环境变量',
middleware: ['auth'],
metadata: {
tags: ['opencode'],
...createSkill({
skill: 'set-cnb-cookie',
title: '设置当前cnb工作空间的cookie环境变量',
summary: '设置当前cnb工作空间的cookie环境变量用于界面操作定制模块功能,例子CNBSESSION=xxxx;csrfkey=2222xxxx;',
args: {
cookie: tool.schema.string().describe('cnb的cookie值'),
}
})
}
}).define(async (ctx) => {
const cookie = ctx.query?.cookie;
if (!cookie) {
ctx.body = { content: '请提供有效的cookie值' };
return;
}
cnb.cookie = cookie;
ctx.body = { content: '已成功设置cnb的cookie环境变量' };
}).addTo(app);
// 获取 CNB_COOKIE环境变量
app.route({
path: 'cnb',
key: 'get-cnb-cookie',
description: '获取当前cnb工作空间的cookie环境变量',
middleware: ['auth'],
metadata: {
tags: ['opencode'],
...createSkill({
skill: 'get-cnb-cookie',
title: '获取当前cnb工作空间的cookie环境变量',
summary: '获取当前cnb工作空间的cookie环境变量用于界面操作定制模块功能',
})
}
}).define(async (ctx) => {
const cookie = cnb.cookie || '未设置cookie环境变量';
ctx.body = { content: `当前cnb工作空间的cookie环境变量为${cookie}` };
}).addTo(app);