DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-plugin-tools-manager

H

dsh-plugin-tools-manager

Manifest valid

DSH tools manager: inspect and toggle host-registered tools

UI (client)hasBundlePatchMachine translated

dsh-tools-manager

DSH 插件:以 tree 形式列出「插件 → 工具」,并支持全局启停单个工具。

  • Tree 列出工具:按来源插件分组,展示每个插件注册的全部工具(name / description)。
  • 全局启停:对任意工具一键禁用/启用,跨会话持久化,立即生效(模型不可见 + 执行被拒,两层一致)。
  • UI 入口:插件页(Plugins)→ 本插件 bundle 行的「配置」入口(plugins.row.config keyed slot,key = @huanlin/dsh-plugin-tools-manager#tools-manager,行 id 与 cordis.patch.yml insert 行 id 逐字一致;0.1.7-alpha.1 起 settings.plugin.item 退役、settings.section 独立 Tab 不再使用)。

架构

工具来源归属(tree 数据基础)

  • 归因算法(零源码修改):
    1. 启动时快照 ctx.tools.schemas() 作基线,归到 (baseline) 分组。
    2. 监听 Cordis internal/plugin(fiber.name = 插件名)→ 维护 pendingPlugins 栈。
    3. 监听 tools/change(register/unregister/restriction 均触发,unfiltered)→ 对 ctx.tools.schemas() 做 diff:
      • 新增工具 → 归因到栈顶(最近加载)插件;
      • 移除工具 → 从归属表删除。
    4. 插件卸载(internal/status DISPOSED)→ 其工具随 effect 自动注销,diff 自然移除。

全局启停(两层一致,缺一不可)

层缝实现
隐藏(模型不可见)system-prompt/assemble(waterfall)过滤 assembly.tools 中 disabled 工具,返回变换后的 assembly
拒执行(防绕过)全局 ctx.tools.guard()(plain ctx)disabled 工具返回 reason(如 tool "X" is disabled by tools-manager: "X")
  • 同一个 disabled: Set<string> 驱动两层,保证 prompt 与执行语义一致。
  • 覆盖场景:模型直调(guard 兜底)、run_code SDK 子调用(guard 兜底)、隐藏后模型不再发起。
  • 不依赖 ctx.tools.restrict()(其强制 scoped ctx,不能做全局过滤)。

持久化

  • disabled 列表持久化在 profile cordis.patch.yml 的 tools-manager entry Config 中(DSH 0.1.7 起;字段标 .volatile(),settings.configure({ auto: false }) 声明插件自管配置页),跨会话生效。
  • Config:{ disabled: string[] }(Schemastery schema,默认 [])。
  • 运行时编辑经 settings.update('tools-manager', { disabled }) 提交,Loader 原地更新 volatile 引用,即时应用(guard/assemble 读同一份 disabled 状态,无需重启)。

Host↔Client 通道

  • 宿主 HTTP 路由:ctx.webServer.register({ kind: 'prefix', path: '/tools-manager/api', handler })。
  • 接口(JSON envelope):
    • POST /tools-manager/api/list → { ok, value: { plugins: [{ name, tools: [{ name, description, disabled }] }] } }
    • POST /tools-manager/api/set body { toolName, disabled } → { ok, value: { plugins: [...] } }
    • 错误:{ ok: false, error: { code, message } }

开发

pnpm install          # 安装依赖(link: 指向 ~/.dsh/source/current/)
pnpm run typecheck    # tsc --noEmit
pnpm test             # vitest run
pnpm run build        # tsc (host) + build-client.mjs (client bundle) + tsc (types)

目录结构

src/
├── index.ts              # Host 入口:name, inject, apply(registry + policy + gateway)
├── config.ts             # Config schema (schemastery), ResolvedConfig, resolveConfig
├── registry.ts           # ToolRegistry: 归因 diff(internal/plugin + tools/change)
├── policy.ts             # installPolicy: system-prompt/assemble 过滤 + tools.guard
├── settings.ts           # installToolsManagerSettings: 注册 namespace,返回 bridge
├── gateway.ts            # registerHttpGateway: /tools-manager/api 前缀路由(list/set)
└── client/
    ├── index.ts              # Client 入口:plugins.row.config keyed slot 注册行配置卡片
    ├── row-config-key.ts     # key 派生(包名#行 id)与三 id 一致性注释
    ├── ToolsManagerPanel.tsx # 行配置卡片(summary 一行简介 / page 工具树,inline styles)
    └── prefixTree.ts         # 前缀树构建工具(`__`/`_` 分割)

运行

本地安装

dsh plugin --profile web add "link:D:/Projects/deepseek-harness/dsh-tools-manager"

配置

默认配置(cordis.patch.yml):

disabled: []    # 预置禁用的工具名列表(默认空)

运行时通过插件页本插件行配置卡片修改(plugins.row.config,注册由 configForms.whileServed 门控:行停用/Host 不供配置时入口随之消失,view:'page' 且 form 缺失时卡片显示不可用提示),持久化到 profile cordis.patch.yml 的 tools-manager entry。

检查

pnpm run typecheck && pnpm test && pnpm run build

验证 lib/ 产物:

  • lib/index.js — host bundle(ESM)
  • lib/client.js — client bundle(CJS,window.__ModuleLoader__.load 包裹)
  • lib/types/ — TypeScript 声明文件
  • cordis.patch.yml — bundle 配置层

已知边界

风险影响缓解
归因偏移(插件运行期动态注册工具)tree 中工具挂错插件记录 Known Limitations;list 接口对未归属工具归到 (unknown) 分组
system-prompt/assemble 多监听时序其他插件也可能变换 tools本项目过滤只删 disabled,next() 委托其余;序靠后仍正确
guard 与 assemble 双层不同步隐藏与拒执行不一致单一 disabled 状态源;单测断言两缝读同一状态
settings 服务缺失启停不持久降级为内存态(仅本次运行生效),set 返回明确错误
run_code 模式模型经 SDK 子调用禁用工具guard 全局兜底拒绝;文档说明"禁用=执行不可达"

Comments

Loading…

Similar plugins

dsh-plugin-manager

by webkong

DSH 插件管理器:在 Web 设置页管理内置与三方插件——安装、卸载、启用、停用,支持 GitHub 搜索安装与非 bundle 插件一键装载

Development & InfrastructureManifest valid

★ 4

MIT

JavaScript

Sep 1, 2026

dsh plugin --profile web add @webkong/dsh-plugin-manager

by eighteentang

DSH 开发工具箱:按 Alt 悬浮查看界面元素归属、把踩过的坑记进随插件分发的经验库、开发模式下自动注入动手前的自检清单。

Terminal & ClientsManifest valid

★ 0

MIT

JavaScript

Sep 26, 2026

dsh plugin --profile web add dsh-plugin-dev-tools

by z-col

DSH Skills 可视化管理器:在 DSH Web 界面可视化查看、编辑、创建、删除 Skills(用户级 ~/.dsh/skills 与项目级 .dsh/skills)

Manifest valid

★ 2

↓ 252/wk

TypeScript

Sep 8, 2026

dsh plugin --profile web add dsh-skills-manager

by null119

DSH(DeepSeek Harness)Web GUI 插件:在设置页管理 MCP 服务器——列出已安装工具,添加/编辑/删除、启用/停用;组合配置提供的 MCP 同样可在运行时直接编辑、停用、移除并恢复,无需重启宿主。

Tools & CapabilitiesManifest valid

★ 16

↓ 121/wk

MIT

TypeScript

Aug 30, 2026

dsh plugin --profile web add dsh-mcp-manage

by xiyue718

DSH 第三方插件管理插件:从设置页启用、禁用、卸载插件。 / Manage third-party DSH plugins from the Plugins settings page.

Manifest valid

★ 0

TypeScript

Sep 20, 2026

dsh plugin --profile web add @dsh-external/ui-plugin-manager

by tianLee-gitter

DSH 技能管理插件:在设置页管理 ~/.dsh/skills 的技能,支持多目录导入与 AI 名称解析(导入后可用 /name 引用)

Manifest valid

★ 0

MIT

TypeScript

Aug 17, 2026

dsh plugin --profile web add lt-dsh-skill-manager