全部插件

DSH / BUNDLE / CLIENT-UI

dsh-whitelist-auto-approval

v0.4.0laoer / dsh-whitelist-auto-approval4dd73cbb50

可安装组合包UI 与客户端插件社区 · Topic 自动分析Web UI

概览

dsh-whitelist-auto-approval

源码级技术说明Per-command sandbox allow-list for the DSH bash tool, managed from Settings and the Plugins page: allow-listed CLIs run with configurable writable roots (workspace stays writable on macOS/Linux) instead of prompting for danger-full-access; write-neutral pipes such as 2>&1 | tail -N still match, and a narrow-root rule can accept any command shape.展开完整技术说明收起技术说明
Per-command sandbox allow-list for the DSH bash tool, managed from Settings and the Plugins page: allow-listed CLIs run with configurable writable roots (workspace stays writable on macOS/Linux) instead of prompting for danger-full-access; write-neutral pipes such as 2>&1 | tail -N still match, and a narrow-root rule can accept any command shape.

README / ZH

插件文档

目录摘要

Per-command sandbox allow-list for the DSH bash tool, managed from Settings and the Plugins page: allow-listed CLIs run with configurable writable roots (workspace stays writable on macOS/Linux) instead of prompting for danger-full-access; write-neutral pipes such as 2>&1 | tail -N still match, and a narrow-root rule can accept any command shape.

dsh.pub 核对固定版本的组合包契约、运行时事实与分发语义;完整 README 请查看源仓库。

在 GitHub 阅读完整 README

LIMITATIONS

已知限制

- **macOS/Linux 两个可写根,Windows 一个**:macOS/Linux 上 `home` 会保留会话工作区并追加 `$HOME`;Windows(或 provider runner 无法识别)仍然会覆盖 `workspaceRoot`,命中命令会失去对工作区的写权限。 - **overlay 是尽力而为**:它只是在官方 runner 的 profile/argv 上追加;runner 不认识、argv 形状变了、路径不存在,都会原样返回并告警一次。结果是"这次没加上根",不是"放宽了沙箱"。 - **`write`/`edit` 不覆盖**:overlay 只放宽被沙箱约束的命令;用文件工具写 `$HOME` 仍按会话策略走。 - **不要和接管 `sandbox` provider 的插件混用**:overlay 的 allow 追加在最终 argv/profile 末尾;如果别的插件在同一 profile 里追加了自己的 deny,顺序可能反过来。本插件假设 provider 是官方 `dsh-sandbox-local`。 - **只处理 bash**:Windows 上 DSH 走 `pwsh-sandbox`;overlay 在 win32 不安装,`home` 退回替换根。`cd` 前缀也只认 POSIX 的 `&&`,pwsh 的 `cd x; cmd` 仍不命中。 - **`cd` 前缀只认一个**:`cd a && cd b && …`、`pushd`、`(cd a && …)` 都不命中;嵌套目录切换直接用 bash 工具的 `workdir`。 - **管道只认写中立的形态**:`| tail` / `| head` / `| wc` 且参数只有数字时命中;`| tee`、`| sh`、`| sed -i`、`| awk`、`| tail -f`、`> file` 这类会写文件或再起程序的形态仍落回原审批。 - **管道会改变看到的退出码**:`a | tail -12` 的退出码是 `tail` 的,`a` 失败可能被遮住;看重成败就用不带管道的写法。 - **提示段是尽力而为**:`promptHint` 只能降低模型写错形态的概率,判断仍在匹配器;模型忽略提示时只会多弹一次窗。 - **`shape: any` 的命中是字符串级的**:`echo lark-cli` 也算命中(拿到的是窄根),而 `bash -c 'lark-cli …'` 不算;注释与重定向目标不计入。 - **`shape: any` 不能配 `$HOME`**:这种规则在加载时被丢弃并告警,见上文「窄根与任意写法」。 - **多根在 Windows 上不可表达**:只取第一个根,并告警一次。 - **`roots` 漏目录 = 执行中被拒**:`custom` / `roots` 不再像 `home` 那样"够宽",漏掉的目录会触发 sandbox denial,进而可能走到升级授权。 - **依赖 `ctx.shell.resolve()` 这个方法名**:DSH 升级若改变执行器契约,插件会退化为"不放行",不会破坏执行。 - **UI 只管理 `rules`**:`audit`、`upgradeFromReadOnly`、`extraPath`、`trace` 仍在 YAML;同一 `command` 的重复规则在 UI 中被阻止(YAML 仍可按顺序手写)。 - **不能替代人工判断**。