dsh-tool-manager
Agent 预设级三方插件/工具管理插件 for DeepSeek Harness (dsh)。
在设置页新增 「Agent 工具」 页面,按 Agent 预设(preset)管理本机安装的三方插件与全局工具: 禁用某个三方插件的模型工具,或禁用任意全局工具——配置按预设持久化,该预设的所有会话(含新建/恢复) 自动继承,模型下一轮立即生效。
English · 安装 · 使用 · 工作原理 · 开发与发布
功能
- 设置页「Agent 工具」:
settings.section槽(id:agent-tools)列出所有预设卡片, 每卡片 🧰「查看工具列表」按钮打开该预设的工具管理面板。 - 工具清单:列出会话可见的全部工具——未归属三方插件的全局工具挂在「系统」节点下(⚙️), 三方插件注册的模型工具挂在对应插件节点下(🔌 插件 ↔ 🔧 工具从属,勾选插件 = 屏蔽其全部工具,展开可单勾)。
- 预设级工具禁用:勾选任意工具(系统或插件归属),保存后通过 agent 作用域的
tools.restrict({ deny })精确屏蔽, 同一预设的所有会话自动生效,agent 销毁自动清理。 - 插件级工具屏蔽:插件开关会屏蔽该插件注册的模型工具(见宿主端
PLUGIN_TOOL_MAP,内置dsh-updater-npm → dsh_docs_search / dsh_docs_read、@omdsh-dev/dsh-genui → render_ui / validate_dsh_ui、dsh-find-plugin → find_dsh_plugin、@dsh-external/dsh-visualize → visualize)。 - 树形管理(插件 ↔ 工具从属):面板内两个分组——「系统」与「三方工具」,均默认收起、可点击展开; 无工具的插件不显示。
- 筛选与批量操作:支持按工具/插件名/描述过滤与「仅显示已禁用」;两组均有全选 / 反选。
- 多语言(中/英):界面文案按 DSH 系统语言环境智能切换——优先采用 DSH locale 设置(自动跟随 浏览器/系统语言,可在设置中显式覆盖),无 locale 服务时回退到浏览器语言检测,默认中文。
- 持久化:配置存于
$DSH_HOME/plugin-data/session-plugin-manager.json(presets键),重启不丢; 新 agent 创建时按所属 preset 自动套用,保存时对所有运行中的该预设 agent 即时重应用。
安装
# 从 npm 安装(推荐)
dsh plugin --profile web add dsh-tool-manager
# 或从 GitHub 安装
dsh plugin --profile web add github:SiriusWJ/dsh-tool-manager
本地开发安装(link 方式):
# 在仓库根目录
dsh plugin --profile web add .
安装后重启 dsh web,设置页侧边栏会出现 「Agent 工具」 页面。
使用
打开 设置 → Agent 工具 → 选择预设卡片 → 点击 🧰 查看工具列表:

- 工具管理面板:「系统」(⚙️)列出未归属三方插件的全局工具,可直接勾选屏蔽;「三方工具」分组(🔌) 下挂其模型工具(🔧)——勾选插件 → 屏蔽其全部模型工具(展开可单勾单个工具); 支持搜索过滤与「仅显示已禁用」。
- 面板顶部显示所选预设(如
预设 cordis),配置按该预设保存。 - 点击 保存并应用:配置持久化到该预设,所有使用该预设的会话自动生效(模型下一轮看不到/调不到被禁用的工具)。
插件级停用只屏蔽其模型工具;插件注册的界面功能(设置页卡片、侧边栏等)是全局的,无法按预设隔离。 标注「预设级不可禁用」的工具为会话内(scoped)注册,无法按预设屏蔽。
工作原理
- 宿主端(
lib/index.js):HTTP 路由GET /dsh-tool-manager/state?preset=<id>(清单 + 该预设配置)、POST /dsh-tool-manager/set?preset=<id>(同源保护,提交后即时重应用)、GET /dsh-tool-manager/presets(预设卡片列表 + 禁用计数)。 监听agent/created,按 session header 的agentPreset查配置, 对每个新 agent 用agent.ctx.tools.restrict({ deny })应用其预设配置。 - 客户端(
client/client.js):注册settings.section槽 (id: agent-tools),🧰 图标打开工具管理面板,通过同源 HTTP 与宿主通信。 - 配置存储:
$DSH_HOME/plugin-data/session-plugin-manager.json(presets键,旧 sessions 数据自动迁移到*default)。
开发与发布
pnpm install # 无运行时依赖,仅用于本地 lint/发布
git tag v0.1.0 # 打 tag 触发 GitHub Actions 自动发布到 npm(需配置 NPM_TOKEN secret)
npm publish # 或手动发布(需 npm 登录)
仓库结构:
├── lib/index.js # 宿主端插件(纯 ESM,无构建)
├── client/client.js # 客户端 bundle(window.__ModuleLoader__)
├── cordis.patch.yml # bundle 补丁层
└── package.json # dsh.bundle + dsh.client 清单
License
English
dsh-tool-manager adds an "Agent Tools" settings page to DeepSeek Harness, letting you manage every tool visible to the agent per Agent preset — system tools and third-party plugins' model tools:
- A settings page (
settings.sectionslot, idagent-tools) lists every preset as a card (default/built-in/custom badges, disabled count); each card's 🧰 "View tools" button opens that preset's tool panel. - Lists all tools: global tools not owned by a third-party plugin under the System (⚙️) node, third-party plugins' model tools nested under their plugin nodes (🔌 plugin rows, 🔧 tool rows; checking a plugin blocks all its mapped tools; expand to toggle one individually).
- Disable any tool per preset via agent-scoped
tools.restrict({ deny })— applied to every session of that preset, effective from the model's next turn, auto-cleaned on agent disposal. - Plugin-level tool blocking via static
PLUGIN_TOOL_MAP(dsh-updater-npm, dsh-genui, dsh-find-plugin, dsh-visualize). - Filters (tool/plugin name/description search,
only disabled) plus select-all / invert on both groups. - Bilingual UI (Chinese / English): text follows the DSH locale automatically (browser/system language detection
via the locale service, overridable in Settings; falls back to
navigator.languagedetection when unavailable, default zh). - Persisted at
$DSH_HOME/plugin-data/session-plugin-manager.json(presetskey; legacy per-session data migrates to*default); applied onagent/createdby the session'sagentPresetand re-applied live on save.
Install:
dsh plugin --profile web add dsh-tool-manager # npm
# or
dsh plugin --profile web add github:SiriusWJ/dsh-tool-manager
Restart dsh web after install, then click the 🧰 icon in any conversation header.
No comments yet. Be the first to write one.