session-peer 0.1.0 → 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
14
  <!-- docs-contract: stable-release-source; package=session-peer; bin=session-peer; node=22.13+/24; python-reference=1.0.2 -->
6
15
 
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.
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
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.
9
54
 
10
- **0.1.0 stable release source; 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
- The verified `0.1.0-preview.1` is public. To evaluate the reviewed `0.1.0`
40
- source before stable publication, build it and optionally install its local
41
- 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,15 +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.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 (typescript)`. Keep the `./...tgz` path to
56
- select the locally built candidate. Use an explicit version for registry
57
- installation until the stable release has been approved and verified.
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.
58
127
 
59
- ### Existing installations
128
+ ## Existing installations
60
129
 
61
130
  Other implementations may also install `session-peer`. Check `type -a session-peer`
62
131
  and `command -v session-peer` before and after installation. Choose one on PATH,
@@ -72,9 +141,9 @@ On Windows PowerShell, inspect competing commands with
72
141
  npm ci --ignore-scripts
73
142
  npm run build
74
143
  npm pack --ignore-scripts
75
- npm install --prefix "$env:TEMP\session-peer-ts-candidate" --ignore-scripts .\session-peer-0.1.0.tgz
76
- & "$env:TEMP\session-peer-ts-candidate\node_modules\.bin\session-peer.cmd" --version
77
- # Later: npm uninstall --prefix "$env:TEMP\session-peer-ts-candidate" 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
78
147
  ```
79
148
 
80
149
  ## Use
@@ -89,9 +158,9 @@ session-peer send --to codex:THREAD_UUID --codex-home "$HOME/.codex" --message '
89
158
  Remove `--dry-run` only when delivery is intended. Omit `--message` or use
90
159
  `--message -` for UTF-8 stdin. `--all` includes stale/archived records for listing;
91
160
  it does not authorize sending. Claude accepts a PID, `claude:PID`, or an
92
- unambiguous ASCII name, case-insensitively. Use a PID for Unicode names. Codex
93
- requires a full UUID and explicit home; `--codex-bin` selects an executable.
94
- 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`.
95
164
 
96
165
  ### Another machine over SSH
97
166
 
@@ -136,6 +205,9 @@ authority, and a Reply-To URI is never executed as shell text.
136
205
  | `refused`, `submitted:false` | Rejected before submission. |
137
206
  | `unknown`, `submitted:null` | Submission may have happened; do not automatically resend. |
138
207
 
208
+ After submission, a missing reply or a target exit alone does not establish
209
+ consumption or failure; do not automatically resend.
210
+
139
211
  `consumptionConfirmed` is always false. Verify an actual ACK separately in the
140
212
  receiver's TUI, not from queueing or transcript polling. Exit codes are 0/1/2
141
213
  for success/error/usage. Errors use fixed codes instead of raw native stderr or
@@ -157,8 +229,14 @@ npm audit
157
229
 
158
230
  Python is only the development conformance oracle (v1.0.2 commit
159
231
  `47c23713d0a2a3c11ebde6186afd8c43489b8b65`), never a runtime dependency. Tests also
160
- need a C compiler and lsof for the POSIX contract suite. CI pins the reference
161
- 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
162
240
  SQLite, Unix inbox and real lock fixtures are distinct from
163
241
  the dedicated real-TUI evidence in [VALIDATION.md](VALIDATION.md). A green fixture
164
242
  test is not an ACK. Package tests inspect contents, repeat-pack hashes, clean
@@ -167,30 +245,27 @@ the verified prebuilt path uses `--ignore-scripts`. SQLite read-only readers may
167
245
  participate in WAL shared-memory bookkeeping; they are not snapshots.
168
246
 
169
247
  See [CONTRIBUTING.md](CONTRIBUTING.md), [RELEASING.md](RELEASING.md) and
170
- [SECURITY.md](SECURITY.md). Publication requires separate approval; no automatic
171
- 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).
172
250
 
173
- ## npm release installation
251
+ ## Package release
174
252
 
175
- The public preview passed registry integrity, provenance, signature and
176
- fresh-install checks. Install it by exact version. Before stable promotion,
177
- unversioned installs select the older `0.1.0-preview.0` marked `latest`:
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:
178
256
 
179
257
  ```sh
