
Security News
Rust 1.100 Will Add Dependency Cooldowns to Cargo
Rust 1.100 will add opt-in dependency cooldowns to Cargo, giving security scanners and maintainers time to catch malicious crate releases.
dsh-write-create-only
Advanced tools
「DSH·write 仅创建」:write 只允许创建新文件,目标已存在时在工具执行前直接拒绝并提示改用 edit,全局所有会话生效,防止模型用 write 整体覆写已有内容。纯 host 端 dsh 插件。
禁止 write 覆盖已存在的文件:write 只允许创建新文件,目标已存在时在工具执行前直接拒绝并提示改用 edit,全局所有会话生效,防止模型用 write 把已有文件整体冲掉。纯 host 端插件,不碰 DSH 源码。
write 是全文件覆写。模型一旦误用 write 去改一个已有文件,原内容会被整段覆盖,而 dsh 默认的 fs-observation-policy 只要求「先读过」,并不禁止覆写。与其事后靠模型自觉,不如把「write = 仅创建」立成硬约束。
edit、read 等其余工具完全不受影响。tools/pre-execute 瀑布里对 write 调用先 fs.stat 目标,已存在则返回 deny,错误信息明确提示「请改用 edit 做定向修改;只有创建新文件时才使用 write」,模型看到后会改走 edit。从 GitHub 安装:源码在 src/,lib/ 不入仓库,安装时 npm 会触发 prepare 脚本现场构建。
dsh plugin --profile web add github:better-er/dsh-write-create-only
从 npm 安装:包内已含构建产物 lib/index.js,安装时不再构建。
dsh plugin --profile web add dsh-write-create-only
两种方式装完都会自动挂载,重启 DSH web 后启用,无需手工编辑任何文件。
dsh plugin --profile web remove dsh-write-create-only
彻底移除,重启 DSH web 后不再加载。
dsh 的每个工具在执行前都会走 tools/pre-execute 这个异步瀑布,每个监听器按序决定 allow / ask / deny。本插件注册一个全局监听器:
exec.name === 'write' 生效;exec.arguments.file_path,用会话工作目录 ctx.fs.resolve 成绝对目标,再 ctx.fs.stat;{ kind: 'deny', reason } 拒绝本次调用;return next() 放行到瀑布下一环。选择 tools/pre-execute 而不是 fs/write-intent,是因为后者是单槽瀑布且已被默认的 fs-observation-policy 占用;而 tools/pre-execute 是多监听器瀑布,位置在工具执行最前面,既不影响 write 的 schema,也不与现有策略抢位。
npm install
npm run build # 产出 lib/index.js
node scripts/smoke.mjs # 无运行时冒烟验证:5 项断言覆盖拦截/放行/容错
FAQs
「DSH·write 仅创建」:write 只允许创建新文件,目标已存在时在工具执行前直接拒绝并提示改用 edit,全局所有会话生效,防止模型用 write 整体覆写已有内容。纯 host 端 dsh 插件。
The npm package dsh-write-create-only receives a total of 166 weekly downloads. As such, dsh-write-create-only popularity was classified as not popular.
We found that dsh-write-create-only demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Rust 1.100 will add opt-in dependency cooldowns to Cargo, giving security scanners and maintainers time to catch malicious crate releases.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.