peertable 0.8.55 → 0.8.57

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.
Files changed (75) hide show
  1. package/README.ja.md +32 -33
  2. package/README.md +36 -37
  3. package/package.json +3 -1
  4. package/room/client.mjs +24 -33
  5. package/room/server.mjs +1 -1
  6. package/skill/SKILL.md +69 -94
  7. package/skill/scripts/aiterm-client.mjs +48 -0
  8. package/skill/scripts/aiterm-deliver.mjs +3 -1
  9. package/skill/scripts/change-seat.mjs +86 -0
  10. package/skill/scripts/change-seat.sh +3 -276
  11. package/skill/scripts/change-seat.test.mjs +129 -0
  12. package/skill/scripts/cli.mjs +77 -0
  13. package/skill/scripts/doctor.mjs +53 -0
  14. package/skill/scripts/doctor.sh +2 -213
  15. package/skill/scripts/ensure-all-bridges.mjs +42 -0
  16. package/skill/scripts/ensure-all-bridges.sh +3 -80
  17. package/skill/scripts/ensure-bridge.mjs +11 -0
  18. package/skill/scripts/ensure-bridge.sh +2 -95
  19. package/skill/scripts/ensure-codex-room-mcp.mjs +1 -1
  20. package/skill/scripts/ensure-project-runtime.mjs +85 -0
  21. package/skill/scripts/ensure-project-runtime.sh +2 -11
  22. package/skill/scripts/ensure-project-runtime.test.mjs +40 -0
  23. package/skill/scripts/install-skill.mjs +89 -0
  24. package/skill/scripts/install-skill.test.mjs +84 -0
  25. package/skill/scripts/launch-seat.mjs +163 -0
  26. package/skill/scripts/launch-seat.sh +3 -797
  27. package/skill/scripts/launch-seat.test.mjs +174 -0
  28. package/skill/scripts/leave-seat.mjs +44 -0
  29. package/skill/scripts/leave-seat.sh +3 -92
  30. package/skill/scripts/leave-seat.test.mjs +64 -0
  31. package/skill/scripts/legacy-entry.mjs +33 -0
  32. package/skill/scripts/platform/windows/resolve-lattice-command.mjs +12 -1
  33. package/skill/scripts/project-runtime.mjs +95 -0
  34. package/skill/scripts/project-runtime.test.mjs +29 -0
  35. package/skill/scripts/project-scaffold.mjs +179 -0
  36. package/skill/scripts/project-scaffold.test.mjs +129 -0
  37. package/skill/scripts/refresh-seat-identity.mjs +11 -8
  38. package/skill/scripts/remove-managed-room-mcp.mjs +9 -4
  39. package/skill/scripts/resume.sh +2 -225
  40. package/skill/scripts/room-api.mjs +28 -0
  41. package/skill/scripts/room-public-session.test.mjs +73 -0
  42. package/skill/scripts/runtime-contract.test.mjs +13 -146
  43. package/skill/scripts/runtime-launch-command.mjs +19 -0
  44. package/skill/scripts/runtime-launch-command.test.mjs +32 -0
  45. package/skill/scripts/seat-approval.mjs +24 -0
  46. package/skill/scripts/seat-approval.test.mjs +43 -0
  47. package/skill/scripts/seat-identity.mjs +2 -71
  48. package/skill/scripts/seat-launch-phase.mjs +11 -0
  49. package/skill/scripts/seat-observer.mjs +54 -0
  50. package/skill/scripts/seat-observer.test.mjs +58 -0
  51. package/skill/scripts/seat-session.mjs +17 -0
  52. package/skill/scripts/seat-status-bridge.mjs +33 -206
  53. package/skill/scripts/seat-usage.mjs +3 -334
  54. package/skill/scripts/setup.sh +3 -215
  55. package/skill/scripts/teardown.mjs +113 -0
  56. package/skill/scripts/teardown.sh +3 -410
  57. package/skill/scripts/teardown.test.mjs +62 -0
  58. package/skill/scripts/upgrade-team-assets.mjs +268 -0
  59. package/skill/scripts/upgrade-team-assets.sh +2 -282
  60. package/skill/scripts/wakeup-bridge.mjs +26 -32
  61. package/skill/scripts/wakeup-delivery.mjs +4 -14
  62. package/skill/templates/charter.md +1 -1
  63. package/skill/templates/member-standalone.md +1 -1
  64. package/skill/templates/member.md +3 -3
  65. package/skill/scripts/agent-pane-status.mjs +0 -6
  66. package/skill/scripts/aiterm-configure.mjs +0 -31
  67. package/skill/scripts/aiterm-launch.mjs +0 -64
  68. package/skill/scripts/aiterm-send.mjs +0 -22
  69. package/skill/scripts/claude-dialog.mjs +0 -26
  70. package/skill/scripts/codex-dialog.mjs +0 -67
  71. package/skill/scripts/platform/windows/build-bridge-command.mjs +0 -52
  72. package/skill/scripts/seat-input.mjs +0 -36
  73. package/skill/scripts/tmux-at.bash +0 -22
  74. package/skill/scripts/tmux-socket.mjs +0 -19
  75. package/skill/scripts/vendors/grok/pane-status.mjs +0 -30
package/README.ja.md CHANGED
@@ -37,7 +37,7 @@ Peertable はこれを裏返す:
37
37
  | **計画** | [Lattice](https://www.npmjs.com/package/@quolu/lattice)(**任意**——下記) | タスクグラフ(依存・状態・証跡)。「今取れるタスク」は機械的に出るので、会話は判断だけに使う |
38
38
  | **成果物** | git | コード・文書・commit |
39
39
 
40
- 各メンバーには同じroom MCPクライアントが載る。Claudeはchannels、CodexとGrokは席の TUI へ新着を入れる。broadcastは本文(claim・試験・完了)を載せ、Codexはターン中に混ぜ、Grokはidleになってから入れる。roomの同じログとツールを使う。
40
+ 各メンバーは同じroom MCPクライアントでログを読み書きする。新着はwakeup bridgeがAitermの公開APIで届け、投入が成立した宛先ごとに配送記録を残す。broadcastは本文(claim・試験・完了)を保ち、Codexはターン中のsteer、Grokはidle後のdispatchを使う。
41
41
 
42
42
  ### ロックなしの調整
43
43
 
@@ -47,7 +47,7 @@ Peertable はこれを裏返す:
47
47
 
48
48
  円卓そのものは最初から Lattice に依存していない。依存しているのは**仕事の取り出し口だけ**なので、setup でどちらか選ぶ:
49
49
 
50
- | | **Lattice 併用**(既定) | **単独** |
50
+ | | **Lattice 併用** | **単独** |
51
51
  |---|---|---|
52
52
  | 仕事の取り出し口 | 依存を解いた ready 集合が機械的に出る | `.team/tasks.md`(setup 時に書く読み取り専用の議題表) |
53
53
  | claim と完了 | room の宣言 + `todo start` / `done` 記録 | room の宣言だけ |
@@ -59,65 +59,64 @@ Peertable はこれを裏返す:
59
59
 
60
60
  ## クイックスタート
61
61
 
62
- ```bash
63
- npm install -g peertable
62
+ Node.js 24以降、Aiterm 0.33.0以降の公開MCP、使うAIの公式CLIと認証を準備する。WindowsではPowerShell 7を使う。PTYの準備・harnessの起動と観測はAitermに任せる。
63
+
64
+ ```sh
65
+ npm install -g peertable@latest
66
+ peertable diagnostics
64
67
  ```
65
68
 
66
- **1. room サーバーを立てる**(localhost でも自宅サーバーでもどこでも):
69
+ global installは、検出したClaude・Codex・Grok・Cursorのスキル置き場へPeertableだけを配置・更新する。AIの設定本文や他製品のMCPは変更しない。再実行は`peertable install`、対象指定は`--target codex`など。同じ配置は維持し、別製品のリンクや利用者の実ディレクトリとの衝突は変更前に止まる。installは既存projectやroomを再構築しない。
70
+
71
+ **1. roomサーバーを起動する。**
67
72
 
68
- ```bash
73
+ ```sh
69
74
  peertable-room
70
- # または Docker(本リポジトリから):
71
- docker compose -f deploy/compose.yaml up -d
72
75
  ```
73
76
 
74
- `http://localhost:8790` を開くと、全 room にライブ Web ビュー(SSE)が付く。**Web UI は観戦専用**——書込は全て API 経由で、`PEERTABLE_POST_TOKEN` 設定時はトークン必須。外から届く設置では必ずトークンを設定する。
75
-
76
- ライブビューはメンバーごとに harness / model / effort / role と**稼働状態**(作業中・待機・**承認待ち**(許可ダイアログで止まっている)・停止)を出す。作業中の席はアイコンが動き、完了宣言(`[done]` / `[完了]` / `受理:` 等)の瞬間に席の上へ印が浮く。状態変化は SSE で押し込むので、30秒の再取得を待たず観測周期(約8秒)で切り替わる。発言にはログ番号(`[123]`)が付き、ライブ新着はブロック単位で現れる。**点が付かない席は「誰も報告していない席」**——状態の送信は別プロセス(スキルが起こす)で、**書けない時は常駐せずに死ぬ**ので「起きているのに黙っている」状態は存在しない。
77
+ 既定の閲覧先は`http://localhost:8790`。Docker常駐のreleaseとrollbackは[配備手順](https://github.com/kitepon/peertable/blob/main/deploy/README.md)を使う。Web UIは閲覧専用で、書込はAPIから行う。`PEERTABLE_POST_TOKEN`を設定したサーバーは書込tokenを要求する。利用端末の資格はPeertableのcredential設定へ保存し、席へはcredential fileのpathだけを渡す。
77
78
 
78
- 観測先は**席自身が名乗る**(`observe: {tmux_socket, tmux_target}`)。席の起動スクリプトと、席の中で動く MCP クライアントの両方が自分の tmux socket / session を登録するので、**スキル以外の経路で立てた席(aiterm の素の pane など)もそのまま観測対象になる**。表示名から `peer-<名前>` を推測しないので、任意のセッション名で立てた席が消える問題は起きない。名乗っていない古い席だけが従来の推測へ落ちる。常駐は専用 tmux セッションが保持し、**起動側は「起こした」ではなく「最初の観測が届いた」ことを確かめてから成功を返す**(確かめられなければログ末尾を出して非ゼロで落ちる)。
79
+ **2. 対象projectを明示して準備する。**
79
80
 
80
- API: `GET /api/<room>/messages` / `members` / `members/<name>` / `summary`(約120バイト・`seq`・`last_ts`・`member_count`)/ `events`(SSE)、`POST /api/<room>/messages` / `members`。
81
+ ```sh
82
+ peertable setup <project> --room <room> --url http://localhost:8790 --tasks <tasks-file>
83
+ peertable launch <project> <name> --roles <role> --brief <着任指示>
84
+ ```
81
85
 
82
- **部屋がメンバーの唯一の台帳である。** メンバーに帰属する情報——素性(harness / model / effort / roles / mission)・観測先(`observe`)・稼働状態・プロセス本人性(pid / 起動時刻 / argv digest)——は room サーバー内蔵の SQLite(`node:sqlite`・`/data/room.db`・Node 24+ 必須)の**1行**に全部入る。欄ごとに書き手は1人(素性=席自身の MCP クライアント、本人性=ランチャー、状態=状態ブリッジ)。席ファイルも重複欄も無く、全ての読者は台帳を読む。旧 `members.json` は初回起動で一度だけ取り込まれる。
86
+ tasks-fileは単独モードの議題本文。Lattice併用を明示した場合は`--tasks`の代わりに`--plan <plan-key>`を使う。役割の正式名と着席配置は同梱snapshotを参照する。スキルに「このprojectに円卓を立てて」と頼む場合も同じ入口を使う。
83
87
 
84
- **2. Claude Code のメンバーを着席させる。** room MCP 定義は**プロジェクト root `.mcp.json`** に置く:
88
+ setupは`.team/`とroom MCPを準備し、alarm・seat-status・wakeup3 bridgeを起動・更新してreadyを確認する。既存の`.mcp.json`にある他製品の設定は保ち、Peertableが追加したroom blockだけを管理する。別のroom設定との衝突はエラーで知らせる。launchはモデル実測、Aitermによる起動準備、room登録、本人性、着任指示の実ターン開始までを確認する。
85
89
 
86
- ```jsonc
87
- // <project>/.mcp.json
88
- { "mcpServers": { "room": { "command": "peertable-client", "args": [] } } }
89
- ```
90
+ **3. 再開・診断・解散も対象を明示する。**
90
91
 
91
- ```bash
92
- export PEERTABLE_URL=http://localhost:8790 PEERTABLE_ROOM=myproject PEERTABLE_MEMBER=hinata
93
- claude --dangerously-load-development-channels server:room
92
+ ```sh
93
+ peertable resume <project>
94
+ peertable diagnostics <project>
95
+ peertable teardown <project>
94
96
  ```
95
97
 
96
- **`--mcp-config` で渡してはいけない。** channels はその経路の MCP server を解決せず、バナーに `server:room · no MCP server configured with that name` が出て**room の配達だけが黙って死ぬ**(Claude Code v2.1.226 で実測・決定44)。スキルを使えば自動で置かれ、teardown で戻る。
97
-
98
- Codex では、スキルが所有する room MCP block をプロジェクトの `.codex/config.toml` へ置く。`.mcp.json` だけは Codex の設定入口にならず、席固有のroom環境も同じスキル起動経路が渡す。Grok Buildはproject rootの`.mcp.json`を読み、Aitermの`grok_agent`からmodel・effort・席固有envを受け取る。CodexとGrokの新着は同じ経路で席の TUI へ入る。Codexは即送信(ターン中のsteering)。Grok TUIはターン中の素送信を次のuserターンへ積むので、配達はidleを待ってから送る。親は通常席の TUI 配達に載せない——ClaudeとGrok親は`parent-watch --follow`、Codex親はpoll。
98
+ setupの再実行も既存projectではresumeへ進み、room・議題・生存席を保つ。resumeは生成物と3 bridgeを更新し、停止席の復帰、fresh heartbeat、probe配達を確認する。診断の`--repair`はbridgeを修復する。
99
99
 
100
- Windows工場hostはPowerShell 7(`pwsh.exe`)を前提とし、5.1しかなければMicrosoft公式installer/package managerで7を導入してから使う。永続PTYはAitermが所有し、psmuxはそのWindows backendであってshellではない。Peertableに残るmux直接観測はAiterm公開APIへ移行中であり、psmuxを一般の製品前提にはしない。
100
+ teardownの既定は解散。席と所有する足場を撤去し、roomと過去ログ、Lattice storeを残す。`--purge`はroomと新設storeも削除する。既存設定・無関係な作業差分は保つ。停止またはroom操作に失敗した場合は再実行用の記録を残してエラーを返す。
101
101
 
102
- 既存roomの`resume.sh`は、最初にPeertable所有generated assetとroot room MCP blockを現行package treeへ更新する。利用者が先に持っていた`.mcp.json`は書き換えず、room blockの明示mergeを要求する。
102
+ 親は呼出し元のセッションに着卓し、親宛DMの監視イベントを実際に受信して確認する。親の耳疎通、kickoffの引受確認、席設定変更の手順は[同梱スキル](skill/SKILL.md)にまとめている。
103
103
 
104
- **3. あるいはスキルに全部やらせる** `skill/` を `~/.claude/skills/peertable` にリンクして、セッションに一言:
104
+ **roomがメンバーの唯一の台帳。** harness・model・effort・roles・mission、Aitermの公開session ID、稼働状態、プロセス本人性をSQLiteのmember行に保持する。room clientは公開`AITERM_SESSION_ID`を名乗り、状態bridgeは`pty_observe`の構造化結果を使う。PeertableはAitermの内部ファイル、socket、namespace、画面文言を解析しない。
105
105
 
106
- > 円卓を立てて
106
+ メンバーカードは名前・状態の丸・役割を表示し、詳細からmodel等を確認できる。roomへの保存と配達成立は別の事実で、`post`の`room_saved`は保存、宛先別の`delivered`は投入成立のreceiptを表す。`members`はserverが計算した実効状態とbridge healthを返す。Codexのbusy中は公開steer、Grokはidle待ちで配達する。Claudeも公開配達APIを使い、未知の承認や判定不能を成功へ丸めない。
107
107
 
108
- 聞き取り・命名・`.team/` scaffold(プロジェクト本体を汚さない)・Lattice plan 投入(単独モードなら読み取り専用の `.team/tasks.md` 生成)・メンバー起動・親の着卓まで一続き。
108
+ API: `GET /api/<room>/messages`・`members`・`members/<name>`・`summary`・`events`、`POST /api/<room>/messages`・`members`。MCPには`post`・`read_unread`・`read_log`・`members`・`delivery_status`を提供する。
109
109
 
110
- **teardown は既定で「解散」**——席を畳んでメンバー登録を外し、`.team/` と `.mcp.json` を撤去する。**部屋と過去ログは残る**(部屋は場所であり、次の卓も同じ部屋で続く。過去ログはその部屋の履歴として繋がる)。工程正本 `.lattice/` も残す。**痕跡ゼロに戻したいなら `--purge`**——部屋ごと削除してプロジェクトを diff ゼロへ返す(ゲストのプロジェクトで試した時はこちら)。
111
110
 
112
111
  ## 状態
113
112
 
114
113
  動いており、**自分自身の開発に使っている**。2026-08-08 に end-to-end 検証済み——オーケストレーターなしの完全な一周(2 メンバーが相談し、claim し、インターフェースを交渉し、見つけた罠を共有して小さなプロジェクトを出荷)を**外部介入ゼロ**で完走。2026-08-13の実席ライフサイクルでは、作業席が親を通じてsession contextを保ったままmodel / effortを変更し、再起動後はroomと工程正本から再着任した。2026-08-14にはGrok 4.6席の着席、room参加、同一sessionの4.6↔4.5変更、DM起床を実機で確認した。2026-08-17にGrok席はidle待ち、broadcastは本文を残し、tmuxの無い親でbridge cursorが止まらないよう直した。
115
114
 
116
- 現在のnpm releaseは **peertable 0.8.40**。
115
+ 公開版は[npmのPeertable](https://www.npmjs.com/package/peertable)を参照。
117
116
 
118
117
  製品の現行契約は [docs/current-design.md](https://github.com/kitepon/peertable/blob/main/docs/current-design.md)。完了計画と累積decision logは`docs/archive/`へ置き、現行文書の地図は [docs/00_overview.md](https://github.com/kitepon/peertable/blob/main/docs/00_overview.md) を正とする。
119
118
 
120
- Claude Code channels はリサーチプレビューのため、フラグ・プロトコルは変わりうる。
119
+ Claude Code channelsを使う接続では、公式の対応範囲と起動条件に従う。通常の席への配送はAitermの公開APIで確認する。
121
120
 
122
121
  ## ライセンス
123
122
 
package/README.md CHANGED
@@ -59,7 +59,7 @@ Three layers, cleanly separated:
59
59
  | **Plan** | [Lattice](https://www.npmjs.com/package/@quolu/lattice) *(optional — see below)* | the task graph: dependencies, states, evidence. What's *ready* is computed, so conversation is spent only on judgment |
60
60
  | **Artifacts** | git | code, docs, commits — per member, path-scoped |
61
61
 
62
- Every member runs the same room MCP client. Claude receives arrivals through channels; Codex and Grok use the wake-up bridge. Broadcasts carry their body (claims, test results, completions); Codex is steered mid-turn, Grok is woken only when idle. All three read and write the same room log with the same tools.
62
+ 各メンバーは同じroom MCPクライアントでログを読み書きする。新着はwakeup bridgeがAitermの公開APIで届け、投入が成立した宛先ごとに配送記録を残す。broadcastは本文(claim・試験・完了)を保ち、Codexはターン中のsteer、Grokidle後のdispatchを使う。
63
63
 
64
64
  ### Coordination without locks
65
65
 
@@ -69,7 +69,7 @@ Task exclusivity is **declaration-based**: claiming is a `[claim] task-id` messa
69
69
 
70
70
  The round table itself never depended on Lattice — only the *work intake* did. So setup asks which one you want:
71
71
 
72
- | | **With Lattice** (default) | **Standalone** |
72
+ | | **With Lattice** | **Standalone** |
73
73
  |---|---|---|
74
74
  | Work intake | dependency-aware ready set, computed | `.team/tasks.md` — a read-only agenda written at setup |
75
75
  | Claim & completion | room declaration + `todo start` / `done` records | room declaration only |
@@ -83,77 +83,76 @@ Standalone gives up machine-guaranteed scheduling across tasks — nothing else.
83
83
  ```
84
84
  room/ room server (zero-dependency Node) + per-session MCP channel client
85
85
  skill/ "peertable" skill for Claude Code: setup / disband (teardown) of a full table,
86
- plus the seat launcher and the wake-up / seat-state / run bridges
86
+ plus the seat launcher and the wake-up / seat-state / alarm bridges
87
87
  deploy/ compose + Caddy snippet for running the room server as a resident service
88
88
  docs/ current-design.md — the current product contract (Japanese),
89
89
  plus one plan_*.md per active campaign and archived history
90
90
  evidence/ per-task completion evidence referenced by the Lattice plan store
91
91
  experiments/ verification harnesses — one per pitfall we actually hit, each pinning the
92
92
  behaviour so it cannot silently regress (channels, Lattice concurrency, the full
93
- loop, pane-state classification, token resolution, teardown, …)
93
+ loop, 公開APIの状態対応, token resolution, teardown, …)
94
94
  ```
95
95
 
96
- ## Quick start
96
+ ## クイックスタート
97
97
 
98
- ```bash
99
- npm install -g peertable
98
+ Node.js 24以降、Aiterm 0.33.0以降の公開MCP、使うAIの公式CLIと認証を準備する。WindowsではPowerShell 7を使う。PTYの準備・harnessの起動と観測はAitermに任せる。
99
+
100
+ ```sh
101
+ npm install -g peertable@latest
102
+ peertable diagnostics
100
103
  ```
101
104
 
102
- **1. Run a room server** (yours can live on `localhost` or any box you own):
105
+ global installは、検出したClaude・Codex・Grok・Cursorのスキル置き場へPeertableだけを配置・更新する。AIの設定本文や他製品のMCPは変更しない。再実行は`peertable install`、対象指定は`--target codex`など。同じ配置は維持し、別製品のリンクや利用者の実ディレクトリとの衝突は変更前に止まる。installは既存projectやroomを再構築しない。
103
106
 
104
- ```bash
105
- peertable-room # PEERTABLE_PORT=8790 PEERTABLE_DATA=./peertable-data
106
- # or with Docker, from this repo:
107
- docker compose -f deploy/compose.yaml up -d
108
- ```
107
+ **1. roomサーバーを起動する。**
109
108
 
110
- Open `http://localhost:8790` — every room gets a live web view (SSE). **The web UI is spectator-only**: all writes go through the API and require `PEERTABLE_POST_TOKEN` when set. Set the token whenever the server is reachable from outside.
109
+ ```sh
110
+ peertable-room
111
+ ```
111
112
 
112
- The live view shows, per member: harness / model / reasoning effort / role, and a **working state** — 作業中 (busy) · 待機 (idle) · 承認待ち (blocked on a permission prompt) · 停止 (dead). A busy seat's avatar animates; a completion (`[done]` / `[完了]` / `受理:` …) pops a marker over the seat. State changes are pushed over SSE, so the icon turns within the observer's polling interval (~8s), not on the next 30-second refresh. Messages carry their log number (`[123]`) for quoting, and live arrivals reveal block by block. **A seat with no dot is one nobody is reporting on** — the state feed is a separate opt-in process (the skill starts it for you), and it refuses to run if it cannot write, so "running but silent" cannot happen.
113
+ 既定の閲覧先は`http://localhost:8790`。Docker常駐のreleaseとrollbackは[配備手順](https://github.com/kitepon/peertable/blob/main/deploy/README.md)を使う。Web UIは閲覧専用で、書込はAPIから行う。`PEERTABLE_POST_TOKEN`を設定したサーバーは書込tokenを要求する。利用端末の資格はPeertableのcredential設定へ保存し、席へはcredential fileのpathだけを渡す。
113
114
 
114
- Seats **declare where to watch them** (`observe: {tmux_socket, tmux_target}`). Both the seat launcher and the MCP client running inside the seat register their own tmux socket and session, so **a seat you started outside the skill — a bare aiterm pane, say — is observed too**. Nothing infers `peer-<name>` from the display name, so a seat under an arbitrary session name no longer vanishes from the view; only seats that never declared fall back to the old guess. The state feed lives in its own tmux session, and whatever starts it waits for the **first observation to land** before reporting success — not merely for a process to exist. If it never lands, the starter prints the log tail and exits non-zero.
115
+ **2. 対象projectを明示して準備する。**
115
116
 
116
- Endpoints: `GET /api/<room>/messages` · `GET /api/<room>/members` · `GET /api/<room>/members/<name>` · `GET /api/<room>/summary` (≈120 bytes: `seq`, `last_ts`, `member_count`) · `GET /api/<room>/events` (SSE) · `POST /api/<room>/messages` · `POST /api/<room>/members`.
117
+ ```sh
118
+ peertable setup <project> --room <room> --url http://localhost:8790 --tasks <tasks-file>
119
+ peertable launch <project> <name> --roles <role> --brief <着任指示>
120
+ ```
117
121
 
118
- **The room is the single member ledger.** Everything that belongs to a member — identity (harness / model / effort / roles / mission), where to observe it (`observe`), its working state, and its process identity (pid / start time / argv digest) — lives in one SQLite row inside the room server (`node:sqlite`, `/data/room.db`; requires Node 24+). One writer per field group: the seat's own MCP client registers identity, the launcher registers process identity, the state feed writes status. No seat files, no duplicated fields — every consumer reads the ledger. A legacy `members.json` is imported once on first boot.
122
+ tasks-fileは単独モードの議題本文。Lattice併用を明示した場合は`--tasks`の代わりに`--plan <plan-key>`を使う。役割の正式名と着席配置は同梱snapshotを参照する。スキルに「このprojectに円卓を立てて」と頼む場合も同じ入口を使う。
119
123
 
120
- **2. Seat a Claude Code member session.** The room MCP definition must live in the **project-root `.mcp.json`**:
124
+ setupは`.team/`とroom MCPを準備し、alarm・seat-status・wakeupの3 bridgeを起動・更新してreadyを確認する。既存の`.mcp.json`にある他製品の設定は保ち、Peertableが追加したroom blockだけを管理する。別のroom設定との衝突はエラーで知らせる。launchはモデル実測、Aitermによる起動準備、room登録、本人性、着任指示の実ターン開始までを確認する。
121
125
 
122
- ```jsonc
123
- // <project>/.mcp.json
124
- { "mcpServers": { "room": { "command": "peertable-client", "args": [] } } }
125
- ```
126
+ **3. 再開・診断・解散も対象を明示する。**
126
127
 
127
- ```bash
128
- export PEERTABLE_URL=http://localhost:8790 PEERTABLE_ROOM=myproject PEERTABLE_MEMBER=hinata
129
- claude --dangerously-load-development-channels server:room
128
+ ```sh
129
+ peertable resume <project>
130
+ peertable diagnostics <project>
131
+ peertable teardown <project>
130
132
  ```
131
133
 
132
- **Do not pass it via `--mcp-config`.** Channels do not resolve MCP servers given that way: the banner prints `server:room · no MCP server configured with that name` and room delivery goes silent while everything else looks fine (measured on Claude Code v2.1.226; [archived decision 44](https://github.com/kitepon/peertable/blob/main/docs/archive/plan.md)). The skill handles this for you and reverts the file on teardown.
133
-
134
- The member gets five tools — `post`, `read_unread`, `read_log`, `members`, `delivery_status` — and a channel that wakes it whenever teammates address it. `post` returns `room_saved` plus a per-recipient `delivery` breakdown (delivered / pending / seat_unavailable / bridge_unavailable / failed): saving to the room is not the same fact as reaching a seat's TUI, and `delivered` is only ever written by the wakeup bridge after the injection actually lands. `members` includes each seat's server-computed effective status (fresh / stale / bridge down / auth failed) and bridge health. (`--dangerously-load-development-channels` is required while channels are in research preview; custom channels aren't on the allowlist yet.)
134
+ setupの再実行も既存projectではresumeへ進み、room・議題・生存席を保つ。resumeは生成物と3 bridgeを更新し、停止席の復帰、fresh heartbeat、probe配達を確認する。診断の`--repair`はbridgeを修復する。
135
135
 
136
- For Codex, the skill instead installs its owned room MCP block in the project's `.codex/config.toml`; `.mcp.json` alone is not a Codex configuration path. Grok Build reads the project-root `.mcp.json`. Aiterm's `grok_agent` supplies its model, reasoning effort, and seat-specific environment; Codex and Grok receive arrivals through the same wake-up bridge. The bridge sends Codex immediately (mid-turn steering). Grok's TUI queues mid-turn paste as the *next* user turn, so the bridge waits until that seat is idle. The parent hat is never a wake-up target — Claude and Grok parents use `parent-watch --follow`; Codex parents poll.
136
+ teardownの既定は解散。席と所有する足場を撤去し、roomと過去ログ、Lattice storeを残す。`--purge`はroomと新設storeも削除する。既存設定・無関係な作業差分は保つ。停止またはroom操作に失敗した場合は再実行用の記録を残してエラーを返す。
137
137
 
138
- On Windows factory hosts, PowerShell 7 (`pwsh.exe`) is required; install it through Microsoft's official installer or package manager before operating the table. Aiterm owns persistent PTYs and uses psmux as its Windows backend. psmux is a terminal/session multiplexer, not a shell. Peertable is migrating its remaining legacy mux observations to Aiterm's public API and does not make psmux a general product prerequisite.
138
+ 親は呼出し元のセッションに着卓し、親宛DMの監視イベントを実際に受信して確認する。親の耳疎通、kickoffの引受確認、席設定変更の手順は[同梱スキル](skill/SKILL.md)にまとめている。
139
139
 
140
- `resume.sh` first upgrades Peertable-owned generated assets and the Peertable-owned root room MCP block to the current package tree. A project-owned pre-existing `.mcp.json` is never rewritten; merge its room block explicitly.
140
+ **roomがメンバーの唯一の台帳。** harness・model・effort・roles・mission、Aitermの公開session ID、稼働状態、プロセス本人性をSQLiteのmember行に保持する。room clientは公開`AITERM_SESSION_ID`を名乗り、状態bridgeは`pty_observe`の構造化結果を使う。PeertableはAitermの内部ファイル、socket、namespace、画面文言を解析しない。
141
141
 
142
- **3. Or let the skill do all of it** — link `skill/` as `~/.claude/skills/peertable`, then tell your session:
142
+ メンバーカードは名前・状態の丸・役割を表示し、詳細からmodel等を確認できる。roomへの保存と配達成立は別の事実で、`post`の`room_saved`は保存、宛先別の`delivered`は投入成立のreceiptを表す。`members`はserverが計算した実効状態とbridge healthを返す。Codexのbusy中は公開steer、Grokはidle待ちで配達する。Claudeも公開配達APIを使い、未知の承認や判定不能を成功へ丸めない。
143
143
 
144
- > 円卓を立てて / "set up a peertable for this project"
144
+ API: `GET /api/<room>/messages`・`members`・`members/<name>`・`summary`・`events`、`POST /api/<room>/messages`・`members`。MCPには`post`・`read_unread`・`read_log`・`members`・`delivery_status`を提供する。
145
145
 
146
- It interviews you, names the members, scaffolds `.team/` (charter + roles, isolated from your project, `.git/info/exclude`d), seeds the Lattice plan — or writes the read-only `.team/tasks.md` agenda if you chose standalone — launches the member sessions, and seats itself beside the table. `teardown` disbands by default: it closes the seats, removes the member registrations, and clears `.team/` — **the room and its history stay** (a room is a place; the next table continues in the same room, so past logs read as that room's history), and the `.lattice/` plan store is kept. Pass `--purge` to delete the room too and restore your project to a zero diff.
147
146
 
148
147
  ## Status
149
148
 
150
149
  Working, and used to build itself. First verified end-to-end on 2026-08-08 with a full no-orchestrator loop: two members consulted, claimed, negotiated an interface, shared a discovered pitfall, and shipped a small project with **zero external intervention**. A 2026-08-13 real-seat lifecycle verified in-place model/effort changes and restart recovery. On 2026-08-14, a Grok 4.6 seat joined the room, changed 4.6↔4.5 in the same session, and woke on a direct message in a live acceptance run. On 2026-08-17 the wake-up path was corrected so Grok seats wait for idle, broadcasts keep their body, and a parent without a tmux seat cannot stall the bridge cursor.
151
150
 
152
- The current npm release is **peertable 0.8.55**.
151
+ 公開版は[npmのPeertable](https://www.npmjs.com/package/peertable)を参照。
153
152
 
154
153
  The current product contract is [docs/current-design.md](https://github.com/kitepon/peertable/blob/main/docs/current-design.md). Completed plans and the cumulative decision log are kept under `docs/archive/`; the current document map is [docs/00_overview.md](https://github.com/kitepon/peertable/blob/main/docs/00_overview.md).
155
154
 
156
- Depends on Claude Code **channels**, currently a research preview — flags and protocol may change.
155
+ Claude Code channelsを使う接続では、公式の対応範囲と起動条件に従う。通常の席への配送はAitermの公開APIで確認する。
157
156
 
158
157
  ## License
159
158
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peertable",
3
- "version": "0.8.55",
3
+ "version": "0.8.57",
4
4
  "description": "A round table of peer agents. No orchestrator at the head. Turn Claude Code, Codex, and Grok sessions into a team of equal, long-lived peers.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,11 +25,13 @@
25
25
  "channels"
26
26
  ],
27
27
  "scripts": {
28
+ "postinstall": "node skill/scripts/install-skill.mjs --postinstall",
28
29
  "verify:release-commit": "node scripts/verify-release-commit.mjs",
29
30
  "test:docs": "node --test scripts/docs-contract.test.mjs",
30
31
  "prepublishOnly": "node scripts/prepublish.mjs"
31
32
  },
32
33
  "bin": {
34
+ "peertable": "skill/scripts/cli.mjs",
33
35
  "peertable-room": "room/server.mjs",
34
36
  "peertable-client": "room/client.mjs"
35
37
  },
package/room/client.mjs CHANGED
@@ -14,7 +14,7 @@ import { boundedRecent, boundedUnread } from './message-bounds.mjs'
14
14
 
15
15
  // client.mjs 側のハードコード版数。package.json の version と一致していることを
16
16
  // diagnostics の version_consistency が見る(2 つの版数源の drift 検出。決定45)
17
- const MCP_VERSION = '0.8.55'
17
+ const MCP_VERSION = '0.8.57'
18
18
  const PKG_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
19
19
 
20
20
  const USAGE = `usage:
@@ -209,34 +209,8 @@ await mcp.connect(new StdioServerTransport())
209
209
  // 登録は client の起動ごとに繰り返し起きるので、1回きりの経路に置くと
210
210
  // member の状態が失われた時に二度と戻らない(server 側は渡された欄だけ更新する upsert)
211
211
  function observeSelf() {
212
- const named = process.env.PEERTABLE_MEMBER ? `peer-${process.env.PEERTABLE_MEMBER}` : ''
213
- const handed = process.env.PEERTABLE_TMUX_SOCKET
214
- if (handed && named) {
215
- return { tmux_socket: handed, tmux_target: named, tmux_namespace: handed }
216
- }
217
- if (!process.env.TMUX) {
218
- process.stderr.write('peertable-client: observe unavailable: TMUX 不在\n')
219
- return null
220
- }
221
- if (!process.env.TMUX_PANE) {
222
- process.stderr.write('peertable-client: observe unavailable: TMUX_PANE 不在\n')
223
- return null
224
- }
225
- const socket = process.env.TMUX.split(',')[0]
226
- if (!socket) {
227
- process.stderr.write('peertable-client: observe unavailable: TMUX の socket が空\n')
228
- return null
229
- }
230
- try {
231
- const target = execFileSync('tmux', ['-S', socket, 'display-message', '-p', '-t', process.env.TMUX_PANE, '#S'], {
232
- encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'],
233
- }).trim()
234
- if (!target) throw new Error('session 名が空')
235
- return { tmux_socket: socket, tmux_target: target }
236
- } catch (error) {
237
- process.stderr.write(`peertable-client: observe unavailable: ${error.message}\n`)
238
- return null
239
- }
212
+ const session = process.env.AITERM_SESSION_ID
213
+ return session ? { aiterm_session_id: session } : null
240
214
  }
241
215
 
242
216
  {
@@ -258,6 +232,7 @@ const IDENTITY = Object.fromEntries(Object.entries({
258
232
  effort: process.env.PEERTABLE_EFFORT,
259
233
  roles,
260
234
  mission: process.env.PEERTABLE_MISSION,
235
+ aiterm_session_id: process.env.AITERM_SESSION_ID,
261
236
  observe,
262
237
  }).filter(([, v]) => v != null && v !== '' && !(Array.isArray(v) && v.length === 0)))
263
238
  {
@@ -383,8 +358,21 @@ async function runDiagnostics(asJson) {
383
358
  'scripts/external-pane.mjs',
384
359
  'scripts/launch-seat.sh',
385
360
  'scripts/resolve-seat-placement.mjs',
386
- 'scripts/tmux-at.bash',
387
- 'scripts/tmux-socket.mjs',
361
+ 'scripts/cli.mjs',
362
+ 'scripts/install-skill.mjs',
363
+ 'scripts/project-scaffold.mjs',
364
+ 'scripts/project-runtime.mjs',
365
+ 'scripts/legacy-entry.mjs',
366
+ 'scripts/launch-seat.mjs',
367
+ 'scripts/leave-seat.mjs',
368
+ 'scripts/change-seat.mjs',
369
+ 'scripts/teardown.mjs',
370
+ 'scripts/doctor.mjs',
371
+ 'scripts/room-api.mjs',
372
+ 'scripts/aiterm-client.mjs',
373
+ 'scripts/seat-session.mjs',
374
+ 'scripts/seat-observer.mjs',
375
+ 'scripts/seat-approval.mjs',
388
376
  'scripts/seat-identity.mjs',
389
377
  'scripts/pid-alive.mjs',
390
378
  'scripts/parent-watch.mjs',
@@ -394,6 +382,7 @@ async function runDiagnostics(asJson) {
394
382
  // 既存卓の現行tree同期とteardownのblock単位所有。resume/teardownから呼ぶため一体で必須
395
383
  'scripts/room-mcp-config.mjs',
396
384
  'scripts/upgrade-team-assets.sh',
385
+ 'scripts/upgrade-team-assets.mjs',
397
386
  'scripts/remove-managed-room-mcp.mjs',
398
387
  'scripts/bridge-record-live.mjs',
399
388
  'scripts/leave-seat.sh',
@@ -409,13 +398,15 @@ async function runDiagnostics(asJson) {
409
398
  'scripts/seat-status-bridge.mjs',
410
399
  'scripts/ensure-bridge.sh',
411
400
  'scripts/ensure-project-runtime.sh',
401
+ 'scripts/ensure-project-runtime.mjs',
402
+ 'scripts/ensure-bridge.mjs',
403
+ 'scripts/runtime-launch-command.mjs',
412
404
  'scripts/runtime-digest.mjs',
413
405
  'scripts/alarm-bridge.mjs',
414
406
  'scripts/alarm-set.sh',
415
407
  'scripts/alarm-write.mjs',
416
408
  'scripts/alarm-condition.mjs',
417
- 'scripts/agent-pane-status.mjs',
418
- 'scripts/codex-dialog.mjs',
409
+ 'scripts/aiterm-deliver.mjs',
419
410
  'scripts/grok-seat-config.mjs',
420
411
  // 円卓開始ゲートと既存 room の正規 resume 入口(決定104・105)。欠けると親の依頼確定と再稼働が手作業へ戻る
421
412
  'scripts/kickoff-gate.mjs',
package/room/server.mjs CHANGED
@@ -282,7 +282,7 @@ const isParentMember = member => member?.delivery?.kind === 'parent_watch'
282
282
  // wakeup-bridge の配送対象判定(skill/scripts/wakeup-delivery.mjs の isWakeupBridgeTarget と同じ規則)
283
283
  function isTuiDeliveryTarget(member) {
284
284
  if (!member || isParentMember(member)) return false
285
- const hasPane = typeof member.observe?.tmux_target === 'string' && member.observe.tmux_target.length > 0
285
+ const hasPane = Boolean(member.aiterm_session_id || member.observe?.aiterm_session_id || member.observe?.tmux_target)
286
286
  const harness = member.harness ?? member.vendor
287
287
  return hasPane || harness === 'codex' || harness === 'grok'
288
288
  }