5 months ago
766af09* feat: add direct H3 mobile pairing foundation Co-authored-by: Max Weinbach <mweinbach@users.noreply.github.com> * feat: surface direct H3 pairing in desktop Co-authored-by: Max Weinbach <mweinbach@users.noreply.github.com> * feat: switch mobile pairing to H3 tickets Co-authored-by: Max Weinbach <mweinbach@users.noreply.github.com> * refactor: remove retired remodex relay transport Co-authored-by: Max Weinbach <mweinbach@users.noreply.github.com> * fix: address mobile h3 pairing review * fix: harden mobile h3 pairing lifecycle * fix: close mobile h3 review gaps * fix: close mobile h3 transport review gaps * fix: harden mobile h3 streaming and pins * fix: harden mobile relay restore and streaming * fix: harden mobile h3 rpc reconnect * fix: harden mobile h3 pairing trust * fix: preserve mobile relay workspace state * fix: harden mobile h3 stream edge cases Validate desktop mobile H3 host hints before IPC propagation, close active H3 SSE sinks when the JSON-RPC connection closes, treat intentional Android pinned HTTPS stream disconnects as close events, and bracket IPv6 hosts in mobile pairing URLs. Tests: bun test apps/desktop/test/server-manager.test.ts test/h3.mobile-http-jsonrpc.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: cancel stale mobile pairing streams Abort the active mobile H3 event stream before clearing the session for a new QR pairing attempt so failed retries cannot leave stale SSE callbacks alive. Tests: bun test test/mobile.secure-transport-client.test.ts; bun test apps/desktop/test/server-manager.test.ts test/h3.mobile-http-jsonrpc.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: tighten desktop mobile relay startup Guard mobile H3 server replacement with a pending-start entry, remove unused direct-H3 workspace cache wiring, and delete orphaned legacy relay types. Tests: bun test apps/desktop/test/server-manager.test.ts apps/desktop/test/mobile-relay-ipc.test.ts apps/desktop/test/ipc-workspace.test.ts; bun test apps/desktop/test/server-manager.test.ts apps/desktop/test/mobile-relay-ipc.test.ts apps/desktop/test/ipc-workspace.test.ts test/h3.mobile-http-jsonrpc.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: bracket mobile h3 advertised IPv6 urls Format IPv6 host hints before constructing the server_listening mobile H3 URL so desktop relay state gets a valid direct HTTPS URL. Tests: bun test test/h3.mobile-http-jsonrpc.test.ts; bun test apps/desktop/test/server-manager.test.ts apps/desktop/test/mobile-relay-ipc.test.ts apps/desktop/test/ipc-workspace.test.ts test/h3.mobile-http-jsonrpc.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: settle pending mobile h3 rpc on close Reject pending HTTP JSON-RPC waiters when an H3 mobile connection closes and return a prompt 503 response instead of waiting for the 30s timeout. Tests: bun test test/h3.mobile-http-jsonrpc.test.ts; bun test apps/desktop/test/server-manager.test.ts apps/desktop/test/mobile-relay-ipc.test.ts apps/desktop/test/ipc-workspace.test.ts test/h3.mobile-http-jsonrpc.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: preserve native pinned stream utf8 Decode Android pinned HTTPS streams with a stateful UTF-8 reader and buffer incomplete UTF-8 sequences in the iOS stream delegate before forwarding SSE chunks. Tests: bun test apps/desktop/test/server-manager.test.ts apps/desktop/test/mobile-relay-ipc.test.ts apps/desktop/test/ipc-workspace.test.ts test/h3.mobile-http-jsonrpc.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check Native build notes: ./gradlew :cowork-pinned-https:compileDebugKotlin is blocked locally by missing Java runtime; xcodebuild with -derivedDataPath /tmp reaches [CP] Check Pods Manifest.lock and fails because the Pods sandbox is out of sync with Podfile.lock. * fix: sanitize desktop mobile h3 control state Sanitize workspace IPC start results so renderer callers only receive the WebSocket URL, restart running servers when requested mobile H3 state changes in either direction, and align the internal mobile relay pairing payload type with the required H3 schema. Tests: bun test apps/desktop/test/server-manager.test.ts apps/desktop/test/ipc-workspace.test.ts apps/desktop/test/mobile-relay-ipc.test.ts test/h3.mobile-http-jsonrpc.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: close stale mobile h3 trust paths Serialize mobile H3 pairing-store updates so token verification cannot restore a concurrently revoked device, and disable the previous workspace H3 endpoint before the desktop relay bridge switches to another workspace. Tests: bun test apps/desktop/test/server-manager.test.ts apps/desktop/test/ipc-workspace.test.ts apps/desktop/test/mobile-relay-ipc.test.ts apps/desktop/test/mobile-relay-bridge.test.ts test/h3.mobile-http-jsonrpc.test.ts test/h3.pairing-store.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: recover workspace after mobile h3 stop failure Recover the workspace server without H3 when stopping mobile access fails during the restart path, matching the rotation recovery behavior and keeping stop non-destructive for the workspace server. Tests: bun test apps/desktop/test/mobile-relay-bridge.test.ts apps/desktop/test/server-manager.test.ts test/h3.pairing-store.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: protect mobile h3 pairing ticket endpoint Require the internal mobile H3 admin bearer token before serving the pairing ticket endpoint so network callers cannot fetch the QR ticket secret directly. Tests: bun test test/h3.mobile-http-jsonrpc.test.ts test/h3.pairing-store.test.ts apps/desktop/test/mobile-relay-bridge.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: clear stale mobile h3 lifecycle state Recover the previous workspace server without H3 when workspace switching fails before the new mobile endpoint starts, and clear stale start options after rotation recovery so later stop calls do not restart an already recovered non-H3 server. Tests: bun test apps/desktop/test/mobile-relay-bridge.test.ts apps/desktop/test/server-manager.test.ts test/h3.mobile-http-jsonrpc.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: harden mobile h3 pairing lifecycle Include IPv6 interface addresses in wildcard mobile H3 host hints, preserve existing mobile H3 state when desktop callers omit the option, report connected bridge state for trusted devices, avoid burning pairing nonces before trust persistence succeeds, and simplify bridge switch recovery state. Tests: bun test test/server.listening-hints.test.ts apps/desktop/test/mobile-relay-bridge.test.ts apps/desktop/test/server-manager.test.ts test/h3.mobile-http-jsonrpc.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: stabilize mobile relay restore states Transition the desktop relay bridge back to pairing after trust revocation, clear relay state during app shutdown without spawning a replacement workspace server, and validate mobile SecureStore restore payloads before using persisted trusted desktop/session state. Tests: bun test apps/desktop/test/mobile-relay-bridge.test.ts apps/desktop/test/electron-shutdown.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: stabilize mobile relay device trust Persist a stable mobile device id for QR pairing, clear stale forgetTrustedPhone error state on successful retry, and stop tracking active mobile relay options when the workspace server cannot provide an H3 endpoint. Tests: bun test apps/desktop/test/mobile-relay-bridge.test.ts test/mobile.secure-transport-client.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: rotate pairing after mobile trust revoke Rotate the mobile H3 endpoint after successfully forgetting trusted phone state so the Remote Access QR advertises a fresh nonce that can be scanned immediately for re-pairing. Tests: bun test apps/desktop/test/mobile-relay-bridge.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check * fix: close mobile h3 rpc on event disconnect Close and remove the server-side H3 JSON-RPC connection when the mobile SSE events stream is canceled so subscriptions and pending prompts are reset before the next reconnect. Tests: bun test test/h3.mobile-http-jsonrpc.test.ts; bun run typecheck; bun run check; bun run docs:check; git diff --check --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Max Weinbach <mweinbach@users.noreply.github.com>
Parent300c932