ConsoleClientSession
Defined in: console-sdk/src/runtime/consoleClient.ts:117
The workout-session surface of ConsoleClient (SDK_PLAN.md §3.6.10):
current() is a point-in-time WorkoutSessionSnapshot read (never a
subscription — the reactive path is useWorkoutSession); start/end are
the SessionEngine’s rejecting cores (imperative callers want exceptions,
§3.8.3 — not the hooks’ never-rejecting bare verbs).
Methods
Section titled “Methods”current()
Section titled “current()”current():
WorkoutSessionSnapshot
Defined in: console-sdk/src/runtime/consoleClient.ts:123
A point-in-time snapshot of the one workout session — the same exhaustive
phase union useWorkoutSession() returns, read once (no subscription).
{ phase: 'idle' } before any start() (or after dismiss()).
Returns
Section titled “Returns”end():
Promise<WorkoutResult>
Defined in: console-sdk/src/runtime/consoleClient.ts:137
Ends the session gracefully and resolves the reconciled
WorkoutResult — rejects with a SessionError on a genuine
fault ('session/wrong-phase', …). The reactive form is
useWorkoutControls().end.
Returns
Section titled “Returns”Promise<WorkoutResult>
start()
Section titled “start()”start(
input):Promise<void>
Defined in: console-sdk/src/runtime/consoleClient.ts:130
Programs and starts a session — rejects with a SessionError on
failure ('session/arm-failed' carrying armed: DeviceId[],
'session/already-active', 'session/invalid-plan'). The reactive,
never-rejecting form is useWorkoutControls().start.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>