@justprove/mobilevc
Advanced tools
+24
-0
@@ -22,2 +22,3 @@ #!/usr/bin/env node | ||
| const RELAY_PAIRING_EVENT_PREFIX = 'mobilevc-relay-pairing-'; | ||
| const RELAY_AGENT_SESSION_PREFIX = 'mobilevc-relay-agent-session-'; | ||
@@ -342,2 +343,3 @@ const PLATFORM_PACKAGES = { | ||
| const pairingEventPath = relayAccess.enabled ? createRelayPairingEventPath() : ''; | ||
| const relayAgentSessionStatePath = relayAccess.enabled ? createRelayAgentSessionStatePath() : ''; | ||
| fs.writeFileSync(logPath, '', { mode: 0o600 }); | ||
@@ -361,2 +363,3 @@ try { | ||
| env.RELAY_PAIRING_EVENT_PATH = pairingEventPath; | ||
| env.RELAY_AGENT_SESSION_STATE_PATH = relayAgentSessionStatePath; | ||
| } | ||
@@ -385,2 +388,3 @@ | ||
| removeRelayPairingEventFile(pairingEventPath); | ||
| removeRelayAgentSessionStateFile(relayAgentSessionStatePath); | ||
| throw new Error(formatStartupFailure(language, startup, logPath)); | ||
@@ -397,2 +401,3 @@ } | ||
| removeRelayPairingEventFile(pairingEventPath); | ||
| removeRelayAgentSessionStateFile(relayAgentSessionStatePath); | ||
| throw new Error(message(language, 'relayPairingTimedOut', logPath)); | ||
@@ -410,2 +415,3 @@ } | ||
| networkExposureMode: relayAccess.networkExposureMode || '', | ||
| relayAgentSessionStatePath, | ||
| }; | ||
@@ -490,2 +496,3 @@ writeJson(STATE_PATH, state); | ||
| if (!isPidAlive(state.pid)) { | ||
| removeRelayAgentSessionStateFile(state.relayAgentSessionStatePath); | ||
| clearState(); | ||
@@ -506,2 +513,3 @@ if (!options.silent) { | ||
| removeRelayAgentSessionStateFile(state.relayAgentSessionStatePath); | ||
| clearState(); | ||
@@ -739,2 +747,7 @@ if (!options.silent) { | ||
| function createRelayAgentSessionStatePath() { | ||
| const suffix = `${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`; | ||
| return path.join(STATE_DIR, `${RELAY_AGENT_SESSION_PREFIX}${suffix}.json`); | ||
| } | ||
| function waitForRelayPairing(eventPath, timeoutMs) { | ||
@@ -783,2 +796,11 @@ return new Promise((resolve) => { | ||
| function removeRelayAgentSessionStateFile(filePath) { | ||
| if (!filePath) { | ||
| return; | ||
| } | ||
| try { | ||
| fs.unlinkSync(filePath); | ||
| } catch (_) {} | ||
| } | ||
| function printRelayQr(language, pairing) { | ||
@@ -1397,3 +1419,5 @@ const uri = buildRelayPairingUri(pairing); | ||
| buildRelayPairingUri, | ||
| createRelayAgentSessionStatePath, | ||
| readRelayPairingEventFile, | ||
| removeRelayAgentSessionStateFile, | ||
| isPortOccupied, | ||
@@ -1400,0 +1424,0 @@ removeRelayPairingEventFile, |
+6
-6
| { | ||
| "name": "@justprove/mobilevc", | ||
| "version": "0.2.8", | ||
| "version": "0.2.9", | ||
| "description": "Claude Code mobile workspace launcher with precompiled MobileVC backend binaries.", | ||
@@ -33,8 +33,8 @@ "license": "MIT", | ||
| "optionalDependencies": { | ||
| "@justprove/mobilevc-server-darwin-arm64": "0.2.8", | ||
| "@justprove/mobilevc-server-darwin-x64": "0.2.8", | ||
| "@justprove/mobilevc-server-linux-arm64": "0.2.8", | ||
| "@justprove/mobilevc-server-linux-x64": "0.2.8", | ||
| "@justprove/mobilevc-server-win32-x64": "0.2.8" | ||
| "@justprove/mobilevc-server-darwin-arm64": "0.2.9", | ||
| "@justprove/mobilevc-server-darwin-x64": "0.2.9", | ||
| "@justprove/mobilevc-server-linux-arm64": "0.2.9", | ||
| "@justprove/mobilevc-server-linux-x64": "0.2.9", | ||
| "@justprove/mobilevc-server-win32-x64": "0.2.9" | ||
| } | ||
| } |
70804
1.4%1274
1.76%