Add TypeScript interfaces for rich prompt system

This commit is contained in:
Jared Miller 2026-01-28 12:54:51 -05:00
parent 8992b0cc7b
commit 2aeec48627
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -35,6 +35,49 @@ export interface OutputLog {
line: string; line: string;
} }
// Phase 2: Rich prompt system interfaces
// Represents the structured data format for interactive prompts from Claude Code
export interface PromptOption {
label: string;
value: string;
description?: string;
}
export interface PermissionPrompt {
prompt_type: "permission";
tool_name: string;
tool_input: Record<string, unknown>;
options: PromptOption[];
allows_tab_instructions: boolean;
selected_option: number;
}
export interface QuestionItem {
question: string;
header?: string;
options: PromptOption[];
multi_select: boolean;
allows_other: boolean;
}
export interface QuestionPrompt {
prompt_type: "question";
questions: QuestionItem[];
}
export interface ExitPlanPrompt {
prompt_type: "exit_plan";
options: PromptOption[];
}
export type PromptData = PermissionPrompt | QuestionPrompt | ExitPlanPrompt | null;
export type AnswerResponse =
| { type: "option"; value: string }
| { type: "text"; value: string }
| { type: "tab_instructions"; selected_option: number; instruction: string };
// WebSocket messages (CLI <-> Server) // WebSocket messages (CLI <-> Server)
export type ClientMessage = export type ClientMessage =