180
- npm install --global --ignore-scripts session-peer@0.1.0-preview.1
258
+ npm view session-peer@0.2.0 version dist.integrity
259
+ npm view session-peer dist-tags
181
260
  ```
182
261
 
183
- Only after the separately approved `0.1.0` stage is published and verified,
184
- install the stable version by exact number:
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).
185
265
 
186
- ```sh
187
- npm install --global --ignore-scripts session-peer@0.1.0
188
- session-peer --version
189
- ```
190
-
191
- The manual workflow uses Trusted Publisher OIDC staging and requires a
192
- maintainer's 2FA approval; a staged upload is not a public release. See
193
- [RELEASING.md](RELEASING.md).
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.
194
269
 
195
270
  ## Related project
196
271
 
@@ -199,3 +274,43 @@ and released independently; its own optional features and installation guide
199
274
  remain there (for example `pipx install session-peer`). Its command is also
200
275
  `session-peer`, so apply the PATH guidance above. This client does not depend on
201
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
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
- **0.1.0 稳定版发布源码,正式发布需另行批准。**包名为 `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
- 已验证的 `0.1.0-preview.1` 已公开。稳定版发布前评估经审查的 `0.1.0` 源码时,请构建源码,并按需安装本地 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.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 (typescript)`。保留 `./...tgz` 路径以选择本地候选产物。在稳定版获批并完成验证之前,从注册表安装时请指定准确版本。
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-candidate" --ignore-scripts .\session-peer-0.1.0.tgz` 安装到隔离目录。以 `& "$env:TEMP\session-peer-ts-candidate\node_modules\.bin\session-peer.cmd" --version` 验证,并可用 `npm uninstall --prefix "$env:TEMP\session-peer-ts-candidate" 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,27 +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` 的旧版 `0.1.0-preview.0`,因此请指定以下准确版本:
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
153
+ npm view session-peer@0.2.0 version dist.integrity
154
+ npm view session-peer dist-tags
106
155
  ```
107
156
 
108
- 待另行批准的 `0.1.0` staging 获公开并验证后,再按准确版本安装稳定版:
157
+ 0.1.0 tarball 的历史措辞差异和验证保留在[日期记录](VALIDATION.md#public-010--2026-09-27-kst)。
158
+ 发布使用 OIDC staging 和单独的 2FA 批准。Staging 成功不等于公开发布。
159
+ 请参阅 [RELEASING.md](RELEASING.md)。
160
+
161
+ ## 相关项目
162
+
163
+ [Python session-peer](https://github.com/abruption/session-peer) 独立维护和发布,其可选功能与安装指南(例如 `pipx install session-peer`)见该项目。同样使用 `session-peer` 命令,请注意上述 PATH 规则。本客户端不依赖该安装,也不承诺功能和参数完全对等。
164
+
165
+ ### 0.2.0 只读诊断
109
166
 
110
167
  ```sh
