peerband 0.2.2 → 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
@@ -277,3 +277,60 @@ JSON Schemas for the relay WebSocket messages, the enrollment API and browser de
277
277
  ## License
278
278
 
279
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.