peerband 0.2.8 → 0.3.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.
- package/README.md +73 -7
- package/dist/peerband.mjs +1676 -365
- package/herdr/lifecycle.mjs +17 -5
- package/herdr-plugin.toml +1 -1
- package/package.json +1 -1
- package/skills/peerband/SKILL.md +33 -5
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<a href="https://peerband.com/dashboard">Dashboard</a>
|
|
25
25
|
</p>
|
|
26
26
|
|
|
27
|
-
PeerBand connects ChatGPT, Claude or any MCP client to the coding agents (Claude Code, Codex, Gemini CLI, OpenCode and others) running in [Herdr](https://herdr.dev) on your machine. Ask what they're doing, send the next instruction, share access with a teammate, and get a note in Slack, Discord or your own endpoint when an agent needs you.
|
|
27
|
+
PeerBand connects ChatGPT, Claude or any MCP client to the coding agents (Claude Code, Codex, Gemini CLI, OpenCode and others) running in [Herdr](https://herdr.dev) on your machine: the Herdr terminal app, or [herdr-core](https://github.com/herdrdev/herdr-core) (`hc`) and the Herdr desktop app built on it. Ask what they're doing, send the next instruction, share access with a teammate, and get a note in Slack, Discord or your own endpoint when an agent needs you.
|
|
28
28
|
|
|
29
29
|
This repository is the open-source client: the `peerband` command-line tool and the Herdr plugin. It runs on your machine and connects out to the PeerBand relay; nothing connects in.
|
|
30
30
|
|
|
@@ -47,7 +47,7 @@ This project is unofficial and is not affiliated with Herdr or Amazon.
|
|
|
47
47
|
## Requirements
|
|
48
48
|
|
|
49
49
|
- Node.js 22.13 or newer
|
|
50
|
-
- Herdr 0.9.3 or newer (needed for the Relay tab)
|
|
50
|
+
- Herdr 0.9.3 or newer (needed for the Relay tab), or herdr-core 0.1.21 or newer (`hc`, also installed by the Herdr desktop app)
|
|
51
51
|
- A PeerBand account (peerband.com)
|
|
52
52
|
|
|
53
53
|
## Install
|
|
@@ -107,6 +107,42 @@ No browser available? Pass a one-time grant from the PeerBand dashboard instead:
|
|
|
107
107
|
|
|
108
108
|
The agent tools take an optional `installation_id`; it can be left out when you have one machine, or exactly one online. Clients that support MCP Events can subscribe to agent status changes and notes instead of waiting. Full reference: [peerband.com/docs](https://peerband.com/docs#tools).
|
|
109
109
|
|
|
110
|
+
## The same tools from the CLI
|
|
111
|
+
|
|
112
|
+
Agents on a logged-in machine can use every PeerBand MCP tool with `peerband` commands, without an MCP client. The commands use this machine's login (it acts as your account), send the MCP tool's arguments and print its result as JSON:
|
|
113
|
+
|
|
114
|
+
| Command | MCP tool |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| `peerband machines` | `list_machines` |
|
|
117
|
+
| `peerband agents [--status S] [--workspace W] [--machine NAME] [--limit N] [--cursor C]` | `list_agents` |
|
|
118
|
+
| `peerband agent status ID` | `get_agent_status` |
|
|
119
|
+
| `peerband agent output ID [--lines N] [--bytes N] [--cursor C] [--text]` | `get_agent_output` |
|
|
120
|
+
| `peerband agent send ID "<message>" [--key KEY]` | `send_agent_message` |
|
|
121
|
+
| `peerband agent wait ID [--until idle,blocked] [--timeout SECONDS]` | `wait_for_agent` |
|
|
122
|
+
| `peerband agent ask ID "<message>" [--timeout SECONDS] [--output-lines N] [--key KEY]` | `ask_agent` |
|
|
123
|
+
| `peerband request REQUEST_ID` | `get_request_status` |
|
|
124
|
+
| `peerband env list --here`, `peerband env ACTION --here [...]` | `list_environment`, `control_environment` |
|
|
125
|
+
| `peerband concierge ask\|run\|cancel\|inbox\|reply` | `concierge_*` (Premium) |
|
|
126
|
+
| `peerband tools`, `peerband tool NAME '{"arg": "value"}'` | Any tool by name, with raw JSON arguments |
|
|
127
|
+
|
|
128
|
+
Every command takes `--installation ID` (from `peerband machines`) or `--here` for this machine; without either, the MCP default applies (your only machine, or the only one online). A message or `ask` without `--key` gets a new random idempotency key; if the network fails mid-write the CLI prints the key, so a retry with `--key` never delivers twice.
|
|
129
|
+
|
|
130
|
+
Hand work to another agent and read its answer:
|
|
131
|
+
|
|
132
|
+
```sh
|
|
133
|
+
peerband agents --installation 1f0c… # find the agent id
|
|
134
|
+
peerband agent ask herdr_1a2b… "Run the tests and summarise failures" --installation 1f0c… --timeout 900 --output-lines 60
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Waits use the live event stream, never polling. Up to 50 seconds is one server call; a longer `--timeout` (up to 3600) keeps waiting with more calls, like an MCP task. `reason: "timeout"` is a result, not an error (exit 0); a tool error prints `{"error": {code, message, next_step}}` on stdout and exits 1.
|
|
138
|
+
|
|
139
|
+
Access is the same as for MCP clients:
|
|
140
|
+
|
|
141
|
+
- The login carries read and message access to your machines, like a personal MCP token. Shares keep their role (read-only shares can't send), and a machine that turned messages off refuses them.
|
|
142
|
+
- Environment control reaches **this machine only** (`--here`). Other machines need the dashboard or an MCP client with `environment:control` consent. The connector's `enableEnvironmentControl` switch still applies. There is no shell typing from the CLI.
|
|
143
|
+
- The receiving agent's first line says the message came from a coding agent working for you, through the PeerBand CLI.
|
|
144
|
+
- At most 120 tool calls a minute per machine. Logging out on the server (revoking the machine) stops these commands at once.
|
|
145
|
+
|
|
110
146
|
## Logging in
|
|
111
147
|
|
|
112
148
|
```
|
|
@@ -136,6 +172,28 @@ The plugin adds a persistent tab titled `PeerBand Relay [On]` or `[Off]` that sh
|
|
|
136
172
|
- **Q**, **Esc** or **Ctrl+C** asks to close the tab; press it again to confirm. Closing it disconnects the relay.
|
|
137
173
|
- The tab is reopened when Herdr starts. `peerband relay` opens or focuses it at any time.
|
|
138
174
|
|
|
175
|
+
## herdr-core and the Herdr desktop app
|
|
176
|
+
|
|
177
|
+
[herdr-core](https://github.com/herdrdev/herdr-core) (`hc`) runs terminals and agents that keep running after you close the window; the Herdr desktop app draws spaces, tabs and panes on top of it. herdr-core has no plugin tab, so for it the relay runs in the background:
|
|
178
|
+
|
|
179
|
+
```sh
|
|
180
|
+
peerband relay --core # connect this machine's herdr-core agents
|
|
181
|
+
peerband status # Relay: Connected (herdr-core, in the background)
|
|
182
|
+
peerband relay --stop # disconnect
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
`peerband setup` starts it for you when herdr-core is installed and the Herdr terminal app is not. It keeps running when you close the desktop app or a terminal, and it reconnects when the core restarts. It does not start again by itself after you log out or restart the computer: run `peerband relay --core` again. One relay serves one runtime per machine, so stop a Herdr Relay tab before starting the herdr-core relay.
|
|
186
|
+
|
|
187
|
+
How it works:
|
|
188
|
+
|
|
189
|
+
- The connector talks to the core through `hc connect` (JSON-RPC over stdin and stdout), so it uses the same core, socket and named pipe as `hc` itself, including `HC_SOCKET`. It needs `hc` on `PATH`, `HC_BIN`, or `herdrCore.binary` in `connector.json`.
|
|
190
|
+
- An agent is a live terminal on this machine whose program reports its status through OSC 7501, the way herdr-core and the desktop app see it. Plain shells are not agents. Terminals on machines your core added (`box/t3`) are not shown: run a relay on that machine.
|
|
191
|
+
- Status changes arrive from the core's event stream (`events.subscribe`), never from reading the screen.
|
|
192
|
+
- Spaces and tabs come from the desktop app's layout. Agents that no tab shows, such as ones started with `hc run --bg`, are grouped under **Background**.
|
|
193
|
+
- Messages are typed into the agent's terminal with `terminal.send`, which waits for you to finish an unsent draft (up to a minute). Core refuses to type into a blocked agent. Terminal addresses (`t7`) are never reused, and the connector checks that the same program still runs there right before it sends.
|
|
194
|
+
- `peerband notify` inside a core terminal names its agent through `HC_TERMINAL_ID`.
|
|
195
|
+
- The dashboard shows the layout but cannot change it yet: creating, renaming and closing spaces, tabs and panes is a Herdr terminal app feature for now. Reading a plain shell's output works.
|
|
196
|
+
|
|
139
197
|
## Commands
|
|
140
198
|
|
|
141
199
|
| Command | What it does |
|
|
@@ -145,12 +203,13 @@ The plugin adds a persistent tab titled `PeerBand Relay [On]` or `[Off]` that sh
|
|
|
145
203
|
| `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 |
|
|
146
204
|
| `peerband status` | Show login, relay, messaging and Herdr state, including whether the Herdr plugin is the right one. `--json` for machine-readable output |
|
|
147
205
|
| `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` |
|
|
148
|
-
| `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) |
|
|
149
|
-
| `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 |
|
|
206
|
+
| `peerband connect` | Run the connector in the foreground. Flags: `--runtime herdr\|herdr-core\|mock`, `--read-only`, `--config PATH`, `--server URL` (`--enable-writes` is still accepted but redundant) |
|
|
207
|
+
| `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. `--core` runs the relay in the background for herdr-core instead; `--stop` stops whichever relay is running |
|
|
150
208
|
| `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 |
|
|
151
209
|
| `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 |
|
|
152
|
-
| `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. `--channel NAME` sends it to one of your channels instead, such as `telegram` (see below). `--json` for machine-readable output |
|
|
210
|
+
| `peerband notify "<text>"` | From inside a Herdr pane or a herdr-core terminal: 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. `--channel NAME` sends it to one of your channels instead, such as `telegram` (see below). `--json` for machine-readable output |
|
|
153
211
|
| `peerband channels` | List the channels this machine can send notes to (name, format, state). `--json` for machine-readable output |
|
|
212
|
+
| `peerband machines`, `agents`, `agent`, `request`, `env`, `concierge`, `tools`, `tool` | The PeerBand MCP tools as commands; see [The same tools from the CLI](#the-same-tools-from-the-cli) |
|
|
154
213
|
| `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 |
|
|
155
214
|
| `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) |
|
|
156
215
|
| `peerband --version`, `help [command]` | Version and help |
|
|
@@ -167,6 +226,7 @@ Optional `connector.json`:
|
|
|
167
226
|
|
|
168
227
|
```json
|
|
169
228
|
{
|
|
229
|
+
"runtime": "herdr",
|
|
170
230
|
"allowedAgents": ["claude"],
|
|
171
231
|
"allowedWorkspaces": ["my-project"],
|
|
172
232
|
"enableWrites": false,
|
|
@@ -177,15 +237,19 @@ Optional `connector.json`:
|
|
|
177
237
|
"binary": "/path/to/herdr",
|
|
178
238
|
"machineId": "my-laptop",
|
|
179
239
|
"timeoutMs": 5000
|
|
240
|
+
},
|
|
241
|
+
"herdrCore": {
|
|
242
|
+
"binary": "/path/to/hc",
|
|
243
|
+
"timeoutMs": 10000
|
|
180
244
|
}
|
|
181
245
|
}
|
|
182
246
|
```
|
|
183
247
|
|
|
184
|
-
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.
|
|
248
|
+
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. `runtime` (`herdr` or `herdr-core`) chooses what the connector serves when neither `--runtime` nor `PEERBAND_RUNTIME` is set; `peerband relay --core` always serves herdr-core. The `herdrCore` block is only needed when `hc` is not on `PATH` (the connector also looks in the installer's default folder).
|
|
185
249
|
|
|
186
250
|
## Agent events and notes
|
|
187
251
|
|
|
188
|
-
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:
|
|
252
|
+
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), or to herdr-core's event stream, and sends small `event` frames over the existing relay connection:
|
|
189
253
|
|
|
190
254
|
- `agent.status_changed`: agent id, new and previous status (`idle`, `working`, `blocked`, `done`, `unknown`), label, workspace and revision, exactly as `list_agents` reports them.
|
|
191
255
|
- `agents.changed`: agents appeared, exited or changed occupant; clients list agents again. Also sent once after every reconnect.
|
|
@@ -223,6 +287,8 @@ From then on, agent notes reach your Telegram by default, with alerts when an ag
|
|
|
223
287
|
peerband notify --channel telegram "Tests pass; ready to merge?"
|
|
224
288
|
```
|
|
225
289
|
|
|
290
|
+
Replies to requests marked `via Telegram` should keep that channel. The relayed message supplies the exact agent ID; use `peerband notify --channel telegram --agent ID "<reply>"` to preserve its topic even when a shell or tool process has no usable pane identity. The relay validates that the agent is current and allowed. A stale or disallowed ID is an error; it never falls back to an unattributed note. Explicit-agent replies require an updated CLI and Relay plugin; an older helper refuses the command without sending a note.
|
|
291
|
+
|
|
226
292
|
A note sent with `--channel telegram` arrives even if you turned notes off for Telegram. Until the owner connects Telegram, `telegram` is not in `peerband channels` and the command fails without sending.
|
|
227
293
|
|
|
228
294
|
### Channels
|