@namzu/computer-use 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +18 -93
  3. package/package.json +5 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 03e363c: Declare the Node floor these packages already had, and export a type `TelemetryConfig` already required.
8
+
9
+ **`engines.node: ">=20.0.0"`.** Only `@namzu/cli` declared one; the other fourteen published without any, so npm could not warn a consumer installing onto an unsupported runtime — they got a crash at some later import instead. The floor is not new: `@namzu/cli` has declared it since it shipped and `install.sh` has enforced it since it existed. This makes the other fourteen say the same thing.
10
+
11
+ If you install with `engine-strict=true` on Node 18, an install that previously emitted nothing will now fail. Upgrade to Node 20 or newer, which the code already assumed. Everyone else sees no change, or an `EBADENGINE` warning that replaces a later crash.
12
+
13
+ Worth stating plainly: CI verifies Node 22 and 24. The 20 floor is a declared minimum, not a tested one.
14
+
15
+ **`SpanProcessorLike` is now exported from `@namzu/telemetry`.** `TelemetryConfig.spanProcessors` takes `readonly SpanProcessorLike[]`, and the type had no export — a field on the public surface whose type was not on it, so a host supplying the value had to inline the shape or reach for `any`.
16
+
17
+ ## 1.1.1
18
+
19
+ ### Patch Changes
20
+
21
+ - b2c005c: Make each README an npm package page rather than the package's manual.
22
+
23
+ `@namzu/sdk`'s README was a twenty-four-section architecture tour, 45 KB of it; the others ran to several hundred lines each. That is the right shape for a single-package repository, where the README _is_ the documentation, and the wrong one here — it duplicated a `docs/` tree that already existed, and nothing checked that the two agreed.
24
+
25
+ Each README is now what a reader needs in the first minute: what the package is, install with its Node requirement, one working example, and links. The long-form material moved into `docs/` whole — `docs/sdk/architecture.md`, `docs/cli/reference.md`, `docs/packages/<name>.md` — where the doc gates cover it.
26
+
27
+ Two documentation defects fell out of the move, both in `@namzu/telemetry`'s session-export example, and both had been shipping: the config field is `redactors` and takes a list, not `redactor` taking one; and `secretRedactor` is a factory that has to be called. The required `destination` field was missing from the example entirely. They surfaced because a README is gated by nothing and `docs/` is compiled against the built SDK.
28
+
29
+ No API change.
30
+
3
31
  ## 1.1.0
4
32
 
5
33
  ### Minor Changes
package/README.md CHANGED
@@ -2,10 +2,10 @@
2
2
  type: Reference
3
3
  title: "@namzu/computer-use"
4
4
  description: >-
5
- Desktop control for Namzu agents — screenshots, mouse, keyboard — driven
6
- through the CLIs already on the machine. No native addon, no prebuild matrix,
7
- and a capability set probed at startup rather than assumed.
8
- tags: [readme, package, computer-use, desktop]
5
+ Screen capture, keyboard and pointer control behind one adapter interface.
6
+ Which backend serves a call depends on the platform, and what a platform
7
+ cannot do is reported as a capability rather than discovered as a failure.
8
+ tags: [readme, package, computer-use, adapters]
9
9
  timestamp: 2026-08-17T00:00:00Z
10
10
  status: active
11
11
  diataxis: reference
@@ -15,19 +15,21 @@ diataxis: reference
15
15
 
16
16
  <h1>@namzu/computer-use</h1>
17
17
 
