session-peer 0.2.0 → 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 CHANGED
@@ -14,303 +14,102 @@
14
14
  <!-- docs-contract: stable-release-source; package=session-peer; bin=session-peer; node=22.13+/24; python-reference=1.0.2 -->
15
15
 
16
16
  **Find and message running Claude Code and Codex sessions, locally or over SSH.**
17
- This TypeScript client runs on Node.js without Python.
17
+ A Node.js client that runs without Python. Package and command: `session-peer`.
18
18
 
19
- This guide describes **0.2.0**. The npm package and CLI command are both **`session-peer`**. This
20
- project does not provide a Relay server or hosted service.
19
+ ## Demo
21
20
 
22
- ## Quick start
21
+ ![Actual Codex to Claude Code request and reply with TypeScript session-peer 0.2.1](https://raw.githubusercontent.com/abruption/session-peer-ts/main/docs/assets/session-peer-ts-v0.2.1-roundtrip.gif)
23
22
 
24
- Use Node **22.13+ within 22.x or 24.x**. Check which `session-peer` your PATH
25
- selects if the Python CLI is already installed; both packages use that command.
23
+ Actual local request and explicit `ACK DEMO-READY` reply using npm 0.2.1. CLI/message excerpts are re-rendered, identifiers redacted and timing edited; this is not a screen recording. Submission alone is not an ACK.
26
24
 
27
- ```sh
28
- npm install --global --ignore-scripts session-peer@0.2.0
29
- session-peer --version # session-peer 0.2.0 (typescript)
30
- session-peer list --agent claude --json
31
- session-peer send --to CLAUDE_PID --message 'Please review the API contract.' --dry-run --json
32
- ```
33
-
34
- 1. List sessions and replace `CLAUDE_PID` with the exact PID you selected.
35
- 2. Run the send command with `--dry-run`; nothing is submitted.
36
- 3. When delivery is intended, run that command once without `--dry-run`.
37
- 4. If acknowledgement matters, ask for an explicit reply in the message and
38
- verify the receiver's TUI response separately. `posted` / `queued` confirms
39
- submission only. See [What success means](#what-success-means).
40
-
41
- ### CLI usability in 0.2.0
42
-
43
- Version 0.2.0 adds `list --help`, `send --help`, `doctor --help` and explicit
44
- `--output-format text`. Output selection remains required: use `--json` or
45
- `--output-format json|text`. Parse errors use JSON; valid text requests render
46
- operation results/errors as text. SSH always exchanges JSON internally.
47
-
48
- `send --to TARGET "message" --json` accepts one positional body. Do not combine
49
- it with `--message`/`-m`; omit the body or use `-` for stdin, and use `--` before
50
- an option-looking positional body. Empty/whitespace bodies are refused before
51
- adding the sender envelope. Claude names use exact Unicode 14.0.0 default full
52
- casefold (no normalization/fuzzy matching); collisions require a PID. This
53
- source behavior is not retroactively available in the published 0.1.0 package.
54
-
55
-
56
- ## What it does
57
-
58
- - Discover local Claude/Codex sessions and known Codex homes (0.2.0; see below).
59
- - Validate a destination with `--dry-run`, then submit one message to its native
60
- inbox or queue. Codex normally requires a unique, stable live writer.
61
- - Use the same commands over SSH to an explicitly installed remote client.
62
- - Accept structured Reply-To URIs as destinations and provide JSON results.
63
- - Refuse ambiguous targets and uncertain ownership; never automatically retry
64
- an uncertain submission.
65
-
66
- Not implemented: Relay transport, MCP, wake/resume,
67
- Antigravity, automatic updates, or human text output. Unsupported commands fail explicitly; this is not a general orchestrator.
68
-
69
- Planned client gaps are tracked in the [versioned compatibility matrix and npm migration guide](PARITY.md); a plan is not an available feature. Relay server/hosted-service delivery remains outside this client's scope.
70
-
71
- ### Unified listing in 0.2.0
72
-
73
- After building this source, `node dist/cli.js list --json` combines Claude and
74
- Codex; `list --agent codex --json` searches known homes. Published npm **0.1.0**
75
- still requires an explicit agent and a home for Codex listing; the install and
76
- explicit list/send forms also work with that older release.
77
-
78
- Sources are default `~/.codex`, `CODEX_HOME`, immediate macOS Orca account homes,
79
- and the JSON array `SESSION_PEER_CODEX_HOMES`. `--codex-home` pins Codex listing
80
- and bypasses unrelated inventory errors; `--agent claude` skips Codex entirely.
81
- Aliases are deduplicated, but the same UUID in different homes stays separate.
82
- Use each row's `codexHome` when sending. Optional absent homes are not failures;
83
- explicitly configured missing/invalid homes produce partial results and exit 1,
84
- retaining readable rows. Listing never selects a writer or submits a message.
85
- See the [source listing contract](PARITY.md#source-unified-listing-contract--16--020)
86
- for ordering, diagnostics, `--all` and SSH behavior.
87
-
88
- Source Codex send now selects the unique stable live writer when `--codex-home`
89
- is omitted. Explicit homes still check all known competitors. Inactive queueing
90
- requires both `--codex-home HOME` and `--allow-inactive-codex-home`, a saved thread,
91
- and verified inactive candidates; it never wakes or resumes a session. Dry-run
92
- submits nothing. JSON adds sanitized `codexHomeResolution` and, when supplied by
93
- native queue output, `queueId`; neither confirms consumption. See the
94
- [selection contract](PARITY.md#source-codex-home-selection--17--020).
95
- Published **0.1.0** still requires an explicit live home and has no inactive opt-in.
96
- On SSH, use the same 0.2.0 build on both ends.
97
-
98
- ## Requirements
99
-
100
- macOS, Linux or native Windows; Node **22.13+ within 22.x or 24.x**. Node 26 is not supported.
101
- The native flock dependency needs a matching prebuilt binary (x64/arm64); this
102
- is not a pure-JavaScript package. Codex sends need `codex`; macOS/Linux also
103
- need `lsof` and `ps`. Windows uses native lock and Restart Manager inspection.
104
- Claude needs a live TUI with an accessible native inbox. SSH requires OpenSSH,
105
- existing key/host trust and the **same client version** on the destination.
106
-
107
- ## Build from source
108
-
109
- To run a reviewed source checkout instead of the published npm package, build
110
- it and optionally install its local tarball:
111
-
112
- ```sh
113
- git clone https://github.com/abruption/session-peer-ts.git
114
- cd session-peer-ts
115
- npm ci --ignore-scripts
116
- npm run build
117
- node dist/cli.js --version
118
- npm pack --ignore-scripts
119
- # Optional global install: first check which session-peer your PATH selects.
120
- npm install --global --ignore-scripts ./session-peer-0.2.0.tgz
121
- session-peer --version
122
- ```
123
-
124
- Expected: `session-peer 0.2.0 (typescript)`. Keep the `./...tgz` path to
125
- select the locally built artifact. Check the checkout version before using
126
- these commands for a later release.
127
-
128
- ## Existing installations
129
-
130
- Other implementations may also install `session-peer`. Check `type -a session-peer`
131
- and `command -v session-peer` before and after installation. Choose one on PATH,
132
- or call this build explicitly with `node /absolute/path/dist/cli.js`. Do not use
133
- `--force` to overwrite another manager's files. No Python package, skill or service
134
- is installed, removed or reconfigured automatically. To remove this npm install,
135
- run `npm uninstall --global session-peer` and recheck PATH.
136
-
137
- On Windows PowerShell, inspect competing commands with
138
- `Get-Command session-peer -All`. To avoid replacing the Python CLI, use an isolated prefix:
139
-
140
- ```powershell
141
- npm ci --ignore-scripts
142
- npm run build
143
- npm pack --ignore-scripts
144
- npm install --prefix "$env:TEMP\session-peer-ts-source" --ignore-scripts .\session-peer-0.2.0.tgz
145
- & "$env:TEMP\session-peer-ts-source\node_modules\.bin\session-peer.cmd" --version
146
- # Later: npm uninstall --prefix "$env:TEMP\session-peer-ts-source" session-peer
147
- ```
148
-
149
- ## Use
25
+ After installation, list sessions and replace `CLAUDE_PID` with the exact PID you selected:
150
26
 
151
27
  ```sh
152
28
  session-peer list --agent claude --json
153
- session-peer list --agent codex --codex-home "$HOME/.codex" --json
154
- session-peer send --to CLAUDE_PID --message 'Please review the API contract.' --dry-run --json
155
- session-peer send --to codex:THREAD_UUID --codex-home "$HOME/.codex" --message 'Please review the API contract.' --dry-run --json
156
- ```
157
-
158
- Remove `--dry-run` only when delivery is intended. Omit `--message` or use
159
- `--message -` for UTF-8 stdin. `--all` includes stale/archived records for listing;
160
- it does not authorize sending. Claude accepts a PID, `claude:PID`, or an
161
- unambiguous Unicode 14.0.0 casefolded name. Use a PID for collisions. Codex
162
- send requires a full UUID; home selection follows the guards above; `--codex-bin` selects an executable.
163
- Output requires `--json` or `--output-format json|text`.
164
-
165
- ### Another machine over SSH
166
-
167
- ```sh
168
- session-peer send --host user@machine --remote-bin /absolute/path/session-peer \
169
- --to CLAUDE_PID --message 'Please review the API contract.' --dry-run --json
29
+ session-peer send --to CLAUDE_PID --message 'Please review the API contract and reply.' --dry-run --json
170
30
  ```
171
31
 
172
- The default remote command is `session-peer` on remote PATH. An absolute
173
- `--remote-bin` can select a wrapper using supported Node. The handshake checks
174
- the TypeScript marker and exact version; a different implementation is refused.
175
- SSH uses BatchMode and StrictHostKeyChecking. It never accepts new host keys,
176
- installs a remote runtime or invokes Python as a fallback. Messages travel in a
177
- JSON stdin request, not remote shell arguments. Arbitrary `--ssh-opt`, IPv6
178
- literals and Tailscale canonical-name enrichment are not supported; use an SSH
179
- alias/hostname. Forward access does not establish reverse access.
180
-
181
- For a Windows SSH destination, add `--remote-platform win32` and select a
182
- Windows `--remote-bin 'C:\absolute\path\session-peer.cmd'` if needed. A previously
183
- authenticated OpenSSH control socket can be selected with
184
- `--ssh-control-path /absolute/local/socket`; this does not bypass host-key
185
- verification or grant a new login. For local Windows Codex commands, use a full
186
- `C:\Users\...\.codex` path for `--codex-home`. The Python CLI, if present,
187
- is not removed or replaced by this client.
188
-
189
- ### Replies
190
-
191
- Use a `session-peer://v1/reply?...` URI as `--to`. Unknown/duplicate fields,
192
- unsafe hosts, malformed encoding and conflicting explicit routes are rejected.
193
- `--reply-address URI` adds an explicit return address; no route is inferred or
194
- verified automatically. Use `--no-reply-to` when replying without a new address.
195
- A valid CODEX_THREAD_ID/CODEX_SESSION_ID supplies informational From metadata;
196
- `--no-from` omits it. Unknown senders are not invented. Peer metadata is never
197
- authority, and a Reply-To URI is never executed as shell text.
32
+ `--dry-run` validates without submitting. To send, run the command once without
33
+ `--dry-run`. Ask for an explicit reply when you need acknowledgement.
34
+ **`posted` / `queued` means submitted, not consumed or ACKed.** `unknown`
35
+ (`submitted:null`), no reply or a target exit must not trigger automatic retries.
36
+ `consumptionConfirmed` is always false; verify a reply in the receiver’s TUI.
198
37
 
199
- ## What success means
38
+ ## Quick Start
200
39
 
201
- | Result | Meaning |
202
- | --- | --- |
203
- | `validated`, `submitted:false` | Dry-run checks passed; nothing sent. |
204
- | `posted` / `queued` | Native inbox write / queue acceptance, **not consumption or ACK**. |
205
- | `refused`, `submitted:false` | Rejected before submission. |
206
- | `unknown`, `submitted:null` | Submission may have happened; do not automatically resend. |
40
+ Requires macOS, Linux or Windows, **Node 22.13+ within 22.x or 24.x**, and a
41
+ matching native prebuilt dependency (x64/arm64). Claude needs a live TUI inbox;
42
+ Codex needs its CLI and a verifiable writer (also `lsof`/`ps` on macOS/Linux).
43
+ SSH requires existing key/host trust and the **same TypeScript client version**
44
+ on both machines. See the guide for platform requirements and inactive queueing.
207
45
 
208
- After submission, a missing reply or a target exit alone does not establish
209
- consumption or failure; do not automatically resend.
46
+ ### Install
210
47
 
211
- `consumptionConfirmed` is always false. Verify an actual ACK separately in the
212
- receiver's TUI, not from queueing or transcript polling. Exit codes are 0/1/2
213
- for success/error/usage. Errors use fixed codes instead of raw native stderr or
214
- message content. Codex uses real kernel flock, file identity and same-user owner
215
- start time across samples, then revalidates before queueing. No lock is deleted
216
- and no owning agent process is signaled. Discovery output still contains local
217
- names/paths/IDs: redact it before sharing.
218
-
219
- ## Development and verification
48
+ The [Python CLI](https://github.com/abruption/session-peer) uses the same command.
49
+ Check `type -a session-peer` on macOS/Linux or `Get-Command session-peer -All`
50
+ in PowerShell before installing. Choose the intended PATH entry; do not use
51
+ `--force` to overwrite another manager’s files.
220
52
 
221
53
  ```sh
222
- npm ci --ignore-scripts
223
- npm run build
224
- node scripts/check-repository.mjs
225
- SESSION_PEER_PYTHON_ROOT=/path/to/python-reference npm test
226
- npm run test:package
227
- npm audit
54
+ npm install --global --ignore-scripts session-peer@0.3.0
55
+ session-peer --version
228
56
  ```
229
57
 
230
- Python is only the development conformance oracle (v1.0.2 commit
231
- `47c23713d0a2a3c11ebde6186afd8c43489b8b65`), never a runtime dependency. Tests also
232
- need a C compiler and lsof for the POSIX contract suite. CI uses Node 22/24 on
233
- macOS, Linux and Windows. macOS/Linux run the full contract suite and package
234
- checks against the pinned reference. Windows x64 runs build/type checks, native
235
- Claude inbox and held/free lock fixtures, writer ownership/revalidation races,
236
- CLI queue outcomes, PowerShell/.cmd SSH framing through an isolated fake endpoint,
237
- package install/native-load/uninstall checks and audit. These are fixture checks;
238
- Windows does not run the POSIX/Python reference suite.
239
- The Windows x64/Node 24 live ACKs are separate, one-shot evidence. Temporary
240
- SQLite, Unix inbox and real lock fixtures are distinct from
241
- the dedicated real-TUI evidence in [VALIDATION.md](VALIDATION.md). A green fixture
242
- test is not an ACK. Package tests inspect contents, repeat-pack hashes, clean
243
- install and uninstall. The native dependency normally has an install script;
244
- the verified prebuilt path uses `--ignore-scripts`. SQLite read-only readers may
245
- participate in WAL shared-memory bookkeeping; they are not snapshots.
58
+ Expected: `session-peer 0.3.0 (typescript)`. For isolated installation, source
59
+ builds, Windows and removal, see the detailed guide below.
246
60
 
247
- See [CONTRIBUTING.md](CONTRIBUTING.md), [RELEASING.md](RELEASING.md) and
248
- [SECURITY.md](SECURITY.md). Future publication remains manual and requires
249
- separate approval. Licensed under [MIT](LICENSE).
61
+ Optional `sp` shorthand ships with 0.3.0 and later (not 0.2.1 or earlier) and is
62
+ never enabled automatically. See [explicit activation and collisions](docs/shorthand.md).
250
63
 
251
- ## Package release
64
+ ### Update
252
65
 
253
- This document describes 0.2.0; public availability is determined by the registry.
254
- On 2026-09-28 KST, the verified prior release was 0.1.0 and the preview tag was
255
- 0.1.0-preview.1. Check the exact version and current tags before installing:
66
+ Use npm for an npm-managed installation. Check the available tags and review
67
+ the target version, then install that exact version; this example updates an
68
+ older npm installation to 0.3.0. The CLI does not install updates;
69
+ `session-peer update --check` only reports them.
256
70
 
257
71
  ```sh
258
- npm view session-peer@0.2.0 version dist.integrity
259
72
  npm view session-peer dist-tags
73
+ npm install --global --ignore-scripts session-peer@0.3.0
74
+ session-peer --version
260
75
  ```
261
76
 
262
- The immutable 0.1.0 archive retained pre-publication README wording. This
263
- archive uses versioned feature descriptions; dated release evidence remains in
264
- [VALIDATION.md](VALIDATION.md#public-010--2026-09-27-kst).
265
-
266
- The release workflow uses Trusted Publisher OIDC staging and a maintainer's
267
- separate 2FA approval. A staged upload is not a public release. See
268
- [RELEASING.md](RELEASING.md) for the process.
269
-
270
- ## Related project
271
-
272
- [Python session-peer](https://github.com/abruption/session-peer) is maintained
273
- and released independently; its own optional features and installation guide
274
- remain there (for example `pipx install session-peer`). Its command is also
275
- `session-peer`, so apply the PATH guidance above. This client does not depend on
276
- that installation or claim complete feature/flag parity.
277
-
278
- ### Read-only diagnostics in 0.2.0
279
-
280
- ```sh
281
- session-peer doctor --json
282
- session-peer doctor --agent codex --codex-home /absolute/home --json
283
- session-peer doctor --host user@host --json
284
- ```
285
-
286
- This source command is not in published npm 0.1.0. Diagnostic success (`ok:true`,
287
- exit 0) is separate from agent readiness (`ready` and per-agent/home results).
288
- It inspects bounded metadata and executable paths without executing Codex,
289
- connecting to inboxes, acquiring writer locks or submitting messages. Windows
290
- inbox readiness means a live process advertises a pipe; it does not prove the
291
- pipe exists or accepts connections. `capabilities` explicitly excludes
292
- wake/wait/ACK and consumption confirmation. Optional TS skill metadata checks
293
- never install anything. See [diagnostic boundaries](PARITY.md#source-read-only-doctor--18--020).
294
- SSH requires the same source build on both ends.
295
- ## Agent skill: explicit installation
296
-
297
- The separate `session-peer-ts` companion skill is tracked in [companion PR #14](https://github.com/abruption/session-peer-skill/pull/14); it is not a new npm or skill-tag release. It supports the published 0.1.0 baseline, detects the TypeScript implementation marker, and checks help before using development capabilities. The Python `session-peer` skill remains separate.
298
-
299
- Review the [exact skill source](https://github.com/abruption/session-peer-skill/tree/081cc3c1d16a394bd92824333f4bc61c36951799/session-peer-ts),
300
- then choose the agent and scope. This example selects **Codex, current project**;
301
- run from that project directory. For Claude Code use `--agent claude-code`.
302
- For user scope add `--global` consistently to add/list/remove. Inspect any existing
303
- `session-peer-ts` copy for local edits before approving its replacement. Codex's
304
- `.agents/skills` directory is shared with other clients that discover that path.
305
-
306
- ```sh
307
- npx -y skills@1.7.0 add https://github.com/abruption/session-peer-skill/tree/081cc3c1d16a394bd92824333f4bc61c36951799/session-peer-ts --skill session-peer-ts --agent codex --copy --yes
308
- npx -y skills@1.7.0 list --agent codex --json
309
- npx -y skills@1.7.0 remove session-peer-ts --agent codex --yes
310
- ```
311
-
312
- For a pinned update, review another exact commit and repeat `add` with the same
313
- agent/scope. Restart the agent if its catalog is cached. Runtime and skill
314
- lifecycles are independent: npm `--ignore-scripts` works, no postinstall invokes
315
- Skills CLI, and installing this skill does not overwrite the Python skill or
316
- install a runtime. See [compatibility and validation](PARITY.md#source-ts-skill-guidance--25--020).
77
+ The companion skill is installed and updated separately; npm installation
78
+ does not install a skill. Review its pinned-source instructions in the guide.
79
+
80
+ <!-- Preserve links to the former detailed sections; their contents are in the guide. -->
81
+ <a id="cli-usability-in-020"></a>
82
+ <a id="what-it-does"></a>
83
+ <a id="unified-listing-in-020"></a>
84
+ <a id="requirements"></a>
85
+ <a id="build-from-source"></a>
86
+ <a id="existing-installations"></a>
87
+ <a id="use"></a>
88
+ <a id="another-machine-over-ssh"></a>
89
+ <a id="replies"></a>
90
+ <a id="what-success-means"></a>
91
+ <a id="development-and-verification"></a>
92
+ <a id="package-release"></a>
93
+ <a id="related-project"></a>
94
+ <a id="read-only-diagnostics-in-020"></a>
95
+ <a id="agent-skill-explicit-installation"></a>
96
+
97
+ ## Docs
98
+
99
+ - [User guide](docs/guide.md) — CLI options, discovery, Codex homes, SSH, replies, installation variants and skill setup.
100
+ - [API reference (English)](docs/api.md).
101
+ - [Compatibility, migration and planned features](PARITY.md).
102
+ - [Release evidence and platform validation](VALIDATION.md).
103
+ - [Development and contributions](CONTRIBUTING.md).
104
+ - [Release process](RELEASING.md).
105
+
106
+ ## License
107
+
108
+ Licensed under the [MIT License](LICENSE).
109
+
110
+ ## Support and security
111
+
112
+ For usage questions and reproducible bugs, [open an issue](https://github.com/abruption/session-peer-ts/issues).
113
+ For vulnerabilities, use [private reporting](https://github.com/abruption/session-peer-ts/security/advisories/new)
114
+ or [support@abruption.dev](mailto:support@abruption.dev?subject=%5Bsession-peer-ts%5D%20Security).
115
+ Read [SECURITY.md](SECURITY.md) and redact credentials, messages and personal paths.