DeepSeek Harness Plugin

OldQin-Family/PortWrench#dsh-portwrench

Stars ★ 1 Category Tools & Capabilities Added 2026-11-20

PortWrench panel for DSH: view listening ports, identify owning processes, and close process trees on Windows. Requires the PortWrench app to be installed and running.

Install

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:OldQin-Family/PortWrench#path:/packages/dsh-portwrench

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

This plugin publishes its README in Chinese only.

PortWrench(端口扳手)的 DSH 插件壳:在 DSH 设置 → 插件 里加一个「端口扳手」面板, 内嵌本机 PortWrench 完整 UI——查看监听端口、识别归属、关闭进程树。

它是什么、不是什么

  • 这只是壳:它把 DSH 和本机 PortWrench 服务连起来。
  • PortWrench 本体(port_console.py,Python)不随本插件安装——需要你自己在 本机下载并运行(见下方三步)。
  • 所有安全闸(杀前身份复核、保护线、审计、频率闸)都在 PortWrench 本体服务端, 本壳不引入任何新权限。

使用三步

  1. 从 PortWrench Releases 下载 zip,解压到任意目录;
  2. 双击 启动端口控制台.bat(Windows、Python 3.10+;默认 http://127.0.0.1:3999/,被占自动顺延);
  3. 回到 DSH 设置 → 插件 →「端口扳手」,面板会自动检测并嵌入 UI。

PortWrench 未运行时,面板显示引导页(不会白屏)。

端口发现(3999–4098 自动探测)

  • 本体从 3999 起绑定,被占则顺延(最多 100 个端口,末位 4098)。
  • 壳页打开时并发探测整个 3999–4098 区间的 /api/v1/health,自动选最低响应端口嵌入—— 本体顺延到 4000、4001 时面板不再误报「未运行」,无需手工改地址。
  • 探测只打回环 health(无敏感面),单口 800ms 超时;区间内无实例才显示引导页。
  • 不读取本地文件、不做 4099 以上端口扫描(与本体顺延范围严格一致)。

卸载

DSH 插件:设置 → 插件 →「端口扳手」→ 卸载;或命令行 dsh plugin remove dsh-portwrench。

PortWrench 本体:直接删掉解压出来的目录即可——它不写注册表、不做开机自启、不留后台服务,删目录就干净了。

平台

  • PortWrench 本体目前仅支持 Windows(依赖 taskkill / Win32_Process / Get-NetTCPConnection)。非 Windows 平台面板会提示暂不支持。

出问题怎么办

现象 先查什么
面板一直显示「PortWrench 未运行」 壳已自动探测 3999–4098;仍失败说明区间内确无实例:①看本体启动窗口是否开着②看启动窗口打印的实际地址,用浏览器直接开一次验证(被占会顺延,地址可能不是 3999)
面板白屏 打开 DSH 的开发者工具看 Console——多半是壳没注册上(模块 id 与包名不一致会报 loaded without registering)
设置页找不到「端口扳手」 插件没启用,或 DSH 版本低于插件要求
点了关闭没反应 那是本体的护栏在拦(目标受保护 / 端口易主 / 触发频率闸),看返回里的 reason 字段

面板里能看到端口列表 = 链路通了。 面板里能点、能关,说明 iframe 嵌的确实是本机那个本体。

隐私与安全

  • 只监听 127.0.0.1,绝不开放外网;不做开机自启、不写注册表、不改防火墙。
  • 关闭动作全部落审计日志;api_token.txt 是程序化通道凭据,不随壳分发;多占用仍需本机授权和一次性 user_grant_id。

来源

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.