feat(relay): Add managed relay tunnels and APN service - #2837
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack
codex/collection-performance-refactors->main(merged)t3code/mobile-remote-connect->maincodex/relay-managed-tunnels-auth-infra->t3code/mobile-remote-connectSummary
This stacked draft PR adds the relay-managed tunnel and cloud authentication work on top of the mobile remote-runtime PR. General collection/performance rewrites from #2854 and the TypeScript/Effect tooling base are now on
main.effect/Cryptowhile retaining Expo-compatible implementationsValidation
bun fmtbun lint(passes with 8 existing web warnings)bun lint:mobilebun typecheckcd infra/relay && bun run test(103passed,5skipped)cd apps/mobile && bun run test(135passed)cd apps/web && bun run test(1005passed)cd apps/server && bun run test(1075passed,4skipped)Rebase Note
General collection/performance rewrites from #2854 are now merged into
main; mobile command metadata, pairing-URL redaction, and shared-runtime Crypto cleanup remain in #2013. This PR retains the managed-relay changes to the mobile connection contract and runtime above those inherited lower-layer changes.Note
High Risk
Touches authentication (Clerk OAuth, protocol callbacks, token storage), new production relay deploy, and release pipeline env wiring; mobile raises minimum iOS to 18.0.
Overview
Adds T3 Cloud as an optional, config-gated product path: root
.env.exampledocuments public Clerk/relay settings, and CI gains a production relay deploy onmainplus a release job that resolves relay URL and Clerk keys into desktop, CLI, and Vercel web builds.Desktop gains end-to-end cloud sign-in: custom URL schemes (
t3code/t3code-dev), macOS launcher/protocol registration for dev,DesktopCloudAuth(state-validated callbacks, single-instance routing), encrypted Clerk JWT storage, and IPC that proxies only allowed Clerk Frontend API hosts.Mobile integrates Clerk (
CloudAuthProvider), a Settings stack (environments, waitlist, T3 Cloud connect rows), agent push notification deep-linking, Live Activity preferences synced via relay when signed in, Expo widgets/notifications plugins, and iOS deployment target 18.0. Saved environments can recordrelayManagedmetadata.Docs and tooling shifts: README/AGENTS/mobile README describe optional cloud setup; desktop dev launcher and window navigation send off-origin OAuth to the system browser.
Reviewed by Cursor Bugbot for commit ee69e93. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add managed relay tunnels with DPoP auth, APNs live activity delivery, and cloud CLI commands
ManagedRelayClient,ManagedRelayDpopSigner, and platform-specific crypto/signer layers for mobile (Expo Crypto) and web (WebCrypto/IndexedDB)infra/relay) with HTTP APIs for environment linking, credential issuance, agent awareness publishing, and APNs delivery of live activity updates and push notifications to mobile devicesEnvironmentAuth,SessionStore,PairingGrantStore) to support DPoP-bound access tokens with replay prevention via aproof_key_thumbprintclaim and per-request DPoP proof verificationt3 cloudCLI commands (status, link, auth) with relay client install/management via a bundled cloudflared binary; the CLI is conditionally exposed based on build-time public configproofKeyThumbprintor fails, which is a breaking change for existing pairing flows that do not supply itMacroscope summarized ee69e93.