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

computer-user

v0.3.4

Published

Codex-style computer use for DeepSeek Harness (DSH): read the screen and drive the mouse & keyboard. Pairs with picturereader (image_scan/image_ocr) to close the look-act-verify loop. Windows.

Downloads

1,045

Readme

computer-user

给 DeepSeek Harness(DSH,含 EAC 桌面客户端)的 Codex 式电脑操作插件:读屏幕并操作 鼠标键盘 —— 截图 → 用 [picturereader] 分析 → click/type/keypress/scroll/drag → 验证。 仅支持 Windows。

  • computer_screenshot 把整个虚拟屏(多显示器、DPI 感知)截成 PNG 文件并返回路径 —— 直接喂给 picturereader 的 image_scan / image_ocr,让任何纯文本模型都能"看"屏幕。
  • 另外 8 个 computer_* 工具,通过内置 PowerShell + Win32 SendInput 操作鼠标键盘 (零原生模块、无需编译,可在 DSH/EAC 宿主进程内运行)。
  • 设置卡(「电脑操作」)顶部是模式下拉框 —— 禁用 / 只读 / 手动批准(/computer)/ 自动,其余收进默认折叠的 高级设置
  • 全程纯本地、不调用外部 API:截图(PowerShell)、分析(picturereader 本地 scan/OCR)、操作(Win32 SendInput),数据不出本机。操作流程见 skills/computer-use.md(先定位目标窗口,再窗口内分块 OCR,确认后一击即中并截图验证)。
  • 已验证兼容 DeepSeek Harness EAC 桌面端(与 Web 同一 DSH 宿主内核)。

English: README.md

工具

| 工具 | 作用 | |---|---| | computer_screenshot | 保存整虚拟屏 PNG(可选 region/scale)→ {path,width,height,virtual_offset,scale} | | computer_click | 在 [x,y] 点击(click / right_click / double_click) | | computer_type | 输入任意 UTF-16 文本(含中文),走 SendInput Unicode | | computer_keypress | 组合键,如 ["ctrl","c"]["alt","tab"];字母/数字走虚拟键以触发快捷键 | | computer_scroll | 在 [x,y] 滚轮:up / down / left / right,clicks 格 | | computer_drag | 按下 → 分步移动 → 释放,可选 hold_keys | | computer_move_mouse | 移动光标但不点击 | | computer_wait | 等待 ms(让 UI 稳定) | | computer_get_cursor_position | 读取当前光标位置 [x,y] |

坐标为「相对虚拟屏原点(所有显示器合并区域左上角)」的像素;computer_screenshot 返回的 virtual_offset 即该原点。SetProcessDPIAware 保证高分屏缩放下坐标与物理像素一致。

安装

npm install computer-user

或在 DSH profile 里:

dsh plugin --profile web add computer-user

然后重启 DSH(或到 EAC「设置 → 插件 → 管理」启用)。工具对所有会话生效;设置卡在「设置 → 电脑操作」。

搭配 picturereader(推荐闭环)

computer_screenshot → path
picturereader image_scan / image_ocr <path>   # 看
computer_click / type / ...                   # 做
computer_screenshot → image_compare           # 验证

设置卡

  • 模式下拉框(卡片顶部):
    • disabled 禁用 —— 所有 computer_* 工具一律拒绝。
    • readonly 只读 —— 仅截图 / 读光标 / 等待可用。
    • manual 手动批准 —— 有副作用工具需先在本会话输入 /computer 批准(一次批准, 后续轮次持续有效)。
    • auto 自动 —— LLM 自由调用所有工具。
  • 「AI 可自行修改运行模式」开关(下拉框下方,不在高级设置里):默认关闭;开启后 AI 可用 computer_set_mode 切换模式,写入同一设置命名空间,设置卡下拉框双向同步
  • 高级设置(默认折叠):截图输出目录、默认缩放、逐字输入间隔、滚动刻度、调试日志。

安全

  • 先定位目标窗口(DPI 感知 GetWindowRect,见 skills/computer-use.md)—— 桌面图标/壁纸会同时干扰 OCR 与点击;只在目标窗口内工作。
  • 动手前务必 computer_screenshot 并用 picturereader 分析,不要盲点盲输。
  • 确认坐标后一击即中,点完截图验证,不要盲目连点(很多 UI 是点击开关)。
  • 手动批准模式配合 /computer 命令,让人在环。

验证与已知限制

  • node --test 单测 16/16 通过(工具注册、门禁、参数校验)。
  • 实机安全窗口冒烟(一次性窗口 + cmd.exe,绝不碰用户应用):截图 PNG 正确;光标读/移 往返精确;hello 中文 123! 逐字回读一致;keypress Home/End 导航+插入验证 (HEADzzzTAIL);双击选词、单击取消、拖拽选区均通过控件状态断言。
  • headless 集成:dsh --profile headless 真实会话中,模型成功调用 computer_screenshotcomputer_get_cursor_position
  • headless 真实场景:模型在 dsh --profile headless 中自主完成 5 步任务 (screenshot → image_scan → type "hello" → screenshot → image_ocr),协调 picturereader 与 computer-user 工具,OCR 确认输入文字出现在屏幕上。
  • 滚轮端到端验证通过:滚动条位置变化 + MouseWheel 事件触发均正常。注意:鼠标若落在 搜狗输入法等置顶悬浮窗上,滚轮事件会被悬浮窗吸收——把光标移到空白处再滚(与任何基于 光标的输入同理)。
  • EAC 兼容:与 picturereader 在同一宿主内并存加载;对全部内置插件静态扫描, computer_* 工具名 / computer-user 命名空间零冲突。

开发

src/capture.ps1     DPI 感知多屏截图(System.Drawing)
src/input.ps1       SendInput 鼠标键盘后端
src/ps.js           PowerShell 运行器(base64 JSON、超时、取消)
src/tools.js       9 个 computer_* 工具定义 + enabled/confirm 门禁
src/config.js       设置命名空间 schema
src/index.js        插件入口(注册工具 + 设置热载)
client.js           Web 设置卡(ModuleLoader bundle,中英)
scripts/           实机冒烟脚本(安全窗口)
tests/             node:test 单测

许可

MIT