thinkpool-pair 0.7.211 → 0.7.212

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 (2) hide show
  1. package/account.mjs +5 -2
  2. package/package.json +1 -1
package/account.mjs CHANGED
@@ -450,6 +450,10 @@ export async function runAccount(SUPABASE_URL, SUPABASE_ANON) {
450
450
  console.log(`◇ supervisor boot sup=${SUP_ID} host=${machine} pid=${process.pid} npx=${VERSION || 'dev'}`)
451
451
 
452
452
  const acct = sb.channel(`tpacct:${session.user.id}`, { config: { presence: { key: machine }, broadcast: { self: false } } })
453
+ // One id per account-bridge PROCESS. The dashboard keeps its restart indicator
454
+ // up until this value changes, so stale presence + fresh claim heartbeats can
455
+ // never impersonate a completed restart.
456
+ const BRIDGE_ID = randomUUID()
453
457
  let restarting = false // set by the "restart" broadcast → stop() exits non-zero so a supervisor respawns us
454
458
  // Web "attach this session" card → bind an unbound/new room to a local dir (and
455
459
  // optionally set it as the account default) so it serves WITHOUT a terminal command.
@@ -558,7 +562,7 @@ export async function runAccount(SUPABASE_URL, SUPABASE_ANON) {
558
562
  // to spawn against — re-read each announce so an add/remove reflects immediately.
559
563
  // Both are additive; older clients ignore them (feature: multi-provider BYOK, slice 1).
560
564
  const PROVIDER_PUBKEY = publicKeyB64()
561
- const pushPresence = () => trackPresence({ name: machine, version: VERSION, rooms: [...children.keys()], refused: [...refused].map(([code, reason]) => ({ code, reason })), service: runsAsService(), providerPubKey: PROVIDER_PUBKEY, providers: announceProviders(), agents: installedAgentCommands().map((cmd) => ({ cmd })), ts: Date.now() })
565
+ const pushPresence = () => trackPresence({ name: machine, bridgeId: BRIDGE_ID, version: VERSION, rooms: [...children.keys()], refused: [...refused].map(([code, reason]) => ({ code, reason })), service: runsAsService(), providerPubKey: PROVIDER_PUBKEY, providers: announceProviders(), agents: installedAgentCommands().map((cmd) => ({ cmd })), ts: Date.now() })
562
566
 
563
567
  // ── Provider registry — the multi-BYOK wire contract (slice 1). ─────────────
564
568
  // AUTH: the account channel `tpacct:<uid>` is created WITHOUT config.private:true,
@@ -661,7 +665,6 @@ export async function runAccount(SUPABASE_URL, SUPABASE_ANON) {
661
665
  // both serving one account is the cross-machine half of the terminal-reconcile
662
666
  // reap that lost room XE3IQ's history.
663
667
  // Spec: docs/specs/2026-06-25-single-bridge-durable-history.md (INV-2)
664
- const BRIDGE_ID = randomUUID()
665
668
  let claimHeld = false
666
669
  let standbyHost = null
667
670
  // Wall-clock of the last SUCCESSFUL claim RPC. The heartbeat watchdog (below) uses it to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkpool-pair",
3
- "version": "0.7.211",
3
+ "version": "0.7.212",
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": {