1# Client Runtime
2
3Shared client behavior for web and mobile. Public APIs are organized by package
4subpath. The package intentionally has no root export.
5
6## Public subpaths
7
8| Subpath | Responsibility |
9| --------------------- | ----------------------------------------------------------------- |
10| `authorization` | Bearer and DPoP authorization plus token persistence contracts |
11| `connection` | Targets, catalog, supervision, retries, registry, and onboarding |
12| `environment` | Environment identity, descriptors, endpoints, and scoped keys |
13| `errors` | Shared client error inspection |
14| `operations` | Multi-step application workflows |
15| `operations/projects` | Multi-step project creation workflows |
16| `platform` | Platform capability and persistence service contracts |
17| `relay` | Managed relay API and environment discovery |
18| `rpc` | HTTP/RPC clients, protocol, sessions, and subscriptions |
19| `state/<domain>` | Focused shared state, retention, reducers, and Atom constructors |
20| `voice-input` | Recording lifecycle, transcription contracts, and draft insertion |
21
22## Dependency direction
23
24Platform applications provide `platform` services. `connection` composes those
25capabilities with `authorization`, `relay`, and `rpc` to supervise environment
26sessions. Independent `state` modules consume the connection registry and expose
27focused state or Atom constructors to application-owned runtimes.
28
29The `voice-input` controller accepts capture callbacks and a selected `VoiceTranscriber`.
30Preparation binds transcription to its implementation and resolved locale; one cancellation
31signal covers both operations. Applications provide recorder events, permissions, native
32transcription implementations, and presentation.
33
34Applications should import the narrowest relevant subpath. There is no broad
35`state` export: use domain paths such as `state/shell`, `state/threads`,
36`state/terminal`, or `state/vcs`. Subpath indices and explicitly exported domain
37files are public API boundaries; all other files remain implementation details.