Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

refactor(dead-code): remove unused desktop symbols

vastsa579e7d8dd54c
diff --git a/apps/desktop/electron/main/audio-backend.ts b/apps/desktop/electron/main/audio-backend.ts
index 4f5f4c6bc..eff76d1af 100644
--- a/apps/desktop/electron/main/audio-backend.ts
+++ b/apps/desktop/electron/main/audio-backend.ts
@@ -16,7 +16,6 @@ import {
CAPTURE_SAMPLE_RATE,
FRAME_LENGTH,
convertFrames,
- computeRms,
} from "@pi-desktop/voice-runtime";
/** Lazily loaded PvRecorder module. */
diff --git a/apps/desktop/electron/main/bootstrap/app-lifecycle.ts b/apps/desktop/electron/main/bootstrap/app-lifecycle.ts
index 63648ce02..41c9a1353 100644
--- a/apps/desktop/electron/main/bootstrap/app-lifecycle.ts
+++ b/apps/desktop/electron/main/bootstrap/app-lifecycle.ts
@@ -340,8 +340,6 @@ export function createApplicationLifecycle({
observedWorkPanelBaseBounds,
classifyDisplayTransition,
resetMenuRendererReady,
- markMenuRendererReady,
- sendToRenderer,
safeOpenExternal,
showPluginLauncher,
askCloseBehavior,
@@ -349,7 +347,6 @@ export function createApplicationLifecycle({
createTray,
browserPane,
pluginViews,
- plugins,
logger,
});
}
diff --git a/apps/desktop/electron/main/bootstrap/remote-hosts.ts b/apps/desktop/electron/main/bootstrap/remote-hosts.ts
index a9809a0c0..3d6e25200 100644
--- a/apps/desktop/electron/main/bootstrap/remote-hosts.ts
+++ b/apps/desktop/electron/main/bootstrap/remote-hosts.ts
@@ -314,9 +314,6 @@ export function createRemoteHostsBoot(
if (host) await closeHost(host);
};
- const isConnected = (hostKey: string): boolean =>
- opened.some((host) => host.hostKey === hostKey);
-
const summaryOf = (record: RemoteHostRecord): RemoteHostSummary => {
const live = opened.find((host) => host.hostKey === record.hostKey);
return {
diff --git a/apps/desktop/electron/main/bootstrap/startup.ts b/apps/desktop/electron/main/bootstrap/startup.ts
index 4fa5b9e6a..fae7ef296 100644
--- a/apps/desktop/electron/main/bootstrap/startup.ts
+++ b/apps/desktop/electron/main/bootstrap/startup.ts
@@ -77,11 +77,10 @@ export type StartupDependencies = {
updater: AppUpdaterController;
modelsDevCatalog: ModelsDevCatalog;
plugins: PluginRuntime;
- activeTurns: Map<string, string>;
/**
* Shared busy check from `runtime/session-coordination.ts`. The queue must
* stay held while a turn's announcement is still running, so this cannot be
- * derived here from `activeTurns` alone.
+ * be derived from the startup state alone.
*/
isSessionBusy: (sessionId: string) => boolean;
getHost: () => HostProcess | null;
@@ -148,7 +147,6 @@ export function registerApplicationStartup(deps: StartupDependencies): void {
updater,
modelsDevCatalog,
plugins,
- activeTurns,
isSessionBusy,
getHost,
getMainWindow,
diff --git a/apps/desktop/electron/main/bootstrap/window.ts b/apps/desktop/electron/main/bootstrap/window.ts
index a3063ac36..d0d52d953 100644
--- a/apps/desktop/electron/main/bootstrap/window.ts
+++ b/apps/desktop/electron/main/bootstrap/window.ts
@@ -12,7 +12,6 @@ import {
import type { BrowserPane } from "../browser-view";
import type { HostProcess } from "../host-process";
import type { Logger } from "../logger";
-import type { PluginRuntime } from "../plugin-runtime";
import type { PluginViewHost } from "../plugin-view-host";
import {
baseWindowBounds,
@@ -21,11 +20,8 @@ import {
displayWorkAreaKey,
emptyWorkPanelReservationState,
isWorkPanelOuterResizeEdge,
- parseWorkPanelChatWidth,
- parseWorkPanelReservationWidth,
planWorkPanelChatResize,
planWorkPanelReservation,
- reconcileBaseWindowBounds,
WORK_PANEL_MAX_WIDTH,
WORK_PANEL_MIN_WIDTH,
windowBoundsEqual,
@@ -94,8 +90,6 @@ export type WindowLifecycleDependencies = {
observedWorkPanelBaseBounds: (windowBounds: WindowBounds, transition: DisplayTransition) => WindowBounds;
classifyDisplayTransition: (displayKey: string) => DisplayTransition;
resetMenuRendererReady: (window: BrowserWindow) => void;
- markMenuRendererReady: (window: BrowserWindow) => boolean;
- sendToRenderer: (channel: string, payload: unknown) => void;
safeOpenExternal: (rawUrl: unknown) => Promise<void>;
showPluginLauncher: () => Promise<void>;
askCloseBehavior: (window: BrowserWindow) => Promise<CloseBehavior | null>;
@@ -103,7 +97,6 @@ export type WindowLifecycleDependencies = {
createTray: () => void;
browserPane: BrowserPane;
pluginViews: PluginViewHost;
- plugins: PluginRuntime;
logger: Pick<Logger, "app">;
};
@@ -121,8 +114,6 @@ export async function createWindow({
observedWorkPanelBaseBounds,
classifyDisplayTransition,
resetMenuRendererReady,
- markMenuRendererReady,
- sendToRenderer,
safeOpenExternal,
showPluginLauncher,
askCloseBehavior,
@@ -130,7 +121,6 @@ export async function createWindow({
createTray,
browserPane,
pluginViews,
- plugins,
logger,
}: WindowLifecycleDependencies): Promise<void> {
diff --git a/apps/desktop/electron/main/importers/codex.ts b/apps/desktop/electron/main/importers/codex.ts
index b9a42c9b3..c7a242f83 100644
--- a/apps/desktop/electron/main/importers/codex.ts
+++ b/apps/desktop/electron/main/importers/codex.ts
@@ -1,5 +1,5 @@
import { createReadStream } from "node:fs";
-import fs, { type FileHandle } from "node:fs/promises";
+import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import type { Readable } from "node:stream";
diff --git a/apps/desktop/electron/main/index.ts b/apps/desktop/electron/main/index.ts
index 034e6fb14..0ac904fdb 100644
--- a/apps/desktop/electron/main/index.ts
+++ b/apps/desktop/electron/main/index.ts
@@ -2,9 +2,6 @@ import {
app,
BrowserWindow,
ipcMain,
- nativeTheme,
- screen,
- Tray,
} from "electron";
import { join } from "node:path";
import {
@@ -19,109 +16,41 @@ import {
APP_VERSION,
IPC,
IPC_WHITELIST,
- KEYBOARD_SHORTCUTS,
- keybindingToElectronAccelerator,
- resolveKeybinding,
isActiveInProject,
type ActivationScope,
type AgentEventEnvelope,
- type AppMenuCommand,
type CloseBehavior,
type KeybindingOverrides,
type PlanExecutionFinishStatus,
} from "@pi-desktop/shared";
-import { summarizeSessionTitle } from "@pi-desktop/agent-runtime";
import { AgentExtensionBridge } from "./agent-extensions";
-import { registerAgentExtensionIpc } from "./agent-extensions-ipc";
-import { isTemplateName, scaffold } from "@pi-desktop/plugin-devkit";
-
-import { HostProcess } from "./host-process";
import {
knownProjectGroups,
pluginWorkspaceInfo,
refreshProjectGroups,
} from "./workspace-roots";
-import {
- shouldCreateTaskNotification as shouldCreateTaskNotificationPolicy,
- shouldShowNativeNotification,
-} from "./notification-policy";
import { PersistenceOutbox } from "./persistence-outbox";
-import { AgentSidecar } from "./agent-sidecar";
import { Logger, ignoreBrokenStdio } from "./logger";
import { describeError, installMainProcessErrorHandlers } from "./main-process-errors";
-import {
- isDbSchemaTooNewError,
-} from "./host-boot-diagnostics";
import {
ModelsDevCatalog,
catalogModelConfigFor,
} from "./models-dev-catalog";
import { VendorOAuth } from "./oauth";
import { AppUpdaterController } from "./updater";
-import { catalogs, resolveLocale } from "@pi-desktop/i18n";
-import {
- baseWindowBounds,
- clampBoundsOriginToWorkArea,
- displayWorkAreaKey,
- emptyWorkPanelReservationState,
- isWorkPanelOuterResizeEdge,
- parseWorkPanelChatWidth,
- parseWorkPanelReservationWidth,
- planWorkPanelChatResize,
- planWorkPanelReservation,
- reconcileBaseWindowBounds,
- WORK_PANEL_MAX_WIDTH,
- WORK_PANEL_MIN_WIDTH,
- windowBoundsEqual,
- type DisplayTransition,
- type WindowBounds,
- type WorkPanelReservationState,
-} from "./work-panel-window";
-import {
- appendPromptFallbackPaths,
- durableUserMessageId,
- preparePromptAttachments,
- type PreparedPromptAttachment,
-} from "./prompt-attachments";
-import {
- InflightCheckpointer,
- executionFromResponse,
- executionListFromResponse,
- planExecutionFromUnknown,
-} from "@pi-desktop/host-runtime";
-import { readWindowState, writeWindowState } from "./window-preferences";
+import type { WorkPanelReservationState } from "./work-panel-window";
+import { InflightCheckpointer } from "@pi-desktop/host-runtime";
import { withGitBranch } from "./workspace-git";
import { applyDevelopmentUserData, desktopDataDir } from "./data-paths";
import { createPlanUiProbe } from "./plan-ui-probe";
-import type { McpControlController, McpControlServer } from "./mcp-control";
-import type { AgentHostBridge } from "./agent-host-bridge";
-import { registerAppIpc } from "./ipc/app-ipc";
-import { registerNotificationIpc } from "./ipc/notification-ipc";
-import { registerSessionIpc } from "./ipc/session-ipc";
-import { registerSettingsIpc } from "./ipc/settings-ipc";
-import { registerProviderIpc } from "./ipc/provider-ipc";
-import {
- createComposerTemplateLoader,
- registerWorkspaceIpc,
-} from "./ipc/workspace-ipc";
-import {
- registerComposerIpc,
-} from "./ipc/composer-ipc";
-import { registerWindowIpc } from "./ipc/window-ipc";
-import { registerPullsIpc } from "./ipc/pulls-ipc";
-import { registerAgentIpc } from "./ipc/agent-ipc";
import { registerIpcHandlers } from "./ipc/register";
import { createVoiceService } from "./voice-service";
import { MainProcessState } from "./bootstrap/main-state";
-import {
- type WindowLifecycleState,
-} from "./bootstrap/window";
import { registerApplicationActivation } from "./bootstrap/app-activation";
-import type { RuntimeState } from "./runtime/context";
import { createHostRuntime } from "./runtime/host";
import { createSidecarRuntime } from "./runtime/sidecar";
import { createEventPersistence } from "./runtime/event-persistence";
-import { createPlanRuntime, type PlanRuntimeState } from "./runtime/plans";
+import { createPlanRuntime } from "./runtime/plans";
import { createRuntimeLifecycle } from "./runtime/lifecycle";
import {
createProviderCatalogRuntime,
@@ -135,26 +64,12 @@ import { wirePluginThemeRuntimeServices } from "./plugin-theme-services";
import { createSessionCollaborationService } from "./services/session-collaboration";
import {
createApplicationLifecycle,
- type ApplicationAppearanceState,
- type ApplicationLifecycleState,
} from "./bootstrap/app-lifecycle";
-import {
- registerApplicationStartup,
- type StartupState,
-} from "./bootstrap/startup";
-import {
- createLauncher,
- type LauncherState,
-} from "./bootstrap/launcher";
+import { registerApplicationStartup } from "./bootstrap/startup";
+import { createLauncher } from "./bootstrap/launcher";
import { createWorkPanelRuntime } from "./bootstrap/work-panel";
import { createCloseBehaviorRuntime } from "./bootstrap/close-behavior";
-import { registerShutdownHandlers, type ShutdownState } from "./bootstrap/shutdown";
-import { registerDiagnosticsIpc } from "./ipc/diagnostics-ipc";
-import { registerMarketIpc } from "./ipc/market-ipc";
-import { registerMcpIpc } from "./ipc/mcp-ipc";
-import { registerPluginIpc } from "./ipc/plugin-ipc";
-import { registerPluginUiIpc } from "./ipc/plugin-ui-ipc";
-import { registerSkillsIpc } from "./ipc/skills-ipc";
+import { registerShutdownHandlers } from "./bootstrap/shutdown";
import { stripWinLongPrefix } from "./path-utils";
// A closed stdout/stderr (Linux AppImage, GUI launch without a TTY) must not
@@ -425,7 +340,6 @@ const pluginServices = createPluginServices({
)(...args);
},
vendorOAuth,
- agentExtensions,
});
const {
plugins,
@@ -433,7 +347,6 @@ const {
mcpOAuth,
pluginScopes,
sessionProjects,
- emitBrowserState,
pluginPanels,
pluginViews,
browserHost,
@@ -619,13 +532,9 @@ const {
hasVisibleWindow,
restoreMainWindow,
toggleMainWindow,
- updateTrayMenu,
createTray,
- resetMenuRendererReady,
markMenuRendererReady,
- waitForMenuRenderer,
ensureWindow,
- deliverApplicationMenuCommand,
dispatchApplicationMenuCommand,
executeNativeMenuAction,
dispatchNativeMenuAction,
@@ -633,10 +542,8 @@ const {
applyPreventScreenSleep,
applyKeepAwakeWhileRunning,
disposePowerSaveBlockers,
- applyNativeThemeSource,
applyApplicationMenuSettings,
applyAppThemePreference,
- resolveAppearance,
broadcastAppearance,
flushPendingApplicationMenuCommands,
} = applicationLifecycle;
@@ -657,7 +564,6 @@ closeBehaviorRuntime = createCloseBehaviorRuntime({
});
const {
applyCloseBehavior,
- askCloseBehavior,
confirmQuitDialog,
} = closeBehaviorRuntime;
@@ -673,7 +579,6 @@ const createdLauncher = createLauncher({
launcherRuntime = createdLauncher;
const {
prewarmPluginLauncher,
- showPluginLauncher,
togglePluginLauncher,
applyPluginLauncherShortcut,
applyToggleWindowShortcut,
@@ -724,14 +629,11 @@ const sessionCoordination = createSessionCoordination({
getViewingSessionId: () => mainState.notificationViewingSessionId,
});
const {
- turnSettlements,
activeTurnUsages,
acquireSessionOperation,
addActiveTurnUsage,
activeToolCallKey,
planSubmissionTurnKey,
- waitForTurnSettlement,
- shouldCreateTaskNotification,
lockAbortReason,
isTurnDispatchable,
isSessionBusy,
@@ -858,9 +760,9 @@ const sidecarRuntime = createSidecarRuntime({
currentNetworkProxy,
});
emitAgentEvent = sidecarRuntime.emitAgentEvent;
-const { wireSidecar, startSidecar } = sidecarRuntime;
+const { startSidecar } = sidecarRuntime;
-const { wireHost, startHost } = createHostRuntime({
+const { startHost } = createHostRuntime({
runtimeState,
dataDir,
logger,
@@ -901,7 +803,7 @@ runtimeLifecycle = createRuntimeLifecycle({
isQuitting: () => mainState.quitting,
getDisplayLocale: () => applicationAppearanceState.updaterLocale,
});
-const { bootHostStatus, runtimeArch, bootBackends } = runtimeLifecycle;
+const { bootHostStatus, bootBackends } = runtimeLifecycle;
const voiceService = createVoiceService(dataDir + "/voice-models", getMainWindow);
@@ -1022,7 +924,6 @@ registerApplicationStartup({
updater,
modelsDevCatalog,
plugins,
- activeTurns,
isSessionBusy,
getHost,
getMainWindow,
diff --git a/apps/desktop/electron/main/ipc/register.ts b/apps/desktop/electron/main/ipc/register.ts
index 70284b3fb..aee38990e 100644
--- a/apps/desktop/electron/main/ipc/register.ts
+++ b/apps/desktop/electron/main/ipc/register.ts
@@ -331,7 +331,6 @@ export function registerIpcHandlers(dependencies: RegisterIpcDependencies) {
plugins,
browserHost,
clipboardHistory,
- logger,
recordPastedClipboardFiles,
currentWorkspacePath,
setCurrentWorkspacePath,
diff --git a/apps/desktop/electron/main/ipc/session-ipc.ts b/apps/desktop/electron/main/ipc/session-ipc.ts
index b00420d88..65333f3d1 100644
--- a/apps/desktop/electron/main/ipc/session-ipc.ts
+++ b/apps/desktop/electron/main/ipc/session-ipc.ts
@@ -9,7 +9,6 @@ import {
draftMatchesExisting,
providerCreateInputFromDraft,
isModelConfigImportSource,
- type ActivationScope,
type ModelConfigImportDraft,
type Mode,
type SessionThinkingLevel,
@@ -39,11 +38,6 @@ type RuntimeSession = {
[key: string]: unknown;
};
-type ImportableModelConfig = ModelConfigImportDraft & {
- id?: string;
- secretValue?: string;
-};
-
let scannedImportSessions = new Map<string, ExternalSessionSummary>();
let scannedModelConfigs = new Map<string, ModelConfigImportDraft>();
diff --git a/apps/desktop/electron/main/ipc/settings-ipc.ts b/apps/desktop/electron/main/ipc/settings-ipc.ts
index 9066ac231..94f7ae5d4 100644
--- a/apps/desktop/electron/main/ipc/settings-ipc.ts
+++ b/apps/desktop/electron/main/ipc/settings-ipc.ts
@@ -1,5 +1,4 @@
import { IPC } from "@pi-desktop/shared";
-import { testNetworkProxy } from "../network-proxy";
import type { AgentSidecar } from "../agent-sidecar";
import type { HostProcess } from "../host-process";
import type { IpcRegistrar } from "./types";
diff --git a/apps/desktop/electron/main/ipc/skills-ipc.ts b/apps/desktop/electron/main/ipc/skills-ipc.ts
index 9184b93ed..0ed56e0ce 100644
--- a/apps/desktop/electron/main/ipc/skills-ipc.ts
+++ b/apps/desktop/electron/main/ipc/skills-ipc.ts
@@ -3,11 +3,9 @@ import { ErrorCodes, IPC, type ActivationScope, type AgentCapabilityMove, type A
import { loadSubagentDefinitions, type UserSubagentDocument } from "@pi-desktop/agent-runtime";
import type { HostProcess } from "../host-process";
import type { Logger } from "../logger";
-import {
- fetchSkillMarketDocument,
- searchSkillMarket,
- type SkillMarketDocument,
- type SkillMarketSearchResult,
+import type {
+ SkillMarketDocument,
+ SkillMarketSearchResult,
} from "../skill-market-catalog";
import {
skillMarketFailureDetail,
diff --git a/apps/desktop/electron/main/ipc/workspace-ipc.ts b/apps/desktop/electron/main/ipc/workspace-ipc.ts
index d332e091e..9a990b0df 100644
--- a/apps/desktop/electron/main/ipc/workspace-ipc.ts
+++ b/apps/desktop/electron/main/ipc/workspace-ipc.ts
@@ -7,7 +7,6 @@ import { isAbsolute, join, resolve } from "node:path";
import {
ErrorCodes,
IPC,
- type ComposerCommand,
type ComposerPasteFile,
type FsChatRefProjectRoot,
type FsChatRefResolveResult,
@@ -83,7 +82,6 @@ export type WorkspaceIpcDependencies = {
plugins: PluginRuntime;
browserHost: BrowserHost;
clipboardHistory: ClipboardHistory;
- logger: Pick<Logger, "app">;
recordPastedClipboardFiles: (files: ComposerPasteFile[]) => void;
currentWorkspacePath: () => string | null;
setCurrentWorkspacePath: (path: string | null) => void;
@@ -101,7 +99,6 @@ export function registerWorkspaceIpc({
plugins,
browserHost,
clipboardHistory,
- logger,
recordPastedClipboardFiles,
currentWorkspacePath,
setCurrentWorkspacePath,
diff --git a/apps/desktop/electron/main/remote/remote-event-bridge.ts b/apps/desktop/electron/main/remote/remote-event-bridge.ts
index 421222409..fcac20a20 100644
--- a/apps/desktop/electron/main/remote/remote-event-bridge.ts
+++ b/apps/desktop/electron/main/remote/remote-event-bridge.ts
@@ -133,7 +133,6 @@ function toAskToolRequest(
}
function toPlanningStateAgentEvent(
- remoteSessionId: string,
planning: PlanningStateEvent,
): AgentEvent {
const { sessionId: _hostSessionId, ...rest } = planning;
@@ -219,7 +218,7 @@ export function createRemoteEventBridge(options: RemoteEventBridgeOptions): Remo
emitAgentEvent(
envelope,
remoteSessionId,
- toPlanningStateAgentEvent(remoteSessionId, planning),
+ toPlanningStateAgentEvent(planning),
);
}
return;
diff --git a/apps/desktop/electron/main/runtime/event-persistence.ts b/apps/desktop/electron/main/runtime/event-persistence.ts
index 972dc9fc0..d7ae32504 100644
--- a/apps/desktop/electron/main/runtime/event-persistence.ts
+++ b/apps/desktop/electron/main/runtime/event-persistence.ts
@@ -1,4 +1,4 @@
-import { applyMessageUpdate, IPC, type AgentEventEnvelope, type UiMessage } from "@pi-desktop/shared";
+import { applyMessageUpdate, type AgentEventEnvelope, type UiMessage } from "@pi-desktop/shared";
import type { FinishTurn } from "./plans";
import type { RuntimeState } from "./context";
import type { InflightCheckpointer } from "@pi-desktop/host-runtime";
diff --git a/apps/desktop/electron/main/runtime/session-launch.ts b/apps/desktop/electron/main/runtime/session-launch.ts
index bf568708a..3aa84d1ba 100644
--- a/apps/desktop/electron/main/runtime/session-launch.ts
+++ b/apps/desktop/electron/main/runtime/session-launch.ts
@@ -35,7 +35,6 @@ import {
catalogModelConfigFor,
type ModelsDevCatalog,
} from "../models-dev-catalog";
-import type { HostProcess } from "../host-process";
import type { Logger } from "../logger";
import type { PluginRuntime } from "../plugin-runtime";
import type { UserMcpRuntime } from "../user-mcp";
diff --git a/apps/desktop/electron/main/runtime/sidecar.ts b/apps/desktop/electron/main/runtime/sidecar.ts
index d12348d66..4dd25afae 100644
--- a/apps/desktop/electron/main/runtime/sidecar.ts
+++ b/apps/desktop/electron/main/runtime/sidecar.ts
@@ -19,7 +19,6 @@ import type { InflightCheckpointer } from "@pi-desktop/host-runtime";
import { summarizeToolResult, type Logger } from "../logger";
import type { ModelsDevCatalog } from "../models-dev-catalog";
import type { PluginRuntime } from "../plugin-runtime";
-import type { UserMcpRuntime } from "../user-mcp";
import type { RuntimeState } from "./context";
import type { FinishTurn } from "./plans";
diff --git a/apps/desktop/electron/main/services/plugin-services.ts b/apps/desktop/electron/main/services/plugin-services.ts
index 98bf9259d..fa35b87a7 100644
--- a/apps/desktop/electron/main/services/plugin-services.ts
+++ b/apps/desktop/electron/main/services/plugin-services.ts
@@ -50,7 +50,6 @@ import { PluginViewHost } from "../plugin-view-host";
import { BrowserPane } from "../browser-view";
import { BrowserHost, BROWSER_PLUGIN_ID } from "../browser-host";
import { OAUTH_AUTH_KIND, type VendorOAuth } from "../oauth";
-import type { AgentExtensionBridge } from "../agent-extensions";
import type { ClipboardHistory } from "../clipboard-history";
import type { TurnEndedPayload } from "../runtime/session-coordination";
import type { HostProcess } from "../host-process";
@@ -77,7 +76,6 @@ export type PluginServicesDependencies = {
getWorkspacePath: () => string | null;
resolveAgentRuntimeLaunch: (...args: any[]) => Promise<any>;
vendorOAuth: VendorOAuth;
- agentExtensions: AgentExtensionBridge;
};
export function createPluginServices({
@@ -98,7 +96,6 @@ export function createPluginServices({
getWorkspacePath,
resolveAgentRuntimeLaunch,
vendorOAuth,
- agentExtensions,
}: PluginServicesDependencies) {
// A plugin request can lose its race with host shutdown or restart.
const isHostUnavailable = (error: unknown): boolean =>
diff --git a/apps/desktop/src/components/Composer.tsx b/apps/desktop/src/components/Composer.tsx
index abf119faa..5cfe2b262 100644
--- a/apps/desktop/src/components/Composer.tsx
+++ b/apps/desktop/src/components/Composer.tsx
@@ -24,7 +24,6 @@ import { headAsk, queuedAskCount } from "../lib/pending-asks";
import type { QueuedPrompt } from "../lib/queued-prompts";
import { composerModelDisplayName, sameComposerModelId } from "../lib/composer-models";
import {
- providerThinkingLevels,
resolveComposerThinkingProvider,
} from "../lib/session-thinking";
import {
@@ -42,7 +41,6 @@ import {
isThinkingLevel,
thinkingLevelForProvider,
thinkingProviderForModel,
- THINKING_LEVELS,
type ComposerPrefill,
} from "../features/chat/composer/model";
import {
@@ -368,7 +366,6 @@ export function Composer({
const configuredThinkingLevel = isThinkingLevel(sessionThinkingLevel)
? sessionThinkingLevel
: "off";
- const availableThinkingLevels = providerThinkingLevels(thinkingProvider);
const thinkingLevel = thinkingLevelForProvider(
thinkingProvider,
configuredThinkingLevel,
@@ -626,7 +623,6 @@ export function Composer({
enhancementUndoText={enhancementUndoText}
enhancePrompt={enhancePrompt}
undoPromptEnhancement={undoPromptEnhancement}
- clearEnhancementError={clearEnhancementError}
runActive={runActive}
hasDraftContent={hasDraftContent}
abort={abort}
diff --git a/apps/desktop/src/components/settings/McpMarketPanel.tsx b/apps/desktop/src/components/settings/McpMarketPanel.tsx
index c603e9fd0..9b5a15289 100644
--- a/apps/desktop/src/components/settings/McpMarketPanel.tsx
+++ b/apps/desktop/src/components/settings/McpMarketPanel.tsx
@@ -90,14 +90,6 @@ function loadSources(allowInsecureHttp = false): MarketSource[] {
}
}
-function saveSources(sources: MarketSource[]): void {
- try {
- window.localStorage?.setItem(SOURCES_STORAGE_KEY, JSON.stringify(sources));
- } catch {
- // Persistence is best-effort; the list stays alive for this session.
- }
-}
-
/**
* The market view of the MCP settings page: browse the builtin catalog,
* install with one click. An install only ever produces a regular user
diff --git a/apps/desktop/src/components/settings/SkillMarketPanel.tsx b/apps/desktop/src/components/settings/SkillMarketPanel.tsx
index aead607d9..c6d9a09c8 100644
--- a/apps/desktop/src/components/settings/SkillMarketPanel.tsx
+++ b/apps/desktop/src/components/settings/SkillMarketPanel.tsx
@@ -26,7 +26,7 @@ import {
IconListChecks,
IconX,
} from "../icons";
-import { Field, Input, TooltipButton, cx } from "../ui";
+import { Input, TooltipButton, cx } from "../ui";
import { LatestWinsGate } from "../../lib/latest-wins";
import {
classifySkillMarketFailure,
diff --git a/apps/desktop/src/components/ui.tsx b/apps/desktop/src/components/ui.tsx
index 08ff6e781..d8c54c06b 100644
--- a/apps/desktop/src/components/ui.tsx
+++ b/apps/desktop/src/components/ui.tsx
@@ -364,7 +364,6 @@ export function Tooltip({
label,
children,
className,
- ariaLabel,
disabled = false,
delayMs = 300,
hideDelayMs = 100,
diff --git a/apps/desktop/src/features/chat/composer/ComposerToolbar.tsx b/apps/desktop/src/features/chat/composer/ComposerToolbar.tsx
index 648af3240..09b4315cf 100644
--- a/apps/desktop/src/features/chat/composer/ComposerToolbar.tsx
+++ b/apps/desktop/src/features/chat/composer/ComposerToolbar.tsx
@@ -58,7 +58,6 @@ export type ComposerToolbarProps = {
enhancementUndoText: string | null;
enhancePrompt: () => Promise<void>;
undoPromptEnhancement: () => void;
- clearEnhancementError: () => void;
runActive: boolean;
hasDraftContent: boolean;
abort: AppState["abort"];
@@ -97,7 +96,6 @@ export function ComposerToolbar({
enhancementUndoText,
enhancePrompt,
undoPromptEnhancement,
- clearEnhancementError,
runActive,
hasDraftContent,
abort,
diff --git a/apps/desktop/src/features/chat/composer/hooks/useComposerAttachments.ts b/apps/desktop/src/features/chat/composer/hooks/useComposerAttachments.ts
index f0afce4a7..6fd3e5fd7 100644
--- a/apps/desktop/src/features/chat/composer/hooks/useComposerAttachments.ts
+++ b/apps/desktop/src/features/chat/composer/hooks/useComposerAttachments.ts
@@ -150,7 +150,7 @@ export function useComposerAttachments({
}
showToast(t, "chat.filesAttached", { count: chips.length }, "success");
} catch (error) {
- showErrorToast(t, error);
+ showErrorToast(error);
} finally {
pickerInFlight.current = false;
setPasting(false);
@@ -247,7 +247,7 @@ export function useComposerAttachments({
"success",
);
} catch (error) {
- showErrorToast(t, error);
+ showErrorToast(error);
} finally {
setPasting(false);
}
@@ -354,7 +354,7 @@ export function useComposerAttachments({
}
if (chips.length) showToast(t, "chat.filesAttached", { count: chips.length }, "success");
} catch (error) {
- showErrorToast(t, error);
+ showErrorToast(error);
} finally {
setPasting(false);
}
@@ -386,7 +386,7 @@ export function useComposerAttachments({
if (directory.path) await useAppStore.getState().activateProject(directory.path);
}
} catch (error) {
- showErrorToast(t, error);
+ showErrorToast(error);
}
};
@@ -446,7 +446,7 @@ function showToast(
useAppStore.getState().showToast(t(key, options), { variant });
}
-function showErrorToast(t: TFunction, error: unknown): void {
+function showErrorToast(error: unknown): void {
useAppStore
.getState()
.showToast(error instanceof Error ? error.message : String(error), { variant: "error" });
diff --git a/apps/desktop/src/features/chat/composer/hooks/useComposerSubmit.ts b/apps/desktop/src/features/chat/composer/hooks/useComposerSubmit.ts
index d6c8c8dfc..4599fe990 100644
--- a/apps/desktop/src/features/chat/composer/hooks/useComposerSubmit.ts
+++ b/apps/desktop/src/features/chat/composer/hooks/useComposerSubmit.ts
@@ -9,7 +9,6 @@ import {
} from "@pi-desktop/shared";
import type { AppState } from "../../../../stores/app-store";
import { useAppStore } from "../../../../stores/app-store";
-import type { ComposerDraftSnapshot } from "../../../../lib/composer-smart-stop";
import { api } from "../../../../lib/api";
import { draftKeyForSession } from "../../../../lib/composer-draft-cache";
import { runExtensionCommand, runPaletteCommand } from "../../../../lib/commands";
diff --git a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx
index 18c1718c1..5f45267cd 100644
--- a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx
+++ b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx
@@ -7,7 +7,6 @@ import {
useContext,
useEffect,
useId,
- useMemo,
useRef,
useState,
} from "react";
@@ -29,7 +28,6 @@ import {
} from "../../../lib/assistant-turns";
import {
delegationRoster,
- delegationRosterOutcome,
delegationRosterSummary,
collectDelegationStatuses,
collectDelegationTimings,
diff --git a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx
index 6b1fae558..974448401 100644
--- a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx
+++ b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx
@@ -18,7 +18,6 @@ import {
assistantTurnResponseOutputTokens,
assistantTurnUsage,
reuseReadonlyMap,
- subagentRunsEqual,
type AssistantTurnEntry,
type AssistantTurnPart,
type TranscriptEntry,
diff --git a/apps/desktop/src/features/chat/transcript/hooks/useTranscriptScroll.ts b/apps/desktop/src/features/chat/transcript/hooks/useTranscriptScroll.ts
index ab17de47f..45ecd37d2 100644
--- a/apps/desktop/src/features/chat/transcript/hooks/useTranscriptScroll.ts
+++ b/apps/desktop/src/features/chat/transcript/hooks/useTranscriptScroll.ts
@@ -36,7 +36,6 @@ import {
isRecentScrollGesture,
isScrollGestureInput,
reduceTranscriptScroll,
- SCROLL_OWNER_ATTRIBUTE,
transcriptHasLayout,
TRANSCRIPT_SCROLL_ROUNDING_TOLERANCE_PX,
type ScrollInputType,
@@ -46,8 +45,6 @@ import { useDisclosureAnchor } from "../../../../hooks/use-disclosure-anchor";
import type { TranscriptSearchTarget } from "../../../../lib/transcript-reading";
import { useTranscriptSearchFocus } from "../../../../hooks/use-transcript-search-focus";
-import { useAppStore } from "../../../../stores/app-store";
-
type UseTranscriptScrollOptions = {
sessionId: string | undefined;
messages: UiMessage[];
diff --git a/apps/desktop/src/features/chat/transcript/shared.tsx b/apps/desktop/src/features/chat/transcript/shared.tsx
index 934859444..0d3effde7 100644
--- a/apps/desktop/src/features/chat/transcript/shared.tsx
+++ b/apps/desktop/src/features/chat/transcript/shared.tsx
@@ -15,8 +15,6 @@ import type {
import {
formatCompactTokenCount,
isCertificateVerificationError,
- THINKING_LEVELS,
- type ThinkingLevel,
} from "@pi-desktop/shared";
import { useOpenChatFileRef, useOpenPreviewTarget } from "../../../hooks/use-preview-target";
import { useChatFileMenu } from "../../../hooks/use-chat-file-menu";
@@ -31,7 +29,7 @@ import { useReferencedImageDataUrl } from "../../../lib/use-referenced-image-dat
import { useVerifiedChatText } from "../../../hooks/use-verified-chat-text";
import { isHtmlFilePath } from "../../../lib/chat-links";
import type { SourcePositionProps } from "../../../lib/markdown-source";
-import { getToolAction, type ToolAction } from "../../../lib/tool-display";
+import type { ToolAction } from "../../../lib/tool-display";
import { calculateTokenRate } from "../../../lib/context-usage";
import { useAppStore } from "../../../stores/app-store";
import { Markdown, useCopy } from "../../../components/Markdown";
@@ -41,7 +39,6 @@ import {
IconBot,
IconBranch,
IconCheck,
- IconChevronDown,
IconChevronRight,
IconCircleAlert,
IconCode,
diff --git a/apps/desktop/src/features/plugins/InstalledPluginsPanel.tsx b/apps/desktop/src/features/plugins/InstalledPluginsPanel.tsx
index 616f8b174..e6abe19b2 100644
--- a/apps/desktop/src/features/plugins/InstalledPluginsPanel.tsx
+++ b/apps/desktop/src/features/plugins/InstalledPluginsPanel.tsx
@@ -25,8 +25,6 @@ export function InstalledPluginsPanel({
loadDev,
setTemplatePick,
installedGroups,
- filteredInstalled,
- installedQuery,
setInstalledQuery,
rowMenu,
setRowMenu,
diff --git a/apps/desktop/src/features/plugins/MarketplacePanel.tsx b/apps/desktop/src/features/plugins/MarketplacePanel.tsx
index f23d26354..74431b79b 100644
--- a/apps/desktop/src/features/plugins/MarketplacePanel.tsx
+++ b/apps/desktop/src/features/plugins/MarketplacePanel.tsx
@@ -3,12 +3,9 @@ import { IconCheck, IconSearch, IconShield } from "../../components/icons";
import { MarketplaceSourceSettings } from "../../components/plugins/MarketplaceSourceSettings";
import { PermissionChips } from "./presentation";
import {
- formatBytes,
formatDate,
monogram,
showsVerifiedBadge,
- versionInstallable,
- versionWithdrawn,
} from "./model";
import type { PluginsPageModel } from "./usePluginsPage";
diff --git a/apps/desktop/src/features/plugins/PluginDialogs.tsx b/apps/desktop/src/features/plugins/PluginDialogs.tsx
index 7f02a8c5e..623897393 100644
--- a/apps/desktop/src/features/plugins/PluginDialogs.tsx
+++ b/apps/desktop/src/features/plugins/PluginDialogs.tsx
@@ -11,7 +11,6 @@ import {
permissionRisk,
} from "./model";
import type { PluginsPageModel } from "./usePluginsPage";
-import type { PluginPermissionReview } from "@pi-desktop/shared";
export function PluginDialogs({
t,
diff --git a/apps/desktop/src/features/plugins/model.ts b/apps/desktop/src/features/plugins/model.ts
index d1766c098..ba7250f4d 100644
--- a/apps/desktop/src/features/plugins/model.ts
+++ b/apps/desktop/src/features/plugins/model.ts
@@ -1,7 +1,6 @@
import type {
MarketPluginSummary,
PluginCapability,
- PluginFsPolicy,
PluginSummary,
} from "@pi-desktop/shared";
diff --git a/apps/desktop/src/features/plugins/usePluginsPage.ts b/apps/desktop/src/features/plugins/usePluginsPage.ts
index 4ae77b0aa..426048116 100644
--- a/apps/desktop/src/features/plugins/usePluginsPage.ts
+++ b/apps/desktop/src/features/plugins/usePluginsPage.ts
@@ -4,14 +4,12 @@ import { useAppStore } from "../../stores/app-store";
import { api } from "../../lib/api";
import { usePluginBrowseState } from "./browse-state";
import type {
- ActivationScope,
MarketPluginDetail,
MarketPluginSummary,
PluginPermissionReview,
PluginServiceStatus,
PluginSummary,
ProjectRecord,
- ProjectWorkspace,
} from "@pi-desktop/shared";
import {
GROUP_ORDER,
diff --git a/apps/desktop/src/lib/api.ts b/apps/desktop/src/lib/api.ts
index 3cfd32863..087f900e7 100644
--- a/apps/desktop/src/lib/api.ts
+++ b/apps/desktop/src/lib/api.ts
@@ -17,7 +17,6 @@ import type {
SpeechSynthesizeRequest,
SpeechSynthesizeResult,
SpeechTranscribeRequest,
- SpeechTranscribeResult,
SessionSummarizeTitleRequest,
SessionSummarizeTitleResponse,
AgentStopResponse,
diff --git a/apps/desktop/src/lib/sidebar-preferences.ts b/apps/desktop/src/lib/sidebar-preferences.ts
index a02a8ddc3..55190a37a 100644
--- a/apps/desktop/src/lib/sidebar-preferences.ts
+++ b/apps/desktop/src/lib/sidebar-preferences.ts
@@ -1,4 +1,4 @@
-import type { ProjectWorkspace, SessionSummary, SessionSort } from "@pi-desktop/shared";
+import type { ProjectWorkspace, SessionSort } from "@pi-desktop/shared";
export type { SessionSort } from "@pi-desktop/shared";
export { sortSessions, sessionIsPinned, sessionIsArchived } from "@pi-desktop/shared";
@@ -90,9 +90,6 @@ function object(value: unknown): value is Record<string, unknown> {
function bool(value: unknown): boolean | undefined {
return typeof value === "boolean" ? value : undefined;
}
-function number(value: unknown): number | undefined {
- return typeof value === "number" && Number.isFinite(value) ? value : undefined;
-}
function manualOrder(value: unknown): number | undefined {
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0
? value
diff --git a/apps/desktop/src/lib/tool-presentation.ts b/apps/desktop/src/lib/tool-presentation.ts
index b7ce974fc..146f2fd10 100644
--- a/apps/desktop/src/lib/tool-presentation.ts
+++ b/apps/desktop/src/lib/tool-presentation.ts
@@ -26,7 +26,6 @@ const MAX_HIGHLIGHT_BYTES = 100_000;
const MAX_HIGHLIGHT_LINES = 800;
/** Rendered list caps; the remainder is reported, never silently dropped. */
const MAX_LIST_ITEMS = 200;
-const MAX_DIFF_LINES = 400;
const DIFF_CONTEXT_LINES = 2;
/** Longer single-line strings become their own block instead of a field row. */
const MAX_FIELD_VALUE = 120;
@@ -335,20 +334,6 @@ export function buildDiffLines(
return lines;
}
-function diffBlock(oldText: string, newText: string): ToolBlock | null {
- const lines = buildDiffLines(oldText, newText);
- if (!lines.some((line) => line.type !== "context")) return null;
- const sign = (line: ToolDiffLine) =>
- line.type === "add" ? "+" : line.type === "del" ? "-" : " ";
- return {
- kind: "diff",
- role: "diff",
- lines: lines.slice(0, MAX_DIFF_LINES),
- hidden: Math.max(0, lines.length - MAX_DIFF_LINES),
- copy: lines.map((line) => `${sign(line)}${line.text}`).join("\n"),
- };
-}
-
function filesBlock(paths: string[], label?: string): ToolBlock | null {
if (paths.length === 0) return null;
return {
diff --git a/apps/desktop/src/stores/app-store.ts b/apps/desktop/src/stores/app-store.ts
index a632c7ca1..5588be5d2 100644
--- a/apps/desktop/src/stores/app-store.ts
+++ b/apps/desktop/src/stores/app-store.ts
@@ -1,160 +1,49 @@
import { create } from "zustand";
-import i18n from "i18next";
import type {
- AgentEventEnvelope,
- AgentStatus,
- AskToolResolution,
- AppNotification,
AppSettings,
- AppVersionInfo,
- ContextCompactionMark,
- ContextCompactionRecord,
ModelInfo,
- OnboardingState,
- Mode,
- PlanResolveRequest,
- PlanResolutionResult,
PlanningState,
- PlanningStateEvent,
- PluginSummary,
- PluginTheme,
- PluginViewMeta,
- PermissionMode,
- ProjectWorkspace,
- ProviderPublic,
- ReviewRollbackResult,
- SessionDetail,
- SessionSummary,
- ThinkingLevel,
} from "@pi-desktop/shared";
import {
- contextCompactionMark,
- ErrorCodes as SharedErrorCodes,
- initialThinkingLevelForBinding,
migrateKeybindingOverrides,
- modelIdsMatch,
normalizeMode,
- normalizeProposalKind,
PROTOCOL_VERSION,
} from "@pi-desktop/shared";
import { api } from "../lib/api";
-import type { SettingsTabId } from "../lib/settings-search";
-import { createNavigationIntentController } from "../lib/navigation-intent";
-import { scheduleHomeDraftAdopt } from "../lib/composer-draft-cache";
-import {
- commitForkedSessionState,
- forkedSessionMessages,
- FORKED_SESSION_WINDOW,
-} from "../lib/session-fork";
-import {
- EMPTY_SESSION_WINDOW,
- sessionIsReusableEmpty,
-} from "../lib/session-create";
-import {
- rememberProject,
- renameRecentProject,
- setProjectPinned,
-} from "../lib/recent-projects";
-import { applyOptimisticSessionConfiguration } from "../lib/session-thinking";
+import { rememberProject } from "../lib/recent-projects";
import {
RETAINED_SESSION_PANE_LIMIT,
clearSessionPanes,
- releaseSessionPane,
- retainSessionPane,
} from "../lib/session-panes";
-import {
- dedupeSessionMessages,
- mergeLiveSessionMessages,
- removeLiveSessionMessage,
- optimisticUserMessage,
- upsertLiveSessionMessage,
- durableCoversLiveSessionMessages,
-} from "../lib/session-transcript";
import {
latestSessionOutcomes,
- type SidebarSessionOutcome,
} from "../lib/sidebar-session-status";
import {
- loadSidebarPreferences,
- projectIsArchived,
- projectIsCollapsed,
- projectIsPinned,
projectWorkspaceFromPath,
saveSidebarPreferences,
- sortProjects,
- sortSessions,
- normalizeProjectName,
- type ProjectSort,
- type SessionSort,
} from "../lib/sidebar-preferences";
-import { settleStoppedAssistantMetrics } from "../lib/context-usage";
-import { formatToolValue } from "../lib/tool-display";
-import { withReviewChangeState } from "../lib/workspace-review";
-import {
- clearSessionPermissions,
- enqueuePermission,
- headPermission,
- removePermission,
- removePermissionForToolCall,
- sessionPermissions,
- type PermissionQueues,
-} from "../lib/pending-permissions";
-import {
- clearSessionAsks,
- enqueueAsk,
- headAsk,
- removeAsk,
- removeAskForToolCall,
- type AskQueues,
-} from "../lib/pending-asks";
import {
WORK_PANEL_DEFAULT_WIDTH,
WORK_PANEL_MIN_WIDTH,
} from "../lib/work-panel-resize";
import {
- isActivePlanExecution,
isPendingPlan,
latestPlanProposal,
- mergePlanCheckpoint,
- terminalizeMissingPlan,
} from "../lib/plan-mode-state";
-import {
- resolveComposerSmartStop,
- type ComposerPrefill,
-} from "../lib/composer-smart-stop";
-import {
- enqueueQueuedPrompt,
- promoteQueuedPrompt,
- queuedPromptForSession,
- removeQueuedPrompt,
- type QueuedPrompt,
- type QueuedPrompts,
-} from "../lib/queued-prompts";
-import type { AgentQueueChangedEvent, QueuedTurnSummary } from "@pi-desktop/shared";
import { settleBootstrapRequests } from "../lib/bootstrap-result";
import {
createSessionRuntime,
type SessionRuntime,
- type SubmittedComposerDraft,
} from "./runtime/session-runtime";
import type { StoreAccess } from "./slices/types";
import {
createWorkPanelSlice,
- currentWorkPanelContext,
switchWorkPanelSession,
} from "./slices/work-panel-slice";
import {
createInitialState,
initialSidebarPreferences,
} from "./slices/initial-state";
-import type {
- AgentTurnResult,
- DraftSessionConfiguration,
- PendingPlanRefreshResult,
- ToastItem,
- ToastOptions,
- ToastVariant,
-} from "./app-state";
import { createSessionSlice } from "./slices/session-slice";
import { createQueueSlice } from "./slices/queue-slice";
import { createTranscriptSlice } from "./slices/transcript-slice";
diff --git a/apps/desktop/src/stores/slices/catalog-slice.ts b/apps/desktop/src/stores/slices/catalog-slice.ts
index e30884cd1..300d39641 100644
--- a/apps/desktop/src/stores/slices/catalog-slice.ts
+++ b/apps/desktop/src/stores/slices/catalog-slice.ts
@@ -1,7 +1,5 @@
import type {
AppNotification,
- ModelInfo,
- ProviderPublic,
SessionSummary,
} from "@pi-desktop/shared";
import { api } from "../../lib/api";
diff --git a/apps/desktop/src/stores/slices/interaction-slice.ts b/apps/desktop/src/stores/slices/interaction-slice.ts
index 978bf6bd1..8ed8f6388 100644
--- a/apps/desktop/src/stores/slices/interaction-slice.ts
+++ b/apps/desktop/src/stores/slices/interaction-slice.ts
@@ -12,7 +12,7 @@ import {
headPermission,
removePermission,
} from "../../lib/pending-permissions";
-import type { AppState, ToastOptions } from "../app-state";
+import type { AppState } from "../app-state";
import type { InteractionRuntime } from "../runtime/interaction-runtime";
import type { SessionRuntime } from "../runtime/session-runtime";
import type { StoreAccess } from "./types";
diff --git a/apps/desktop/src/stores/slices/project-slice.ts b/apps/desktop/src/stores/slices/project-slice.ts
index dc48e8247..ecc20fa00 100644
--- a/apps/desktop/src/stores/slices/project-slice.ts
+++ b/apps/desktop/src/stores/slices/project-slice.ts
@@ -1,8 +1,5 @@
import i18n from "i18next";
-import type {
- ProjectWorkspace,
- SessionSummary,
-} from "@pi-desktop/shared";
+import type { ProjectWorkspace } from "@pi-desktop/shared";
import { api } from "../../lib/api";
import {
rememberProject,
@@ -30,9 +27,6 @@ import {
sortSessions,
normalizeProjectName,
type ProjectMeta,
- type ProjectSort,
- type SessionMeta,
- type SessionSort,
} from "../../lib/sidebar-preferences";
import {
normalizeProjectPath,
diff --git a/apps/desktop/src/stores/slices/queue-slice.ts b/apps/desktop/src/stores/slices/queue-slice.ts
index a990c9e07..64163a88f 100644
--- a/apps/desktop/src/stores/slices/queue-slice.ts
+++ b/apps/desktop/src/stores/slices/queue-slice.ts
@@ -4,7 +4,6 @@ import type {
AgentQueueChangedEvent,
AgentPromptAttachment,
AppError,
- SessionSummary,
UiMessage,
QueuedTurnSummary,
} from "@pi-desktop/shared";
@@ -18,7 +17,6 @@ import {
removeQueuedPrompt,
reorderQueuedPrompt,
type QueuedPrompt,
- type QueuedPromptDirection,
} from "../../lib/queued-prompts";
import type {
ComposerDraftSnapshot,
diff --git a/apps/desktop/src/stores/slices/session-slice.ts b/apps/desktop/src/stores/slices/session-slice.ts
index d7f48174a..87e819a05 100644
--- a/apps/desktop/src/stores/slices/session-slice.ts
+++ b/apps/desktop/src/stores/slices/session-slice.ts
@@ -25,7 +25,6 @@ import {
retainSessionPane,
} from "../../lib/session-panes";
import {
- normalizeProjectPath,
projectPathsForNewSessions,
sessionMatchesProject,
} from "../../lib/sidebar-session-groups";
@@ -47,12 +46,9 @@ import { sessionReadLooksEmpty } from "../../lib/session-transcript-read";
import type {
AppState,
DraftSessionConfiguration,
- NavigationOptions,
- PendingPlanRefreshResult,
SessionHistoryWindow,
} from "../app-state";
import {
- type SessionConfiguration,
type SessionRuntime,
} from "../runtime/session-runtime";
import type { StoreAccess } from "./types";
diff --git a/apps/desktop/src/stores/slices/transcript-slice.ts b/apps/desktop/src/stores/slices/transcript-slice.ts
index 52c26780d..7379b2bbe 100644
--- a/apps/desktop/src/stores/slices/transcript-slice.ts
+++ b/apps/desktop/src/stores/slices/transcript-slice.ts
@@ -1,6 +1,5 @@
import i18n from "i18next";
import type {
- ReviewRollbackResult,
UiMessage,
} from "@pi-desktop/shared";
import { api } from "../../lib/api";
diff --git a/apps/desktop/src/stores/slices/work-panel-slice.ts b/apps/desktop/src/stores/slices/work-panel-slice.ts
index 1e2df303a..1d976fab1 100644
--- a/apps/desktop/src/stores/slices/work-panel-slice.ts
+++ b/apps/desktop/src/stores/slices/work-panel-slice.ts
@@ -13,7 +13,6 @@ import {
subagentWorkPanelTab,
switchWorkPanelContextState,
type WorkPanelContext,
- type WorkPanelTab,
} from "../../lib/work-panel-tabs";
import {
WORK_PANEL_COMPACT_MIN_WIDTH,
diff --git a/apps/pi-host/src/app.ts b/apps/pi-host/src/app.ts
index 31833564c..f319795e7 100644
--- a/apps/pi-host/src/app.ts
+++ b/apps/pi-host/src/app.ts
@@ -1,5 +1,4 @@
import { mkdir } from "node:fs/promises";
-import { join } from "node:path";
import { AgentHost, type ApprovalPort } from "@pi-desktop/agent-host";
import {
diff --git a/packages/agent-host/src/agent-host.ts b/packages/agent-host/src/agent-host.ts
index caa6cdd41..8901bf8d8 100644
--- a/packages/agent-host/src/agent-host.ts
+++ b/packages/agent-host/src/agent-host.ts
@@ -25,7 +25,6 @@ import type {
RacpSessionStatus,
RacpTurn,
RacpTurnAdmission,
- ToolPermissionRequest,
UiMessage,
} from "@pi-desktop/shared";
import {
diff --git a/packages/agent-runtime/src/model-capabilities.ts b/packages/agent-runtime/src/model-capabilities.ts
index e7a04c7a5..4593188e0 100644
--- a/packages/agent-runtime/src/model-capabilities.ts
+++ b/packages/agent-runtime/src/model-capabilities.ts
@@ -4,7 +4,6 @@ import {
type ModelBinding,
type ModelInfo,
type ModelModality,
- type ThinkingLevel,
} from "@pi-desktop/shared";
import type { ModelConfig, ThinkingCapabilitySet } from "./thinking-level.js";
diff --git a/packages/agent-runtime/src/runtime.ts b/packages/agent-runtime/src/runtime.ts
index 7ce1a2cf6..900cfb869 100644
--- a/packages/agent-runtime/src/runtime.ts
+++ b/packages/agent-runtime/src/runtime.ts
@@ -1564,7 +1564,6 @@ export class DesktopAgentRuntime {
private models: Models;
private model: Model<Api>;
private turnId?: string;
- private hostTurnId?: string;
private disposed = false;
readonly sessionId: string;
private mode: Mode;
@@ -1773,7 +1772,6 @@ export class DesktopAgentRuntime {
constructor(opts: AgentRuntimeOptions) {
this.sessionId = opts.sessionId;
- this.hostTurnId = opts.turnId;
this.turnId = opts.turnId;
this.mode = opts.mode;
this.planningState = proposalKindForMode(this.mode) ? "planning" : "inactive";
@@ -1968,7 +1966,7 @@ Do not invent objections or turn speculative risks into blockers. Stop when the
headers: () => this.providerRetryHeaders,
status: () => this.providerResponseStatus,
failure: () => this.providerFetchFailure,
- onRetry: ({ error, phase, attempt, delayMs }) => {
+ onRetry: ({ error, attempt, delayMs }) => {
this.setAgentActivity({
phase: "retrying",
since: Date.now(),
@@ -4887,7 +4885,7 @@ Do not invent objections or turn speculative risks into blockers. Stop when the
),
}),
executionMode: "sequential",
- execute: async (toolCallId, params, signal) => {
+ execute: async (_toolCallId, params, signal) => {
const ids =
isRecord(params) && Array.isArray(params.delegationIds)
? params.delegationIds.map(String)
@@ -7821,7 +7819,6 @@ Do not invent objections or turn speculative risks into blockers. Stop when the
// Claims are message-scoped: a later prompt must observe edited or newly
// created instruction files instead of reusing a previous chain.
this.pathInstructionClaims.clear();
- this.hostTurnId = durableTurnId;
this.turnId = durableTurnId;
this.acceptingSteering = true;
this.pendingUserMessageId = undefined;
@@ -7929,7 +7926,6 @@ Do not invent objections or turn speculative risks into blockers. Stop when the
: input;
this.retainPendingSteering();
const nextTurnId = durableTurnId?.trim() || randomUUID();
- this.hostTurnId = nextTurnId;
this.turnId = nextTurnId;
this.acceptingSteering = true;
this.gracefulStopRequested = false;
diff --git a/packages/agent-runtime/src/subagent-context.ts b/packages/agent-runtime/src/subagent-context.ts
index a87ba7b3e..43d79fc97 100644
--- a/packages/agent-runtime/src/subagent-context.ts
+++ b/packages/agent-runtime/src/subagent-context.ts
@@ -41,7 +41,6 @@ import {
contextBudgetLimitsFor,
retainedUserMessageBudget,
type ContextBudget,
- type ContextBudgetModel,
type ContextBudgetModelInput,
} from "./context-budget.js";
import {
diff --git a/packages/plugin-sdk/src/index.ts b/packages/plugin-sdk/src/index.ts
index e11db4baa..3483a13b7 100644
--- a/packages/plugin-sdk/src/index.ts
+++ b/packages/plugin-sdk/src/index.ts
@@ -8,7 +8,6 @@ import {
import { validateMcpServer } from "./mcp-config.js";
import { parseNetDomains, type PluginNetDomain } from "./net-policy.js";
import {
- isExternalThemeAssetPath,
isThemeAssetPath,
normalizeThemeAssetPath,
THEME_ASSET_EXTENSIONS,
diff --git a/packages/voice-runtime/src/model-manager.ts b/packages/voice-runtime/src/model-manager.ts
index 88f15d4d0..d0511ad58 100644
--- a/packages/voice-runtime/src/model-manager.ts
+++ b/packages/voice-runtime/src/model-manager.ts
@@ -1,7 +1,7 @@
import { EventEmitter } from "node:events";
import { existsSync } from "node:fs";
import path from "node:path";
-import type { ModelInfo, ModelState, ModelStatus } from "./types.js";
+import type { ModelInfo, ModelState } from "./types.js";
import { findModel, getCatalog } from "./model-catalog.js";
/**
diff --git a/packages/voice-runtime/src/voice-controller.ts b/packages/voice-runtime/src/voice-controller.ts
index c91e0fdd8..02c63edab 100644
--- a/packages/voice-runtime/src/voice-controller.ts
+++ b/packages/voice-runtime/src/voice-controller.ts
@@ -1,13 +1,12 @@
import { EventEmitter } from "node:events";
import { PcmChunker } from "./pcm-chunker.js";
-import { convertFrames, computeRms } from "./pcm-utils.js";
+import { convertFrames } from "./pcm-utils.js";
import { TranscriptionEngine } from "./transcription-engine.js";
import type {
AudioCapture,
AudioCaptureFactory,
TranscribeOptions,
TranscriptionStream,
- VoicePhase,
VoiceResult,
VoiceSettings,
VoiceState,