/** * Lifecycle state machine + the universal `{state, evidence, nextAllowedActions}` contract. * * `nextAllowedActions` is the forcing function: it tells the caller exactly which * primitives are currently permitted and, when not, why. Owner-routed verbs * (`submit`) report `owner-not-live` when no `RuntimeOwner` holds the session lease. */ import type { HarnessLifecycle, NextAllowedAction, PrimitiveResponse, SessionState, SessionStateView } from "./types"; export declare function isTerminal(lifecycle: HarnessLifecycle): boolean; export declare function canTransition(from: HarnessLifecycle, to: HarnessLifecycle): boolean; export declare function assertTransition(from: HarnessLifecycle, to: HarnessLifecycle): void; export interface NextAllowedActionsOptions { /** Additional live-owner/RPC readiness gate for submit, e.g. rpc-not-idle. */ submitUnavailableReason?: string | null; } export declare function submitUnavailableReason(lifecycle: HarnessLifecycle, ownerLive: boolean, gateReason?: string | null): string | null; /** * Derive the permitted next actions for a session given its lifecycle and whether * a live owner currently holds the lease. */ export declare function nextAllowedActions(lifecycle: HarnessLifecycle, ownerLive: boolean, options?: NextAllowedActionsOptions): NextAllowedAction[]; export declare function buildStateView(state: SessionState, ownerLive: boolean): SessionStateView; /** Build the universal contract response carried by every primitive. */ export declare function buildResponse>(state: SessionState, ownerLive: boolean, evidence: E, ok?: boolean): PrimitiveResponse;