@cabane/companion 0.6.88 → 0.6.90
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 +17 -11
- package/dist/cli.js +776 -219
- package/dist/pairing-config.js +9 -6
- package/dist/postinstall.js +209 -0
- package/dist/runtime.js +765 -208
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ The Companion runs on a **device you pair**, running **agents you assign to it**
|
|
|
16
16
|
|
|
17
17
|
## Prerequisites
|
|
18
18
|
|
|
19
|
-
You need **Node 22+** (the Companion itself runs on Node — check with `node --version`) and **at least one harness installed and signed in**. The Companion installs no harness and drives no login for you — bring your own, and set it up **before** starting the Companion. It
|
|
19
|
+
You need **Node 22+** (the Companion itself runs on Node — check with `node --version`) and **at least one harness installed and signed in**. The Companion installs no harness and drives no login for you — bring your own, and set it up **before** starting the Companion. It will still `start` with nothing connected — that is the ordinary first-run state, and `start` is what offers you the harnesses it found — but no turn can be routed to it until you connect one.
|
|
20
20
|
|
|
21
21
|
Set up whichever you already use — one is enough, and a machine can expose several. [Harnesses](#harnesses) has the full per-harness wiring; the short version:
|
|
22
22
|
|
|
@@ -29,10 +29,12 @@ claude # complete the login, then quit
|
|
|
29
29
|
|
|
30
30
|
Both halves are load-bearing, for different reasons:
|
|
31
31
|
|
|
32
|
-
- **The install** puts `claude` on your PATH (`which claude` should resolve). That
|
|
33
|
-
- **The login** writes the credential the turn actually uses. The Companion does _not_ run your global `claude` to answer a turn — inference goes through the bundled Claude Agent SDK — but the SDK reads the credential your Claude Code login left on disk. So a machine with `claude` installed and never logged in looks fine
|
|
32
|
+
- **The install** puts `claude` on your PATH (`which claude` should resolve). That is what makes the Companion _offer_ to connect Claude Code, and what `cabane-companion status` reports a version from. It is not what runs your turns, and on its own it exposes nothing — that takes connecting it _and_ the bundled binary (below).
|
|
33
|
+
- **The login** writes the credential the turn actually uses. The Companion does _not_ run your global `claude` to answer a turn — inference goes through the bundled Claude Agent SDK, which spawns its own native binary — but the SDK reads the credential your Claude Code login left on disk. So a machine with `claude` installed and never logged in looks fine and then fails every turn with **"Sign-in needed"**.
|
|
34
34
|
|
|
35
|
-
**
|
|
35
|
+
**Connect it.** Claude Code is an opt-in like the others: accept the offer from `cabane-companion start`, run `cabane-companion connect claude-code`, or add a `claudeCode` block to `~/.cabane/config.json`. A device exposes it only when you have connected it **and** the Agent SDK's bundled binary is installed — that binary arrives as an optional npm dependency, so a companion installed with optional dependencies omitted has none, and will tell you so with the command that fixes it.
|
|
36
|
+
|
|
37
|
+
**Codex** — log in (`codex login`, or set `CODEX_API_KEY` in Codex's own environment — Cabane never sees the key), then opt in the same way: accept the offer from `cabane-companion start`, run `cabane-companion connect codex`, or add a one-line `codex` block in `~/.cabane/config.json`. As with Claude Code, the turn runs the SDK's own vendored `codex` binary rather than the CLI on your PATH. → [full setup](https://app.cabane.ai/docs/reference/connectors/chatgpt)
|
|
36
38
|
|
|
37
39
|
**opencode** — install it, authenticate a provider through its own flow, and start its server (`opencode serve`); the Companion addresses it at the URL you give it. → [full setup](https://app.cabane.ai/docs/reference/connectors/opencode)
|
|
38
40
|
|
|
@@ -292,11 +294,13 @@ Which harness a turn uses follows the agent's **model**, set in Cabane (Workspac
|
|
|
292
294
|
|
|
293
295
|
What "exposed" means differs per harness, because each is discoverable in a different way. Bring your own install and your own login in all three cases — the Companion never installs a binary and never drives a login:
|
|
294
296
|
|
|
295
|
-
| Harness | How the device exposes it
|
|
296
|
-
| --------------- |
|
|
297
|
-
| **Claude Code** | `
|
|
298
|
-
| **Codex** | A `codex` block in `~/.cabane/config.json
|
|
299
|
-
| **opencode** | An `opencode.serverUrl` in `~/.cabane/config.json` pointing at a reachable `opencode serve`.
|
|
297
|
+
| Harness | How the device exposes it | Setup |
|
|
298
|
+
| --------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
299
|
+
| **Claude Code** | A `claudeCode` block in `~/.cabane/config.json`, **and** the Agent SDK's bundled binary installed. | [Claude](https://app.cabane.ai/docs/reference/connectors/claude) |
|
|
300
|
+
| **Codex** | A `codex` block in `~/.cabane/config.json`, **and** the Codex SDK's vendored binary installed. | [ChatGPT (Codex)](https://app.cabane.ai/docs/reference/connectors/chatgpt) |
|
|
301
|
+
| **opencode** | An `opencode.serverUrl` in `~/.cabane/config.json` pointing at a reachable `opencode serve`. | [opencode](https://app.cabane.ai/docs/reference/connectors/opencode) |
|
|
302
|
+
|
|
303
|
+
Claude Code and Codex each run a native binary their SDK ships, installed alongside the Companion as an optional npm dependency. Those are what a turn launches — not the `claude` / `codex` CLIs on your PATH, which are for setup and login. If one didn't install, the Companion says so on startup and on the device's page in Cabane, with the command that repairs it: `npm i -g @cabane/companion --include=optional`.
|
|
300
304
|
|
|
301
305
|
Each harness has a full setup page in the docs — install, login, enable, verify — linked above; this section is just the shape of it and the config the Companion reads.
|
|
302
306
|
|
|
@@ -305,12 +309,13 @@ Each harness has a full setup page in the docs — install, login, enable, verif
|
|
|
305
309
|
```jsonc
|
|
306
310
|
{
|
|
307
311
|
// …device identity, managed by `pair`; don't hand-edit those fields…
|
|
312
|
+
"claudeCode": { "enabled": true },
|
|
308
313
|
"codex": { "enabled": true },
|
|
309
314
|
"opencode": { "serverUrl": "http://127.0.0.1:4096" },
|
|
310
315
|
}
|
|
311
316
|
```
|
|
312
317
|
|
|
313
|
-
|
|
318
|
+
Every block is optional and independent — set only the harnesses you have. Claude Code and Codex each take a flag and no URL, because the SDK bundled with the Companion spawns its own native binary per turn; opencode is a long-lived server addressed by URL, so run one `opencode serve` per Companion process. A hand-edit needs a restart (`cabane-companion stop && cabane-companion start`); the `connect` command updates a running Companion over its control socket.
|
|
314
319
|
|
|
315
320
|
Everything else about a Companion-run agent is the same whichever harness runs it — same assignment, same working directory, same secrets. A harness is a way to execute a turn, not a different way to run the Companion.
|
|
316
321
|
|
|
@@ -320,7 +325,8 @@ Everything else about a Companion-run agent is the same whichever harness runs i
|
|
|
320
325
|
~/.cabane/
|
|
321
326
|
├── config.json # device identity: baseUrl + device token (cabdev_…) + device id/label,
|
|
322
327
|
│ # plus optional per-agent `agents` overrides (cwd / prepareHook), the
|
|
323
|
-
│ # optional harness blocks (`
|
|
328
|
+
│ # optional harness blocks (`claudeCode` / `codex` enabled,
|
|
329
|
+
│ # `opencode` serverUrl), and
|
|
324
330
|
│ # legacy local prefs. mode 600.
|
|
325
331
|
│ # No account password, no full-account token.
|
|
326
332
|
├── credentials.json # agentId → per-agent workspace-bound token, cached on first assignment
|