前言¶
DeepSeek Harness (DSH) 遵循「一切皆插件」的理念。当需要管理多个对话角色或代理时,dsh-digital-life 插件提供了将可配置的对话式数字生命代理作为 Host 和 Client Cordis 插件安装的方案。它支持将代理身份持久化存储,并允许在独立会话或主对话中调用这些代理。
安装¶
在 DSH 的代码仓库根目录执行以下命令:
cd /path/to/deepseek-harness
pnpm dsh plugin --profile web add https://github.com/elonnzhang/dsh-digital-life.git
安装后启动 Web Profile (pnpm dsh web --port 3080),在浏览器中访问 Settings → 数字生命。
核心功能¶
插件提供以下核心能力:
- 持久化与存储:记录保存在
digital-life设置命名空间,每个代理的身份文件保存在$DSH_HOME/digital-life/<id>/agents/<id>.md。 - 身份导入:支持从
~/.agent/agents/xxx.md和~/.claude/agents/xxx.md导入代理身份(YAML frontmatter 被忽略,Markdown body 为运行时身份)。 - 管理界面:添加 Harness 风格的设置部分,支持创建、编辑、启用和删除记录。
- 工具调用:
consult_digital_life(id, question):发起单次独立咨询。consult_digital_life_category(category, question):在指定类别中并发咨询多个记录。
- 会话注入:通过
sidebar.footer.actionSlot 注入 Chat Panel,创建无 Workspace 的独立会话。
典型用法¶
1. 配置代理¶
在设置页面添加记录,填写 ID(小写字母、数字、连字符)、名称、描述、类别、标签和 Persona。若不填写 Agent 文件路径,Persona 会自动写入管理文件。
2. 启动咨询¶
在 Composer 中输入 @id(如 @startup-mentor)以调用 consult_digital_life 工具。需在配置中将 子代理 Provider 设为 spawn。
3. 独立会话¶
通过 Chat Panel 或主页选择器启动。该会话没有 Workspace (workspaceId/cwd),且强制使用 只读文件沙箱。
注意事项¶
- 构建依赖:仓库必须包含构建好的
lib/目录,因为package.json指向构建文件。 - 身份来源:外部 Agent 文件保持独立,不会被覆盖;内部保存时使用 Markdown body。
- 类别限制:使用
custom类别的新记录应设置customCategory。 - 更新:更新插件需先在仓库端构建,再运行
pnpm dsh plugin --profile web update dsh-digital-life。
总结¶
该插件为 DSH 提供了标准化的数字生命管理方案,适合需要固定角色对话或批量咨询场景。
- GitHub 仓库: https://github.com/elonnzhang/dsh-digital-life
- 社区目录: https://www.skillhub.cn/plugins/elonnzhang/dsh-digital-life