From 439aca3eb02e11e718d3e6011757f86bb294a8d4 Mon Sep 17 00:00:00 2001 From: murashit Date: Wed, 24 Jun 2026 06:30:23 +0900 Subject: [PATCH] Remove unnecessary re-exports --- src/app-server/protocol/server-requests.ts | 2 +- src/app-server/services/thread-archive-markdown.ts | 2 +- src/features/chat/app-server/inbound/handler.ts | 3 ++- .../chat/app-server/inbound/notification-plan.ts | 10 +++------- .../app-server/mappers/message-stream/agent-items.ts | 2 +- .../mappers/message-stream/hook-run-items.ts | 2 +- .../app-server/mappers/message-stream/turn-items.ts | 3 ++- src/features/chat/application/composer/suggestions.ts | 2 +- .../application/conversation/optimistic-turn-start.ts | 2 +- .../application/conversation/plan-implementation.ts | 7 ++++--- .../conversation/slash-command-execution.ts | 2 +- .../application/conversation/slash-command-executor.ts | 2 +- .../chat/application/conversation/submission-state.ts | 3 ++- .../chat/application/pending-requests/block.ts | 2 -- .../pending-requests/pending-request-actions.ts | 8 ++------ src/features/chat/application/state/root-reducer.ts | 7 ------- .../chat/application/threads/rename-editor-actions.ts | 9 ++------- .../application/threads/start-new-thread-actions.ts | 2 +- .../chat/application/threads/state-selectors.ts | 3 ++- .../application/threads/thread-management-actions.ts | 3 ++- src/features/chat/panel/shell-state.tsx | 3 ++- .../chat/panel/surface/message-stream-projection.ts | 3 ++- .../chat/presentation/message-stream/detail-view.ts | 3 ++- .../chat/presentation/message-stream/status-view.ts | 2 +- src/features/chat/presentation/runtime/status.ts | 2 +- src/features/chat/ui/turn-diff/render.tsx | 2 +- src/features/thread-picker/modal.ts | 2 +- src/features/threads-view/view.ts | 2 -- src/plugin-runtime.ts | 3 ++- src/settings/archived-section.tsx | 2 +- src/utils.ts | 4 ---- tests/features/chat/protocol/inbound/handler.test.ts | 8 ++------ tests/features/chat/state-reducer.test.ts | 7 +++---- tests/features/chat/support/shell-state.ts | 3 ++- 34 files changed, 50 insertions(+), 72 deletions(-) diff --git a/src/app-server/protocol/server-requests.ts b/src/app-server/protocol/server-requests.ts index 814eb235..3c387933 100644 --- a/src/app-server/protocol/server-requests.ts +++ b/src/app-server/protocol/server-requests.ts @@ -13,7 +13,7 @@ import type { PendingUserInput, } from "../../domain/pending-requests/model"; import { pathRelativeToRoot } from "../../shared/path/file-paths"; -import { jsonPreview } from "../../utils"; +import { jsonPreview } from "../../shared/text/preview"; type AppServerRequestByMethod = Extract; diff --git a/src/app-server/services/thread-archive-markdown.ts b/src/app-server/services/thread-archive-markdown.ts index 824de3d3..012097db 100644 --- a/src/app-server/services/thread-archive-markdown.ts +++ b/src/app-server/services/thread-archive-markdown.ts @@ -5,7 +5,7 @@ import { type ArchiveExportSettings, type ArchiveThreadInput, } from "../../domain/threads/archive-markdown"; -import { shortThreadId } from "../../utils"; +import { shortThreadId } from "../../shared/id/thread-id"; export interface ArchiveExportResult { path: string; diff --git a/src/features/chat/app-server/inbound/handler.ts b/src/features/chat/app-server/inbound/handler.ts index 20929ef2..46648ece 100644 --- a/src/features/chat/app-server/inbound/handler.ts +++ b/src/features/chat/app-server/inbound/handler.ts @@ -9,7 +9,8 @@ import type { ThreadCatalogEvent } from "../../../../workspace/thread-catalog"; import type { AppServerResourceEvent } from "../actions/metadata"; import type { LocalIdSource } from "../../../../shared/id/local-id"; import { classifyAppServerLog } from "./app-server-logs"; -import { activeTurnId, type ChatAction, type ChatState } from "../../application/state/root-reducer"; +import { activeTurnId } from "../../application/conversation/turn-state"; +import type { ChatAction, ChatState } from "../../application/state/root-reducer"; import type { ChatStateStore } from "../../application/state/store"; import type { MessageStreamNoticeSection } from "../../domain/message-stream/items"; import { createStructuredSystemItem, createSystemItem } from "../../domain/message-stream/factories/system-items"; diff --git a/src/features/chat/app-server/inbound/notification-plan.ts b/src/features/chat/app-server/inbound/notification-plan.ts index 0995e380..89efaa4f 100644 --- a/src/features/chat/app-server/inbound/notification-plan.ts +++ b/src/features/chat/app-server/inbound/notification-plan.ts @@ -6,13 +6,9 @@ import type { ServerNotification } from "../../../../app-server/connection/rpc-m import { normalizeExplicitThreadName } from "../../../../domain/threads/model"; import type { ThreadConversationSummary } from "../../../../domain/threads/transcript"; import type { ThreadCatalogEvent } from "../../../../workspace/thread-catalog"; -import { jsonPreview } from "../../../../utils"; -import { - activeTurnId, - pendingTurnStart as pendingTurnStartForState, - type ChatAction, - type ChatState, -} from "../../application/state/root-reducer"; +import { jsonPreview } from "../../../../shared/text/preview"; +import { activeTurnId, pendingTurnStart as pendingTurnStartForState } from "../../application/conversation/turn-state"; +import type { ChatAction, ChatState } from "../../application/state/root-reducer"; import { completeReasoningItems, upsertMessageStreamItemById } from "../../domain/message-stream/updates"; import { messageStreamItemFromTurnItem, diff --git a/src/features/chat/app-server/mappers/message-stream/agent-items.ts b/src/features/chat/app-server/mappers/message-stream/agent-items.ts index 57678ce4..272388f5 100644 --- a/src/features/chat/app-server/mappers/message-stream/agent-items.ts +++ b/src/features/chat/app-server/mappers/message-stream/agent-items.ts @@ -1,4 +1,4 @@ -import { definedProp } from "../../../../../utils"; +import { definedProp } from "../../../../../shared/object/defined-prop"; import type { AgentMessageStreamItem, AgentStateSummary, ExecutionState } from "../../../domain/message-stream/items"; import { collabAgentStateExecutionState } from "../../../domain/message-stream/agent-state"; import { diff --git a/src/features/chat/app-server/mappers/message-stream/hook-run-items.ts b/src/features/chat/app-server/mappers/message-stream/hook-run-items.ts index 6876230b..44445e27 100644 --- a/src/features/chat/app-server/mappers/message-stream/hook-run-items.ts +++ b/src/features/chat/app-server/mappers/message-stream/hook-run-items.ts @@ -1,4 +1,4 @@ -import { definedProp } from "../../../../../utils"; +import { definedProp } from "../../../../../shared/object/defined-prop"; import type { ExecutionState, HookMessageStreamItem } from "../../../domain/message-stream/items"; import { executionStateFromStatus, diff --git a/src/features/chat/app-server/mappers/message-stream/turn-items.ts b/src/features/chat/app-server/mappers/message-stream/turn-items.ts index 05d5ec17..395ff212 100644 --- a/src/features/chat/app-server/mappers/message-stream/turn-items.ts +++ b/src/features/chat/app-server/mappers/message-stream/turn-items.ts @@ -2,7 +2,8 @@ import type { CommandMessageStreamTarget, MessageStreamDiagnosticSection, Messag import type { MessageStreamItemProvenance } from "../../../domain/message-stream/provenance"; import type { HistoricalTurn } from "../../../../../domain/threads/history"; import type { TurnItem } from "../../../../../app-server/protocol/turn"; -import { definedProp, jsonPreview } from "../../../../../utils"; +import { definedProp } from "../../../../../shared/object/defined-prop"; +import { jsonPreview } from "../../../../../shared/text/preview"; import { referencedThreadMetadataFromPrompt } from "../../../../../domain/threads/reference"; import { turnUserItemText } from "../../../../../app-server/protocol/turn"; import { agentMessageStreamItem } from "./agent-items"; diff --git a/src/features/chat/application/composer/suggestions.ts b/src/features/chat/application/composer/suggestions.ts index 7aaec76f..67ffb799 100644 --- a/src/features/chat/application/composer/suggestions.ts +++ b/src/features/chat/application/composer/suggestions.ts @@ -5,7 +5,7 @@ import { findModelMetadataByIdOrName, sortedModelMetadata } from "../../../../do import { supportedEffortsForModelMetadata } from "../../../../domain/catalog/metadata"; import { SLASH_COMMANDS, slashCommandSubcommands, type SlashCommandName } from "./slash-commands"; import { threadDisplayTitle } from "../../../../domain/threads/title"; -import { shortThreadId } from "../../../../utils"; +import { shortThreadId } from "../../../../shared/id/thread-id"; export interface ComposerSuggestion { display: string; diff --git a/src/features/chat/application/conversation/optimistic-turn-start.ts b/src/features/chat/application/conversation/optimistic-turn-start.ts index 7787d89b..eb12095d 100644 --- a/src/features/chat/application/conversation/optimistic-turn-start.ts +++ b/src/features/chat/application/conversation/optimistic-turn-start.ts @@ -1,4 +1,4 @@ -import type { PendingTurnStart } from "../state/root-reducer"; +import type { PendingTurnStart } from "./turn-state"; import type { MessageStreamFileMention, MessageStreamItem, MessageStreamMessageItem } from "../../domain/message-stream/items"; import type { MessageStreamItemProvenance } from "../../domain/message-stream/provenance"; import { fileMentionsFromInput } from "../../domain/message-stream/format/file-mentions"; diff --git a/src/features/chat/application/conversation/plan-implementation.ts b/src/features/chat/application/conversation/plan-implementation.ts index 42526ccf..cbaa2ff5 100644 --- a/src/features/chat/application/conversation/plan-implementation.ts +++ b/src/features/chat/application/conversation/plan-implementation.ts @@ -1,9 +1,10 @@ import type { AppServerClient } from "../../../../app-server/connection/client"; import { latestImplementablePlanTargetFromItems, type PlanImplementationTarget } from "../../domain/message-stream/selectors"; +import type { ChatRuntimeState } from "../../domain/runtime/state"; import type { ChatStateStore } from "../state/store"; -import type { ChatActiveThreadState, ChatMessageStreamState, ChatRuntimeState, ChatState, ChatTurnState } from "../state/root-reducer"; -import { chatTurnBusy } from "../state/root-reducer"; -import { messageStreamItems } from "../state/message-stream"; +import { chatTurnBusy, type ChatTurnState } from "./turn-state"; +import type { ChatActiveThreadState, ChatState } from "../state/root-reducer"; +import { messageStreamItems, type ChatMessageStreamState } from "../state/message-stream"; const IMPLEMENT_PLAN_PROMPT = "Please implement this plan."; diff --git a/src/features/chat/application/conversation/slash-command-execution.ts b/src/features/chat/application/conversation/slash-command-execution.ts index b8dc7517..8e7ab8b1 100644 --- a/src/features/chat/application/conversation/slash-command-execution.ts +++ b/src/features/chat/application/conversation/slash-command-execution.ts @@ -5,7 +5,7 @@ import { normalizeReasoningEffort } from "../../../../domain/catalog/metadata"; import type { Thread } from "../../../../domain/threads/model"; import { threadDisplayTitle } from "../../../../domain/threads/title"; import type { ReferencedThreadMetadata } from "../../../../domain/threads/reference"; -import { shortThreadId } from "../../../../utils"; +import { shortThreadId } from "../../../../shared/id/thread-id"; import type { ChatRuntimeSettingsActions } from "../runtime/settings-actions"; import type { GoalActions } from "../threads/goal-actions"; import type { ThreadManagementActions } from "../threads/thread-management-actions"; diff --git a/src/features/chat/application/conversation/slash-command-executor.ts b/src/features/chat/application/conversation/slash-command-executor.ts index 2b8e4ac5..1ee0fb4e 100644 --- a/src/features/chat/application/conversation/slash-command-executor.ts +++ b/src/features/chat/application/conversation/slash-command-executor.ts @@ -3,7 +3,7 @@ import { codexTextInputWithAttachments, type CodexInput } from "../../../../doma import { readReferencedThreadConversationSummaries } from "../../../../app-server/threads"; import { referencedThreadPromptBundle, REFERENCED_THREAD_TURN_LIMIT } from "../../../../domain/threads/reference"; import type { Thread } from "../../../../domain/threads/model"; -import { shortThreadId } from "../../../../utils"; +import { shortThreadId } from "../../../../shared/id/thread-id"; import { executeSlashCommand as runSlashCommand, type SlashCommandExecutionPorts, diff --git a/src/features/chat/application/conversation/submission-state.ts b/src/features/chat/application/conversation/submission-state.ts index 6aa572d1..f1ef20e2 100644 --- a/src/features/chat/application/conversation/submission-state.ts +++ b/src/features/chat/application/conversation/submission-state.ts @@ -1,6 +1,7 @@ import type { Thread } from "../../../../domain/threads/model"; import type { MessageStreamItem } from "../../domain/message-stream/items"; -import { activeTurnId, chatTurnBusy, pendingTurnStart, type ChatState, type PendingTurnStart } from "../state/root-reducer"; +import { activeTurnId, chatTurnBusy, pendingTurnStart, type PendingTurnStart } from "./turn-state"; +import type { ChatState } from "../state/root-reducer"; import { messageStreamItems } from "../state/message-stream"; export interface SubmissionStateSnapshot { diff --git a/src/features/chat/application/pending-requests/block.ts b/src/features/chat/application/pending-requests/block.ts index f1bc3d6c..6c4edf29 100644 --- a/src/features/chat/application/pending-requests/block.ts +++ b/src/features/chat/application/pending-requests/block.ts @@ -9,8 +9,6 @@ import type { import type { ChatRequestState } from "./state"; import type { ChatUiState } from "../state/ui-state"; -export type { PendingRequestId } from "../../../../domain/pending-requests/model"; - export interface PendingRequestBlockState { approvals: readonly PendingApproval[]; pendingUserInputs: readonly PendingUserInput[]; diff --git a/src/features/chat/application/pending-requests/pending-request-actions.ts b/src/features/chat/application/pending-requests/pending-request-actions.ts index 61a13d75..6eaffec1 100644 --- a/src/features/chat/application/pending-requests/pending-request-actions.ts +++ b/src/features/chat/application/pending-requests/pending-request-actions.ts @@ -6,15 +6,11 @@ import { type McpElicitationAction, type PendingApproval, type PendingMcpElicitation, + type PendingRequestId, type PendingUserInput, } from "../../../../domain/pending-requests/model"; import { approvalDetailsDisclosureId } from "../../domain/pending-requests/disclosure-ids"; -import { - pendingRequestBlockStateFromChatState, - type PendingRequestBlockActions, - type PendingRequestBlockState, - type PendingRequestId, -} from "./block"; +import { pendingRequestBlockStateFromChatState, type PendingRequestBlockActions, type PendingRequestBlockState } from "./block"; interface PendingRequestResponder { resolveApproval: (requestId: PendingRequestId, action: ApprovalAction) => void; diff --git a/src/features/chat/application/state/root-reducer.ts b/src/features/chat/application/state/root-reducer.ts index 1d204b20..7bb773e9 100644 --- a/src/features/chat/application/state/root-reducer.ts +++ b/src/features/chat/application/state/root-reducer.ts @@ -79,11 +79,6 @@ import { } from "./ui-state"; import { definedPatch, patchObject } from "./patch"; -export { activeTurnId, chatTurnBusy, pendingTurnStart, type ChatTurnState, type PendingTurnStart } from "../conversation/turn-state"; -export type { ChatMessageStreamState } from "./message-stream"; -export type { ChatDisclosureBucket, ChatDisclosureUiState, ChatRenameGeneratingUiState, ChatRenameUiState } from "./ui-state"; -export { renameGenerationStillActive } from "./ui-state"; - export type ChatConnectionPhase = | { kind: "idle" } | { kind: "connecting" } @@ -118,8 +113,6 @@ export interface ChatActiveThreadState { readonly tokenUsage: ThreadTokenUsage | null; } -export type { ChatRuntimeState } from "../../domain/runtime/state"; - interface ChatComposerState { readonly draft: string; readonly suggestSelected: number; diff --git a/src/features/chat/application/threads/rename-editor-actions.ts b/src/features/chat/application/threads/rename-editor-actions.ts index 9afe998b..84bf67e9 100644 --- a/src/features/chat/application/threads/rename-editor-actions.ts +++ b/src/features/chat/application/threads/rename-editor-actions.ts @@ -3,13 +3,8 @@ import { threadRenameDraftTitle } from "../../../../domain/threads/title"; import type { ThreadTitleContext } from "../../../../domain/threads/title-generation-model"; import type { ThreadOperations } from "../../../threads/thread-operations"; import type { ThreadTitleService } from "../../../threads/thread-title-service"; -import { - renameGenerationStillActive, - type ChatAction, - type ChatRenameGeneratingUiState, - type ChatRenameUiState, - type ChatState, -} from "../state/root-reducer"; +import type { ChatAction, ChatState } from "../state/root-reducer"; +import { renameGenerationStillActive, type ChatRenameGeneratingUiState, type ChatRenameUiState } from "../state/ui-state"; import type { ChatStateStore } from "../state/store"; import { messageStreamItems } from "../state/message-stream"; import { firstThreadTitleContextFromMessageStreamItems } from "./title-context"; diff --git a/src/features/chat/application/threads/start-new-thread-actions.ts b/src/features/chat/application/threads/start-new-thread-actions.ts index 3c409d81..f7be9dbf 100644 --- a/src/features/chat/application/threads/start-new-thread-actions.ts +++ b/src/features/chat/application/threads/start-new-thread-actions.ts @@ -1,5 +1,5 @@ import type { ActiveThreadIdentitySync } from "./active-thread-identity-sync"; -import { chatTurnBusy } from "../state/root-reducer"; +import { chatTurnBusy } from "../conversation/turn-state"; import type { ChatStateStore } from "../state/store"; export interface StartNewThreadActions { diff --git a/src/features/chat/application/threads/state-selectors.ts b/src/features/chat/application/threads/state-selectors.ts index 6a52fdff..be0bd991 100644 --- a/src/features/chat/application/threads/state-selectors.ts +++ b/src/features/chat/application/threads/state-selectors.ts @@ -1,5 +1,6 @@ import type { Thread } from "../../../../domain/threads/model"; -import { chatTurnBusy, type ChatState } from "../state/root-reducer"; +import { chatTurnBusy } from "../conversation/turn-state"; +import type { ChatState } from "../state/root-reducer"; import { messageStreamIsEmpty } from "../state/message-stream"; export function activeThreadId(state: ChatState): string | null { diff --git a/src/features/chat/application/threads/thread-management-actions.ts b/src/features/chat/application/threads/thread-management-actions.ts index 659d540f..1a9c0b08 100644 --- a/src/features/chat/application/threads/thread-management-actions.ts +++ b/src/features/chat/application/threads/thread-management-actions.ts @@ -6,7 +6,8 @@ import type { ThreadOperations } from "../../../threads/thread-operations"; import { messageStreamItemsFromTurns } from "../../app-server/mappers/message-stream/turn-items"; import { resumedThreadActionFromActiveRuntime } from "../state/actions"; import { messageStreamRollbackCandidate, messageStreamTurnsAfterTurnId } from "../state/message-stream"; -import { chatTurnBusy, type ChatAction, type ChatState } from "../state/root-reducer"; +import { chatTurnBusy } from "../conversation/turn-state"; +import type { ChatAction, ChatState } from "../state/root-reducer"; import type { ChatStateStore } from "../state/store"; const STATUS_COMPACTION_REQUESTED = "Compaction requested."; diff --git a/src/features/chat/panel/shell-state.tsx b/src/features/chat/panel/shell-state.tsx index a64778a8..c73c9252 100644 --- a/src/features/chat/panel/shell-state.tsx +++ b/src/features/chat/panel/shell-state.tsx @@ -5,7 +5,8 @@ import { batch, computed, signal, type ReadonlySignal, type Signal } from "@prea import type { RuntimeSnapshot } from "../domain/runtime/snapshot"; import { messageItemsHaveThreadTurns, runtimeSnapshotForChatSlices } from "../application/runtime/snapshot"; import { implementPlanTargetFromState } from "../application/conversation/plan-implementation"; -import { activeTurnId, chatTurnBusy, type ChatState } from "../application/state/root-reducer"; +import { activeTurnId, chatTurnBusy } from "../application/conversation/turn-state"; +import type { ChatState } from "../application/state/root-reducer"; import { messageStreamActiveItems, messageStreamItems, diff --git a/src/features/chat/panel/surface/message-stream-projection.ts b/src/features/chat/panel/surface/message-stream-projection.ts index 581646f5..76192d2e 100644 --- a/src/features/chat/panel/surface/message-stream-projection.ts +++ b/src/features/chat/panel/surface/message-stream-projection.ts @@ -1,4 +1,5 @@ -import type { ChatAction, ChatDisclosureBucket, ChatDisclosureUiState } from "../../application/state/root-reducer"; +import type { ChatAction } from "../../application/state/root-reducer"; +import type { ChatDisclosureBucket, ChatDisclosureUiState } from "../../application/state/ui-state"; import { messageStreamViewBlocks, type MessageStreamViewBlock } from "../../presentation/message-stream/view-model"; import { messageStreamSegmentsEmpty, type ForkCandidate, type PlanImplementationTarget } from "../../domain/message-stream/selectors"; import type { MessageStreamRollbackCandidate } from "../../application/state/message-stream"; diff --git a/src/features/chat/presentation/message-stream/detail-view.ts b/src/features/chat/presentation/message-stream/detail-view.ts index 657c5804..4b797940 100644 --- a/src/features/chat/presentation/message-stream/detail-view.ts +++ b/src/features/chat/presentation/message-stream/detail-view.ts @@ -1,4 +1,5 @@ -import { shortThreadId, truncate } from "../../../../utils"; +import { shortThreadId } from "../../../../shared/id/thread-id"; +import { truncate } from "../../../../shared/text/preview"; import { failedStatusLabel } from "../../domain/message-stream/execution-state"; import { pathRelativeToRoot } from "../../../../shared/path/file-paths"; import type { diff --git a/src/features/chat/presentation/message-stream/status-view.ts b/src/features/chat/presentation/message-stream/status-view.ts index e3f094cd..5e3442e2 100644 --- a/src/features/chat/presentation/message-stream/status-view.ts +++ b/src/features/chat/presentation/message-stream/status-view.ts @@ -1,4 +1,4 @@ -import { shortThreadId } from "../../../../utils"; +import { shortThreadId } from "../../../../shared/id/thread-id"; import { messageStreamReasoningIsActive } from "../../domain/message-stream/semantics/active-turn"; import type { AgentRunSummary, diff --git a/src/features/chat/presentation/runtime/status.ts b/src/features/chat/presentation/runtime/status.ts index 61300e1f..200a2156 100644 --- a/src/features/chat/presentation/runtime/status.ts +++ b/src/features/chat/presentation/runtime/status.ts @@ -1,6 +1,6 @@ import type { RuntimeConfigSnapshot } from "../../../../domain/runtime/config"; import type { RateLimitWindow, SpendControlLimitSnapshot, ThreadTokenUsage } from "../../../../domain/runtime/metrics"; -import { jsonPreview } from "../../../../utils"; +import { jsonPreview } from "../../../../shared/text/preview"; import { currentServiceTier, currentModel, diff --git a/src/features/chat/ui/turn-diff/render.tsx b/src/features/chat/ui/turn-diff/render.tsx index 00e1a600..387b07be 100644 --- a/src/features/chat/ui/turn-diff/render.tsx +++ b/src/features/chat/ui/turn-diff/render.tsx @@ -5,7 +5,7 @@ import { renderDisplayDiffLines } from "../../../../shared/diff/render"; import { displayDiffLines } from "../../../../shared/diff/unified"; import { IconButton } from "../../../../shared/ui/components"; import { renderUiRoot } from "../../../../shared/ui/ui-root"; -import { shortThreadId } from "../../../../utils"; +import { shortThreadId } from "../../../../shared/id/thread-id"; import type { ChatTurnDiffViewState, PersistedChatTurnDiffViewState } from "../../domain/turn-diff"; export interface ChatTurnDiffViewActions { diff --git a/src/features/thread-picker/modal.ts b/src/features/thread-picker/modal.ts index 4f90f352..839b3e55 100644 --- a/src/features/thread-picker/modal.ts +++ b/src/features/thread-picker/modal.ts @@ -2,7 +2,7 @@ import { Notice, Platform, SuggestModal, type App } from "obsidian"; import { threadRecencyAt, type Thread } from "../../domain/threads/model"; import { threadDisplayTitle } from "../../domain/threads/title"; -import { shortThreadId } from "../../utils"; +import { shortThreadId } from "../../shared/id/thread-id"; import type { ThreadCatalogActiveReader } from "../../workspace/thread-catalog"; export interface ThreadPickerHost { diff --git a/src/features/threads-view/view.ts b/src/features/threads-view/view.ts index 81229084..c46559c1 100644 --- a/src/features/threads-view/view.ts +++ b/src/features/threads-view/view.ts @@ -3,8 +3,6 @@ import { ItemView, type WorkspaceLeaf } from "obsidian"; import { VIEW_TYPE_CODEX_THREADS } from "../../constants"; import { CodexThreadsSession, type CodexThreadsHost } from "./session"; -export type { CodexThreadsHost, CodexThreadsSettingsAccess } from "./session"; - export class CodexThreadsView extends ItemView { private readonly session: CodexThreadsSession; diff --git a/src/plugin-runtime.ts b/src/plugin-runtime.ts index 01d4a858..78cebb31 100644 --- a/src/plugin-runtime.ts +++ b/src/plugin-runtime.ts @@ -19,7 +19,8 @@ import { persistedChatTurnDiffViewState } from "./features/chat/domain/turn-diff import { CodexChatTurnDiffView } from "./features/chat/ui/turn-diff/view"; import { openThreadPicker, type ThreadPickerHost } from "./features/thread-picker/modal"; import { archiveExportSettings } from "./features/threads/archive-export-settings"; -import { CodexThreadsView, type CodexThreadsHost, type CodexThreadsSettingsAccess } from "./features/threads-view/view"; +import type { CodexThreadsHost, CodexThreadsSettingsAccess } from "./features/threads-view/session"; +import { CodexThreadsView } from "./features/threads-view/view"; import type { CodexPanelSettingTabHost } from "./settings/host"; import { WorkspacePanelCoordinator } from "./workspace/panel-coordinator"; import { createThreadCatalog, type ThreadCatalog } from "./workspace/thread-catalog"; diff --git a/src/settings/archived-section.tsx b/src/settings/archived-section.tsx index 599bf538..5bc1ac59 100644 --- a/src/settings/archived-section.tsx +++ b/src/settings/archived-section.tsx @@ -3,7 +3,7 @@ import type { ComponentChild as UiNode } from "preact"; import type { Thread } from "../domain/threads/model"; import { threadArchiveDisplayTitle } from "../domain/threads/title"; import { ObsidianExtraButton, ObsidianTextInput, ObsidianToggle } from "../shared/ui/components"; -import { shortThreadId } from "../utils"; +import { shortThreadId } from "../shared/id/thread-id"; import type { ArchivedThreadSectionState } from "./section-state"; import { SettingRow, SettingsGroup, SettingsHeading, SettingsItems, SettingsStatusRow } from "./setting-components"; diff --git a/src/utils.ts b/src/utils.ts index 8be83458..dece0485 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,7 +1,3 @@ -export { definedProp } from "./shared/object/defined-prop"; -export { jsonPreview, truncate } from "./shared/text/preview"; -export { shortThreadId } from "./shared/id/thread-id"; - export function errorMessage(error: unknown): string { return error instanceof Error ? error.message : String(error); } diff --git a/tests/features/chat/protocol/inbound/handler.test.ts b/tests/features/chat/protocol/inbound/handler.test.ts index e921da40..9505b804 100644 --- a/tests/features/chat/protocol/inbound/handler.test.ts +++ b/tests/features/chat/protocol/inbound/handler.test.ts @@ -6,12 +6,8 @@ import { type ChatInboundHandlerActions, } from "../../../../../src/features/chat/app-server/inbound/handler"; import { attachHookRunsToTurn } from "../../../../../src/features/chat/domain/message-stream/updates"; -import { - chatReducer, - pendingTurnStart, - type ChatAction, - type ChatState, -} from "../../../../../src/features/chat/application/state/root-reducer"; +import { chatReducer, type ChatAction, type ChatState } from "../../../../../src/features/chat/application/state/root-reducer"; +import { pendingTurnStart } from "../../../../../src/features/chat/application/conversation/turn-state"; import type { ChatStateStore } from "../../../../../src/features/chat/application/state/store"; import type { ServerNotification, ServerRequest } from "../../../../../src/app-server/connection/rpc-messages"; import { appServerApprovalRequest, appServerUserInputRequest } from "../../../../../src/app-server/protocol/server-requests"; diff --git a/tests/features/chat/state-reducer.test.ts b/tests/features/chat/state-reducer.test.ts index dae08f44..31fc8ab8 100644 --- a/tests/features/chat/state-reducer.test.ts +++ b/tests/features/chat/state-reducer.test.ts @@ -2,12 +2,11 @@ import { describe, expect, it } from "vitest"; import { activeTurnId, - chatReducer, chatTurnBusy, pendingTurnStart, - type ChatState, -} from "../../../src/features/chat/application/state/root-reducer"; -import { transitionChatTurnLifecycleState } from "../../../src/features/chat/application/conversation/turn-state"; + transitionChatTurnLifecycleState, +} from "../../../src/features/chat/application/conversation/turn-state"; +import { chatReducer, type ChatState } from "../../../src/features/chat/application/state/root-reducer"; import { createChatStateStore } from "../../../src/features/chat/application/state/store"; import { messageStreamItems } from "../../../src/features/chat/application/state/message-stream"; import type { ThreadGoal } from "../../../src/domain/threads/goal"; diff --git a/tests/features/chat/support/shell-state.ts b/tests/features/chat/support/shell-state.ts index b0b2a07c..877097c7 100644 --- a/tests/features/chat/support/shell-state.ts +++ b/tests/features/chat/support/shell-state.ts @@ -1,5 +1,6 @@ import { runtimeSnapshotForChatState } from "../../../../src/features/chat/application/runtime/snapshot"; -import { activeTurnId, chatTurnBusy, type ChatState } from "../../../../src/features/chat/application/state/root-reducer"; +import { activeTurnId, chatTurnBusy } from "../../../../src/features/chat/application/conversation/turn-state"; +import type { ChatState } from "../../../../src/features/chat/application/state/root-reducer"; import { messageStreamActiveItems, messageStreamItems,