peerband 0.2.1 → 0.2.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,13 +1,48 @@
1
- # PeerBand
1
+ <p align="center">
2
+ <a href="https://peerband.com">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kshvidler/peerband-cli/main/docs/assets/peerband-logo-dark.svg">
5
+ <img src="https://raw.githubusercontent.com/kshvidler/peerband-cli/main/docs/assets/peerband-logo.svg" alt="PeerBand" width="72" height="72">
6
+ </picture>
7
+ </a>
8
+ </p>
2
9
 
3
- **A direct line to your coding agents.** PeerBand lets you reach the agents running in [Herdr](https://herdr.dev) from any MCP client (Claude, ChatGPT, your own tools) through your PeerBand account. 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.
10
+ <h1 align="center">PeerBand</h1>
11
+
12
+ <p align="center"><strong>A direct line to your local AI agents.</strong></p>
13
+
14
+ <p align="center">
15
+ <a href="https://www.npmjs.com/package/peerband"><img src="https://img.shields.io/npm/v/peerband?color=111&label=npm" alt="npm version"></a>
16
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-111" alt="Apache-2.0 license"></a>
17
+ <img src="https://img.shields.io/badge/node-%E2%89%A522.13-111" alt="Node.js 22.13 or newer">
18
+ </p>
19
+
20
+ <p align="center">
21
+ <a href="https://peerband.com">Website</a> ·
22
+ <a href="https://peerband.com/guide">Guide</a> ·
23
+ <a href="https://peerband.com/docs">Docs</a> ·
24
+ <a href="https://peerband.com/dashboard">Dashboard</a>
25
+ </p>
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.
28
+
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.
4
30
 
5
31
  ```
6
32
  MCP client --> PeerBand relay <== outbound WebSocket == peerband connector --> Herdr
7
- (Claude, ...) (peerband.com) (on your machine) (your agents)
33
+ (ChatGPT, Claude) (peerband.com) (on your machine) (your agents)
8
34
  ```
9
35
 
10
- Your MCP client can list agents, read their status and bounded recent output, and send them a message (sending needs your approval of the `agents:message` permission when you connect the client, and a machine can opt out; see [Security model](#security-model)). This project is unofficial and is not affiliated with Herdr or Amazon.
36
+ ## What you can do
37
+
38
+ - **Check in from anywhere.** Add one URL to ChatGPT, Claude or Claude Code and ask what your agents are doing. Your client lists agents and reads their status and bounded recent output.
39
+ - **Send the next instruction.** Messages go to an explicit agent, only with your consent (`agents:message`), and every message tells the agent who sent it.
40
+ - **Share a machine.** `peerband share` creates an invite link for a teammate or a review bot: read only, or read and message. Your agent treats guests as coworkers.
41
+ - **Get told when an agent needs you.** Agents send you notes with `peerband notify`. Webhooks deliver status changes and notes to Slack, Discord, or your own endpoint, signed with [Standard Webhooks](https://www.standardwebhooks.com). Send a note to one webhook with `--channel`.
42
+ - **No polling.** The connector streams agent status changes, so the dashboard and MCP clients read output only when something changed. `wait_for_agent` waits for an agent to finish or block without reading its output.
43
+ - **Safe by default.** Outbound connection only, metadata-only activity logs, one switch to make a machine read only, and best-effort secret redaction.
44
+
45
+ This project is unofficial and is not affiliated with Herdr or Amazon.
11
46
 
12
47
  ## Requirements
13
48
 
@@ -56,6 +91,21 @@ No browser available? Pass a one-time grant from the PeerBand dashboard instead:
56
91
 
57
92
  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
93
  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.
94
+ 3. Ask your client something like "What are my agents doing?".
95
+
96
+ ## MCP tools
97
+
98
+ | Tool | Scope | What it does |
99
+ | --- | --- | --- |
100
+ | `list_machines` | `agents:read` | Your machines (and machines shared with you), their installation IDs and whether each is online. Call it first |
101
+ | `list_agents` | `agents:read` | The agents on a machine, with status, label, workspace and Herdr location (space and tab) |
102
+ | `get_agent_status` | `agents:read` | The status of one agent: `idle`, `working`, `blocked`, `done` or `unknown` |
103
+ | `get_agent_output` | `agents:read` | A bounded excerpt of an agent's recent output |
104
+ | `wait_for_agent` | `agents:read` | Wait up to 50 seconds for an agent to reach a status (default: idle, blocked or done), without polling or reading output |
105
+ | `send_agent_message` | `agents:message` | Send a message to an explicit agent ID. Fails with `write_disabled` on a read-only machine |
106
+ | `get_request_status` | `agents:read` | The delivery receipt of an earlier message |
107
+
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).
59
109
 
60
110
  ## Logging in
61
111
 
@@ -151,6 +201,16 @@ peerband notify "Migration finished, 3 tests failing"
151
201
 
152
202
  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).
153
203
 
204
+ ### Webhooks
205
+
206
+ Add webhooks in the PeerBand dashboard under Webhooks. Each one has a name, an HTTPS URL, a format and a filter:
207
+
208
+ - **Formats.** `slack` and `discord` post a one-line message to an incoming webhook. `standard` posts a JSON envelope signed with [Standard Webhooks](https://www.standardwebhooks.com) (`webhook-id`, `webhook-timestamp`, `webhook-signature` headers), so you can verify it with any Standard Webhooks library and the secret shown once when you create the webhook.
209
+ - **Events.** `agent.status_changed` (filter by status, for example only `blocked`), `agent.notified` (notes), `machine.online` and `machine.offline` (held for 30 seconds, so a short network drop pages nobody). The Test button sends `webhook.test`. Webhooks go to the machine owner only, never to people you shared the machine with.
210
+ - **Machines.** All your machines, or a chosen few.
211
+
212
+ Failed deliveries are retried for about a day with backoff, and the dashboard shows every attempt. Webhook payloads carry metadata and note text only, never terminal output.
213
+
154
214
  ### Channels
155
215
 
156
216
  A channel is one of your PeerBand webhooks, addressed by its name: for example a Slack or Discord incoming webhook, or your own endpoint. Add them in the PeerBand dashboard under Webhooks; the webhook's name is the channel name. A note always shows in the dashboard. Without a channel, it also goes to every webhook that takes notes; with one, it goes to that one webhook instead (the dashboard shows which channel it was sent to):
@@ -217,3 +277,60 @@ JSON Schemas for the relay WebSocket messages, the enrollment API and browser de
217
277
  ## License
218
278
 
219
279
  Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE). Contributions: [CONTRIBUTING.md](CONTRIBUTING.md).
280
+
281
+ ## Control Herdr remotely
282
+
283
+ The MCP tools `list_environment` and `control_environment` let the machine owner
284
+ open a workspace or tab, split a pane, rename or focus layout items, and start an
285
+ agent without messaging an existing agent first. They require a separate
286
+ `environment:control` OAuth grant and explicit machine opt-in. Existing read and
287
+ message grants do not gain this permission; reconnect an MCP client that requests
288
+ the new scope and approve its consent screen. Legacy personal MCP tokens do not
289
+ have environment-control access.
290
+
291
+ Set `"enableEnvironmentControl": true` in your `connector.json` and restart the
292
+ PeerBand Relay tab. For a foreground connection, use
293
+ `peerband connect --enable-environment-control`. `--read-only` or
294
+ `"enableWrites": false` disables all environment controls. Environment controls
295
+ are unavailable when `allowedAgents` or `allowedWorkspaces` is configured, since
296
+ those allowlists cannot authorize creating new layout targets. Shared users
297
+ cannot use these tools, even on a share that allows messages.
298
+
299
+ 1. Call `list_machines` and select an owned `installation_id` explicitly.
300
+ 2. Call `list_environment` with that installation to find workspace, tab and pane
301
+ IDs, including panes with no agent. Labels are untrusted user text. Each list
302
+ is bounded to 50 entries and reports truncation.
303
+ 3. Call `control_environment` with the installation, an action, its fields below,
304
+ and a random `idempotency_key` of 16?256 characters.
305
+ 4. Use `get_request_status` on the same installation with the returned
306
+ `requestId` (as `request_id`) until the receipt settles. A completed creation
307
+ returns IDs in `result.workspace`, `result.tab`, `result.rootPane` or
308
+ `result.pane`. `delivered` confirms the Herdr action was acknowledged; it does
309
+ not mean an agent has finished a task.
310
+
311
+ | Action | Fields |
312
+ | --- | --- |
313
+ | `workspace.create` | `cwd`, optional `label` |
314
+ | `tab.create` | `workspace_id`, `cwd`, optional `label` |
315
+ | `pane.split` | `pane_id`, `cwd`, `direction` (`right`, `down`, `left`, `up`) |
316
+ | `agent.start` | `pane_id`, `name`, `kind` (for example `codex`, `claude`, `gemini`) |
317
+ | `workspace.rename`, `tab.rename`, `pane.rename` | Matching ID and `label` |
318
+ | `workspace.focus`, `tab.focus`, `pane.focus` | Matching ID |
319
+
320
+ `cwd` is an absolute path on the remote machine. Creation preserves the local
321
+ user's focus. Start an agent only in an idle shell pane; Herdr checks whether the
322
+ pane can accept it. To start in a new tab, create the tab first, check its receipt,
323
+ and pass `result.rootPane.paneId` to `agent.start`. Then call `list_agents` for its
324
+ PeerBand agent ID and use `send_agent_message` to provide the task.
325
+
326
+ Reuse a key only for the same operation. Receipts survive connector restarts and
327
+ retain only hashes, delivery metadata and bounded result metadata. A lost
328
+ acknowledgement or interrupted write becomes `delivery_unknown` and is never
329
+ replayed automatically. Inspect the environment before deciding what to do next;
330
+ a fresh key can duplicate an uncertain action. Receipts expire after seven days,
331
+ so keys are not a permanent operation history.
332
+
333
+ The API does not accept shell commands, raw keystrokes, native agent arguments,
334
+ environment-variable overrides, close/stop actions or permission-dialog responses.
335
+ Older servers can ignore the new capability header; older connectors are detected
336
+ before the server routes environment tools.