Skip to content

WorkoutControls

Defined in: console-sdk/src/session/types.ts:578

The always-available workout lifecycle verbs (SDK_PLAN.md §3.6.5). A flat hook so buttons wire without narrowing. Per the paired-verb contract (§3.8.3), the bare verbs NEVER reject — failure routes into the snapshot (startError, phase 'failed') — while the *Async twins reject with a typed SessionError for imperative composition.

abandon(options?): Promise<void>

Defined in: console-sdk/src/session/types.ts:618

Abandons without a normal finish. keep: 'partial' applies RM-743 partial-capture semantics (partialResult populated with whatever reconciled); default 'discard'.

"discard" | "partial"

Promise<void>


dismiss(): void

Defined in: console-sdk/src/session/types.ts:625

Returns a terminal session (completed/aborted/failed) to idle and releases session-scoped streams. Optional when the next action is another start() (which implicitly dismisses a terminal session) — required only to release session-scoped streams while staying on a terminal screen.

void


end(): Promise<WorkoutResult | null>

Defined in: console-sdk/src/session/types.ts:610

Ends the session gracefully: parallel stop-all, stop-verify, final split commit, and record reconciliation (RM-558/621/647/743 semantics), then phase 'completed' with the reconciled result. Resolves the WorkoutResult, or null on failure (failure lands in the snapshot: phase 'failed').

Promise<WorkoutResult | null>


endAsync(): Promise<WorkoutResult>

Defined in: console-sdk/src/session/types.ts:612

Rejecting twin of end ('session/wrong-phase', …).

Promise<WorkoutResult>


pause(): Promise<void>

Defined in: console-sdk/src/session/types.ts:600

Pauses a running session; a wrong-phase call is a dev-warned no-op.

Promise<void>


resume(): Promise<void>

Defined in: console-sdk/src/session/types.ts:602

Resumes a paused session; a wrong-phase call is a dev-warned no-op.

Promise<void>


start(input): Promise<boolean>

Defined in: console-sdk/src/session/types.ts:588

Programs and starts a session. Resolves true once all devices are armed and the session is running; resolves false on failure, with the SessionError mirrored into startError — NEVER rejects (§3.8.3). Calling start() while a previous session sits in a TERMINAL phase (completed/aborted/failed) implicitly dismiss()es it first; 'session/already-active' is reserved for arming/running/resting/paused/finalizing.

StartWorkoutInput

Promise<boolean>


startAsync(input): Promise<void>

Defined in: console-sdk/src/session/types.ts:594

Rejecting twin of start for imperative composition. Rejects with 'session/arm-failed' (carrying armed: DeviceId[]), 'session/already-active', or 'session/invalid-plan'.

StartWorkoutInput

Promise<void>

isStarting: boolean

Defined in: console-sdk/src/session/types.ts:596

true while a start()/startAsync() is in flight.


startError: SessionError | null

Defined in: console-sdk/src/session/types.ts:598

The last start failure, cleared on the next start()/startAsync().