import type { ScenarioDefinition, ScenarioState } from '../../shared/types' import { mockScenario } from './mock-data' // Mock mode has no Go process, but the presenter controls and the 5 s polling // fallback should still observe a version change. Nitro keeps this per-process // state, exactly like the single Go pod keeps its in-memory scenario. let current: ScenarioState = clone(mockScenario) function clone(value: T): T { return JSON.parse(JSON.stringify(value)) as T } export function getMockScenario(): ScenarioState { return clone(current) } export function setMockScenario(input: ScenarioDefinition): ScenarioState { current = { version: current.version + 1, scenario: clone(input), at: new Date().toISOString(), } return clone(current) }