diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index c88bef4ce22..a78dd8f2ea4 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -12662,8 +12662,8 @@ "src/shared/native-chat-agent-support.test.ts": 38, "src/shared/native-chat-appearance-settings.test.ts": 34, "src/shared/native-chat-approval-envelope.test.ts": 49, - "src/shared/native-chat-ask-fifo.test.ts": 30, - "src/shared/native-chat-ask.test.ts": 95, + "src/shared/native-chat/input/native-chat-ask-fifo.test.ts": 30, + "src/shared/native-chat/input/native-chat-ask.test.ts": 95, "src/shared/native-chat/input/native-chat-background-task-row.test.ts": 67, "src/shared/native-chat-context-usage.test.ts": 28, "src/shared/native-chat-cut-turn-notice.test.ts": 217, diff --git a/mobile/src/session/MobileNativeChatAwaitingInputRow.tsx b/mobile/src/session/MobileNativeChatAwaitingInputRow.tsx index 949a0b1b2a6..e003e4d0863 100644 --- a/mobile/src/session/MobileNativeChatAwaitingInputRow.tsx +++ b/mobile/src/session/MobileNativeChatAwaitingInputRow.tsx @@ -3,7 +3,7 @@ import { MessageSquareMore } from 'lucide-react-native' import { NATIVE_CHAT_ASK_ROW_COPY, type NativeChatAskRowSubject -} from '../../../src/shared/native-chat-ask-row' +} from '../../../src/shared/native-chat/input/native-chat-ask-row' import { INLINE_TEXT_SELECTION } from '../components/inline-text-selection' import { colors, spacing, typography } from '../theme/mobile-theme' import { scaledType } from './mobile-native-chat-message-styles' diff --git a/mobile/src/session/MobileNativeChatMessage.tsx b/mobile/src/session/MobileNativeChatMessage.tsx index d5d79b31658..ff971abee0b 100644 --- a/mobile/src/session/MobileNativeChatMessage.tsx +++ b/mobile/src/session/MobileNativeChatMessage.tsx @@ -38,7 +38,7 @@ import { MobileNativeChatResolutionReceipt } from './MobileNativeChatResolutionR import { nativeChatAskRunBlocks, nativeChatAskRunSubject -} from '../../../src/shared/native-chat-ask-row' +} from '../../../src/shared/native-chat/input/native-chat-ask-row' import type { NativeChatResolvedPrompt } from '../../../src/shared/native-chat-resolution-receipt' import { MobileNativeChatSubagentGroup } from './MobileNativeChatSubagentGroup' import { ToolRun } from './MobileNativeChatToolRun' diff --git a/mobile/src/session/MobileNativeChatView.tsx b/mobile/src/session/MobileNativeChatView.tsx index f3de19cb4cc..f37b22c0ba1 100644 --- a/mobile/src/session/MobileNativeChatView.tsx +++ b/mobile/src/session/MobileNativeChatView.tsx @@ -14,7 +14,7 @@ import { import { useSafeAreaInsets } from 'react-native-safe-area-context' import { GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler' import type { AskAnswerSelection } from '../../../src/shared/native-chat-ask-answer' -import type { AskPrompt } from '../../../src/shared/native-chat-ask-types' +import type { AskPrompt } from '../../../src/shared/native-chat/input/native-chat-ask-types' import type { NativeChatMessage } from '../../../src/shared/native-chat-types' import type { NativeChatLiveTurnIndicator, diff --git a/mobile/src/session/mobile-native-chat-controller-contract.ts b/mobile/src/session/mobile-native-chat-controller-contract.ts index 7afb41e487f..533ffddca18 100644 --- a/mobile/src/session/mobile-native-chat-controller-contract.ts +++ b/mobile/src/session/mobile-native-chat-controller-contract.ts @@ -1,7 +1,8 @@ import type { StructuredMobileSendAttachment } from './use-mobile-structured-send-with-outcome' import type { MobileSessionView } from '../storage/session-view-preferences' import type { Dispatch, MutableRefObject, SetStateAction } from 'react' -import type { AskAnswerSelection, AskPrompt } from '../../../src/shared/native-chat-ask' +import type { AskAnswerSelection } from '../../../src/shared/native-chat-ask-answer' +import type { AskPrompt } from '../../../src/shared/native-chat/input/native-chat-ask-types' import type { MobileChatPermission } from './native-chat/input/mobile-native-chat-permission' import type { MobileChatQuestion } from './native-chat/input/mobile-native-chat-question' import type { diff --git a/mobile/src/session/mobile-native-chat-run-descriptors.ts b/mobile/src/session/mobile-native-chat-run-descriptors.ts index e31fc282cb5..bab9d027f57 100644 --- a/mobile/src/session/mobile-native-chat-run-descriptors.ts +++ b/mobile/src/session/mobile-native-chat-run-descriptors.ts @@ -2,7 +2,7 @@ import type { NativeChatMessage } from '../../../src/shared/native-chat-types' import type { NativeChatResolvedPrompt } from '../../../src/shared/native-chat-resolution-receipt' import { splitNativeChatBlocks } from '../../../src/shared/native-chat/tools/native-chat-tool-fold' import { nativeChatWorkRunEntries } from '../../../src/shared/native-chat-work-run' -import { nativeChatAskRunBlocks } from '../../../src/shared/native-chat-ask-row' +import { nativeChatAskRunBlocks } from '../../../src/shared/native-chat/input/native-chat-ask-row' import type { MobileNativeChatWorkRuns } from './use-mobile-native-chat-transcript-rows' import type { MobileNativeChatRowSources } from './mobile-native-chat-row-keys' diff --git a/mobile/src/session/mobile-prompt-controller.test.ts b/mobile/src/session/mobile-prompt-controller.test.ts index 16755b0247b..ee852879f5a 100644 --- a/mobile/src/session/mobile-prompt-controller.test.ts +++ b/mobile/src/session/mobile-prompt-controller.test.ts @@ -2,7 +2,7 @@ import { act } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { RpcResponse } from '../transport/types' import type { RpcClient } from '../transport/rpc-client' -import type { AskPrompt } from '../../../src/shared/native-chat-ask' +import type { AskPrompt } from '../../../src/shared/native-chat/input/native-chat-ask-types' import { visible, handleRef, diff --git a/mobile/src/session/native-chat/input/MobileNativeChatAsk.test.tsx b/mobile/src/session/native-chat/input/MobileNativeChatAsk.test.tsx index c07eeadba23..37983f9a1a9 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatAsk.test.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatAsk.test.tsx @@ -1,8 +1,8 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { AskPrompt } from '../../../../../src/shared/native-chat-ask' -import { NATIVE_CHAT_QUESTION_AUTO_ADVANCE_MS } from '../../../../../src/shared/native-chat-question-auto-advance' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' +import { NATIVE_CHAT_QUESTION_AUTO_ADVANCE_MS } from '../../../../../src/shared/native-chat/input/native-chat-question-auto-advance' import { encodeAgentSessionQuestionAnswers } from '../../../../../src/shared/agent-session-question-answer' import { MobileNativeChatAsk } from './MobileNativeChatAsk' import { MobileNativeChatStructuredAsk } from './MobileNativeChatStructuredAsk' diff --git a/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx b/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx index 38677ef58da..10caafbb856 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx @@ -1,7 +1,8 @@ import { useRef, useState } from 'react' import { Pressable, ScrollView, StyleSheet, Text, TextInput, View } from 'react-native' import { Check } from 'lucide-react-native' -import type { AskAnswerSelection, AskPrompt } from '../../../../../src/shared/native-chat-ask' +import type { AskAnswerSelection } from '../../../../../src/shared/native-chat-ask-answer' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import type { AgentJournalFreeTextInput } from '../../../../../src/shared/agent-session-journal-types' import { askAcceptsEmptyAnswer, diff --git a/mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx b/mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx index 4aaecc365c0..eee78968a03 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx @@ -1,7 +1,7 @@ import { Pressable, StyleSheet, Text, View } from 'react-native' import { colors, radii, spacing, typography } from '../../../theme/mobile-theme' import type { AskAnswerSelection } from '../../../../../src/shared/native-chat-ask-answer' -import type { AskPrompt } from '../../../../../src/shared/native-chat-ask-types' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import { MobileNativeChatAsk } from './MobileNativeChatAsk' import { MobileNativeChatPermission } from './MobileNativeChatPermission' import type { MobileChatPermission } from './mobile-native-chat-permission' diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts b/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts index d891b7ddd08..ad105d55a74 100644 --- a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts +++ b/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts @@ -4,7 +4,7 @@ import { NATIVE_CHAT_ADVANCE_BUFFER_MS, NATIVE_CHAT_QUESTION_STEP_MS, NATIVE_CHAT_SUBMIT_DELAY_MS -} from '../../../../../src/shared/native-chat-answer-stepping' +} from '../../../../../src/shared/native-chat/input/native-chat-answer-stepping' export const MOBILE_NATIVE_CHAT_ADVANCE_BUFFER_MS = NATIVE_CHAT_ADVANCE_BUFFER_MS export const MOBILE_NATIVE_CHAT_QUESTION_STEP_MS = NATIVE_CHAT_QUESTION_STEP_MS diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send-omp.test.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send-omp.test.ts index 52e48aa5982..3a2f8c40815 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send-omp.test.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send-omp.test.ts @@ -1,7 +1,7 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { AskPrompt } from '../../../../../src/shared/native-chat-ask-types' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import type { RpcClient } from '../../../transport/rpc-client' import { useMobileNativeChatAnswerSend } from './use-mobile-native-chat-answer-send' import { useNativeChatAcceptedAction } from '../../use-native-chat-action-outcomes' diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts index d6898443bbf..01d1b4b8ea4 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts @@ -5,7 +5,7 @@ vi.mock('../../../terminal/worker-terminal-takeover-report', () => ({ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { AskPrompt } from '../../../../../src/shared/native-chat-ask' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import type { AgentType } from '../../../../../src/shared/native-chat-types' import { buildNativeChatPasteBytes } from '../../../../../src/shared/native-chat-paste-bytes' import type { RpcClient } from '../../../transport/rpc-client' diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts index 80db1c91c58..22f9888aa8b 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts @@ -6,7 +6,7 @@ import { hasAskAnswer } from '../../../../../src/shared/native-chat-ask-answer' import type { AskAnswerSelection } from '../../../../../src/shared/native-chat-ask-answer' -import type { AskPrompt } from '../../../../../src/shared/native-chat-ask-types' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import type { RpcClient } from '../../../transport/rpc-client' import { MOBILE_NATIVE_CHAT_QUESTION_STEP_MS } from './mobile-native-chat-answer-stepping' import { diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-auto-advance.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-auto-advance.ts index fa6cf8a4927..f292bc9414e 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-auto-advance.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-auto-advance.ts @@ -1,5 +1,5 @@ import { useEffect, useRef } from 'react' -import { NATIVE_CHAT_QUESTION_AUTO_ADVANCE_MS } from '../../../../../src/shared/native-chat-question-auto-advance' +import { NATIVE_CHAT_QUESTION_AUTO_ADVANCE_MS } from '../../../../../src/shared/native-chat/input/native-chat-question-auto-advance' /** Mirrors desktop's useNativeChatQuestionAutoAdvance; shared code cannot import this app's React. */ export function useMobileNativeChatAskAutoAdvance(): { diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.test.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.test.ts index 84cfa89a903..e71a0f490cf 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.test.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.test.ts @@ -1,7 +1,7 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import type { AskPrompt } from '../../../../../src/shared/native-chat-ask-types' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import { useMobileNativeChatAskDismiss } from './use-mobile-native-chat-ask-dismiss' import { mobileNativeChatPromptDismissals } from './mobile-native-chat-prompt-dismissals' diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.ts index 2c5e93a37bd..902a0d6adbd 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import type { AskPrompt } from '../../../../../src/shared/native-chat-ask' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import { useMobileNativeChatPromptDismiss } from './use-mobile-native-chat-prompt-dismiss' // Keep answered/collapsed asks across view toggles and remounts until an observed prompt supersedes them. diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.ts index b30e76f1165..be4aaab8737 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' import type { AgentStatusEntry } from '../../../../../src/shared/agent-status-types' -import type { AskPrompt } from '../../../../../src/shared/native-chat-ask' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import { resolveNativeChatInteractivePromptCard, type ChatApproval diff --git a/mobile/src/session/use-mobile-structured-async-question.ts b/mobile/src/session/use-mobile-structured-async-question.ts index e789505749c..b36956c6188 100644 --- a/mobile/src/session/use-mobile-structured-async-question.ts +++ b/mobile/src/session/use-mobile-structured-async-question.ts @@ -1,10 +1,10 @@ import { useCallback, useMemo } from 'react' +import { extractPendingMessageReplyAsk } from '../../../src/shared/native-chat/input/native-chat-ask' import { - extractPendingMessageReplyAsk, formatAskAnswer, - type AskAnswerSelection, - type AskPrompt -} from '../../../src/shared/native-chat-ask' + type AskAnswerSelection +} from '../../../src/shared/native-chat-ask-answer' +import type { AskPrompt } from '../../../src/shared/native-chat/input/native-chat-ask-types' import type { NativeChatMessage } from '../../../src/shared/native-chat-types' import type { useMobileStructuredAgentSession } from './use-mobile-structured-agent-session' diff --git a/src/main/codex/codex-structured-async-question.test.ts b/src/main/codex/codex-structured-async-question.test.ts index 2eb81e479d2..32374c67176 100644 --- a/src/main/codex/codex-structured-async-question.test.ts +++ b/src/main/codex/codex-structured-async-question.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { extractPendingAsk } from '../../shared/native-chat-ask' +import { extractPendingAsk } from '../../shared/native-chat/input/native-chat-ask' import { codexItemBody } from './codex-structured-item-translation' describe('Codex async question items', () => { diff --git a/src/main/native-chat/transcript-reader-codex-history-mode.test.ts b/src/main/native-chat/transcript-reader-codex-history-mode.test.ts index 821f91315f1..afb7e9325c2 100644 --- a/src/main/native-chat/transcript-reader-codex-history-mode.test.ts +++ b/src/main/native-chat/transcript-reader-codex-history-mode.test.ts @@ -2,7 +2,7 @@ import { mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { extractPendingAsk } from '../../shared/native-chat-ask' +import { extractPendingAsk } from '../../shared/native-chat/input/native-chat-ask' import { decodeCodexTranscriptLine } from './transcript-line-decoders-codex' import { readNativeChatTranscript } from './transcript-reader' import { readNativeChatTranscriptTail } from './transcript-tail-reader' diff --git a/src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.test.ts b/src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.test.ts index eabc36c5551..75decb00584 100644 --- a/src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.test.ts +++ b/src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.test.ts @@ -3,11 +3,11 @@ import { AGENT_STATUS_INTERACTIVE_PROMPT_MAX_LENGTH, parseAgentStatusPayload } from '../../../../shared/agent-status-types' +import { nativeChatAskDismissKey } from '../../../../shared/native-chat-ask-dismiss-key' import { - nativeChatAskDismissKey, parseAskFromStatus, parseAskFromToolInput -} from '../../../../shared/native-chat-ask' +} from '../../../../shared/native-chat/input/native-chat-ask' import type { NativeChatBlock } from '../../../../shared/native-chat-types' import { sanitizeNativeChatRpcBlock } from './native-chat-rpc-block-sanitize' diff --git a/src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.ts b/src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.ts index a419f9ca168..aae22443651 100644 --- a/src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.ts +++ b/src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.ts @@ -3,7 +3,7 @@ import { normalizeSubagentState } from '../../../../shared/native-chat-subagent-summary' import { fitInteractivePrompt } from '../../../../shared/agent-status-field-normalization' -import { parseAskFromToolInput } from '../../../../shared/native-chat-ask' +import { parseAskFromToolInput } from '../../../../shared/native-chat/input/native-chat-ask' import type { NativeChatBlock, NativeChatSubagentState } from '../../../../shared/native-chat-types' import { boundSubagentEntryId } from '../../../native-chat/subagent-entry-id-bounds' import type { RpcContext } from '../core' diff --git a/src/renderer/src/components/native-chat/NativeChatApprovalCard.tsx b/src/renderer/src/components/native-chat/NativeChatApprovalCard.tsx index eaa0e117edd..d8747c62b88 100644 --- a/src/renderer/src/components/native-chat/NativeChatApprovalCard.tsx +++ b/src/renderer/src/components/native-chat/NativeChatApprovalCard.tsx @@ -11,7 +11,7 @@ import { isPlanApprovalSubject } from '../../../../shared/agent-session-approval-subject' import { NativeChatCodeBlock } from './NativeChatCodeBlock' -import type { ChatApproval } from './native-chat-interactive-prompt' +import type { ChatApproval } from '../../../../shared/native-chat-interactive-prompt' import { NativeChatPromptCollapseToggle } from './NativeChatPromptCollapse' import { useNativeChatPromptCardFocus } from './use-native-chat-prompt-card-focus' diff --git a/src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx b/src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx index 8ffba1f6ee5..16e9661629a 100644 --- a/src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx @@ -4,7 +4,7 @@ import { translate } from '@/i18n/i18n' import { NATIVE_CHAT_ASK_ROW_COPY, type NativeChatAskRowSubject -} from '../../../../shared/native-chat-ask-row' +} from '../../../../shared/native-chat/input/native-chat-ask-row' import { useNativeChatDisclosure } from './native-chat-disclosure-store' import { NativeChatToolRunIcon } from './NativeChatToolIcon' import { useNativeChatClippedLine } from './use-native-chat-clipped-line' diff --git a/src/renderer/src/components/native-chat/NativeChatInteractiveCard.tsx b/src/renderer/src/components/native-chat/NativeChatInteractiveCard.tsx index 3aa6b29ef3e..1656cf77568 100644 --- a/src/renderer/src/components/native-chat/NativeChatInteractiveCard.tsx +++ b/src/renderer/src/components/native-chat/NativeChatInteractiveCard.tsx @@ -1,5 +1,5 @@ import { useCallback, useLayoutEffect, useRef, useState } from 'react' -import type { InteractivePromptCard } from './native-chat-interactive-prompt' +import type { InteractivePromptCard } from '../../../../shared/native-chat-interactive-prompt' import { NativeChatQuestionCard } from './NativeChatQuestionCard' import { NativeChatApprovalCard } from './NativeChatApprovalCard' import type { NativeChatInteractiveSend } from './use-native-chat-interactive-send' diff --git a/src/renderer/src/components/native-chat/NativeChatPromptCollapse.tsx b/src/renderer/src/components/native-chat/NativeChatPromptCollapse.tsx index 7a269fe8b8d..af7f55f562a 100644 --- a/src/renderer/src/components/native-chat/NativeChatPromptCollapse.tsx +++ b/src/renderer/src/components/native-chat/NativeChatPromptCollapse.tsx @@ -3,7 +3,7 @@ import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { ShortcutKeyCombo } from '@/components/ShortcutKeyCombo' import { translate } from '@/i18n/i18n' -import type { InteractivePromptCard } from './native-chat-interactive-prompt' +import type { InteractivePromptCard } from '../../../../shared/native-chat-interactive-prompt' /** A prompt card's one collapse affordance; folding or unfolding writes nothing to the agent. */ export function NativeChatPromptCollapseToggle({ diff --git a/src/renderer/src/components/native-chat/NativeChatQuestionCard.test.tsx b/src/renderer/src/components/native-chat/NativeChatQuestionCard.test.tsx index 8e45dfc79c2..abb6c25c28d 100644 --- a/src/renderer/src/components/native-chat/NativeChatQuestionCard.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatQuestionCard.test.tsx @@ -4,8 +4,9 @@ import { act } from 'react' import { createRoot } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { NativeChatQuestionCard } from './NativeChatQuestionCard' -import type { AskAnswerSelection, AskPrompt } from './native-chat-interactive-prompt' -import { NATIVE_CHAT_QUESTION_AUTO_ADVANCE_MS } from '../../../../shared/native-chat-question-auto-advance' +import type { AskAnswerSelection } from '../../../../shared/native-chat-ask-answer' +import type { AskPrompt } from '../../../../shared/native-chat/input/native-chat-ask-types' +import { NATIVE_CHAT_QUESTION_AUTO_ADVANCE_MS } from '../../../../shared/native-chat/input/native-chat-question-auto-advance' // Answers must use option indices; labels can be duplicated and a non-first choice must retain its position. diff --git a/src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx b/src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx index 349a9fc7541..48b0b9d62e8 100644 --- a/src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx +++ b/src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx @@ -4,7 +4,8 @@ import { useRef, useState, type RefObject } from 'react' import { Check, Pencil, X } from 'lucide-react' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' -import type { AskAnswerSelection, AskPrompt } from './native-chat-interactive-prompt' +import type { AskAnswerSelection } from '../../../../shared/native-chat-ask-answer' +import type { AskPrompt } from '../../../../shared/native-chat/input/native-chat-ask-types' import { NativeChatPromptCollapseToggle } from './NativeChatPromptCollapse' import { useNativeChatPromptCardFocus } from './use-native-chat-prompt-card-focus' import { useNativeChatQuestionAutoAdvance } from './use-native-chat-question-auto-advance' diff --git a/src/renderer/src/components/native-chat/NativeChatResolvedView.reveal-latest.test.tsx b/src/renderer/src/components/native-chat/NativeChatResolvedView.reveal-latest.test.tsx index f778f028c3a..ae34e208603 100644 --- a/src/renderer/src/components/native-chat/NativeChatResolvedView.reveal-latest.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatResolvedView.reveal-latest.test.tsx @@ -4,7 +4,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { useImperativeHandle } from 'react' import type { NativeChatLiveSession } from './use-native-chat-live-session' -import type { AskPrompt } from './native-chat-interactive-prompt' +import type { AskPrompt } from '../../../../shared/native-chat/input/native-chat-ask-types' import type { NativeChatInteractiveSend } from './use-native-chat-interactive-send' import type { NativeChatMessageListHandle } from './use-native-chat-reveal-latest' import type * as InteractiveCardModule from './NativeChatInteractiveCard' diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredAsyncQuestion.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredAsyncQuestion.tsx index 3c19b9693f7..76413b74441 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredAsyncQuestion.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredAsyncQuestion.tsx @@ -1,5 +1,6 @@ import { useMemo } from 'react' -import { extractPendingMessageReplyAsk, formatAskAnswer } from '../../../../shared/native-chat-ask' +import { extractPendingMessageReplyAsk } from '../../../../shared/native-chat/input/native-chat-ask' +import { formatAskAnswer } from '../../../../shared/native-chat-ask-answer' import type { NativeChatStructuredComposerTransport } from './native-chat-composer-types' import { NativeChatQuestionCard } from './NativeChatQuestionCard' import type { NativeChatLiveSession } from './use-native-chat-live-session' diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx index 28337a8c3dd..b550e5a4d9e 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx @@ -46,7 +46,7 @@ import { useNativeChatRewindHost } from './use-native-chat-rewind-host' import { NativeChatRewindContext } from './native-chat-rewind-context' import { NativeChatQueuedMessageList } from './NativeChatQueuedMessageList' import { nativeChatStructuredStopControls } from './native-chat-structured-stop-controls' -import { chatApprovalFromJournal } from './native-chat-interactive-prompt' +import { chatApprovalFromJournal } from '../../../../shared/native-chat-interactive-prompt' import { useAppStore } from '../../store' import { structuredAgentLabel } from '@/lib/structured-agent-session-launch-label' import { useNativeChatStructuredComposerTransport } from './use-native-chat-structured-composer-transport' diff --git a/src/renderer/src/components/native-chat/NativeChatToolRun.tsx b/src/renderer/src/components/native-chat/NativeChatToolRun.tsx index eb9bf6d6564..d4ac046d859 100644 --- a/src/renderer/src/components/native-chat/NativeChatToolRun.tsx +++ b/src/renderer/src/components/native-chat/NativeChatToolRun.tsx @@ -27,7 +27,7 @@ import { nativeChatToolRunOutcome } from '../../../../shared/native-chat/tools/n import { nativeChatAskRunBlocks, nativeChatAskRunSubject -} from '../../../../shared/native-chat-ask-row' +} from '../../../../shared/native-chat/input/native-chat-ask-row' import { NativeChatAwaitingInputRow } from './NativeChatAwaitingInputRow' import { NativeChatBackgroundTaskRun } from './NativeChatBackgroundTaskRun' import { NativeChatSubagentRun } from './NativeChatSubagentRun' diff --git a/src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts b/src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts index fbce558a264..da4ccf2093f 100644 --- a/src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts @@ -4,11 +4,11 @@ import { buildAskAnswerKeys, buildCodexAskAnswerKeys, formatAskAnswer, - hasAskAnswer, - parseAskFromStatus, - sayNativeChatApprovalTranslated, - type AskPrompt -} from './native-chat-interactive-prompt' + hasAskAnswer +} from '../../../../shared/native-chat-ask-answer' +import { parseAskFromStatus } from '../../../../shared/native-chat/input/native-chat-ask' +import { sayNativeChatApprovalTranslated } from './native-chat-interactive-prompt' +import type { AskPrompt } from '../../../../shared/native-chat/input/native-chat-ask-types' import { parseApprovalFromStatus } from '../../../../shared/native-chat-interactive-prompt' const ESC = String.fromCharCode(27) diff --git a/src/renderer/src/components/native-chat/native-chat-interactive-prompt.ts b/src/renderer/src/components/native-chat/native-chat-interactive-prompt.ts index 2b54ccc1235..9d7bde71b46 100644 --- a/src/renderer/src/components/native-chat/native-chat-interactive-prompt.ts +++ b/src/renderer/src/components/native-chat/native-chat-interactive-prompt.ts @@ -4,26 +4,6 @@ import { type NativeChatApprovalSay } from '../../../../shared/native-chat-interactive-prompt' -export { - buildAskAnswerKeys, - buildCodexAskAnswerKeys, - formatAskAnswer, - hasAskAnswer, - parseAskFromStatus, - registerQuestionTool, - type AskAnswerKeyGroup, - type AskAnswerSelection, - type AskOption, - type AskPrompt, - type AskQuestion, - type InteractiveQuestionParser -} from '../../../../shared/native-chat-ask' -export { - chatApprovalFromJournal, - type ChatApproval, - type InteractivePromptCard -} from '../../../../shared/native-chat-interactive-prompt' - const PIECES: Record string> = { title: (values) => translate('components.native-chat.approval.title', COPY.title, values), allow: () => translate('components.native-chat.approval.allow', COPY.allow), diff --git a/src/renderer/src/components/native-chat/native-chat-runtime-image-send.ts b/src/renderer/src/components/native-chat/native-chat-runtime-image-send.ts index cc1a2ea8e35..17a4a3559a7 100644 --- a/src/renderer/src/components/native-chat/native-chat-runtime-image-send.ts +++ b/src/renderer/src/components/native-chat/native-chat-runtime-image-send.ts @@ -2,7 +2,7 @@ import { sendNativeChatObservedWrites } from './native-chat-observed-send' import { agentImagePasteWrites, formatAgentImagePath } from '../../../../shared/agent-image-paste' import type { AgentType } from '../../../../shared/agent-status-types' import { sendRuntimePtyInput } from '@/runtime/runtime-terminal-inspection' -import { NATIVE_CHAT_SUBMIT_DELAY_MS } from '../../../../shared/native-chat-answer-stepping' +import { NATIVE_CHAT_SUBMIT_DELAY_MS } from '../../../../shared/native-chat/input/native-chat-answer-stepping' import { buildNativeChatImagePasteBytes, buildNativeChatPasteBytes, diff --git a/src/renderer/src/components/native-chat/native-chat-runtime-send.ts b/src/renderer/src/components/native-chat/native-chat-runtime-send.ts index 970568e01c1..ac0ce75fc60 100644 --- a/src/renderer/src/components/native-chat/native-chat-runtime-send.ts +++ b/src/renderer/src/components/native-chat/native-chat-runtime-send.ts @@ -1,7 +1,7 @@ import { sendNativeChatObservedWrites } from './native-chat-observed-send' import { sendRuntimePtyInput } from '@/runtime/runtime-terminal-inspection' import { sendRuntimePtyInputVerified } from '@/runtime/runtime-terminal-verified-input' -import type { AskAnswerKeyGroup } from './native-chat-interactive-prompt' +import type { AskAnswerKeyGroup } from '../../../../shared/native-chat-ask-answer' import { clearConfirmDurationMs, clearThenWrite, @@ -12,7 +12,7 @@ import { NATIVE_CHAT_ADVANCE_BUFFER_MS, NATIVE_CHAT_QUESTION_STEP_MS, NATIVE_CHAT_SUBMIT_DELAY_MS -} from '../../../../shared/native-chat-answer-stepping' +} from '../../../../shared/native-chat/input/native-chat-answer-stepping' import { buildNativeChatPasteBytes, NATIVE_CHAT_SUBMIT diff --git a/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.ts b/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.ts index 122adf53eab..0d1fd5289aa 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.ts @@ -2,10 +2,8 @@ import { useMemo } from 'react' import { useAppStore } from '../../store' import type { NativeChatMessage } from '../../../../shared/native-chat-types' import { resolveNativeChatInteractivePromptCard } from '../../../../shared/native-chat-interactive-prompt' -import { - sayNativeChatApprovalTranslated, - type InteractivePromptCard -} from './native-chat-interactive-prompt' +import { sayNativeChatApprovalTranslated } from './native-chat-interactive-prompt' +import type { InteractivePromptCard } from '../../../../shared/native-chat-interactive-prompt' export function useNativeChatInteractivePromptCard({ paneKey, diff --git a/src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx b/src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx index dbc46773be5..428c4fe5106 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx +++ b/src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx @@ -44,7 +44,7 @@ vi.mock('./native-chat-runtime-send', () => ({ })) import { useNativeChatInteractiveSend } from './use-native-chat-interactive-send' -import type { AskPrompt } from './native-chat-interactive-prompt' +import type { AskPrompt } from '../../../../shared/native-chat/input/native-chat-ask-types' const PROMPT: AskPrompt = { questions: [{ question: 'q', multiSelect: false, options: [{ label: 'A' }, { label: 'B' }] }] diff --git a/src/renderer/src/components/native-chat/use-native-chat-interactive-send.ts b/src/renderer/src/components/native-chat/use-native-chat-interactive-send.ts index 2108781949c..2a286d51b8f 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-interactive-send.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-interactive-send.ts @@ -13,9 +13,9 @@ import { buildCodexAskAnswerKeys, formatAskAnswer, hasAskAnswer, - type AskAnswerSelection, - type AskPrompt -} from './native-chat-interactive-prompt' + type AskAnswerSelection +} from '../../../../shared/native-chat-ask-answer' +import type { AskPrompt } from '../../../../shared/native-chat/input/native-chat-ask-types' import { sendNativeChatAskAnswer, sendNativeChatMessage, diff --git a/src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.test.ts b/src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.test.ts index ffcfa6160c7..d21fa61a6da 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.test.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.test.ts @@ -8,7 +8,7 @@ import { nativeChatPromptDismissals, forgetNativeChatPromptDismissalsForTab } from './native-chat-prompt-dismissals' -import type { InteractivePromptCard } from './native-chat-interactive-prompt' +import type { InteractivePromptCard } from '../../../../shared/native-chat-interactive-prompt' const PANE = 'tab-1:leaf-1' const question: InteractivePromptCard = { diff --git a/src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.ts b/src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.ts index ba952252494..a4ba24ce3c0 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.ts @@ -10,7 +10,7 @@ import { nativeChatPromptDismissals as dismissals, type NativeChatPromptDismissal } from './native-chat-prompt-dismissals' -import type { InteractivePromptCard } from './native-chat-interactive-prompt' +import type { InteractivePromptCard } from '../../../../shared/native-chat-interactive-prompt' export type NativeChatPromptCardPresentation = { /** The card that owns the input region now; null leaves it to the composer. */ diff --git a/src/renderer/src/components/native-chat/use-native-chat-question-auto-advance.ts b/src/renderer/src/components/native-chat/use-native-chat-question-auto-advance.ts index cd52c67f43a..8afeecadf47 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-question-auto-advance.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-question-auto-advance.ts @@ -1,5 +1,5 @@ import { useEffect, useRef } from 'react' -import { NATIVE_CHAT_QUESTION_AUTO_ADVANCE_MS } from '../../../../shared/native-chat-question-auto-advance' +import { NATIVE_CHAT_QUESTION_AUTO_ADVANCE_MS } from '../../../../shared/native-chat/input/native-chat-question-auto-advance' /** One cancellable delayed step: a single-select pick shows as chosen before the card moves on. */ export function useNativeChatQuestionAutoAdvance(): { diff --git a/src/renderer/src/components/native-chat/use-native-chat-reveal-latest.ts b/src/renderer/src/components/native-chat/use-native-chat-reveal-latest.ts index f4f32e16d44..ffb73f61a3e 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-reveal-latest.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-reveal-latest.ts @@ -1,5 +1,5 @@ import { useCallback, useImperativeHandle, useMemo, useRef } from 'react' -import { hasAskAnswer } from './native-chat-interactive-prompt' +import { hasAskAnswer } from '../../../../shared/native-chat-ask-answer' import { nativeChatSlotCopyText } from './native-chat-message-copy-text' import type { NativeChatTranscriptSlot } from './native-chat-transcript-slots' import type { NativeChatInteractiveSend } from './use-native-chat-interactive-send' diff --git a/src/shared/agent-pending-prompt.ts b/src/shared/agent-pending-prompt.ts index 1d251dec639..2be6cf24829 100644 --- a/src/shared/agent-pending-prompt.ts +++ b/src/shared/agent-pending-prompt.ts @@ -1,6 +1,6 @@ import type { AgentStatusIpcPayload } from './agent-status-ipc-payload' import { hookRowAgentPhase } from './agent-transitions' -import { parseAskFromStatus } from './native-chat-ask' +import { parseAskFromStatus } from './native-chat/input/native-chat-ask' import { buildAskAnswerKeys, buildCodexAskAnswerKeys } from './native-chat-ask-answer' import { parseNativeChatApprovalEnvelope } from './native-chat-approval-envelope' import { diff --git a/src/shared/agent-question-answered-intent.ts b/src/shared/agent-question-answered-intent.ts index 2f3bb52379d..efdfeea72b4 100644 --- a/src/shared/agent-question-answered-intent.ts +++ b/src/shared/agent-question-answered-intent.ts @@ -1,5 +1,5 @@ import type { AgentType } from './agent-status-types' -import { askOptionsHavePreview } from './native-chat-ask' +import { askOptionsHavePreview } from './native-chat/input/native-chat-ask' /** Main revalidates the renderer's submit snapshot against cached status so racing real hooks outrank inference. */ export type AgentQuestionAnsweredInferenceRequest = { diff --git a/src/shared/agent-status-types.test.ts b/src/shared/agent-status-types.test.ts index 8c5537a4b49..f1141adace0 100644 --- a/src/shared/agent-status-types.test.ts +++ b/src/shared/agent-status-types.test.ts @@ -20,7 +20,7 @@ import { ORCA_DISPATCH_PROMPT_LEAD_LINE, ORCA_DISPATCH_STATUS_PREAMBLE_PREFIX } from './orca-dispatch-status-prompt' -import { parseAskFromStatus } from './native-chat-ask' +import { parseAskFromStatus } from './native-chat/input/native-chat-ask' afterEach(() => { vi.restoreAllMocks() diff --git a/src/shared/codex-async-question-input.ts b/src/shared/codex-async-question-input.ts index cbf9164732a..7d1fb003071 100644 --- a/src/shared/codex-async-question-input.ts +++ b/src/shared/codex-async-question-input.ts @@ -1,4 +1,4 @@ -import type { AskPrompt, AskQuestion } from './native-chat-ask-types' +import type { AskPrompt, AskQuestion } from './native-chat/input/native-chat-ask-types' /** Return accepted immediately; nonblocking questions receive answers in later user messages ({questions:[{title, options?: string[]}]}). */ export const CODEX_ASYNC_QUESTION_TOOL = 'request_user_input_async' diff --git a/src/shared/native-chat-ask-answer.ts b/src/shared/native-chat-ask-answer.ts index a4379ee4e56..b6434017533 100644 --- a/src/shared/native-chat-ask-answer.ts +++ b/src/shared/native-chat-ask-answer.ts @@ -1,6 +1,6 @@ // Deliver answers as pasted messages or Claude/Codex selector keystrokes. -import type { AskPrompt, AskQuestion } from './native-chat-ask-types' +import type { AskPrompt, AskQuestion } from './native-chat/input/native-chat-ask-types' /** Option indices in display order plus free text; selectors address stable numbers rather than labels. */ export type AskAnswerSelection = { indices: number[]; other?: string } diff --git a/src/shared/native-chat-ask-card-rules.ts b/src/shared/native-chat-ask-card-rules.ts index aa0e3e134e0..47c3d5f0bee 100644 --- a/src/shared/native-chat-ask-card-rules.ts +++ b/src/shared/native-chat-ask-card-rules.ts @@ -1,5 +1,5 @@ import type { AgentJournalFreeTextInput } from './agent-session-journal-types' -import type { AskQuestion } from './native-chat-ask-types' +import type { AskQuestion } from './native-chat/input/native-chat-ask-types' // How a stepped question card picks, labels and confirms; desktop and mobile draw it differently. diff --git a/src/shared/native-chat-ask-dismiss-key.ts b/src/shared/native-chat-ask-dismiss-key.ts index 740ecd0aede..e5027a7e224 100644 --- a/src/shared/native-chat-ask-dismiss-key.ts +++ b/src/shared/native-chat-ask-dismiss-key.ts @@ -1,4 +1,4 @@ -import type { AskPrompt } from './native-chat-ask-types' +import type { AskPrompt } from './native-chat/input/native-chat-ask-types' // Live/status transcripts shorten question text differently; identity uses a prefix both retain. const ASK_DISMISS_KEY_TEXT_PREFIX = 200 diff --git a/src/shared/native-chat-interactive-prompt.ts b/src/shared/native-chat-interactive-prompt.ts index 749326ff441..bb2d0343de5 100644 --- a/src/shared/native-chat-interactive-prompt.ts +++ b/src/shared/native-chat-interactive-prompt.ts @@ -3,7 +3,8 @@ import type { AgentJournalApprovalItem, AgentJournalApprovalSubject } from './agent-session-journal-types' -import { parseAskFromStatus, resolveNativeChatAsk, type AskPrompt } from './native-chat-ask' +import { parseAskFromStatus, resolveNativeChatAsk } from './native-chat/input/native-chat-ask' +import type { AskPrompt } from './native-chat/input/native-chat-ask-types' import type { NativeChatMessage } from './native-chat-types' import { parseOmpPlanReviewPrompt } from './omp-plan-review-prompt' diff --git a/src/shared/native-chat-resolution-receipt.ts b/src/shared/native-chat-resolution-receipt.ts index e49564e5f8f..51a1cd4aa59 100644 --- a/src/shared/native-chat-resolution-receipt.ts +++ b/src/shared/native-chat-resolution-receipt.ts @@ -6,7 +6,7 @@ import { agentSessionPromptQuestions, legacyAgentSessionQuestionAnswers } from './agent-session-question-answer' -import type { NativeChatAskRowSubject } from './native-chat-ask-row' +import type { NativeChatAskRowSubject } from './native-chat/input/native-chat-ask-row' /** Desktop's fallbacks for its translations; the phone's words. */ export const NATIVE_CHAT_RECEIPT_COPY = { diff --git a/src/shared/native-chat-transcript-contracts.test.ts b/src/shared/native-chat-transcript-contracts.test.ts index 0a09b67d1a3..e15eff5a062 100644 --- a/src/shared/native-chat-transcript-contracts.test.ts +++ b/src/shared/native-chat-transcript-contracts.test.ts @@ -4,7 +4,7 @@ import './native-chat/tools/native-chat-tool-activity.spec' import './native-chat/tools/native-chat-tool-pair-limit.spec' import './native-chat/tools/native-chat-tool-fold-attribution.spec' import './native-chat-turn-grouping.spec' -import './native-chat-ask-row.spec' +import './native-chat/input/native-chat-ask-row.spec' import './native-chat/tools/native-chat-tool-pairing.spec' import './native-chat-live-line.spec' import './native-chat-merge-pairs.spec' diff --git a/src/shared/native-chat-work-run.ts b/src/shared/native-chat-work-run.ts index 20118052aa6..7b5920a9d17 100644 --- a/src/shared/native-chat-work-run.ts +++ b/src/shared/native-chat-work-run.ts @@ -1,6 +1,6 @@ // Group tool calls and finished thoughts into one collapsible run between prose rows; thinking before each call must not double the visible rows. -import { isNativeChatAskCall } from './native-chat-ask-row' +import { isNativeChatAskCall } from './native-chat/input/native-chat-ask-row' import { deriveNativeChatRowContent } from './native-chat-row-content' import { isStoppedBeforeStartBlock } from './native-chat-stopped-before-start' import { pairToolBlocks } from './native-chat/tools/native-chat-tool-pairs' diff --git a/src/shared/native-chat-answer-stepping.ts b/src/shared/native-chat/input/native-chat-answer-stepping.ts similarity index 100% rename from src/shared/native-chat-answer-stepping.ts rename to src/shared/native-chat/input/native-chat-answer-stepping.ts diff --git a/src/shared/native-chat-ask-fifo.test.ts b/src/shared/native-chat/input/native-chat-ask-fifo.test.ts similarity index 92% rename from src/shared/native-chat-ask-fifo.test.ts rename to src/shared/native-chat/input/native-chat-ask-fifo.test.ts index 221f60c9763..6da8e414349 100644 --- a/src/shared/native-chat-ask-fifo.test.ts +++ b/src/shared/native-chat/input/native-chat-ask-fifo.test.ts @@ -1,6 +1,6 @@ import { expect, it } from 'vitest' import { extractPendingAsk } from './native-chat-ask' -import type { NativeChatMessage } from './native-chat-types' +import type { NativeChatMessage } from '../../native-chat-types' type Block = NativeChatMessage['blocks'][number] diff --git a/src/shared/native-chat-ask-row.spec.ts b/src/shared/native-chat/input/native-chat-ask-row.spec.ts similarity index 98% rename from src/shared/native-chat-ask-row.spec.ts rename to src/shared/native-chat/input/native-chat-ask-row.spec.ts index f9ebec2bdc6..53008811a32 100644 --- a/src/shared/native-chat-ask-row.spec.ts +++ b/src/shared/native-chat/input/native-chat-ask-row.spec.ts @@ -4,7 +4,7 @@ import { nativeChatAskRunSubject, nativeChatAskRunBlocks } from './native-chat-ask-row' -import type { NativeChatBlock } from './native-chat-types' +import type { NativeChatBlock } from '../../native-chat-types' function askCall(input: unknown, name = 'AskUserQuestion'): NativeChatBlock { return { type: 'tool-call', name, input } diff --git a/src/shared/native-chat-ask-row.ts b/src/shared/native-chat/input/native-chat-ask-row.ts similarity index 90% rename from src/shared/native-chat-ask-row.ts rename to src/shared/native-chat/input/native-chat-ask-row.ts index 1f77a6a0d60..f27ff44d940 100644 --- a/src/shared/native-chat-ask-row.ts +++ b/src/shared/native-chat/input/native-chat-ask-row.ts @@ -1,10 +1,10 @@ // Shared desktop i18n fallbacks and direct mobile copy keep pending-question rows consistent. -import { isAskUserQuestionTool } from './agent-question-answered-intent' -import { CODEX_ASYNC_QUESTION_TOOL } from './codex-async-question-input' +import { isAskUserQuestionTool } from '../../agent-question-answered-intent' +import { CODEX_ASYNC_QUESTION_TOOL } from '../../codex-async-question-input' import { parseAskFromToolInput } from './native-chat-ask' -import { isToolCallBlock, type NativeChatBlock } from './native-chat-types' -import { pairToolBlocks } from './native-chat/tools/native-chat-tool-pairs' +import { isToolCallBlock, type NativeChatBlock } from '../../native-chat-types' +import { pairToolBlocks } from '../tools/native-chat-tool-pairs' export const NATIVE_CHAT_ASK_ROW_COPY = { awaiting: 'Awaiting user input:', diff --git a/src/shared/native-chat-ask-types.ts b/src/shared/native-chat/input/native-chat-ask-types.ts similarity index 100% rename from src/shared/native-chat-ask-types.ts rename to src/shared/native-chat/input/native-chat-ask-types.ts diff --git a/src/shared/native-chat-ask.test.ts b/src/shared/native-chat/input/native-chat-ask.test.ts similarity index 97% rename from src/shared/native-chat-ask.test.ts rename to src/shared/native-chat/input/native-chat-ask.test.ts index 4400f0b6e76..8f4a5fa50a9 100644 --- a/src/shared/native-chat-ask.test.ts +++ b/src/shared/native-chat/input/native-chat-ask.test.ts @@ -3,13 +3,9 @@ import { NATIVE_CHAT_INTERRUPTED_STATUS_TEXT, type NativeChatBlock, type NativeChatMessage -} from './native-chat-types' -import { - extractPendingAsk, - nativeChatAskDismissKey, - parseAskFromStatus, - resolveNativeChatAsk -} from './native-chat-ask' +} from '../../native-chat-types' +import { extractPendingAsk, parseAskFromStatus, resolveNativeChatAsk } from './native-chat-ask' +import { nativeChatAskDismissKey } from '../../native-chat-ask-dismiss-key' function message(id: string, blocks: NativeChatBlock[]): NativeChatMessage { return { id, role: 'assistant', blocks, timestamp: 1, source: 'transcript' } diff --git a/src/shared/native-chat-ask.ts b/src/shared/native-chat/input/native-chat-ask.ts similarity index 94% rename from src/shared/native-chat-ask.ts rename to src/shared/native-chat/input/native-chat-ask.ts index 7a7a52075ec..68cfae251d2 100644 --- a/src/shared/native-chat-ask.ts +++ b/src/shared/native-chat/input/native-chat-ask.ts @@ -4,18 +4,14 @@ import type { AskQuestion, InteractiveQuestionParser } from './native-chat-ask-types' -import { isInterruptedStatusMessage, type NativeChatMessage } from './native-chat-types' +import { isInterruptedStatusMessage, type NativeChatMessage } from '../../native-chat-types' import { CODEX_ASYNC_QUESTION_TOOL, parseCodexAsyncQuestionsInput -} from './codex-async-question-input' - -export type { AskOption, AskPrompt, AskQuestion, InteractiveQuestionParser } +} from '../../codex-async-question-input' const QUESTION_TOOL_PARSERS = new Map() -export { nativeChatAskDismissKey } from './native-chat-ask-dismiss-key' - export function registerQuestionTool(toolName: string, parser: InteractiveQuestionParser): void { QUESTION_TOOL_PARSERS.set(toolName, parser) } @@ -223,12 +219,3 @@ export function resolveNativeChatAsk(args: { }): AskPrompt | null { return args.liveAsk ?? (args.transcriptSettled ? extractPendingAsk(args.messages) : null) } - -export { - buildAskAnswerKeys, - buildCodexAskAnswerKeys, - formatAskAnswer, - hasAskAnswer, - type AskAnswerKeyGroup, - type AskAnswerSelection -} from './native-chat-ask-answer' diff --git a/src/shared/native-chat-question-auto-advance.ts b/src/shared/native-chat/input/native-chat-question-auto-advance.ts similarity index 100% rename from src/shared/native-chat-question-auto-advance.ts rename to src/shared/native-chat/input/native-chat-question-auto-advance.ts diff --git a/src/shared/structured-agent-question-card.ts b/src/shared/structured-agent-question-card.ts index ceb9fd8e6ff..22e9812eb2c 100644 --- a/src/shared/structured-agent-question-card.ts +++ b/src/shared/structured-agent-question-card.ts @@ -1,7 +1,7 @@ import type { AgentJournalFreeTextInput, AgentJournalQuestion } from './agent-session-journal-types' import type { AgentSessionQuestionAnswer } from './agent-session-question-answer' import type { AskAnswerSelection } from './native-chat-ask-answer' -import type { AskPrompt } from './native-chat-ask-types' +import type { AskPrompt } from './native-chat/input/native-chat-ask-types' import { askTypedText } from './native-chat-ask-card-rules' /** A structured prompt drawn with the same stepped card as a terminal ask. */ diff --git a/src/shared/structured-agent-question-projection.ts b/src/shared/structured-agent-question-projection.ts index 14a3549dc84..7a2eac81770 100644 --- a/src/shared/structured-agent-question-projection.ts +++ b/src/shared/structured-agent-question-projection.ts @@ -3,7 +3,7 @@ import type { AgentJournalQuestionItem } from './agent-session-journal-types' import { isAskUserQuestionTool } from './agent-question-answered-intent' -import { parseAskFromToolInput } from './native-chat-ask' +import { parseAskFromToolInput } from './native-chat/input/native-chat-ask' import { agentJournalItemRowOrigin } from './agent-session-journal-position' import { agentJournalLinkageFields } from './agent-session-journal-producer' import type { NativeChatMessage } from './native-chat-types' diff --git a/tests/e2e/native-chat-ssh-delivery.unit.test.ts b/tests/e2e/native-chat-ssh-delivery.unit.test.ts index 72e62d9ed96..c0c61cb1d5a 100644 --- a/tests/e2e/native-chat-ssh-delivery.unit.test.ts +++ b/tests/e2e/native-chat-ssh-delivery.unit.test.ts @@ -12,7 +12,7 @@ import { sendNativeChatMessageVerified, resetNativeChatPtySendQueuesForTests } from '../../src/renderer/src/components/native-chat/native-chat-runtime-send' -import { buildAskAnswerKeys } from '../../src/shared/native-chat-ask' +import { buildAskAnswerKeys } from '../../src/shared/native-chat-ask-answer' import { sendRuntimePtyInputVerified } from '@/runtime/runtime-terminal-verified-input' import { RpcDispatcher } from '../../src/main/runtime/rpc/dispatcher' import { TERMINAL_METHODS } from '../../src/main/runtime/rpc/methods/terminal'