peerband 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,12 @@
1
+ PeerBand
2
+ Copyright 2026 Kirill Shvidler
3
+
4
+ This is an unofficial project, not affiliated with Herdr or Amazon.
5
+ The Herdr protocol schema fixture is derived from herdrdev/herdr 0.9.3,
6
+ copyright its contributors, under Apache License 2.0.
7
+ https://github.com/herdrdev/herdr
8
+
9
+ Original project code is licensed under Apache License 2.0.
10
+ Bundled dependencies (ws, ajv, ajv-formats) retain their own licenses; see
11
+ package-lock.json and the corresponding package license files. Herdr and
12
+ Amazon names identify integration targets and do not imply endorsement.
package/README.md CHANGED
@@ -1,3 +1,155 @@
1
- # Temporary Holding Version
1
+ # PeerBand
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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.
4
+
5
+ ```
6
+ MCP client --> PeerBand relay <== outbound WebSocket == peerband connector --> Herdr
7
+ (Claude, ...) (peerband.com) (on your machine) (your agents)
8
+ ```
9
+
10
+ Your MCP client can list agents, read their status and bounded recent output, and (only if you opt in) send them a message. This project is unofficial and is not affiliated with Herdr or Amazon.
11
+
12
+ ## Requirements
13
+
14
+ - Node.js 22.13 or newer
15
+ - Herdr 0.9.3 or newer (needed for the Relay tab)
16
+ - A PeerBand account (peerband.com)
17
+
18
+ ## Install
19
+
20
+ macOS and Linux:
21
+
22
+ ```sh
23
+ curl -fsSL https://peerband.com/install.sh | sh
24
+ ```
25
+
26
+ Windows PowerShell:
27
+
28
+ ```powershell
29
+ irm https://peerband.com/install.ps1 | iex
30
+ ```
31
+
32
+ Or with npm directly:
33
+
34
+ ```sh
35
+ npm install -g peerband
36
+ ```
37
+
38
+ The installers check Node, install the CLI, run `peerband login` (which opens your browser), and set up the Herdr plugin when Herdr is present.
39
+
40
+ Headless machine or CI with no browser? Pass a one-time grant from the PeerBand dashboard instead: `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`.
41
+
42
+ > PeerBand is not published to npm yet. To try a build, run `npm pack` in this repository and install with `PEERBAND_PACKAGE=/path/to/peerband-0.1.0.tgz` (a tarball path or git URL) set when running the installer.
43
+
44
+ ## Quickstart
45
+
46
+ 1. Install the CLI (above).
47
+ 2. `peerband login` opens your browser. Sign in to PeerBand and confirm the code shown in your terminal.
48
+ 3. `peerband herdr install` to add the plugin to Herdr.
49
+ 4. `peerband relay` to open the PeerBand Relay tab, then press Space to connect.
50
+ 5. 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.
51
+
52
+ ## Logging in
53
+
54
+ ```
55
+ $ peerband login
56
+ To sign in, open this page in your browser:
57
+
58
+ https://peerband.com/device?code=WDJB-MJHT
59
+
60
+ and confirm this code: WDJB-MJHT
61
+
62
+ Opened your browser.
63
+ ⠋ Waiting for approval… (Ctrl+C to cancel)
64
+ ```
65
+
66
+ `peerband login` requests a short code from the server, opens the link, and polls until you approve it in your PeerBand account. Compare the code in the browser with the one in your terminal and only approve a request you just started yourself. The credential is stored in the config home (see below) and never printed; the secret device code is never shown.
67
+
68
+ - The browser is not opened over SSH, without a display, when output is piped, or with `--no-browser`. The link and code are still printed: open the link on any device where you are signed in to PeerBand.
69
+ - **Headless or CI:** create a one-time grant in the dashboard and run `peerband login --grant GRANT` (or set `PEERBAND_GRANT` to keep it out of your shell history).
70
+ - Codes expire after about 10 minutes; run `peerband login` again. Ctrl+C cancels (exit 130). A server without browser sign-in answers with a hint to use `--grant`.
71
+ - `--name NAME` sets the machine name shown in the dashboard (default: hostname); `--server URL` or `PEERBAND_SERVER` targets another server.
72
+
73
+ ## The Relay tab
74
+
75
+ The plugin adds a persistent tab titled `PeerBand Relay [On]` or `[Off]` that shows your account, connection state and a metadata-only activity log.
76
+
77
+ - **Space** or **Enter** (or a click on the control box) toggles the connection.
78
+ - **Q**, **Esc** or **Ctrl+C** asks to close the tab; press it again to confirm. Closing it disconnects the relay.
79
+ - The tab is reopened when Herdr starts. `peerband relay` opens or focuses it at any time.
80
+
81
+ ## Commands
82
+
83
+ | Command | What it does |
84
+ | --- | --- |
85
+ | `peerband login` | Sign in through your browser. Flags: `--no-browser`, `--name NAME`, `--server URL`; headless/CI: `--grant GRANT` |
86
+ | `peerband logout` | Stop a running relay and delete the local credential. Does not revoke it on the server |
87
+ | `peerband status` | Show login, relay and Herdr state. `--json` for machine-readable output |
88
+ | `peerband connect` | Run the connector in the foreground. Flags: `--runtime herdr\|mock`, `--enable-writes`, `--config PATH`, `--server URL` |
89
+ | `peerband relay` | Open or focus the Relay tab in Herdr |
90
+ | `peerband herdr install` | Install (or update) the Herdr plugin |
91
+ | `peerband herdr uninstall` | Stop the relay, remove the plugin and its `settings.json` |
92
+ | `peerband --version`, `help [command]` | Version and help |
93
+
94
+ Exit codes: 0 success, 1 failure, 2 usage error, 3 not logged in, 130 interrupted (Ctrl+C in `peerband connect`).
95
+
96
+ ## Configuration
97
+
98
+ The config home is `PEERBAND_CONFIG_HOME` if set; otherwise `%APPDATA%\peerband` on Windows, and `$XDG_CONFIG_HOME/peerband` or `~/.config/peerband` elsewhere. It holds `credentials.json`, the relay state (`relay-state.json`, `relay-tab.json`), the receipt store (`state/receipts.json`) and the optional `connector.json`. `peerband connect` also reads `PEERBAND_RUNTIME` and `PEERBAND_CONNECTOR_CONFIG` (the `--runtime` and `--config` defaults).
99
+
100
+ `PEERBAND_SERVER` (or `--server`) overrides the default server `https://peerband.com`. Plain `http:` is accepted only for loopback hosts.
101
+
102
+ Optional `connector.json`:
103
+
104
+ ```json
105
+ {
106
+ "allowedAgents": ["claude"],
107
+ "allowedWorkspaces": ["my-project"],
108
+ "enableWrites": false,
109
+ "stateDirectory": "/path/to/state",
110
+ "herdr": {
111
+ "socketPath": "/path/to/herdr-api.sock",
112
+ "schemaPath": "/path/to/herdr-api.schema.json",
113
+ "binary": "/path/to/herdr",
114
+ "machineId": "my-laptop",
115
+ "timeoutMs": 5000
116
+ }
117
+ }
118
+ ```
119
+
120
+ All fields are optional. `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.
121
+
122
+ ## Security model
123
+
124
+ - **Outbound only.** The connector dials the relay over a WebSocket; it opens no listening port.
125
+ - **Credential on disk** is stored in `credentials.json`, readable only by your user (mode 0600 inside a 0700 directory).
126
+ - **Read-only by default.** Listing agents, status and bounded, sanitized output are available. Sending messages requires `--enable-writes` or `"enableWrites": true`, and each send needs an idempotency key.
127
+ - **Metadata-only activity.** The Relay tab and receipts record what happened (tool, target, outcome), not prompts or output.
128
+ - **Logout does not revoke.** `peerband logout` only deletes the local file. To revoke a machine, remove it in the PeerBand dashboard.
129
+
130
+ Agent output can contain secrets, and redaction is best effort. See [SECURITY.md](SECURITY.md) to report a vulnerability.
131
+
132
+ ## How Herdr finds Node
133
+
134
+ Herdr may resolve a different (older) `node` than your shell. `peerband herdr install` therefore records the absolute path of the Node that ran it, in the plugin's `settings.json` (in the directory printed by `herdr plugin config-dir peerband`), along with `PEERBAND_CONFIG_HOME` when it is set. The plugin launcher uses that Node. (The Herdr binary is not recorded: Herdr sets `HERDR_BIN_PATH` for plugin processes itself.) `peerband herdr uninstall` deletes this file. If you change your Node installation, rerun `peerband herdr install`.
135
+
136
+ ## Troubleshooting
137
+
138
+ - **"PeerBand needs Node.js 22.13 or newer" inside Herdr.** Run `peerband herdr install` from a shell whose `node --version` is 22.13+.
139
+ - **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`.
140
+ - **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.
141
+ - **The plugin shows up in other Herdr sessions too.** Herdr's plugin registry is per user, shared by all Herdr sessions, so installing, linking or uninstalling PeerBand affects every session.
142
+ - **"not logged in" (exit 3).** Run `peerband login`.
143
+ - **Revoked.** The machine was removed in the dashboard. Run `peerband login` again.
144
+ - **SSH or a headless machine: no browser opens.** That is intended. Run `peerband login --no-browser`, open the printed link on a device where you are signed in to PeerBand (your laptop or phone), and confirm the code. Or skip the browser entirely with `peerband login --grant GRANT` using a grant from the dashboard.
145
+ - **"The code expired."** You have about 10 minutes to approve. Run `peerband login` again.
146
+ - **"This server doesn't support browser sign-in yet."** Use `peerband login --grant GRANT`.
147
+ - **The browser did not open.** Open the printed link manually; the code is part of the link.
148
+
149
+ ## Protocol
150
+
151
+ JSON Schemas for the relay WebSocket messages, the enrollment API and browser device login are in [`protocol/`](protocol/).
152
+
153
+ ## License
154
+
155
+ Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE). Contributions: [CONTRIBUTING.md](CONTRIBUTING.md).
package/SECURITY.md ADDED
@@ -0,0 +1,27 @@
1
+ # Security policy
2
+
3
+ ## Reporting a vulnerability
4
+
5
+ Please report security issues privately using GitHub's **Report a vulnerability** button on the repository's Security tab (GitHub Security Advisories). Do not open a public issue for a vulnerability.
6
+
7
+ Include the affected version (`peerband --version`), your operating system and Node.js version, and steps to reproduce. Do not include credentials, enrollment grants or private terminal output; redact them first.
8
+
9
+ ## Scope
10
+
11
+ This repository is the PeerBand client: the `peerband` CLI, the connector that dials the relay, and the Herdr plugin. In scope:
12
+
13
+ - credential storage and handling (`credentials.json`, enrollment grants)
14
+ - the outbound relay connection and request handling
15
+ - the opt-in write path (`send_agent_message`) and its authorization checks
16
+ - the installers (`install/install.sh`, `install/install.ps1`)
17
+ - the Herdr plugin launcher and process ownership
18
+
19
+ ## Design notes
20
+
21
+ - The connector only makes outbound connections. It never listens for inbound ones.
22
+ - The credential file is created user-only (mode 0600 in a 0700 directory).
23
+ - Writes are disabled unless you opt in with `--enable-writes` or `enableWrites` in `connector.json`.
24
+ - The activity log is metadata only; prompts and agent output are not persisted.
25
+ - `peerband logout` deletes the local credential but does not revoke it. Revoke machines from your PeerBand dashboard.
26
+
27
+ Agent output returned to an MCP client may still contain secrets; redaction is best effort.