Add TypeScript interfaces for rich prompt system
This commit is contained in:
parent
8992b0cc7b
commit
2aeec48627
1 changed files with 43 additions and 0 deletions
43
src/types.ts
43
src/types.ts
|
|
@ -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 =
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue