session-peer 0.1.0-preview.1 → 0.2.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
@@ -1,29 +1,99 @@
1
1
  # session-peer (TypeScript)
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/session-peer?logo=npm)](https://www.npmjs.com/package/session-peer)
4
+ [![npm downloads per week](https://img.shields.io/npm/dw/session-peer?logo=npm)](https://www.npmjs.com/package/session-peer)
5
+ [![npm downloads per month](https://img.shields.io/npm/dm/session-peer?logo=npm)](https://www.npmjs.com/package/session-peer)
6
+ [![CI](https://github.com/abruption/session-peer-ts/actions/workflows/ci.yml/badge.svg)](https://github.com/abruption/session-peer-ts/actions/workflows/ci.yml)
7
+ [![Node support](https://img.shields.io/node/v/session-peer?logo=node.js)](https://www.npmjs.com/package/session-peer)
8
+ [![MIT license](https://img.shields.io/npm/l/session-peer)](LICENSE)
9
+
10
+ <sub>npm download statistics can lag behind package publication.</sub>
11
+
3
12
  [English](README.md) | [한국어](README.ko.md) | [日本語](README.ja.md) | [简体中文](README.zh-CN.md)
4
13
 
5
- <!-- docs-contract: preview-candidate; package=session-peer; bin=session-peer; node=22.13+/24; python-reference=1.0.2 -->
14
+ <!-- docs-contract: stable-release-source; package=session-peer; bin=session-peer; node=22.13+/24; python-reference=1.0.2 -->
15
+
16
+ **Find and message running Claude Code and Codex sessions, locally or over SSH.**
17
+ This TypeScript client runs on Node.js without Python.
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.
21
+
22
+ ## Quick start
23
+
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.
26
+
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
6
42
 
7
- Send messages to running **Claude Code and Codex sessions**, locally or on
8
- another machine over SSH. This TypeScript client runs on Node.js without Python.
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.
9
54
 
10
- **Preview release candidate; publication requires separate approval.** Package name:
11
- `session-peer`. CLI command: **`session-peer`**. This project does not provide
12
- a Relay server or hosted service.
13
55
 
14
56
  ## What it does
15
57
 
16
- - Discover local sessions and explicitly selected Codex homes.
58
+ - Discover local Claude/Codex sessions and known Codex homes (0.2.0; see below).
17
59
  - Validate a destination with `--dry-run`, then submit one message to its native
18
- inbox or queue. Codex requires a unique, stable live writer.
60
+ inbox or queue. Codex normally requires a unique, stable live writer.
19
61
  - Use the same commands over SSH to an explicitly installed remote client.
20
62
  - Accept structured Reply-To URIs as destinations and provide JSON results.
21
63
  - Refuse ambiguous targets and uncertain ownership; never automatically retry
22
64
  an uncertain submission.
23
65
 
24
- Not implemented: Relay transport, MCP, wake/resume, inactive queueing,
25
- Antigravity, automatic updates, implicit multi-agent discovery, or human text
26
- output. Unsupported commands fail explicitly; this is not a general orchestrator.
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.
27
97
 
28
98
  ## Requirements
29
99
 
@@ -34,11 +104,10 @@ need `lsof` and `ps`. Windows uses native lock and Restart Manager inspection.
34
104
  Claude needs a live TUI with an accessible native inbox. SSH requires OpenSSH,
35
105
  existing key/host trust and the **same client version** on the destination.
36
106
 
37
- ## Install
107
+ ## Build from source
38
108
 
39
- Do **not** run registry `npm install -g session-peer` or `npx session-peer`
40
- until an official npm release verifies ownership and provenance. Today, build
41
- a reviewed source checkout and optionally install its local tarball:
109
+ To run a reviewed source checkout instead of the published npm package, build
110
+ it and optionally install its local tarball:
42
111
 
43
112
  ```sh
44
113
  git clone https://github.com/abruption/session-peer-ts.git
@@ -48,16 +117,15 @@ npm run build
48
117
  node dist/cli.js --version
49
118
  npm pack --ignore-scripts
50
119
  # Optional global install: first check which session-peer your PATH selects.
51
- npm install --global --ignore-scripts ./session-peer-0.1.0-preview.1.tgz
120
+ npm install --global --ignore-scripts ./session-peer-0.2.0.tgz
52
121
  session-peer --version
53
122
  ```
54
123
 
55
- Expected: `session-peer 0.1.0-preview.1 (typescript)`. Keep the `./...tgz` path;
56
- it selects the locally built artifact, not an unverified registry package.
57
- After a separately approved npm release, the package will remain `session-peer`
58
- while the command remains `session-peer`; follow that release's version/dist-tag.
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.
59
127
 
60
- ### Existing installations
128
+ ## Existing installations
61
129
 
62
130
  Other implementations may also install `session-peer`. Check `type -a session-peer`
63
131
  and `command -v session-peer` before and after installation. Choose one on PATH,
@@ -73,9 +141,9 @@ On Windows PowerShell, inspect competing commands with
73
141
  npm ci --ignore-scripts
74
142
  npm run build
75
143
  npm pack --ignore-scripts
76
- npm install --prefix "$env:TEMP\session-peer-ts-preview" --ignore-scripts .\session-peer-0.1.0-preview.1.tgz
77
- & "$env:TEMP\session-peer-ts-preview\node_modules\.bin\session-peer.cmd" --version
78
- # Later: npm uninstall --prefix "$env:TEMP\session-peer-ts-preview" session-peer
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
79
147
  ```
80
148
 
81
149
  ## Use
@@ -90,9 +158,9 @@ session-peer send --to codex:THREAD_UUID --codex-home "$HOME/.codex" --message '
90
158
  Remove `--dry-run` only when delivery is intended. Omit `--message` or use
91
159
  `--message -` for UTF-8 stdin. `--all` includes stale/archived records for listing;
92
160
  it does not authorize sending. Claude accepts a PID, `claude:PID`, or an
93
- unambiguous ASCII name, case-insensitively. Use a PID for Unicode names. Codex
94
- requires a full UUID and explicit home; `--codex-bin` selects an executable.
95
- Output requires `--json` or `--output-format json`.
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`.
96
164
 
97
165
  ### Another machine over SSH
98
166
 
@@ -116,7 +184,7 @@ authenticated OpenSSH control socket can be selected with
116
184
  `--ssh-control-path /absolute/local/socket`; this does not bypass host-key
117
185
  verification or grant a new login. For local Windows Codex commands, use a full
118
186
  `C:\Users\...\.codex` path for `--codex-home`. The Python CLI, if present,
119
- is not removed or replaced by this preview.
187
+ is not removed or replaced by this client.
120
188
 
121
189
  ### Replies
122
190
 
@@ -137,6 +205,9 @@ authority, and a Reply-To URI is never executed as shell text.
137
205
  | `refused`, `submitted:false` | Rejected before submission. |
138
206
  | `unknown`, `submitted:null` | Submission may have happened; do not automatically resend. |
139
207
 
208
+ After submission, a missing reply or a target exit alone does not establish
209
+ consumption or failure; do not automatically resend.
210
+
140
211
  `consumptionConfirmed` is always false. Verify an actual ACK separately in the
141
212
  receiver's TUI, not from queueing or transcript polling. Exit codes are 0/1/2
142
213
  for success/error/usage. Errors use fixed codes instead of raw native stderr or
@@ -158,8 +229,14 @@ npm audit
158
229
 
159
230
  Python is only the development conformance oracle (v1.0.2 commit
160
231
  `47c23713d0a2a3c11ebde6186afd8c43489b8b65`), never a runtime dependency. Tests also
161
- need a C compiler and lsof for the POSIX contract suite. CI pins the reference
162
- and covers macOS/Linux/Windows × Node 22/24. Temporary
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
163
240
  SQLite, Unix inbox and real lock fixtures are distinct from
164
241
  the dedicated real-TUI evidence in [VALIDATION.md](VALIDATION.md). A green fixture
165
242
  test is not an ACK. Package tests inspect contents, repeat-pack hashes, clean
@@ -168,23 +245,27 @@ the verified prebuilt path uses `--ignore-scripts`. SQLite read-only readers may
168
245
  participate in WAL shared-memory bookkeeping; they are not snapshots.
169
246
 
170
247
  See [CONTRIBUTING.md](CONTRIBUTING.md), [RELEASING.md](RELEASING.md) and
171
- [SECURITY.md](SECURITY.md). Publication requires separate approval; no automatic
172
- npm publish is enabled. Licensed under [MIT](LICENSE).
248
+ [SECURITY.md](SECURITY.md). Future publication remains manual and requires
249
+ separate approval. Licensed under [MIT](LICENSE).
173
250
 
174
- ## npm release installation
251
+ ## Package release
175
252
 
176
- Only after the official release and registry integrity/provenance verification,
177
- install the exact preview below. It is not the stable `latest` channel. Before
178
- publication, keep using the local tarball instructions above.
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:
179
256
 
180
257
  ```sh
181
- npm install --global --ignore-scripts session-peer@0.1.0-preview.1
182
- session-peer --version
258
+ npm view session-peer@0.2.0 version dist.integrity
259
+ npm view session-peer dist-tags
183
260
  ```
184
261
 
185
- The manual workflow initially uses a short-lived bootstrap token. Later versions
186
- use Trusted Publisher OIDC staging and require a maintainer's 2FA approval;
187
- a staged upload is not a public release. See [RELEASING.md](RELEASING.md).
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.
188
269
 
189
270
  ## Related project
190
271
 
@@ -193,3 +274,43 @@ and released independently; its own optional features and installation guide
193
274
  remain there (for example `pipx install session-peer`). Its command is also
194
275
  `session-peer`, so apply the PATH guidance above. This client does not depend on
195
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).
package/README.zh-CN.md CHANGED
@@ -1,21 +1,50 @@
1
1
  # session-peer (TypeScript)
2
2
 
3
+ [![npm 版本](https://img.shields.io/npm/v/session-peer?logo=npm)](https://www.npmjs.com/package/session-peer)
4
+ [![npm 每周下载](https://img.shields.io/npm/dw/session-peer?logo=npm)](https://www.npmjs.com/package/session-peer)
5
+ [![npm 每月下载](https://img.shields.io/npm/dm/session-peer?logo=npm)](https://www.npmjs.com/package/session-peer)
6
+ [![CI](https://github.com/abruption/session-peer-ts/actions/workflows/ci.yml/badge.svg)](https://github.com/abruption/session-peer-ts/actions/workflows/ci.yml)
7
+ [![Node 支持](https://img.shields.io/node/v/session-peer?logo=node.js)](https://www.npmjs.com/package/session-peer)
8
+ [![MIT 许可证](https://img.shields.io/npm/l/session-peer)](LICENSE)
9
+
10
+ <sub>npm 下载统计可能晚于软件包发布才更新。</sub>
11
+
3
12
  [English](README.md) | [한국어](README.ko.md) | [日本語](README.ja.md) | [简体中文](README.zh-CN.md)
4
13
 
5
- <!-- docs-contract: preview-candidate; package=session-peer; bin=session-peer; node=22.13+/24; python-reference=1.0.2 -->
14
+ <!-- docs-contract: stable-release-source; package=session-peer; bin=session-peer; node=22.13+/24; python-reference=1.0.2 -->
6
15
 
7
16
  向正在运行的 **Claude Code 和 Codex 会话**发送消息,支持本机和跨机器 SSH。这是运行于 Node.js 的 TypeScript 客户端,不需要 Python。
8
17
 
9
- **预览发布候选,正式上传需另行批准。**包名为 `session-peer`,CLI 命令为 **`session-peer`**。本项目不提供 Relay 服务器或托管服务。
18
+ **这是 0.2.0 使用指南。**包名为 `session-peer`,CLI 命令为 **`session-peer`**。本项目不提供 Relay 服务器或托管服务。
10
19
 
11
20
  ## 功能与边界
12
21
 
13
- - 发现本机会话以及显式指定的 Codex home。
22
+ - 发现本机 Claude/Codex 会话与已知 Codex home(面向 0.2.0 的功能,见下文)。
14
23
  - 先用 `--dry-run` 验证目标,再向原生 inbox / queue 提交一次消息。Codex 要求唯一且稳定的活跃 writer。
15
24
  - 通过 SSH 调用远端已安装的同版本客户端,支持结构化 Reply-To URI 和 JSON 输出。
16
25
  - 目标或进程归属不明确时拒绝操作;不会自动重试结果不确定的提交。
17
26
 
18
- 未实现 Relay 传输、MCP、wake/resume、非活跃会话排队、Antigravity、自动更新、隐式多代理发现及面向人的文本输出。不支持的命令会明确失败;这不是通用编排器。
27
+ 未实现 Relay 传输、MCP、wake/resume、Antigravity、自动更新及面向人的文本输出。不支持的命令会明确失败;这不是通用编排器。
28
+
29
+ 客户端功能计划见 [版本化兼容性表与 npm 迁移指南](PARITY.md);计划不代表当前支持。提供 Relay 服务器或托管服务不属于本客户端范围。
30
+
31
+ ### 0.2.0 统一列表
32
+
33
+ 构建后,`node dist/cli.js list --json` 合并列出 Claude/Codex,`list --agent codex --json` 查找已知 home。公开 npm **0.1.0** 仍要求显式 agent,以及 Codex 列表所需的 home;0.2.0 也支持显式命令格式。
34
+
35
+ 范围仅限默认 `~/.codex`、`CODEX_HOME`、macOS Orca 下的直接账户 home,以及 JSON 数组 `SESSION_PEER_CODEX_HOMES`。`--codex-home` 固定 Codex 列表并绕过无关配置错误;`--agent claude` 完全跳过 Codex 探索。同一 home 的别名合并,不同 home 的相同 UUID 保留。发送时使用每行的 `codexHome`。可选 home 缺失不是错误;显式 home 缺失或无效会保留成功读取的行,并返回退出码 1。列表不会选择 writer 或提交消息。[列表契约](PARITY.md#source-unified-listing-contract--16--020)说明排序、诊断、`--all` 和 SSH 行为。0.2.0的 Codex 发送在省略 `--codex-home` 时选择唯一且稳定的 live writer;显式 home 仍会检查所有已知竞争 home。非活动队列提交需要已保存的线程、所有候选均确认非活动,以及 `--codex-home HOME --allow-inactive-codex-home`,不会执行 wake/resume。Dry-run 不提交。JSON 新增诊断 `codexHomeResolution`,且仅在原生输出提供时包含 `queueId`;两者均不代表消费确认。请参阅[选择契约](PARITY.md#source-codex-home-selection--17--020)。公开 **0.1.0** 仍需要显式 live home,且没有非活动许可选项。SSH 两端请使用同一0.2.0 构建。
36
+
37
+ ### 0.2.0 CLI 易用性
38
+
39
+ 0.2.0新增 `list --help`、`send --help`、`doctor --help` 和 `--output-format text`。
40
+ 仍须明确选择输出格式:`--json` 或 `--output-format json|text`。解析错误
41
+ 使用 JSON;有效 text 请求的操作结果和错误使用文本。SSH 内部始终传输 JSON。
42
+ 支持 `send --to TARGET "message" --json` 位置正文,不可同时使用
43
+ `--message`/`-m`。省略正文或使用 `-` 从 stdin 读取;选项形式的位置正文
44
+ 前须加 `--`。空或纯空白正文在添加发件人信息前被拒绝。Claude 名称使用
45
+ Unicode 14.0.0 默认 full casefold 精确匹配,不进行规范化或模糊匹配;
46
+ 冲突时须指定 PID。这些源码功能不会追溯到已经发布的 0.1.0 包。
47
+
19
48
 
20
49
  ## 环境要求
21
50
 
@@ -23,7 +52,23 @@ macOS、Linux 或 Windows native;Node **22.x 中的 22.13 及以上,或 24.x
23
52
 
24
53
  ## 安装
25
54
 
26
- 在正式 npm 发布确认包归属和来源之前,**不要**运行注册表安装 `npm install -g session-peer` 或 `npx session-peer`。目前请构建经审查的源码,并按需安装本地 tarball:
55
+ 已验证的稳定版可在 Node 22.x 的 22.13 及以上或 24.x 上安装。Python CLI 也使用同一个命令名;若已有安装,请先检查 PATH。
56
+
57
+ ```sh
58
+ npm install --global --ignore-scripts session-peer@0.2.0
59
+ session-peer --version
60
+ ```
61
+
62
+ 预期输出:`session-peer 0.2.0 (typescript)`。
63
+
64
+ 1. 用 `session-peer list --agent claude --json` 查找目标并选择准确 PID。
65
+ 2. 用 `session-peer send --to CLAUDE_PID --message 'Please reply after checking.' --dry-run --json` 验证,不提交。
66
+ 3. 确定发送时使用选定 PID,移除同一命令中的 `--dry-run`,只执行一次。
67
+ 4. 若需要 ACK,在消息中明确请求回复,并单独确认目标 TUI 的响应。`posted` / `queued` 仅表示提交。
68
+
69
+ ### 从源码构建
70
+
71
+ 若要使用经审查的源码而非公开的 npm 包,请构建源码,并按需安装本地 tarball:
27
72
 
28
73
  ```sh
29
74
  git clone https://github.com/abruption/session-peer-ts.git
@@ -33,17 +78,17 @@ npm run build
33
78
  node dist/cli.js --version
34
79
  npm pack --ignore-scripts
35
80
  # 可选:全局安装前先检查 PATH 选择的现有命令
36
- npm install --global --ignore-scripts ./session-peer-0.1.0-preview.1.tgz
81
+ npm install --global --ignore-scripts ./session-peer-0.2.0.tgz
37
82
  session-peer --version
38
83
  ```
39
84
 
40
- 预期输出:`session-peer 0.1.0-preview.1 (typescript)`。保留 `./...tgz` 路径,确保安装的是本地构建产物,而非未验证的注册表包。将来另行批准 npm 发布后,包名和命令名仍如上所示,请按该次发布的版本 / dist-tag 安装。
85
+ 保留 `./...tgz` 路径以选择本地产物。使用后续版本的源码时,请先确认检出的版本。
41
86
 
42
87
  ### 与已有安装共存
43
88
 
44
89
  安装前后用 `type -a session-peer` 和 `command -v session-peer` 检查实际执行项。其他实现也可能提供同名命令;请选择 PATH 上的一种,或显式运行 `node /absolute/path/dist/cli.js`。不要用 `--force` 覆盖其他管理器的文件。本包不会自动安装、删除或调整 Python 包、技能或服务。卸载使用 `npm uninstall --global session-peer`,随后再次检查 PATH。
45
90
 
46
- 在 Windows PowerShell 中用 `Get-Command session-peer -All` 检查已有命令。为了不替换 Python CLI,可先执行 `npm ci --ignore-scripts`、`npm run build`、`npm pack --ignore-scripts`,再用 `npm install --prefix "$env:TEMP\session-peer-ts-preview" --ignore-scripts .\session-peer-0.1.0-preview.1.tgz` 安装到隔离目录。以 `& "$env:TEMP\session-peer-ts-preview\node_modules\.bin\session-peer.cmd" --version` 验证,并可用 `npm uninstall --prefix "$env:TEMP\session-peer-ts-preview" session-peer` 卸载。
91
+ 在 Windows PowerShell 中用 `Get-Command session-peer -All` 检查已有命令。为了不替换 Python CLI,可先执行 `npm ci --ignore-scripts`、`npm run build`、`npm pack --ignore-scripts`,再用 `npm install --prefix "$env:TEMP\session-peer-ts-source" --ignore-scripts .\session-peer-0.2.0.tgz` 安装到隔离目录。以 `& "$env:TEMP\session-peer-ts-source\node_modules\.bin\session-peer.cmd" --version` 验证,并可用 `npm uninstall --prefix "$env:TEMP\session-peer-ts-source" session-peer` 卸载。
47
92
 
48
93
  ## 使用
49
94
 
@@ -54,7 +99,7 @@ session-peer send --to CLAUDE_PID --message 'Please review the API contract.' --
54
99
  session-peer send --to codex:THREAD_UUID --codex-home "$HOME/.codex" --message 'Please review the API contract.' --dry-run --json
55
100
  ```
56
101
 
57
- 只有确定要投递时才移除 `--dry-run`。省略 `--message` 或使用 `--message -` 会读取 UTF-8 stdin。`--all` 仅让列表包含陈旧 / 已归档记录,不授予发送权限。Claude 支持 PID、`claude:PID` 或唯一的 ASCII 名称(不区分大小写);Unicode 名称请改用 PID。Codex 需要完整 UUID 和显式 home;`--codex-bin` 可指定可执行文件。输出必须选择 `--json` 或 `--output-format json`。
102
+ 只有确定要投递时才移除 `--dry-run`。省略 `--message` 或使用 `--message -` 会读取 UTF-8 stdin。`--all` 仅让列表包含陈旧 / 已归档记录,不授予发送权限。Claude 支持 PID、`claude:PID` 或唯一的 Unicode 14.0.0 casefold 名称;冲突时使用 PID。Codex 发送需要完整 UUID,home 遵循上述选择规则;`--codex-bin` 可指定可执行文件。输出必须选择 `--json` 或 `--output-format json|text`。
58
103
 
59
104
  ### 跨机器 SSH
60
105
 
@@ -80,6 +125,8 @@ session-peer send --host user@machine --remote-bin /absolute/path/session-peer \
80
125
  | `refused`, `submitted:false` | 提交前被拒绝。 |
81
126
  | `unknown`, `submitted:null` | 可能已经提交,不要自动重发。 |
82
127
 
128
+ 提交后没有回复或目标退出,都不能单独证明消息已消费或失败。不要自动重发。
129
+
83
130
  `consumptionConfirmed` 始终为 false。必须在目标 TUI 中另行确认实际 ACK,不可由排队或轮询 transcript 推断。退出码 0/1/2 分别表示成功/错误/用法错误。错误只返回固定代码,不返回原生 stderr 或消息内容。Codex 使用真实内核 flock、文件身份和同用户进程开始时间进行多次核验,排队前再次检查。不删除 lock,也不向拥有它的代理进程发送信号。发现结果仍包含本地名称、路径、ID,分享前请脱敏。
84
131
 
85
132
  ## 开发与验证
@@ -93,21 +140,59 @@ npm run test:package
93
140
  npm audit
94
141
  ```
95
142
 
96
- Python 只用作开发时的兼容性基准(v1.0.2,`47c23713d0a2a3c11ebde6186afd8c43489b8b65`),不是运行时依赖。POSIX 契约测试还需要 C 编译器和 lsof。CI 固定基准提交,覆盖 macOS/Linux/Windows × Node 22/24。临时 SQLite、Unix inbox、真实锁 fixture 与 [VALIDATION.md](VALIDATION.md) 中专用真实 TUI 的证据分开记录;fixture 通过不是 ACK。包测试检查文件清单、重复打包哈希、全新安装与卸载。原生依赖通常有安装脚本,已验证的预编译路径使用 `--ignore-scripts`。SQLite 只读连接仍可能参与 WAL 共享内存管理,不能视为快照。
143
+ Python 只用作开发时的兼容性基准(v1.0.2,`47c23713d0a2a3c11ebde6186afd8c43489b8b65`),不是运行时依赖。POSIX 契约测试还需要 C 编译器和 lsof。CI 在三种 OS 上使用 Node 22/24。macOS/Linux 对固定基准执行完整契约与包检查;Windows x64 执行构建、类型检查、原生 Claude inbox、持有/空闲锁、writer 归属与提交前竞争、CLI 队列结果、隔离模拟 SSH 目标的实际 PowerShell/.cmd 帧处理、包安装/原生加载/卸载及 audit。这些属于 fixture 检查;Windows 不运行 POSIX/Python 参考测试套件。Windows x64/Node 24 实机 ACK 是单独的一次性证据。临时 SQLite、Unix inbox、真实锁 fixture 与 [VALIDATION.md](VALIDATION.md) 中专用真实 TUI 的证据分开记录;fixture 通过不是 ACK。包测试检查文件清单、重复打包哈希、全新安装与卸载。原生依赖通常有安装脚本,已验证的预编译路径使用 `--ignore-scripts`。SQLite 只读连接仍可能参与 WAL 共享内存管理,不能视为快照。
97
144
 
98
- 参见 [CONTRIBUTING.md](CONTRIBUTING.md)、[RELEASING.md](RELEASING.md) 和 [SECURITY.md](SECURITY.md)。发布需单独批准,未启用自动 npm 发布。采用 [MIT](LICENSE) 许可证。
145
+ 参见 [CONTRIBUTING.md](CONTRIBUTING.md)、[RELEASING.md](RELEASING.md) 和 [SECURITY.md](SECURITY.md)。后续版本的发布需单独批准,未启用自动 npm 发布。采用 [MIT](LICENSE) 许可证。
99
146
 
100
- ## npm 发布后的安装
147
+ ## npm 版本
101
148
 
102
- 仅在官方发布以及注册表完整性、provenance 验证完成后,安装以下精确预览版本。它不是稳定版 `latest`。公开前继续使用上述本地 tarball 安装。
149
+ 本文描述 0.2.0 功能;公开状态请查询注册表。
150
+ 2026-09-28 KST 验证的前一稳定版为 0.1.0,preview 标签为 0.1.0-preview.1。
103
151
 
104
152
  ```sh
105
- npm install --global --ignore-scripts session-peer@0.1.0-preview.1
106
- session-peer --version
153
+ npm view session-peer@0.2.0 version dist.integrity
154
+ npm view session-peer dist-tags
107
155
  ```
108
156
 
109
- 手动工作流仅在首次发布时使用短期 bootstrap 令牌。以后通过 Trusted Publisher OIDC 上传至 staging,由维护者使用 2FA 批准。staging 成功不代表已经公开发布。参见 [RELEASING.md](RELEASING.md)。
157
+ 0.1.0 tarball 的历史措辞差异和验证保留在[日期记录](VALIDATION.md#public-010--2026-09-27-kst)。
158
+ 发布使用 OIDC staging 和单独的 2FA 批准。Staging 成功不等于公开发布。
159
+ 请参阅 [RELEASING.md](RELEASING.md)。
110
160
 
111
161
  ## 相关项目
112
162
 
113
163
  [Python session-peer](https://github.com/abruption/session-peer) 独立维护和发布,其可选功能与安装指南(例如 `pipx install session-peer`)见该项目。同样使用 `session-peer` 命令,请注意上述 PATH 规则。本客户端不依赖该安装,也不承诺功能和参数完全对等。
164
+
165
+ ### 0.2.0 只读诊断
166
+
167
+ ```sh
168
+ session-peer doctor --json
169
+ session-peer doctor --agent codex --codex-home /absolute/home --json
170
+ session-peer doctor --host user@host --json
171
+ ```
172
+
173
+ 公开 npm 0.1.0 不包含此命令。诊断成功(`ok:true`、退出码 0)与代理就绪状态
174
+ (`ready`、各代理和 home 的结果)分开报告。只检查限定的元数据和可执行文件路径,
175
+ 不会执行 Codex、连接 inbox、获取 writer 锁或提交消息。Windows 就绪状态只表示
176
+ 存活进程公布了 pipe,并不证明 pipe 存在或可以连接。`capabilities` 明确将
177
+ wake/wait/ACK 和消费确认标为不支持。可选的 TS 技能元数据检查也不会安装任何内容。
178
+ 参见[诊断边界](PARITY.md#source-read-only-doctor--18--020)。SSH 两端需要相同的源码构建。
179
+ ## 显式安装代理技能
180
+
181
+ 独立的 `session-peer-ts` 技能在配套 PR 中管理,不代表新 npm 或技能标签发布。它支持已发布的 0.1.0 基础功能,通过 TypeScript 标识和帮助检查开发功能。Python 的 `session-peer` 技能仍独立保留。
182
+
183
+ 先检查[固定提交的技能源码](https://github.com/abruption/session-peer-skill/tree/081cc3c1d16a394bd92824333f4bc61c36951799/session-peer-ts),再选择代理和安装范围。
184
+ 以下示例选择 **Codex、当前项目**;请在该项目目录中运行。
185
+ Claude Code 使用 `--agent claude-code`。用户范围安装应在 add/list/remove 中一致添加 `--global`。
186
+ 批准替换已有的 `session-peer-ts` 副本前,请检查本地修改。
187
+ Codex 的 `.agents/skills` 目录与其他扫描该路径的客户端共享。
188
+
189
+ ```sh
190
+ 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
191
+ npx -y skills@1.7.0 list --agent codex --json
192
+ npx -y skills@1.7.0 remove session-peer-ts --agent codex --yes
193
+ ```
194
+
195
+ 更新固定版本时,请检查另一个准确的提交,然后以相同代理和范围重新运行 `add`。
196
+ 如果代理缓存了技能目录,请重启代理。运行时和技能独立管理:npm `--ignore-scripts` 可正常使用,
197
+ postinstall 不会调用 Skills CLI,安装此技能不会覆盖 Python 技能或安装运行时。
198
+ 参见[兼容性和验证](PARITY.md#source-ts-skill-guidance--25--020)。