# 在 DeepSeek Harness 对话中管理插件

> **稳定版 `0.3.1` 已在官方 DSH `0.1.5-rc.2` 和 `0.1.6-alpha.1` 上验证。** 无需修改实现，peer 元数据已声明两个精确版本。[从 npm 安装](https://www.npmjs.com/package/relay-dsh-plugin-manager) · [兼容性证据](https://github.com/yangbobo2021/Relay/tree/codex/relay-foundation/dsh-lab/dsh-0.1.6-alpha.1-20260915)。

> **发布通道：** `latest` → `0.3.1`；`next` → `0.3.1-rc.2`。

```bash
npx @deepseek-ai/dsh@0.1.6-alpha.1 plugin --profile web add relay-dsh-plugin-manager@next
npx @deepseek-ai/dsh@0.1.6-alpha.1 web
```

[![npm 版本](https://img.shields.io/npm/v/relay-dsh-plugin-manager?label=npm)](https://www.npmjs.com/package/relay-dsh-plugin-manager)
[![CI](https://github.com/yangbobo2021/relay-dsh-plugin-manager/actions/workflows/ci.yml/badge.svg)](https://github.com/yangbobo2021/relay-dsh-plugin-manager/actions/workflows/ci.yml)
[![npm 月下载量](https://img.shields.io/npm/dm/relay-dsh-plugin-manager?label=downloads)](https://www.npmjs.com/package/relay-dsh-plugin-manager)
[![GitHub Stars](https://img.shields.io/github/stars/yangbobo2021/relay-dsh-plugin-manager?style=flat)](https://github.com/yangbobo2021/relay-dsh-plugin-manager/stargazers)
[![MIT 许可证](https://img.shields.io/github/license/yangbobo2021/relay-dsh-plugin-manager)](LICENSE)
[![DSH 兼容版本](https://img.shields.io/badge/DSH-0.1.2--alpha.3%20%7C%200.1.2--rc.1-2f7d68)](https://github.com/deepseek-ai/deepseek-harness)
[![npm 可信发布](https://img.shields.io/badge/npm_trusted_publishing-enabled-2f9e44)](.github/workflows/release.yml)

[English](README.md) | 中文

**npm 包名：** [`relay-dsh-plugin-manager`](https://www.npmjs.com/package/relay-dsh-plugin-manager)
· [Relay DSH 插件目录](https://github.com/yangbobo2021/Relay/blob/codex/relay-foundation/docs/dsh-plugins.zh.md)

**只需描述需要的能力，就能查找和管理 DSH 插件；不必离开对话，也不必手工
编辑 Profile 文件。**

`relay-dsh-plugin-manager` 让 DeepSeek Harness Chat 可以查找、安装、更新、
启用、停用和卸载插件。搜索和查看只读；任何变更执行前，DSH 都会先展示计划，
并等待单独确认。

[![插件管理器在 DSH 中成功安装 relay-dsh-plugin-codex](https://raw.githubusercontent.com/yangbobo2021/Relay/codex/relay-foundation/docs/media/dsh-plugin-manager-codex-install-success.png)](https://github.com/yangbobo2021/Relay/blob/codex/relay-foundation/docs/media/dsh-plugin-manager-codex-install-demo.zh.mp4?raw=1)

*查看 [38 秒真实 DSH 运行录像](https://github.com/yangbobo2021/Relay/blob/codex/relay-foundation/docs/media/dsh-plugin-manager-codex-install-demo.zh.mp4?raw=1)：
从搜索、查看不产生变更的计划、单独确认，到 Codex 插件安装完成。录像基于官方
DSH 提交
[`b150a551`](https://github.com/deepseek-ai/deepseek-harness/commit/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e)，
使用 Plugin Manager `0.1.0-rc.2` 和 Codex 插件 `0.1.2`。*

如果这种对话式插件管理对你有用，欢迎
[Star 本插件](https://github.com/yangbobo2021/relay-dsh-plugin-manager)，并
[反馈安装结果或缺少的插件场景](https://github.com/yangbobo2021/relay-dsh-plugin-manager/issues)。

## 安装

如果你自行安装了官方 DSH，请先停止 DSH Web，再通过 DSH CLI 安装 npm 正式包：

```bash
dsh plugin --profile web add relay-dsh-plugin-manager@latest
```

然后启动或重启 DSH Web：

```bash
dsh web
```

如果 `PATH` 中没有 `dsh`，请在两条命令中将它替换为
`pnpm dlx @deepseek-ai/dsh@0.1.2-rc.1`。

安装后，**设置 > 插件** 会默认打开 **推荐插件** 标签页，在这里介绍推荐的
对话后端插件，并附一份简短帮助。实际的插件管理仍在 Chat 对话中完成。

### KeySync 已内置安装

通过 [KeySync](https://sublang.ai/keysync/dl-dy) 一键安装 DSH 时，本插件会作为
内置插件自动安装，不需要再次执行上面的安装命令。该命令只适用于独立安装的
官方 DSH，或已经移除本插件的 Profile。

## 使用

直接用自然语言描述需求即可：

```text
找一个能连接飞书的插件
查找 GitHub 用户 yangbobo2021 发布的 DSH 插件
安装 relay-dsh-plugin-codex
一起安装 relay-dsh-plugin-codex、relay-dsh-plugin-files 和 relay-dsh-plugin-terminal
列出已安装插件及其状态
停用 example-dsh-plugin
卸载 example-dsh-plugin
```

也可以只使用一个 `/plugins` 命令：

```text
/plugins 找一个工作区文件浏览插件
/plugins 搜索 owner:yangbobo2021
/plugins 安装 relay-dsh-plugin-files
```

搜索和查看不会修改配置。安装、更新、卸载、启用、停用和重启都会先展示计划。
你可以直接在 DSH 的选项界面中确认，也可以在后续 Chat 消息中明确批准。
一次请求安装多个插件时，DSH 会展示一份有序计划和缺失的配套 peer 插件，等待
一次确认后依次安装。修改完成但仍需重启时，状态会明确区分“需要另行重启”和
“等待人工重启”。

### 匿名使用统计

匿名运行统计默认开启，用于衡量插件管理器的搜索和安装结果。如需关闭，可在启动
DSH Web 时设置以下变量；关闭统计不会影响插件管理功能：

```bash
RELAY_PLUGIN_MANAGER_TELEMETRY=0 dsh web
```

Registry 运营方执行生产验收时，可以只标记该次运行：

```bash
RELAY_PLUGIN_MANAGER_TELEMETRY_TEST=1 dsh web
```

该模式只增加 `is_test: true`；普通用户不会发送这个标记。

管理器只向第一方接口 `https://dsh-plugins.tech/v1/telemetry/events` 发送事件；Registry
会校验严格的事件结构，再把通过校验的事件转发到自己的 PostHog 项目。统计只记录
管理器操作类型，以及由管理器执行的插件安装开始、成功或失败；安装
事件包含公开的插件包名、是否激活、是否需要重启和有限错误代码。不会发送搜索词、
对话内容、本地路径、命令输出、错误文本、IP 地理位置或登录身份。一个随机匿名 ID
保存在当前 Profile 的 `.relay-plugin-manager/telemetry.json`，用于避免把同一安装重复
计算为多个用户；删除该文件即可重置。

这些数据只能说明“插件管理器被使用”和“管理器执行了安装”，不会把插件加载或
激活推断成其他插件的真实功能使用。

### DSH Registry 发现数据源

来源级 Registry 搜索 provider 默认使用 `https://dsh-plugins.tech`。可设置插件
配置 `registryUrl`，或环境变量 `DSH_PLUGIN_REGISTRY_URL` 覆盖 Registry 根地址
（本地预览示例：`http://127.0.0.1:4174`）；非本机地址必须使用 HTTPS。设置
`registryUrl: false` 可显式关闭 Registry 发现。

该 provider 只发送任务查询、推断出的中英文语言和结果数量。返回候选仍必须进入同一套本地 npm/GitHub
检查流程，完成检查后才能生成计划；Registry 描述属于不可信文本，不能授权任何
变更。
搜索会把有限的关键词候选池与当前语义目录结合，再通过本地检查按项目身份合并
npm/GitHub 别名。Agent 从候选池中构造“最小完整答案”：覆盖任务需要的每一种职责和
实质不同的解决思路，按角色组织可替代方案，并去掉明确无关或重复的候选。结果不会
为了凑满二十个而填充，也不会静默截成任意固定数量；精确包名和仓库查询仍保持第一名。

对于包含多项职责的任务，Agent 会执行两步只读流程：先拆成最少的必需/可选角色并
分别搜索，再审查每个角色组，只把直接解决该职责的候选交给管理器评估。只有每个
必需角色都有经过审查的候选、并且不存在未解决的重要用户选择时，结果才会标记为
`complete`。同一插件可以承担多个角色而只展示一次；实质不同的实现会按主方案和
替代方案分组。草案十分钟后过期，也不会产生任何安装授权。

对于需要跨越等待并继续原对话的监控任务，Agent 会分别搜索“读取特定来源的状态/事件”
和“持久等待并恢复 Session”两项职责。如果同一个插件同时覆盖两项职责，最终方案仍只
展示一次，不会制造重复结果。

## 与 Relay 的关系

本插件在 [Relay](https://github.com/yangbobo2021/Relay) 的 integration 工作区中
开发，同时作为可独立安装的 DSH 插件发布。Relay 主要探索长时间运行的 Agent、
外部事件投递、可复用 DSH 视图，以及多种对话后端。

你还可以试试这些 Relay DSH 插件：

- [Codex 对话](https://github.com/yangbobo2021/relay-dsh-plugin-codex)
- [Claude Code 对话](https://github.com/yangbobo2021/relay-dsh-plugin-claude)
- [Workbench 面板](https://github.com/yangbobo2021/relay-dsh-plugin-workbench)
- [工作区文件浏览](https://github.com/yangbobo2021/relay-dsh-plugin-files)
- [Terminal 终端](https://github.com/yangbobo2021/relay-dsh-plugin-terminal)

更多安装组合和兼容性说明见
[Relay DSH 插件完整指南](https://github.com/yangbobo2021/Relay/blob/codex/relay-foundation/docs/dsh-plugins.zh.md)。

## 反馈

问题和需求可以提交到本仓库的
[Issue Tracker](https://github.com/yangbobo2021/relay-dsh-plugin-manager/issues)。
