- Home
- Plugins
- Dev & Plugin Tools
- dsh-plugins-scope
dsh-plugins-scope
ikun250501/dsh-plugins-scope
Manage third-party DSH plugins per global, workspace and session scope with tri-state inheritance. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Install
dsh plugin --profile web add github:ikun250501/dsh-plugins-scopeREADME
dsh-plugins-scope
English | 中文
DeepSeek Harness(DSH)插件:按 全局 / 工作区 / 会话 三级管理第三方插件是否生效。
每一层只有 开 / 关 / 继承,默认继承;官方插件和基础 UI 不参与。
功能
- 三级继承:会话覆盖工作区,工作区覆盖全局;没设过的层自动跟随上一层。
- 自动分类:读取插件包描述,区分“会话级”(工具、模型、提示词、技能、代理等)与“仅全局”(壁纸、主题、界面、管理器等)。
- 五个真实出口:关闭后,工具从模型工具表消失、提示词段与上下文不再注入、随包技能不再出现、
llm/stream请求拦截被跳过;不是只把界面上的字改掉。 - 三处入口:插件管理 → 作用域 页签;工作区 “…” 菜单 → 插件作用域…;会话 “…” 菜单 / 新建会话行 → 插件作用域。工作区/会话菜单项带独立 SVG 图标,与重命名、删除同级。
关闭的语义
| 类型 | 关闭后 |
|---|---|
| 工具 | 下一次模型请求起从 schema 消失,硬调用会失败 |
| 提示词段 / 上下文 | 下一次请求起不再注入 |
| 技能 | 下一次请求起该会话看不到、也读不到 |
llm/stream 拦截 | 该会话的下一次请求跳过该插件的监听 |
| 纯 UI / 全局服务 | 只提供全局开关;切换 profile bundle 并提示重启,重启后不再加载 |
限制:纯客户端 UI 一次 web 启动只加载一遍;插件的后台定时器/自有服务不因“关”而停止。分叉会话与子代理会先读父会话的覆盖值(父链,不复制),父会话被删除后回落到工作区。本插件是作用域管理,不是沙箱。
安装
要求:DSH 0.2.2-rc.x,Node.js >= 24.9。
# 从 npm
dsh plugin --profile <profile> add dsh-plugins-scope
# 从 GitHub(npm 尚未发布对应版本时)
dsh plugin --profile <profile> add github:ikun250501/dsh-plugins-scope
# 本地开发(<本地包目录> 指向含 dsh.bundle.patch 的目录)
dsh plugin --profile <profile> add <本地包目录>
桌面客户端也可用插件管理器安装:plugin_manager install_bundle target=<包目录或包名>。安装后若提示重启,重启对应实例。
使用
- 打开 插件管理 → 作用域:设置每个第三方插件的全局默认。
- 工作区 “…” → 插件作用域…:只改这个工作区。
- 会话 “…” 或新建会话行:只改这个会话;改动在下一步生效。
兼容性
本插件通过 patch DSH 内部服务实现过滤:
ToolsService.resolveSystemPrompt.assemble/SystemPrompt.contextSkillsService.list/getEventsService.waterfall(仅llm/stream)AgentLoop.initializeAgent(仅在启用托管加载时)
这些是内部实现,不是公开稳定 API;DSH 升级后可能失效。升级 DSH 后请先在一个临时会话里验证“关掉后工具/提示词确实消失”。
卸载
- 在插件管理器里移除
dsh-plugins-scope(或plugin_manager remove_bundle)。 - 确认 profile 的
package.json依赖与dsh.profile.bundles里不再有它。 - 存储可保留,也可删除
storages/plugin-scopes/<profile>.json。
开发
npm run check # node --check index.js && node --check client.js
目录:
index.js:宿主端;存储、解析、分类、五个出口的过滤。client.js:设置页签、工作区/会话菜单、新建会话入口。cordis.patch.yml:bundle 入口(plugin-scopes)。docs/DETAIL.md:完整行为与边界。
License
MIT。
English README: README.en.md
Related plugins
deepseek-harness
deepseek-ai/deepseek-harness
dsh-market
dsh-market/dsh-market
dsh-web (dsh-plugin-manager)
zhu1090093659/dsh-web
dsh-web
zhu1090093659/dsh-web