feat(remote): control the daemon from a phone with /remote - #438
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dependency ReviewThe following issues were found:
License Issuespackages/runtime/package.json
OpenSSF Scorecard
Scanned Files
|
1203750 to
e7162f2
Compare
The daemon gains a remote.pairing.start RPC served by an optional RemotePairingService. The capability is granted only when the daemon hosts one, remote devices can never call it, and failures surface as remote_unavailable without leaking details. The runtime hosts it for the AWS deployment test when AXL_REMOTE_DEPLOYMENT_TEST names a config file. Each pairing opens a daemon E2EE session; when the device's claim notice arrives over the relay the host reserves and confirms the claim, publishes the Welcome, registers the device with observe and steer, and hands the activated endpoint to the E2EE bridge. A paired session is restored when the daemon restarts. /remote in the TUI prints the pairing link and a QR code from a dependency-free encoder (byte mode, every version and error correction level, checked against an independent decoder). A terminal too narrow for a scannable code gets a hint instead. The link carries its identities as base64url bytes, so a pairing link fits a version 18 code. Remote devices may call session.resume with steer, so a phone can reopen sessions after the daemon restarts. Signed-off-by: Lokesh <lokeshselvam7025@gmail.com>
Adds the deployment-test phone page (remote.html, pnpm build:remote) and the SDK browser adapter behind it. pairRemoteBrowserDevice publishes the claim, notices the daemon over the relay, joins the published Welcome, and sends the pair activation. RemoteBrowserSession seals requests with the browser binding and dispatches daemon results, errors, and live deliveries. Idempotency keys follow the protocol's retryable mutation list. The page stores the link fragment in this browser and removes it from the address bar, lists sessions, reopens and subscribes to one (acknowledging the snapshot boundary so live events flow), renders the transcript including failed and stopped turns, sends and queues prompts, and stops the running turn. ?debug logs relay traffic and call timing, never content. Hosted clients now call the global fetch unbound, which browsers require. Signed-off-by: Lokesh <lokeshselvam7025@gmail.com>
Signed-off-by: Lokesh <lokeshselvam7025@gmail.com>
e7162f2 to
d2fef2b
Compare
Summary
Stacked on #436. Review only the top three commits:
feat(remote): start phone pairing from the terminal with /remotefeat(web): control the daemon from a phone browserchore(web): license the phone pageThe page is hosted by #439.
With this,
/remotein the terminal shows a QR code. Scanning it on a phone opens the deployment-test page, which pairs with the daemon on the laptop and controls it end to end encrypted over the hosted relay.Daemon and terminal
remote.pairing.startRPC backed by an optionalRemotePairingService. The capability is granted only when the daemon hosts pairing, remote devices can never call it, and failures surface asremote_unavailablewithout detail.AXL_REMOTE_DEPLOYMENT_TESTnames a config (written byremote-config.shin the hosting PR):/remoteprints a QR code and the link. The QR encoder is dependency free (packages/tui/src/qr-code.ts, byte mode, versions 1 to 40, levels L to H). A terminal narrower than the code gets a hint instead of an unscannable code.session.resumewith steer, so a phone can reopen sessions after the daemon restarts. An--unsafedaemon stays observe-only as before.Phone page (
packages/web/remote.html,pnpm build:remote)pairRemoteBrowserDeviceandRemoteBrowserSessionin the SDK drive the browser binding: claim, relay notice, Welcome join, pair activation, then sealed requests with results, errors, and live deliveries.?debuglogs relay traffic and call timing, never content.window.fetchas a method, which browsers rejectThe link carries the deployment-test stack's shared credentials in its fragment. That is acceptable only for the test stack; production pairing must not put credentials in a link.
Test plan
pnpm lint,pnpm typecheck, boundary and generated-file checksediting and /quit recover from a stale shutdown statusis flaky onRCas well; it passes when rerun/remotereturned a link in about 4 sstopReason: aborted)Follow-ups: