export type QuestionType = "select" | "text";

export interface QuestionOptionInput {
  value: string;
  label: string;
  description?: string;
}

export interface QuestionInput {
  id: string;
  label?: string;
  prompt: string;
  type: QuestionType;
  options?: QuestionOptionInput[];
  allowCustom?: boolean;
  required?: boolean;
}

export interface NormalizedQuestion {
  id: string;
  label: string;
  prompt: string;
  type: QuestionType;
  options: QuestionOptionInput[];
  allowCustom: boolean;
  required: boolean;
}

/**
 * `question` and `answer` intentionally match pi-permission-auto-review's
 * trusted user-interaction envelope for ask_user_question.
 */
export interface UserAnswer {
  id: string;
  question: string;
  type: QuestionType;
  answer: string;
  value: string;
  label: string;
  custom: boolean;
  skipped: boolean;
}

export interface AskUserResult {
  version: 1;
  cancelled: boolean;
  questions: NormalizedQuestion[];
  answers: UserAnswer[];
}
