thinkpool-pair 0.7.73 → 0.7.75
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 +5 -1
- package/package.json +1 -1
- package/service.mjs +15 -4
package/account.mjs
CHANGED
|
@@ -298,7 +298,11 @@ export async function runAccount(SUPABASE_URL, SUPABASE_ANON) {
|
|
|
298
298
|
// → dashboard reads "no bridge" while sessions run; 2026-06-17/-22/-24). The 15s
|
|
299
299
|
// tick + token-refresh callers are unaffected (their interval exceeds the window).
|
|
300
300
|
const trackPresence = makeThrottledTrack(acct, { minMs: 5000 })
|
|
301
|
-
|
|
301
|
+
// `service` lets the dashboard show whether this bridge is the durable installed
|
|
302
|
+
// service (always-on, survives reboot) vs a foreground `npx` run that dies with its
|
|
303
|
+
// terminal. THINKPOOL_PAIR_AUTOUPDATE=1 is set ONLY by the install-service plist/unit
|
|
304
|
+
// (service.mjs), so it's the reliable proxy for "running as the managed service".
|
|
305
|
+
const pushPresence = () => trackPresence({ name: machine, version: VERSION, rooms: [...children.keys()], service: process.env.THINKPOOL_PAIR_AUTOUPDATE === '1', ts: Date.now() })
|
|
302
306
|
// Re-track on EVERY (re)subscribe, not just the first: a realtime reconnect
|
|
303
307
|
// (network blip, or a token swap mid-flight) rejoins the channel and must
|
|
304
308
|
// re-announce, or the dashboard would read "no bridge" until the next restart.
|
package/package.json
CHANGED
package/service.mjs
CHANGED
|
@@ -82,10 +82,21 @@ export function buildArtifact(platform, { room = null, cmdArgs = [], autoUpdate
|
|
|
82
82
|
// Modern bootstrap/enable, NOT the deprecated `launchctl load`. On current macOS
|
|
83
83
|
// (Darwin 24/25) `load` silently no-ops for a GUI LaunchAgent — the plist lands on
|
|
84
84
|
// disk but never loads, so the bridge is "installed" yet off (the 2026-06-26 bug).
|
|
85
|
-
// bootout
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
// Sequence: bootout any existing instance (idempotent reinstall) → WAIT for it to
|
|
86
|
+
// actually leave the domain (bootout is async; bootstrapping while teardown is in
|
|
87
|
+
// flight throws "Bootstrap failed: 5: Input/output error") → enable (clears a stale
|
|
88
|
+
// `disabled` override from a prior bootout / the account-storm cleanup) → bootstrap,
|
|
89
|
+
// retried on the EIO race → a final `print` so the command's exit code reports the
|
|
90
|
+
// real loaded state (installService warns if it ends not-loaded).
|
|
91
|
+
const lbl = label(room), dom = 'gui/$(id -u)'
|
|
92
|
+
const post = [
|
|
93
|
+
`launchctl bootout ${dom}/${lbl} 2>/dev/null`,
|
|
94
|
+
`for i in $(seq 1 20); do launchctl print ${dom}/${lbl} >/dev/null 2>&1 || break; sleep 0.2; done`,
|
|
95
|
+
`launchctl enable ${dom}/${lbl}`,
|
|
96
|
+
`for i in $(seq 1 20); do launchctl bootstrap ${dom} "${file}" 2>/dev/null && break; sleep 0.3; done`,
|
|
97
|
+
`launchctl print ${dom}/${lbl} >/dev/null 2>&1`,
|
|
98
|
+
].join('; ')
|
|
99
|
+
return { file, content, logDir, post: [post], note: 'Loaded as a LaunchAgent — starts at login, restarts on crash.' }
|
|
89
100
|
}
|
|
90
101
|
|
|
91
102
|
if (platform === 'linux') {
|