session-peer 0.1.0 → 0.2.1

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.
@@ -0,0 +1,294 @@
1
+ # 사용자 가이드 — session-peer (TypeScript)
2
+
3
+ [README로 돌아가기](../README.ko.md)
4
+
5
+ [English](guide.md) | [한국어](guide.ko.md) | [日本語](guide.ja.md) | [简体中文](guide.zh-CN.md)
6
+
7
+ 0.2.1 상세 가이드입니다. 0.2.1은 0.2.0의 안정성·보안 보강 업데이트입니다([변경 사항](../PARITY.md#021-reliability-and-hardening)). 이전 발행 기록은 [0.2.0 공개 릴리스 증거](../VALIDATION.md#public-020--2026-09-28-kst)에 있습니다. 아래 0.1.0 설명은 이전 버전과의 비교입니다.
8
+
9
+ ## 목차
10
+
11
+ - [주요 기능과 범위](#주요-기능과-범위)
12
+ - [요구사항](#요구사항)
13
+ - [설치](#설치)
14
+ - [사용법](#사용법)
15
+ - [성공의 의미](#성공의-의미)
16
+ - [개발·검증](#개발검증)
17
+ - [npm 릴리스](#npm-릴리스)
18
+ - [관련 프로젝트](#관련-프로젝트)
19
+ - [에이전트 스킬: 명시적 설치](#에이전트-스킬-명시적-설치)
20
+
21
+
22
+ 실행 중인 **Claude Code·Codex 세션에 로컬 또는 SSH로 메시지를 전달**하는
23
+ TypeScript 클라이언트입니다. Python 없이 Node.js로 실행합니다.
24
+
25
+ **0.2.1 사용 안내입니다.** 패키지명은
26
+ `session-peer`, CLI 명령어는 **`session-peer`**입니다. Relay 서버나 호스팅
27
+ 서비스를 제공하는 프로젝트가 아닙니다.
28
+
29
+ ## 주요 기능과 범위
30
+
31
+ - 로컬 Claude/Codex 세션과 알려진 Codex 홈 탐색 (0.2.0 기능, 아래 참고)
32
+ - `--dry-run`으로 대상을 검증한 뒤 네이티브 inbox 또는 queue에 메시지 1회 제출
33
+ - 원격에 명시적으로 설치한 같은 버전의 클라이언트로 SSH 전송
34
+ - 구조화된 Reply-To URI와 JSON 결과
35
+ - 모호한 대상·확인할 수 없는 소유권은 거부하고, 불확실한 제출은 자동 재시도하지 않음
36
+
37
+ Relay 전송, MCP, wake/resume, Antigravity, 자동 업데이트는 미지원입니다. 미지원 옵션은 명시적으로
38
+ 거부하며 범용 오케스트레이터를 지향하지 않습니다.
39
+
40
+ 클라이언트 기능 계획은 [버전별 호환성 표와 npm 이주 가이드](../PARITY.md)에서 추적하며, 계획은 현재 지원을 뜻하지 않습니다. Relay 서버·호스팅 서비스 제공은 이 클라이언트의 범위 밖입니다.
41
+
42
+ ### 0.2.0 통합 목록
43
+
44
+ 소스 빌드 후 `node dist/cli.js list --json`은 Claude/Codex를 함께 조회하고,
45
+ `list --agent codex --json`은 알려진 홈을 조회합니다. 공개 npm **0.1.0**은 여전히
46
+ 에이전트와 Codex 목록용 홈을 명시해야 합니다. 0.2.0에서도 명시적 명령 형식을 쓸 수 있습니다.
47
+
48
+ 탐색 범위는 기본 `~/.codex`, `CODEX_HOME`, macOS Orca의 바로 아래 계정 홈,
49
+ JSON 배열 `SESSION_PEER_CODEX_HOMES`입니다. `--codex-home`은 Codex 목록을 해당 홈에
50
+ 고정하고 다른 설정 오류를 우회하며, `--agent claude`는 Codex 탐색을 생략합니다.
51
+ 동일 홈의 별칭은 합치지만 다른 홈의 동일 UUID는 보존합니다. 전송에는 각 행의
52
+ `codexHome`을 사용하세요. 선택적 홈 부재는 오류가 아니지만 명시된 홈의 부재·오류는
53
+ 성공한 행을 보존하면서 종료 코드 1을 반환합니다. 목록은 writer를 선택하거나 전송하지 않습니다.
54
+ 정렬·진단·`--all`·SSH는 [목록 계약](../PARITY.md#source-unified-listing-contract--16--020)을 참고하세요.
55
+ 0.2.0의 Codex 전송은 `--codex-home` 생략 시 유일하고 안정된 live writer 홈을
56
+ 선택합니다. 명시한 홈도 모든 알려진 경쟁 홈을 검사합니다. 비활성 큐는 저장된 스레드와
57
+ 모든 후보의 비활성 검증에 더해 `--codex-home HOME --allow-inactive-codex-home`이
58
+ 필요하며 wake/resume을 수행하지 않습니다. Dry-run은 제출하지 않습니다.
59
+ JSON에는 정제된 `codexHomeResolution`과 네이티브 출력에 있을 때만 `queueId`가 추가되며,
60
+ 둘 다 소비 확인은 아닙니다. [홈 선택 계약](../PARITY.md#source-codex-home-selection--17--020)을 참고하세요.
61
+ 공개 **0.1.0**은 여전히 명시적 live 홈이 필요하고 비활성 허용 옵션이 없습니다.
62
+ SSH 양쪽에는 동일한 0.2.1 빌드를 사용하세요.
63
+
64
+ ### 0.2.0 CLI 사용성
65
+
66
+ 0.2.0는 `list --help`, `send --help`, `doctor --help`, `--output-format text`를 제공합니다.
67
+ 출력 형식은 계속 명시해야 합니다: `--json` 또는 `--output-format json|text`.
68
+ 구문 오류는 JSON이며 유효한 text 요청의 실행 결과·오류는 텍스트입니다. SSH
69
+ 내부 전송은 항상 JSON입니다. `send --to TARGET "message" --json` 위치 인자를
70
+ 지원하며 `--message`/`-m`과 중복할 수 없습니다. 본문 생략 또는 `-`는 stdin,
71
+ 옵션처럼 시작하는 위치 본문 앞에는 `--`를 사용합니다. 빈 본문·공백 본문은
72
+ 발신자 머리말 추가 전에 거부합니다. Claude 이름은 Unicode 14.0.0 기본 full
73
+ casefold로 정확히 비교하며 정규화·유사 검색을 하지 않습니다. 충돌 시 PID를
74
+ 지정하세요. 이미 발행된 0.1.0에는 이 소스 기능이 소급 적용되지 않습니다.
75
+
76
+
77
+ ## 요구사항
78
+
79
+ macOS/Linux/Windows native와 Node **22.x의 22.13 이상 또는 24.x**가 필요합니다. Node 26은
80
+ 미지원입니다. 네이티브 flock 의존성에 맞는 사전 빌드 바이너리(x64/arm64)가 필요하므로
81
+ 순수 JavaScript 패키지는 아닙니다. Codex 전송에는 `codex`가 필요하고 macOS/Linux에서는
82
+ `lsof`, `ps`도 필요합니다. Windows는 네이티브 잠금과 Restart Manager로 소유자를 확인합니다. 저장된
83
+ 스레드의 유일하고 안정적인 live writer가 필요합니다. Claude는 접근 가능한 inbox가
84
+ 있는 실행 중 TUI가 필요합니다. SSH에는 OpenSSH, 기존 키·호스트 신뢰 설정과 원격의
85
+ **동일 버전 클라이언트**가 필요합니다.
86
+
87
+ ## 설치
88
+
89
+ Node 22.x의 22.13 이상 또는 24.x에서 검증된 안정판을 설치합니다.
90
+ Python CLI도 같은 명령어를 사용하므로 기존 설치본이 있다면 먼저 PATH를 확인하세요.
91
+
92
+ ```sh
93
+ npm install --global --ignore-scripts session-peer@0.2.1
94
+ session-peer --version
95
+ ```
96
+
97
+ 예상 출력은 `session-peer 0.2.1 (typescript)`입니다.
98
+
99
+ 1. `session-peer list --agent claude --json`으로 대상을 찾고 정확한 PID를 선택합니다.
100
+ 2. `session-peer send --to CLAUDE_PID --message '확인 후 회신해 주세요.' --dry-run --json`으로 제출 없이 검증합니다.
101
+ 3. 실제 전달할 때 선택한 PID로 같은 명령에서 `--dry-run`을 제거해 한 번 실행합니다.
102
+ 4. ACK가 필요하면 메시지에 명시적인 회신을 요청하고 수신 TUI의 응답을 별도로 확인합니다. `posted` / `queued`는 제출만 뜻합니다.
103
+
104
+ ### 소스에서 빌드
105
+
106
+ 공개된 npm 패키지 대신 검토한 소스를 실행하려면 빌드하고 필요한 경우
107
+ 로컬 tarball을 설치합니다.
108
+
109
+ ```sh
110
+ git clone https://github.com/abruption/session-peer-ts.git
111
+ cd session-peer-ts
112
+ npm ci --ignore-scripts
113
+ npm run build
114
+ node dist/cli.js --version
115
+ npm pack --ignore-scripts
116
+ # 선택 사항: PATH에서 사용할 구현을 명시적으로 선택한 뒤 전역 설치
117
+ npm install --global --ignore-scripts ./session-peer-0.2.1.tgz
118
+ session-peer --version
119
+ ```
120
+
121
+ 설치 명령의 `./...tgz`는 로컬 산출물을 지정하므로 생략하지 마세요.
122
+ 나중 버전의 소스를 사용할 때는 체크아웃 버전을 먼저 확인하세요.
123
+
124
+ ### 기존 설치본과 PATH
125
+
126
+ 다른 구현도 `session-peer`를 설치할 수 있습니다. 전후에 `type -a session-peer`와
127
+ `command -v session-peer`로 확인하고 PATH에서 하나를 선택하거나
128
+ `node /절대/경로/dist/cli.js`처럼 명시적으로 실행하세요. 다른 설치 관리자의 파일을
129
+ `--force`로 덮어쓰지 마세요. Python 패키지·스킬·서비스는 자동 설치·삭제·설정하지
130
+ 않습니다. npm 설치본 제거는 `npm uninstall --global session-peer`로 하고 PATH를
131
+ 다시 확인하세요.
132
+
133
+ Windows PowerShell에서는 `Get-Command session-peer -All`로 기존 설치본을 확인하세요.
134
+ Python CLI를 덮어쓰지 않으려면 격리 prefix에 설치·제거할 수 있습니다.
135
+
136
+ ```powershell
137
+ npm ci --ignore-scripts
138
+ npm run build
139
+ npm pack --ignore-scripts
140
+ npm install --prefix "$env:TEMP\session-peer-ts-source" --ignore-scripts .\session-peer-0.2.1.tgz
141
+ & "$env:TEMP\session-peer-ts-source\node_modules\.bin\session-peer.cmd" --version
142
+ # 이후 제거: npm uninstall --prefix "$env:TEMP\session-peer-ts-source" session-peer
143
+ ```
144
+
145
+ ## 사용법
146
+
147
+ ```sh
148
+ session-peer list --agent claude --json
149
+ session-peer list --agent codex --codex-home "$HOME/.codex" --json
150
+ session-peer send --to CLAUDE_PID --message 'API 계약을 검토해 주세요.' --dry-run --json
151
+ session-peer send --to codex:THREAD_UUID --codex-home "$HOME/.codex" --message 'API 계약을 검토해 주세요.' --dry-run --json
152
+ ```
153
+
154
+ 실제 전달할 때만 `--dry-run`을 제거합니다. `--message`를 생략하거나 `--message -`를
155
+ 사용하면 UTF-8 stdin을 읽습니다. `--all`은 오래된·보관된 기록을 목록에 포함할 뿐
156
+ 전송을 허용하지 않습니다. Claude 대상은 PID, `claude:PID`, 모호하지 않은 Unicode 14.0.0 casefold 이름입니다. 충돌 시 PID를 지정하세요.
157
+ Codex 전송에는 전체 UUID가 필요하며 홈은 위의 선택 규칙을 따릅니다. `--codex-bin`으로 실행 파일을 고를 수 있습니다. 출력에는
158
+ `--json` 또는 `--output-format json|text`이 필요합니다.
159
+
160
+ ### 다른 머신으로 SSH 전송
161
+
162
+ ```sh
163
+ session-peer send --host user@machine --remote-bin /absolute/path/session-peer \
164
+ --to CLAUDE_PID --message 'API 계약을 검토해 주세요.' --dry-run --json
165
+ ```
166
+
167
+ 원격 기본 명령은 PATH의 `session-peer`입니다. `--remote-bin` 절대 경로로 지원되는
168
+ Node를 선택하는 래퍼를 지정할 수 있습니다. TypeScript 표시와 정확한 버전을 확인하므로
169
+ 다른 구현을 발견하면 거부합니다. BatchMode·StrictHostKeyChecking을 사용하며 새
170
+ 호스트 키 승인, 원격 런타임 설치, Python 대체 실행은 하지 않습니다. 메시지는 원격
171
+ 셸 인자가 아닌 JSON stdin 요청으로 전달합니다. 임의의 `--ssh-opt`, IPv6 리터럴,
172
+ Tailscale 정규 이름 보강은 미지원이므로 SSH 별칭·호스트명을 사용하세요. 정방향 접속이
173
+ 역방향 접속을 보장하지 않습니다.
174
+
175
+ Windows SSH 대상에는 `--remote-platform win32`를 명시하고, 원격 PATH에 없다면
176
+ `--remote-bin 'C:\절대\경로\session-peer.cmd'`를 지정하세요. 이미 인증된 OpenSSH
177
+ 제어 소켓은 `--ssh-control-path /로컬/절대/소켓`으로 선택할 수 있습니다. 이는 호스트 키
178
+ 검증을 우회하거나 새 로그인을 허용하지 않습니다. Windows 로컬 Codex 홈은
179
+ `C:\Users\...\.codex`처럼 전체 경로를 사용합니다. 기존 Python CLI는 자동 제거·교체하지 않습니다.
180
+
181
+ ### 회신
182
+
183
+ `session-peer://v1/reply?...` URI를 `--to`로 사용할 수 있습니다. 알 수 없거나 중복된
184
+ 필드, 위험한 호스트, 잘못된 인코딩, 명시적 경로와의 충돌은 거부합니다.
185
+ `--reply-address URI`는 명시적인 회신 주소를 추가할 뿐 자동 추론·검증하지 않습니다.
186
+ 새 회신 주소를 붙이지 않을 때는 `--no-reply-to`를 사용합니다. 유효한
187
+ CODEX_THREAD_ID/CODEX_SESSION_ID는 참고용 From 정보에 사용하고 `--no-from`으로
188
+ 생략합니다. 모르는 발신자를 만들지 않으며 peer 정보는 권한 근거가 아닙니다. URI를
189
+ 셸 명령으로 실행하지 않습니다.
190
+
191
+ ## 성공의 의미
192
+
193
+ | 결과 | 의미 |
194
+ | --- | --- |
195
+ | `validated`, `submitted:false` | dry-run 검증 통과. 전송하지 않음 |
196
+ | `posted` / `queued` | inbox 쓰기 / queue 수락. **소비·ACK 확인 아님** |
197
+ | `refused`, `submitted:false` | 제출 전에 거부 |
198
+ | `unknown`, `submitted:null` | 제출됐을 수 있음. 자동 재전송 금지 |
199
+
200
+ 제출 후 회신이 없거나 대상이 종료됐다는 사실만으로 소비나 실패를 확정할 수 없습니다. 자동 재전송하지 마세요.
201
+
202
+ `consumptionConfirmed`는 항상 false입니다. 실제 ACK는 수신 TUI에서 별도로 확인하며
203
+ queue 결과나 transcript 폴링으로 추정하지 않습니다. 종료 코드는 성공/오류/사용법에
204
+ 0/1/2를 사용합니다. 오류는 고정 코드로 반환하며 원문 stderr·메시지를 노출하지 않습니다.
205
+ Codex는 실제 OS flock, 파일 식별자, 동일 사용자 소유 프로세스의 시작 시각을 여러 번
206
+ 검사하고 제출 직전에 다시 검증합니다. 잠금을 삭제하거나 소유 프로세스에 신호를 보내지
207
+ 않습니다. 탐색 결과의 이름·경로·ID는 공유 전에 익명화하세요.
208
+
209
+ ## 개발·검증
210
+
211
+ ```sh
212
+ npm ci --ignore-scripts
213
+ npm run build
214
+ node scripts/check-repository.mjs
215
+ SESSION_PEER_PYTHON_ROOT=/path/to/python-reference npm test
216
+ npm run test:package
217
+ npm audit
218
+ ```
219
+
220
+ Python은 개발용 호환성 기준(v1.0.2 커밋
221
+ `47c23713d0a2a3c11ebde6186afd8c43489b8b65`)일 뿐 런타임 의존성이 아닙니다. POSIX 계약 테스트에는
222
+ C 컴파일러와 lsof도 필요합니다. CI는 세 OS에서 Node 22/24를 사용합니다.
223
+ macOS/Linux는 고정된 참조 기준으로 전체 계약·패키지 검사를 실행하고, Windows는
224
+ x64에서 빌드·타입 검사, 네이티브 Claude inbox·점유/해제된 잠금, writer 소유권·제출 직전 경합,
225
+ CLI 큐 결과, 격리된 가짜 SSH 대상의 실제 PowerShell/.cmd 프레이밍, 패키지 설치·네이티브 로드·삭제와 audit를 실행합니다.
226
+ 이는 fixture 검사이며 Windows에서 POSIX/Python 참조 스위트를 실행한다는 뜻은 아닙니다.
227
+ Windows x64/Node 24 실기기 ACK는 별도의 일회성 증거입니다. 임시 SQLite·Unix inbox·실제 잠금 fixture와 [VALIDATION.md](../VALIDATION.md)의
228
+ 실제 TUI 증거는 구분합니다. fixture 통과는 ACK가 아닙니다. 패키지 내용·반복 빌드 해시·
229
+ 새 환경 설치·삭제도 검사합니다. 네이티브 의존성에는 설치 스크립트가 있지만 검증한 사전
230
+ 빌드 경로는 `--ignore-scripts`를 사용합니다. SQLite 읽기 전용 접근도 WAL 공유 메모리
231
+ 처리에 참여할 수 있으므로 스냅샷 읽기는 아닙니다.
232
+
233
+ [CONTRIBUTING.md](../CONTRIBUTING.md), [RELEASING.md](../RELEASING.md),
234
+ [SECURITY.md](../SECURITY.md)를 참고하세요. 이후 릴리스 발행에는 별도 승인이 필요하며
235
+ npm 자동 발행은 활성화하지 않았습니다. [MIT 라이선스](../LICENSE)입니다.
236
+
237
+ ## npm 릴리스
238
+
239
+ 0.2.0은 2026-09-28 KST에 공개·검증했습니다. [공개 기록](../VALIDATION.md#public-020--2026-09-28-kst)을
240
+ 참고하고 설치 전 정확한 버전과 현재 태그를 확인하세요.
241
+
242
+ ```sh
243
+ npm view session-peer@0.2.0 version dist.integrity
244
+ npm view session-peer dist-tags
245
+ ```
246
+
247
+ 0.1.0 tarball의 과거 문구 불일치와 검증은 [날짜별 기록](../VALIDATION.md#public-010--2026-09-27-kst)에 보존합니다.
248
+ 발행은 OIDC staging과 별도 2FA 승인을 거칩니다. Staging 성공은 공개 발행이 아닙니다.
249
+ [RELEASING.md](../RELEASING.md)를 참고하세요.
250
+
251
+ ## 관련 프로젝트
252
+
253
+ [Python session-peer](https://github.com/abruption/session-peer)는 독립적으로 유지·
254
+ 발행합니다. 선택 기능과 설치법(예: `pipx install session-peer`)은 해당 저장소에서
255
+ 안내합니다. 명령어가 같은 `session-peer`이므로 위 PATH 안내를 따르세요. 이 클라이언트는
256
+ Python 설치에 의존하지 않으며 전체 기능·플래그 호환성을 주장하지 않습니다.
257
+
258
+ ### 0.2.0 읽기 전용 진단
259
+
260
+ ```sh
261
+ session-peer doctor --json
262
+ session-peer doctor --agent codex --codex-home /absolute/home --json
263
+ session-peer doctor --host user@host --json
264
+ ```
265
+
266
+ 공개 npm 0.1.0에는 없는 소스 기능입니다. 진단 성공(`ok:true`, 종료 코드 0)과
267
+ 에이전트 준비 상태(`ready`, 에이전트·홈별 결과)는 별개입니다. 정해진 메타데이터와
268
+ 실행 파일 경로만 검사하며 Codex 실행, inbox 연결, writer 잠금 획득, 메시지 제출을
269
+ 하지 않습니다. Windows inbox 준비 상태는 살아 있는 프로세스의 pipe 광고를 뜻하며
270
+ pipe 존재나 연결 가능성을 보증하지 않습니다. `capabilities`는 wake/wait/ACK와 소비
271
+ 확인을 미지원으로 표시합니다. 선택적 TS 스킬 메타데이터 검사도 설치를 하지 않습니다.
272
+ [진단 경계](../PARITY.md#source-read-only-doctor--18--020)를 참고하세요. SSH 양쪽에 같은
273
+ 소스 빌드가 필요합니다.
274
+ ## 에이전트 스킬: 명시적 설치
275
+
276
+ 별도 `session-peer-ts` 스킬은 동반 PR에서 관리되며 새 npm 또는 스킬 태그 발행이 아닙니다. 공개된 0.1.0 기본 기능을 지원하고 TypeScript 구현 표시와 도움말로 개발 기능을 확인합니다. Python `session-peer` 스킬은 별도로 유지합니다.
277
+
278
+ [고정된 스킬 소스](https://github.com/abruption/session-peer-skill/tree/081cc3c1d16a394bd92824333f4bc61c36951799/session-peer-ts)를 검토한 뒤 에이전트와 설치 범위를 선택하세요.
279
+ 아래 예시는 **Codex, 현재 프로젝트**를 선택합니다. 해당 프로젝트 디렉터리에서 실행하세요.
280
+ Claude Code는 `--agent claude-code`를 사용합니다. 사용자 범위는 add/list/remove 모두에
281
+ `--global`을 동일하게 추가하세요. 기존 `session-peer-ts` 사본을 교체하기 전에 로컬 수정 사항을
282
+ 확인하세요. Codex의 `.agents/skills` 디렉터리는 이 경로를 탐색하는 다른 클라이언트와 공유됩니다.
283
+
284
+ ```sh
285
+ 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
286
+ npx -y skills@1.7.0 list --agent codex --json
287
+ npx -y skills@1.7.0 remove session-peer-ts --agent codex --yes
288
+ ```
289
+
290
+ 고정 버전 업데이트는 다른 정확한 커밋을 검토한 뒤 같은 에이전트·범위로 `add`를 반복합니다.
291
+ 목록을 캐시하는 에이전트는 다시 시작하세요. 런타임과 스킬은 독립적으로 관리됩니다.
292
+ npm `--ignore-scripts`를 사용할 수 있고 postinstall은 Skills CLI를 호출하지 않습니다.
293
+ 이 스킬 설치는 Python 스킬을 덮어쓰거나 런타임을 설치하지 않습니다.
294
+ [호환성과 검증](../PARITY.md#source-ts-skill-guidance--25--020)을 참고하세요.
package/docs/guide.md ADDED
@@ -0,0 +1,324 @@
1
+ # User guide — session-peer (TypeScript)
2
+
3
+ [Back to README](../README.md)
4
+
5
+ [English](guide.md) | [한국어](guide.ko.md) | [日本語](guide.ja.md) | [简体中文](guide.zh-CN.md)
6
+
7
+ This guide covers 0.2.1, a reliability and hardening update to 0.2.0 ([changes](../PARITY.md#021-reliability-and-hardening)). [Public 0.2.0 release evidence](../VALIDATION.md#public-020--2026-09-28-kst) records the previous publication. References to 0.1.0 below describe the older release.
8
+
9
+ ## Contents
10
+
11
+ - [Quick start](#quick-start)
12
+ - [What it does](#what-it-does)
13
+ - [Requirements](#requirements)
14
+ - [Build from source](#build-from-source)
15
+ - [Existing installations](#existing-installations)
16
+ - [Use](#use)
17
+ - [What success means](#what-success-means)
18
+ - [Development and verification](#development-and-verification)
19
+ - [Package release](#package-release)
20
+ - [Related project](#related-project)
21
+ - [Agent skill: explicit installation](#agent-skill-explicit-installation)
22
+
23
+
24
+ **Find and message running Claude Code and Codex sessions, locally or over SSH.**
25
+ This TypeScript client runs on Node.js without Python.
26
+
27
+ This guide describes **0.2.1**. The npm package and CLI command are both **`session-peer`**. This
28
+ project does not provide a Relay server or hosted service.
29
+
30
+ ## Quick start
31
+
32
+ Use Node **22.13+ within 22.x or 24.x**. Check which `session-peer` your PATH
33
+ selects if the Python CLI is already installed; both packages use that command.
34
+
35
+ ```sh
36
+ npm install --global --ignore-scripts session-peer@0.2.1
37
+ session-peer --version # session-peer 0.2.1 (typescript)
38
+ session-peer list --agent claude --json
39
+ session-peer send --to CLAUDE_PID --message 'Please review the API contract.' --dry-run --json
40
+ ```
41
+
42
+ 1. List sessions and replace `CLAUDE_PID` with the exact PID you selected.
43
+ 2. Run the send command with `--dry-run`; nothing is submitted.
44
+ 3. When delivery is intended, run that command once without `--dry-run`.
45
+ 4. If acknowledgement matters, ask for an explicit reply in the message and
46
+ verify the receiver's TUI response separately. `posted` / `queued` confirms
47
+ submission only. See [What success means](#what-success-means).
48
+
49
+ ### CLI usability in 0.2.0
50
+
51
+ Version 0.2.0 adds `list --help`, `send --help`, `doctor --help` and explicit
52
+ `--output-format text`. Output selection remains required: use `--json` or
53
+ `--output-format json|text`. Parse errors use JSON; valid text requests render
54
+ operation results/errors as text. SSH always exchanges JSON internally.
55
+
56
+ `send --to TARGET "message" --json` accepts one positional body. Do not combine
57
+ it with `--message`/`-m`; omit the body or use `-` for stdin, and use `--` before
58
+ an option-looking positional body. Empty/whitespace bodies are refused before
59
+ adding the sender envelope. Claude names use exact Unicode 14.0.0 default full
60
+ casefold (no normalization/fuzzy matching); collisions require a PID. This
61
+ source behavior is not retroactively available in the published 0.1.0 package.
62
+
63
+
64
+ ## What it does
65
+
66
+ - Discover local Claude/Codex sessions and known Codex homes (0.2.0; see below).
67
+ - Validate a destination with `--dry-run`, then submit one message to its native
68
+ inbox or queue. Codex normally requires a unique, stable live writer.
69
+ - Use the same commands over SSH to an explicitly installed remote client.
70
+ - Accept structured Reply-To URIs as destinations and provide JSON results.
71
+ - Refuse ambiguous targets and uncertain ownership; never automatically retry
72
+ an uncertain submission.
73
+
74
+ Not implemented: Relay transport, MCP, wake/resume,
75
+ Antigravity or automatic updates. Unsupported commands fail explicitly; this is not a general orchestrator.
76
+
77
+ 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.
78
+
79
+ ### Unified listing in 0.2.0
80
+
81
+ After building this source, `node dist/cli.js list --json` combines Claude and
82
+ Codex; `list --agent codex --json` searches known homes. Published npm **0.1.0**
83
+ still requires an explicit agent and a home for Codex listing; the install and
84
+ explicit list/send forms also work with that older release.
85
+
86
+ Sources are default `~/.codex`, `CODEX_HOME`, immediate macOS Orca account homes,
87
+ and the JSON array `SESSION_PEER_CODEX_HOMES`. `--codex-home` pins Codex listing
88
+ and bypasses unrelated inventory errors; `--agent claude` skips Codex entirely.
89
+ Aliases are deduplicated, but the same UUID in different homes stays separate.
90
+ Use each row's `codexHome` when sending. Optional absent homes are not failures;
91
+ explicitly configured missing/invalid homes produce partial results and exit 1,
92
+ retaining readable rows. Listing never selects a writer or submits a message.
93
+ See the [source listing contract](../PARITY.md#source-unified-listing-contract--16--020)
94
+ for ordering, diagnostics, `--all` and SSH behavior.
95
+
96
+ Source Codex send now selects the unique stable live writer when `--codex-home`
97
+ is omitted. Explicit homes still check all known competitors. Inactive queueing
98
+ requires both `--codex-home HOME` and `--allow-inactive-codex-home`, a saved thread,
99
+ and verified inactive candidates; it never wakes or resumes a session. Dry-run
100
+ submits nothing. JSON adds sanitized `codexHomeResolution` and, when supplied by
101
+ native queue output, `queueId`; neither confirms consumption. See the
102
+ [selection contract](../PARITY.md#source-codex-home-selection--17--020).
103
+ Published **0.1.0** still requires an explicit live home and has no inactive opt-in.
104
+ On SSH, use the same 0.2.1 build on both ends.
105
+
106
+ ## Requirements
107
+
108
+ macOS, Linux or native Windows; Node **22.13+ within 22.x or 24.x**. Node 26 is not supported.
109
+ The native flock dependency needs a matching prebuilt binary (x64/arm64); this
110
+ is not a pure-JavaScript package. Codex sends need `codex`; macOS/Linux also
111
+ need `lsof` and `ps`. Windows uses native lock and Restart Manager inspection.
112
+ Claude needs a live TUI with an accessible native inbox. SSH requires OpenSSH,
113
+ existing key/host trust and the **same client version** on the destination.
114
+
115
+ ## Build from source
116
+
117
+ To run a reviewed source checkout instead of the published npm package, build
118
+ it and optionally install its local tarball:
119
+
120
+ ```sh
121
+ git clone https://github.com/abruption/session-peer-ts.git
122
+ cd session-peer-ts
123
+ npm ci --ignore-scripts
124
+ npm run build
125
+ node dist/cli.js --version
126
+ npm pack --ignore-scripts
127
+ # Optional global install: first check which session-peer your PATH selects.
128
+ npm install --global --ignore-scripts ./session-peer-0.2.1.tgz
129
+ session-peer --version
130
+ ```
131
+
132
+ Expected: `session-peer 0.2.1 (typescript)`. Keep the `./...tgz` path to
133
+ select the locally built artifact. Check the checkout version before using
134
+ these commands for a later release.
135
+
136
+ ## Existing installations
137
+
138
+ Other implementations may also install `session-peer`. Check `type -a session-peer`
139
+ and `command -v session-peer` before and after installation. Choose one on PATH,
140
+ or call this build explicitly with `node /absolute/path/dist/cli.js`. Do not use
141
+ `--force` to overwrite another manager's files. No Python package, skill or service
142
+ is installed, removed or reconfigured automatically. To remove this npm install,
143
+ run `npm uninstall --global session-peer` and recheck PATH.
144
+
145
+ On Windows PowerShell, inspect competing commands with
146
+ `Get-Command session-peer -All`. To avoid replacing the Python CLI, use an isolated prefix:
147
+
148
+ ```powershell
149
+ npm ci --ignore-scripts
150
+ npm run build
151
+ npm pack --ignore-scripts
152
+ npm install --prefix "$env:TEMP\session-peer-ts-source" --ignore-scripts .\session-peer-0.2.1.tgz
153
+ & "$env:TEMP\session-peer-ts-source\node_modules\.bin\session-peer.cmd" --version
154
+ # Later: npm uninstall --prefix "$env:TEMP\session-peer-ts-source" session-peer
155
+ ```
156
+
157
+ ## Use
158
+
159
+ ```sh
160
+ session-peer list --agent claude --json
161
+ session-peer list --agent codex --codex-home "$HOME/.codex" --json
162
+ session-peer send --to CLAUDE_PID --message 'Please review the API contract.' --dry-run --json
163
+ session-peer send --to codex:THREAD_UUID --codex-home "$HOME/.codex" --message 'Please review the API contract.' --dry-run --json
164
+ ```
165
+
166
+ Remove `--dry-run` only when delivery is intended. Omit `--message` or use
167
+ `--message -` for UTF-8 stdin. `--all` includes stale/archived records for listing;
168
+ it does not authorize sending. Claude accepts a PID, `claude:PID`, or an
169
+ unambiguous Unicode 14.0.0 casefolded name. Use a PID for collisions. Codex
170
+ send requires a full UUID; home selection follows the guards above; `--codex-bin` selects an executable.
171
+ Output requires `--json` or `--output-format json|text`.
172
+
173
+ ### Another machine over SSH
174
+
175
+ ```sh
176
+ session-peer send --host user@machine --remote-bin /absolute/path/session-peer \
177
+ --to CLAUDE_PID --message 'Please review the API contract.' --dry-run --json
178
+ ```
179
+
180
+ The default remote command is `session-peer` on remote PATH. An absolute
181
+ `--remote-bin` can select a wrapper using supported Node. The handshake checks
182
+ the TypeScript marker and exact version; a different implementation is refused.
183
+ SSH uses BatchMode and StrictHostKeyChecking. It never accepts new host keys,
184
+ installs a remote runtime or invokes Python as a fallback. Messages travel in a
185
+ JSON stdin request, not remote shell arguments. Arbitrary `--ssh-opt`, IPv6
186
+ literals and Tailscale canonical-name enrichment are not supported; use an SSH
187
+ alias/hostname. Forward access does not establish reverse access.
188
+
189
+ For a Windows SSH destination, add `--remote-platform win32` and select a
190
+ Windows `--remote-bin 'C:\absolute\path\session-peer.cmd'` if needed. A previously
191
+ authenticated OpenSSH control socket can be selected with
192
+ `--ssh-control-path /absolute/local/socket`; this does not bypass host-key
193
+ verification or grant a new login. For local Windows Codex commands, use a full
194
+ `C:\Users\...\.codex` path for `--codex-home`. The Python CLI, if present,
195
+ is not removed or replaced by this client.
196
+
197
+ ### Replies
198
+
199
+ Use a `session-peer://v1/reply?...` URI as `--to`. Unknown/duplicate fields,
200
+ unsafe hosts, malformed encoding and conflicting explicit routes are rejected.
201
+ `--reply-address URI` adds an explicit return address; no route is inferred or
202
+ verified automatically. Use `--no-reply-to` when replying without a new address.
203
+ A valid CODEX_THREAD_ID/CODEX_SESSION_ID supplies informational From metadata;
204
+ `--no-from` omits it. Unknown senders are not invented. Peer metadata is never
205
+ authority, and a Reply-To URI is never executed as shell text.
206
+
207
+ ## What success means
208
+
209
+ | Result | Meaning |
210
+ | --- | --- |
211
+ | `validated`, `submitted:false` | Dry-run checks passed; nothing sent. |
212
+ | `posted` / `queued` | Native inbox write / queue acceptance, **not consumption or ACK**. |
213
+ | `refused`, `submitted:false` | Rejected before submission. |
214
+ | `unknown`, `submitted:null` | Submission may have happened; do not automatically resend. |
215
+
216
+ After submission, a missing reply or a target exit alone does not establish
217
+ consumption or failure; do not automatically resend.
218
+
219
+ `consumptionConfirmed` is always false. Verify an actual ACK separately in the
220
+ receiver's TUI, not from queueing or transcript polling. Exit codes are 0/1/2
221
+ for success/error/usage. Errors use fixed codes instead of raw native stderr or
222
+ message content. Codex uses real kernel flock, file identity and same-user owner
223
+ start time across samples, then revalidates before queueing. No lock is deleted
224
+ and no owning agent process is signaled. Discovery output still contains local
225
+ names/paths/IDs: redact it before sharing.
226
+
227
+ ## Development and verification
228
+
229
+ ```sh
230
+ npm ci --ignore-scripts
231
+ npm run build
232
+ node scripts/check-repository.mjs
233
+ SESSION_PEER_PYTHON_ROOT=/path/to/python-reference npm test
234
+ npm run test:package
235
+ npm audit
236
+ ```
237
+
238
+ Python is only the development conformance oracle (v1.0.2 commit
239
+ `47c23713d0a2a3c11ebde6186afd8c43489b8b65`), never a runtime dependency. Tests also
240
+ need a C compiler and lsof for the POSIX contract suite. CI uses Node 22/24 on
241
+ macOS, Linux and Windows. macOS/Linux run the full contract suite and package
242
+ checks against the pinned reference. Windows x64 runs build/type checks, native
243
+ Claude inbox and held/free lock fixtures, writer ownership/revalidation races,
244
+ CLI queue outcomes, PowerShell/.cmd SSH framing through an isolated fake endpoint,
245
+ package install/native-load/uninstall checks and audit. These are fixture checks;
246
+ Windows does not run the POSIX/Python reference suite.
247
+ The Windows x64/Node 24 live ACKs are separate, one-shot evidence. Temporary
248
+ SQLite, Unix inbox and real lock fixtures are distinct from
249
+ the dedicated real-TUI evidence in [VALIDATION.md](../VALIDATION.md). A green fixture
250
+ test is not an ACK. Package tests inspect contents, repeat-pack hashes, clean
251
+ install and uninstall. The native dependency normally has an install script;
252
+ the verified prebuilt path uses `--ignore-scripts`. SQLite read-only readers may
253
+ participate in WAL shared-memory bookkeeping; they are not snapshots.
254
+
255
+ See [CONTRIBUTING.md](../CONTRIBUTING.md), [RELEASING.md](../RELEASING.md) and
256
+ [SECURITY.md](../SECURITY.md). Future publication remains manual and requires
257
+ separate approval. Licensed under [MIT](../LICENSE).
258
+
259
+ ## Package release
260
+
261
+ Version 0.2.0 was published and verified on 2026-09-28 KST; see the
262
+ [public release record](../VALIDATION.md#public-020--2026-09-28-kst). Check the
263
+ exact version and current tags before installing:
264
+
265
+ ```sh
266
+ npm view session-peer@0.2.0 version dist.integrity
267
+ npm view session-peer dist-tags
268
+ ```
269
+
270
+ The immutable 0.1.0 archive retained pre-publication README wording. This
271
+ archive uses versioned feature descriptions; dated release evidence remains in
272
+ [VALIDATION.md](../VALIDATION.md#public-010--2026-09-27-kst).
273
+
274
+ The release workflow uses Trusted Publisher OIDC staging and a maintainer's
275
+ separate 2FA approval. A staged upload is not a public release. See
276
+ [RELEASING.md](../RELEASING.md) for the process.
277
+
278
+ ## Related project
279
+
280
+ [Python session-peer](https://github.com/abruption/session-peer) is maintained
281
+ and released independently; its own optional features and installation guide
282
+ remain there (for example `pipx install session-peer`). Its command is also
283
+ `session-peer`, so apply the PATH guidance above. This client does not depend on
284
+ that installation or claim complete feature/flag parity.
285
+
286
+ ### Read-only diagnostics in 0.2.0
287
+
288
+ ```sh
289
+ session-peer doctor --json
290
+ session-peer doctor --agent codex --codex-home /absolute/home --json
291
+ session-peer doctor --host user@host --json
292
+ ```
293
+
294
+ This source command is not in published npm 0.1.0. Diagnostic success (`ok:true`,
295
+ exit 0) is separate from agent readiness (`ready` and per-agent/home results).
296
+ It inspects bounded metadata and executable paths without executing Codex,
297
+ connecting to inboxes, acquiring writer locks or submitting messages. Windows
298
+ inbox readiness means a live process advertises a pipe; it does not prove the
299
+ pipe exists or accepts connections. `capabilities` explicitly excludes
300
+ wake/wait/ACK and consumption confirmation. Optional TS skill metadata checks
301
+ never install anything. See [diagnostic boundaries](../PARITY.md#source-read-only-doctor--18--020).
302
+ SSH requires the same source build on both ends.
303
+ ## Agent skill: explicit installation
304
+
305
+ 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.
306
+
307
+ Review the [exact skill source](https://github.com/abruption/session-peer-skill/tree/081cc3c1d16a394bd92824333f4bc61c36951799/session-peer-ts),
308
+ then choose the agent and scope. This example selects **Codex, current project**;
309
+ run from that project directory. For Claude Code use `--agent claude-code`.
310
+ For user scope add `--global` consistently to add/list/remove. Inspect any existing
311
+ `session-peer-ts` copy for local edits before approving its replacement. Codex's
312
+ `.agents/skills` directory is shared with other clients that discover that path.
313
+
314
+ ```sh
315
+ 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
316
+ npx -y skills@1.7.0 list --agent codex --json
317
+ npx -y skills@1.7.0 remove session-peer-ts --agent codex --yes
318
+ ```
319
+
320
+ For a pinned update, review another exact commit and repeat `add` with the same
321
+ agent/scope. Restart the agent if its catalog is cached. Runtime and skill
322
+ lifecycles are independent: npm `--ignore-scripts` works, no postinstall invokes
323
+ Skills CLI, and installing this skill does not overwrite the Python skill or
324
+ install a runtime. See [compatibility and validation](../PARITY.md#source-ts-skill-guidance--25--020).