thinkpool-pair 0.6.27 → 0.7.1
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/bridge.mjs +10 -1
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -41,6 +41,7 @@ import { saveSession, flushSession, loadLatest, canResume } from './session-stor
|
|
|
41
41
|
// Public client creds (the same anon values the web app ships — safe to embed).
|
|
42
42
|
// Override with TP_SUPABASE_URL / TP_SUPABASE_ANON if you ever need to.
|
|
43
43
|
const SUPABASE_URL = process.env.TP_SUPABASE_URL || 'https://daytvtakmlixpfbbqzjd.supabase.co'
|
|
44
|
+
const WEB_BASE = process.env.TP_WEB_BASE || 'https://thinkpool.io'
|
|
44
45
|
const SUPABASE_ANON = process.env.TP_SUPABASE_ANON || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImRheXR2dGFrbWxpeHBmYmJxempkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzgwNTMxNzEsImV4cCI6MjA5MzYyOTE3MX0.zYmz8bHUNEY4STUr2JuXChAsKwxNwkwFHe1Hd0Betqo'
|
|
45
46
|
|
|
46
47
|
// Per-terminal rolling scrollback (raw chars). Replayed to joining clients.
|
|
@@ -134,8 +135,16 @@ if (argv[0] === 'install-service' || argv[0] === 'uninstall-service') {
|
|
|
134
135
|
process.exit(0)
|
|
135
136
|
}
|
|
136
137
|
|
|
138
|
+
// Account mode (Phase 1, docs/specs/2026-06-16-account-bridge.md): one bridge per
|
|
139
|
+
// ACCOUNT, not per room. `login` links this device; `bind <ROOM> <dir>` maps a
|
|
140
|
+
// session to a working dir on this machine; a bare invocation discovers + serves
|
|
141
|
+
// every session you're in (a headless child bridge per room, run in its dir).
|
|
142
|
+
if (argv[0] === 'login') { const { runLogin } = await import('./account.mjs'); await runLogin(SUPABASE_URL, SUPABASE_ANON, WEB_BASE) }
|
|
143
|
+
if (argv[0] === 'bind') { const { runBind } = await import('./account.mjs'); runBind(argv[1], argv[2]) }
|
|
144
|
+
if (!argv[0] || argv[0].startsWith('-')) { const { runAccount } = await import('./account.mjs'); await runAccount(SUPABASE_URL, SUPABASE_ANON) }
|
|
145
|
+
|
|
137
146
|
const room = (argv[0] || '').toUpperCase().trim()
|
|
138
|
-
if (!room
|
|
147
|
+
if (!room) { console.error('usage: npx thinkpool-pair <ROOM> [--headless] [--continue|--fresh] [-- <command…>] | npx thinkpool-pair (account mode)'); process.exit(1) }
|
|
139
148
|
// ── Supervisor mode (--supervise / --keep-alive): keep the bridge alive across
|
|
140
149
|
// crashes. We re-exec ourselves without the flag and respawn the child on any
|
|
141
150
|
// non-clean exit with exponential backoff. Zero-dependency, cross-platform. With
|