Skip to content

IntervalSpec

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

One entry in a structured interval program (SDK_PLAN.md §3.6.5).

role is the leg → device binding, NOT the mode signal — the plan’s choreography is chosen by the explicit intervals.mode discriminator (StartWorkoutInput), never inferred from role presence:

  • In broadcast mode every device runs each interval simultaneously and role MUST be omitted (a broadcast plan is role-less; valid at any N — the same role-less input that drives one rower drives a rower + bike pair with zero changes, the binding constraint §1.3).
  • In sequential mode role selects which console runs this leg, the turn hands off to the next leg’s role after it, and role MUST be present on every interval; SessionProgress.activeDeviceId is non-null only in this mode.

The mode ↔ role coherence rules (a broadcast plan with any role, a sequential plan with a missing role, or a role-scoped plan with no mode) reject with 'session/invalid-plan'.

optional rest?: Rest

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

Rest after the work segment; defaults to { kind: 'untilUserContinues' }.


optional role?: Modality

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

sequential mode: the modality whose console runs this leg (turn-based). broadcast mode: omit it (every device runs the interval). All intervals in one plan must agree with the plan’s mode.


optional targets?: PerformanceTargets

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

Optional performance targets for the work segment. Only targets.pace is programmed to the console; the rest are app-scored pass-through values.


work: { kind: "distance"; meters: number; } | { kind: "time"; seconds: number; } | { calories: number; kind: "calories"; }

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

The work segment: a distance, a duration, or a calorie goal.