DeepSeek Harness 插件

wwwangzilin/dsh-role-cards

Star 数 ★ 0 分类 UI 增强 收录于 2026-10-18

把新建会话界面的选择器换成组合面板:角色预设卡与工作区卡各自成排,折叠时是胶囊按钮,展开后是两行可滚动的紧凑卡片。

安装

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:wwwangzilin/dsh-role-cards

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

DSH Web 插件:新建会话界面(hero)的组合角色卡 + 工作区卡选择器。

折叠时是一排小胶囊按钮(🎭 角色 / 📂 工作区);展开时是两行紧凑卡片(角色预设、 系统预设,然后工作区),支持悬停展开详情、滚轮切换、点击选择。

结构

  • src/client/ComboPanel.tsx — 组合面板组件(角色卡 + 工作区卡)
  • src/client/index.ts — 客户端插件入口:注册两个 hero slot
  • src/index.ts — host half(空 apply 占位)
  • src/invariant.ts — invariant 伴随插件
  • lib/ — tsdown 构建产物(lib/client.js 是浏览器 bundle)
  • cordis.patch.yml — bundle patch(profile boot 挂载)
  • tsdown.config.ts — 独立 tsdown 配置(node half + client half)

安装

在 ~/.dsh/profiles/web/package.json:

"dependencies": {
  "dsh-role-cards": "link:D://projects//ds//dsh-role-cards"
}

并把 "dsh-role-cards" 加入 dsh.profile.bundles,然后重启:

pnpm dsh web

构建

pnpm install   # 安装 tsdown / react 等 devDependencies
pnpm build     # tsdown 产出 lib/(index.js + invariant.js + client.js)

也可以直接用 harness 仓库里的 tsdown(无需本地 node_modules):

node D:\projects\ds\deepseek-harness\node_modules\.bin\tsdown.cmd

说明

  • 客户端注册 conversation.hero.agentPreset(渲染 null,顶掉官方 chip)与 conversation.hero.workspace(渲染 ComboPanel);不传 priority,由 client-runner facade 自动分配更低优先级从而胜出。
  • 角色卡显示预设 id 属于 ROLE_IDS(nekomode / luna / akane / rin / mei)时 使用 ROLE_META 的 emoji + tag;其余预设归入「系统模式 / 自定义」系统卡片。
  • 「添加工作区」按钮需要 pickDirectory 注入才可用(当前版本未注入,保持禁用)。

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。