| 1 | # Client Runtime |
| 2 | |
| 3 | Shared client behavior for web and mobile. Public APIs are organized by package |
| 4 | subpath. 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 | |
| 24 | Platform applications provide `platform` services. `connection` composes those |
| 25 | capabilities with `authorization`, `relay`, and `rpc` to supervise environment |
| 26 | sessions. Independent `state` modules consume the connection registry and expose |
| 27 | focused state or Atom constructors to application-owned runtimes. |
| 28 | |
| 29 | The `voice-input` controller accepts capture callbacks and a selected `VoiceTranscriber`. |
| 30 | Preparation binds transcription to its implementation and resolved locale; one cancellation |
| 31 | signal covers both operations. Applications provide recorder events, permissions, native |
| 32 | transcription implementations, and presentation. |
| 33 | |
| 34 | Applications 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 |
| 37 | files are public API boundaries; all other files remain implementation details. |