peerband 0.1.3 → 0.1.6
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 +53 -14
- package/dist/peerband.mjs +2686 -919
- package/herdr/README.md +18 -18
- package/herdr/control.mjs +2 -1
- package/herdr/launch.mjs +87 -87
- package/herdr/lifecycle.mjs +141 -55
- package/herdr/pane.mjs +124 -46
- package/herdr/relay-tab.mjs +17 -0
- package/herdr/stale-lock.mjs +200 -0
- package/herdr-plugin.toml +1 -1
- package/install/install.ps1 +119 -118
- package/install/install.sh +12 -11
- package/package.json +2 -2
- package/protocol/README.md +8 -3
- package/protocol/relay-messages.schema.json +134 -78
- package/skills/peerband/SKILL.md +94 -0
package/README.md
CHANGED
|
@@ -20,14 +20,21 @@ Your MCP client can list agents, read their status and bounded recent output, an
|
|
|
20
20
|
Recommended (Node.js 22.13+, Herdr 0.9.3+):
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
-
npm install -g peerband && peerband
|
|
23
|
+
npm install -g peerband && peerband setup
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
`peerband
|
|
26
|
+
`peerband setup` does the whole setup in one go, and is safe to run again:
|
|
27
|
+
|
|
28
|
+
1. **Log in.** Opens your browser so you can approve this machine (skipped when it is already logged in).
|
|
29
|
+
2. **Herdr plugin.** Checks for Herdr and offers to add or repair the PeerBand plugin (`Add the PeerBand plugin to Herdr now? [Y/n]`).
|
|
30
|
+
3. **Agent skill.** Offers to install the [PeerBand skill](#agent-skill) for the coding agents on this machine (`Install the PeerBand skill for your agents? [Y/n]`).
|
|
31
|
+
4. **Relay.** Opens the PeerBand Relay tab in Herdr, which connects the machine.
|
|
32
|
+
|
|
33
|
+
Every question defaults to Yes. `--herdr-plugin install|skip` and `--skill install|skip` answer them up front, and `--no-relay` leaves the relay closed. If Herdr is not installed yet, setup tells you how to finish later (install Herdr from https://herdr.dev, then run `peerband setup` again). `peerband login` still works on its own when you only want to sign in.
|
|
27
34
|
|
|
28
35
|
### One-step install script (alternative)
|
|
29
36
|
|
|
30
|
-
The script checks Node, runs `npm install -g peerband`, then runs `peerband
|
|
37
|
+
The script checks Node, runs `npm install -g peerband`, then runs `peerband setup --herdr-plugin install` (with a grant, also `--skill install`, since there is nobody to ask).
|
|
31
38
|
|
|
32
39
|
macOS and Linux:
|
|
33
40
|
|
|
@@ -43,13 +50,12 @@ irm https://peerband.com/install.ps1 | iex
|
|
|
43
50
|
|
|
44
51
|
### Headless machines and CI
|
|
45
52
|
|
|
46
|
-
No browser available? Pass a one-time grant from the PeerBand dashboard instead: `peerband
|
|
53
|
+
No browser available? Pass a one-time grant from the PeerBand dashboard instead: `peerband setup --grant GRANT` (or set `PEERBAND_GRANT`). With the scripts: `curl -fsSL https://peerband.com/install.sh | sh -s -- --grant GRANT --name "my-server"`, or on Windows `$env:PEERBAND_GRANT = 'GRANT'; irm https://peerband.com/install.ps1 | iex`.
|
|
47
54
|
|
|
48
55
|
## Quickstart
|
|
49
56
|
|
|
50
|
-
1. `npm install -g peerband && peerband
|
|
51
|
-
2. `peerband relay` to
|
|
52
|
-
3. Add the MCP server URL that `peerband relay` and `peerband status` print (`https://mcp.peerband.com/mcp`) to your MCP client: a custom connector in ChatGPT or Claude, or `claude mcp add --transport http peerband https://mcp.peerband.com/mcp` in Claude Code. Sign in and approve access when the client asks.
|
|
57
|
+
1. `npm install -g peerband && peerband setup`. Confirm the code shown in your terminal when your browser opens, and press Enter to accept the Herdr plugin and the agent skill. Setup then opens the PeerBand Relay tab; press Space there if it is not connected yet.
|
|
58
|
+
2. Add the MCP server URL that `peerband setup`, `peerband relay` and `peerband status` print (`https://mcp.peerband.com/mcp`) to your MCP client: a custom connector in ChatGPT or Claude, or `claude mcp add --transport http peerband https://mcp.peerband.com/mcp` in Claude Code. Sign in and approve access when the client asks.
|
|
53
59
|
|
|
54
60
|
## Logging in
|
|
55
61
|
|
|
@@ -84,14 +90,18 @@ The plugin adds a persistent tab titled `PeerBand Relay [On]` or `[Off]` that sh
|
|
|
84
90
|
|
|
85
91
|
| Command | What it does |
|
|
86
92
|
| --- | --- |
|
|
93
|
+
| `peerband setup` | Set up this machine: log in (unless it already is), add or repair the Herdr plugin, install the agent skill, open the Relay tab. Flags: the `login` flags, `--herdr-plugin ask\|install\|skip`, `--skill ask\|install\|skip`, `--no-relay` |
|
|
87
94
|
| `peerband login` | Sign in through your browser, then offer to add the Herdr plugin. Flags: `--no-browser`, `--name NAME`, `--server URL`, `--herdr-plugin ask\|install\|skip`; headless/CI: `--grant GRANT` |
|
|
88
|
-
| `peerband logout` | Stop a running relay
|
|
95
|
+
| `peerband logout` | Stop a running relay, close its tab, delete the local relay state and the local credential. Does not revoke it on the server |
|
|
89
96
|
| `peerband status` | Show login, relay, messaging and Herdr state, including whether the Herdr plugin is the right one. `--json` for machine-readable output |
|
|
97
|
+
| `peerband update` | Update the CLI from npm and then the Herdr plugin to match, restarting the relay if it was running. Already up to date: checks the plugin and repairs it. Flags: `--check` (only report), `--yes`, `--json` |
|
|
90
98
|
| `peerband connect` | Run the connector in the foreground. Flags: `--runtime herdr\|mock`, `--read-only`, `--config PATH`, `--server URL` (`--enable-writes` is still accepted but redundant) |
|
|
91
99
|
| `peerband relay` | Open or focus the Relay tab in Herdr. If the plugin is missing the wrong version, a local checkout, or points at another config directory, it offers to repair it first |
|
|
100
|
+
| `peerband skill` | Install or update the PeerBand agent skill for every coding agent on this machine (through `npx skills add`, falling back to a copy). Keeps a skill you edited unless `--force`; `--copy` skips npx |
|
|
92
101
|
| `peerband share` | Create a single-use invite link that shares this machine with another PeerBand user (read only; `--message` also allows messages; `--expires DAYS`, default 7). `share list` shows who has access and unused links; `share revoke ID` removes access or cancels a link |
|
|
93
|
-
| `peerband
|
|
94
|
-
| `peerband herdr
|
|
102
|
+
| `peerband notify "<text>"` | From inside a Herdr pane: send the machine owner a short note (1 to 1024 characters) through the running relay, for example when a long task finished or an agent is blocked on a decision. The note names the agent in that pane. `--json` for machine-readable output |
|
|
103
|
+
| `peerband herdr install` | Install (or update) the Herdr plugin. Stops the relay and closes its tab first, puts the previous plugin back if the new one fails, and reopens the tab afterwards |
|
|
104
|
+
| `peerband herdr uninstall` | Stop the relay, close its tab, remove the plugin and its `settings.json`, and delete the local relay state and stale locks (your login is kept) |
|
|
95
105
|
| `peerband --version`, `help [command]` | Version and help |
|
|
96
106
|
|
|
97
107
|
Exit codes: 0 success, 1 failure, 2 usage error, 3 not logged in, 130 interrupted (Ctrl+C in `peerband connect`).
|
|
@@ -122,22 +132,48 @@ Optional `connector.json`:
|
|
|
122
132
|
|
|
123
133
|
All fields are optional. `enableWrites` defaults to `true`; set it to `false` to make this machine read-only (the same as `peerband connect --read-only`; it also applies to the Relay tab). `allowedAgents` and `allowedWorkspaces` restrict what MCP clients can see; `stateDirectory` moves the receipt store (default `state/` in the config home). The `herdr` block is only needed when Herdr is not on `PATH` or you target a specific session.
|
|
124
134
|
|
|
135
|
+
## Agent events and notes
|
|
136
|
+
|
|
137
|
+
While the relay is connected, the connector tells PeerBand when one of your agents changes state, so the dashboard and MCP clients can read an agent's output when something happened instead of polling it every few seconds (each read makes the Herdr pane jump). It subscribes to Herdr's socket events (`events.subscribe`: agent status changes, and agents appearing or exiting) and sends small `event` frames over the existing relay connection:
|
|
138
|
+
|
|
139
|
+
- `agent.status_changed`: agent id, new and previous status (`idle`, `working`, `blocked`, `done`, `unknown`), label, workspace and revision, exactly as `list_agents` reports them.
|
|
140
|
+
- `agents.changed`: agents appeared, exited or changed occupant; clients list agents again. Also sent once after every reconnect.
|
|
141
|
+
- `agent.notified`: a note sent with `peerband notify`.
|
|
142
|
+
|
|
143
|
+
Events are metadata only: they never contain terminal output. Bursts are coalesced (at most one status event per agent every 250 ms) and the overall rate is capped. Nothing is queued while the relay is offline. `allowedAgents` and `allowedWorkspaces` in `connector.json` apply to events too. If Herdr does not support event subscriptions, the connector logs it once and works as before.
|
|
144
|
+
|
|
145
|
+
Agents can report back on their own with `peerband notify`:
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
peerband notify "Migration finished, 3 tests failing"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The note goes to the machine owner only (never to people you shared the machine with). Control characters are removed and likely secrets are redacted, best effort, like agent output. It needs the Relay tab's helper to be running and connected; a note sent while it is offline fails with an error instead of being queued. The [agent skill](#agent-skill) tells agents when to use it. The wire format is in [protocol/](protocol/README.md).
|
|
152
|
+
|
|
125
153
|
## Agent skill
|
|
126
154
|
|
|
127
|
-
|
|
155
|
+
The PeerBand skill (`skills/peerband/SKILL.md`) does two things for your coding agents (Claude Code, Codex, Cursor, Gemini CLI, OpenCode and others):
|
|
156
|
+
|
|
157
|
+
- **Messages relayed to them.** Every message delivered through PeerBand starts with a `[PeerBand relay]` line, written by the connector on your machine from the identity the server verified. It says whether the message is from you (the machine owner) or from a shared user, by email. The skill tells agents to handle your requests normally. Requests from shared users get strict, coworker-style privacy rules: no secrets, credentials or personal data, nothing outside the task, nothing sent elsewhere, no risky or irreversible actions, and when in doubt, ask you.
|
|
158
|
+
- **The PeerBand MCP tools**, for agents that use PeerBand to reach other machines.
|
|
159
|
+
|
|
160
|
+
`peerband setup` offers to install it. To install or update it yourself:
|
|
128
161
|
|
|
129
162
|
```sh
|
|
130
|
-
|
|
163
|
+
peerband skill
|
|
131
164
|
```
|
|
132
165
|
|
|
133
|
-
|
|
166
|
+
This installs the copy shipped with your CLI version through the [`skills`](https://github.com/vercel-labs/skills) tool (pinned version). The tool keeps one copy in `~/.agents/skills/peerband` and links it into each agent it finds. If npx is unavailable it copies the skill into `~/.agents/skills` and `~/.claude/skills` instead (`--copy` does that directly). `peerband update` refreshes it. Without the CLI: `npx skills add kshvidler/peerband-cli`.
|
|
167
|
+
|
|
168
|
+
**Changing the rules.** To allow or block more for shared users, edit `~/.agents/skills/peerband/SKILL.md`. The agents suggest this themselves when you ask them for different behaviour, because a rule given in chat is forgotten next session. Once you have edited it, `peerband skill` and `peerband update` keep your version; `peerband skill --force` goes back to the shipped one.
|
|
134
169
|
|
|
135
170
|
## Security model
|
|
136
171
|
|
|
172
|
+
- **Every relayed message says who sent it.** The connector puts a `[PeerBand relay]` header in front of each delivered message: from the machine owner, or from a shared user (by email). Anything without an owner role from the server is treated as a shared user. The text after the header is the sender's own, so agents trust only the first line ([agent skill](#agent-skill)).
|
|
137
173
|
- **Outbound only.** The connector dials the relay over a WebSocket; it opens no listening port.
|
|
138
174
|
- **Credential on disk** is stored in `credentials.json`, readable only by your user (mode 0600 inside a 0700 directory).
|
|
139
175
|
- **Messaging is on by default, gated by consent.** An MCP client can call `send_agent_message` only if you approved the `agents:message` scope when you connected it (reading needs only the read scope). Each send needs an idempotency key. A machine can opt out entirely with `peerband connect --read-only` or `"enableWrites": false` in `connector.json`; `peerband status` and the Relay tab show which mode it is in.
|
|
140
|
-
- **Metadata-only activity.** The Relay tab and receipts record what happened (tool, target, outcome), not prompts or output.
|
|
176
|
+
- **Metadata-only activity.** The Relay tab and receipts record what happened (tool, target, outcome), not prompts or output. Agent status events carry the same kind of metadata (status, label, workspace), never output; `peerband notify` notes are sanitized and addressed to the machine owner only.
|
|
141
177
|
- **Logout does not revoke.** `peerband logout` only deletes the local file. To revoke a machine, remove it in the PeerBand dashboard.
|
|
142
178
|
|
|
143
179
|
Agent output can contain secrets, and redaction is best effort. See [SECURITY.md](SECURITY.md) to report a vulnerability.
|
|
@@ -148,6 +184,9 @@ Herdr may resolve a different (older) `node` than your shell. `peerband herdr in
|
|
|
148
184
|
|
|
149
185
|
## Troubleshooting
|
|
150
186
|
|
|
187
|
+
- **Updating.** Run `peerband update`. It installs the latest CLI with `npm install -g`, then the new CLI stops the relay, closes the Relay tab (on Windows its processes keep the plugin files open, which makes Herdr fail with "os error 32 ... being used by another process"), replaces the plugin, clears stale locks and reopens the tab. If you already ran `npm install -g peerband` yourself, `peerband update` (or `peerband herdr install`) brings the plugin up to the same version. `peerband update --check` only reports. From npx or a source checkout it prints the command to run instead.
|
|
188
|
+
- **"Existing helper lock could not be verified" / "Another PeerBand helper still holds the relay lock".** A lock whose owner process has exited is reclaimed automatically (also for locks written by older versions, when no helper answers). If the message names a running process, end it or run `peerband herdr install`, which stops the relay cleanly.
|
|
189
|
+
- **Several PeerBand Relay tabs.** `peerband relay` and Herdr's startup hook focus the existing tab instead of opening another. `peerband herdr install` closes all of them and reopens one.
|
|
151
190
|
- **"PeerBand needs Node.js 22.13 or newer" inside Herdr.** Run `peerband herdr install` from a shell whose `node --version` is 22.13+.
|
|
152
191
|
- **The Relay tab does not open.** Check `peerband status` for the plugin, run `herdr plugin list` (look for a line like `- peerband (PeerBand) enabled [github:kshvidler/peerband-cli@v0.1.0]`), and confirm Herdr is 0.9.3 or newer. Then `peerband relay`.
|
|
153
192
|
- **Windows: Herdr cannot see files in AppData.** Set `PEERBAND_CONFIG_HOME` to a plain folder (for example `D:\peerband`), log in again, and rerun `peerband herdr install` so the plugin picks it up.
|