@monoclaw/machine 0.0.0-stage → 1.0.3

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.
package/README.md CHANGED
@@ -1,3 +1,80 @@
1
- # Temporary Holding Version
1
+ # @monoclaw/machine
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The one app you install on a machine so your Monoclaw agents can run there. It connects **out** to
4
+ command.monoclaw.ai, exposes the folders you allow, and runs providers: today Claude Code (via the
5
+ Agent SDK, with your own Claude login), voices, transcription and images. Install it with the command
6
+ shown under **Add a machine** in MonoClaw; it needs **Node.js 22 or newer** (`node -v`; get it from
7
+ [nodejs.org](https://nodejs.org/en/download), `brew install node`, nvm, or `winget install OpenJS.NodeJS.LTS`).
8
+
9
+ ```bash
10
+ npm install -g --ignore-scripts @monoclaw/machine
11
+ monoclaw doctor
12
+ monoclaw enrol <token> --router https://command.monoclaw.ai --root ~/command
13
+ # then run it, one of:
14
+ monoclaw service install # in the background, at every login
15
+ monoclaw start # in this terminal
16
+ ```
17
+
18
+ - `monoclaw status` — enrolment, exposed folders, provider readiness (is Claude Code installed and logged in?).
19
+ - `monoclaw doctor` — checks and repairs a fresh install: Node, the host's own copy of Claude Code (an optional 280 MB npm package that a dropped download can skip; `doctor` installs the exact version the SDK wants), Claude Code on the PATH and its login, roots, the service. Until the copy is repaired the host runs sessions with the `claude` on the PATH; `MONOCLAW_CLAUDE_PATH` names a specific executable.
20
+ - `monoclaw roots add|remove|list <path>` — folders agents may work in. Nothing outside them is browsable or openable, whatever the server asks.
21
+ - `monoclaw service install` — writes a systemd user unit / launchd plist / Windows scheduled task and prints the commands to enable it. Never uses sudo.
22
+ - `monoclaw config show|set` — local policy the server cannot override: `allowedPermissionModes` (default excludes `bypassPermissions`), `allowRemoteInputEdits` (off), `maxSessions` (8), `allowInsecure` (off).
23
+ - `monoclaw update [--to <version>]` — update now. Running hosts also check the server's version policy at start and every six hours, update between turns and restart themselves; a host below the server's minimum cannot connect until it updates. `MONOCLAW_NO_UPDATE=1` skips optional updates only.
24
+ - **One computer, several spaces:** a machine belongs to one space; enrol the computer once per space and each enrolment runs as a **profile**: `monoclaw enrol <token> --router … --profile guestlab`, then `monoclaw --profile guestlab start` or `… service install`. Profiles live in `~/.monoclaw/host/profiles/<name>/` with their own service (`monoclaw-<name>.service` / `ai.monoclaw.host.<name>`); modules, models and the Claude login are shared. Running the app's install command on a computer that already runs MonoClaw does the right thing: a token for a space it is already in changes nothing; a token for another space makes the second enrolment (it asks first; `--yes` skips).
25
+ - Config and logs live in `~/.monoclaw/host/` (`MONOCLAW_HOST_HOME` to override). This is deliberately not v2's `~/.monoclaw-host/`, and the background service is `ai.monoclaw.host` (macOS) / `monoclaw.service` (Linux), not v2's `com.monoclaw.host` / `monoclaw-host.service`, so a v2 and a v3 host can run side by side on one machine.
26
+
27
+ ## Modules (protocol 4, this version)
28
+
29
+ What a machine can do is the **modules** installed on it; a bare host has none. A module is code that ships with the
30
+ host; a **connection** is an account on it (this machine's Claude login, an API key, or "this machine" for a local model).
31
+ Keys stay on the machine, in the OS keychain (or a 0600 file), keyed by the connection id.
32
+
33
+ | Module | Does | Connection |
34
+ | --- | --- | --- |
35
+ | `claude-subscription` | agents (Claude Code with `claude login`) | `claude` |
36
+ | `claude-api` | agents (Claude Code with an API key) | API keys, several |
37
+ | `kokoro` | text to speech on this machine, 54 voices (needs ffmpeg; ~385 MB) | `kokoro` |
38
+ | `parakeet` | speech to text on this machine, English or 25 languages (needs ffmpeg; ~520 MB) | `parakeet` |
39
+ | `elevenlabs` | text to speech and Scribe speech to text | API keys, several |
40
+ | `fal` | images (FLUX on fal.ai) for agents' image tools | API keys, several |
41
+
42
+ - `monoclaw modules list [--all]` — installed modules, their connections and readiness; `--all` the catalogue.
43
+ - `monoclaw modules add <id…>` / `remove <id>` — the local voice modules install `sherpa-onnx-node` into `~/.monoclaw/host/modules` (npm, no install scripts) and download their models, with progress.
44
+ - `monoclaw modules connect <module> [--name <n>]` — add an API key connection (typed blind, or piped on stdin); `monoclaw modules key <id>` replaces a key.
45
+ - `monoclaw modules cap <id> --usd N | --characters N | --off` — a monthly cap per connection, kept in `~/.monoclaw/host/usage.json`; work over it is refused.
46
+ - `monoclaw provider …` still works for the Claude connections. Hosts from before 1.0.0-rc.18 get `claude-subscription` (and `claude-api` with API-key accounts) on first start.
47
+
48
+ The app adds modules and connections remotely too (`module.add`, `provider_account.expect` with a sealed key); jobs
49
+ arrive as `job.run` (a voice chapter, a voice note, an image) and agents' image tools as the in-process MCP server
50
+ `monoclaw-tools`, whose files are saved under `images/` in the agent's folder. `scripts/smoke-local-voice.ts` installs
51
+ kokoro and parakeet for real and checks a sentence comes back.
52
+
53
+ ## Security model
54
+
55
+ The host connects **out** to one server over https only and refuses to talk to any other origin, even if
56
+ the server asks. A session can only start inside a folder you exposed; the permission mode is clamped to
57
+ your `allowedPermissionModes`; edited tool inputs from the app are ignored unless you allow them; files
58
+ the agent sends must be inside the working folder. Inside a session, Claude Code has what you have: the
59
+ roots are where agents work, not a sandbox. Details: `docs/security/SECURITY.md` in the repo.
60
+
61
+ ## Publishing (maintainers)
62
+
63
+ Bump `version` here, add a CHANGELOG entry, merge to main, then push a tag with the same version:
64
+
65
+ ```bash
66
+ git tag host-v1.0.1 && git push origin host-v1.0.1
67
+ ```
68
+ `.github/workflows/publish-host.yml` checks the tag against this file, runs the typecheck, tests, build and
69
+ shrinkwrap, and publishes with npm trusted publishing (a pre-release goes to the `next` dist-tag). Nothing is
70
+ published from a developer's or an agent's machine. The server reads npm's `latest` within ten minutes and hosts
71
+ update themselves; raise the version floor in the server's settings when a release must be enforced.
72
+
73
+ Claude Code must be installed and logged in on the machine (`claude login`, or `CLAUDE_CODE_OAUTH_TOKEN` from
74
+ `claude setup-token` on headless boxes). The host strips nested Claude Code environment variables, so it
75
+ can be run from inside a Claude Code session.
76
+
77
+ Adding a provider: implement `Provider` from `@monoclaw/protocol` in `src/providers/<id>/index.ts` and
78
+ register it in `src/providers/index.ts`. The manifest's capabilities decide which controls appear.
79
+
80
+ Carried from monoclaw-v2 (`CARRIED_FROM.md`).
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import("../dist/cli.js");