peertable 0.4.21 → 0.4.23

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.21",
3
+ "version": "0.4.23",
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.21'
16
+ const MCP_VERSION = '0.4.23'
17
17
  const PKG_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
18
18
 
19
19
  const USAGE = `usage:
@@ -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: {
@@ -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'
@@ -330,6 +330,19 @@ case "$stale_member_rc" in
330
330
  ;;
331
331
  esac
332
332
 
333
+ # leave-seat が席専用 GROK_HOME を消す。同名再着席では preflight 後に空になるので、
334
+ # live 起動の直前に auth と ui だけを書き直す(user booth MCP は載せない)。
335
+ if [ "$vendor" = grok ]; then
336
+ mkdir -p "$grok_home"
337
+ if [ ! -f "${HOME}/.grok/auth.json" ]; then
338
+ echo "SEAT_GROK_AUTH_MISSING: ${HOME}/.grok/auth.json が無い(席は立てない)" >&2
339
+ exit 1
340
+ fi
341
+ cp "${HOME}/.grok/auth.json" "${grok_home}/auth.json"
342
+ chmod 600 "${grok_home}/auth.json" 2>/dev/null || true
343
+ printf '%s\n' '[ui]' 'permission_mode = "always-approve"' >"${grok_home}/config.toml"
344
+ fi
345
+
333
346
  # 前の卓の残骸を回収してから、Aiterm の公開 agent launcher を唯一の席起動経路として呼ぶ。
334
347
  # direct CLI launch へ戻るfallbackは置かない。Aiterm が作る同名PTYと launch receipt が、
335
348
  # 以後の `pty_read` / `agent_configure` / room metadata を同じsessionへ束縛する。
@@ -361,6 +374,15 @@ fi
361
374
  if [ "$vendor" = grok ]; then
362
375
  launch_env+=("GROK_HOME=$grok_home")
363
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
364
386
  if [ "$vendor" = codex ] \
365
387
  && ! env -u PEERTABLE_POST_TOKEN "${launch_env[@]}" node "$codex_room_mcp_helper" ensure "$proj" "$peertable_repo"; then
366
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