feat(app): 移除内置agents并添加CORS支持和技能上传优化

移除了agents/registry.json中的所有内置agents配置,将agents数组清空。
为web应用添加了CORS中间件支持,允许指定的前端地址跨域访问。
重构了技能上传功能,增加了LLM重写机制,自动规范化上传的技能格式。
新增了工具名称提取逻辑,从技能正文中自动识别Required Tools段落。
更新了技能学习候选者和草稿的载荷结构,添加评估报告统计信息。
修改了意图路由技能的说明,改进任务状态管理逻辑。
This commit is contained in:
2026-06-12 13:25:20 +08:00
parent fc9fd93c36
commit 8aeb97a5fc
76 changed files with 3382 additions and 553 deletions

View File

@ -5,9 +5,17 @@
"display_name": "terminal-operation",
"lineage": [],
"name": "terminal-operation",
"owners": ["system"],
"owners": [
"system"
],
"source_kind": "initial",
"status": "active",
"tags": ["terminal", "shell", "command", "process", "execution"],
"tags": [
"terminal",
"shell",
"command",
"process",
"execution"
],
"updated_at": "2026-05-26T00:00:00.000000+00:00"
}
}

View File

@ -7,13 +7,37 @@ tools:
- execute_code
---
# Terminal Operation — 终端与进程管理
# Terminal Operation
## Overview
Shell 命令执行、后台进程管理和 Python 代码执行。支持超时控制和后台运行。
## When to Use
- Use when the task requires Terminal Operation guidance.
## Required Tools
- `terminal`
- `process`
- `execute_code`
## Workflow
- Identify whether the user's request matches the skill's trigger conditions.
- Read the relevant source guidance below and apply only the steps that fit the current task.
- Use the required tools deliberately and keep tool output tied to the user's goal.
### Source Guidance
### Terminal Operation — 终端与进程管理
Shell 命令执行、后台进程管理和 Python 代码执行工具集。
## 工具说明
#### 工具说明
### terminal
##### terminal
执行 shell 命令。
- `command` (str): 要执行的命令
- `working_dir` (str, 默认 "."): 工作目录
@ -21,7 +45,7 @@ Shell 命令执行、后台进程管理和 Python 代码执行工具集。
- `background` (bool, 默认 false): 是否后台运行
- 后台运行时返回 process_id可通过 process 工具管理
### process
##### process
管理后台进程。
- `action` (str): `list` | `log` | `kill`
- `process_id` (str | None): 进程 ID
@ -29,7 +53,7 @@ Shell 命令执行、后台进程管理和 Python 代码执行工具集。
- `log`: 查看进程日志(最后 12000 字节)
- `kill`: 终止进程(先 SIGTERM5 秒后 SIGKILL
### execute_code
##### execute_code
执行 Python 代码片段。
- `code` (str): Python 代码
- `language` (str, 默认 "python"): 仅支持 python
@ -37,10 +61,25 @@ Shell 命令执行、后台进程管理和 Python 代码执行工具集。
- `working_dir` (str, 默认 "."): 工作目录
- 适合快速验证脚本逻辑,不适合长期运行任务
## 使用原则
#### 使用原则
1. 长期运行任务使用 `background=true`
2. 执行危险命令rm -rf、dd、格式化等前必须确认用户意图
3. `execute_code` 适合轻量脚本验证,重型任务用 `terminal`
4. 后台进程用完后及时 kill 清理
5. 注意命令注入风险,不要直接拼接用户输入
## Validation
- Verify the requested outcome with the most direct available check.
- Report any skipped step, unavailable dependency, or remaining uncertainty explicitly.
## Boundaries
- Do not broaden the task beyond the user's request.
- Do not use tools that are not listed or clearly available in the current runtime.
## Anti-Patterns
- Do not summarize the skill instead of applying it.
- Do not claim completion without validation evidence.

View File

@ -1,12 +1,16 @@
{
"change_reason": "Initial skill for terminal and process management",
"content_hash": "placeholder",
"content_hash": "2d122feb0963e072faa627ca644fff0b39aa7ff3a6a502f8b313bb26d7aee154",
"created_at": "2026-05-26T00:00:00.000000+00:00",
"created_by": "system",
"frontmatter": {
"description": "Shell 命令执行、后台进程管理和 Python 代码执行。支持超时控制和后台运行。",
"name": "terminal-operation",
"tools": ["terminal", "process", "execute_code"]
"tools": [
"terminal",
"process",
"execute_code"
]
},
"parent_version": null,
"provenance": {
@ -15,8 +19,12 @@
},
"review_state": "published",
"skill_name": "terminal-operation",
"summary": "Terminal Operation Shell 命令执行、后台进程管理Python 代码执行",
"summary_hash": "placeholder",
"tool_hints": ["terminal", "process", "execute_code"],
"summary": "# Terminal Operation ## Overview Shell 命令执行、后台进程管理Python 代码执行。支持超时控制和后台运行。",
"summary_hash": "8571fa76cc5e5aa682bd9503d45e91e4f111e6ef9d64152a69efa0462ae04294",
"tool_hints": [
"terminal",
"process",
"execute_code"
],
"version": "v0001"
}
}