Reorganize chat feature layout

This commit is contained in:
murashit 2026-06-11 17:48:06 +09:00
parent fe72473ab2
commit a92d993ced
127 changed files with 413 additions and 407 deletions

View file

@ -105,12 +105,12 @@ const generatedAppServerImportLegacyFiles = [
"src/features/chat/display/hooks.ts",
"src/features/chat/display/permission-details.ts",
"src/features/chat/display/review.ts",
"src/features/chat/display/thread-items.ts",
"src/features/chat/inbound/controller.ts",
"src/features/chat/inbound/notification-plan.ts",
"src/features/chat/inbound/routing.ts",
"src/features/chat/requests/approval.ts",
"src/features/chat/requests/user-input.ts",
"src/features/chat/protocol/display-items.ts",
"src/features/chat/protocol/inbound/controller.ts",
"src/features/chat/protocol/inbound/notification-plan.ts",
"src/features/chat/protocol/inbound/routing.ts",
"src/features/chat/protocol/requests/approval.ts",
"src/features/chat/protocol/requests/user-input.ts",
"src/features/chat/threads/thread-goal-actions.ts",
"src/features/chat/threads/thread-rename-controller.ts",
"src/features/chat/threads/thread-resume.ts",
@ -400,7 +400,7 @@ export default defineConfig([
},
},
{
files: ["src/features/chat/chat-state.ts", "src/features/chat/display/**/*.{ts,tsx}"],
files: ["src/features/chat/state/reducer.ts", "src/features/chat/display/**/*.{ts,tsx}"],
rules: {
"no-restricted-syntax": [
"error",

View file

@ -2,17 +2,17 @@ import { Notice } from "obsidian";
import type { ConnectionManager } from "../../../app-server/connection-manager";
import type { RuntimeSnapshot } from "../runtime/effective-settings";
import type { ChatStateStore } from "../chat-state";
import type { ChatStateStore } from "../state/reducer";
import type { CodexChatHost } from "../chat-host";
import { createChatServerDiagnosticsActions, type ChatServerDiagnosticsActions } from "../server-actions/diagnostics-actions";
import { createChatServerMetadataActions, type ChatServerMetadataActions } from "../server-actions/metadata-actions";
import { createChatServerThreadActions } from "../server-actions/thread-actions";
import { createChatServerDiagnosticsActions, type ChatServerDiagnosticsActions } from "../protocol/client-actions/diagnostics-actions";
import { createChatServerMetadataActions, type ChatServerMetadataActions } from "../protocol/client-actions/metadata-actions";
import { createChatServerThreadActions } from "../protocol/client-actions/thread-actions";
import { ChatConnectionController } from "./connection-controller";
import { createChatReconnectActions } from "./reconnect-actions";
import type { rejectServerRequest, respondToServerRequest } from "../requests/server-request-responder";
import type { rejectServerRequest, respondToServerRequest } from "../protocol/requests/server-request-responder";
import type { ChatThreadGoalActions } from "../threads/thread-goal-actions";
import type { ThreadRenameController } from "../threads/thread-rename-controller";
import { ChatInboundController } from "../inbound/controller";
import { ChatInboundController } from "../protocol/inbound/controller";
import type { ChatConnectionWorkTracker } from "../panel/lifecycle";
interface ChatServerActionControllerPorts {

View file

@ -1,8 +1,8 @@
import { StaleConnectionError } from "../../../app-server/connection-manager";
import type { AppServerClient } from "../../../app-server/client";
import type { AppServerInitialization } from "../../../app-server/initialization";
import { clearDisconnectedConnectionStateAction, connectionInitializedAction } from "../chat-state-actions";
import type { ChatStateStore } from "../chat-state";
import { clearDisconnectedConnectionStateAction, connectionInitializedAction } from "../state/actions";
import type { ChatStateStore } from "../state/reducer";
import type { ChatConnectionWorkTracker, ActiveChatConnection } from "../panel/lifecycle";
export interface ChatConnectionAdapter {

View file

@ -1,6 +1,6 @@
import { clearLocalTurnAction, closePanelsAction } from "../chat-state-actions";
import { activeThreadId } from "../chat-state-selectors";
import type { ChatStateStore } from "../chat-state";
import { clearLocalTurnAction, closePanelsAction } from "../state/actions";
import { activeThreadId } from "../state/selectors";
import type { ChatStateStore } from "../state/reducer";
export interface ChatReconnectActionsHost {
stateStore: ChatStateStore;

View file

@ -1,12 +1,12 @@
import type { App, EventRef } from "obsidian";
import type { ComponentChild as UiNode } from "preact";
import type { CodexInput } from "../../../app-server/request-input";
import { isComposerSendKey, type SendShortcut } from "../../../shared/ui/keyboard";
import { textareaCursorAtVisualBoundary } from "../../../shared/ui/textarea-caret";
import { chatTurnBusy, type ChatAction, type ChatState, type ChatStateStore } from "../chat-state";
import type { ComposerMetaViewModel } from "../panel/model";
import { composerShellNode, syncComposerHeight, type ComposerCallbacks } from "../ui/composer";
import type { CodexInput } from "../../../../app-server/request-input";
import { isComposerSendKey, type SendShortcut } from "../../../../shared/ui/keyboard";
import { textareaCursorAtVisualBoundary } from "../../../../shared/ui/textarea-caret";
import { chatTurnBusy, type ChatAction, type ChatState, type ChatStateStore } from "../../state/reducer";
import type { ComposerMetaViewModel } from "../../panel/view-model";
import { composerShellNode, syncComposerHeight, type ComposerCallbacks } from "../../ui/composer";
import { composerBoundaryScrollDirection, type ComposerBoundaryScrollAction } from "./boundary-scroll";
import { noteCandidates as appNoteCandidates, resolveWikiLinkMention as resolveAppWikiLinkMention } from "./obsidian-context";
import {

View file

@ -1,11 +1,11 @@
import type { Thread } from "../../../domain/threads/model";
import type { ModelMetadata, SkillMetadata } from "../../../domain/catalog/metadata";
import type { Thread } from "../../../../domain/threads/model";
import type { ModelMetadata, SkillMetadata } from "../../../../domain/catalog/metadata";
import { prepareFuzzySearch, sortSearchResults, type SearchResult } from "obsidian";
import { findModelMetadataByIdOrName, sortedModelMetadata } from "../../../domain/catalog/metadata";
import { isReasoningEffort, REASONING_EFFORTS, supportedEffortsForModelMetadata } from "../../../domain/catalog/metadata";
import { findModelMetadataByIdOrName, sortedModelMetadata } from "../../../../domain/catalog/metadata";
import { isReasoningEffort, REASONING_EFFORTS, supportedEffortsForModelMetadata } from "../../../../domain/catalog/metadata";
import { SLASH_COMMANDS, slashCommandSubcommands, type SlashCommandName } from "./slash-commands";
import { getThreadTitle } from "../../../domain/threads/model";
import { shortThreadId } from "../../../utils";
import { getThreadTitle } from "../../../../domain/threads/model";
import { shortThreadId } from "../../../../utils";
export interface ComposerSuggestion {
display: string;

View file

@ -1,6 +1,6 @@
import { codexTextInputWithMentions, type RequestMention } from "../../../app-server/request-input";
import type { SkillMetadata } from "../../../domain/catalog/metadata";
import { parseObsidianWikiLink } from "../../../shared/obsidian/wikilinks";
import { codexTextInputWithMentions, type RequestMention } from "../../../../app-server/request-input";
import type { SkillMetadata } from "../../../../domain/catalog/metadata";
import { parseObsidianWikiLink } from "../../../../shared/obsidian/wikilinks";
export interface ParsedWikiLink {
raw: string;

View file

@ -1,11 +1,11 @@
import type { AppServerClient } from "../../../app-server/client";
import type { CodexInput } from "../../../app-server/request-input";
import { submissionStateSnapshot } from "../chat-state-selectors";
import type { ChatStateStore } from "../chat-state";
import type { AppServerClient } from "../../../../app-server/client";
import type { CodexInput } from "../../../../app-server/request-input";
import { submissionStateSnapshot } from "../../state/selectors";
import type { ChatStateStore } from "../../state/reducer";
import { parseSlashCommand } from "../composer/suggestions";
import type { SlashCommandExecutionResult } from "./slash-command-execution";
import type { SlashCommandName } from "../composer/slash-commands";
import type { ReferencedThreadDisplay } from "../../../domain/threads/reference";
import type { ReferencedThreadDisplay } from "../../../../domain/threads/reference";
interface ComposerDraftPort {
readonly trimmedDraft: string;

View file

@ -1,27 +1,27 @@
import type { App, Component } from "obsidian";
import type { AppServerClient } from "../../../app-server/client";
import type { ChatServerThreadActions } from "../server-actions/thread-actions";
import type { AppServerClient } from "../../../../app-server/client";
import type { ChatServerThreadActions } from "../../protocol/client-actions/thread-actions";
import { ChatComposerController } from "../composer/controller";
import { activeTurnId, type ChatState, type ChatStateStore } from "../chat-state";
import type { ChatReconnectActions } from "../session/reconnect-actions";
import { PendingRequestController } from "../requests/pending-request-controller";
import type { ChatRuntimeSettingsActions } from "../runtime/runtime-settings-actions";
import { activeTurnId, type ChatState, type ChatStateStore } from "../../state/reducer";
import type { ChatReconnectActions } from "../../connection/reconnect-actions";
import { PendingRequestController } from "../../pending-requests/controller";
import type { ChatRuntimeSettingsActions } from "../../runtime/runtime-settings-actions";
import { createComposerSubmissionActions } from "./composer-submission-actions";
import { createPlanImplementationActions } from "./plan-implementation-actions";
import { createSlashCommandActions } from "./slash-command-actions";
import { TurnSubmissionController } from "./turn-submission-controller";
import type { ChatThreadActions } from "../threads/thread-actions";
import type { ChatThreadGoalActions } from "../threads/thread-goal-actions";
import type { ThreadHistoryController } from "../threads/thread-history-controller";
import type { ThreadRenameController } from "../threads/thread-rename-controller";
import type { ChatInboundController } from "../inbound/controller";
import { currentModel, type RuntimeSnapshot } from "../runtime/effective-settings";
import { ChatMessageRenderer } from "../ui/message-stream";
import type { CodexChatHost } from "../chat-host";
import type { DisplayDetailSection } from "../display/types";
import type { ChatMessageScrollIntentController } from "../panel/message-scroll-intent-controller";
import type { ComposerMetaViewModel } from "../panel/model";
import type { ChatThreadActions } from "../../threads/thread-actions";
import type { ChatThreadGoalActions } from "../../threads/thread-goal-actions";
import type { ThreadHistoryController } from "../../threads/thread-history-controller";
import type { ThreadRenameController } from "../../threads/thread-rename-controller";
import type { ChatInboundController } from "../../protocol/inbound/controller";
import { currentModel, type RuntimeSnapshot } from "../../runtime/effective-settings";
import { ChatMessageRenderer } from "../../ui/message-stream";
import type { CodexChatHost } from "../../chat-host";
import type { DisplayDetailSection } from "../../display/types";
import type { ChatMessageScrollIntentController } from "../../panel/message-scroll-intent-controller";
import type { ComposerMetaViewModel } from "../../panel/view-model";
interface ConversationSurfaceControllerGroupPorts {
obsidian: {

View file

@ -1,8 +1,8 @@
import type { AppServerClient } from "../../../app-server/client";
import { closePanelsAction, setRequestedCollaborationModeDefaultAction } from "../chat-state-actions";
import { activeThreadId, canImplementPlan } from "../chat-state-selectors";
import type { ChatStateStore } from "../chat-state";
import type { DisplayItem } from "../display/types";
import type { AppServerClient } from "../../../../app-server/client";
import { closePanelsAction, setRequestedCollaborationModeDefaultAction } from "../../state/actions";
import { activeThreadId, canImplementPlan } from "../../state/selectors";
import type { ChatStateStore } from "../../state/reducer";
import type { DisplayItem } from "../../display/types";
const IMPLEMENT_PLAN_PROMPT = "Please implement this plan.";

View file

@ -1,4 +1,4 @@
import { isReasoningEffort, type ReasoningEffort } from "../../../domain/catalog/metadata";
import { isReasoningEffort, type ReasoningEffort } from "../../../../domain/catalog/metadata";
const DEFAULT_ALIASES = new Set(["default", "reset", "clear", "off"]);

View file

@ -1,19 +1,19 @@
import type { AppServerClient } from "../../../app-server/client";
import { codexTextInputWithAttachments, type CodexInput } from "../../../app-server/request-input";
import { chronologicalConversationSummariesFromAppServerTurns } from "../../../app-server/turn-model";
import { referencedThreadPromptBundle, referencedThreadTurns, REFERENCED_THREAD_TURN_LIMIT } from "../../../domain/threads/reference";
import type { Thread } from "../../../domain/threads/model";
import type { AppServerClient } from "../../../../app-server/client";
import { codexTextInputWithAttachments, type CodexInput } from "../../../../app-server/request-input";
import { chronologicalConversationSummariesFromAppServerTurns } from "../../../../app-server/turn-model";
import { referencedThreadPromptBundle, referencedThreadTurns, REFERENCED_THREAD_TURN_LIMIT } from "../../../../domain/threads/reference";
import type { Thread } from "../../../../domain/threads/model";
import {
executeSlashCommand as runSlashCommand,
type SlashCommandExecutionResult,
type ThreadReferenceInput,
} from "./slash-command-execution";
import type { SlashCommandName } from "../composer/slash-commands";
import type { DisplayDetailSection } from "../display/types";
import type { ReasoningEffort } from "../../../domain/catalog/metadata";
import type { ThreadGoal, ThreadGoalStatus } from "../../../app-server/thread-goal";
import { submissionStateSnapshot } from "../chat-state-selectors";
import type { ChatStateStore } from "../chat-state";
import type { DisplayDetailSection } from "../../display/types";
import type { ReasoningEffort } from "../../../../domain/catalog/metadata";
import type { ThreadGoal, ThreadGoalStatus } from "../../../../app-server/thread-goal";
import { submissionStateSnapshot } from "../../state/selectors";
import type { ChatStateStore } from "../../state/reducer";
export interface SlashCommandThreadPort {
startNewThread: () => Promise<void>;

View file

@ -1,9 +1,9 @@
import type { CodexInput } from "../../../app-server/request-input";
import type { ThreadGoal, ThreadGoalStatus } from "../../../app-server/thread-goal";
import type { ReasoningEffort } from "../../../domain/catalog/metadata";
import type { Thread } from "../../../domain/threads/model";
import { getThreadTitle } from "../../../domain/threads/model";
import type { ReferencedThreadDisplay } from "../../../domain/threads/reference";
import type { CodexInput } from "../../../../app-server/request-input";
import type { ThreadGoal, ThreadGoalStatus } from "../../../../app-server/thread-goal";
import type { ReasoningEffort } from "../../../../domain/catalog/metadata";
import type { Thread } from "../../../../domain/threads/model";
import { getThreadTitle } from "../../../../domain/threads/model";
import type { ReferencedThreadDisplay } from "../../../../domain/threads/reference";
import {
slashCommandDefinition,
slashCommandHelpSections,
@ -12,7 +12,7 @@ import {
type SlashCommandName,
type SlashCommandSubcommandDefinition,
} from "../composer/slash-commands";
import type { DisplayDetailSection, DisplayDetailMetaRow } from "../display/types";
import type { DisplayDetailSection, DisplayDetailMetaRow } from "../../display/types";
import {
modelOverrideMessage,
parseModelOverride,

View file

@ -1,14 +1,14 @@
import type { AppServerClient } from "../../../app-server/client";
import type { CodexInput } from "../../../app-server/request-input";
import type { ReferencedThreadDisplay } from "../../../domain/threads/reference";
import type { AppServerClient } from "../../../../app-server/client";
import type { CodexInput } from "../../../../app-server/request-input";
import type { ReferencedThreadDisplay } from "../../../../domain/threads/reference";
import {
addTranscriptItemAction,
optimisticTurnStartedAction,
turnStartAcknowledgedAction,
turnStartFailedAction,
} from "../chat-state-actions";
import { submissionStateSnapshot } from "../chat-state-selectors";
import type { ChatStateStore } from "../chat-state";
} from "../../state/actions";
import { submissionStateSnapshot } from "../../state/selectors";
import type { ChatStateStore } from "../../state/reducer";
import {
acknowledgeOptimisticTurnStart,
cleanupFailedTurnStart,

View file

@ -1,8 +1,8 @@
import type { PendingTurnStart } from "../chat-state";
import type { DisplayFileMention, DisplayItem, MessageDisplayItem } from "../display/types";
import { fileMentionsFromInput, userMessageDisplayText } from "../display/thread-items";
import { attachHookRunsToTurn } from "../display/hooks";
import type { CodexInput } from "../../../app-server/request-input";
import type { PendingTurnStart } from "../../state/reducer";
import type { DisplayFileMention, DisplayItem, MessageDisplayItem } from "../../display/types";
import { fileMentionsFromInput, userMessageDisplayText } from "../../protocol/display-items";
import { attachHookRunsToTurn } from "../../display/hooks";
import type { CodexInput } from "../../../../app-server/request-input";
export interface LocalUserMessageParams {
id: string;

View file

@ -4,7 +4,7 @@ import {
type ChatRuntimeState,
type ChatTranscriptState,
type ChatTurnState,
} from "../chat-state";
} from "../state/reducer";
import type { DisplayItem, MessageDisplayItem } from "./types";
import { isCompletedTurnOutcomeMessage } from "./turn-outcome-message";

View file

@ -1,7 +1,7 @@
import type { SharedAppServerMetadata } from "../../../app-server/shared-cache-state";
import type { Thread } from "../../../domain/threads/model";
import type { ChatServerMetadataActions } from "../server-actions/metadata-actions";
import type { ChatServerThreadActions } from "../server-actions/thread-actions";
import type { ChatServerMetadataActions } from "../protocol/client-actions/metadata-actions";
import type { ChatServerThreadActions } from "../protocol/client-actions/thread-actions";
export interface CachedSharedAppServerStateSource {
cachedThreadList: () => readonly Thread[] | null;

View file

@ -1,20 +1,20 @@
import { ConnectionManager } from "../../../app-server/connection-manager";
import type { ChatServerDiagnosticsActions } from "../server-actions/diagnostics-actions";
import type { ChatServerMetadataActions } from "../server-actions/metadata-actions";
import type { ChatServerThreadActions } from "../server-actions/thread-actions";
import type { ChatComposerController } from "../composer/controller";
import type { ChatInboundController } from "../inbound/controller";
import type { ChatServerDiagnosticsActions } from "../protocol/client-actions/diagnostics-actions";
import type { ChatServerMetadataActions } from "../protocol/client-actions/metadata-actions";
import type { ChatServerThreadActions } from "../protocol/client-actions/thread-actions";
import type { ChatComposerController } from "../conversation/composer/controller";
import type { ChatInboundController } from "../protocol/inbound/controller";
import type { ChatThreadGoalActions } from "../threads/thread-goal-actions";
import { createChatRuntimeSettingsActions, type ChatRuntimeSettingsActions } from "../runtime/runtime-settings-actions";
import type { ChatThreadActions } from "../threads/thread-actions";
import type { ThreadHistoryController } from "../threads/thread-history-controller";
import type { ThreadRenameController } from "../threads/thread-rename-controller";
import type { ToolbarPanelController } from "./toolbar-controller";
import type { ChatConnectionController } from "../session/connection-controller";
import type { ChatReconnectActions } from "../session/reconnect-actions";
import type { PendingRequestController } from "../requests/pending-request-controller";
import { rejectServerRequest, respondToServerRequest } from "../requests/server-request-responder";
import type { ComposerSubmissionActions } from "../turns/composer-submission-actions";
import type { ChatConnectionController } from "../connection/connection-controller";
import type { ChatReconnectActions } from "../connection/reconnect-actions";
import type { PendingRequestController } from "../pending-requests/controller";
import { rejectServerRequest, respondToServerRequest } from "../protocol/requests/server-request-responder";
import type { ComposerSubmissionActions } from "../conversation/turns/composer-submission-actions";
import type { RestoredThreadController } from "../threads/restored-thread-controller";
import type { ThreadIdentityActions } from "../threads/thread-identity-actions";
import type { ThreadResumeController } from "../threads/thread-resume-controller";
@ -28,9 +28,9 @@ import {
createChatConnectionControllers,
createChatInboundController,
createChatReconnectControllerGroup,
} from "../session/composition";
} from "../connection/composition";
import { createThreadControllerGroup, createThreadSelectionControllerGroup } from "../threads/composition";
import { createConversationSurfaceControllerGroup } from "../turns/composition";
import { createConversationSurfaceControllerGroup } from "../conversation/turns/composition";
import { createConnectionLifecycleControllerGroup, createPanelUiControllerGroup, createViewRenderControllerGroup } from "./ui-composition";
export interface ChatViewControllers {

View file

@ -4,12 +4,12 @@ import type { ComponentChild as UiNode } from "preact";
import type { AppServerClient } from "../../../app-server/client";
import type { ArchiveExportAdapter } from "../../../domain/threads/export";
import type { RuntimeSnapshot } from "../runtime/effective-settings";
import type { ChatState, ChatStateStore } from "../chat-state";
import type { ChatState, ChatStateStore } from "../state/reducer";
import type { CodexChatHost } from "../chat-host";
import type { ChatMessageScrollIntentController } from "../panel/message-scroll-intent-controller";
import type { DisplayDetailSection, DisplayItem } from "../display/types";
import type { ChatConnectionWorkTracker, ChatResumeWorkTracker, ChatViewDeferredTasks } from "./lifecycle";
import type { ComposerMetaViewModel } from "./model";
import type { ComposerMetaViewModel } from "./view-model";
export interface ChatControllerCompositionPorts {
obsidian: ChatPanelObsidianContext;

View file

@ -1,6 +1,6 @@
import type { ChatComposerController } from "../composer/controller";
import type { ChatComposerController } from "../conversation/composer/controller";
import type { DisplayDetailSection } from "../display/types";
import type { ChatConnectionController } from "../session/connection-controller";
import type { ChatConnectionController } from "../connection/connection-controller";
import type { ThreadSelectionActions } from "../threads/thread-selection-controller";
import type { ChatMessageRenderer } from "../ui/message-stream";
import type { ChatControllerCompositionPorts } from "./controller-ports";

View file

@ -1,6 +1,6 @@
import type { ComponentChild as UiNode } from "preact";
import type { ChatStateStore } from "../chat-state";
import type { ChatStateStore } from "../state/reducer";
import { renderChatPanelShell } from "../ui/shell";
export interface ChatShellRenderPort {

View file

@ -1,5 +1,5 @@
import type { OpenCodexPanelSnapshot } from "../../../workspace/open-panel-snapshot";
import type { ChatState } from "../chat-state";
import type { ChatState } from "../state/reducer";
import type { DisplayItem } from "../display/types";
import type { RestoredThreadState } from "./lifecycle";

View file

@ -1,4 +1,4 @@
import type { ChatAction, ChatState, ChatStateStore } from "../chat-state";
import type { ChatAction, ChatState, ChatStateStore } from "../state/reducer";
import type { ChatThreadActions } from "../threads/thread-actions";
import type { ToolbarArchiveConfirmState } from "./toolbar-archive-confirm-state";

View file

@ -1,12 +1,12 @@
import type { ConnectionManager } from "../../../app-server/connection-manager";
import type { ComponentChild as UiNode } from "preact";
import type { ChatStateStore } from "../chat-state";
import type { ChatStateStore } from "../state/reducer";
import type { CodexChatHost } from "../chat-host";
import type { ChatServerMetadataActions } from "../server-actions/metadata-actions";
import type { ChatServerThreadActions } from "../server-actions/thread-actions";
import type { ChatComposerController } from "../composer/controller";
import type { ChatServerMetadataActions } from "../protocol/client-actions/metadata-actions";
import type { ChatServerThreadActions } from "../protocol/client-actions/thread-actions";
import type { ChatComposerController } from "../conversation/composer/controller";
import type { ChatThreadActions } from "../threads/thread-actions";
import { scheduleAppServerWarmup } from "../session/app-server-warmup-controller";
import { scheduleAppServerWarmup } from "../connection/app-server-warmup-controller";
import { closeChatView, openChatView, type ChatViewLifecycleHost } from "./view-lifecycle";
import { ToolbarPanelController } from "./toolbar-controller";
import { ChatViewRenderController } from "./view-render-controller";

View file

@ -1,10 +1,10 @@
import type { ChatState } from "../chat-state";
import type { ChatState } from "../state/reducer";
import type { ReasoningEffort } from "../../../domain/catalog/metadata";
import type { RuntimeSnapshot } from "../runtime/effective-settings";
import type { SendShortcut } from "../../../shared/ui/keyboard";
import type { ToolbarActions } from "../ui/toolbar";
import type { ToolbarThreadRow } from "./model/types";
import type { RestoredThreadTitleSnapshot } from "./model";
import type { ToolbarThreadRow } from "./view-model/types";
import type { RestoredThreadTitleSnapshot } from "./view-model";
interface ChatPanelToolbarState {
archiveConfirmId: () => string | null;

View file

@ -5,9 +5,9 @@ import {
fastModeActive,
runtimeConfigOrDefault,
} from "../../runtime/effective-settings";
import { compactReasoningEffortLabel } from "../../turns/runtime-overrides";
import { compactReasoningEffortLabel } from "../../conversation/turns/runtime-overrides";
import { contextSummary } from "../../runtime/status-summary";
import type { ChatState } from "../../chat-state";
import type { ChatState } from "../../state/reducer";
import type { ComposerContextMeterCellViewModel, ComposerContextMeterViewModel, ComposerMetaViewModel } from "./types";
import type { runtimeSnapshotForChatSlices } from "./runtime";

View file

@ -1,5 +1,5 @@
import { codexPanelDisplayTitle, explicitThreadName, getThreadTitle } from "../../../../domain/threads/model";
import type { ChatState } from "../../chat-state";
import type { ChatState } from "../../state/reducer";
import type { RestoredThreadTitleSnapshot } from "./types";
export function chatViewDisplayTitle(state: ChatState, restoredThreadTitle: string | null): string {

View file

@ -1,7 +1,7 @@
import type { ReasoningEffort } from "../../../../domain/catalog/metadata";
import type { RuntimeSnapshot } from "../../runtime/effective-settings";
import type { RuntimeConfigSection, RateLimitSummary } from "../../runtime/status-summary";
import type { ChatState } from "../../chat-state";
import type { ChatState } from "../../state/reducer";
export interface RuntimeSnapshotInput {
runtimeConfig: ChatState["connection"]["runtimeConfig"];

View file

@ -1,11 +1,11 @@
import { setDetailOpenAction, setUserInputDraftAction } from "../chat-state-actions";
import { pendingRequestSnapshot, type PendingRequestSnapshot } from "../chat-state-selectors";
import type { ChatStateStore } from "../chat-state";
import type { ApprovalAction, PendingApproval } from "../requests/approval";
import type { ChatInboundController } from "../inbound/controller";
import { pendingRequestFocusSignature } from "../requests/view-model";
import { setDetailOpenAction, setUserInputDraftAction } from "../state/actions";
import { pendingRequestSnapshot, type PendingRequestSnapshot } from "../state/selectors";
import type { ChatStateStore } from "../state/reducer";
import type { ApprovalAction, PendingApproval } from "../protocol/requests/approval";
import type { ChatInboundController } from "../protocol/inbound/controller";
import { pendingRequestFocusSignature } from "./view-model";
import type { PendingRequestMessageActions } from "../ui/pending-request-message";
import { answersForPendingUserInput, type PendingUserInput } from "../requests/user-input";
import { answersForPendingUserInput, type PendingUserInput } from "../protocol/requests/user-input";
export interface PendingRequestControllerHost {
stateStore: ChatStateStore;

View file

@ -1,5 +1,5 @@
import type { PendingApproval } from "./approval";
import type { PendingUserInput } from "./user-input";
import type { PendingApproval } from "../protocol/requests/approval";
import type { PendingUserInput } from "../protocol/requests/user-input";
export interface ChatRequestState {
approvals: readonly PendingApproval[];

View file

@ -5,10 +5,10 @@ import {
approvalTitle,
type ApprovalAction,
type PendingApproval,
} from "./approval";
} from "../protocol/requests/approval";
import type { DisplayDetailSection, DisplayItem } from "../display/types";
import { definedProp } from "../../../utils";
import type { PendingUserInput } from "./user-input";
import type { PendingUserInput } from "../protocol/requests/user-input";
export function pendingRequestsSignature(
approvals: readonly PendingApproval[],

View file

@ -1,4 +1,4 @@
import type { AppServerClient } from "../../../app-server/client";
import type { AppServerClient } from "../../../../app-server/client";
import {
diagnosticProbeError,
diagnosticProbeOk,
@ -8,9 +8,9 @@ import {
type DiagnosticProbeMethod,
type McpServerStartupStatus,
type McpServerStatusSummary,
} from "../../../app-server/diagnostics";
import type { SharedAppServerMetadata } from "../../../app-server/shared-cache-state";
import { mcpStatusLines as buildMcpStatusLines } from "../mcp-status";
} from "../../../../app-server/diagnostics";
import type { SharedAppServerMetadata } from "../../../../app-server/shared-cache-state";
import { mcpStatusLines as buildMcpStatusLines } from "../../mcp-status";
import { cloneAppServerDiagnostics, type ChatServerActionHost } from "./shared";
interface RefreshDiagnosticProbesOptions {

View file

@ -1,9 +1,9 @@
import { type Diagnostics, diagnosticProbeError, diagnosticProbeOk } from "../../../app-server/diagnostics";
import { listModelMetadata, listSkillCatalog } from "../../../app-server/resource-operations";
import { runtimeConfigSnapshotFromAppServerConfig } from "../../../app-server/runtime-config";
import { rateLimitSnapshotFromAppServerSnapshot } from "../../../app-server/runtime-metrics";
import type { SharedAppServerMetadata } from "../../../app-server/shared-cache-state";
import type { ModelMetadata, SkillMetadata } from "../../../domain/catalog/metadata";
import { type Diagnostics, diagnosticProbeError, diagnosticProbeOk } from "../../../../app-server/diagnostics";
import { listModelMetadata, listSkillCatalog } from "../../../../app-server/resource-operations";
import { runtimeConfigSnapshotFromAppServerConfig } from "../../../../app-server/runtime-config";
import { rateLimitSnapshotFromAppServerSnapshot } from "../../../../app-server/runtime-metrics";
import type { SharedAppServerMetadata } from "../../../../app-server/shared-cache-state";
import type { ModelMetadata, SkillMetadata } from "../../../../domain/catalog/metadata";
import { cloneAppServerDiagnostics, type ChatServerActionHost } from "./shared";
interface RateLimitMetadataResult {

View file

@ -1,6 +1,6 @@
import type { AppServerClient } from "../../../app-server/client";
import type { Diagnostics } from "../../../app-server/diagnostics";
import type { ChatStateStore } from "../chat-state";
import type { AppServerClient } from "../../../../app-server/client";
import type { Diagnostics } from "../../../../app-server/diagnostics";
import type { ChatStateStore } from "../../state/reducer";
export interface ChatServerActionHost {
stateStore: ChatStateStore;

View file

@ -1,8 +1,8 @@
import { listThreads } from "../../../app-server/resource-operations";
import type { Thread } from "../../../domain/threads/model";
import type { RuntimeSnapshot } from "../runtime/effective-settings";
import { serviceTierRequestForThreadStart } from "../runtime/turn-settings";
import { resumedThreadActionFromAppServerResponse } from "../threads/thread-resume";
import { listThreads } from "../../../../app-server/resource-operations";
import type { Thread } from "../../../../domain/threads/model";
import type { RuntimeSnapshot } from "../../runtime/effective-settings";
import { serviceTierRequestForThreadStart } from "../../runtime/turn-settings";
import { resumedThreadActionFromAppServerResponse } from "../../threads/thread-resume";
import type { ChatServerActionHost } from "./shared";
interface StartedThreadSummary {

View file

@ -1,4 +1,4 @@
import type { DisplayDetailSection, DisplayFileChange, DisplayFileMention, DisplayItem } from "./types";
import type { DisplayDetailSection, DisplayFileChange, DisplayFileMention, DisplayItem } from "../display/types";
import type { CodexInput, CodexInputItem } from "../../../app-server/request-input";
import type { FileUpdateChange } from "../../../generated/app-server/v2/FileUpdateChange";
import type { ThreadItem } from "../../../generated/app-server/v2/ThreadItem";
@ -6,16 +6,16 @@ import type { Turn } from "../../../generated/app-server/v2/Turn";
import { definedProp, truncate } from "../../../utils";
import { referencedThreadDisplayFromPrompt } from "../../../domain/threads/reference";
import { appServerUserItemText } from "../../../app-server/turn-model";
import { agentDisplayItem } from "./agent";
import { pathRelativeToRoot } from "./paths";
import { normalizeProposedPlanMarkdown } from "./plan";
import { agentDisplayItem } from "../display/agent";
import { pathRelativeToRoot } from "../display/paths";
import { normalizeProposedPlanMarkdown } from "../display/plan";
import {
commandExecutionState,
dynamicToolCallExecutionState,
imageGenerationExecutionState,
mcpToolCallExecutionState,
patchApplyExecutionState,
} from "./state";
} from "../display/state";
import {
bodyDetail,
compactToolSummary,
@ -24,7 +24,7 @@ import {
jsonTargetLabel,
metaDetail,
statusQualifier,
} from "./tool-format";
} from "../display/tool-format";
type UserMessageItem = Extract<ThreadItem, { type: "userMessage" }>;
type AgentMessageItem = Extract<ThreadItem, { type: "agentMessage" }>;

View file

@ -1,15 +1,15 @@
import type { RequestId } from "../../../generated/app-server/RequestId";
import type { ServerNotification } from "../../../generated/app-server/ServerNotification";
import type { ServerRequest } from "../../../generated/app-server/ServerRequest";
import type { Turn } from "../../../generated/app-server/v2/Turn";
import type { McpServerStartupStatus } from "../../../app-server/diagnostics";
import type { RequestId } from "../../../../generated/app-server/RequestId";
import type { ServerNotification } from "../../../../generated/app-server/ServerNotification";
import type { ServerRequest } from "../../../../generated/app-server/ServerRequest";
import type { Turn } from "../../../../generated/app-server/v2/Turn";
import type { McpServerStartupStatus } from "../../../../app-server/diagnostics";
import { classifyAppServerLog } from "./app-server-logs";
import { activeTurnId, type ChatAction, type ChatState, type ChatStateStore } from "../chat-state";
import { createStructuredSystemItem, createSystemItem } from "../display/system";
import type { DisplayDetailSection } from "../display/types";
import { activeTurnId, type ChatAction, type ChatState, type ChatStateStore } from "../../state/reducer";
import { createStructuredSystemItem, createSystemItem } from "../../display/system";
import type { DisplayDetailSection } from "../../display/types";
import { approvalResponse, type ApprovalAction, type PendingApproval } from "../requests/approval";
import { userInputResponse, type PendingUserInput } from "../requests/user-input";
import { createApprovalResultItem, createUserInputResultItem } from "../requests/view-model";
import { createApprovalResultItem, createUserInputResultItem } from "../../pending-requests/view-model";
import { planChatNotification, type ChatNotificationEffect } from "./notification-plan";
import { routeServerRequest } from "./routing";

View file

@ -1,13 +1,13 @@
import { activeThreadSettingsAppliedAction } from "../chat-state-actions";
import type { McpServerStartupStatus } from "../../../app-server/diagnostics";
import { threadTokenUsageFromAppServerUsage } from "../../../app-server/runtime-metrics";
import type { ServerNotification } from "../../../generated/app-server/ServerNotification";
import type { FileUpdateChange } from "../../../generated/app-server/v2/FileUpdateChange";
import type { ThreadItem } from "../../../generated/app-server/v2/ThreadItem";
import type { Turn } from "../../../generated/app-server/v2/Turn";
import { jsonPreview } from "../../../utils";
import { activeTurnId, pendingTurnStart as pendingTurnStartForState, type ChatAction, type ChatState } from "../chat-state";
import { createAutoReviewResultItem, createReviewResultItem } from "../display/review";
import { activeThreadSettingsAppliedAction } from "../../state/actions";
import type { McpServerStartupStatus } from "../../../../app-server/diagnostics";
import { threadTokenUsageFromAppServerUsage } from "../../../../app-server/runtime-metrics";
import type { ServerNotification } from "../../../../generated/app-server/ServerNotification";
import type { FileUpdateChange } from "../../../../generated/app-server/v2/FileUpdateChange";
import type { ThreadItem } from "../../../../generated/app-server/v2/ThreadItem";
import type { Turn } from "../../../../generated/app-server/v2/Turn";
import { jsonPreview } from "../../../../utils";
import { activeTurnId, pendingTurnStart as pendingTurnStartForState, type ChatAction, type ChatState } from "../../state/reducer";
import { createAutoReviewResultItem, createReviewResultItem } from "../../display/review";
import {
appendAssistantDelta,
appendItemOutput,
@ -16,18 +16,13 @@ import {
appendToolOutput,
completeReasoningItems,
upsertDisplayItem,
} from "../display/stream-updates";
import {
displayItemFromThreadItem,
displayItemsFromTurns,
normalizeFileChanges,
shouldSuppressLifecycleItem,
} from "../display/thread-items";
import { planProgressDisplayItem } from "../display/plan";
import { createSystemItem } from "../display/system";
import type { DisplayItem, DisplayKind, MessageDisplayItem } from "../display/types";
import { goalChangeItem } from "../display/goal-messages";
import { attachHookRunsToTurn, hookRunDisplayItem } from "../display/hooks";
} from "../../display/stream-updates";
import { displayItemFromThreadItem, displayItemsFromTurns, normalizeFileChanges, shouldSuppressLifecycleItem } from "../display-items";
import { planProgressDisplayItem } from "../../display/plan";
import { createSystemItem } from "../../display/system";
import type { DisplayItem, DisplayKind, MessageDisplayItem } from "../../display/types";
import { goalChangeItem } from "../../display/goal-messages";
import { attachHookRunsToTurn, hookRunDisplayItem } from "../../display/hooks";
import { routeServerNotification } from "./routing";
export type ChatNotificationEffect =

View file

@ -1,5 +1,5 @@
import type { ServerNotification } from "../../../generated/app-server/ServerNotification";
import type { ServerRequest } from "../../../generated/app-server/ServerRequest";
import type { ServerNotification } from "../../../../generated/app-server/ServerNotification";
import type { ServerRequest } from "../../../../generated/app-server/ServerRequest";
import { toPendingApproval, type PendingApproval } from "../requests/approval";
import { toPendingUserInput, type PendingUserInput } from "../requests/user-input";

View file

@ -1,11 +1,11 @@
import type { RequestId } from "../../../generated/app-server/RequestId";
import type { ServerRequest } from "../../../generated/app-server/ServerRequest";
import type { CommandExecutionApprovalDecision } from "../../../generated/app-server/v2/CommandExecutionApprovalDecision";
import type { CommandExecutionRequestApprovalResponse } from "../../../generated/app-server/v2/CommandExecutionRequestApprovalResponse";
import type { FileChangeRequestApprovalResponse } from "../../../generated/app-server/v2/FileChangeRequestApprovalResponse";
import type { GrantedPermissionProfile } from "../../../generated/app-server/v2/GrantedPermissionProfile";
import type { PermissionsRequestApprovalResponse } from "../../../generated/app-server/v2/PermissionsRequestApprovalResponse";
import { addOptional, nonEmptyString, permissionRows } from "../display/permission-details";
import type { RequestId } from "../../../../generated/app-server/RequestId";
import type { ServerRequest } from "../../../../generated/app-server/ServerRequest";
import type { CommandExecutionApprovalDecision } from "../../../../generated/app-server/v2/CommandExecutionApprovalDecision";
import type { CommandExecutionRequestApprovalResponse } from "../../../../generated/app-server/v2/CommandExecutionRequestApprovalResponse";
import type { FileChangeRequestApprovalResponse } from "../../../../generated/app-server/v2/FileChangeRequestApprovalResponse";
import type { GrantedPermissionProfile } from "../../../../generated/app-server/v2/GrantedPermissionProfile";
import type { PermissionsRequestApprovalResponse } from "../../../../generated/app-server/v2/PermissionsRequestApprovalResponse";
import { addOptional, nonEmptyString, permissionRows } from "../../display/permission-details";
export type ApprovalAction = "accept" | "accept-session" | "decline" | "cancel" | CommandApprovalDecisionAction;
interface CommandApprovalDecisionAction {

View file

@ -1,4 +1,4 @@
import type { AppServerClient } from "../../../app-server/client";
import type { AppServerClient } from "../../../../app-server/client";
type RespondRequestId = Parameters<AppServerClient["respondToServerRequest"]>[0];
type RejectRequestId = Parameters<AppServerClient["rejectServerRequest"]>[0];

View file

@ -1,8 +1,8 @@
import type { RequestId } from "../../../generated/app-server/RequestId";
import type { ServerRequest } from "../../../generated/app-server/ServerRequest";
import type { ToolRequestUserInputParams } from "../../../generated/app-server/v2/ToolRequestUserInputParams";
import type { ToolRequestUserInputQuestion } from "../../../generated/app-server/v2/ToolRequestUserInputQuestion";
import type { ToolRequestUserInputResponse } from "../../../generated/app-server/v2/ToolRequestUserInputResponse";
import type { RequestId } from "../../../../generated/app-server/RequestId";
import type { ServerRequest } from "../../../../generated/app-server/ServerRequest";
import type { ToolRequestUserInputParams } from "../../../../generated/app-server/v2/ToolRequestUserInputParams";
import type { ToolRequestUserInputQuestion } from "../../../../generated/app-server/v2/ToolRequestUserInputQuestion";
import type { ToolRequestUserInputResponse } from "../../../../generated/app-server/v2/ToolRequestUserInputResponse";
type UserInputRequest = Extract<ServerRequest, { method: "item/tool/requestUserInput" }>;

View file

@ -11,8 +11,8 @@ import {
} from "./turn-settings";
import type { ThreadSettingsUpdate } from "../../../app-server/thread-settings";
import type { RequestedServiceTier } from "./effective-settings";
import { modelOverrideMessage, reasoningEffortOverrideMessage } from "../turns/runtime-overrides";
import type { ChatAction, ChatState, ChatStateStore } from "../chat-state";
import { modelOverrideMessage, reasoningEffortOverrideMessage } from "../conversation/turns/runtime-overrides";
import type { ChatAction, ChatState, ChatStateStore } from "../state/reducer";
const COLLABORATION_MODE_WARNING_MESSAGES: Record<TurnCollaborationModeWarning, string> = {
"missing-model": "No effective model is available. Sending without a mode override.",

View file

@ -1,12 +1,12 @@
import type { AppServerInitialization } from "../../app-server/initialization";
import type { Thread } from "../../domain/threads/model";
import type { ThreadTokenUsage } from "../../app-server/runtime-metrics";
import { parseServiceTier, type ServiceTier } from "../../app-server/runtime-policy";
import type { ReasoningEffort } from "../../domain/catalog/metadata";
import type { ChatRuntimeState } from "./runtime/state";
import type { CollaborationMode } from "./runtime/turn-settings";
import type { DisplayItem } from "./display/types";
import type { PendingTurnStart } from "./turns/turn-state";
import type { AppServerInitialization } from "../../../app-server/initialization";
import type { Thread } from "../../../domain/threads/model";
import type { ThreadTokenUsage } from "../../../app-server/runtime-metrics";
import { parseServiceTier, type ServiceTier } from "../../../app-server/runtime-policy";
import type { ReasoningEffort } from "../../../domain/catalog/metadata";
import type { ChatRuntimeState } from "../runtime/state";
import type { CollaborationMode } from "../runtime/turn-settings";
import type { DisplayItem } from "../display/types";
import type { PendingTurnStart } from "../conversation/turns/turn-state";
export interface ActiveThreadResumedAction {
type: "active-thread/resumed";

View file

@ -1,15 +1,15 @@
import type { AppServerInitialization } from "../../app-server/initialization";
import type { ReasoningEffort } from "../../domain/catalog/metadata";
import type { Thread } from "../../domain/threads/model";
import type { ModelMetadata, SkillMetadata } from "../../domain/catalog/metadata";
import type { ThreadGoal } from "../../app-server/thread-goal";
import type { ThreadSettingsUpdate } from "../../app-server/thread-settings";
import type { ApprovalsReviewer } from "../../app-server/runtime-policy";
import type { Diagnostics } from "../../app-server/diagnostics";
import { createAppServerDiagnostics } from "../../app-server/diagnostics";
import type { RuntimeConfigSnapshot } from "../../app-server/runtime-config";
import type { RateLimitSnapshot, ThreadTokenUsage } from "../../app-server/runtime-metrics";
import type { CollaborationMode } from "./runtime/turn-settings";
import type { AppServerInitialization } from "../../../app-server/initialization";
import type { ReasoningEffort } from "../../../domain/catalog/metadata";
import type { Thread } from "../../../domain/threads/model";
import type { ModelMetadata, SkillMetadata } from "../../../domain/catalog/metadata";
import type { ThreadGoal } from "../../../app-server/thread-goal";
import type { ThreadSettingsUpdate } from "../../../app-server/thread-settings";
import type { ApprovalsReviewer } from "../../../app-server/runtime-policy";
import type { Diagnostics } from "../../../app-server/diagnostics";
import { createAppServerDiagnostics } from "../../../app-server/diagnostics";
import type { RuntimeConfigSnapshot } from "../../../app-server/runtime-config";
import type { RateLimitSnapshot, ThreadTokenUsage } from "../../../app-server/runtime-metrics";
import type { CollaborationMode } from "../runtime/turn-settings";
import {
commitPendingThreadSettingsRuntimeState,
initialActiveChatRuntimeState,
@ -20,12 +20,12 @@ import {
setRequestedServiceTierRuntimeState,
setSelectedCollaborationModeRuntimeState,
type ChatRuntimeState,
} from "./runtime/state";
import type { RequestedServiceTier } from "./runtime/effective-settings";
import type { PendingApproval } from "./requests/approval";
import type { ComposerSuggestion } from "./composer/suggestions";
import { upsertDisplayItem } from "./display/stream-updates";
import type { DisplayItem } from "./display/types";
} from "../runtime/state";
import type { RequestedServiceTier } from "../runtime/effective-settings";
import type { PendingApproval } from "../protocol/requests/approval";
import type { ComposerSuggestion } from "../conversation/composer/suggestions";
import { upsertDisplayItem } from "../display/stream-updates";
import type { DisplayItem } from "../display/types";
import type {
ActiveThreadResumedAction,
ActiveThreadRestoredPlaceholderAction,
@ -44,16 +44,21 @@ import type {
TurnStartAcknowledgedAction,
TurnStartFailedAction,
UserInputDraftSetAction,
} from "./chat-state-actions";
import { initialChatTranscriptState, reduceTranscriptSlice, type ChatTranscriptState, type TranscriptAction } from "./transcript-state";
} from "./actions";
import { initialChatTranscriptState, reduceTranscriptSlice, type ChatTranscriptState, type TranscriptAction } from "./transcript";
import {
initialChatRequestState,
reduceRequestSlice,
resolveChatRequest,
type ChatRequestState,
type RequestAction,
} from "./requests/request-state";
import { initialChatTurnState, transitionChatTurnLifecycleState, type ChatTurnState, type PendingTurnStart } from "./turns/turn-state";
} from "../pending-requests/state";
import {
initialChatTurnState,
transitionChatTurnLifecycleState,
type ChatTurnState,
type PendingTurnStart,
} from "../conversation/turns/turn-state";
export {
activeTurnId,
@ -63,8 +68,8 @@ export {
type ChatTurnLifecycleState,
type ChatTurnState,
type PendingTurnStart,
} from "./turns/turn-state";
export type { ChatTranscriptState } from "./transcript-state";
} from "../conversation/turns/turn-state";
export type { ChatTranscriptState } from "./transcript";
interface ChatConnectionState {
status: string;
@ -88,7 +93,7 @@ export interface ChatActiveThreadState {
tokenUsage: ThreadTokenUsage | null;
}
export type { ChatRuntimeState } from "./runtime/state";
export type { ChatRuntimeState } from "../runtime/state";
interface ChatComposerState {
draft: string;

View file

@ -1,10 +1,10 @@
import { activeTurnId as selectActiveTurnId, chatTurnBusy, pendingTurnStart } from "./chat-state";
import type { ChatState, PendingTurnStart } from "./chat-state";
import type { Thread } from "../../domain/threads/model";
import type { PendingApproval } from "./requests/approval";
import type { PendingUserInput } from "./requests/user-input";
import type { DisplayItem } from "./display/types";
import { implementPlanCandidateFromState } from "./display/action-candidates";
import { activeTurnId as selectActiveTurnId, chatTurnBusy, pendingTurnStart } from "./reducer";
import type { ChatState, PendingTurnStart } from "./reducer";
import type { Thread } from "../../../domain/threads/model";
import type { PendingApproval } from "../protocol/requests/approval";
import type { PendingUserInput } from "../protocol/requests/user-input";
import type { DisplayItem } from "../display/types";
import { implementPlanCandidateFromState } from "../display/action-candidates";
export interface PendingRequestSnapshot {
approvals: readonly PendingApproval[];

View file

@ -1,5 +1,5 @@
import { upsertDisplayItem } from "./display/stream-updates";
import type { DisplayItem } from "./display/types";
import { upsertDisplayItem } from "../display/stream-updates";
import type { DisplayItem } from "../display/types";
export interface ChatTranscriptState {
displayItems: readonly DisplayItem[];

View file

@ -11,7 +11,7 @@ import { ThreadResumeController } from "./thread-resume-controller";
import { createThreadSelectionActions } from "./thread-selection-controller";
import { RestoredThreadController } from "./restored-thread-controller";
import type { ToolbarPanelController } from "../panel/toolbar-controller";
import type { ChatStateStore } from "../chat-state";
import type { ChatStateStore } from "../state/reducer";
import type { CodexChatHost } from "../chat-host";
import type { ChatResumeWorkTracker, ChatViewDeferredTasks } from "../panel/lifecycle";

View file

@ -1,5 +1,5 @@
import { restoreThreadPlaceholderAction } from "../chat-state-actions";
import type { ChatStateStore } from "../chat-state";
import { restoreThreadPlaceholderAction } from "../state/actions";
import type { ChatStateStore } from "../state/reducer";
import {
transitionRestoredThreadLifecycle,
type RestoredThreadLifecycleState,

View file

@ -7,9 +7,9 @@ import { exportArchivedThreadMarkdown } from "../../../domain/threads/export";
import type { ArchiveExportAdapter } from "../../../domain/threads/export";
import { inheritedForkThreadName } from "../../../domain/threads/model";
import type { CodexPanelSettings } from "../../../settings/model";
import { chatTurnBusy, type ChatAction, type ChatState, type ChatStateStore } from "../chat-state";
import { chatTurnBusy, type ChatAction, type ChatState, type ChatStateStore } from "../state/reducer";
import { rollbackCandidateFromItems, turnsAfterTurnId } from "../display/action-candidates";
import { displayItemsFromTurns } from "../display/thread-items";
import { displayItemsFromTurns } from "../protocol/display-items";
import { resumedThreadActionFromActiveRuntime } from "./thread-resume";
export interface ChatThreadActionsHost {

View file

@ -6,7 +6,7 @@ import {
type ThreadGoalUpdate,
} from "../../../app-server/thread-goal";
import type { JsonValue } from "../../../generated/app-server/serde_json/JsonValue";
import type { ChatStateStore } from "../chat-state";
import type { ChatStateStore } from "../state/reducer";
import type { GoalDisplayItem } from "../display/types";
import { goalChangeItem } from "../display/goal-messages";

View file

@ -1,7 +1,7 @@
import type { AppServerClient } from "../../../app-server/client";
import type { ThreadTurnsPage } from "../../../app-server/turn-history";
import type { ChatAction, ChatState, ChatStateStore } from "../chat-state";
import { displayItemsFromTurns } from "../display/thread-items";
import type { ChatAction, ChatState, ChatStateStore } from "../state/reducer";
import { displayItemsFromTurns } from "../protocol/display-items";
export interface ThreadHistoryControllerHost {
stateStore: ChatStateStore;

View file

@ -1,7 +1,7 @@
import type { RestoredThreadController } from "./restored-thread-controller";
import { applyThreadListAction, clearActiveThreadAction } from "../chat-state-actions";
import { activeThreadId, listedThreads } from "../chat-state-selectors";
import type { ChatStateStore } from "../chat-state";
import { applyThreadListAction, clearActiveThreadAction } from "../state/actions";
import { activeThreadId, listedThreads } from "../state/selectors";
import type { ChatStateStore } from "../state/reducer";
export interface ThreadIdentityActionsHost {
stateStore: ChatStateStore;

View file

@ -9,7 +9,7 @@ import {
import type { Thread } from "../../../domain/threads/model";
import type { Turn } from "../../../generated/app-server/v2/Turn";
import type { CodexPanelSettings } from "../../../settings/model";
import type { ChatAction, ChatState, ChatStateStore } from "../chat-state";
import type { ChatAction, ChatState, ChatStateStore } from "../state/reducer";
import { generateThreadTitleWithCodex } from "../../../app-server/thread-title-generation";
import { completedConversationSummaryFromAppServerTurn } from "../../../app-server/turn-model";
import { firstNamingContextFromDisplayItems, namingContextFromDisplayItems } from "./thread-naming";

View file

@ -1,8 +1,8 @@
import type { AppServerClient } from "../../../app-server/client";
import type { ThreadTokenUsage } from "../../../app-server/runtime-metrics";
import { setActiveThreadTokenUsageAction } from "../chat-state-actions";
import { activeThreadId, canSwitchToThread, displayItemsEmpty, listedThreads } from "../chat-state-selectors";
import type { ChatStateStore } from "../chat-state";
import { setActiveThreadTokenUsageAction } from "../state/actions";
import { activeThreadId, canSwitchToThread, displayItemsEmpty, listedThreads } from "../state/selectors";
import type { ChatStateStore } from "../state/reducer";
import type { RestoredThreadController } from "./restored-thread-controller";
import { resumedThreadActionFromAppServerResponse } from "./thread-resume";
import type { ThreadHistoryController } from "./thread-history-controller";

View file

@ -7,7 +7,7 @@ import type { ThreadStartResponse } from "../../../generated/app-server/v2/Threa
import type { ThreadResumeResponse } from "../../../generated/app-server/v2/ThreadResumeResponse";
import type { ChatRuntimeState } from "../runtime/state";
import type { DisplayItem } from "../display/types";
import type { ActiveThreadResumedAction } from "../chat-state-actions";
import type { ActiveThreadResumedAction } from "../state/actions";
interface ThreadActivationResponse {
thread: Thread;

View file

@ -1,6 +1,6 @@
import { closePanelsAction } from "../chat-state-actions";
import { canSwitchToThread } from "../chat-state-selectors";
import type { ChatStateStore } from "../chat-state";
import { closePanelsAction } from "../state/actions";
import { canSwitchToThread } from "../state/selectors";
import type { ChatStateStore } from "../state/reducer";
export interface ThreadSelectionControllerHost {
stateStore: ChatStateStore;

View file

@ -2,8 +2,8 @@ import { setIcon } from "obsidian";
import type { ButtonHTMLAttributes, ComponentChild as UiNode, Ref } from "preact";
import { useLayoutEffect, useRef, useState } from "preact/hooks";
import type { ComposerSuggestion } from "../composer/suggestions";
import type { ComposerMetaViewModel, RuntimeChoice } from "../panel/model";
import type { ComposerSuggestion } from "../conversation/composer/suggestions";
import type { ComposerMetaViewModel, RuntimeChoice } from "../panel/view-model";
import { IconButton } from "../../../shared/ui/components";
import { syncTextareaHeight } from "../../../shared/ui/textarea-autogrow";

View file

@ -1,11 +1,11 @@
import { Fragment, type ComponentChild as UiNode } from "preact";
import { useLayoutEffect, useState } from "preact/hooks";
import { activeTurnId } from "../../chat-state";
import { activeTurnId } from "../../state/reducer";
import { displayBlocksForItems } from "../../display/blocks";
import type { ToolResultDisplayItem } from "../../display/tool-view";
import type { DisplayBlock, DisplayItem } from "../../display/types";
import { userInputDraftKey, userInputOtherDraftKey } from "../../requests/user-input";
import { userInputDraftKey, userInputOtherDraftKey } from "../../protocol/requests/user-input";
import { pendingRequestMessageNode } from "../pending-request-message";
import { toolResultNode } from "../tool-result";
import { activeAgentRunSummaryBlock, agentRunSummaryNode, workItemNode, type WorkItemDisplayItem } from "../work-items";

View file

@ -1,6 +1,6 @@
import type { ChatState } from "../../chat-state";
import type { PendingRequestSnapshot } from "../../chat-state-selectors";
import { chatTurnBusy } from "../../chat-state";
import type { ChatState } from "../../state/reducer";
import type { PendingRequestSnapshot } from "../../state/selectors";
import { chatTurnBusy } from "../../state/reducer";
import type { DisplayItem } from "../../display/types";
import {
forkCandidatesFromItems,

View file

@ -1,4 +1,4 @@
import type { ChatAction, ChatState } from "../../chat-state";
import type { ChatAction, ChatState } from "../../state/reducer";
import type { ChatMessageStreamActionPort, ChatMessageStreamContextPort, ChatMessageStreamRequestPort } from "./context-builder";
export interface MessageStreamContextPortOptions {

View file

@ -1,7 +1,7 @@
import type { ComponentChild as UiNode } from "preact";
import type { ChatTurnLifecycleState } from "../../chat-state";
import type { PendingRequestSnapshot } from "../../chat-state-selectors";
import type { ChatTurnLifecycleState } from "../../state/reducer";
import type { PendingRequestSnapshot } from "../../state/selectors";
import type { DisplayItem } from "../../display/types";
import type { PendingRequestMessageActions } from "../pending-request-message";
import type { ChatTurnDiffViewState } from "../turn-diff";

View file

@ -1,7 +1,7 @@
import { type ComponentChild as UiNode } from "preact";
import { useEffect, useRef } from "preact/hooks";
import { activeTurnId } from "../../chat-state";
import { activeTurnId } from "../../state/reducer";
import type { DisplayItem } from "../../display/types";
import { IconButton } from "../../../../shared/ui/components";
import type { MessageActionContext, RenderableTextItem } from "./context";

View file

@ -1,4 +1,4 @@
import type { ChatState } from "../../chat-state";
import type { ChatState } from "../../state/reducer";
import type { MessageStreamScrollIntent, MessageStreamVirtualizerHandle } from "../message-virtualizer";
import { messageStreamBlocks } from "./blocks";
import { createMessageStreamContext, type ChatMessageStreamContextPort } from "./context-builder";

View file

@ -2,8 +2,8 @@ import type { App, Component } from "obsidian";
import type { ComponentChild as UiNode } from "preact";
import { copyTextWithNotice } from "../../../../shared/ui/clipboard";
import type { ChatAction, ChatState, ChatStateStore } from "../../chat-state";
import type { ComposerBoundaryScrollAction } from "../../composer/boundary-scroll";
import type { ChatAction, ChatState, ChatStateStore } from "../../state/reducer";
import type { ComposerBoundaryScrollAction } from "../../conversation/composer/boundary-scroll";
import type { MessageStreamScrollIntent, MessageStreamVirtualizerHandle } from "../message-virtualizer";
import type { ChatMessageStreamActionPort, ChatMessageStreamContextPort, ChatMessageStreamRequestPort } from "./context-builder";
import { createMessageStreamContextPort } from "./context-port";

View file

@ -8,9 +8,9 @@ import {
approvalTitle,
type ApprovalAction,
type PendingApproval,
} from "../requests/approval";
import type { PendingUserInput } from "../requests/user-input";
import { questionDefaultAnswer } from "../requests/user-input";
} from "../protocol/requests/approval";
import type { PendingUserInput } from "../protocol/requests/user-input";
import { questionDefaultAnswer } from "../protocol/requests/user-input";
import { createWorkMessageClassName } from "./work-message";
type PendingUserInputRequestId = PendingUserInput["requestId"];

View file

@ -1,12 +1,12 @@
import type { ChatState } from "../chat-state";
import { pendingRequestsSignature as requestStateSignature } from "../requests/view-model";
import type { ChatState } from "../state/reducer";
import { pendingRequestsSignature as requestStateSignature } from "../pending-requests/view-model";
import {
activeComposerThreadName as buildActiveComposerThreadName,
composerMetaViewModel as buildComposerMetaViewModel,
composerPlaceholder as buildComposerPlaceholder,
runtimeComposerChoices,
toolbarViewModel as buildToolbarViewModel,
} from "../panel/model";
} from "../panel/view-model";
import type { GoalBannerActions, GoalBannerOptions } from "./goal-banner";
import type { ChatPanelComposerPorts, ChatPanelGoalPorts, ChatPanelMessagesPorts, ChatPanelToolbarPorts } from "../panel/ui-ports";
import type { ChatPanelShellState } from "./shell";

View file

@ -2,7 +2,7 @@ import { createContext, type ComponentChild as UiNode } from "preact";
import { useContext } from "preact/hooks";
import { signal, type Signal } from "@preact/signals";
import { renderUiRoot, unmountUiRoot } from "../../../shared/ui/ui-root";
import type { ChatState, ChatStateStore } from "../chat-state";
import type { ChatState, ChatStateStore } from "../state/reducer";
export interface ChatPanelShellState {
connection: Signal<ChatState["connection"]>;

View file

@ -3,7 +3,7 @@ import { useLayoutEffect, useRef } from "preact/hooks";
import type { RuntimeConfigSection, RateLimitSummary } from "../runtime/status-summary";
import { IconButton } from "../../../shared/ui/components";
import type { ToolbarDiagnosticSection, ToolbarThreadRow, ToolbarViewModel } from "../panel/model/types";
import type { ToolbarDiagnosticSection, ToolbarThreadRow, ToolbarViewModel } from "../panel/view-model/types";
type ButtonProps = ButtonHTMLAttributes & {
disabled?: boolean | undefined;

View file

@ -13,7 +13,7 @@ import type {
TaskProgressDisplayItem,
} from "../display/types";
import { agentActivityMetaLabel, agentMessagePreview, agentRunSummaryLabel, taskStatusMarker } from "../display/labels";
import { activeTurnId, type ChatTurnLifecycleState } from "../chat-state";
import { activeTurnId, type ChatTurnLifecycleState } from "../state/reducer";
import { createWorkMessageClassName } from "./work-message";
import { shortThreadId, truncate } from "../../../utils";

View file

@ -8,7 +8,7 @@ import type { ModelMetadata } from "../../domain/catalog/metadata";
import type { Thread } from "../../domain/threads/model";
import { collaborationModeLabel as formatCollaborationModeLabel } from "./runtime/turn-settings";
import type { RuntimeSnapshot } from "./runtime/effective-settings";
import { chatTurnBusy, createChatStateStore, type ChatState, type ChatAction } from "./chat-state";
import { chatTurnBusy, createChatStateStore, type ChatState, type ChatAction } from "./state/reducer";
import type { OpenCodexPanelSnapshot } from "../../workspace/open-panel-snapshot";
import type { SharedAppServerMetadata } from "../../app-server/shared-cache-state";
import type { CodexChatHost } from "./chat-host";
@ -21,7 +21,7 @@ import {
modelStatusLines as buildModelStatusLines,
runtimeSnapshotForChatSlices,
statusSummaryLines as buildStatusSummaryLines,
} from "./panel/model";
} from "./panel/view-model";
import { openPanelTurnLifecycle } from "./panel/snapshot";
import { ChatConnectionWorkTracker, ChatResumeWorkTracker, ChatViewDeferredTasks } from "./panel/lifecycle";
import { ChatMessageScrollIntentController } from "./panel/message-scroll-intent-controller";

View file

@ -2,7 +2,7 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { scheduleAppServerWarmup } from "../../../../src/features/chat/session/app-server-warmup-controller";
import { scheduleAppServerWarmup } from "../../../../src/features/chat/connection/app-server-warmup-controller";
import { ChatViewDeferredTasks } from "../../../../src/features/chat/panel/lifecycle";
function createController({

View file

@ -2,13 +2,13 @@ import { describe, expect, it, vi } from "vitest";
import type { AppServerClient } from "../../../../src/app-server/client";
import { emptyRuntimeConfigSnapshot } from "../../../../src/app-server/runtime-config";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/chat-state";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/state/reducer";
import {
ChatConnectionController,
type ChatConnectionAdapter,
type ChatConnectionDiagnosticsPort,
type ChatConnectionMetadataPort,
} from "../../../../src/features/chat/session/connection-controller";
} from "../../../../src/features/chat/connection/connection-controller";
import { ChatConnectionWorkTracker } from "../../../../src/features/chat/panel/lifecycle";
function createController({ connected = false, client = {} as AppServerClient } = {}) {

View file

@ -1,7 +1,7 @@
import { describe, expect, it, vi } from "vitest";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/chat-state";
import { createChatReconnectActions, type ChatReconnectActionsHost } from "../../../../src/features/chat/session/reconnect-actions";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/state/reducer";
import { createChatReconnectActions, type ChatReconnectActionsHost } from "../../../../src/features/chat/connection/reconnect-actions";
function createHost(overrides: Partial<ChatReconnectActionsHost> = {}) {
const stateStore = createChatStateStore(createChatState());

View file

@ -1,6 +1,9 @@
import { describe, expect, it, vi } from "vitest";
import { composerBoundaryScrollDirection, type ComposerBoundaryScrollAction } from "../../../../src/features/chat/composer/boundary-scroll";
import {
composerBoundaryScrollDirection,
type ComposerBoundaryScrollAction,
} from "../../../../../src/features/chat/conversation/composer/boundary-scroll";
describe("composer boundary scroll shortcuts", () => {
it("scrolls up from the first composer line", () => {

View file

@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { isComposerSendKey, type ComposerSendKeyEvent } from "../../../../src/shared/ui/keyboard";
import { isComposerSendKey, type ComposerSendKeyEvent } from "../../../../../src/shared/ui/keyboard";
const baseEvent: ComposerSendKeyEvent = {
key: "Enter",

View file

@ -1,8 +1,8 @@
import { describe, expect, it } from "vitest";
import type { ReasoningEffort } from "../../../../src/generated/app-server/ReasoningEffort";
import type { Thread } from "../../../../src/generated/app-server/v2/Thread";
import type { ModelMetadata } from "../../../../src/domain/catalog/metadata";
import type { ReasoningEffort } from "../../../../../src/generated/app-server/ReasoningEffort";
import type { Thread } from "../../../../../src/generated/app-server/v2/Thread";
import type { ModelMetadata } from "../../../../../src/domain/catalog/metadata";
import {
activeComposerSuggestions,
applyComposerSuggestionInsertion,
@ -11,8 +11,8 @@ import {
findWikiLinkSuggestions,
nextComposerSuggestionIndex,
parseSlashCommand,
} from "../../../../src/features/chat/composer/suggestions";
import { userInputWithWikiLinkMentions } from "../../../../src/features/chat/composer/wikilink-context";
} from "../../../../../src/features/chat/conversation/composer/suggestions";
import { userInputWithWikiLinkMentions } from "../../../../../src/features/chat/conversation/composer/wikilink-context";
function expectPresent<T>(value: T | null | undefined): T {
if (value === null || value === undefined) throw new Error("Expected value to be present");

View file

@ -3,11 +3,11 @@
import type { App } from "obsidian";
import { describe, expect, it, vi } from "vitest";
import { ChatComposerController } from "../../../../src/features/chat/composer/controller";
import { createChatStateStore } from "../../../../src/features/chat/chat-state";
import { renderUiRoot, unmountUiRoot } from "../../../../src/shared/ui/ui-root";
import type { SkillMetadata } from "../../../../src/generated/app-server/v2/SkillMetadata";
import { installObsidianDomShims } from "../../../support/dom";
import { ChatComposerController } from "../../../../../src/features/chat/conversation/composer/controller";
import { createChatStateStore } from "../../../../../src/features/chat/state/reducer";
import { renderUiRoot, unmountUiRoot } from "../../../../../src/shared/ui/ui-root";
import type { SkillMetadata } from "../../../../../src/generated/app-server/v2/SkillMetadata";
import { installObsidianDomShims } from "../../../../support/dom";
installObsidianDomShims();

View file

@ -1,7 +1,7 @@
import { describe, expect, it, vi } from "vitest";
import { TFile, type App } from "obsidian";
import { noteCandidates, resolveWikiLinkMention } from "../../../../src/features/chat/composer/obsidian-context";
import { noteCandidates, resolveWikiLinkMention } from "../../../../../src/features/chat/conversation/composer/obsidian-context";
describe("Obsidian composer context", () => {
it("builds note candidates from markdown files", () => {

View file

@ -5,7 +5,7 @@ import {
parsedWikiLinks,
userInputWithWikiLinkMentions,
userInputWithWikiLinkMentionsAndSkills,
} from "../../../../src/features/chat/composer/wikilink-context";
} from "../../../../../src/features/chat/conversation/composer/wikilink-context";
describe("wikilink context", () => {
it("parses aliases, subpaths, and duplicate links", () => {

View file

@ -1,9 +1,9 @@
import { describe, expect, it, vi } from "vitest";
import type { AppServerClient } from "../../../../src/app-server/client";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/chat-state";
import { createComposerSubmissionActions } from "../../../../src/features/chat/turns/composer-submission-actions";
import type { Thread } from "../../../../src/generated/app-server/v2/Thread";
import type { AppServerClient } from "../../../../../src/app-server/client";
import { createChatState, createChatStateStore } from "../../../../../src/features/chat/state/reducer";
import { createComposerSubmissionActions } from "../../../../../src/features/chat/conversation/turns/composer-submission-actions";
import type { Thread } from "../../../../../src/generated/app-server/v2/Thread";
function thread(id: string): Thread & { archived: boolean } {
return {

View file

@ -1,13 +1,13 @@
import { describe, expect, it, vi } from "vitest";
import type { AppServerClient } from "../../../../src/app-server/client";
import { createChatState, createChatStateStore, type ChatStateStore } from "../../../../src/features/chat/chat-state";
import { implementPlanCandidateFromState } from "../../../../src/features/chat/display/action-candidates";
import type { AppServerClient } from "../../../../../src/app-server/client";
import { createChatState, createChatStateStore, type ChatStateStore } from "../../../../../src/features/chat/state/reducer";
import { implementPlanCandidateFromState } from "../../../../../src/features/chat/display/action-candidates";
import {
createPlanImplementationActions,
type PlanImplementationActionsHost,
} from "../../../../src/features/chat/turns/plan-implementation-actions";
import type { DisplayItem } from "../../../../src/features/chat/display/types";
} from "../../../../../src/features/chat/conversation/turns/plan-implementation-actions";
import type { DisplayItem } from "../../../../../src/features/chat/display/types";
const planItem = (id: string): DisplayItem => ({
id,

View file

@ -1,8 +1,8 @@
import { describe, expect, it, vi } from "vitest";
import type { AppServerClient } from "../../../../src/app-server/client";
import type { CodexInput } from "../../../../src/app-server/request-input";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/chat-state";
import type { AppServerClient } from "../../../../../src/app-server/client";
import type { CodexInput } from "../../../../../src/app-server/request-input";
import { createChatState, createChatStateStore } from "../../../../../src/features/chat/state/reducer";
import {
createSlashCommandActions,
type SlashCommandActionsHost,
@ -10,8 +10,8 @@ import {
type SlashCommandRuntimePort,
type SlashCommandStatusPort,
type SlashCommandThreadPort,
} from "../../../../src/features/chat/turns/slash-command-actions";
import type { Thread } from "../../../../src/generated/app-server/v2/Thread";
} from "../../../../../src/features/chat/conversation/turns/slash-command-actions";
import type { Thread } from "../../../../../src/generated/app-server/v2/Thread";
const textInput = (text: string): CodexInput => [{ type: "text", text }];

View file

@ -1,9 +1,12 @@
import { describe, expect, it, vi } from "vitest";
import type { ThreadGoal } from "../../../../src/app-server/thread-goal";
import { slashCommandHelpLines, slashCommandHelpSections } from "../../../../src/features/chat/composer/slash-commands";
import type { Thread } from "../../../../src/generated/app-server/v2/Thread";
import { executeSlashCommand, type SlashCommandExecutionContext } from "../../../../src/features/chat/turns/slash-command-execution";
import type { ThreadGoal } from "../../../../../src/app-server/thread-goal";
import { slashCommandHelpLines, slashCommandHelpSections } from "../../../../../src/features/chat/conversation/composer/slash-commands";
import type { Thread } from "../../../../../src/generated/app-server/v2/Thread";
import {
executeSlashCommand,
type SlashCommandExecutionContext,
} from "../../../../../src/features/chat/conversation/turns/slash-command-execution";
function context(overrides: Partial<SlashCommandExecutionContext> = {}): SlashCommandExecutionContext {
return {

View file

@ -1,8 +1,8 @@
import { describe, expect, it, vi } from "vitest";
import type { AppServerClient } from "../../../../src/app-server/client";
import type { CodexInput } from "../../../../src/app-server/request-input";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/chat-state";
import type { AppServerClient } from "../../../../../src/app-server/client";
import type { CodexInput } from "../../../../../src/app-server/request-input";
import { createChatState, createChatStateStore } from "../../../../../src/features/chat/state/reducer";
import {
TurnSubmissionController,
type TurnSubmissionControllerHost,
@ -13,8 +13,8 @@ import {
type TurnSubmissionStatusPort,
type TurnSubmissionThreadPort,
type TurnSubmissionViewPort,
} from "../../../../src/features/chat/turns/turn-submission-controller";
import type { Thread } from "../../../../src/generated/app-server/v2/Thread";
} from "../../../../../src/features/chat/conversation/turns/turn-submission-controller";
import type { Thread } from "../../../../../src/generated/app-server/v2/Thread";
const textInput = (text: string): CodexInput => [{ type: "text", text }];

View file

@ -7,8 +7,8 @@ import {
localUserMessageItemFromInput,
optimisticTurnStart,
shouldAcknowledgeTurnStart,
} from "../../../../src/features/chat/turns/turn-submission";
import type { DisplayItem } from "../../../../src/features/chat/display/types";
} from "../../../../../src/features/chat/conversation/turns/turn-submission";
import type { DisplayItem } from "../../../../../src/features/chat/display/types";
describe("chat turn submission helpers", () => {
it("builds local user messages without sharing mentioned file arrays", () => {

View file

@ -23,7 +23,7 @@ import {
patchApplyExecutionState,
taskProgressExecutionState,
} from "../../../../src/features/chat/display/state";
import { displayItemFromThreadItem, displayItemsFromTurns } from "../../../../src/features/chat/display/thread-items";
import { displayItemFromThreadItem, displayItemsFromTurns } from "../../../../src/features/chat/protocol/display-items";
import { referencedThreadPrompt } from "../../../../src/domain/threads/reference";
import type { DisplayItem } from "../../../../src/features/chat/display/types";
import type { Thread } from "../../../../src/generated/app-server/v2/Thread";

View file

@ -4,12 +4,12 @@ import { describe, expect, it, vi } from "vitest";
import type { App, Component, EventRef } from "obsidian";
import type { RuntimeSnapshot } from "../../../../src/features/chat/runtime/effective-settings";
import { createChatStateStore } from "../../../../src/features/chat/chat-state";
import { createChatStateStore } from "../../../../src/features/chat/state/reducer";
import { createChatViewControllers } from "../../../../src/features/chat/panel/composition";
import type { ChatControllerCompositionPorts } from "../../../../src/features/chat/panel/controller-ports";
import { ChatConnectionWorkTracker, ChatResumeWorkTracker, ChatViewDeferredTasks } from "../../../../src/features/chat/panel/lifecycle";
import { ChatMessageScrollIntentController } from "../../../../src/features/chat/panel/message-scroll-intent-controller";
import type { ComposerMetaViewModel } from "../../../../src/features/chat/panel/model";
import type { ComposerMetaViewModel } from "../../../../src/features/chat/panel/view-model";
import { DEFAULT_SETTINGS } from "../../../../src/settings/model";
describe("createChatViewControllers", () => {

View file

@ -2,7 +2,7 @@
import { describe, expect, it, vi } from "vitest";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/chat-state";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/state/reducer";
import { createToolbarArchiveConfirmState } from "../../../../src/features/chat/panel/toolbar-archive-confirm-state";
import { ToolbarPanelController } from "../../../../src/features/chat/panel/toolbar-controller";
import type { ChatThreadActions } from "../../../../src/features/chat/threads/thread-actions";

View file

@ -1,9 +1,9 @@
import { describe, expect, it, vi } from "vitest";
import { ChatInboundController } from "../../../../src/features/chat/inbound/controller";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/chat-state";
import { PendingRequestController } from "../../../../src/features/chat/requests/pending-request-controller";
import { toPendingUserInput } from "../../../../src/features/chat/requests/user-input";
import { ChatInboundController } from "../../../../src/features/chat/protocol/inbound/controller";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/state/reducer";
import { PendingRequestController } from "../../../../src/features/chat/pending-requests/controller";
import { toPendingUserInput } from "../../../../src/features/chat/protocol/requests/user-input";
import type { ServerRequest } from "../../../../src/generated/app-server/ServerRequest";
function expectPresent<T>(value: T | null | undefined): T {

View file

@ -1,16 +1,16 @@
import { describe, expect, it, vi } from "vitest";
import type { AppServerClient } from "../../../src/app-server/client";
import type { RateLimitSnapshot } from "../../../src/app-server/runtime-metrics";
import { threadFromAppServerThread } from "../../../src/app-server/thread-model";
import { createChatServerDiagnosticsActions } from "../../../src/features/chat/server-actions/diagnostics-actions";
import { createChatServerMetadataActions } from "../../../src/features/chat/server-actions/metadata-actions";
import { createChatServerThreadActions } from "../../../src/features/chat/server-actions/thread-actions";
import { createChatState, createChatStateStore } from "../../../src/features/chat/chat-state";
import type { Model } from "../../../src/generated/app-server/v2/Model";
import type { McpServerStatus } from "../../../src/generated/app-server/v2/McpServerStatus";
import type { SkillMetadata } from "../../../src/generated/app-server/v2/SkillMetadata";
import type { Thread } from "../../../src/generated/app-server/v2/Thread";
import type { AppServerClient } from "../../../../src/app-server/client";
import type { RateLimitSnapshot } from "../../../../src/app-server/runtime-metrics";
import { threadFromAppServerThread } from "../../../../src/app-server/thread-model";
import { createChatServerDiagnosticsActions } from "../../../../src/features/chat/protocol/client-actions/diagnostics-actions";
import { createChatServerMetadataActions } from "../../../../src/features/chat/protocol/client-actions/metadata-actions";
import { createChatServerThreadActions } from "../../../../src/features/chat/protocol/client-actions/thread-actions";
import { createChatState, createChatStateStore } from "../../../../src/features/chat/state/reducer";
import type { Model } from "../../../../src/generated/app-server/v2/Model";
import type { McpServerStatus } from "../../../../src/generated/app-server/v2/McpServerStatus";
import type { SkillMetadata } from "../../../../src/generated/app-server/v2/SkillMetadata";
import type { Thread } from "../../../../src/generated/app-server/v2/Thread";
describe("chat server actions", () => {
it("publishes newly started threads before the first turn completes", async () => {

Some files were not shown because too many files have changed in this diff Show more