DSH Plugins Marketplace

DSH Plugins

Plugins

/

Tools & Capabilities

/

dsh-plugin-trim

d

dsh-plugin-trim

Manifest valid

Trims the tool surface per session. Each session owns a profile — a tool whitelist — applied through `agent.ctx.tools.restrict({ allow })` on that agent scope only, and switching one session never tou

UI (client)hasBundlePatch

dsh-plugin-trim

按会话裁剪工具面的 DSH 插件:每个会话自己一个「档位」,provider 只负责给它自动套默认档。另带一层 profile 级的插件物理开关,和一个自托管面板。

Per-session tool trimming for DeepSeek Harness: every session carries its own profile (a tool whitelist); the provider only decides which profile a session starts on. A second, profile-level layer physically disables plugin entries. Self-hosted panel included.

为什么按会话,而不是按 provider

这不是风格选择,是 API 的硬约束:

能力作用域依据
tools.restrict({ allow })只能 agent 作用域源码:requires a scoped context (agent.ctx): a context-global restriction would mask every agent
pluginManager.setPluginEnabled()profile 作用域它写 cordis.patch.yml 的 disabled: true,一改影响全部会话

所以:

  • 工具面只能按会话裁 —— 按 provider 裁只是「把同一份白名单套给所有本地会话」
  • 插件只能 profile 级物理开关 —— "只对这个会话关掉某插件"物理上做不到,别假装能做

实测收益

12GB 笔记本显卡跑 27B、256K 全驻留,同一段对话:

阶段toolspromptdecodeprefill
全开10556,30622.5 tok/s487 tok/s
关三个插件(插件层)6234,20743.0 tok/s136 tok/s
会话套 local 档(工具层)1412,89066.8 tok/s1.31k tok/s

裁工具面会连带去掉技能目录注入,再省约 4.3K token。

三层

层作用域做什么
会话档位单个会话agent.ctx.tools.restrict({ allow }),full 档 = 不限制
provider 默认档触发条件本地 provider 的新会话套 local,云端套 full;切了就重算这一条会话
插件开关profilesetPluginEnabled,物理启停,影响全部会话

装

dsh plugin --profile <你的 profile> add github:haidai233/dsh-plugin-trim

或本地目录:

dsh plugin --profile desktop add D:\path\to\dsh-plugin-trim

装完重启 DSH。

面板

固定地址,装完就能开:

http://127.0.0.1:12256/

插件自己起一个只监听回环的 HTTP 服务(默认 12256,被占则自动 +1 顺延,可用 panelPort 改)。跟 DSH 的端口无关,DSH 重启多少次都不变。

Windows 上还有个启动器(包里自带):

open-panel.cmd          # 打开面板;12256 不通时回退扫 DSH 端口
open-panel.cmd check    # 只打印地址

面板内容:

  • 会话:每行一个会话(本地/云端、provider、工具档位下拉、工具数、是否已裁),可以给单条会话换档或改回「跟随 provider」
  • 档位定义 · 工具名单:一个档位就是一份工具白名单。内置 full(不裁剪)和 local(14 项),可以随便新建(如 coding / chat),逐个工具勾选后保存;面板新建的档位也能删,引用它的会话会自动回到「跟随 provider」
  • 本地 provider:指定哪个 provider 算本地
  • 插件(profile 级):全部可管理插件,带搜索/分页/「只看已停用」,核心组件停用前弹确认

给模型的工具

tool_trim:

action作用
list本会话可见的工具名
status本会话的 provider / 档位 / 是否已裁
profile给本会话换档(full / local / custom)
set把某个工具加进/移出本会话当前档位
apply按当前档位重装
restore撤掉限制,恢复全部

配置(cordis.patch.yml 的 config 段)

