Skip to content

feat: 支持从其他工作区导入 Skill#193

Open
MounteZ22 wants to merge 3 commits intoErlichLiu:mainfrom
MounteZ22:feature/import-from-workspace
Open

feat: 支持从其他工作区导入 Skill#193
MounteZ22 wants to merge 3 commits intoErlichLiu:mainfrom
MounteZ22:feature/import-from-workspace

Conversation

@MounteZ22
Copy link
Copy Markdown

背景

Proma 支持多工作区,用户通常会按项目或场景拆分工作区使用 Agent。

在实际使用中,不同工作区可能会复用一部分 Skill。此前如果用户想把某个工作区里的 Skill 复用到另一个工作区,只能手动去工作区目录复制,或者要求agent重新创建/安装。

考虑提供一个显式的入口,让用户可以把其他工作区里已有的 Skill 导入到当前工作区,同时继续保持工作区之间的独立性。

本次改动

核心能力

  • 支持在 Agent 设置页中,从其他工作区导入 Skill 到当前工作区
  • 支持从来源工作区的 skills/skills-inactive/ 导入
  • 导入时直接复制 Skill 目录到当前工作区,不引入来源元数据,也不做自动同步
  • 如果当前工作区已经存在同名 Skill,无论是 active 还是 inactive,都会阻止重复导入

交互优化

  • 导入弹窗改为先选择来源工作区
  • 只展示该工作区中“当前工作区还没有”的 Skill
  • Skill 列表支持滚动,避免工作区或 Skill 过多时超出可视区域

设计约定

  • 导入后的 Skill 是当前工作区的本地副本
  • 工作区之间保持独立,不建立联动关系
  • 后续如果来源工作区中的 Skill 发生变化,不会自动同步到已导入的工作区

涉及文件

  • packages/shared/src/types/agent.ts
  • apps/electron/src/main/lib/agent-workspace-manager.ts
  • apps/electron/src/main/ipc.ts
  • apps/electron/src/preload/index.ts
  • apps/electron/src/renderer/components/settings/AgentSettings.tsx

验证

  • apps/electron: tsc --noEmit
  • packages/shared: tsc --noEmit
  • 手动验证:
    • 正常导入 Skill ✅
    • 从 inactive Skill 导入 ✅
    • 重复导入时正确报错 ✅
    • 设置页导入弹窗交互正常 ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant