peertable 0.4.22 → 0.4.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peertable",
3
- "version": "0.4.22",
3
+ "version": "0.4.24",
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",
package/room/client.mjs CHANGED
@@ -13,7 +13,7 @@ import { findModelsDoc, resolveSeatIdentity } from '../skill/scripts/resolve-sea
13
13
 
14
14
  // client.mjs 側のハードコード版数。package.json の version と一致していることを
15
15
  // diagnostics の version_consistency が見る(2 つの版数源の drift 検出。決定45)
16
- const MCP_VERSION = '0.4.22'
16
+ const MCP_VERSION = '0.4.24'
17
17
  const PKG_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
18
18
 
19
19
  const USAGE = `usage:
@@ -346,6 +346,7 @@ async function runDiagnostics(asJson) {
346
346
  'scripts/ensure-room-mcp.mjs',
347
347
  'scripts/leave-seat.sh',
348
348
  'scripts/change-seat.sh',
349
+ 'scripts/post-message.mjs',
349
350
  // effort 専用の互換入口。change-seat.sh へ委譲するので、どちらが欠けても席設定変更が死ぬ
350
351
  'scripts/change-effort.sh',
351
352
  'scripts/make-plan-input.mjs',
package/skill/SKILL.md CHANGED
@@ -186,7 +186,7 @@ witness をどう生成するかは**対象 project 側の作法に従う**(La
186
186
 
187
187
  - 親は MCP を後付けできないため room へは HTTP API 直で参加する:
188
188
  - 登録: `curl -X POST $URL/api/$ROOM/members -H "X-Peertable-Token: $TOKEN" -d '{"name":"bell"}'`
189
- - 発言: `curl -X POST $URL/api/$ROOM/messages -H "X-Peertable-Token: $TOKEN" -d '{"from":"bell","to":"<明示宛先>","body":"..."}'`(複数人は`to`へ名前の配列)
189
+ - 発言: `node skill/scripts/post-message.mjs bell <宛先> '<本文>' | curl -X POST $URL/api/$ROOM/messages -H "X-Peertable-Token: $TOKEN" -H "Content-Type: application/json" --data-binary @-`。Windows の `python3 -c json.dumps` は stdout が cp932 になり日本語本文が部屋へ壊れて保存される。複数人は`to`へ名前の配列(JSON)
190
190
  - 観測: **bell宛DM番犬**(下記)。素の SSE 全量 Monitor は張らない
191
191
  - **親宛DM番犬の仕様**(決定76): room追従は`parent-watch.mjs`一つが所有する。`parent-join.sh`が
192
192
  `.team/parent-watch.json`をprimeし、room SSE・heartbeat・再接続catch-up・`to`/`to_names`判定・
@@ -21,6 +21,7 @@ if (process.env.PEERTABLE_PLAN) env_vars.push(
21
21
  'LATTICE_TODO_ACTOR_SESSION', 'LATTICE_TODO_ACTOR_AGENT',
22
22
  )
23
23
  if (vendor === 'grok' && process.env.GROK_HOME) env_vars.push('GROK_HOME')
24
+ if (vendor === 'codex' && process.env.CODEX_HOME) env_vars.push('CODEX_HOME')
24
25
  const result = await client.callTool({
25
26
  name: `${vendor}_agent`,
26
27
  arguments: {
@@ -235,7 +235,7 @@ fi
235
235
 
236
236
  body="[席設定変更] ${parent} が ${name} の ${changes} に変更(${change_method})"
237
237
  [ -z "$reason" ] || body="${body}。理由: ${reason}"
238
- history=$(python3 -c 'import json,sys;print(json.dumps({"from":sys.argv[1],"to":sys.argv[2],"body":sys.argv[3]},ensure_ascii=False))' "$parent" "$name" "$body")
238
+ history=$(node "$(dirname "$0")/post-message.mjs" "$parent" "$name" "$body")
239
239
  history_response=$(env -u PEERTABLE_POST_TOKEN node "$credential_helper" request "$credential_file" POST \
240
240
  "$url/api/$room/messages" "$history") || {
241
241
  echo "SEAT_CHANGE_CHANGED_BUT_HISTORY_FAILED: ${name} は ${changes} で再着席済み、room履歴の記録に失敗" >&2
@@ -16,7 +16,7 @@ const [action, project, peertableRepo] = process.argv.slice(2)
16
16
  if (!['ensure', 'remove'].includes(action) || !project || !peertableRepo)
17
17
  fail('SEAT_CODEX_ROOM_MCP_ARGS_INVALID', '<ensure|remove> <project> <peertable_repo>')
18
18
 
19
- const configDir = resolve(project, '.codex')
19
+ const configDir = resolve(process.env.CODEX_HOME || join(project, '.codex'))
20
20
  const configFile = join(configDir, 'config.toml')
21
21
  const startPattern = /^# BEGIN PEERTABLE ROOM MCP added_newline=([01])$/mu
22
22
  const endMarker = '# END PEERTABLE ROOM MCP'
@@ -374,6 +374,15 @@ fi
374
374
  if [ "$vendor" = grok ]; then
375
375
  launch_env+=("GROK_HOME=$grok_home")
376
376
  fi
377
+ if [ "$vendor" = codex ]; then
378
+ codex_home="${proj}/.team/seats/${name}.codex"
379
+ mkdir -p "$codex_home"
380
+ if [ -f "${HOME}/.codex/auth.json" ]; then
381
+ cp "${HOME}/.codex/auth.json" "${codex_home}/auth.json"
382
+ chmod 600 "${codex_home}/auth.json" 2>/dev/null || true
383
+ fi
384
+ launch_env+=("CODEX_HOME=$codex_home")
385
+ fi
377
386
  if [ "$vendor" = codex ] \
378
387
  && ! env -u PEERTABLE_POST_TOKEN "${launch_env[@]}" node "$codex_room_mcp_helper" ensure "$proj" "$peertable_repo"; then
379
388
  echo "SEAT_CODEX_ROOM_MCP_INVALID: Codexのproject設定へseat固有room clientを装備できない(席は立てない)" >&2
@@ -81,6 +81,7 @@ if ! rm -f "$proj/.team/seats/$name.json"; then
81
81
  failed=1
82
82
  fi
83
83
  rm -rf "$proj/.team/seats/${name}.grok-home"
84
+ rm -rf "$proj/.team/seats/${name}.codex"
84
85
  if ! env -u PEERTABLE_POST_TOKEN node "$credential_helper" remove "$proj" "$credential_file"; then
85
86
  echo "SEAT_LEAVE_CREDENTIAL_FAILED: $name" >&2
86
87
  failed=1
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ // room へ送る JSON を UTF-8 で出す。python stdout の cp932 は日本語本文を壊す。
3
+ const [from, to, ...rest] = process.argv.slice(2)
4
+ const body = rest.join('\n')
5
+ if (!from || !to || body.length === 0) {
6
+ process.stderr.write('usage: post-message.mjs <from> <to> <body>\n')
7
+ process.exit(2)
8
+ }
9
+ process.stdout.write(`${JSON.stringify({ from, to, body })}\n`)