键默认说明
enabledtrue总开关
followToolstrueprovider 变化时给这条会话自动套默认档
autofalsetrue = 切到本地 provider 时顺带物理开关插件(profile 级,慎用)
localProvider空哪个 provider 算本地;面板选的值存在 ~/.dsh/plugin-trim-state.json,优先于这里
routes[]非空时只认这些 provider
localEntries示例 3 条插件层要关掉的 entryId
defaultProfileFor{local: local, cloud: full}本地/云端各套哪个档
profiles.<名字>local 14 项任意键名都是一个档位;面板里新建的档位存在 ~/.dsh/plugin-trim-state.json,不写回配置

本地 provider 判定:localProvider 写死 / routes 命中 / baseURL 落在回环或私有网段 / id 带 local、ollama、llama、vllm、sglang 等标记。

HTTP 接口

固定端口面板(127.0.0.1:12256):

方法路径
GET/ 面板页
GET/health
POST/api/plugin-trim/{status,setProfile,autoProfile,setProfileTools,setProvider,applyAll,restoreAll,set,applyPlugins,restorePlugins}

同一套处理函数还会注册到 DSH 自带 webServer 上(/api/plugin-trim/...,带同源校验),两个入口等价。

已知限制

  • 换到更宽的档位之前必须先撤旧限制,否则读到的是上一次裁过的工具集,越裁越少。已修(applyProfile 里先 release 再读可见集),但热重载会泄漏:v0.1 没有把 restrict 的 disposer 注册到 ctx.effect,重载后旧限制留在工具层撤不掉。v0.2 已修;升级后重启一次 DSH 清掉遗留。
  • 插件层:整条 bundle 停用后会脱离组合,DSH 自己也认不回来(unknown-plugin)。这类条目「还原」无效,只能去 patch 文件删掉那两行再重启;接口会以 skipped[].hint 提示。
  • 裁工具会把 skill 一起裁掉,技能目录随之不再注入(约 4.3K token)。要用技能就把 skill 加进档位。
  • tool_trim 自己不在白名单里,装了小档位后模型侧调不到它 —— 换档走面板或 HTTP。
  • 与 dsh-local-trim 功能有重叠,不要同时启用两者对同一 provider 做裁剪。

许可

MIT

Comments

Loading…

Similar plugins

dsh-local-trim

by Leonlee114514

One-step local model onboarding plus a light harness for DSH. On load it probes loopback and private-network inference endpoints (llama.cpp, Ollama, vLLM, LM Studio), reads each model's context window

Models & ProvidersManifest valid

★ 0

MIT

JavaScript

Nov 6, 2026

dsh plugin --profile web add dsh-local-trim

Auto-resumes dsh sessions whose turn was left mid-flight by a web process restart or by a transient upstream failure, by injecting a 「继续(自动)」 ("continue (auto)") user message so the agent picks up exa

Workflow & AutomationModels & ProvidersManifest valid

★ 0

↓ 95/wk

dsh plugin --profile web add dsh-autoresume

by GaoHu1997

Keep a DSH profile identical across machines through any WebDAV server. The plugin collects the five parts that make up a setup — models (the llm-pi-ai line of cordis.patch.yml), defaults (the agent-d

Development & InfrastructureModels & ProvidersManifest valid

★ 0

MIT

TypeScript

Nov 7, 2026

dsh plugin --profile web add dsh-webdav-sync

by cayan0x

DSH Desktop enhancement plugin: task-execution discipline plus a real relationship, per session. Discipline: adaptive protocol tiers (short for chat / full for tasks / lean for reasoning models), inte

Tools & CapabilitiesTerminal & ClientsMemory & ContextManifest valid

★ 4

↓ 311/wk

MIT

TypeScript

Oct 9, 2026

dsh plugin --profile web add lume-dsh-plugin

Keeps an unfinished task list visible across turns. DSH clears the todos projection at the start of every turn and expects the model to rewrite the whole list, so when a turn is interrupted the plan i

Sessions & MessagesManifest valid

★ 0

dsh plugin --profile web add dsh-todo-continuity

DSH plugin conflict governance: diagnose silent plugin conflicts in DeepSeek Harness and get the exact patch that fixes each one. DSH 插件冲突诊断与修复建议。

Development & InfrastructureManifest valid

★ 0

MIT

JavaScript

dsh plugin --profile web add dsh-conflict-doctor