From fe7f63e6691a2e54d611bb5caa46956233d26894 Mon Sep 17 00:00:00 2001 From: murashit Date: Sun, 21 Jun 2026 14:22:16 +0900 Subject: [PATCH] Prune redundant internal helper exports --- .../connection/short-lived-client.ts | 2 +- src/app-server/protocol/runtime-config.ts | 4 +-- .../services/ephemeral-structured-turn.ts | 6 ++-- .../services/thread-title-generation.ts | 10 ++---- src/domain/runtime/config.ts | 6 +--- .../chat/app-server/actions/threads.ts | 2 +- .../application/runtime/settings-actions.ts | 2 +- .../chat/application/runtime/snapshot.ts | 2 -- .../chat/application/state/message-stream.ts | 3 +- .../chat/domain/message-stream/selectors.ts | 2 +- .../domain/message-stream/semantics/index.ts | 9 ----- .../chat/domain/message-stream/updates.ts | 3 +- src/features/chat/host/session-graph.ts | 2 +- .../panel/surface/composer-projection.tsx | 2 +- .../chat/panel/surface/runtime-snapshot.ts | 2 +- .../chat/panel/surface/toolbar-projection.tsx | 2 +- .../presentation/message-stream/layout.ts | 6 ++-- .../message-stream/render-family.ts | 27 --------------- .../presentation/message-stream/text-view.ts | 4 +-- .../presentation/message-stream/view-model.ts | 34 +++++++++++++++---- .../presentation/pending-requests/snapshot.ts | 2 +- .../chat/ui/message-stream/context.ts | 5 +-- src/features/selection-rewrite/runner.ts | 9 ++--- src/settings/setting-components.tsx | 4 +-- src/shared/id/local-id.ts | 2 +- .../thread-title-generation.test.ts | 14 ++++---- .../chat/message-stream/semantics.test.ts | 6 ++-- tests/runtime/runtime-settings.test.ts | 2 +- 28 files changed, 71 insertions(+), 103 deletions(-) delete mode 100644 src/features/chat/domain/message-stream/semantics/index.ts delete mode 100644 src/features/chat/presentation/message-stream/render-family.ts diff --git a/src/app-server/connection/short-lived-client.ts b/src/app-server/connection/short-lived-client.ts index f6d4de17..2a62be4b 100644 --- a/src/app-server/connection/short-lived-client.ts +++ b/src/app-server/connection/short-lived-client.ts @@ -1,6 +1,6 @@ import { AppServerClient } from "./client"; -export interface ShortLivedAppServerClientOptions { +interface ShortLivedAppServerClientOptions { unhandledServerRequestMessage?: string; } diff --git a/src/app-server/protocol/runtime-config.ts b/src/app-server/protocol/runtime-config.ts index a54c6a85..13f973de 100644 --- a/src/app-server/protocol/runtime-config.ts +++ b/src/app-server/protocol/runtime-config.ts @@ -1,5 +1,5 @@ +import { normalizeReasoningEffort } from "../../domain/catalog/metadata"; import { approvalPolicyOrNull, approvalsReviewerOrNull, parseServiceTier } from "../../domain/runtime/policy"; -import { normalizedRuntimeReasoningEffort } from "../../domain/runtime/config"; import type { ReasoningSummary, SandboxMode, RuntimeConfigSnapshot, Verbosity, WebSearchMode } from "../../domain/runtime/config"; interface ConfigLayerRecord { @@ -24,7 +24,7 @@ export function runtimeConfigSnapshotFromAppServerConfig(response: ConfigReadRes profile: selectedConfigProfile(response.layers), model: nonEmptyStringOrNull(config["model"]), modelProvider: nonEmptyStringOrNull(config["model_provider"]), - reasoningEffort: normalizedRuntimeReasoningEffort(effort), + reasoningEffort: normalizeReasoningEffort(effort), rawReasoningEffort: nonEmptyStringOrNull(effort), reasoningSummary: reasoningSummaryOrNull(config["model_reasoning_summary"]), verbosity: verbosityOrNull(config["model_verbosity"]), diff --git a/src/app-server/services/ephemeral-structured-turn.ts b/src/app-server/services/ephemeral-structured-turn.ts index a93c8975..c73a2581 100644 --- a/src/app-server/services/ephemeral-structured-turn.ts +++ b/src/app-server/services/ephemeral-structured-turn.ts @@ -35,9 +35,7 @@ export interface EphemeralStructuredTurnClient { startStructuredTurn(options: AppServerStartStructuredTurnOptions): Promise<{ turn: TurnRecord }>; } -export type EphemeralStructuredTurnRuntimeClient = ModelMetadataClient; - -type EphemeralStructuredTurnRuntimeCapableClient = EphemeralStructuredTurnClient & EphemeralStructuredTurnRuntimeClient; +type EphemeralStructuredTurnRuntimeCapableClient = EphemeralStructuredTurnClient & ModelMetadataClient; export type EphemeralStructuredTurnClientFactory = ( codexPath: string, @@ -58,7 +56,7 @@ export interface RunEphemeralStructuredTurnOptions { timedOutMessage: string; abortMessage?: string; runtime?: StructuredTurnRuntimeOverride | undefined; - resolveRuntime?: ((client: EphemeralStructuredTurnRuntimeClient) => Promise) | undefined; + resolveRuntime?: ((client: ModelMetadataClient) => Promise) | undefined; signal?: AbortSignal | undefined; onProgress?: (event: StructuredTurnProgressEvent) => void; clientFactory?: EphemeralStructuredTurnClientFactory | undefined; diff --git a/src/app-server/services/thread-title-generation.ts b/src/app-server/services/thread-title-generation.ts index 8bf7eeda..100b31b7 100644 --- a/src/app-server/services/thread-title-generation.ts +++ b/src/app-server/services/thread-title-generation.ts @@ -1,10 +1,9 @@ import { runEphemeralStructuredTurn, - type EphemeralStructuredTurnClient, type EphemeralStructuredTurnClientFactory, - type EphemeralStructuredTurnRuntimeClient, type StructuredTurnOutputSchema, } from "./ephemeral-structured-turn"; +import type { ModelMetadataClient } from "../catalog"; import { resolvedRuntimeOverrideForClient } from "./runtime-overrides"; import { conversationAssistantTextFromTurnRecord, type TurnRecord } from "../protocol/turn"; import type { ReasoningEffort } from "../../domain/catalog/metadata"; @@ -39,15 +38,12 @@ export interface ThreadTitleRuntimeSettings { threadNamingEffort: ReasoningEffort | null; } -export type ThreadTitleClient = EphemeralStructuredTurnClient; -export type ThreadTitleClientFactory = EphemeralStructuredTurnClientFactory; - export async function generateThreadTitleWithCodex( codexPath: string, cwd: string, context: ThreadTitleContext, runtimeSettings: ThreadTitleRuntimeSettings, - clientFactory?: ThreadTitleClientFactory, + clientFactory?: EphemeralStructuredTurnClientFactory, ): Promise { const turn = await runEphemeralStructuredTurn({ codexPath, @@ -71,6 +67,6 @@ function threadTitleFromGenerationTurn(turn: TurnRecord): string | null { return response ? threadTitleFromGeneratedText(response) : null; } -async function threadTitleRuntimeOverrideForClient(client: EphemeralStructuredTurnRuntimeClient, settings: ThreadTitleRuntimeSettings) { +async function threadTitleRuntimeOverrideForClient(client: ModelMetadataClient, settings: ThreadTitleRuntimeSettings) { return resolvedRuntimeOverrideForClient(client, { model: settings.threadNamingModel, effort: settings.threadNamingEffort }); } diff --git a/src/domain/runtime/config.ts b/src/domain/runtime/config.ts index 02df9ee6..e6e51d6f 100644 --- a/src/domain/runtime/config.ts +++ b/src/domain/runtime/config.ts @@ -1,4 +1,4 @@ -import { normalizeReasoningEffort, type ReasoningEffort } from "../catalog/metadata"; +import type { ReasoningEffort } from "../catalog/metadata"; import { cloneApprovalPolicy, type ApprovalPolicy, type ApprovalsReviewer, type ServiceTier } from "./policy"; export type ReasoningSummary = "auto" | "concise" | "detailed" | "none"; @@ -60,10 +60,6 @@ export function cloneRuntimeConfigSnapshot(config: RuntimeConfigSnapshot): Runti }; } -export function normalizedRuntimeReasoningEffort(value: unknown): ReasoningEffort | null { - return normalizeReasoningEffort(value); -} - function cloneJsonLike(value: unknown): unknown { if (Array.isArray(value)) return value.map(cloneJsonLike); if (!value || typeof value !== "object") return value; diff --git a/src/features/chat/app-server/actions/threads.ts b/src/features/chat/app-server/actions/threads.ts index 16184fd1..79e84d6c 100644 --- a/src/features/chat/app-server/actions/threads.ts +++ b/src/features/chat/app-server/actions/threads.ts @@ -1,6 +1,6 @@ import type { Thread } from "../../../../domain/threads/model"; import { threadActivationSnapshotFromAppServerResponse } from "../../../../app-server/threads"; -import type { RuntimeSnapshot } from "../../application/runtime/snapshot"; +import type { RuntimeSnapshot } from "../../domain/runtime/snapshot"; import { runtimeConfigOrDefault } from "../../domain/runtime/effective"; import { serviceTierRequestForThreadStart } from "../../application/runtime/thread-settings-update"; import { resumedThreadAction } from "../../application/state/actions"; diff --git a/src/features/chat/application/runtime/settings-actions.ts b/src/features/chat/application/runtime/settings-actions.ts index 62d3d0f0..9b711303 100644 --- a/src/features/chat/application/runtime/settings-actions.ts +++ b/src/features/chat/application/runtime/settings-actions.ts @@ -8,7 +8,7 @@ import { pendingRuntimeSettingsPatch as buildPendingRuntimeSettingsPatch, type PendingRuntimeSettingsPatch, } from "./thread-settings-update"; -import type { RuntimeSnapshot } from "./snapshot"; +import type { RuntimeSnapshot } from "../../domain/runtime/snapshot"; import { nextCollaborationMode, type CollaborationMode, type RequestedServiceTier } from "../../domain/runtime/pending-settings"; import type { ChatAction, ChatState } from "../state/root-reducer"; import type { ChatStateStore } from "../state/store"; diff --git a/src/features/chat/application/runtime/snapshot.ts b/src/features/chat/application/runtime/snapshot.ts index 47ad8471..0a0be505 100644 --- a/src/features/chat/application/runtime/snapshot.ts +++ b/src/features/chat/application/runtime/snapshot.ts @@ -3,8 +3,6 @@ import type { MessageStreamItem } from "../../domain/message-stream/items"; import type { RuntimeSnapshot } from "../../domain/runtime/snapshot"; import { messageStreamItems } from "../state/message-stream"; -export type { RuntimeSnapshot } from "../../domain/runtime/snapshot"; - interface RuntimeSnapshotInput { runtimeConfig: ChatState["connection"]["runtimeConfig"]; activeThread: Pick; diff --git a/src/features/chat/application/state/message-stream.ts b/src/features/chat/application/state/message-stream.ts index d66c4b29..b022544d 100644 --- a/src/features/chat/application/state/message-stream.ts +++ b/src/features/chat/application/state/message-stream.ts @@ -1,7 +1,8 @@ import { upsertMessageStreamItemById } from "../../domain/message-stream/updates"; import type { MessageStreamItem, MessageStreamMessageItem } from "../../domain/message-stream/items"; import { normalizeProposedPlanMarkdown } from "../../domain/message-stream/format/proposed-plan"; -import { messageStreamIsTurnInitiator, messageStreamSemanticClassifications } from "../../domain/message-stream/semantics"; +import { messageStreamSemanticClassifications } from "../../domain/message-stream/semantics/classify"; +import { messageStreamIsTurnInitiator } from "../../domain/message-stream/semantics/predicates"; import { streamedItemOutputMessageStreamItem, streamedTextMessageStreamItem, diff --git a/src/features/chat/domain/message-stream/selectors.ts b/src/features/chat/domain/message-stream/selectors.ts index f9acce0e..cf23bff5 100644 --- a/src/features/chat/domain/message-stream/selectors.ts +++ b/src/features/chat/domain/message-stream/selectors.ts @@ -1,5 +1,5 @@ import type { MessageStreamItem } from "./items"; -import { messageStreamSemanticClassifications } from "./semantics"; +import { messageStreamSemanticClassifications } from "./semantics/classify"; export interface ForkCandidate { itemId: string; diff --git a/src/features/chat/domain/message-stream/semantics/index.ts b/src/features/chat/domain/message-stream/semantics/index.ts deleted file mode 100644 index 5b44f0cf..00000000 --- a/src/features/chat/domain/message-stream/semantics/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { messageStreamSemanticClassifications } from "./classify"; -export { - messageStreamIsAutoReviewDecision, - messageStreamIsCoordinationProgress, - messageStreamIsTurnInitiator, - messageStreamIsTurnSteer, - messageStreamIsWorkspaceResult, -} from "./predicates"; -export type { MessageStreamSemanticClassification } from "./types"; diff --git a/src/features/chat/domain/message-stream/updates.ts b/src/features/chat/domain/message-stream/updates.ts index f24bc23e..d0a3f383 100644 --- a/src/features/chat/domain/message-stream/updates.ts +++ b/src/features/chat/domain/message-stream/updates.ts @@ -1,4 +1,5 @@ -import { messageStreamIsTurnInitiator, messageStreamSemanticClassifications } from "./semantics"; +import { messageStreamSemanticClassifications } from "./semantics/classify"; +import { messageStreamIsTurnInitiator } from "./semantics/predicates"; import type { MessageStreamFileChange, MessageStreamItem } from "./items"; export function upsertMessageStreamItemById(items: readonly MessageStreamItem[], next: MessageStreamItem): MessageStreamItem[] { diff --git a/src/features/chat/host/session-graph.ts b/src/features/chat/host/session-graph.ts index 1578f87e..dd44669b 100644 --- a/src/features/chat/host/session-graph.ts +++ b/src/features/chat/host/session-graph.ts @@ -64,7 +64,7 @@ import { connectionDiagnosticSectionsModel } from "../application/connection/dia import { toolInventoryDiagnosticSections } from "../application/connection/tool-inventory-display"; import { createStructuredSystemItem, createSystemItem } from "../domain/message-stream/factories/system-items"; import { createLocalIdSource, type LocalIdSource } from "../../../shared/id/local-id"; -import type { RuntimeSnapshot } from "../application/runtime/snapshot"; +import type { RuntimeSnapshot } from "../domain/runtime/snapshot"; import type { ChatPanelEnvironment } from "./runtime"; import { createConnectionBundle, type ChatPanelConnectionBundle, type CurrentAppServerClient } from "./connection-bundle"; import { VaultNoteCandidateProvider } from "../panel/vault-note-candidate-provider"; diff --git a/src/features/chat/panel/surface/composer-projection.tsx b/src/features/chat/panel/surface/composer-projection.tsx index 2cecdc6d..e8f89934 100644 --- a/src/features/chat/panel/surface/composer-projection.tsx +++ b/src/features/chat/panel/surface/composer-projection.tsx @@ -13,7 +13,7 @@ import { contextSummary } from "../../presentation/runtime/status"; import { compactReasoningEffortLabel } from "../../presentation/runtime/messages"; import { sortedModelMetadata } from "../../../../domain/catalog/metadata"; import type { ReasoningEffort } from "../../../../domain/catalog/metadata"; -import type { RuntimeSnapshot } from "../../application/runtime/snapshot"; +import type { RuntimeSnapshot } from "../../domain/runtime/snapshot"; import { ComposerShell, type ComposerShellProps } from "../../ui/composer"; import { composerStateFromShellState, useChatPanelShellState, type ChatPanelComposerShellState } from "../shell-state"; import { explicitThreadName } from "../../../../domain/threads/model"; diff --git a/src/features/chat/panel/surface/runtime-snapshot.ts b/src/features/chat/panel/surface/runtime-snapshot.ts index 4dde361a..9f7f88bf 100644 --- a/src/features/chat/panel/surface/runtime-snapshot.ts +++ b/src/features/chat/panel/surface/runtime-snapshot.ts @@ -1,5 +1,5 @@ import { messageStreamItems } from "../../application/state/message-stream"; -import type { RuntimeSnapshot } from "../../application/runtime/snapshot"; +import type { RuntimeSnapshot } from "../../domain/runtime/snapshot"; import { runtimeSnapshotForChatSlices } from "../../application/runtime/snapshot"; import type { ChatPanelComposerShellState, ChatPanelToolbarShellState } from "../shell-state"; diff --git a/src/features/chat/panel/surface/toolbar-projection.tsx b/src/features/chat/panel/surface/toolbar-projection.tsx index b442ae15..599be016 100644 --- a/src/features/chat/panel/surface/toolbar-projection.tsx +++ b/src/features/chat/panel/surface/toolbar-projection.tsx @@ -6,7 +6,7 @@ import { getThreadTitle } from "../../../../domain/threads/model"; import { rateLimitSummary } from "../../presentation/runtime/status"; import { connectionDiagnosticSectionsModel } from "../../application/connection/diagnostics-display"; import { toolInventoryDiagnosticSections } from "../../application/connection/tool-inventory-display"; -import type { RuntimeSnapshot } from "../../application/runtime/snapshot"; +import type { RuntimeSnapshot } from "../../domain/runtime/snapshot"; import { chatTurnBusy, type ChatState } from "../../application/state/root-reducer"; import { toolbarStateFromShellState, useChatPanelShellState, type ChatPanelToolbarShellState } from "../shell-state"; import { Toolbar, type ToolbarActions, type ToolbarThreadRow, type ToolbarViewModel } from "../../ui/toolbar"; diff --git a/src/features/chat/presentation/message-stream/layout.ts b/src/features/chat/presentation/message-stream/layout.ts index 024a3ad4..5b6712a0 100644 --- a/src/features/chat/presentation/message-stream/layout.ts +++ b/src/features/chat/presentation/message-stream/layout.ts @@ -1,13 +1,13 @@ import type { MessageStreamItem } from "../../domain/message-stream/items"; import { pathRelativeToRoot } from "../../domain/message-stream/format/path-labels"; +import { messageStreamSemanticClassifications } from "../../domain/message-stream/semantics/classify"; import { messageStreamIsAutoReviewDecision, messageStreamIsTurnInitiator, messageStreamIsTurnSteer, messageStreamIsWorkspaceResult, - messageStreamSemanticClassifications, -} from "../../domain/message-stream/semantics"; -import type { MessageStreamSemanticClassification } from "../../domain/message-stream/semantics"; +} from "../../domain/message-stream/semantics/predicates"; +import type { MessageStreamSemanticClassification } from "../../domain/message-stream/semantics/types"; const STEERING_ACTIVITY_LABEL = "steer"; diff --git a/src/features/chat/presentation/message-stream/render-family.ts b/src/features/chat/presentation/message-stream/render-family.ts deleted file mode 100644 index 0c2c0de1..00000000 --- a/src/features/chat/presentation/message-stream/render-family.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { MessageStreamSemanticClassification } from "../../domain/message-stream/semantics"; - -export type MessageStreamRenderFamily = "text" | "detail" | "status"; - -export function messageStreamRenderFamily(classification: MessageStreamSemanticClassification): MessageStreamRenderFamily { - switch (classification.item.kind) { - case "message": - case "system": - case "userInputResult": - return "text"; - case "command": - case "fileChange": - case "tool": - case "hook": - case "goal": - case "approvalResult": - case "reviewResult": - case "agent": - return "detail"; - case "taskProgress": - case "reasoning": - case "wait": - case "contextCompaction": - return "status"; - } - return "status"; -} diff --git a/src/features/chat/presentation/message-stream/text-view.ts b/src/features/chat/presentation/message-stream/text-view.ts index 67df133c..db15b3b4 100644 --- a/src/features/chat/presentation/message-stream/text-view.ts +++ b/src/features/chat/presentation/message-stream/text-view.ts @@ -12,12 +12,10 @@ export interface MessageStreamForkTarget { turnId: string; } -export type MessageStreamPlanImplementationTarget = PlanImplementationTarget; - export interface MessageStreamTextActionTargets { fork?: MessageStreamForkTarget; rollback?: true; - implementPlan?: MessageStreamPlanImplementationTarget; + implementPlan?: PlanImplementationTarget; } export interface ReferencedThreadTextView { diff --git a/src/features/chat/presentation/message-stream/view-model.ts b/src/features/chat/presentation/message-stream/view-model.ts index aa6dfe7e..7d93dfab 100644 --- a/src/features/chat/presentation/message-stream/view-model.ts +++ b/src/features/chat/presentation/message-stream/view-model.ts @@ -1,12 +1,9 @@ -import { - messageStreamIsCoordinationProgress, - messageStreamSemanticClassifications, - type MessageStreamSemanticClassification, -} from "../../domain/message-stream/semantics"; +import { messageStreamSemanticClassifications } from "../../domain/message-stream/semantics/classify"; +import { messageStreamIsCoordinationProgress } from "../../domain/message-stream/semantics/predicates"; +import type { MessageStreamSemanticClassification } from "../../domain/message-stream/semantics/types"; import type { AgentRunSummary, MessageStreamItem, TaskProgressMessageStreamItem } from "../../domain/message-stream/items"; import { messageStreamLayoutBlocks, type MessageStreamItemAnnotations, type MessageStreamLayoutBlock } from "./layout"; import { detailView, type DetailView } from "./detail-view"; -import { messageStreamRenderFamily } from "./render-family"; import { messageStreamTextView, type MessageStreamTextActionTargets, type MessageStreamTextView } from "./text-view"; import { activeAgentRunSummary, @@ -74,6 +71,7 @@ type MessageStreamPresentationBlock = }; type MessageStreamPresentationBlockSource = (input: MessageStreamPresentationBlockInput) => readonly MessageStreamPresentationBlock[]; +type MessageStreamRenderFamily = "text" | "detail" | "status"; export type MessageStreamRenderedItemView = | { @@ -310,6 +308,30 @@ function messageStreamRenderedItemView( } } +function messageStreamRenderFamily(classification: MessageStreamSemanticClassification): MessageStreamRenderFamily { + switch (classification.item.kind) { + case "message": + case "system": + case "userInputResult": + return "text"; + case "command": + case "fileChange": + case "tool": + case "hook": + case "goal": + case "approvalResult": + case "reviewResult": + case "agent": + return "detail"; + case "taskProgress": + case "reasoning": + case "wait": + case "contextCompaction": + return "status"; + } + return "status"; +} + function statusViewContext(input: MessageStreamPresentationBlockInput): Parameters[1] { return { activeTurnId: input.activeTurnId, diff --git a/src/features/chat/presentation/pending-requests/snapshot.ts b/src/features/chat/presentation/pending-requests/snapshot.ts index 0cbda7dc..14f66884 100644 --- a/src/features/chat/presentation/pending-requests/snapshot.ts +++ b/src/features/chat/presentation/pending-requests/snapshot.ts @@ -17,7 +17,7 @@ export interface PendingRequestBlockSnapshot { approvalDetails: ReadonlySet; } -export interface PendingRequestBlockSnapshotSource { +interface PendingRequestBlockSnapshotSource { approvals: readonly PendingApproval[]; pendingUserInputs: readonly PendingUserInput[]; pendingMcpElicitations: readonly PendingMcpElicitation[]; diff --git a/src/features/chat/ui/message-stream/context.ts b/src/features/chat/ui/message-stream/context.ts index 5ab67c12..296a094e 100644 --- a/src/features/chat/ui/message-stream/context.ts +++ b/src/features/chat/ui/message-stream/context.ts @@ -2,7 +2,8 @@ import type { ComponentChild as UiNode } from "preact"; import type { ApprovalAction, McpElicitationAction, PendingRequestId } from "../../domain/pending-requests/model"; import type { PendingRequestBlockSnapshot } from "../../presentation/pending-requests/snapshot"; -import type { MessageStreamForkTarget, MessageStreamPlanImplementationTarget } from "../../presentation/message-stream/text-view"; +import type { MessageStreamForkTarget } from "../../presentation/message-stream/text-view"; +import type { PlanImplementationTarget } from "../../domain/message-stream/selectors"; import type { ChatTurnDiffViewState } from "../../domain/turn-diff"; export interface MessageStreamBlock { @@ -51,7 +52,7 @@ export interface TextItemActionContext extends TextItemDetailStateContext { forkMenuItemId: string | null; onForkMenuToggle?: (itemId: string | null) => void; copyText?: (text: string) => void; - onImplementPlan?: (target: MessageStreamPlanImplementationTarget) => void; + onImplementPlan?: (target: PlanImplementationTarget) => void; onRollback?: () => void; onFork?: (target: MessageStreamForkTarget, archiveSource: boolean) => void; } diff --git a/src/features/selection-rewrite/runner.ts b/src/features/selection-rewrite/runner.ts index 91278ad0..4457a960 100644 --- a/src/features/selection-rewrite/runner.ts +++ b/src/features/selection-rewrite/runner.ts @@ -1,9 +1,9 @@ import { type EphemeralStructuredTurnClient, - type EphemeralStructuredTurnRuntimeClient, runEphemeralStructuredTurnForLastAgentText, type StructuredTurnOutputSchema, } from "../../app-server/services/ephemeral-structured-turn"; +import type { ModelMetadataClient } from "../../app-server/catalog"; import type { AppServerClientHandlers } from "../../app-server/connection/client"; import { resolvedRuntimeOverrideForClient } from "../../app-server/services/runtime-overrides"; import type { SelectionRewriteRuntimeSettings } from "./model"; @@ -36,7 +36,7 @@ export interface RunSelectionRewriteOptions { export type SelectionRewriteActivity = "reasoning" | "writing"; -type SelectionRewriteClient = EphemeralStructuredTurnClient & EphemeralStructuredTurnRuntimeClient; +type SelectionRewriteClient = EphemeralStructuredTurnClient & ModelMetadataClient; type SelectionRewriteClientFactory = (codexPath: string, cwd: string, handlers: AppServerClientHandlers) => SelectionRewriteClient; export async function runSelectionRewrite(options: RunSelectionRewriteOptions): Promise { @@ -72,9 +72,6 @@ export async function runSelectionRewrite(options: RunSelectionRewriteOptions): return output; } -async function selectionRewriteRuntimeOverrideForClient( - client: EphemeralStructuredTurnRuntimeClient, - settings: SelectionRewriteRuntimeSettings, -) { +async function selectionRewriteRuntimeOverrideForClient(client: ModelMetadataClient, settings: SelectionRewriteRuntimeSettings) { return resolvedRuntimeOverrideForClient(client, { model: settings.rewriteSelectionModel, effort: settings.rewriteSelectionEffort }); } diff --git a/src/settings/setting-components.tsx b/src/settings/setting-components.tsx index c536c1a9..02686724 100644 --- a/src/settings/setting-components.tsx +++ b/src/settings/setting-components.tsx @@ -8,8 +8,6 @@ import { ObsidianToggle, } from "../shared/ui/components"; -export type SelectControlOption = ObsidianDropdownOption; - export function SettingsGroup({ className, children }: { className: string; children: UiNode }): UiNode { return
{children}
; } @@ -86,7 +84,7 @@ export function SelectControl({ }: { value: string; onChange: (value: string) => void; - options: readonly SelectControlOption[]; + options: readonly ObsidianDropdownOption[]; }): UiNode { return ; } diff --git a/src/shared/id/local-id.ts b/src/shared/id/local-id.ts index 5c33e5ef..f4d978b9 100644 --- a/src/shared/id/local-id.ts +++ b/src/shared/id/local-id.ts @@ -2,7 +2,7 @@ export interface LocalIdSource { next(prefix: string): string; } -export interface LocalIdSourceOptions { +interface LocalIdSourceOptions { nowMs?: () => number; seed?: string; } diff --git a/tests/app-server/thread-title-generation.test.ts b/tests/app-server/thread-title-generation.test.ts index 4edfd59e..570f95ab 100644 --- a/tests/app-server/thread-title-generation.test.ts +++ b/tests/app-server/thread-title-generation.test.ts @@ -6,11 +6,11 @@ import type { AppServerClient, AppServerClientHandlers, AppServerStartStructured import type { TurnItem, TurnRecord } from "../../src/app-server/protocol/turn"; import type { RequestId, ServerNotification } from "../../src/app-server/connection/rpc-messages"; import type { ServerInitialization } from "../../src/domain/server/initialization"; -import { - generateThreadTitleWithCodex, - type ThreadTitleClient, - type ThreadTitleClientFactory, -} from "../../src/app-server/services/thread-title-generation"; +import { generateThreadTitleWithCodex } from "../../src/app-server/services/thread-title-generation"; +import type { + EphemeralStructuredTurnClient, + EphemeralStructuredTurnClientFactory, +} from "../../src/app-server/services/ephemeral-structured-turn"; import { findThreadTitleContext, threadTitleContextFromConversationSummary, @@ -213,7 +213,7 @@ function runtimeSettings() { } function fakeThreadTitleClientFactory(configure?: (client: FakeThreadTitleClient) => void): { - clientFactory: ThreadTitleClientFactory; + clientFactory: EphemeralStructuredTurnClientFactory; client: { current: FakeThreadTitleClient | null }; } { const client: { current: FakeThreadTitleClient | null } = { current: null }; @@ -227,7 +227,7 @@ function fakeThreadTitleClientFactory(configure?: (client: FakeThreadTitleClient }; } -class FakeThreadTitleClient implements ThreadTitleClient { +class FakeThreadTitleClient implements EphemeralStructuredTurnClient { startStructuredTurnImpl: (() => Promise) | null = null; startStructuredTurnOptions: AppServerStartStructuredTurnOptions | null = null; modelList: ModelListResponse["data"] = []; diff --git a/tests/features/chat/message-stream/semantics.test.ts b/tests/features/chat/message-stream/semantics.test.ts index 1ae64a48..a4834daf 100644 --- a/tests/features/chat/message-stream/semantics.test.ts +++ b/tests/features/chat/message-stream/semantics.test.ts @@ -1,10 +1,8 @@ import { describe, expect, it } from "vitest"; import { messageStreamItemFromTurnItem } from "../../../../src/features/chat/app-server/mappers/message-stream/turn-items"; -import { - messageStreamIsAutoReviewDecision, - messageStreamSemanticClassifications, -} from "../../../../src/features/chat/domain/message-stream/semantics"; +import { messageStreamSemanticClassifications } from "../../../../src/features/chat/domain/message-stream/semantics/classify"; +import { messageStreamIsAutoReviewDecision } from "../../../../src/features/chat/domain/message-stream/semantics/predicates"; import type { MessageStreamItem } from "../../../../src/features/chat/domain/message-stream/items"; import type { TurnItem } from "../../../../src/app-server/protocol/turn"; diff --git a/tests/runtime/runtime-settings.test.ts b/tests/runtime/runtime-settings.test.ts index f5c54dc5..a0aaa760 100644 --- a/tests/runtime/runtime-settings.test.ts +++ b/tests/runtime/runtime-settings.test.ts @@ -15,7 +15,7 @@ import { runtimeConfigOrDefault, supportedReasoningEfforts, } from "../../src/features/chat/domain/runtime/effective"; -import type { RuntimeSnapshot } from "../../src/features/chat/application/runtime/snapshot"; +import type { RuntimeSnapshot } from "../../src/features/chat/domain/runtime/snapshot"; import { resetRuntimeSettingToConfig, setPendingRuntimeSetting } from "../../src/features/chat/domain/runtime/pending-settings"; import { pendingRuntimeSettingsPatch,