18
- **Desktop control for [`@namzu/sdk`](https://www.npmjs.com/package/@namzu/sdk).**
18
+ **Screen, keyboard and pointer control for Namzu agents.**
19
19
 
20
- [![License: FSL-1.1-MIT](https://img.shields.io/badge/license-FSL--1.1--MIT-blue.svg)](https://github.com/cogitave/namzu/blob/main/LICENSE.md)
21
- [![npm](https://img.shields.io/npm/v/@namzu/computer-use.svg?label=%40namzu%2Fcomputer-use)](https://www.npmjs.com/package/@namzu/computer-use)
20
+ [![npm](https://img.shields.io/npm/v/@namzu/computer-use.svg)](https://www.npmjs.com/package/@namzu/computer-use)
21
+ [![build](https://github.com/cogitave/namzu/actions/workflows/ci.yml/badge.svg)](https://github.com/cogitave/namzu/actions/workflows/ci.yml)
22
+ [![license](https://img.shields.io/badge/license-FSL--1.1--MIT-blue.svg)](https://github.com/cogitave/namzu/blob/main/LICENSE.md)
22
23
 
23
- [Install](#install) · [Usage](#usage) · [Platform matrix](#platform-matrix) · [Capabilities](#capability-flags) · [Errors](#error-surface)
24
+ [Install](#install) · [Usage](#usage) · [Documentation](#documentation)
24
25
 
25
26
  </div>
26
27
 
27
28
  ---
28
- Subprocess-based computer-use host for [`@namzu/sdk`](https://www.npmjs.com/package/@namzu/sdk). Lets namzu agents control a desktop — screenshots, mouse, keyboard — via platform-native CLIs.
29
29
 
30
- > No native addons. No Rust toolchain. No per-platform prebuild packages. No CFRunLoop pump. Just `spawn()` and the CLIs already on your OS.
30
+ Screen capture, keyboard and pointer control, behind one adapter interface.
31
+ Which backend serves a call depends on the platform, and what a platform
32
+ cannot do is reported as a capability rather than discovered as a failure.
31
33
 
32
34
  ## Install
33
35
 
@@ -35,6 +37,8 @@ Subprocess-based computer-use host for [`@namzu/sdk`](https://www.npmjs.com/pack
35
37
  pnpm add @namzu/sdk @namzu/computer-use
36
38
  ```
37
39
 
40
+ `@namzu/sdk` is a peer dependency. Install both.
41
+
38
42
  ## Usage
39
43
 
40
44
  ```ts
@@ -58,90 +62,11 @@ const registry = new ToolRegistry()
58
62
  registry.register(createComputerUseTool(host))
59
63
  ```
60
64
 
61
- The tool is a single `computer_use` action with a discriminated-union input:
62
-
63
- ```ts
64
- { type: 'screenshot' }
65
- { type: 'cursor_position' }
66
- { type: 'mouse_move'; to: { x, y } }
67
- { type: 'mouse_click'; at: { x, y }, button: 'left' | 'right' | 'middle' }
68
- { type: 'mouse_drag'; from: { x, y }, to: { x, y }, button }
69
- { type: 'scroll'; at: { x, y }, direction, amount }
70
- { type: 'type_text'; text }
71
- { type: 'key'; keys } // e.g. "ctrl+c", "cmd+shift+t", "Return"
72
- ```
73
-
74
- 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.
75
-
76
- ## Platform Matrix
77
-
78
- | OS / Server | Screenshot | Mouse | Keyboard | Cursor Pos | Install |
79
- |---|---|---|---|---|---|
80
- | **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) |
81
- | **Linux X11** | `maim` | `xdotool` | `xdotool` | `xdotool` | `apt install xdotool maim` / `dnf install …` / `pacman -S …` |
82
- | **Linux Wayland** | `grim` (wlroots) | `ydotool` (needs uinput daemon) | `wtype` or `ydotool` | — | `apt install grim wtype ydotool` + start `ydotoold` |
83
- | **Windows** | PowerShell `System.Drawing` | `SendInput` via inline C# | `SendKeys` | `Cursor::Position` | `pwsh` or `powershell.exe` (built-in) |
84
-
85
- ### macOS permissions (TCC)
86
-
87
- On first use you'll be prompted for:
88
-
89
- - **Screen Recording** — required by `screencapture` to produce images with window contents.
90
- - **Accessibility** — required by `osascript` to send keystrokes and clicks.
91
-
92
- Grant both to the terminal/app running your Node process. The adapter surfaces TCC-denied errors verbatim in `SpawnError.stderr`.
93
-
94
- ### macOS scroll
95
-
96
- 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.
97
-
98
- ### Linux Wayland caveats
99
-
100
- - Only wlroots compositors (Sway, Hyprland, Wayfire) are supported for screenshot via `grim`. GNOME and KDE Wayland block compositor-level screen capture by design.
101
- - `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`.
102
- - Cursor position has no standard Wayland API; capability stays `false` on this adapter.
103
-
104
- ### Windows caveats
105
-
106
- - Input fails when the workstation is locked or on the screensaver. No way around this — Windows enforces user-session context for `SendInput`.
107
-
108
- ## Capability Flags
109
-
110
- `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.
111
-
112
- If the user installs a missing CLI mid-session, reconstruct the host (capabilities do not re-probe).
113
-
114
- ## Error Surface
115
-
116
- ```ts
117
- import {
118
- ActionCapabilityError,
119
- AdapterUnavailableError,
120
- SpawnError,
121
- } from '@namzu/computer-use'
122
- ```
123
-
124
- | Error | Meaning |
125
- |---|---|
126
- | `AdapterUnavailableError` | Mandatory binaries missing at construction (e.g. `xdotool` on Linux X11). `err.missing` lists them, which is the actionable half. |
127
- | `ActionCapabilityError` | The action requires a capability that is `false` (e.g. macOS `mouse_move` without `cliclick`). |
128
- | `SpawnError` | A spawned CLI returned non-zero or timed out. `err.result.stderr` carries the reason, including a TCC or permission rejection verbatim. |
129
-
130
- All three are exported, so a host can branch on the type rather than matching
131
- on a message this package is free to reword.
132
-
133
- ## Design
134
-
135
- The adapter contract, the capability protocol and the platform command matrix
136
- are declared in this package's own types and enforced by its tests.
65
+ ## Documentation
137
66
 
138
- Subprocess rather than a native addon, deliberately. A Rust + napi-rs host
139
- would mean a prebuild for every platform and architecture, a toolchain for
140
- anyone building from source, and a native crash taking the agent's process
141
- with it. Every capability here is a program the operating system already
142
- ships or the user can install with one command, and a failure is an exit code.
67
+ - [Computer use — the platform matrix, capability flags and error surface](https://github.com/cogitave/namzu/blob/main/docs/packages/computer-use.md)
68
+ - [Namzu docs](https://github.com/cogitave/namzu/tree/main/docs)
143
69
 
144
70
  ## License
145
71
 
146
- FSL-1.1-MIT, converting to MIT two years after each release. Same as
147
- `@namzu/sdk`.
72
+ FSL-1.1-MIT, converting to MIT two years after each release.
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@namzu/computer-use",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "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).",
5
5
  "license": "FSL-1.1-MIT",
6
+ "engines": {
7
+ "node": ">=20.0.0"
8
+ },
6
9
  "type": "module",
7
10
  "homepage": "https://github.com/cogitave/namzu#readme",
8
11
  "repository": {
@@ -50,7 +53,7 @@
50
53
  "@types/node": "^22.19.17",
51
54
  "typescript": "^5.5.0",
52
55
  "vitest": "^3.2.6",
53
- "@namzu/sdk": "^28.0.0"
56
+ "@namzu/sdk": "^30.1.0"
54
57
  },
55
58
  "scripts": {
56
59
  "build": "tsc --build",