Files
t3code/packages/client-runtime
Theo BrowneandClaude Opus 5 cf2b02f8e9 fix(mobile): name the real reason a snooze was refused; share wake label
Addresses two Bugbot findings on the merge commit.

canSnooze refuses for two unrelated reasons — the agent is blocked on the
user, or a turn start is still queued — but the alert only described the
first. A user whose thread was mid-start went looking for a pending
request that didn't exist. Each branch now says what actually happened.

snoozeWakeLabel was duplicated almost line-for-line between web's
Sidebar.snooze.ts and mobile's threadListV2.ts, so the two platforms
could drift on the same thresholds. It now lives in client-runtime beside
canSnooze/effectiveSnoozed, which both platforms already import, and both
re-export it from where their callers expect. It takes `{ now: string }`
like every other function in that module — client-runtime's Effect lint
bans `new Date()` — which also makes a malformed clock degrade to "now"
rather than NaN. Its tests move to the owning package, keeping mobile's
sub-minute case that web's lacked.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-27 16:17:30 -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.