dsh-preset-tool-guard:按 Agent preset 限制工具可见性

dsh 的工具解析沿 agent→preset→global 继承,preset 无法单独收窄 global 挂载的工具,minimal 等预设也会看到宿主侧全部 provider。KouzakiUmi 的 dsh-preset-tool-guard 在宿主挂载一次,于 agent/created 读取组合 preset,在 Agent 自有 scope 调用 ctx.tools.restrict(),按 allowlists、deny 与前缀做 per-preset 白名单,被遮工具返回 UNKNOWN_TOOL 且不影响其他 Agent。安装需 Node ^22.19 或 >=24,dsh plugin --profile 添加后重启;配置写在 profile 的 cordis.patch.yml,调参可先用 dryRun。

阅读全文