初步支持AskUserQuestion交互

This commit is contained in:
xintaofei
2026-03-11 19:43:24 +08:00
parent 56100c6759
commit 79a22c8a03
16 changed files with 273 additions and 2 deletions

View File

@@ -7,9 +7,13 @@ import type {
SessionModeInfo,
AvailableCommandInfo,
} from "@/lib/types"
import type { PendingPermission } from "@/contexts/acp-connections-context"
import type {
PendingPermission,
PendingQuestion,
} from "@/contexts/acp-connections-context"
import { ChatInput } from "@/components/chat/chat-input"
import { PermissionDialog } from "@/components/chat/permission-dialog"
import { QuestionDialog } from "@/components/chat/question-dialog"
interface ConversationShellProps {
status: ConnectionStatus | null
@@ -17,10 +21,12 @@ interface ConversationShellProps {
defaultPath?: string
error: string | null
pendingPermission: PendingPermission | null
pendingQuestion: PendingQuestion | null
onFocus: () => void
onSend: (draft: PromptDraft, modeId?: string | null) => void
onCancel: () => void
onRespondPermission: (requestId: string, optionId: string) => void
onAnswerQuestion: (answer: string) => void
children: ReactNode
modes?: SessionModeInfo[]
configOptions?: SessionConfigOptionInfo[]
@@ -42,10 +48,12 @@ export function ConversationShell({
defaultPath,
error,
pendingPermission,
pendingQuestion,
onFocus,
onSend,
onCancel,
onRespondPermission,
onAnswerQuestion,
children,
modes,
configOptions,
@@ -69,6 +77,8 @@ export function ConversationShell({
onRespond={onRespondPermission}
/>
<QuestionDialog question={pendingQuestion} onAnswer={onAnswerQuestion} />
{!hideInput && (
<ChatInput
status={status}