import type { InterviewStep } from './interview-steps.js'; /** Normalized answer types after UI adapter processing */ export type AnswerValue = string | string[] | boolean; /** Serializable interview state for persistence/resume */ export interface InterviewState { currentStepId: string | null; answers: Record; isComplete: boolean; } /** Result of submitting an answer */ export type SubmitResult = { success: true; } | { success: false; error: string; }; /** * UI-agnostic interview state machine. * * Usage: * const sm = new InterviewStateMachine(steps); * const question = sm.nextQuestion(); * if (question) { * const result = sm.submitAnswer(question.id, userValue); * if (result.success) { * const next = sm.nextQuestion(); * } * } */ export declare class InterviewStateMachine { private steps; private answers; private currentIndex; private complete; constructor(steps: InterviewStep[]); /** Get the current serializable state */ getState(): InterviewState; /** Restore state (e.g., after agent reconnect) */ restoreState(state: InterviewState): void; /** Get the current step without advancing (useful after restoreState) */ currentQuestion(): InterviewStep | null; /** Get the next unanswered step that passes its condition */ nextQuestion(): InterviewStep | null; /** * Submit an answer for the current step. * Validates the value using the step's validate function if present. * Does NOT advance — call nextQuestion() separately to get the next step. */ submitAnswer(id: string, value: unknown): SubmitResult; /** Whether the interview has reached the end */ isComplete(): boolean; /** Get the collected answers (same shape as legacy answers map) */ getResult(): Record; /** Get answers cast to unknown for compat with legacy init functions */ getResultUnknown(): Record; private currentStepId; private normalizeValue; } //# sourceMappingURL=interview-state-machine.d.ts.map