npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-gamepad-approval

v0.1.4

Published

Xbox 手柄硬件审批 dsh 插件 — Agent 高危工具调用需物理按键确认(A 批准 / B 驳回)

Downloads

211

Readme

dsh-gamepad-approval

Xbox 手柄硬件审批插件 for DeepSeek Harness (dsh)

Agent 执行高危工具调用时必须通过物理按键确认:手柄震动两下提醒,A 键批准 / B 键驳回。审批决策物理隔离,远程攻击无法模拟。

与 trea-gamepad (MCP 版) 功能相同,本插件运行在 dsh 的 tools/pre-execute 管道内。

特性

  • 物理隔离 — 审批决策必须通过 Xbox 手柄按键(XInput 直连,不经过浏览器)
  • fail-closed — 无手柄 / 超时 / 断连 / 读不到输入时一律驳回
  • 只加门不拆门 — 硬件批准后仍委托 dsh 后续安全门(next()),不会绕过其他策略
  • 18 条权限规则 — 覆盖文件删除、系统命令、防火墙、磁盘、git 破坏性操作、密钥访问等
  • 可配置风险阈值 — minRiskLevel 控制触发审批的最低风险等级
  • 取消感知 — 工具调用被中止时立即终止等待,不挂起

前提条件

  • Windows 系统
  • dsh ≥ 0.1.0-rc.8
  • Xbox 兼容手柄(XInput 协议,大多数 PC 手柄都支持)

安装

dsh plugin --profile default add dsh-gamepad-approval

或从本地目录安装(开发模式):

dsh plugin --profile default add ./dsh-plugin

使用流程

  1. 插件加载时自动探测手柄(日志中会显示连接状态)
  2. Agent 发起高危工具调用(如 rm -rf、git push --force)时:
    • 手柄震动两下提醒
    • 按 A 键批准(升调"叮-叮↑")/ 按 B 键驳回(降调"咚-咚↓")
  3. 超时(默认 120 秒)自动驳回

配置

在 dsh 的 cordis.yml 或 patch 中:

- insert:
  - id: gamepad-approval
    name: dsh-gamepad-approval
    config:
      timeoutSeconds: 120   # 等待手柄按键的超时秒数
      minRiskLevel: medium  # 触发审批的最低风险等级: low | medium | high | critical

权限规则覆盖

| 类别 | 示例 | 风险 | |------|------|------| | 文件删除 | rm -rf, Remove-Item, del /f | critical | | 系统关机 | shutdown, Stop-Computer | critical | | 磁盘操作 | format, diskpart, dd if= | critical | | 系统配置 | reg add, schtasks, systemctl | critical | | 数据库破坏 | DROP TABLE, TRUNCATE | critical | | 远程脚本执行 | curl ... | sh | critical | | Git 破坏性 | push --force, reset --hard | high | | 密钥访问 | cat *.pem, echo $*_KEY | high | | 防火墙 | iptables, netsh firewall | high | | 进程终止 | taskkill /f, kill -9 | high | | 全局安装 | npm i -g, choco install | medium | | 脚本执行 | npx, npm run, bash -c | medium |

技术实现

插件监听 dsh 工具管道的 tools/pre-execute waterfall 事件:

模型发起 tool-call
  → tools/pre-execute(本插件)
      命中规则 → PowerShell XInput 直连手柄:震动 + 等待 A/B
        A 键  → next()(委托后续安全门后放行)
        其他  → deny(fail-closed)
  → dsh 原有 guard / execute / post-execute 管道

License

MIT