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

@@ -2,6 +2,8 @@ import { createSkill } from '@kevisual/router';
import { app, cnb } from '../../app.ts';
import { tool } from "@opencode-ai/plugin/tool"
// "列出我的代码仓库search blog"
// 列出我的知识库的代码仓库
app.route({
path: 'cnb',
key: 'list-repos',
@@ -11,18 +13,24 @@ app.route({
tags: ['opencode'],
...createSkill({
skill: 'list-repos',
title: '列出代码仓库',
summary: '列出代码仓库',
title: '列出cnb代码仓库',
summary: '列出cnb代码仓库, 可选flags参数如 KnowledgeBase',
args: {
search: tool.schema.string().optional().describe('搜索关键词'),
pageSize: tool.schema.number().optional().describe('每页数量默认999'),
flags: tool.schema.string().optional().describe('仓库标记,如果是知识库则填写 KnowledgeBase'),
},
})
}
}).define(async (ctx) => {
const search = ctx.query?.search;
const pageSize = ctx.query?.pageSize || 9999;
const res = await cnb.repo.getRepoList({ search, page_size: pageSize, role: 'developer' });
const flags = ctx.query?.flags;
const params: any = {};
if (flags) {
params.flags = flags;
}
const res = await cnb.repo.getRepoList({ search, page_size: pageSize, role: 'developer', ...params });
if (res.code === 200) {
const repos = res.data.map((item) => ({
name: item.name,
@@ -30,7 +38,7 @@ app.route({
description: item.description,
web_url: item.web_url,
}));
ctx.body = { content: JSON.stringify(repos) };
ctx.body = { content: JSON.stringify(repos), list: res.data };
} else {
ctx.throw(500, '获取仓库列表失败');
}