Releases: lifeopsgo/dsh-capability-toggle-plugin
Release list
v1.0.0
v1.0.0 — CI and compatibility release
This maintenance release makes the plugin’s runtime requirements explicit and makes its GitHub CI reproducible on a clean runner.
Highlights
-
Reliable clean-environment CI
-
Declares all DSH Host SDK packages used by the plugin as runtime peer dependencies.
-
Pins matching development dependencies for reproducible type checking and builds in CI.
-
Adds peer contracts for the WebUI client modules injected by the plugin.
-
Declares React as an external runtime peer, matching the generated client bundle.
-
Improved DSH compatibility metadata
-
Supports the verified
0.1.0-rc.8DSH baseline. -
Accepts the subsequent
1.0.0-*prerelease compatibility line. -
Avoids silently accepting older unsupported RC builds.
-
CI and tooling updates
-
GitHub Actions upgraded:
pnpm/action-setup4 →6actions/checkout4 →7actions/setup-node4 →7
-
TypeScript upgraded from5.9.3 to7.0.2.
-
CI validates frozen dependency installation, type checking, tests, and production builds.
-
Repository maintenance
-
Added contribution, security, support, and code-of-conduct documentation.
-
Added Issue forms, PR template, Dependabot configuration, and editor settings.
-
Refined bilingual README documentation and installation guidance.
Validation
pnpm install --frozen-lockfile- Type checking
- 87/87 tests passing
- Production build
- GitHub Actions CI passing on
main
Install
dsh plugin --profile web add github:lifeopsgo/dsh-capability-toggle-plugin#v1.0.0
dsh --profile web
``
Refresh the Web UI, then open the capability control beside the composer’s ➕ button while the agent is idle.
## Notes
- This is a compatibility and maintenance release; capability-control behavior is unchanged.
- The existing `v0.1.0` tag remains immutable. Use `v1.0.0` for the current validated release.
- TypeScript 7 currently reports its upstream experimental-API warning during builds, but this plugin’s typecheck, tests, and build pass successfully.
``
中文 Release 内容:
```markdown
# v1.0.0 — CI 与兼容性维护版本
这是一个维护版本,重点是让插件的运行时依赖声明更准确,并让 GitHub CI 能在干净环境中稳定复现。
## 重点更新
- **CI 可在干净环境稳定运行**
- 为插件实际使用的 DSH Host SDK 补齐运行时 peer dependency 声明。
- 为 CI 补齐对应的精确开发依赖,保证类型检查和构建可复现。
- 补齐 WebUI Client 注入模块的运行时 peer 契约。
- 补齐 React runtime peer 声明,与生成的 Client bundle 保持一致。
- **改进 DSH 兼容性元数据**
- 支持已经验证的 `0.1.0-rc.8` DSH 基线。
- 支持后续 `1.0.0-*` 预发布兼容线。
- 不再错误接受未经验证的旧 RC版本。
- **CI 与工具链更新**
- GitHub Actions:
- `pnpm/action-setup` 4 →6
- `actions/checkout` 4 →7
- `actions/setup-node` 4 →7
- TypeScript 从5.9.3 升级至 7.0.2。
- CI 会验证冻结依赖安装、类型检查、测试和生产构建。
- **仓库维护**
- 增加贡献指南、安全策略、支持说明和行为准则。
- 增加 Issue 表单、PR 模板、Dependabot 配置和编辑器规范。
- 精简并完善中英文 README 与安装说明。
## 验证结果
- `pnpm install --frozen-lockfile`
- 类型检查通过
- **87/87 测试通过**
- 生产构建通过
- `main` 分支 GitHub Actions CI通过
## 安装
```bash
dsh plugin --profile web add github:lifeopsgo/dsh-capability-toggle-plugin#v1.0.0
dsh --profile web
``
刷新 Web UI 后,在 agent 空闲时点击输入栏 ➕旁边的能力开关即可。
## 说明
- 这是兼容性与维护版本,能力开关的核心行为没有变化。
- 现有 `v0.1.0` tag 保持不变;请使用 `v1.0.0` 获取当前已验证版本。
- TypeScript 7 在构建时会显示其上游“实验性 API”提示,但本插件的类型检查、测试和构建均已通过。
``v0.1.0
v0.1.0 — first release
Turn individual agent capabilities on and off from the DSH WebUI composer — and have it actually enforced.
Install
dsh plugin --profile web add github:lifeopsgo/dsh-capability-toggle-plugin#v0.1.0
dsh --profile web webRefresh the page — the control appears in the composer row, next to the ➕ button. Click it while the agent is idle.
The tag ships prebuilt lib/, so installation runs no prepare script: you will not hit pnpm's build-approval prompt (allowBuilds) that git-hosted plugins otherwise require. dsh plugin also reconciles dsh.profile.bundles for you — no manual package.json editing.
What you get
A composer-row popup listing every capability the agent can currently reach, each with a three-level switch — session, project, global.
- Five tabs, six capability families — Skills · MCP · Tools · Prompt · Security (the last folds the approval gate and the guard presets together).
- Three levels per row, each
on,off, or unset. Precedence is session › project › global › default (enabled); an unset level defers to the next one down. The badge at the row's end shows the resolved result. - Real enforcement, not hiding. A disabled capability leaves the model's tool schema set and skill catalog on the agent's next step, and a forced call is hard-refused.
- Per-round adjustability — changes take effect on the agent's next step, no session restart.
- Locked while running — switches are read-only while the agent works; toggles apply when it is idle.
- Survives popup close and turn boundaries — the Host caches the last-known inventory, so reopening between turns still shows disabled state correctly.
- 5 opt-in safety guards — read-only mode, protect secrets, confirm dangerous shell, confirm destructive git, confirm outbound network.
Blockguards refuse outright;Confirmguards raise one approval prompt. - Approval gate — off means every approval request from this agent is auto-rejected, independent of the system
/permissionsetting. - Bilingual — ships zh-CN and en dictionaries, follows the WebUI language.
How enforcement works
Every seam acts on the agent's own scope, filtering the surface it inherits. Nothing global is mutated; everything is restored when the agent is released.
| Family | Mechanism |
|---|---|
tool / mcp |
ctx.tools.restrict({ deny }) on the agent's scope |
skill |
A same-named modelInvocable:false runtime skill shadows the real one |
prompt |
A same-named empty-text section/context shadow, or suppressRuntimeContext() |
approval |
A scoped approval/request listener resolving 'rejected' |
guard |
A tools/pre-execute listener matching the preset's predicate |
Notes
- Requires Node ≥ 22.6 and a DSH profile running the Web GUI.
- Trust boundary. The plugin's two same-origin routes inherit DSH's local-GUI trust model: no separate auth, no CSRF token, relying on only this machine reaching the GUI port on
127.0.0.1./setmutates persisted settings, so any local process able to reach that port can call it. Add authentication in front if you expose the GUI beyond localhost. - Prompt gating is a curated allowlist, probed for real presence. Entries that would break the model or the render (
harness:identity,tools:code-only/tools:sdk, and the strict variablesprovider/model/cwd) are deliberately excluded. - 87 tests over the pure resolution logic; MIT licensed.
v0.1.0 — 首个版本
在 DSH WebUI 输入栏逐项开关 agent 的能力 —— 而且是真的强制生效。
安装
dsh plugin --profile web add github:lifeopsgo/dsh-capability-toggle-plugin#v0.1.0
dsh --profile web web刷新页面,输入栏 ➕ 旁边会出现开关按钮,agent 空闲时点开即可。
tag 内自带预构建的 lib/,安装不会触发 prepare 脚本,所以不会遇到 pnpm 对 git 插件的构建授权提示(allowBuilds)。dsh plugin 还会自动把插件写进 dsh.profile.bundles,不用手改 package.json。
有什么
一个输入栏弹窗,列出 agent 当前能触达的每一项能力,每项带三级开关:会话、项目、全局。
- 五个 tab,六个能力族 —— 技能 · MCP · 工具 · 提示词 · 安全(安全 tab 收纳审批闸门与守卫预设)。
- 每行三级,每级可取
开、关或未设。优先级 会话 › 项目 › 全局 › 默认(启用);某级未设则向下跟随。行尾徽标显示综合三级后的真实结果。 - 真强制,不是隐藏。 被停用的能力会在模型下一步就从工具 schema 和技能目录里消失,强行调用被硬拦截。
- 逐轮可调 —— 改动在 agent 下一步即生效,无需重启会话。
- 运行中锁定 —— agent 工作时开关只读,切换只在空闲时落地。
- 关弹窗、跨轮次都不丢 —— Host 缓存最后一次已知的能力清单,轮次之间重开弹窗仍正确显示已停用状态。
- 5 个可选安全守卫 —— 只读模式、保护密钥、危险 shell 需确认、破坏性 git 需确认、外网出站需确认。
拦截类直接拒绝,确认类弹一次审批。 - 审批闸门 —— 关掉后本 agent 的所有审批请求一律自动拒绝,与系统
/permission设置互不干扰。 - 中英双语 —— 内置中英词典,跟随 WebUI 语言。
强制是怎么实现的
每条路径都作用在 agent 自己的层上,过滤它继承来的能力面;不改全局注册,agent 释放时全部还原。
| 能力族 | 机制 |
|---|---|
tool / mcp |
在 agent scope 上 ctx.tools.restrict({ deny }) |
skill |
用同名、modelInvocable:false 的运行时技能影子掉真技能 |
prompt |
同名空文本 section/context 影子,或 suppressRuntimeContext() |
approval |
scoped approval/request 监听器直接 resolve 'rejected' |
guard |
tools/pre-execute 监听器按预设断言匹配 |
说明
- 环境要求:Node ≥ 22.6,以及一个跑 Web GUI 的 DSH profile。
- 信任边界:插件的两条同源路由沿用 DSH 本地 GUI 的信任模型 —— 无独立鉴权、无 CSRF token,依赖「只有本机能访问
127.0.0.1上的 GUI 端口」。/set会写持久化 settings,任何能访问该端口的本地进程都能调用。若把 GUI 暴露到非本机地址,需自行在前置代理加鉴权。 - 提示词开关是精选白名单,且会探测实际存在性。会让模型或渲染崩坏的项(
harness:identity、tools:code-only/tools:sdk,以及严格插值变量provider/model/cwd)被刻意排除。 - 87 条纯逻辑测试;MIT 许可。