添加仓库管理功能,包括创建、删除和列出代码仓库,更新依赖安装逻辑,修复环境变量配置
This commit is contained in:
32
agent/routes/call/index.ts
Normal file
32
agent/routes/call/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { createSkill } from '@kevisual/router'
|
||||
import { app } from '../../app.ts'
|
||||
import { tool } from '@opencode-ai/plugin/tool'
|
||||
|
||||
// "调用 path: cnb key: list-repos"
|
||||
app.route({
|
||||
path: 'call',
|
||||
key: '',
|
||||
description: '调用',
|
||||
middleware: ['auth'],
|
||||
metadata: {
|
||||
tags: ['opencode'],
|
||||
...createSkill({
|
||||
skill: 'call-app',
|
||||
title: '调用app应用',
|
||||
summary: '调用router的应用, 参数path, key, payload',
|
||||
args: {
|
||||
path: tool.schema.string().describe('应用路径,例如 cnb'),
|
||||
key: tool.schema.string().optional().describe('应用key,例如 list-repos'),
|
||||
payload: tool.schema.object({}).optional().describe('调用参数'),
|
||||
}
|
||||
})
|
||||
},
|
||||
}).define(async (ctx) => {
|
||||
const { path, key } = ctx.query;
|
||||
console.log('call app', ctx.query);
|
||||
if (!path) {
|
||||
ctx.throw('路径path不能为空');
|
||||
}
|
||||
const res = await ctx.run({ path, key, payload: ctx.query.payload || {} });
|
||||
ctx.forward(res);
|
||||
}).addTo(app)
|
||||
1
agent/routes/call/tempCodeRunnerFile.ts
Normal file
1
agent/routes/call/tempCodeRunnerFile.ts
Normal file
@@ -0,0 +1 @@
|
||||
调用 path: cnb key: get-repo-list payload: { page: 1, per_page: 10 }
|
||||
Reference in New Issue
Block a user