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 +121 -4
- package/dist/peerband.mjs +486 -233
- package/herdr-plugin.toml +1 -1
- package/package.json +33 -7
- package/protocol/README.md +29 -0
- package/protocol/relay-messages.schema.json +18 -2
- package/skills/peerband/SKILL.md +20 -0
package/herdr-plugin.toml
CHANGED
package/package.json
CHANGED
|
@@ -1,16 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "peerband",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "PeerBand CLI and Herdr plugin: reach your local coding agents from any MCP client through your PeerBand account",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"homepage": "https://peerband.com",
|
|
8
|
-
"repository": {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/kshvidler/peerband-cli.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/kshvidler/peerband-cli/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"peerband",
|
|
17
|
+
"herdr",
|
|
18
|
+
"mcp",
|
|
19
|
+
"coding-agents",
|
|
20
|
+
"cli"
|
|
21
|
+
],
|
|
22
|
+
"bin": {
|
|
23
|
+
"peerband": "dist/peerband.mjs"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=22.13.0"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/",
|
|
30
|
+
"herdr/",
|
|
31
|
+
"herdr-plugin.toml",
|
|
32
|
+
"protocol/",
|
|
33
|
+
"install/",
|
|
34
|
+
"skills/",
|
|
35
|
+
"README.md",
|
|
36
|
+
"LICENSE",
|
|
37
|
+
"NOTICE",
|
|
38
|
+
"SECURITY.md"
|
|
39
|
+
],
|
|
14
40
|
"scripts": {
|
|
15
41
|
"build": "node scripts/build.mjs",
|
|
16
42
|
"typecheck": "tsc --noEmit",
|
package/protocol/README.md
CHANGED
|
@@ -41,3 +41,32 @@ The client only reports metadata (tool, target id, outcome, latency) to its loca
|
|
|
41
41
|
The protocol has no explicit version field today. Changes are additive: new optional fields, new `tool` values and new frame types may appear, so implementations must ignore unknown fields and unknown frame types on received messages. The `event` frame is such an addition: servers that do not know it ignore it, and the `x-peerband-features` upgrade header tells servers that do which clients emit events. A breaking change would use a new endpoint path or a `hello` negotiation message and be documented here with a bump of the schema `$id`. Schemas are published with each client release in `protocol/`.
|
|
42
42
|
|
|
43
43
|
The tests in `test/protocol.test.ts` validate messages produced by the real relay client against these schemas.
|
|
44
|
+
|
|
45
|
+
### Environment control (optional capability)
|
|
46
|
+
|
|
47
|
+
A connector implementing environment tools advertises `environment-control` in
|
|
48
|
+
the comma-separated `x-peerband-features` upgrade header, alongside `events` when
|
|
49
|
+
available. A server must check this feature before routing `list_environment` or
|
|
50
|
+
`control_environment`. The standard request/response envelope and 15-second
|
|
51
|
+
request deadline are unchanged. Old servers can ignore the header value.
|
|
52
|
+
|
|
53
|
+
Both tools require `principal.role: "owner"`, `environment:control` in the verified
|
|
54
|
+
principal's scopes, and the local `enableEnvironmentControl` opt-in. Read-only
|
|
55
|
+
mode and configured agent/workspace allowlists deny both tools. The server must
|
|
56
|
+
resolve ownership and require an explicit installation before dispatch. Guest
|
|
57
|
+
shares never grant environment authority.
|
|
58
|
+
|
|
59
|
+
`list_environment` takes `{}` and returns `workspaces`, `tabs`, `panes` (at most 50
|
|
60
|
+
each), with corresponding `workspacesTruncated`, `tabsTruncated`,
|
|
61
|
+
`panesTruncated` booleans. Rows carry only selected, bounded metadata: IDs, labels,
|
|
62
|
+
paths, agent kind and state. No terminal contents, argv, tokens or environment
|
|
63
|
+
variables leave the machine through these tools.
|
|
64
|
+
|
|
65
|
+
`control_environment` accepts camelCase arguments, as listed in the README action
|
|
66
|
+
table (`workspaceId`, `tabId`, `paneId`, `idempotencyKey` on the wire). The connector
|
|
67
|
+
independently validates the action-specific fields and the installed Herdr schema.
|
|
68
|
+
Creation always sends `focus: false`; agent startup never accepts native arguments.
|
|
69
|
+
A write returns a durable receipt, queried through `get_request_status`; successful
|
|
70
|
+
receipts include bounded metadata in `result`, with camelCase result IDs. Receipt
|
|
71
|
+
states and uncertainty rules match message delivery. Neither the relay nor the
|
|
72
|
+
connector retries a mutation after disconnection or startup reconciliation.
|
|
@@ -11,6 +11,21 @@
|
|
|
11
11
|
{ "$ref": "#/$defs/event" }
|
|
12
12
|
],
|
|
13
13
|
"$defs": {
|
|
14
|
+
"environmentControlArgs": {
|
|
15
|
+
"description": "Owner-only, opt-in actions; no native args, shell, implicit targets, close/stop or env overrides. cwd must be an absolute path on the remote machine. See README for supported agent kinds.",
|
|
16
|
+
"oneOf": [
|
|
17
|
+
{"type": "object", "required": ["action", "idempotencyKey", "cwd"], "additionalProperties": false, "properties": {"action": {"const": "workspace.create"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "cwd": {"type": "string", "minLength": 1, "maxLength": 2048}, "label": {"type": "string", "minLength": 1, "maxLength": 128}}},
|
|
18
|
+
{"type": "object", "required": ["action", "idempotencyKey", "workspaceId", "cwd"], "additionalProperties": false, "properties": {"action": {"const": "tab.create"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "workspaceId": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]{0,255}$"}, "cwd": {"type": "string", "minLength": 1, "maxLength": 2048}, "label": {"type": "string", "minLength": 1, "maxLength": 128}}},
|
|
19
|
+
{"type": "object", "required": ["action", "idempotencyKey", "paneId", "cwd", "direction"], "additionalProperties": false, "properties": {"action": {"const": "pane.split"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "paneId": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]{0,255}$"}, "cwd": {"type": "string", "minLength": 1, "maxLength": 2048}, "direction": {"enum": ["right", "down", "left", "up"]}}},
|
|
20
|
+
{"type": "object", "required": ["action", "idempotencyKey", "paneId", "name", "kind"], "additionalProperties": false, "properties": {"action": {"const": "agent.start"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "paneId": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]{0,255}$"}, "name": {"type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[a-z][a-z0-9_-]{0,31}$"}, "kind": {"type": "string", "minLength": 1, "maxLength": 32}}},
|
|
21
|
+
{"type": "object", "required": ["action", "idempotencyKey", "workspaceId"], "additionalProperties": false, "properties": {"action": {"const": "workspace.focus"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "workspaceId": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]{0,255}$"}}},
|
|
22
|
+
{"type": "object", "required": ["action", "idempotencyKey", "workspaceId", "label"], "additionalProperties": false, "properties": {"action": {"const": "workspace.rename"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "workspaceId": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]{0,255}$"}, "label": {"type": "string", "minLength": 1, "maxLength": 128}}},
|
|
23
|
+
{"type": "object", "required": ["action", "idempotencyKey", "tabId"], "additionalProperties": false, "properties": {"action": {"const": "tab.focus"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "tabId": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]{0,255}$"}}},
|
|
24
|
+
{"type": "object", "required": ["action", "idempotencyKey", "tabId", "label"], "additionalProperties": false, "properties": {"action": {"const": "tab.rename"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "tabId": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]{0,255}$"}, "label": {"type": "string", "minLength": 1, "maxLength": 128}}},
|
|
25
|
+
{"type": "object", "required": ["action", "idempotencyKey", "paneId"], "additionalProperties": false, "properties": {"action": {"const": "pane.focus"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "paneId": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]{0,255}$"}}},
|
|
26
|
+
{"type": "object", "required": ["action", "idempotencyKey", "paneId", "label"], "additionalProperties": false, "properties": {"action": {"const": "pane.rename"}, "idempotencyKey": {"type": "string", "minLength": 16, "maxLength": 256}, "paneId": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]{0,255}$"}, "label": {"type": "string", "minLength": 1, "maxLength": 128}}}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
14
29
|
"agentStatus": { "enum": ["idle", "working", "blocked", "done", "unknown"] },
|
|
15
30
|
"event": {
|
|
16
31
|
"title": "client -> server: agent event",
|
|
@@ -77,16 +92,17 @@
|
|
|
77
92
|
},
|
|
78
93
|
"request": {
|
|
79
94
|
"title": "server -> client: tool request",
|
|
95
|
+
"allOf": [{"if": {"properties": {"tool": {"const": "control_environment"}}}, "then": {"properties": {"args": {"$ref": "#/$defs/environmentControlArgs"}}}}, {"if": {"properties": {"tool": {"const": "list_environment"}}}, "then": {"properties": {"args": {"type": "object", "maxProperties": 0}}}}],
|
|
80
96
|
"description": "At most 32 outstanding per connection; the client answers within 15 seconds. Requests are never replayed.",
|
|
81
97
|
"type": "object",
|
|
82
98
|
"required": ["type", "id", "tool", "args", "principal"],
|
|
83
99
|
"properties": {
|
|
84
100
|
"type": { "const": "request" },
|
|
85
101
|
"id": { "type": "string", "minLength": 1, "maxLength": 256 },
|
|
86
|
-
"tool": { "enum": ["list_agents", "get_agent_status", "get_agent_output", "get_request_status", "send_agent_message"] },
|
|
102
|
+
"tool": { "enum": ["list_agents", "get_agent_status", "get_agent_output", "get_request_status", "send_agent_message", "list_environment", "control_environment"] },
|
|
87
103
|
"args": {
|
|
88
104
|
"type": "object",
|
|
89
|
-
"description": "camelCase arguments: list_agents {machine, workspace, status, cursor, limit}; get_agent_status {agentId}; get_agent_output {agentId, lines, bytes, cursor}; send_agent_message {agentId, message, idempotencyKey}; get_request_status {requestId}."
|
|
105
|
+
"description": "camelCase arguments: list_agents {machine, workspace, status, cursor, limit}; get_agent_status {agentId}; get_agent_output {agentId, lines, bytes, cursor}; send_agent_message {agentId, message, idempotencyKey}; get_request_status {requestId}; list_environment {}; control_environment {action, idempotencyKey, workspaceId?, tabId?, paneId?, cwd?, label?, direction?, name?, kind?}. Environment tools require the environment-control upgrade feature, owner role and environment:control scope."
|
|
90
106
|
},
|
|
91
107
|
"principal": {
|
|
92
108
|
"type": "object",
|
package/skills/peerband/SKILL.md
CHANGED
|
@@ -93,3 +93,23 @@ peerband notify "Migration finished, 3 tests failing"
|
|
|
93
93
|
- Notes go to the machine owner only, never to people the machine is shared with.
|
|
94
94
|
- The note names your agent automatically (from the pane). It needs the relay to be running and connected; if the command fails ("No PeerBand relay is running", "not connected"), carry on and report the result in your normal output instead of retrying in a loop.
|
|
95
95
|
- **Channels.** The owner can set up channels (their webhooks, such as a Slack channel, each with a name). Every note shows in the owner's dashboard. Without `--channel` it also goes to every webhook that takes notes; that is the right default. With `--channel NAME` it goes to that one webhook instead of all of them. Use `peerband notify --channel NAME "<text>"` only when the owner asked for a specific channel, or a project's instructions name one. Run `peerband channels` to see the names and which are active. If the channel is unknown, inactive, or the server or relay does not support channels, the command fails and says why: don't guess other names; send the note without `--channel` or tell the user.
|
|
96
|
+
|
|
97
|
+
## Create tabs, panes and agents remotely
|
|
98
|
+
|
|
99
|
+
Use `list_environment` and `control_environment` for owner-requested Herdr layout
|
|
100
|
+
changes and agent startup. These need explicit `installation_id`, separate
|
|
101
|
+
`environment:control` OAuth consent, and `enableEnvironmentControl: true` in the
|
|
102
|
+
machine's connector config. Message shares never grant this authority. Ask the
|
|
103
|
+
owner to enable it when disabled; do not edit their config on a guest's request.
|
|
104
|
+
|
|
105
|
+
List machines, then list that machine's environment for exact IDs. Use
|
|
106
|
+
`tab.create` with `workspace_id` and an absolute remote `cwd`, check the receipt
|
|
107
|
+
with `get_request_status`, then `agent.start` in its `result.rootPane.paneId`
|
|
108
|
+
(`pane_id`, `name`, `kind`). Next call `list_agents` for a PeerBand agent ID and
|
|
109
|
+
`send_agent_message` for its task. Other supported actions create workspaces,
|
|
110
|
+
split panes, and rename or focus workspaces/tabs/panes. Creation preserves focus.
|
|
111
|
+
|
|
112
|
+
Each control needs a fresh random idempotency key; reuse that key for retries of
|
|
113
|
+
the identical operation. Inspect receipts before continuing a dependent action.
|
|
114
|
+
`delivery_unknown` requires inspection, never an automatic retry with a new key.
|
|
115
|
+
No shell, raw keys, agent flags, stop/close or permission approvals are exposed.
|