/** * Run state machine for @a5c-ai/agent-mux. * * Defines the 9 RunState values, valid transition map, terminal state set, * and guard helpers used by RunHandleImpl. */ /** * All valid states for an agent run. * * States are mutually exclusive; every run is in exactly one state at a time. * Terminal states are absorbing — no transitions out. */ export type RunState = 'spawned' | 'running' | 'paused' | 'interrupted' | 'aborted' | 'timed-out' | 'completed' | 'crashed' | 'killed'; /** Set of states from which no further transitions are possible. */ export declare const TERMINAL_STATES: ReadonlySet; /** * Map of (fromState -> Set) defining all legal state transitions. * * Transitions not listed here are invalid and will throw * AgentMuxError('INVALID_STATE_TRANSITION', ...). */ export declare const VALID_TRANSITIONS: ReadonlyMap>; /** * Returns true when the state is terminal (no transitions out). */ export declare function isTerminal(state: RunState): boolean; /** * Assert that transitioning from `from` to `to` is valid. * * @throws {AgentMuxError} code `INVALID_STATE_TRANSITION` when the transition * is not in the VALID_TRANSITIONS map. */ export declare function assertTransition(from: RunState, to: RunState): void;