chore: apply oxlint fix-suggestions (unused imports + useless fragments)

Scoped to only `no-unused-vars` and `react/jsx-no-useless-fragment` —
the safe subset of --fix-suggestions. Primary changes:

- Remove unused named imports from statements
- Remove unused default/type imports entirely
- Collapse `<><Single/></>` fragments to `<Single/>`

Verified clean: typecheck + format + lint all green.
This commit is contained in:
Mohamed Boudra
2026-04-23 21:55:25 +07:00
parent 731c570b25
commit cda3d1d46c
49 changed files with 70 additions and 207 deletions
-1
View File
@@ -17,7 +17,6 @@ import {
} from "./helpers/launcher"; } from "./helpers/launcher";
import { import {
connectTerminalClient, connectTerminalClient,
waitForTerminalContent,
setupDeterministicPrompt, setupDeterministicPrompt,
type TerminalPerfDaemonClient, type TerminalPerfDaemonClient,
} from "./helpers/terminal-perf"; } from "./helpers/terminal-perf";
+1 -2
View File
@@ -20,7 +20,7 @@ import {
useRef, useRef,
useState, useState,
} from "react"; } from "react";
import { Platform, Text, View } from "react-native"; import { View } from "react-native";
import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler"; import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
import { KeyboardProvider } from "react-native-keyboard-controller"; import { KeyboardProvider } from "react-native-keyboard-controller";
import { Extrapolation, interpolate, runOnJS, useSharedValue } from "react-native-reanimated"; import { Extrapolation, interpolate, runOnJS, useSharedValue } from "react-native-reanimated";
@@ -82,7 +82,6 @@ import { resolveActiveHost } from "@/utils/active-host";
import { toggleDesktopSidebarsWithCheckoutIntent } from "@/utils/desktop-sidebar-toggle"; import { toggleDesktopSidebarsWithCheckoutIntent } from "@/utils/desktop-sidebar-toggle";
import { import {
buildHostRootRoute, buildHostRootRoute,
decodeWorkspaceIdFromPathSegment,
mapPathnameToServer, mapPathnameToServer,
parseHostAgentRouteFromPathname, parseHostAgentRouteFromPathname,
parseServerIdFromPathname, parseServerIdFromPathname,
@@ -28,7 +28,7 @@ import type {
} from "@server/server/agent/agent-sdk-types"; } from "@server/server/agent/agent-sdk-types";
import type { AgentProviderDefinition } from "@server/server/agent/provider-manifest"; import type { AgentProviderDefinition } from "@server/server/agent/provider-manifest";
import { getModeVisuals, type AgentModeIcon } from "@server/server/agent/provider-manifest"; import { getModeVisuals, type AgentModeIcon } from "@server/server/agent/provider-manifest";
import { Combobox, ComboboxItem, ComboboxEmpty } from "@/components/ui/combobox"; import { Combobox, ComboboxItem } from "@/components/ui/combobox";
import { import {
IsolatedBottomSheetModal, IsolatedBottomSheetModal,
useIsolatedBottomSheetVisibility, useIsolatedBottomSheetVisibility,
@@ -40,11 +40,7 @@ import type {
AgentProvider, AgentProvider,
} from "@server/server/agent/agent-sdk-types"; } from "@server/server/agent/agent-sdk-types";
import type { AgentProviderDefinition } from "@server/server/agent/provider-manifest"; import type { AgentProviderDefinition } from "@server/server/agent/provider-manifest";
import { import { getModeVisuals, type AgentModeColorTier } from "@server/server/agent/provider-manifest";
getModeVisuals,
type AgentModeColorTier,
type AgentModeIcon,
} from "@server/server/agent/provider-manifest";
import { import {
getFeatureHighlightColor, getFeatureHighlightColor,
getFeatureTooltip, getFeatureTooltip,
@@ -1154,36 +1150,34 @@ export function DraftAgentStatusBar({
})); }));
return ( return (
<> <ControlledStatusBar
<ControlledStatusBar provider={selectedProvider ?? ""}
provider={selectedProvider ?? ""} providerDefinitions={providerDefinitions}
providerDefinitions={providerDefinitions} allProviderModels={allProviderModels}
allProviderModels={allProviderModels} modeOptions={hasSelectedProvider ? mappedModeOptions : undefined}
modeOptions={hasSelectedProvider ? mappedModeOptions : undefined} selectedModeId={effectiveSelectedMode}
selectedModeId={effectiveSelectedMode} onSelectMode={onSelectMode}
onSelectMode={onSelectMode} modelOptions={modelOptions}
modelOptions={modelOptions} selectedModelId={selectedModel}
selectedModelId={selectedModel} onSelectModel={(modelId) => onSelectModel(modelId)}
onSelectModel={(modelId) => onSelectModel(modelId)} onSelectProviderAndModel={onSelectProviderAndModel}
onSelectProviderAndModel={onSelectProviderAndModel} isModelLoading={isAllModelsLoading}
isModelLoading={isAllModelsLoading} favoriteKeys={favoriteKeys}
favoriteKeys={favoriteKeys} onToggleFavoriteModel={(provider, modelId) => {
onToggleFavoriteModel={(provider, modelId) => { void updatePreferences((current) =>
void updatePreferences((current) => toggleFavoriteModel({ preferences: current, provider, modelId }),
toggleFavoriteModel({ preferences: current, provider, modelId }), ).catch((error) => {
).catch((error) => { console.warn("[DraftAgentStatusBar] toggle favorite model failed", error);
console.warn("[DraftAgentStatusBar] toggle favorite model failed", error); });
}); }}
}} thinkingOptions={mappedThinkingOptions.length > 0 ? mappedThinkingOptions : undefined}
thinkingOptions={mappedThinkingOptions.length > 0 ? mappedThinkingOptions : undefined} selectedThinkingOptionId={effectiveSelectedThinkingOption}
selectedThinkingOptionId={effectiveSelectedThinkingOption} onSelectThinkingOption={onSelectThinkingOption}
onSelectThinkingOption={onSelectThinkingOption} features={features}
features={features} onSetFeature={onSetFeature}
onSetFeature={onSetFeature} onModelSelectorOpen={onModelSelectorOpen}
onModelSelectorOpen={onModelSelectorOpen} disabled={disabled}
disabled={disabled} />
/>
</>
); );
} }
@@ -3,7 +3,7 @@ import { Pressable, View } from "react-native";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { ChevronDown, GitBranch } from "lucide-react-native"; import { ChevronDown, GitBranch } from "lucide-react-native";
import { StyleSheet, useUnistyles } from "react-native-unistyles"; import { StyleSheet, useUnistyles } from "react-native-unistyles";
import { Combobox, ComboboxItem, type ComboboxOption } from "@/components/ui/combobox"; import { Combobox, ComboboxItem } from "@/components/ui/combobox";
import { useIsCompactFormFactor } from "@/constants/layout"; import { useIsCompactFormFactor } from "@/constants/layout";
import { useHostRuntimeClient, useHostRuntimeIsConnected } from "@/runtime/host-runtime"; import { useHostRuntimeClient, useHostRuntimeIsConnected } from "@/runtime/host-runtime";
import { useToast } from "@/contexts/toast-context"; import { useToast } from "@/contexts/toast-context";
@@ -18,7 +18,6 @@ const IS_WEB = platformIsWeb;
import { Combobox, ComboboxItem } from "@/components/ui/combobox"; import { Combobox, ComboboxItem } from "@/components/ui/combobox";
import { getProviderIcon } from "@/components/provider-icons"; import { getProviderIcon } from "@/components/provider-icons";
import type { FavoriteModelRow } from "@/hooks/use-form-preferences";
import { import {
buildModelRows, buildModelRows,
buildSelectedTriggerLabel, buildSelectedTriggerLabel,
+1 -1
View File
@@ -3,7 +3,7 @@ import { View, Text, ScrollView as RNScrollView } from "react-native";
import { ScrollView as GHScrollView } from "react-native-gesture-handler"; import { ScrollView as GHScrollView } from "react-native-gesture-handler";
import { StyleSheet } from "react-native-unistyles"; import { StyleSheet } from "react-native-unistyles";
import { Fonts } from "@/constants/theme"; import { Fonts } from "@/constants/theme";
import type { DiffLine, DiffSegment } from "@/utils/tool-call-parsers"; import type { DiffLine } from "@/utils/tool-call-parsers";
import { useWebScrollbarStyle } from "@/hooks/use-web-scrollbar-style"; import { useWebScrollbarStyle } from "@/hooks/use-web-scrollbar-style";
import { getCodeInsets } from "./code-insets"; import { getCodeInsets } from "./code-insets";
import { isWeb } from "@/constants/platform"; import { isWeb } from "@/constants/platform";
@@ -21,7 +21,6 @@ import {
Download, Download,
MoreVertical, MoreVertical,
RotateCw, RotateCw,
X,
} from "lucide-react-native"; } from "lucide-react-native";
import { getFileIconSvg } from "@/components/material-file-icons"; import { getFileIconSvg } from "@/components/material-file-icons";
import { LoadingSpinner } from "@/components/ui/loading-spinner"; import { LoadingSpinner } from "@/components/ui/loading-spinner";
@@ -2,13 +2,11 @@ import {
View, View,
Text, Text,
TextInput, TextInput,
Pressable,
ActivityIndicator, ActivityIndicator,
NativeSyntheticEvent, NativeSyntheticEvent,
TextInputContentSizeChangeEventData, TextInputContentSizeChangeEventData,
TextInputKeyPressEventData, TextInputKeyPressEventData,
TextInputSelectionChangeEventData, TextInputSelectionChangeEventData,
BackHandler,
} from "react-native"; } from "react-native";
import { import {
useState, useState,
+1 -2
View File
@@ -36,7 +36,6 @@ import {
ChevronDown, ChevronDown,
Check, Check,
CheckSquare, CheckSquare,
X,
Copy, Copy,
TriangleAlertIcon, TriangleAlertIcon,
Scissors, Scissors,
@@ -54,7 +53,7 @@ import Animated, {
} from "react-native-reanimated"; } from "react-native-reanimated";
import Svg, { Defs, LinearGradient as SvgLinearGradient, Rect, Stop } from "react-native-svg"; import Svg, { Defs, LinearGradient as SvgLinearGradient, Rect, Stop } from "react-native-svg";
import { createMarkdownStyles } from "@/styles/markdown-styles"; import { createMarkdownStyles } from "@/styles/markdown-styles";
import { Colors, Fonts } from "@/constants/theme"; import { Fonts } from "@/constants/theme";
import * as Clipboard from "expo-clipboard"; import * as Clipboard from "expo-clipboard";
import type { TodoEntry, UserMessageImageAttachment } from "@/types/stream"; import type { TodoEntry, UserMessageImageAttachment } from "@/types/stream";
import type { ToolCallDetail } from "@server/server/agent/agent-sdk-types"; import type { ToolCallDetail } from "@server/server/agent/agent-sdk-types";
@@ -10,7 +10,7 @@ import {
type GestureResponderEvent, type GestureResponderEvent,
} from "react-native"; } from "react-native";
import * as Haptics from "expo-haptics"; import * as Haptics from "expo-haptics";
import { useMutation, useQueries } from "@tanstack/react-query"; import { useQueries } from "@tanstack/react-query";
import { import {
useCallback, useCallback,
useMemo, useMemo,
@@ -53,7 +53,6 @@ import {
buildHostNewWorkspaceRoute, buildHostNewWorkspaceRoute,
parseHostWorkspaceRouteFromPathname, parseHostWorkspaceRouteFromPathname,
} from "@/utils/host-routes"; } from "@/utils/host-routes";
import { prepareWorkspaceTab } from "@/utils/workspace-navigation";
import { import {
createSidebarWorkspaceEntry, createSidebarWorkspaceEntry,
type SidebarProjectEntry, type SidebarProjectEntry,
@@ -95,11 +94,7 @@ import {
useIsNavigationProjectActive, useIsNavigationProjectActive,
useIsNavigationWorkspaceSelected, useIsNavigationWorkspaceSelected,
} from "@/stores/navigation-active-workspace-store"; } from "@/stores/navigation-active-workspace-store";
import { import { useSessionStore, type WorkspaceDescriptor } from "@/stores/session-store";
normalizeWorkspaceDescriptor,
useSessionStore,
type WorkspaceDescriptor,
} from "@/stores/session-store";
import { useWorkspaceFields } from "@/stores/session-store-hooks"; import { useWorkspaceFields } from "@/stores/session-store-hooks";
import { redirectIfArchivingActiveWorkspace } from "@/utils/sidebar-workspace-archive-redirect"; import { redirectIfArchivingActiveWorkspace } from "@/utils/sidebar-workspace-archive-redirect";
import { openExternalUrl } from "@/utils/open-external-url"; import { openExternalUrl } from "@/utils/open-external-url";
@@ -109,7 +104,6 @@ import {
} from "@/utils/workspace-execution"; } from "@/utils/workspace-execution";
import { WorkspaceHoverCard } from "@/components/workspace-hover-card"; import { WorkspaceHoverCard } from "@/components/workspace-hover-card";
import { GitHubIcon } from "@/components/icons/github-icon"; import { GitHubIcon } from "@/components/icons/github-icon";
import { createNameId } from "mnemonic-id";
import { isWeb as platformIsWeb, isNative as platformIsNative } from "@/constants/platform"; import { isWeb as platformIsWeb, isNative as platformIsNative } from "@/constants/platform";
function toProjectIconDataUri(icon: { mimeType: string; data: string } | null): string | null { function toProjectIconDataUri(icon: { mimeType: string; data: string } | null): string | null {
@@ -31,7 +31,6 @@ import { View, Text } from "react-native";
import { StyleSheet, useUnistyles } from "react-native-unistyles"; import { StyleSheet, useUnistyles } from "react-native-unistyles";
import { ResizeHandle } from "@/components/resize-handle"; import { ResizeHandle } from "@/components/resize-handle";
import { shouldFocusPaneFromEventTarget } from "@/components/split-container-pane-focus"; import { shouldFocusPaneFromEventTarget } from "@/components/split-container-pane-focus";
import { usePanelStore } from "@/stores/panel-store";
import { useWindowControlsPadding } from "@/utils/desktop-window"; import { useWindowControlsPadding } from "@/utils/desktop-window";
import { TitlebarDragRegion } from "@/components/desktop/titlebar-drag-region"; import { TitlebarDragRegion } from "@/components/desktop/titlebar-drag-region";
import { import {
@@ -1,4 +1,4 @@
import { useRef, ReactNode, useCallback, useEffect, useMemo } from "react"; import { useRef, ReactNode, useCallback, useEffect } from "react";
import { Buffer } from "buffer"; import { Buffer } from "buffer";
import { AppState } from "react-native"; import { AppState } from "react-native";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
@@ -12,7 +12,6 @@ import {
processTimelineResponse, processTimelineResponse,
} from "@/contexts/session-stream-reducers"; } from "@/contexts/session-stream-reducers";
import type { import type {
ActivityLogPayload,
AgentAttachment, AgentAttachment,
AgentStreamEventPayload, AgentStreamEventPayload,
SessionOutboundMessage, SessionOutboundMessage,
@@ -25,7 +24,6 @@ import {
} from "@server/shared/agent-attention-notification"; } from "@server/shared/agent-attention-notification";
import type { AgentLifecycleStatus } from "@server/shared/agent-lifecycle"; import type { AgentLifecycleStatus } from "@server/shared/agent-lifecycle";
import type { DaemonClient } from "@server/client/daemon-client"; import type { DaemonClient } from "@server/client/daemon-client";
import { File } from "expo-file-system";
import { getHostRuntimeStore, useHostRuntimeIsConnected } from "@/runtime/host-runtime"; import { getHostRuntimeStore, useHostRuntimeIsConnected } from "@/runtime/host-runtime";
import { useVoiceAudioEngineOptional, useVoiceRuntimeOptional } from "@/contexts/voice-context"; import { useVoiceAudioEngineOptional, useVoiceRuntimeOptional } from "@/contexts/voice-context";
import type { AudioPlaybackSource } from "@/voice/audio-engine-types"; import type { AudioPlaybackSource } from "@/voice/audio-engine-types";
@@ -38,7 +36,6 @@ import {
} from "@/stores/session-store"; } from "@/stores/session-store";
import { useDraftStore } from "@/stores/draft-store"; import { useDraftStore } from "@/stores/draft-store";
import { useWorkspaceSetupStore } from "@/stores/workspace-setup-store"; import { useWorkspaceSetupStore } from "@/stores/workspace-setup-store";
import type { AgentDirectoryEntry } from "@/types/agent-directory";
import { sendOsNotification } from "@/utils/os-notifications"; import { sendOsNotification } from "@/utils/os-notifications";
import { getIsAppActivelyVisible } from "@/utils/app-visibility"; import { getIsAppActivelyVisible } from "@/utils/app-visibility";
import { import {
@@ -132,7 +132,7 @@ export function useDesktopPermissions(): UseDesktopPermissionsReturn {
"Notification was not delivered. Check System Settings > Notifications.", "Notification was not delivered. Check System Settings > Notifications.",
); );
} }
} catch (error) { } catch {
setTestNotificationError("Failed to send notification."); setTestNotificationError("Failed to send notification.");
} finally { } finally {
if (isMountedRef.current) { if (isMountedRef.current) {
@@ -3,7 +3,6 @@ import { useEffect } from "react";
import { import {
keyboardActionDispatcher, keyboardActionDispatcher,
type KeyboardActionDefinition, type KeyboardActionDefinition,
type KeyboardActionHandler,
type KeyboardActionId, type KeyboardActionId,
} from "@/keyboard/keyboard-action-dispatcher"; } from "@/keyboard/keyboard-action-dispatcher";
@@ -6,7 +6,6 @@ import { setCommandCenterFocusRestoreElement } from "@/utils/command-center-focu
import { import {
buildHostWorkspaceRoute, buildHostWorkspaceRoute,
buildSettingsRoute, buildSettingsRoute,
parseHostAgentRouteFromPathname,
parseHostWorkspaceRouteFromPathname, parseHostWorkspaceRouteFromPathname,
} from "@/utils/host-routes"; } from "@/utils/host-routes";
import { navigateToWorkspace } from "@/hooks/use-workspace-navigation"; import { navigateToWorkspace } from "@/hooks/use-workspace-navigation";
+1 -1
View File
@@ -1,4 +1,4 @@
import { useSyncExternalStore, useCallback, useMemo } from "react"; import { useSyncExternalStore, useMemo } from "react";
import AsyncStorage from "@react-native-async-storage/async-storage"; import AsyncStorage from "@react-native-async-storage/async-storage";
import equal from "fast-deep-equal/es6"; import equal from "fast-deep-equal/es6";
import { import {
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react"; import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
import { createNameId } from "mnemonic-id"; import { createNameId } from "mnemonic-id";
import type { ImageAttachment } from "@/components/message-input"; import type { ImageAttachment } from "@/components/message-input";
import { View, Text, Pressable, ScrollView, Keyboard } from "react-native"; import { View, Text, ScrollView, Keyboard } from "react-native";
import { useLocalSearchParams, useRouter } from "expo-router"; import { useLocalSearchParams, useRouter } from "expo-router";
import { useIsFocused } from "@react-navigation/native"; import { useIsFocused } from "@react-navigation/native";
import { StyleSheet, useUnistyles } from "react-native-unistyles"; import { StyleSheet, useUnistyles } from "react-native-unistyles";
@@ -47,7 +47,6 @@ import type {
AgentCapabilityFlags, AgentCapabilityFlags,
AgentSessionConfig, AgentSessionConfig,
} from "@server/server/agent/agent-sdk-types"; } from "@server/server/agent/agent-sdk-types";
import { AGENT_PROVIDER_DEFINITIONS } from "@server/server/agent/provider-manifest";
import { resolveWorkspaceIdByExecutionDirectory } from "@/utils/workspace-execution"; import { resolveWorkspaceIdByExecutionDirectory } from "@/utils/workspace-execution";
import { prepareWorkspaceTab } from "@/utils/workspace-navigation"; import { prepareWorkspaceTab } from "@/utils/workspace-navigation";
import { TitlebarDragRegion } from "@/components/desktop/titlebar-drag-region"; import { TitlebarDragRegion } from "@/components/desktop/titlebar-drag-region";
@@ -57,7 +56,6 @@ import type { KeyboardActionDefinition } from "@/keyboard/keyboard-action-dispat
import { normalizeAgentSnapshot } from "@/utils/agent-snapshots"; import { normalizeAgentSnapshot } from "@/utils/agent-snapshots";
import { useAgentInputDraft } from "@/hooks/use-agent-input-draft"; import { useAgentInputDraft } from "@/hooks/use-agent-input-draft";
import { useDraftAgentCreateFlow } from "@/hooks/use-draft-agent-create-flow"; import { useDraftAgentCreateFlow } from "@/hooks/use-draft-agent-create-flow";
import { useDraftAgentFeatures } from "@/hooks/use-draft-agent-features";
import { isWeb } from "@/constants/platform"; import { isWeb } from "@/constants/platform";
const EMPTY_PENDING_PERMISSIONS = new Map(); const EMPTY_PENDING_PERMISSIONS = new Map();
@@ -21,7 +21,6 @@ import {
X, X,
} from "lucide-react-native"; } from "lucide-react-native";
import { GestureDetector } from "react-native-gesture-handler"; import { GestureDetector } from "react-native-gesture-handler";
import Animated from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useSafeAreaInsets } from "react-native-safe-area-context";
import { StyleSheet, useUnistyles } from "react-native-unistyles"; import { StyleSheet, useUnistyles } from "react-native-unistyles";
import invariant from "tiny-invariant"; import invariant from "tiny-invariant";
@@ -6,7 +6,7 @@ import { act } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import type { WorkspaceScriptPayload } from "@server/shared/messages"; import type { WorkspaceScriptPayload } from "@server/shared/messages";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createRoot, type Root } from "react-dom/client"; import { createRoot } from "react-dom/client";
import { WorkspaceScriptsButton } from "@/screens/workspace/workspace-scripts-button"; import { WorkspaceScriptsButton } from "@/screens/workspace/workspace-scripts-button";
const { theme, startWorkspaceScriptMock } = vi.hoisted(() => { const { theme, startWorkspaceScriptMock } = vi.hoisted(() => {
-6
View File
@@ -8,24 +8,18 @@ import type { PendingPermission } from "@/types/shared";
import type { ComposerAttachment } from "@/attachments/types"; import type { ComposerAttachment } from "@/attachments/types";
import type { AgentLifecycleStatus } from "@server/shared/agent-lifecycle"; import type { AgentLifecycleStatus } from "@server/shared/agent-lifecycle";
import type { import type {
AgentPermissionResponse,
AgentPermissionRequest, AgentPermissionRequest,
AgentSessionConfig,
AgentFeature, AgentFeature,
AgentProvider, AgentProvider,
AgentMode, AgentMode,
AgentCapabilityFlags, AgentCapabilityFlags,
AgentModelDefinition,
AgentUsage, AgentUsage,
AgentPersistenceHandle, AgentPersistenceHandle,
} from "@server/server/agent/agent-sdk-types"; } from "@server/server/agent/agent-sdk-types";
import type { import type {
FileDownloadTokenResponse,
GitSetupOptions,
ServerInfoStatusPayload, ServerInfoStatusPayload,
ProjectPlacementPayload, ProjectPlacementPayload,
ServerCapabilities, ServerCapabilities,
AgentSnapshotPayload,
WorkspaceDescriptorPayload, WorkspaceDescriptorPayload,
} from "@server/shared/messages"; } from "@server/shared/messages";
import { normalizeWorkspaceOpaqueId } from "@/utils/workspace-identity"; import { normalizeWorkspaceOpaqueId } from "@/utils/workspace-identity";
@@ -6,7 +6,6 @@ import {
highlightDiffFile, highlightDiffFile,
parseAndHighlightDiff, parseAndHighlightDiff,
type ParsedDiffFile, type ParsedDiffFile,
type DiffHunk,
} from "./diff-highlighter"; } from "./diff-highlighter";
const SIMPLE_DIFF = `diff --git a/example.ts b/example.ts const SIMPLE_DIFF = `diff --git a/example.ts b/example.ts
@@ -1,4 +1,4 @@
import type { ProviderSnapshotEntry, AgentProvider } from "@server/server/agent/agent-sdk-types"; import type { ProviderSnapshotEntry } from "@server/server/agent/agent-sdk-types";
import { import {
type AgentModeColorTier, type AgentModeColorTier,
type AgentModeIcon, type AgentModeIcon,
+1 -5
View File
@@ -1,11 +1,7 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { DaemonServerInfo } from "@/stores/session-store"; import type { DaemonServerInfo } from "@/stores/session-store";
import type { AudioEngine } from "@/voice/audio-engine-types"; import type { AudioEngine } from "@/voice/audio-engine-types";
import { import { createVoiceRuntime, type VoiceSessionAdapter } from "@/voice/voice-runtime";
createVoiceRuntime,
type VoiceRuntime,
type VoiceSessionAdapter,
} from "@/voice/voice-runtime";
import { REALTIME_VOICE_VAD_CONFIG } from "@/voice/realtime-voice-config"; import { REALTIME_VOICE_VAD_CONFIG } from "@/voice/realtime-voice-config";
function createAudioEngineMock(): AudioEngine { function createAudioEngineMock(): AudioEngine {
@@ -1,13 +1,10 @@
// EventTarget polyfill is required for the Flow SDK to work in React Native // EventTarget polyfill is required for the Flow SDK to work in React Native
import "event-target-polyfill"; import "event-target-polyfill";
import { Buffer } from "buffer";
import { Button, StyleSheet, Text, View } from "react-native"; import { Button, StyleSheet, Text, View } from "react-native";
import { Platform } from "react-native";
import { import {
type MicrophoneDataCallback, type MicrophoneDataCallback,
type VolumeLevelCallback, type VolumeLevelCallback,
getMicrophoneModeIOS,
initialize, initialize,
playPCMData, playPCMData,
toggleRecording, toggleRecording,
@@ -22,7 +19,7 @@ import {
useFlow, useFlow,
useFlowEventListener, useFlowEventListener,
} from "@speechmatics/flow-client-react"; } from "@speechmatics/flow-client-react";
import { useCallback, useEffect, useState, useSyncExternalStore } from "react"; import { useCallback, useEffect, useState } from "react";
import { useSharedValue } from "react-native-reanimated"; import { useSharedValue } from "react-native-reanimated";
import { getFlowAPIJwt } from "./auth"; import { getFlowAPIJwt } from "./auth";
import VolumeDisplay from "./volume-display"; import VolumeDisplay from "./volume-display";
+1 -1
View File
@@ -1,4 +1,4 @@
import { type PermissionResponse, createPermissionHook } from "expo-modules-core"; import { type PermissionResponse } from "expo-modules-core";
import ExpoTwoWayAudioModule from "./ExpoTwoWayAudioModule"; import ExpoTwoWayAudioModule from "./ExpoTwoWayAudioModule";
export async function initialize() { export async function initialize() {
@@ -3,7 +3,6 @@ import { DaemonClient, type DaemonTransport } from "./daemon-client";
import { import {
asUint8Array, asUint8Array,
decodeTerminalResizePayload, decodeTerminalResizePayload,
decodeTerminalSnapshotPayload,
decodeTerminalStreamFrame, decodeTerminalStreamFrame,
encodeTerminalSnapshotPayload, encodeTerminalSnapshotPayload,
encodeTerminalStreamFrame, encodeTerminalStreamFrame,
@@ -7,7 +7,7 @@
* to understand how command output is delivered. * to understand how command output is delivered.
*/ */
import { query, type SDKUserMessage, type SDKMessage } from "@anthropic-ai/claude-agent-sdk"; import { query, type SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
class Pushable<T> implements AsyncIterable<T> { class Pushable<T> implements AsyncIterable<T> {
private queue: T[] = []; private queue: T[] = [];
+1 -6
View File
@@ -15,12 +15,7 @@
* Usage: npx tsx src/poc-commands/run-poc.ts * Usage: npx tsx src/poc-commands/run-poc.ts
*/ */
import { import { query, type SlashCommand, type SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
query,
type Query,
type SlashCommand,
type SDKUserMessage,
} from "@anthropic-ai/claude-agent-sdk";
// Pattern from claude-agent.ts listModels(): // Pattern from claude-agent.ts listModels():
// Use an empty async generator when you just need control methods // Use an empty async generator when you just need control methods
@@ -107,7 +107,7 @@ async function startAgentMcpServer(logger: pino.Logger): Promise<AgentMcpServerH
} }
await transport.handleRequest(req, res, req.body); await transport.handleRequest(req, res, req.body);
} catch (error) { } catch {
if (!res.headersSent) { if (!res.headersSent) {
res.status(500).json({ res.status(500).json({
jsonrpc: "2.0", jsonrpc: "2.0",
@@ -1,6 +1,5 @@
import { describe, test, expect, beforeEach, afterEach } from "vitest"; import { describe, test, expect, beforeEach, afterEach } from "vitest";
import { createDaemonTestContext, type DaemonTestContext } from "../../test-utils/index.js"; import { createDaemonTestContext, type DaemonTestContext } from "../../test-utils/index.js";
import type { AgentSlashCommand } from "../agent-sdk-types.js";
// Fake-daemon plumbing coverage: validates manager/client command wiring without a real Claude binary. // Fake-daemon plumbing coverage: validates manager/client command wiring without a real Claude binary.
describe("claude agent commands E2E", () => { describe("claude agent commands E2E", () => {
@@ -3281,7 +3281,7 @@ class ClaudeAgentSession implements AgentSession {
return; return;
} }
this.ingestPersistedHistory(fs.readFileSync(historyPath, "utf8")); this.ingestPersistedHistory(fs.readFileSync(historyPath, "utf8"));
} catch (error) { } catch {
// ignore history load failures // ignore history load failures
} }
} }
@@ -17,7 +17,6 @@ import type {
AgentStreamEvent, AgentStreamEvent,
ToolCallTimelineItem, ToolCallTimelineItem,
AssistantMessageTimelineItem, AssistantMessageTimelineItem,
UserMessageTimelineItem,
AgentTimelineItem, AgentTimelineItem,
} from "../agent-sdk-types.js"; } from "../agent-sdk-types.js";
@@ -1,4 +1,4 @@
import { describe, test, expect, beforeAll, afterAll, beforeEach } from "vitest"; import { describe, test, expect, beforeAll, afterAll } from "vitest";
import { mkdtempSync, writeFileSync, rmSync, existsSync } from "node:fs"; import { mkdtempSync, writeFileSync, rmSync, existsSync } from "node:fs";
import { readFile } from "node:fs/promises"; import { readFile } from "node:fs/promises";
import { tmpdir, homedir } from "node:os"; import { tmpdir, homedir } from "node:os";
@@ -13,7 +13,7 @@ import {
DaemonClient, DaemonClient,
} from "./test-utils/index.js"; } from "./test-utils/index.js";
import { getFullAccessConfig, getAskModeConfig } from "./daemon-e2e/agent-configs.js"; import { getFullAccessConfig, getAskModeConfig } from "./daemon-e2e/agent-configs.js";
import { chunkPcm16, parsePcm16MonoWav, wordSimilarity } from "./test-utils/dictation-e2e.js"; import { parsePcm16MonoWav, wordSimilarity } from "./test-utils/dictation-e2e.js";
import type { import type {
AgentClient, AgentClient,
AgentPersistenceHandle, AgentPersistenceHandle,
@@ -1,19 +1,9 @@
import { describe, test, expect, beforeEach, afterEach } from "vitest"; import { describe, test, expect, beforeEach, afterEach } from "vitest";
import { import { mkdtempSync, readdirSync } from "fs";
mkdtempSync,
writeFileSync,
existsSync,
rmSync,
mkdirSync,
readFileSync,
readdirSync,
} from "fs";
import { tmpdir } from "os"; import { tmpdir } from "os";
import path from "path"; import path from "path";
import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js"; import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js";
import { createMessageCollector, type MessageCollector } from "../test-utils/message-collector.js"; import { createMessageCollector, type MessageCollector } from "../test-utils/message-collector.js";
import type { AgentTimelineItem } from "../agent/agent-sdk-types.js";
import type { AgentSnapshotPayload, SessionOutboundMessage } from "../messages.js";
function tmpCwd(): string { function tmpCwd(): string {
return mkdtempSync(path.join(tmpdir(), "daemon-e2e-")); return mkdtempSync(path.join(tmpdir(), "daemon-e2e-"));
@@ -1,17 +1,8 @@
import { describe, test, expect, beforeEach, afterEach } from "vitest"; import { describe, test, expect, beforeEach, afterEach } from "vitest";
import { import { mkdtempSync, rmSync, readdirSync } from "fs";
mkdtempSync,
writeFileSync,
existsSync,
rmSync,
mkdirSync,
readFileSync,
readdirSync,
} from "fs";
import { tmpdir } from "os"; import { tmpdir } from "os";
import path from "path"; import path from "path";
import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js"; import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js";
import type { AgentTimelineItem } from "../agent/agent-sdk-types.js";
import type { AgentSnapshotPayload, SessionOutboundMessage } from "../messages.js"; import type { AgentSnapshotPayload, SessionOutboundMessage } from "../messages.js";
function tmpCwd(): string { function tmpCwd(): string {
@@ -1,18 +1,8 @@
import { describe, test, expect, beforeEach, afterEach } from "vitest"; import { describe, test, expect, beforeEach, afterEach } from "vitest";
import { import { mkdtempSync, writeFileSync, rmSync, readdirSync } from "fs";
mkdtempSync,
writeFileSync,
existsSync,
rmSync,
mkdirSync,
readFileSync,
readdirSync,
} from "fs";
import { tmpdir } from "os"; import { tmpdir } from "os";
import path from "path"; import path from "path";
import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js"; import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js";
import type { AgentTimelineItem } from "../agent/agent-sdk-types.js";
import type { AgentSnapshotPayload, SessionOutboundMessage } from "../messages.js";
function tmpCwd(): string { function tmpCwd(): string {
return mkdtempSync(path.join(tmpdir(), "daemon-e2e-")); return mkdtempSync(path.join(tmpdir(), "daemon-e2e-"));
@@ -1,18 +1,8 @@
import { describe, test, expect, beforeEach, afterEach } from "vitest"; import { describe, test, expect, beforeEach, afterEach } from "vitest";
import { import { mkdtempSync, writeFileSync, rmSync, mkdirSync, readdirSync } from "fs";
mkdtempSync,
writeFileSync,
existsSync,
rmSync,
mkdirSync,
readFileSync,
readdirSync,
} from "fs";
import { tmpdir } from "os"; import { tmpdir } from "os";
import path from "path"; import path from "path";
import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js"; import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js";
import type { AgentTimelineItem } from "../agent/agent-sdk-types.js";
import type { AgentSnapshotPayload, SessionOutboundMessage } from "../messages.js";
function tmpCwd(): string { function tmpCwd(): string {
return mkdtempSync(path.join(tmpdir(), "daemon-e2e-")); return mkdtempSync(path.join(tmpdir(), "daemon-e2e-"));
@@ -1,14 +1,5 @@
import { describe, test, expect, beforeEach, afterEach } from "vitest"; import { describe, test, expect, beforeEach, afterEach } from "vitest";
import { import { mkdtempSync, writeFileSync, existsSync, rmSync, readFileSync, realpathSync } from "fs";
mkdtempSync,
writeFileSync,
existsSync,
rmSync,
mkdirSync,
readFileSync,
readdirSync,
realpathSync,
} from "fs";
import { tmpdir } from "os"; import { tmpdir } from "os";
import path from "path"; import path from "path";
import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js"; import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js";
@@ -16,7 +7,7 @@ import { createMessageCollector, type MessageCollector } from "../test-utils/mes
import { withTimeout } from "../../utils/promise-timeout.js"; import { withTimeout } from "../../utils/promise-timeout.js";
import { deriveWorktreeProjectHash } from "../../utils/worktree.js"; import { deriveWorktreeProjectHash } from "../../utils/worktree.js";
import type { AgentTimelineItem } from "../agent/agent-sdk-types.js"; import type { AgentTimelineItem } from "../agent/agent-sdk-types.js";
import type { AgentSnapshotPayload, SessionOutboundMessage } from "../messages.js"; import type { SessionOutboundMessage } from "../messages.js";
function tmpCwd(): string { function tmpCwd(): string {
return mkdtempSync(path.join(tmpdir(), "daemon-e2e-")); return mkdtempSync(path.join(tmpdir(), "daemon-e2e-"));
@@ -1,19 +1,9 @@
import { describe, test, expect, beforeEach, afterEach } from "vitest"; import { describe, test, expect, beforeEach, afterEach } from "vitest";
import { import { mkdtempSync, rmSync, readdirSync } from "fs";
mkdtempSync,
writeFileSync,
existsSync,
rmSync,
mkdirSync,
readFileSync,
readdirSync,
} from "fs";
import { tmpdir } from "os"; import { tmpdir } from "os";
import path from "path"; import path from "path";
import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js"; import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js";
import { createMessageCollector, type MessageCollector } from "../test-utils/message-collector.js"; import { createMessageCollector, type MessageCollector } from "../test-utils/message-collector.js";
import type { AgentTimelineItem } from "../agent/agent-sdk-types.js";
import type { AgentSnapshotPayload, SessionOutboundMessage } from "../messages.js";
function tmpCwd(): string { function tmpCwd(): string {
return mkdtempSync(path.join(tmpdir(), "daemon-e2e-")); return mkdtempSync(path.join(tmpdir(), "daemon-e2e-"));
@@ -1,18 +1,9 @@
import { describe, test, expect, beforeEach, afterEach } from "vitest"; import { describe, test, expect, beforeEach, afterEach } from "vitest";
import { import { mkdtempSync, existsSync, rmSync, readFileSync } from "fs";
mkdtempSync,
writeFileSync,
existsSync,
rmSync,
mkdirSync,
readFileSync,
readdirSync,
} from "fs";
import { tmpdir } from "os"; import { tmpdir } from "os";
import path from "path"; import path from "path";
import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js"; import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js";
import type { AgentTimelineItem } from "../agent/agent-sdk-types.js"; import type { SessionOutboundMessage } from "../messages.js";
import type { AgentSnapshotPayload, SessionOutboundMessage } from "../messages.js";
function tmpCwd(): string { function tmpCwd(): string {
return mkdtempSync(path.join(tmpdir(), "daemon-e2e-")); return mkdtempSync(path.join(tmpdir(), "daemon-e2e-"));
@@ -1,19 +1,11 @@
import { describe, test, expect, beforeEach, afterEach } from "vitest"; import { describe, test, expect, beforeEach, afterEach } from "vitest";
import { import { mkdtempSync, writeFileSync, rmSync, readdirSync } from "fs";
mkdtempSync,
writeFileSync,
existsSync,
rmSync,
mkdirSync,
readFileSync,
readdirSync,
} from "fs";
import { tmpdir } from "os"; import { tmpdir } from "os";
import path from "path"; import path from "path";
import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js"; import { createDaemonTestContext, type DaemonTestContext } from "../test-utils/index.js";
import { createMessageCollector } from "../test-utils/message-collector.js"; import { createMessageCollector } from "../test-utils/message-collector.js";
import type { AgentTimelineItem } from "../agent/agent-sdk-types.js"; import type { AgentTimelineItem } from "../agent/agent-sdk-types.js";
import type { AgentSnapshotPayload, SessionOutboundMessage } from "../messages.js"; import type { SessionOutboundMessage } from "../messages.js";
function tmpCwd(): string { function tmpCwd(): string {
return mkdtempSync(path.join(tmpdir(), "daemon-e2e-")); return mkdtempSync(path.join(tmpdir(), "daemon-e2e-"));
@@ -1,11 +1,7 @@
import { describe, expect, test, vi } from "vitest"; import { describe, expect, test, vi } from "vitest";
import type { ManagedAgent } from "./agent/agent-manager.js"; import type { ManagedAgent } from "./agent/agent-manager.js";
import type { StoredAgentRecord } from "./agent/agent-storage.js"; import type { StoredAgentRecord } from "./agent/agent-storage.js";
import { import { buildConfigOverrides, buildSessionConfig } from "./persistence-hooks.js";
attachAgentStoragePersistence,
buildConfigOverrides,
buildSessionConfig,
} from "./persistence-hooks.js";
import type { import type {
AgentPermissionRequest, AgentPermissionRequest,
AgentSession, AgentSession,
@@ -250,7 +250,7 @@ export class OpenAISTT implements SpeechToTextProvider {
if (tempFilePath) { if (tempFilePath) {
try { try {
await unlink(tempFilePath); await unlink(tempFilePath);
} catch (cleanupError) { } catch {
logger.warn({ tempFilePath }, "Failed to clean up temp file"); logger.warn({ tempFilePath }, "Failed to clean up temp file");
} }
} }
@@ -13,7 +13,6 @@ import { afterEach, describe, expect, test, vi } from "vitest";
import pino, { type Logger } from "pino"; import pino, { type Logger } from "pino";
import type { SessionOutboundMessage, WorkspaceDescriptorPayload } from "./messages.js"; import type { SessionOutboundMessage, WorkspaceDescriptorPayload } from "./messages.js";
import { ScriptRouteStore } from "./script-proxy.js";
import { archivePaseoWorktree } from "./paseo-worktree-archive-service.js"; import { archivePaseoWorktree } from "./paseo-worktree-archive-service.js";
import { import {
buildAgentSessionConfig, buildAgentSessionConfig,
+2 -2
View File
@@ -1,12 +1,12 @@
#!/usr/bin/env node #!/usr/bin/env node
import { Command } from "commander"; import { Command } from "commander";
import { appendFileSync, existsSync, openSync, readFileSync } from "node:fs"; import { appendFileSync, existsSync, readFileSync } from "node:fs";
import { resolve } from "node:path"; import { resolve } from "node:path";
import { FileTaskStore } from "./task-store.js"; import { FileTaskStore } from "./task-store.js";
import { computeExecutionOrder, buildSortedChildrenMap } from "./execution-order.js"; import { computeExecutionOrder, buildSortedChildrenMap } from "./execution-order.js";
import { resolvePackageVersion } from "../server/package-version.js"; import { resolvePackageVersion } from "../server/package-version.js";
import { spawnProcess } from "../utils/spawn.js"; import { spawnProcess } from "../utils/spawn.js";
import type { AgentType, ModelName, Task } from "./types.js"; import type { AgentType, Task } from "./types.js";
const TASKS_DIR = resolve(process.cwd(), ".tasks"); const TASKS_DIR = resolve(process.cwd(), ".tasks");
const store = new FileTaskStore(TASKS_DIR); const store = new FileTaskStore(TASKS_DIR);
@@ -1,6 +1,6 @@
import { describe, it, expect, afterEach, vi } from "vitest"; import { describe, it, expect, afterEach } from "vitest";
import { createTerminalManager, type TerminalManager } from "./terminal-manager.js"; import { createTerminalManager, type TerminalManager } from "./terminal-manager.js";
import { existsSync, mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { existsSync, mkdtempSync, mkdirSync, readFileSync, rmSync } from "node:fs";
import { join } from "node:path"; import { join } from "node:path";
import { tmpdir } from "node:os"; import { tmpdir } from "node:os";
+1 -1
View File
@@ -710,7 +710,7 @@ function isGitError(error: unknown): boolean {
async function requireGitRepo(cwd: string): Promise<void> { async function requireGitRepo(cwd: string): Promise<void> {
try { try {
await runGitCommand(["rev-parse", "--git-dir"], { cwd, env: READ_ONLY_GIT_ENV }); await runGitCommand(["rev-parse", "--git-dir"], { cwd, env: READ_ONLY_GIT_ENV });
} catch (error) { } catch {
throw new NotGitRepoError(cwd); throw new NotGitRepoError(cwd);
} }
} }
@@ -1,12 +1,5 @@
import * as React from "react"; import * as React from "react";
import { import { motion, AnimatePresence, useInView, useScroll, useTransform } from "framer-motion";
motion,
AnimatePresence,
useInView,
useScroll,
useTransform,
useMotionValueEvent,
} from "framer-motion";
import { CursorFieldProvider } from "~/components/butterfly"; import { CursorFieldProvider } from "~/components/butterfly";
import { CommandDialog } from "~/components/command-dialog"; import { CommandDialog } from "~/components/command-dialog";
import { import {