/**
 * Intent Status State Machine
 *
 * Defines and enforces valid status transitions for intents.
 * Prevents invalid state changes and provides detailed error messages.
 */
import type { IntentStatus } from '../common/types.js';
/**
 * Transition metadata
 */
export interface TransitionMeta {
    /** Human-readable description of the transition */
    description: string;
    /** Whether this transition requires a reason */
    requiresReason?: boolean;
    /** Whether this transition requires elevated permissions */
    requiresPermission?: boolean;
    /** Trigger event type for this transition */
    event?: string;
}
/**
 * Terminal states that cannot transition to any other state
 */
export declare const TERMINAL_STATES: Set<IntentStatus>;
/**
 * Active states where the intent is being processed
 */
export declare const ACTIVE_STATES: Set<IntentStatus>;
/**
 * States that allow cancellation
 */
export declare const CANCELLABLE_STATES: Set<IntentStatus>;
/**
 * States that allow replay (restart from pending)
 */
export declare const REPLAYABLE_STATES: Set<IntentStatus>;
/**
 * Result of a transition validation
 */
export interface TransitionResult {
    valid: boolean;
    meta?: TransitionMeta;
    error?: string;
    errorCode?: 'INVALID_TRANSITION' | 'TERMINAL_STATE' | 'REQUIRES_REASON' | 'REQUIRES_PERMISSION';
}
/**
 * Check if a status transition is valid
 */
export declare function isValidTransition(fromStatus: IntentStatus, toStatus: IntentStatus): boolean;
/**
 * Get metadata for a transition
 */
export declare function getTransitionMeta(fromStatus: IntentStatus, toStatus: IntentStatus): TransitionMeta | undefined;
/**
 * Validate a status transition with detailed result
 */
export declare function validateTransition(fromStatus: IntentStatus, toStatus: IntentStatus, options?: {
    hasReason?: boolean;
    hasPermission?: boolean;
}): TransitionResult;
/**
 * Get all valid transitions from a status
 */
export declare function getValidTransitions(fromStatus: IntentStatus): IntentStatus[];
/**
 * Get the event type for a transition
 */
export declare function getTransitionEvent(fromStatus: IntentStatus, toStatus: IntentStatus): string | undefined;
/**
 * Check if a status is terminal (no further transitions possible)
 */
export declare function isTerminalState(status: IntentStatus): boolean;
/**
 * Check if a status is active (intent is being processed)
 */
export declare function isActiveState(status: IntentStatus): boolean;
/**
 * Check if an intent can be cancelled from the given status
 */
export declare function canCancel(status: IntentStatus): boolean;
/**
 * Check if an intent can be replayed from the given status
 */
export declare function canReplay(status: IntentStatus): boolean;
/**
 * Get the next logical status for workflow progression
 * Returns the primary "happy path" next status
 */
export declare function getNextWorkflowStatus(status: IntentStatus): IntentStatus | null;
/**
 * State machine error class
 */
export declare class StateMachineError extends Error {
    readonly fromStatus: IntentStatus;
    readonly toStatus: IntentStatus;
    readonly errorCode: TransitionResult['errorCode'];
    constructor(result: TransitionResult, fromStatus: IntentStatus, toStatus: IntentStatus);
}
/**
 * Assert that a transition is valid, throwing if not
 */
export declare function assertValidTransition(fromStatus: IntentStatus, toStatus: IntentStatus, options?: {
    hasReason?: boolean;
    hasPermission?: boolean;
}): void;
/**
 * Get a visual representation of the state machine
 * Returns a mermaid diagram string
 */
export declare function getStateDiagram(): string;
//# sourceMappingURL=state-machine.d.ts.map