0fcf66fc22
Interactive Prompts: - Unified InteractivePrompt type across all 3 adapters (Claude/Codex/Gemini) - InteractivePromptOverlay component with options, text input, countdown - Gemini + Codex pane monitors detect tool confirmation, ask user, plan approval - respondInteractivePrompt routing: permission → respondPermission, options → _selectOption - Claude AskUserQuestion nested questions[0] structure parsing Cross-AI Review: - Client-generated reviewId, removed pendingReview state - FloatingReviewPanel uses CSS display:none instead of unmount (keeps hooks alive) - Child review sessions default to YOLO/bypass permission mode - Send back to parent, send to existing/new review, tab switching, end review - Collapsed review cards with read-only panel for ended reviews - Full reconnect support: active + ended reviews restore correctly AskUserQuestion Tool Card UI: - Dedicated renderer replaces raw JSON display - Options shown with selected (green) / unselected (gray) indicators - Free text answers shown in quoted format with green border - Collapsed summary: question → answer - Shared parseAskQuestionInput utility (client + server) - Historical tool results attached via _result on tool_use blocks Adapter Fixes: - Session→adapter mapping persisted in SQLite (survives server restart) - SESSION_CREATED deferred for pendingRekey adapters (Codex/Gemini) - session-rekeyed handler sends complete SESSION_CREATED with adapter + cwd - Gemini: auto-accept folder trust, privacy notice, IDE nudge, YOLO * prompt - Claude: auto-accept bypass permissions confirmation (v2.1.85+) - Port fallback (EADDRINUSE → try +1), statusLine shell script wrapper Other: - Desktop Enter sends / Shift+Enter newline; Mobile Enter newline - Strip CLAWTAP_REF marker from session list - Active sessions tab shows adapter badge - Rename CLAUDE_UI_PASSWORD → CLAWTAP_PASSWORD Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
85 lines
2.3 KiB
TypeScript
85 lines
2.3 KiB
TypeScript
export type ServerMessageType =
|
|
| 'session-created' | 'session-state' | 'text-delta' | 'thinking'
|
|
| 'tool-start' | 'tool-done' | 'tool-updates' | 'message-complete'
|
|
| 'permission-request' | 'permission-dismissed' | 'history-load'
|
|
| 'turn-complete' | 'status-update' | 'mode-updated'
|
|
| 'compacting' | 'compact-done' | 'session-error' | 'session-ended'
|
|
| 'client-id' | 'pending-notifications' | 'error'
|
|
| 'review-started' | 'review-ended';
|
|
|
|
export interface ServerMessage {
|
|
type: ServerMessageType;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export type ClientMessageType =
|
|
| 'query' | 'permission-response' | 'ask-response' | 'abort'
|
|
| 'reconnect' | 'set-permission-mode' | 'plan-response';
|
|
|
|
export interface ClientMessage {
|
|
type: ClientMessageType;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface QueryOptions {
|
|
adapter?: string;
|
|
cwd?: string;
|
|
model?: string;
|
|
sessionId?: string;
|
|
permissionMode?: string;
|
|
effort?: string;
|
|
images?: string[];
|
|
clientId?: string;
|
|
}
|
|
|
|
export type PermissionBehavior = 'allow' | 'allow_session' | 'deny';
|
|
|
|
export type PermissionMode = 'default' | 'acceptEdits' | 'plan' | 'bypassPermissions';
|
|
|
|
export interface ChatMessage {
|
|
role: 'user' | 'assistant';
|
|
content: MessageContent[];
|
|
interrupted?: boolean;
|
|
plan?: string;
|
|
senderClientId?: string;
|
|
id?: string; // unique message ID
|
|
adapter?: string; // 'claude' | 'codex'
|
|
timestamp?: string; // ISO 8601
|
|
}
|
|
|
|
export type MessageContent =
|
|
| { type: 'text'; text: string }
|
|
| { type: 'tool_use'; id: string; name: string; input: Record<string, unknown> }
|
|
| { type: 'tool_result'; tool_use_id: string; content: string };
|
|
|
|
export interface ToolStatus {
|
|
name: string;
|
|
input?: Record<string, unknown>;
|
|
status: 'running' | 'success' | 'error' | 'interrupted';
|
|
result?: string;
|
|
error?: string;
|
|
}
|
|
|
|
export interface SessionStatus {
|
|
contextPercent: number;
|
|
model: string;
|
|
cost: number;
|
|
}
|
|
|
|
export interface InteractivePrompt {
|
|
requestId: string;
|
|
promptType: 'permission' | 'question' | 'plan' | 'loop-detected';
|
|
title: string;
|
|
description: string;
|
|
toolName?: string;
|
|
toolInput?: any;
|
|
options?: { value: string; label: string }[];
|
|
textInput?: { placeholder?: string };
|
|
}
|
|
|
|
export interface PromptResponse {
|
|
requestId: string;
|
|
selectedOption?: string;
|
|
textValue?: string;
|
|
}
|