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

@namzu/computer-use

v0.2.1

Published

Subprocess-based computer-use host for @namzu/sdk. Screenshot, mouse, and keyboard control via platform-native CLIs (screencapture/osascript on darwin, xdotool/maim on Linux X11, grim/wtype/ydotool on Wayland, PowerShell on Windows).

Downloads

587

Readme

@namzu/computer-use

Subprocess-based computer-use host for @namzu/sdk. Lets namzu agents control a desktop — screenshots, mouse, keyboard — via platform-native CLIs.

No native addons. No Rust toolchain. No per-platform prebuild packages. No CFRunLoop pump. Just spawn() and the CLIs already on your OS.

Install

pnpm add @namzu/sdk @namzu/computer-use

Usage

import { SubprocessComputerUseHost } from '@namzu/computer-use'
import { createComputerUseTool, ToolRegistry } from '@namzu/sdk'

const host = new SubprocessComputerUseHost()
await host.initialize()

console.log(host.capabilities)
// {
//   displayServer: 'darwin',
//   screenshot: true,
//   mouse: true,
//   keyboard: true,
//   cursorPosition: false,  // unless `cliclick` is installed
//   clipboard: true,
// }

const registry = new ToolRegistry()
registry.register(createComputerUseTool(host))

The tool is a single computer_use action with a discriminated-union input:

{ type: 'screenshot' }
{ type: 'cursor_position' }
{ type: 'mouse_move';  to: { x, y } }
{ type: 'mouse_click'; at: { x, y }, button: 'left' | 'right' | 'middle' }
{ type: 'mouse_drag';  from: { x, y }, to: { x, y }, button }
{ type: 'scroll';      at: { x, y }, direction, amount }
{ type: 'type_text';   text }
{ type: 'key';         keys }     // e.g. "ctrl+c", "cmd+shift+t", "Return"

Screenshots return base64-encoded PNG in ToolResult.output. Destructive actions (click/drag/type/key/scroll) surface as isDestructive === true so namzu's HITL layer can gate them.

Platform Matrix

| OS / Server | Screenshot | Mouse | Keyboard | Cursor Pos | Install | |---|---|---|---|---|---| | macOS | screencapture (built-in) | osascript click / cliclick for move+drag+right-click | osascript keystroke | via cliclick | brew install cliclick (optional, for move/drag/cursor-pos) | | Linux X11 | maim | xdotool | xdotool | xdotool | apt install xdotool maim / dnf install … / pacman -S … | | Linux Wayland | grim (wlroots) | ydotool (needs uinput daemon) | wtype or ydotool | — | apt install grim wtype ydotool + start ydotoold | | Windows | PowerShell System.Drawing | SendInput via inline C# | SendKeys | Cursor::Position | pwsh or powershell.exe (built-in) |

macOS permissions (TCC)

On first use you'll be prompted for:

  • Screen Recording — required by screencapture to produce images with window contents.
  • Accessibility — required by osascript to send keystrokes and clicks.

Grant both to the terminal/app running your Node process. The adapter surfaces TCC-denied errors verbatim in SpawnError.stderr.

macOS scroll

Scroll is not supported on macOS from built-in CLIs. Use keyboard navigation ({ type: 'key', keys: 'page_down' }) as a substitute, or install a future native host package.

Linux Wayland caveats

  • Only wlroots compositors (Sway, Hyprland, Wayfire) are supported for screenshot via grim. GNOME and KDE Wayland block compositor-level screen capture by design.
  • ydotool requires the ydotoold daemon to be running with access to /dev/uinput (usually via the input group). If the daemon is not running, mouse/keyboard capabilities degrade to false.
  • Cursor position has no standard Wayland API; capability stays false on this adapter.

Windows caveats

  • Input fails when the workstation is locked or on the screensaver. No way around this — Windows enforces user-session context for SendInput.

Capability Flags

host.capabilities is frozen at initialize() and reflects what actually works, not what the action union permits. The tool layer rejects unsupported actions before hitting the adapter, so the model gets a clean error instead of a hang.

If the user installs a missing CLI mid-session, reconstruct the host (capabilities do not re-probe).

Error Surface

| Error | Meaning | |---|---| | AdapterUnavailableError | Mandatory binaries missing at construction (e.g. xdotool on Linux X11). err.missing lists them. | | ActionCapabilityError | Action requires a capability that's false (e.g. macOS mouse_move without cliclick). | | SpawnError | A spawned CLI returned non-zero, timed out, or the stderr holds a TCC / permission rejection. |

Design

See docs.local/architecture/patterns/namzu-computer-use/subprocess-adapter-pattern.md for adapter contract, capability protocol, and platform command matrix.

ADR: docs/architecture/decisions/adr-computer-use-subprocess.md explains why subprocess over Rust+napi-rs.

License

FSL-1.1-MIT. Same as @namzu/sdk.