Skip to content

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).

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()).

WorkoutSessionSnapshot


end(): Promise<WorkoutResult>

Defined in: console-sdk/src/runtime/consoleClient.ts:137

Ends the session gracefully and resolves the reconciled WorkoutResultrejects with a SessionError on a genuine fault ('session/wrong-phase', …). The reactive form is useWorkoutControls().end.

Promise<WorkoutResult>


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.

StartWorkoutInput

Promise<void>