chengyimingvb/dsh-silent-pwsh ↗★ 0
dsh-silent-pwsh
Self-healing DeepSeek-Harness plugin: keeps confined pwsh/bash console windows invisible (SW_HIDE) on Windows — no black console flash on every sandboxed command.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:chengyimingvb/dsh-silent-pwsh说明文档
阅读完整 README ↗dsh-silent-pwsh
DeepSeek-Harness 插件:让 Windows 上受限(沙箱)pwsh / bash 调用的控制台窗口创建即隐藏(SW_HIDE)——每次命令不再闪现黑框。
背景
DSH 每次受限 pwsh 调用都经过 windows-acl runner(dsh-sandbox-windows-acl/lib/runner.js),用原生 CreateProcessAsUserW 拉起子进程。出厂包里没给 STARTUPINFOW 设置 STARTF_USESHOWWINDOW | SW_HIDE,宿主又没有控制台,于是每个受限命令都会新建一个可见的控制台窗口(黑框闪现)。CREATE_NO_WINDOW 在受限令牌下会让子进程以 0xC0000142 启动失败(官方已验证),所以正确做法是 SW_HIDE:控制台保留(PowerShell 初始化不受影响)、窗口隐藏。
进程树终止用的 taskkill 和沙箱能力探测的 spawnSync 也缺 windowsHide,同样会闪框,本插件一并修复。
它做什么
DSH 插件模型只能补 Loader 配置、加载 Cordis 插件,无法通过任何配置缝修改上述原生 spawn 标志。因此本插件是一个自愈补丁插件:宿主每次启动时(任何受限命令执行前)校验并幂等重打三处补丁——
文件(\node_modules 下) | 补丁 |
|---|---|
@deepseek-ai/dsh-sandbox-windows-acl/lib/types-CNjZgO4h.js | 两处 encodeStartupInfo:dwFlags: 256 → 257(+STARTF_USESHOWWINDOW),加 wShowWindow: 0(SW_HIDE) |
@deepseek-ai/dsh-subprocess-local/lib/index.js | taskkill 的 spawnSync 加 windowsHide: true |
@deepseek-ai/dsh-sandbox-local/lib/index.js | windows-acl 能力探测的 spawnSync 加 windowsHide: true |
补丁只在文件处于「预期旧形态」时替换;形态不匹配(上游改版)则告警跳过,绝不破坏文件。重装或升级 DSH 后无需手动改,下次启动自动修复。
安装
前置:DeepSeek-Harness 桌面应用,node 与 pnpm 在 PATH 上。
从 GitHub 安装(推荐)
dsh plugin --profile web add github:chengyimingvb/dsh-silent-pwsh
# 或完整 URL:
dsh plugin --profile web add https://github.com/chengyimingvb/dsh-silent-pwsh
从本地目录 / zip 安装
# 解压 zip 后进入 dsh-silent-pwsh 目录:
.\install.ps1 # 装入 web profile
.\install.ps1 -Profile headless # 或其它 profile
# 被执行策略拦截时:powershell -ExecutionPolicy Bypass -File .\install.ps1
然后重启 DeepSeek Harness。宿主日志会显示 [silent-pwsh] up to date(需要自愈时显示 [silent-pwsh] patched …)。