feat: Enhance skill management with remote installation and file upload#601
feat: Enhance skill management with remote installation and file upload#601
Conversation
- 新增 remote_skill_install_service.py 支持远程技能安装 - 更新 skill_service.py 增强技能管理功能 - 更新 skill_router.py 添加相关路由 - 更新前端组件 SkillsManagerComponent.vue - 更新 ExtensionsView.vue - 添加对应单元测试 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
牛逼,思维同频了,我这也在做。看来我不用继续了。坐等大佬合入 |
|
|
Looks good |
There was a problem hiding this comment.
Pull request overview
This PR enhances the Skills management experience by expanding import options and introducing remote installation via skills.sh/npx skills, with corresponding backend endpoints, service logic, docs, and tests.
Changes:
- Extend Skills import to support uploading a single
SKILL.mdin addition to ZIP packages. - Add remote Skill discovery + installation flow (frontend modal + backend endpoints calling
npx skillsin an isolatedHOME). - Update docs, Docker image dependencies, and unit tests to cover the new behaviors.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/views/ExtensionsView.vue | Adds “远程安装” entry point and allows uploading .md alongside .zip. |
| web/src/components/SkillsManagerComponent.vue | Implements remote install modal UI + API calls for listing/installing remote skills. |
| web/src/apis/skill_api.js | Adds API wrappers for /remote/list and /remote/install. |
| backend/server/routers/skill_router.py | Adds remote list/install routes and updates import docstring/log message. |
| backend/package/yuxi/services/skill_service.py | Refactors import logic to support single SKILL.md upload and directory import helper. |
| backend/package/yuxi/services/remote_skill_install_service.py | New service to run npx skills in isolated temp HOME, parse output, and import into system. |
| docker/api.Dockerfile | Installs git to support remote skill acquisition workflows. |
| backend/test/unit/services/test_skill_service.py | Adds coverage for single SKILL.md import and directory import validation. |
| backend/test/unit/services/test_remote_skill_install_service.py | Adds unit tests for parsing/listing/installing remote skills with isolated HOME. |
| backend/test/unit/routers/test_skill_router.py | Adds router tests for SKILL.md import and remote list/install routes. |
| docs/agents/skills-management.md | Documents the new remote install flow and updated import options. |
| docs/develop-guides/roadmap.md | Updates release notes/roadmap items to include the new Skills capabilities. |
| backend/package/yuxi/agents/middlewares/summary_middleware.py | Minor import ordering adjustment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <a-upload | ||
| accept=".zip" | ||
| accept=".zip,.md" | ||
| :show-upload-list="false" | ||
| :custom-request="handleImportUpload" | ||
| :disabled="skillsLoading || skillsImporting" | ||
| > | ||
| <a-button type="primary" :loading="skillsImporting" class="lucide-icon-btn"> | ||
| <Upload :size="14" /> | ||
| <span>上传 ZIP</span> | ||
| <span>上传 Skill</span> | ||
| </a-button> |
There was a problem hiding this comment.
accept=".zip,.md" 会允许用户选择任意 .md 文件,但后端 import_skill_zip() 仅接受 ZIP 或文件名以 SKILL.md(大小写不敏感)结尾的 Markdown;上传如 README.md 会直接返回 400,用户体验上容易困惑。建议在上传前做一次文件名校验(例如 beforeUpload / customRequest 内判断 file.name 是否为 SKILL.md 或以 skill.md 结尾),不符合时给出明确提示。
There was a problem hiding this comment.
已在 0378729 中添加 beforeUpload 校验。在 ExtensionsView.vue 的上传组件中加入了 before-upload 钩子,仅允许文件名为 .zip 结尾或大小写不敏感匹配 skill.md 的文件通过,其他 .md 文件(如 README.md)会直接提示"仅支持上传 .zip 文件或 SKILL.md 文件"并取消上传,不再发起请求。
|
多选可以添加,也不用做成表格,直接使用多选的组件就可以,这个鉴权就不懂了。剩下的那两个我研究研究,不过目录挂载.agent 这个我试过,行不通,会影响沙盒的文件挂载,影响路径解析,现在也是先安装到 .agents 下面,然后 copy 到 yuxi 的目录的 |
- 前端:在 ExtensionsView.vue 上传前添加 beforeUpload 校验, 仅允许 .zip 或 SKILL.md 文件,其他 .md 文件给出明确错误提示 - 后端:import_skill_dir 添加路径限制检查(is_relative_to), 确保来源目录在系统临时目录内,防止路径遍历 - 后端:install_remote_skill 改为扫描目录查找安装结果, 避免直接用用户输入构造文件路径(消除 CodeQL 告警) - 后端:_run_skills_cli 错误输出清洗 ANSI 控制字符并截断到 500 字符 - 后端:install_remote_skill 返回类型从 object 修正为 Skill Agent-Logs-Url: https://github.com/xerrors/Yuxi/sessions/0145c647-72bc-41f9-b07b-04d4acf51932 Co-authored-by: xerrors <35524243+xerrors@users.noreply.github.com>
|
这边有一个问题,就是win环境下不支持,会报错。 然后,后续怎么更新?会生成v2、v3这种?像之前一样,还是支持更新功能? |
|
这可能是因为历史版本导致的,如果出现名称冲突,会自动添加后缀。你可以将原本的已存在的删除一下,或者最好办的就是去数据库里面把同名的给删掉就好了 |
变更描述
增强 skills 的导入功能,可以导入单个SKILL.md 文件,ZIP压缩包。更重要的是,可以借助 skills.sh 的能力安装绝大多数 skills。
变更类型
测试
相关日志或者截图
说明
(可选)有什么需要特别说明的吗?
💡 提示: 提交前可以运行
make lint和make format检查代码规范