thinkpool-pair 0.7.357 → 0.7.359

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
@@ -798,6 +798,7 @@ export async function runAccount(SUPABASE_URL, SUPABASE_ANON) {
798
798
  // reap that lost room XE3IQ's history.
799
799
  // Spec: docs/specs/2026-06-25-single-bridge-durable-history.md (INV-2)
800
800
  let claimHeld = false
801
+ let claimFencing = 0
801
802
  let standbyHost = null
802
803
  // Wall-clock of the last SUCCESSFUL claim RPC. The heartbeat watchdog (below) uses it to
803
804
  // detect a wedged loop and self-heal — the 2026-07-08 outage stood by against its OWN
@@ -822,6 +823,7 @@ export async function runAccount(SUPABASE_URL, SUPABASE_ANON) {
822
823
  else if (!held && claimHeld) process.stderr.write(`\n ◇ another device (${host}) took over this account — standing by.\n`)
823
824
  else if (!held && standbyHost !== host) process.stderr.write(`\n ◇ another device (${host}) is serving this account — standing by.\n (this Mac takes over automatically if that device goes offline.)\n`)
824
825
  claimHeld = held
826
+ claimFencing = held && Number.isSafeInteger(Number(c?.fencing)) && Number(c.fencing) > 0 ? Number(c.fencing) : 0
825
827
  standbyHost = held ? null : host
826
828
 
827
829
  // ── supervisor claim_tick logging (cascade brg-instrument) ─────────────────
@@ -1026,7 +1028,7 @@ export async function runAccount(SUPABASE_URL, SUPABASE_ANON) {
1026
1028
  // @latest); they report idle to us over IPC so we can restart at a moment
1027
1029
  // when every session is quiet. Strip AUTOUPDATE so an inherited service env
1028
1030
  // can't make a child self-exit; flag it as an account child instead.
1029
- const env = { ...process.env, THINKPOOL_PAIR_ACCOUNT_CHILD: '1' }
1031
+ const env = { ...process.env, THINKPOOL_PAIR_ACCOUNT_CHILD: '1', TP_ACCOUNT_BRIDGE_ID: BRIDGE_ID, TP_ACCOUNT_BRIDGE_FENCING: String(claimFencing) }
1030
1032
  delete env.THINKPOOL_PAIR_AUTOUPDATE
1031
1033
  // Hand the child the owner JWT for authed web writes (code-mockup, L16).
1032
1034
  if (currentAccessToken) env.TP_ACCESS_TOKEN = currentAccessToken