Files
t3code/packages/client-runtime
Theo BrowneandClaude Fable 5 8fa10884a3 perf(mobile): speed up multi-environment reconnect on foreground
Three serialization points made reconnecting to several environments feel
sequential even though the supervisor fan-out is parallel:

- The foreground liveness probe waited 15s on half-open sockets before
  starting a reconnect. It now times out after 5s.
- Remote DPoP tokens lived inside the single connection-catalog SecureStore
  document, so every environment's token read/write serialized on one
  semaphore and rewrote the whole catalog to the Keychain. Tokens now live
  under per-environment keys with an in-memory cache and lazy migration.
- The relay access-token cache held its lock across the network token
  exchange, so cache hits queued behind a stale account's round trip. Cache
  hits now take a lock-free fast path.

Also reset the retry backoff ladder on application-active, since network
conditions usually changed while backgrounded.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-29 16:51:04 -07:00
..

Client Runtime

Shared client behavior for web and mobile. Public APIs are organized by package subpath. The package intentionally has no root export.

Public subpaths

Subpath Responsibility
authorization Bearer and DPoP authorization plus token persistence contracts
connection Targets, catalog, supervision, retries, registry, and onboarding
environment Environment identity, descriptors, endpoints, and scoped keys
errors Shared client error inspection
operations Multi-step application workflows
operations/projects Multi-step project creation workflows
platform Platform capability and persistence service contracts
relay Managed relay API and environment discovery
rpc HTTP/RPC clients, protocol, sessions, and subscriptions
state/<domain> Focused shared state, retention, reducers, and Atom constructors

Dependency direction

Platform applications provide platform services. connection composes those capabilities with authorization, relay, and rpc to supervise environment sessions. Independent state modules consume the connection registry and expose focused state or Atom constructors to application-owned runtimes.

Applications should import the narrowest relevant subpath. There is no broad state export: use domain paths such as state/shell, state/threads, state/terminal, or state/vcs. Subpath indices and explicitly exported domain files are public API boundaries; all other files remain implementation details.