/** * MCP server lifecycle state machine. * * Pure transition logic, no side effects, no I/O. * All state changes flow through `applyTransition()`. */ import type { McpServerState } from './types.js'; /** * Returns `true` if transitioning from `from` to `to` is permitted by the * state machine definition. * * @param from - Current state * @param to - Proposed next state */ export declare function canTransition(from: McpServerState, to: McpServerState): boolean; /** * Returns all states reachable from the given state. * * @param from - Current state */ export declare function reachableFrom(from: McpServerState): ReadonlySet; /** Result of attempting a state transition. */ export type TransitionResult = { success: true; previous: McpServerState; next: McpServerState; } | { success: false; reason: string; }; /** * Attempt to apply a state transition. * * Returns `{ success: true, previous, next }` if the transition is valid, * or `{ success: false, reason }` if it is not. * * This function is pure, callers are responsible for updating the entry. * * @param current - The current state of the server * @param target - The desired next state */ export declare function applyTransition(current: McpServerState, target: McpServerState): TransitionResult; /** * Returns `true` if the state represents an active/usable server. * * Both `connected` and `degraded` allow tool calls to proceed. */ export declare function isOperational(state: McpServerState): boolean; /** * Returns `true` if the state is terminal for a reconnect cycle * (i.e., the manager should not attempt further reconnects automatically). */ export declare function isTerminal(state: McpServerState): boolean; //# sourceMappingURL=lifecycle.d.ts.map