feat(ask): add initial ask tool prototype and project setup

This commit is contained in:
Erik Kotsiuba
2026-04-16 17:56:01 +02:00
commit 133a0548ba
16 changed files with 4039 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
export type AskQuestionType = "single" | "multi" | "code-review";
export interface AskOption {
value: string;
label: string;
description?: string;
preview?: string;
}
export interface AskQuestionInput {
id: string;
label?: string;
prompt: string;
type?: AskQuestionType;
allowOther?: boolean;
required?: boolean;
options: AskOption[];
}
export interface AskParams {
title?: string;
questions: AskQuestionInput[];
}
export interface AskQuestion
extends Omit<AskQuestionInput, "type" | "allowOther" | "required" | "label"> {
label: string;
type: AskQuestionType;
allowOther: boolean;
required: boolean;
}
export interface AskAnswer {
values: string[];
labels: string[];
indices: number[];
customText?: string;
note?: string;
}
export interface AskResult {
title?: string;
cancelled: boolean;
questions: Array<{
id: string;
label: string;
prompt: string;
type: AskQuestionType;
}>;
answers: Record<string, AskAnswer>;
}
export type ViewMode = "navigate" | "input" | "submit";
export interface AskState {
title?: string;
questions: AskQuestion[];
currentTab: number;
optionIndex: number;
submitIndex: number;
mode: ViewMode;
inputQuestionId: string | null;
answers: Record<string, AskAnswer>;
completed: boolean;
cancelled: boolean;
}
export interface RenderOption extends AskOption {
isOther?: boolean;
}