// tools/create-spec/question-generator.ts — SPEC-1083
// Dynamic clarification questions grounded in the user's requested work.
import { extractSignals } from '../../engine/elicitation/answer-extractor.js';
import { detectDecisionGaps } from '../../engine/elicitation/decision-gap-detector.js';
import { validateQuestionGrounding } from '../../engine/elicitation/question-grounding-gate.js';
/** Generate clarification questions based on request-specific missing decisions. */
export function generateInteractiveQuestions(description, knowledge) {
    const signals = extractSignals(description);
    const gaps = detectDecisionGaps(signals, knowledge);
    return gaps.flatMap((gap) => {
        const question = {
            question: gap.question,
            header: gap.header,
            options: gap.options,
            multiSelect: gap.multiSelect,
        };
        return validateQuestionGrounding(question, {
            gap,
            requestText: description,
        }).passed
            ? [question]
            : [];
    });
}
//# sourceMappingURL=question-generator.js.map