From ea532813b1f8464b4de54c81663152ee07cb8da1 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 27 Oct 2026 17:33:03 -0700 Subject: [PATCH] refactor: group native chat turn presentation (#34629) --- config/scripts/ci-shard-timings.json | 6 +++--- .../native-chat-compaction-pagination.test.mjs | 2 +- ...ile-native-chat-merged-snapshot-parity.test.ts | 2 +- .../use-mobile-native-chat-transcript-rows.ts | 2 +- .../use-mobile-native-chat-turn-disclosure.ts | 2 +- .../use-mobile-structured-turn-indicator.ts | 2 +- ...ructured-journal-restore-turn-grouping.test.ts | 2 +- ...ex-structured-journal-subagent-readers.test.ts | 2 +- .../agent-session-wire/hook-outcome-rows.test.ts | 7 +++++-- ...agent-session-claude-opening-send-hold.test.ts | 2 +- ...ed-agent-session-orca-stop-row-readers.test.ts | 2 +- ...-agent-session-codex-opening-send-hold.test.ts | 2 +- ...agent-session-codex-stopped-send-order.test.ts | 2 +- .../native-chat/NativeChatMessageList.tsx | 2 +- .../native-chat-rail-outline-parity.test.ts | 2 +- .../native-chat-subagent-sections.test.ts | 2 +- .../native-chat/native-chat-transcript-slots.ts | 7 +++++-- .../native-chat-waiting-partition-budget.test.ts | 2 +- .../use-native-chat-turn-membership.ts | 2 +- ...se-structured-agent-session-transport-state.ts | 2 +- src/shared/native-chat-stopped-send-turn.test.ts | 2 +- .../native-chat-transcript-contracts.test.ts | 2 +- src/shared/native-chat-turn-membership.test.ts | 2 +- src/shared/native-chat-turn-membership.ts | 2 +- ...-chat-turn-membership-derived-tool-row.test.ts | 2 +- .../native-chat-activity-tail-line.test.ts | 0 .../transcript}/native-chat-turn-activity.test.ts | 5 ++++- .../transcript}/native-chat-turn-activity.ts | 15 ++++++--------- .../transcript}/native-chat-turn-fold.test.ts | 0 .../transcript}/native-chat-turn-fold.ts | 14 +++++++------- .../transcript}/native-chat-turn-grouping.spec.ts | 2 +- .../transcript}/native-chat-turn-grouping.ts | 6 +++--- ...essage-projection-stopped-before-start.test.ts | 2 +- 33 files changed, 57 insertions(+), 51 deletions(-) rename src/shared/{ => native-chat/transcript}/native-chat-activity-tail-line.test.ts (100%) rename src/shared/{ => native-chat/transcript}/native-chat-turn-activity.test.ts (97%) rename src/shared/{ => native-chat/transcript}/native-chat-turn-activity.ts (85%) rename src/shared/{ => native-chat/transcript}/native-chat-turn-fold.test.ts (100%) rename src/shared/{ => native-chat/transcript}/native-chat-turn-fold.ts (91%) rename src/shared/{ => native-chat/transcript}/native-chat-turn-grouping.spec.ts (98%) rename src/shared/{ => native-chat/transcript}/native-chat-turn-grouping.ts (95%) diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index f354e134920..d8ab7dad402 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -12490,7 +12490,7 @@ "src/shared/mobile-web-bundle/manifest-contract.test.ts": 156, "src/shared/modifier-double-tap-detector.test.ts": 45, "src/shared/muse-session-log.test.ts": 43, - "src/shared/native-chat-activity-tail-line.test.ts": 141, + "src/shared/native-chat/transcript/native-chat-activity-tail-line.test.ts": 141, "src/shared/native-chat-agent-profiles.test.ts": 37, "src/shared/native-chat-agent-support.test.ts": 38, "src/shared/native-chat/native-chat-appearance-settings.test.ts": 34, @@ -12519,8 +12519,8 @@ "src/shared/native-chat-transcript-contracts.test.ts": 591, "src/shared/native-chat-transcript-projection.test.ts": 134, "src/shared/native-chat-transcript-retention.test.ts": 55, - "src/shared/native-chat-turn-activity.test.ts": 137, - "src/shared/native-chat-turn-fold.test.ts": 120, + "src/shared/native-chat/transcript/native-chat-turn-activity.test.ts": 137, + "src/shared/native-chat/transcript/native-chat-turn-fold.test.ts": 120, "src/shared/native-chat-turn-membership.test.ts": 174, "src/shared/native-chat-turn-status.test.ts": 52, "src/shared/native-chat-unverifiable-turn-status.test.ts": 111, diff --git a/config/scripts/native-chat-compaction-pagination.test.mjs b/config/scripts/native-chat-compaction-pagination.test.mjs index 2e3e8173add..78dde5c35ca 100644 --- a/config/scripts/native-chat-compaction-pagination.test.mjs +++ b/config/scripts/native-chat-compaction-pagination.test.mjs @@ -3,7 +3,7 @@ import { expect, it } from 'vitest' import { readAgentSessionHistory } from '../../src/main/native-chat/agent-session-wire/agent-session-history-page.ts' import { projectStructuredAgentSessionMessages } from '../../src/renderer/src/components/native-chat/structured-agent-session-message-projection.ts' import { nativeChatTurnMembership } from '../../src/shared/native-chat-turn-membership.ts' -import { nativeChatRowsInDrawOrder } from '../../src/shared/native-chat-turn-grouping.ts' +import { nativeChatRowsInDrawOrder } from '../../src/shared/native-chat/transcript/native-chat-turn-grouping.ts' import { selectNativeChatTurnStatuses } from '../../src/shared/native-chat-turn-status.ts' import { selectStructuredAgentSettledTurns } from '../../src/shared/structured-agent-session-turn-timing.ts' import { buildNativeChatTranscriptSlots } from '../../src/renderer/src/components/native-chat/native-chat-transcript-slots.ts' diff --git a/mobile/src/session/mobile-native-chat-merged-snapshot-parity.test.ts b/mobile/src/session/mobile-native-chat-merged-snapshot-parity.test.ts index 6301d7a7e74..9c736780d2d 100644 --- a/mobile/src/session/mobile-native-chat-merged-snapshot-parity.test.ts +++ b/mobile/src/session/mobile-native-chat-merged-snapshot-parity.test.ts @@ -5,7 +5,7 @@ import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { describe, expect, it } from 'vitest' import type { AgentSessionSubscribeEvent } from '../../../src/shared/agent-session-wire' import { withNativeChatCutTurnNotices } from '../../../src/shared/native-chat-cut-turn-notice' -import { nativeChatRowsInDrawOrder } from '../../../src/shared/native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from '../../../src/shared/native-chat/transcript/native-chat-turn-grouping' import { nativeChatTurnMembership } from '../../../src/shared/native-chat-turn-membership' import { nativeChatMessagesWaitingBehindLiveTurn } from '../../../src/shared/native-chat-messages-waiting-behind-live-turn' import { activeStructuredAgentSessionTurnId } from '../../../src/shared/structured-agent-session-live-turn' diff --git a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-transcript-rows.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-transcript-rows.ts index eed8f2b22b4..19849af1994 100644 --- a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-transcript-rows.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-transcript-rows.ts @@ -6,7 +6,7 @@ import { nativeChatTurnFold, nativeChatTurnFoldRow, type NativeChatTurnFold -} from '../../../../../src/shared/native-chat-turn-fold' +} from '../../../../../src/shared/native-chat/transcript/native-chat-turn-fold' import { nativeChatRowRendersProse, nativeChatRowSpeaksOrActs diff --git a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-turn-disclosure.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-turn-disclosure.ts index f221b1e61fe..3a27f01e4d3 100644 --- a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-turn-disclosure.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-turn-disclosure.ts @@ -25,7 +25,7 @@ import type { MobileNativeChatRunPresentation } from '../../mobile-native-chat-r import { nativeChatRowsInDrawOrder, nativeChatTurnBarRows -} from '../../../../../src/shared/native-chat-turn-grouping' +} from '../../../../../src/shared/native-chat/transcript/native-chat-turn-grouping' import { useMobileNativeChatTurnStatus } from './use-mobile-native-chat-turn-status' const EMPTY_TURN_IDS: ReadonlySet = new Set() diff --git a/mobile/src/session/use-mobile-structured-turn-indicator.ts b/mobile/src/session/use-mobile-structured-turn-indicator.ts index bb0ed58fe07..272209db5e8 100644 --- a/mobile/src/session/use-mobile-structured-turn-indicator.ts +++ b/mobile/src/session/use-mobile-structured-turn-indicator.ts @@ -2,7 +2,7 @@ import { useMemo } from 'react' import type { StructuredAgentSessionState } from '../../../src/shared/structured-agent-session-reducer' import type { NativeChatLiveTurnIndicator } from '../../../src/shared/native-chat-turn-status' import { isStructuredAgentSessionThinking } from '../../../src/shared/structured-agent-session-live-turn' -import { selectStructuredAgentTurnActivity } from '../../../src/shared/native-chat-turn-activity' +import { selectStructuredAgentTurnActivity } from '../../../src/shared/native-chat/transcript/native-chat-turn-activity' import { agentStopDisplayStatus } from '../../../src/shared/agent-stop-display-status' import { mobileStructuredSendQueues } from './use-mobile-structured-send-with-outcome' diff --git a/src/main/codex/codex-structured-journal-restore-turn-grouping.test.ts b/src/main/codex/codex-structured-journal-restore-turn-grouping.test.ts index 4a540dd9c3b..7f62d7efde1 100644 --- a/src/main/codex/codex-structured-journal-restore-turn-grouping.test.ts +++ b/src/main/codex/codex-structured-journal-restore-turn-grouping.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import type { AgentJournalRenderItem } from '../../shared/agent-session-journal-types' import { agentJournalItemKey } from '../../shared/agent-session-journal-item-key' -import { nativeChatTurnFold } from '../../shared/native-chat-turn-fold' +import { nativeChatTurnFold } from '../../shared/native-chat/transcript/native-chat-turn-fold' import { nativeChatTurnMembership } from '../../shared/native-chat-turn-membership' import type { NativeChatMessage } from '../../shared/native-chat-types' import { projectStructuredItemToNativeChat } from '../../shared/structured-agent-session-projection' diff --git a/src/main/codex/codex-structured-journal-subagent-readers.test.ts b/src/main/codex/codex-structured-journal-subagent-readers.test.ts index bba6b3336f6..4151ec2bc95 100644 --- a/src/main/codex/codex-structured-journal-subagent-readers.test.ts +++ b/src/main/codex/codex-structured-journal-subagent-readers.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' import type { AgentJournalRenderItem } from '../../shared/agent-session-journal-types' import type { AgentSessionTurnActivity } from '../../shared/agent-session-wire' -import { selectStructuredAgentTurnActivity } from '../../shared/native-chat-turn-activity' +import { selectStructuredAgentTurnActivity } from '../../shared/native-chat/transcript/native-chat-turn-activity' import { latestStructuredAgentSessionAssistantMessage } from '../../shared/structured-agent-session-latest-request' import { isStructuredAgentSessionThinking, diff --git a/src/main/native-chat/agent-session-wire/hook-outcome-rows.test.ts b/src/main/native-chat/agent-session-wire/hook-outcome-rows.test.ts index c109f6e0b52..b11388c9788 100644 --- a/src/main/native-chat/agent-session-wire/hook-outcome-rows.test.ts +++ b/src/main/native-chat/agent-session-wire/hook-outcome-rows.test.ts @@ -16,8 +16,11 @@ import { withNativeChatCutTurnNotices } from '../../../shared/native-chat-cut-tu import { nativeChatRowTurnKeys, nativeChatTurnBarRows -} from '../../../shared/native-chat-turn-grouping' -import { nativeChatTurnFold, nativeChatTurnFoldRow } from '../../../shared/native-chat-turn-fold' +} from '../../../shared/native-chat/transcript/native-chat-turn-grouping' +import { + nativeChatTurnFold, + nativeChatTurnFoldRow +} from '../../../shared/native-chat/transcript/native-chat-turn-fold' import { nativeChatTurnMembership } from '../../../shared/native-chat-turn-membership' import { projectStructuredItemsToNativeChat } from '../../../shared/structured-agent-session-projection' import { GROK_ACP_DIALECT } from '../../acp/acp-dialects/grok-dialect' diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-claude-opening-send-hold.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-claude-opening-send-hold.test.ts index 4f352ab121f..2e821803698 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-claude-opening-send-hold.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-claude-opening-send-hold.test.ts @@ -9,7 +9,7 @@ import { computeAgentSessionPayloadFingerprint } from '../../../shared/agent-ses import { agentSessionSendSubmission } from '../../../shared/agent-session-wire' import { projectStructuredAgentSessionMessages } from '../../../shared/structured-agent-session-message-projection' import { projectNativeChatTranscriptMessages } from '../../../shared/native-chat-transcript-projection' -import { nativeChatRowsInDrawOrder } from '../../../shared/native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from '../../../shared/native-chat/transcript/native-chat-turn-grouping' import { nativeChatTurnMembership } from '../../../shared/native-chat-turn-membership' import { ClaudeStructuredSessionAdapter } from '../../claude/claude-structured-session-adapter' import { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-orca-stop-row-readers.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-orca-stop-row-readers.test.ts index 0c95f03335b..63170969a6d 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-orca-stop-row-readers.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-orca-stop-row-readers.test.ts @@ -5,7 +5,7 @@ import { agentJournalItemKey } from '../../../shared/agent-session-journal-item- import type { AgentJournalRenderItem } from '../../../shared/agent-session-journal-types' import { withNativeChatCutTurnNotices } from '../../../shared/native-chat-cut-turn-notice' import { latestNativeChatOrcaStopCut } from '../../../shared/native-chat/native-chat-orca-stop-cut' -import { nativeChatTurnFold } from '../../../shared/native-chat-turn-fold' +import { nativeChatTurnFold } from '../../../shared/native-chat/transcript/native-chat-turn-fold' import { orcaStopRowBody } from './structured-agent-session-orca-stop-row' const LEGACY_TEXT = diff --git a/src/main/runtime/structured-agent-session-codex-opening-send-hold.test.ts b/src/main/runtime/structured-agent-session-codex-opening-send-hold.test.ts index ab30ac23aad..7328fcbd2ac 100644 --- a/src/main/runtime/structured-agent-session-codex-opening-send-hold.test.ts +++ b/src/main/runtime/structured-agent-session-codex-opening-send-hold.test.ts @@ -8,7 +8,7 @@ import { agentJournalSubmissionKey } from '../../shared/agent-session-journal-it import { CODEX_TURN_OPEN_WAIT_MS } from '../codex/codex-structured-turn-open-wait' import { projectStructuredAgentSessionMessages } from '../../shared/structured-agent-session-message-projection' import { projectNativeChatTranscriptMessages } from '../../shared/native-chat-transcript-projection' -import { nativeChatRowsInDrawOrder } from '../../shared/native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from '../../shared/native-chat/transcript/native-chat-turn-grouping' import { nativeChatTurnMembership } from '../../shared/native-chat-turn-membership' import { CodexAppServerRequestError } from '../codex/app-server/codex-app-server-request-error' import type { diff --git a/src/main/runtime/structured-agent-session-codex-stopped-send-order.test.ts b/src/main/runtime/structured-agent-session-codex-stopped-send-order.test.ts index 18d63b7b01b..790effb6568 100644 --- a/src/main/runtime/structured-agent-session-codex-stopped-send-order.test.ts +++ b/src/main/runtime/structured-agent-session-codex-stopped-send-order.test.ts @@ -20,7 +20,7 @@ import { readAgentJournalTurn } from '../../shared/agent-session-turn-record' import { AGENT_SESSION_GOAL_CONTROL_COPY } from '../../shared/agent-session-goal-control-copy' import { NATIVE_CHAT_STOPPED_BEFORE_START_TEXT } from '../../shared/native-chat/native-chat-stopped-before-start' import { projectNativeChatTranscript } from '../../shared/native-chat-transcript-projection' -import { nativeChatRowsInDrawOrder } from '../../shared/native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from '../../shared/native-chat/transcript/native-chat-turn-grouping' import { nativeChatTurnMembership, structuredAgentTurnAnchors diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx index 952d165b851..0a31242b1d5 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx @@ -17,7 +17,7 @@ import { NativeChatDockedTaskList } from './NativeChatDockedTaskList' import { useNativeChatTurnStatus } from './use-native-chat-turn-status' import { NativeChatAwaitingInputRow } from './NativeChatAwaitingInputRow' import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' -import type { NativeChatTurnActivity } from '../../../../shared/native-chat-turn-activity' +import type { NativeChatTurnActivity } from '../../../../shared/native-chat/transcript/native-chat-turn-activity' import { NativeChatTurnActivityLine } from './NativeChatTurnActivityLine' import { NativeChatDisclosureContext, diff --git a/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts b/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts index dbbc59d456c..b2a94804d48 100644 --- a/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts @@ -13,7 +13,7 @@ import type { import { agentJournalSubmissionKey } from '../../../../shared/agent-session-journal-item-key' import { DISPATCH_REJECTED_CANCELLED } from '../../../../shared/structured-agent-session-dispatch-rejection' import type { NativeChatMessage } from '../../../../shared/native-chat-types' -import { nativeChatRowsInDrawOrder } from '../../../../shared/native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from '../../../../shared/native-chat/transcript/native-chat-turn-grouping' import { nativeChatTurnMembership } from '../../../../shared/native-chat-turn-membership' import { buildNativeChatRailItems, diff --git a/src/renderer/src/components/native-chat/native-chat-subagent-sections.test.ts b/src/renderer/src/components/native-chat/native-chat-subagent-sections.test.ts index dfba120371b..78c838bec64 100644 --- a/src/renderer/src/components/native-chat/native-chat-subagent-sections.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-subagent-sections.test.ts @@ -8,7 +8,7 @@ import type { NativeChatSubagentState } from '../../../../shared/native-chat-types' import { projectNativeChatTranscript } from '../../../../shared/native-chat-transcript-projection' -import { nativeChatRowsInDrawOrder } from '../../../../shared/native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from '../../../../shared/native-chat/transcript/native-chat-turn-grouping' import { nativeChatTurnMembership, type NativeChatTurnJournal diff --git a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts index 7d631b760ee..3155a4af1a9 100644 --- a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts +++ b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts @@ -8,8 +8,11 @@ import type { NativeChatMessage } from '../../../../shared/native-chat-types' import type { NativeChatTurnStatus } from '../../../../shared/native-chat-turn-status' import { isNativeChatRowInLiveWorkingTurn } from '../../../../shared/native-chat-turn-membership' import { nativeChatMessagesWaitingBehindLiveTurn } from '../../../../shared/native-chat-messages-waiting-behind-live-turn' -import { nativeChatTurnBarRows } from '../../../../shared/native-chat-turn-grouping' -import { nativeChatTurnFold, nativeChatTurnFoldRow } from '../../../../shared/native-chat-turn-fold' +import { nativeChatTurnBarRows } from '../../../../shared/native-chat/transcript/native-chat-turn-grouping' +import { + nativeChatTurnFold, + nativeChatTurnFoldRow +} from '../../../../shared/native-chat/transcript/native-chat-turn-fold' import { nativeChatRowRendersContent } from '../../../../shared/native-chat-row-content' import { type NativeChatRowTypography, diff --git a/src/renderer/src/components/native-chat/native-chat-waiting-partition-budget.test.ts b/src/renderer/src/components/native-chat/native-chat-waiting-partition-budget.test.ts index 73b3cd05bcb..f3f6d211354 100644 --- a/src/renderer/src/components/native-chat/native-chat-waiting-partition-budget.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-waiting-partition-budget.test.ts @@ -3,7 +3,7 @@ import type { AgentJournalRenderItem } from '../../../../shared/agent-session-jo import type { NativeChatMessage } from '../../../../shared/native-chat-types' import { projectNativeChatTranscript } from '../../../../shared/native-chat-transcript-projection' import { nativeChatTurnMembership } from '../../../../shared/native-chat-turn-membership' -import { nativeChatRowsInDrawOrder } from '../../../../shared/native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from '../../../../shared/native-chat/transcript/native-chat-turn-grouping' import { nativeChatSubagentSections } from './native-chat-subagent-sections' import { buildNativeChatTranscriptSlots, diff --git a/src/renderer/src/components/native-chat/use-native-chat-turn-membership.ts b/src/renderer/src/components/native-chat/use-native-chat-turn-membership.ts index 20cf678359d..a2cfdcda1d5 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-turn-membership.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-turn-membership.ts @@ -6,7 +6,7 @@ import type { import type { NativeChatMessage } from '../../../../shared/native-chat-types' import type { AgentSessionLatestTurn } from '../../../../shared/agent-session-wire' import { nativeChatTurnMembership } from '../../../../shared/native-chat-turn-membership' -import { nativeChatRowsInDrawOrder } from '../../../../shared/native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from '../../../../shared/native-chat/transcript/native-chat-turn-grouping' export type NativeChatTurnRows = { messages: readonly NativeChatMessage[] diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-transport-state.ts b/src/renderer/src/components/native-chat/use-structured-agent-session-transport-state.ts index 035dfa2a6fa..60371b72322 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session-transport-state.ts +++ b/src/renderer/src/components/native-chat/use-structured-agent-session-transport-state.ts @@ -7,7 +7,7 @@ import { import { isStructuredAgentSessionMainAgentWorking } from '../../../../shared/structured-agent-session-main-agent-working' import type { StructuredAgentSessionState } from '../../../../shared/structured-agent-session-reducer' import type { StructuredAgentSubagentRoster } from '../../../../shared/structured-agent-session-subagent-roster' -import { selectStructuredAgentTurnActivity } from '../../../../shared/native-chat-turn-activity' +import { selectStructuredAgentTurnActivity } from '../../../../shared/native-chat/transcript/native-chat-turn-activity' import { structuredSessionBackgroundTasksView } from '../../../../shared/structured-session-background-tasks-view' import { structuredSessionForegroundCommands } from '../../../../shared/structured-session-foreground-commands' import { useStructuredAgentTurnTiming } from './use-structured-agent-turn-timing' diff --git a/src/shared/native-chat-stopped-send-turn.test.ts b/src/shared/native-chat-stopped-send-turn.test.ts index a58db776d31..a142365b1aa 100644 --- a/src/shared/native-chat-stopped-send-turn.test.ts +++ b/src/shared/native-chat-stopped-send-turn.test.ts @@ -7,7 +7,7 @@ import type { AgentJournalTurnScope } from './agent-session-journal-types' import { projectNativeChatTranscript } from './native-chat-transcript-projection' -import { nativeChatRowsInDrawOrder } from './native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from './native-chat/transcript/native-chat-turn-grouping' import { nativeChatTurnMembership, structuredAgentTurnAnchors } from './native-chat-turn-membership' import { DISPATCH_REJECTED_CANCELLED } from './structured-agent-session-dispatch-rejection' import { projectStructuredAgentSessionMessages } from './structured-agent-session-message-projection' diff --git a/src/shared/native-chat-transcript-contracts.test.ts b/src/shared/native-chat-transcript-contracts.test.ts index e15eff5a062..38451e94bcb 100644 --- a/src/shared/native-chat-transcript-contracts.test.ts +++ b/src/shared/native-chat-transcript-contracts.test.ts @@ -3,7 +3,7 @@ import './native-chat-reasoning-order.spec' 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/transcript/native-chat-turn-grouping.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' diff --git a/src/shared/native-chat-turn-membership.test.ts b/src/shared/native-chat-turn-membership.test.ts index 1696a9c0818..2b2f10ef4ed 100644 --- a/src/shared/native-chat-turn-membership.test.ts +++ b/src/shared/native-chat-turn-membership.test.ts @@ -6,7 +6,7 @@ import type { AgentJournalSubmission, AgentJournalTurnScope } from './agent-session-journal-types' -import { nativeChatRowsInDrawOrder } from './native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from './native-chat/transcript/native-chat-turn-grouping' import { nativeChatTurnMembership, structuredAgentTurnAnchors, diff --git a/src/shared/native-chat-turn-membership.ts b/src/shared/native-chat-turn-membership.ts index 166d2bed7ca..00d712106bc 100644 --- a/src/shared/native-chat-turn-membership.ts +++ b/src/shared/native-chat-turn-membership.ts @@ -21,7 +21,7 @@ import { nativeChatTurnDrawOrder, nativeChatUserRowOpensTurn, type NativeChatOpensTurn -} from './native-chat-turn-grouping' +} from './native-chat/transcript/native-chat-turn-grouping' import type { NativeChatMessage, NativeChatRole } from './native-chat-types' import { dispatchWasWithdrawn } from './structured-agent-session-dispatch-rejection' import { inSendOrder } from './native-chat/native-chat-send-order' diff --git a/src/shared/native-chat/tools/native-chat-turn-membership-derived-tool-row.test.ts b/src/shared/native-chat/tools/native-chat-turn-membership-derived-tool-row.test.ts index 779c05d2126..a6fa5c9515a 100644 --- a/src/shared/native-chat/tools/native-chat-turn-membership-derived-tool-row.test.ts +++ b/src/shared/native-chat/tools/native-chat-turn-membership-derived-tool-row.test.ts @@ -5,7 +5,7 @@ import type { } from '../../agent-session-journal-types' import type { AgentJournalTurnScope } from '../../agent-session-journal-turn-scope' import { foldToolMessages } from './native-chat-tool-fold' -import { nativeChatRowsInDrawOrder } from '../../native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from '../transcript/native-chat-turn-grouping' import { nativeChatTurnMembership } from '../../native-chat-turn-membership' import type { NativeChatMessage, NativeChatRole } from '../../native-chat-types' import { projectStructuredItemsToNativeChat } from '../../structured-agent-session-projection' diff --git a/src/shared/native-chat-activity-tail-line.test.ts b/src/shared/native-chat/transcript/native-chat-activity-tail-line.test.ts similarity index 100% rename from src/shared/native-chat-activity-tail-line.test.ts rename to src/shared/native-chat/transcript/native-chat-activity-tail-line.test.ts diff --git a/src/shared/native-chat-turn-activity.test.ts b/src/shared/native-chat/transcript/native-chat-turn-activity.test.ts similarity index 97% rename from src/shared/native-chat-turn-activity.test.ts rename to src/shared/native-chat/transcript/native-chat-turn-activity.test.ts index f3dd80625d3..ac51aac3a09 100644 --- a/src/shared/native-chat-turn-activity.test.ts +++ b/src/shared/native-chat/transcript/native-chat-turn-activity.test.ts @@ -1,5 +1,8 @@ import { describe, expect, it } from 'vitest' -import type { AgentJournalItemBody, AgentJournalRenderItem } from './agent-session-journal-types' +import type { + AgentJournalItemBody, + AgentJournalRenderItem +} from '../../agent-session-journal-types' import { selectStructuredAgentTurnActivity } from './native-chat-turn-activity' function item(sequence: number, body: AgentJournalItemBody): AgentJournalRenderItem { diff --git a/src/shared/native-chat-turn-activity.ts b/src/shared/native-chat/transcript/native-chat-turn-activity.ts similarity index 85% rename from src/shared/native-chat-turn-activity.ts rename to src/shared/native-chat/transcript/native-chat-turn-activity.ts index 794663c6f43..bc5ac7fdd21 100644 --- a/src/shared/native-chat-turn-activity.ts +++ b/src/shared/native-chat/transcript/native-chat-turn-activity.ts @@ -1,12 +1,9 @@ -import { readAgentJournalTurn } from './agent-session-turn-record' -import type { AgentJournalRenderItem } from './agent-session-journal-types' -import type { AgentSessionTurnActivity } from './agent-session-wire' -import { isRootAgentJournalItem } from './agent-session-journal-producer' -import { normalizePromptField } from './agent-status-field-normalization' -import { - describeActiveToolCall, - formatActiveToolLabel -} from './native-chat/tools/native-chat-tool-activity' +import { readAgentJournalTurn } from '../../agent-session-turn-record' +import type { AgentJournalRenderItem } from '../../agent-session-journal-types' +import type { AgentSessionTurnActivity } from '../../agent-session-wire' +import { isRootAgentJournalItem } from '../../agent-session-journal-producer' +import { normalizePromptField } from '../../agent-status-field-normalization' +import { describeActiveToolCall, formatActiveToolLabel } from '../tools/native-chat-tool-activity' export type NativeChatTurnActivity = { kind: 'description'; text: string } diff --git a/src/shared/native-chat-turn-fold.test.ts b/src/shared/native-chat/transcript/native-chat-turn-fold.test.ts similarity index 100% rename from src/shared/native-chat-turn-fold.test.ts rename to src/shared/native-chat/transcript/native-chat-turn-fold.test.ts diff --git a/src/shared/native-chat-turn-fold.ts b/src/shared/native-chat/transcript/native-chat-turn-fold.ts similarity index 91% rename from src/shared/native-chat-turn-fold.ts rename to src/shared/native-chat/transcript/native-chat-turn-fold.ts index f2339e7fd4c..4e2b4b48e14 100644 --- a/src/shared/native-chat-turn-fold.ts +++ b/src/shared/native-chat/transcript/native-chat-turn-fold.ts @@ -1,18 +1,18 @@ // Derive settled-turn answers from the last assistant prose or system failure; the journal has no answer marker. // Earlier work/recovered errors fold behind that answer, while failed turns end visibly on their error. -import { AGENT_SESSION_COMPACTION_SKIPPED_PRESENTATION } from './agent-session-compaction' -import { AGENT_SESSION_ORCA_STOP_PRESENTATION } from './agent-session-orca-stop' -import { AGENT_SESSION_TURN_NOTICE_PRESENTATION } from './agent-session-turn-notice' -import { nativeChatRowRendersContent } from './native-chat-row-content' -import { isStoppedBeforeStartBlock } from './native-chat/native-chat-stopped-before-start' -import { nativeChatRowRendersProse } from './native-chat/native-chat-trailing-run' +import { AGENT_SESSION_COMPACTION_SKIPPED_PRESENTATION } from '../../agent-session-compaction' +import { AGENT_SESSION_ORCA_STOP_PRESENTATION } from '../../agent-session-orca-stop' +import { AGENT_SESSION_TURN_NOTICE_PRESENTATION } from '../../agent-session-turn-notice' +import { nativeChatRowRendersContent } from '../../native-chat-row-content' +import { isStoppedBeforeStartBlock } from '../native-chat-stopped-before-start' +import { nativeChatRowRendersProse } from '../native-chat-trailing-run' import { isBackgroundTaskBlock, isSubagentGroupBlock, type NativeChatMessage, type NativeChatRole -} from './native-chat-types' +} from '../../native-chat-types' /** Each surface supplies its own row-content results so folding sees exactly the prose it renders. */ export type NativeChatTurnFoldRow = { diff --git a/src/shared/native-chat-turn-grouping.spec.ts b/src/shared/native-chat/transcript/native-chat-turn-grouping.spec.ts similarity index 98% rename from src/shared/native-chat-turn-grouping.spec.ts rename to src/shared/native-chat/transcript/native-chat-turn-grouping.spec.ts index 4cf9fdbc168..012a0df1f11 100644 --- a/src/shared/native-chat-turn-grouping.spec.ts +++ b/src/shared/native-chat/transcript/native-chat-turn-grouping.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { NativeChatMessage } from './native-chat-types' +import type { NativeChatMessage } from '../../native-chat-types' import { nativeChatRowTurnKeys, nativeChatTurnBarRows, diff --git a/src/shared/native-chat-turn-grouping.ts b/src/shared/native-chat/transcript/native-chat-turn-grouping.ts similarity index 95% rename from src/shared/native-chat-turn-grouping.ts rename to src/shared/native-chat/transcript/native-chat-turn-grouping.ts index 5ce1cabe528..d326ef31810 100644 --- a/src/shared/native-chat-turn-grouping.ts +++ b/src/shared/native-chat/transcript/native-chat-turn-grouping.ts @@ -1,8 +1,8 @@ // Share desktop/mobile turn ownership, bar placement and row order. -import type { AgentJournalRenderItem } from './agent-session-journal-types' -import { readAgentJournalTurn } from './agent-session-turn-record' -import type { NativeChatRole } from './native-chat-types' +import type { AgentJournalRenderItem } from '../../agent-session-journal-types' +import { readAgentJournalTurn } from '../../agent-session-turn-record' +import type { NativeChatRole } from '../../native-chat-types' type NativeChatTurnRow = { id: string; role: NativeChatRole } diff --git a/src/shared/structured-agent-session-message-projection-stopped-before-start.test.ts b/src/shared/structured-agent-session-message-projection-stopped-before-start.test.ts index 2c5b5d741fd..32fe17d043c 100644 --- a/src/shared/structured-agent-session-message-projection-stopped-before-start.test.ts +++ b/src/shared/structured-agent-session-message-projection-stopped-before-start.test.ts @@ -22,7 +22,7 @@ import { projectNativeChatTranscript, projectNativeChatTranscriptMessages } from './native-chat-transcript-projection' -import { nativeChatRowsInDrawOrder } from './native-chat-turn-grouping' +import { nativeChatRowsInDrawOrder } from './native-chat/transcript/native-chat-turn-grouping' import { nativeChatTurnMembership } from './native-chat-turn-membership' let sequence = 0