From 2aeec486271ae53372d456ef33f94cc540b2b97a Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Wed, 28 Jan 2026 12:54:51 -0500 Subject: [PATCH] Add TypeScript interfaces for rich prompt system --- src/types.ts | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/types.ts b/src/types.ts index eca8ef3..14bba7b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -35,6 +35,49 @@ export interface OutputLog { 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; + 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) export type ClientMessage =