111
- npm install --global --ignore-scripts session-peer@0.1.0
112
- session-peer --version
168
+ session-peer doctor --json
169
+ session-peer doctor --agent codex --codex-home /absolute/home --json
170
+ session-peer doctor --host user@host --json
113
171
  ```
114
172
 
115
- 手动工作流通过 Trusted Publisher OIDC 上传至 staging,由维护者使用 2FA 批准。staging 成功不代表已经公开发布。参见 [RELEASING.md](RELEASING.md)。
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
+ ## 显式安装代理技能
116
180
 
117
- ## 相关项目
181
+ 独立的 `session-peer-ts` 技能在配套 PR 中管理,不代表新 npm 或技能标签发布。它支持已发布的 0.1.0 基础功能,通过 TypeScript 标识和帮助检查开发功能。Python 的 `session-peer` 技能仍独立保留。
118
182
 
119
- [Python session-peer](https://github.com/abruption/session-peer) 独立维护和发布,其可选功能与安装指南(例如 `pipx install session-peer`)见该项目。同样使用 `session-peer` 命令,请注意上述 PATH 规则。本客户端不依赖该安装,也不承诺功能和参数完全对等。
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)。
package/RELEASING.md CHANGED
@@ -7,7 +7,86 @@ remain independent. The npm Trusted Publisher for `abruption/session-peer-ts`,
7
7
  uses OIDC and no npm token. The protected GitHub environment requires a reviewer
8
8
  and permits deployments from `main` only.
9
9
 
10
- ## Verified preview and stable baseline — 2026-09-27
10
+ ## Public baseline checked 2026-09-28 KST
11
+
12
+ `session-peer@0.1.0` is public. The registry records publication at
13
+ `2026-09-27T11:23:51.466Z`; the 2026-09-28 KST recheck found
14
+ `latest: 0.1.0` and `preview: 0.1.0-preview.1`. See the
15
+ [dated stable verification record](VALIDATION.md#public-010--2026-09-27-kst)
16
+ for source, staging run, artifact hashes, approvals and evidence limits.
17
+
18
+ ## 0.2.0 stable release procedure
19
+
20
+ The reviewed stable target is 0.2.0. Previous stable 0.1.0 integrity is pinned:
21
+ `sha512-/FtILLgUpIAgqf5FsdU5/x17IGeWO3ylmm47gbSyN3hHjD40pp5gtOeAXU3zqmye/cx7PE52Pp/oLa0ZgZyDQQ==`.
22
+ The prior preview integrity below remains pinned as a preservation check, not a
23
+ claim that a 0.2.0 preview was published. Neither existing tag is removed.
24
+
25
+ 1. Merge the reviewed release preparation PR into main and require successful
26
+ exact-main CI (including Windows Node 22/24 and the release gate).
27
+ 2. Check npm environment reviewers and main-only deployment policy, package
28
+ ownership/2FA and stage-only Trusted Publisher mapping. Inspect pending stages
29
+ with authenticated `npm stage list session-peer`; stop on a conflicting stage.
30
+ 3. Require 0.2.0 absent, `latest=0.1.0`, `preview=0.1.0-preview.1`, and both prior
31
+ integrity/provenance records unchanged. The script enforces these baselines.
32
+ 4. Obtain final approval naming **exact main SHA**, **0.2.0**, **stable-stage** and
33
+ `latest` promotion to 0.2.0. An instruction to begin release preparation does
34
+ not identify a future merged SHA. Do not replay any historical approval.
35
+ 5. Dispatch `publish.yml` on main with `mode=stable-stage`, `version=0.2.0`,
36
+ `source_sha=<approved 40-character main SHA>`, and
37
+ `confirmation=session-peer@0.2.0 stable-stage`. Both workflow jobs bind
38
+ `source_sha` to their actual `GITHUB_SHA`; moved main or mismatched input fails.
39
+ 6. Before approving the protected npm environment, download the prepare job's
40
+ `npm-release-<SHA>` artifact. Review its exact manifest/hash and packaged prose
41
+ using the documentation gate below. Only this artifact proceeds to staging.
42
+ 7. Staging uses Node 24/npm 11.15.0 and OIDC, with upload retries disabled. Record
43
+ the stage ID, compare the staged tarball with the retained artifact, and obtain
44
+ the separate final npm 2FA approval. Stage approval publicly publishes 0.2.0
45
+ and promotes `latest`; staging alone does neither.
46
+ 8. After approval, use that exact source/artifact to run `node scripts/release.mjs
47
+ artifact` and `node scripts/release.mjs verify`. Verify 0.2.0 integrity,
48
+ provenance/signatures, fresh version-specific install/uninstall, latest=0.2.0
49
+ and unchanged preview. Append dated public evidence; do not alter a tarball.
50
+
51
+ GitHub tags/releases, companion skill merge/installation and fleet rollout are
52
+ separate operations. The companion skill is pinned and independently managed;
53
+ this npm release neither installs it nor requires executing its instructions.
54
+ The procedures below for 0.1.0 are historical, not current dispatch inputs.
55
+
56
+ ## Documentation gate for the next release
57
+
58
+ The published 0.1.0 archive retained pre-publication README wording even after
59
+ GitHub documentation was corrected. Apply this required manual artifact review
60
+ before environment approval for staging, and confirm the same artifact again
61
+ before npm 2FA approval. The automated hash/file-list checks do not judge prose.
62
+
63
+ 1. Read `package/README.md`, all three translated READMEs,
64
+ `package/VALIDATION.md`, `package/PARITY.md` and `package/RELEASING.md` from the exact retained
65
+ tarball. Compare them with the reviewed release source, not just GitHub main.
66
+ For example, `tar -xOf /absolute/path/reviewed.tgz package/README.md` reads
67
+ the packaged English README without installing it.
68
+ 2. Match installation versions, CLI banners and POSIX/PowerShell tarball names
69
+ against the archive's package.json. Update all four languages together and
70
+ run the repository checker. Fixed `session-peer-<version>.tgz` examples are
71
+ part of this review, not timeless filenames.
72
+ 3. Use release wording that remains accurate after publication. Keep candidate
73
+ checks dated and historical; record previously published versions explicitly.
74
+ Do not claim the candidate is already publicly verified. Avoid an undated
75
+ assertion that the archive's own version is unpublished or awaiting approval;
76
+ keep pending approval status in the staging record instead.
77
+ 4. Match CI claims to the actual workflow and platform depth. Keep fixture,
78
+ native submission and separately observed ACK evidence distinct. Use the versioned
79
+ matrix in PARITY.md; planned features are not current capability.
80
+ 5. Record reviewer, source SHA, tarball SHA-256 and the documentation review in
81
+ the release approval record. A wording failure requires a reviewed source
82
+ correction and new candidate artifact with its own checks/approval; never
83
+ edit a validated tarball in place or overwrite a published version.
84
+ 6. After publication, verify registry integrity/provenance/signatures and the
85
+ version-specific install as usual, inspect the npm rendered README when
86
+ accessible, and append a dated public-validation record in GitHub. Preserve
87
+ any discrepancy between that later record and immutable packaged documents.
88
+
89
+ ## Historical preview baseline before stable — 2026-09-27
11
90
 
12
91
  `session-peer@0.1.0-preview.1` was staged from main commit
13
92
  `f65d3ee99cc26ff4a267aef84e31a308d034ac80` in
@@ -19,10 +98,11 @@ uninstallation. The artifact SHA-256 was
19
98
  `d154beac93893b60b0695e5a6296e185beb8dbd05188ffe04befb74d29966110`;
20
99
  registry integrity is
21
100
  `sha512-h4SMvrQ/LWA9osd4EHIs9rSTqv1u+S3MXQAmn+yG/gZ9+7NwYMutq+Oa5K/0ggIq61Wfwdh11Cv+5YdEffiNMA==`.
22
- The `preview` tag points to preview.1. The existing `latest` tag still points
23
- to preview.0. No stable version has been published by this preparation PR.
101
+ At that pre-stable checkpoint, `preview` pointed to preview.1 and `latest`
102
+ pointed to preview.0. The subsequent approved stable release changed `latest`
103
+ to 0.1.0; the historical baseline is not the current registry state.
24
104
 
25
- ## Prepare 0.1.0 stable
105
+ ## Historical 0.1.0 stable procedure (completed)
26
106
 
27
107
  1. Merge the reviewed 0.1.0 preparation PR. Require successful `cli` CI on the
28
108
  exact merged `main` commit, including the release gate and Windows Node 22/24.
@@ -0,0 +1,39 @@
1
+ UNICODE LICENSE V3
2
+
3
+ COPYRIGHT AND PERMISSION NOTICE
4
+
5
+ Copyright © 1991-2026 Unicode, Inc.
6
+
7
+ NOTICE TO USER: Carefully read the following legal agreement. BY
8
+ DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
9
+ SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
10
+ TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
11
+ DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a
14
+ copy of data files and any associated documentation (the "Data Files") or
15
+ software and any associated documentation (the "Software") to deal in the
16
+ Data Files or Software without restriction, including without limitation
17
+ the rights to use, copy, modify, merge, publish, distribute, and/or sell
18
+ copies of the Data Files or Software, and to permit persons to whom the
19
+ Data Files or Software are furnished to do so, provided that either (a)
20
+ this copyright and permission notice appear with all copies of the Data
21
+ Files or Software, or (b) this copyright and permission notice appear in
22
+ associated Documentation.
23
+
24
+ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
25
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
27
+ THIRD PARTY RIGHTS.
28
+
29
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
30
+ BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
31
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
32
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
33
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
34
+ FILES OR SOFTWARE.
35
+
36
+ Except as contained in this notice, the name of a copyright holder shall
37
+ not be used in advertising or otherwise to promote the sale, use or other
38
+ dealings in these Data Files or Software without prior written
39
+ authorization of the copyright holder.