thinkpool-pair 0.7.6 → 0.7.7

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/account.mjs CHANGED
@@ -132,7 +132,7 @@ export async function runAccount(SUPABASE_URL, SUPABASE_ANON) {
132
132
  }
133
133
  warned.delete(room)
134
134
  process.stderr.write(`\n ◆ serving ${room}${r.name ? ` "${r.name}"` : ''} → ${dir}${dirs[room] ? '' : ' (default)'}\n`)
135
- const child = spawn(process.execPath, [BRIDGE, room, '--headless'], { cwd: dir, stdio: 'inherit' })
135
+ const child = spawn(process.execPath, [BRIDGE, room, '--headless', '--auto=claude'], { cwd: dir, stdio: 'inherit' })
136
136
  children.set(room, child)
137
137
  child.on('exit', () => { children.delete(room) }) // re-served on the next tick
138
138
  }
package/bridge.mjs CHANGED
@@ -175,6 +175,9 @@ if (_superOwn.includes('--supervise') || _superOwn.includes('--keep-alive')) {
175
175
  }
176
176
 
177
177
  const headless = argv.includes('--headless')
178
+ // Account-mode children pass --auto=<agent> so a served session opens a live
179
+ // terminal automatically (headless, no TTY/picker) instead of an empty room.
180
+ const autoAgent = (argv.find(a => a.startsWith('--auto=')) || '').slice(7) || null
178
181
  // Structured mode (Phase 2, opt-in): Claude Code runs through the Agent SDK
179
182
  // (structured events + risk-tiered permission gate) instead of the PTY byte
180
183
  // relay. Default OFF — the PTY path is untouched. Only applies to `claude`.
@@ -694,16 +697,17 @@ channel
694
697
  if (status === 'SUBSCRIBED') {
695
698
  realtimeHealthy = true; brokenSince = 0
696
699
  channel.track({ name, role: 'bridge' })
697
- if (attachedCmd && !terms.size && !sessions.size) {
700
+ const startCmd = attachedCmd || autoAgent // autoAgent: account-mode auto-open (headless)
701
+ if (startCmd && !terms.size && !sessions.size) {
698
702
  // Claude + structured mode → Agent SDK session; everything else → PTY.
699
703
  // On restart, restore the latest saved structured session for this room:
700
704
  // replay its transcript + resume the live SDK context if recent enough.
701
- if (wantStructured(attachedCmd)) {
705
+ if (wantStructured(startCmd)) {
702
706
  const prev = loadLatest(room)
703
707
  if (prev && (prev.log?.length || prev.sessionId)) openStructured({ id: prev.id, resume: canResume(prev) ? prev.sessionId : undefined, log: prev.log, commands: prev.commands })
704
708
  else openStructured({ id: randomUUID() })
705
709
  }
706
- else openTerm({ id: randomUUID(), cmd: attachedCmd, args: attachedArgs, attached: true })
710
+ else openTerm({ id: randomUUID(), cmd: startCmd, args: attachedArgs, attached: !autoAgent })
707
711
  }
708
712
  announce()
709
713
  process.stderr.write(headless
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkpool-pair",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "description": "Share a local coding-agent CLI (Claude Code, Codex, Gemini, Aider, …) into a ThinkPool Code room, live.",
5
5
  "type": "module",
6
6
  "bin": {