diff --git a/packages/cli/src/commands/mcp.test.ts b/packages/cli/src/commands/mcp.test.ts index 2877f847144..715786859bf 100644 --- a/packages/cli/src/commands/mcp.test.ts +++ b/packages/cli/src/commands/mcp.test.ts @@ -6,8 +6,7 @@ import { describe, it, expect, vi } from 'vitest'; import { mcpCommand } from './mcp.js'; -import { type Argv } from 'yargs'; -import yargs from 'yargs'; +import yargs, { type Argv } from 'yargs'; describe('mcp command', () => { it('should have correct command definition', () => { diff --git a/packages/cli/src/commands/mcp/list.ts b/packages/cli/src/commands/mcp/list.ts index 421c822a551..dbcf8be92f0 100644 --- a/packages/cli/src/commands/mcp/list.ts +++ b/packages/cli/src/commands/mcp/list.ts @@ -7,8 +7,8 @@ // File for 'gemini mcp list' command import type { CommandModule } from 'yargs'; import { type MergedSettings, loadSettings } from '../../config/settings.js'; -import type { MCPServerConfig } from '@google/gemini-cli-core'; import { + type MCPServerConfig, MCPServerStatus, createTransport, debugLogger, diff --git a/packages/cli/src/config/config.integration.test.ts b/packages/cli/src/config/config.integration.test.ts index 6797be4447a..05d8b77fb73 100644 --- a/packages/cli/src/config/config.integration.test.ts +++ b/packages/cli/src/config/config.integration.test.ts @@ -17,8 +17,8 @@ import { import * as fs from 'node:fs'; import * as path from 'node:path'; import { tmpdir } from 'node:os'; -import type { ConfigParameters } from '@google/gemini-cli-core'; import { + type ConfigParameters, Config, DEFAULT_FILE_FILTERING_OPTIONS, } from '@google/gemini-cli-core'; diff --git a/packages/cli/src/config/extensions/update.test.ts b/packages/cli/src/config/extensions/update.test.ts index cb5bba2a119..26be013969c 100644 --- a/packages/cli/src/config/extensions/update.test.ts +++ b/packages/cli/src/config/extensions/update.test.ts @@ -15,11 +15,10 @@ import { type ExtensionUpdateStatus, } from '../../ui/state/extensions.js'; import { ExtensionStorage } from './storage.js'; -import { copyExtension } from '../extension-manager.js'; +import { copyExtension, type ExtensionManager } from '../extension-manager.js'; import { checkForExtensionUpdate } from './github.js'; import { loadInstallMetadata } from '../extension.js'; import * as fs from 'node:fs'; -import type { ExtensionManager } from '../extension-manager.js'; import type { GeminiCLIExtension } from '@google/gemini-cli-core'; // Mock dependencies diff --git a/packages/cli/src/config/keyBindings.test.ts b/packages/cli/src/config/keyBindings.test.ts index c2abc32d276..b5913d964d1 100644 --- a/packages/cli/src/config/keyBindings.test.ts +++ b/packages/cli/src/config/keyBindings.test.ts @@ -5,8 +5,8 @@ */ import { describe, it, expect } from 'vitest'; -import type { KeyBindingConfig } from './keyBindings.js'; import { + type KeyBindingConfig, Command, commandCategories, commandDescriptions, diff --git a/packages/cli/src/config/trustedFolders.test.ts b/packages/cli/src/config/trustedFolders.test.ts index 714d7032418..9b3f6580880 100644 --- a/packages/cli/src/config/trustedFolders.test.ts +++ b/packages/cli/src/config/trustedFolders.test.ts @@ -19,9 +19,8 @@ import { isWorkspaceTrusted, resetTrustedFoldersForTesting, } from './trustedFolders.js'; -import { loadEnvironment } from './settings.js'; +import { loadEnvironment, type Settings } from './settings.js'; import { createMockSettings } from '../test-utils/settings.js'; -import type { Settings } from './settings.js'; // We explicitly do NOT mock 'fs' or 'proper-lockfile' here to ensure // we are testing the actual behavior on the real file system. diff --git a/packages/cli/src/deferred.test.ts b/packages/cli/src/deferred.test.ts index 99b86c98277..0a50bef309c 100644 --- a/packages/cli/src/deferred.test.ts +++ b/packages/cli/src/deferred.test.ts @@ -4,7 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { + describe, + it, + expect, + vi, + beforeEach, + type MockInstance, +} from 'vitest'; import { runDeferredCommand, defer, @@ -14,7 +21,6 @@ import { import { ExitCodes } from '@google/gemini-cli-core'; import type { ArgumentsCamelCase, CommandModule } from 'yargs'; import { createMockSettings } from './test-utils/settings.js'; -import type { MockInstance } from 'vitest'; const { mockRunExitCleanup, mockCoreEvents } = vi.hoisted(() => ({ mockRunExitCleanup: vi.fn(), diff --git a/packages/cli/src/gemini.test.tsx b/packages/cli/src/gemini.test.tsx index 2784c5694aa..840683bcdeb 100644 --- a/packages/cli/src/gemini.test.tsx +++ b/packages/cli/src/gemini.test.tsx @@ -21,14 +21,17 @@ import { startInteractiveUI, getNodeMemoryArgs, } from './gemini.js'; -import { loadCliConfig, parseArguments } from './config/config.js'; +import { + loadCliConfig, + parseArguments, + type CliArgs, +} from './config/config.js'; import { loadSandboxConfig } from './config/sandboxConfig.js'; import { terminalCapabilityManager } from './ui/utils/terminalCapabilityManager.js'; import { start_sandbox } from './utils/sandbox.js'; import { validateNonInteractiveAuth } from './validateNonInterActiveAuth.js'; import os from 'node:os'; import v8 from 'node:v8'; -import { type CliArgs } from './config/config.js'; import { type LoadedSettings, loadSettings } from './config/settings.js'; import { createMockConfig, diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx index 2e238765e83..93b9bf4374e 100644 --- a/packages/cli/src/gemini.tsx +++ b/packages/cli/src/gemini.tsx @@ -16,12 +16,16 @@ import v8 from 'node:v8'; import os from 'node:os'; import dns from 'node:dns'; import { start_sandbox } from './utils/sandbox.js'; -import type { DnsResolutionOrder, LoadedSettings } from './config/settings.js'; +import { + type DnsResolutionOrder, + type LoadedSettings, + loadSettings, + SettingScope, +} from './config/settings.js'; import { loadTrustedFolders, type TrustedFoldersError, } from './config/trustedFolders.js'; -import { loadSettings, SettingScope } from './config/settings.js'; import { getStartupWarnings } from './utils/startupWarnings.js'; import { getUserStartupWarnings } from './utils/userStartupWarnings.js'; import { ConsolePatcher } from './ui/utils/ConsolePatcher.js'; diff --git a/packages/cli/src/gemini_cleanup.test.tsx b/packages/cli/src/gemini_cleanup.test.tsx index fb37bb94ece..d0b47caeb10 100644 --- a/packages/cli/src/gemini_cleanup.test.tsx +++ b/packages/cli/src/gemini_cleanup.test.tsx @@ -6,8 +6,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { main } from './gemini.js'; -import { debugLogger } from '@google/gemini-cli-core'; -import { type Config } from '@google/gemini-cli-core'; +import { debugLogger, type Config } from '@google/gemini-cli-core'; vi.mock('@google/gemini-cli-core', async (importOriginal) => { const actual = diff --git a/packages/cli/src/nonInteractiveCli.test.ts b/packages/cli/src/nonInteractiveCli.test.ts index 206d011e630..6d3140d8e5c 100644 --- a/packages/cli/src/nonInteractiveCli.test.ts +++ b/packages/cli/src/nonInteractiveCli.test.ts @@ -4,16 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - Config, - ToolRegistry, - ServerGeminiStreamEvent, - SessionMetrics, - AnyDeclarativeTool, - AnyToolInvocation, - UserFeedbackPayload, -} from '@google/gemini-cli-core'; import { + type Config, + type ToolRegistry, + type ServerGeminiStreamEvent, + type SessionMetrics, + type AnyDeclarativeTool, + type AnyToolInvocation, + type UserFeedbackPayload, ToolErrorType, GeminiEventType, OutputFormat, diff --git a/packages/cli/src/nonInteractiveCli.ts b/packages/cli/src/nonInteractiveCli.ts index c2cab72353b..26c7b268c5e 100644 --- a/packages/cli/src/nonInteractiveCli.ts +++ b/packages/cli/src/nonInteractiveCli.ts @@ -4,15 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - Config, - ToolCallRequestInfo, - ResumedSessionData, - UserFeedbackPayload, -} from '@google/gemini-cli-core'; -import { isSlashCommand } from './ui/utils/commandUtils.js'; -import type { LoadedSettings } from './config/settings.js'; import { + type Config, + type ToolCallRequestInfo, + type ResumedSessionData, + type UserFeedbackPayload, convertSessionToClientHistory, GeminiEventType, FatalInputError, @@ -31,6 +27,8 @@ import { Scheduler, ROOT_SCHEDULER_ID, } from '@google/gemini-cli-core'; +import { isSlashCommand } from './ui/utils/commandUtils.js'; +import type { LoadedSettings } from './config/settings.js'; import type { Content, Part } from '@google/genai'; import readline from 'node:readline'; diff --git a/packages/cli/src/services/BuiltinCommandLoader.test.ts b/packages/cli/src/services/BuiltinCommandLoader.test.ts index 1246ee05321..fd1c56e59cb 100644 --- a/packages/cli/src/services/BuiltinCommandLoader.test.ts +++ b/packages/cli/src/services/BuiltinCommandLoader.test.ts @@ -52,8 +52,7 @@ vi.mock('../ui/commands/permissionsCommand.js', async () => { import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest'; import { BuiltinCommandLoader } from './BuiltinCommandLoader.js'; -import type { Config } from '@google/gemini-cli-core'; -import { isNightly } from '@google/gemini-cli-core'; +import { type Config, isNightly } from '@google/gemini-cli-core'; import { CommandKind } from '../ui/commands/types.js'; import { restoreCommand } from '../ui/commands/restoreCommand.js'; diff --git a/packages/cli/src/services/BuiltinCommandLoader.ts b/packages/cli/src/services/BuiltinCommandLoader.ts index 31673e921a0..c3f6092a6db 100644 --- a/packages/cli/src/services/BuiltinCommandLoader.ts +++ b/packages/cli/src/services/BuiltinCommandLoader.ts @@ -11,8 +11,9 @@ import { type SlashCommand, type CommandContext, } from '../ui/commands/types.js'; -import type { MessageActionReturn, Config } from '@google/gemini-cli-core'; import { + type MessageActionReturn, + type Config, isNightly, startupProfiler, getAdminErrorMessage, diff --git a/packages/cli/src/services/FileCommandLoader.test.ts b/packages/cli/src/services/FileCommandLoader.test.ts index 077b8c45fe7..4d92f766dad 100644 --- a/packages/cli/src/services/FileCommandLoader.test.ts +++ b/packages/cli/src/services/FileCommandLoader.test.ts @@ -6,8 +6,7 @@ import * as glob from 'glob'; import * as path from 'node:path'; -import type { Config } from '@google/gemini-cli-core'; -import { GEMINI_DIR, Storage } from '@google/gemini-cli-core'; +import { type Config, GEMINI_DIR, Storage } from '@google/gemini-cli-core'; import mock from 'mock-fs'; import { FileCommandLoader } from './FileCommandLoader.js'; import { assert, vi } from 'vitest'; diff --git a/packages/cli/src/services/FileCommandLoader.ts b/packages/cli/src/services/FileCommandLoader.ts index fb27327ead2..4cc28dfb56f 100644 --- a/packages/cli/src/services/FileCommandLoader.ts +++ b/packages/cli/src/services/FileCommandLoader.ts @@ -9,21 +9,18 @@ import path from 'node:path'; import toml from '@iarna/toml'; import { glob } from 'glob'; import { z } from 'zod'; -import type { Config } from '@google/gemini-cli-core'; -import { Storage, coreEvents } from '@google/gemini-cli-core'; +import { type Config, Storage, coreEvents } from '@google/gemini-cli-core'; import type { ICommandLoader } from './types.js'; -import type { - CommandContext, - SlashCommand, - SlashCommandActionReturn, +import { + type CommandContext, + type SlashCommand, + type SlashCommandActionReturn, + CommandKind, } from '../ui/commands/types.js'; -import { CommandKind } from '../ui/commands/types.js'; import { DefaultArgumentProcessor } from './prompt-processors/argumentProcessor.js'; -import type { - IPromptProcessor, - PromptPipelineContent, -} from './prompt-processors/types.js'; import { + type IPromptProcessor, + type PromptPipelineContent, SHORTHAND_ARGS_PLACEHOLDER, SHELL_INJECTION_TRIGGER, AT_FILE_INJECTION_TRIGGER, diff --git a/packages/cli/src/services/McpPromptLoader.ts b/packages/cli/src/services/McpPromptLoader.ts index f61eed91843..96e4738ea16 100644 --- a/packages/cli/src/services/McpPromptLoader.ts +++ b/packages/cli/src/services/McpPromptLoader.ts @@ -4,14 +4,17 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { Config } from '@google/gemini-cli-core'; -import { getErrorMessage, getMCPServerPrompts } from '@google/gemini-cli-core'; -import type { - CommandContext, - SlashCommand, - SlashCommandActionReturn, +import { + type Config, + getErrorMessage, + getMCPServerPrompts, +} from '@google/gemini-cli-core'; +import { + type CommandContext, + type SlashCommand, + type SlashCommandActionReturn, + CommandKind, } from '../ui/commands/types.js'; -import { CommandKind } from '../ui/commands/types.js'; import type { ICommandLoader } from './types.js'; import type { PromptArgument } from '@modelcontextprotocol/sdk/types.js'; diff --git a/packages/cli/src/services/prompt-processors/shellProcessor.test.ts b/packages/cli/src/services/prompt-processors/shellProcessor.test.ts index 0f6fb562a88..0323d3dcf46 100644 --- a/packages/cli/src/services/prompt-processors/shellProcessor.test.ts +++ b/packages/cli/src/services/prompt-processors/shellProcessor.test.ts @@ -8,8 +8,8 @@ import { describe, it, expect, beforeEach, vi, type Mock } from 'vitest'; import { ConfirmationRequiredError, ShellProcessor } from './shellProcessor.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import type { CommandContext } from '../../ui/commands/types.js'; -import type { Config } from '@google/gemini-cli-core'; import { + type Config, ApprovalMode, getShellConfiguration, PolicyDecision, diff --git a/packages/cli/src/services/prompt-processors/shellProcessor.ts b/packages/cli/src/services/prompt-processors/shellProcessor.ts index 4c8369f6643..67ff97e1094 100644 --- a/packages/cli/src/services/prompt-processors/shellProcessor.ts +++ b/packages/cli/src/services/prompt-processors/shellProcessor.ts @@ -13,8 +13,9 @@ import { } from '@google/gemini-cli-core'; import type { CommandContext } from '../../ui/commands/types.js'; -import type { IPromptProcessor, PromptPipelineContent } from './types.js'; import { + type IPromptProcessor, + type PromptPipelineContent, SHELL_INJECTION_TRIGGER, SHORTHAND_ARGS_PLACEHOLDER, } from './types.js'; diff --git a/packages/cli/src/test-utils/mockCommandContext.ts b/packages/cli/src/test-utils/mockCommandContext.ts index 8dc5b9930a1..3c6302da472 100644 --- a/packages/cli/src/test-utils/mockCommandContext.ts +++ b/packages/cli/src/test-utils/mockCommandContext.ts @@ -6,8 +6,7 @@ import { vi } from 'vitest'; import type { CommandContext } from '../ui/commands/types.js'; -import type { LoadedSettings } from '../config/settings.js'; -import { mergeSettings } from '../config/settings.js'; +import { type LoadedSettings, mergeSettings } from '../config/settings.js'; import type { GitService } from '@google/gemini-cli-core'; import type { SessionStatsState } from '../ui/contexts/SessionContext.js'; diff --git a/packages/cli/src/test-utils/mockConfig.ts b/packages/cli/src/test-utils/mockConfig.ts index 8b7c7c520de..77c82ca629b 100644 --- a/packages/cli/src/test-utils/mockConfig.ts +++ b/packages/cli/src/test-utils/mockConfig.ts @@ -6,8 +6,11 @@ import { vi } from 'vitest'; import type { Config } from '@google/gemini-cli-core'; -import type { LoadedSettings, Settings } from '../config/settings.js'; -import { createTestMergedSettings } from '../config/settings.js'; +import { + type LoadedSettings, + type Settings, + createTestMergedSettings, +} from '../config/settings.js'; /** * Creates a mocked Config object with default values and allows overrides. diff --git a/packages/cli/src/test-utils/render.tsx b/packages/cli/src/test-utils/render.tsx index 6908fd36fba..a1a2c2cd834 100644 --- a/packages/cli/src/test-utils/render.tsx +++ b/packages/cli/src/test-utils/render.tsx @@ -8,14 +8,14 @@ import { render as inkRenderDirect, type Instance as InkInstance, type RenderOptions, + Box, } from 'ink'; import { EventEmitter } from 'node:events'; -import { Box } from 'ink'; import type React from 'react'; +import { act, useState } from 'react'; import { Terminal } from '@xterm/headless'; import { vi } from 'vitest'; import stripAnsi from 'strip-ansi'; -import { act, useState } from 'react'; import os from 'node:os'; import { LoadedSettings } from '../config/settings.js'; import { KeypressProvider } from '../ui/contexts/KeypressContext.js'; diff --git a/packages/cli/src/ui/AppContainer.test.tsx b/packages/cli/src/ui/AppContainer.test.tsx index 8505afd3efb..8e16b2a04fe 100644 --- a/packages/cli/src/ui/AppContainer.test.tsx +++ b/packages/cli/src/ui/AppContainer.test.tsx @@ -31,6 +31,10 @@ import { AuthType, type AgentDefinition, CoreToolCallStatus, + ShellExecutionService, + writeToStdout, + enableMouseEvents, + disableMouseEvents, } from '@google/gemini-cli-core'; // Mock coreEvents @@ -105,8 +109,8 @@ import { type UIActions, } from './contexts/UIActionsContext.js'; import { KeypressProvider } from './contexts/KeypressContext.js'; -import { OverflowProvider } from './contexts/OverflowContext.js'; import { + OverflowProvider, useOverflowActions, type OverflowActions, } from './contexts/OverflowContext.js'; @@ -229,12 +233,6 @@ import * as useKeypressModule from './hooks/useKeypress.js'; import { useSuspend } from './hooks/useSuspend.js'; import { measureElement } from 'ink'; import { useTerminalSize } from './hooks/useTerminalSize.js'; -import { - ShellExecutionService, - writeToStdout, - enableMouseEvents, - disableMouseEvents, -} from '@google/gemini-cli-core'; import { type ExtensionManager } from '../config/extension-manager.js'; import { WARNING_PROMPT_DURATION_MS, diff --git a/packages/cli/src/ui/AppContainer.tsx b/packages/cli/src/ui/AppContainer.tsx index d42cad8495e..2636e434daf 100644 --- a/packages/cli/src/ui/AppContainer.tsx +++ b/packages/cli/src/ui/AppContainer.tsx @@ -36,9 +36,10 @@ import { type ConfirmationRequest, type PermissionConfirmationRequest, type QuotaStats, + MessageType, + StreamingState, } from './types.js'; import { checkPermissions } from './hooks/atCommandProcessor.js'; -import { MessageType, StreamingState } from './types.js'; import { ToolActionsProvider } from './contexts/ToolActionsContext.js'; import { type StartupWarning, diff --git a/packages/cli/src/ui/IdeIntegrationNudge.tsx b/packages/cli/src/ui/IdeIntegrationNudge.tsx index 409a6469f60..8c6ea37bd3f 100644 --- a/packages/cli/src/ui/IdeIntegrationNudge.tsx +++ b/packages/cli/src/ui/IdeIntegrationNudge.tsx @@ -6,8 +6,10 @@ import type { IdeInfo } from '@google/gemini-cli-core'; import { Box, Text } from 'ink'; -import type { RadioSelectItem } from './components/shared/RadioButtonSelect.js'; -import { RadioButtonSelect } from './components/shared/RadioButtonSelect.js'; +import { + type RadioSelectItem, + RadioButtonSelect, +} from './components/shared/RadioButtonSelect.js'; import { useKeypress } from './hooks/useKeypress.js'; import { theme } from './semantic-colors.js'; diff --git a/packages/cli/src/ui/auth/AuthDialog.tsx b/packages/cli/src/ui/auth/AuthDialog.tsx index 33652297b69..c1f3207f07f 100644 --- a/packages/cli/src/ui/auth/AuthDialog.tsx +++ b/packages/cli/src/ui/auth/AuthDialog.tsx @@ -9,11 +9,11 @@ import { useCallback, useState } from 'react'; import { Box, Text } from 'ink'; import { theme } from '../semantic-colors.js'; import { RadioButtonSelect } from '../components/shared/RadioButtonSelect.js'; -import type { - LoadableSettingScope, - LoadedSettings, +import { + type LoadableSettingScope, + type LoadedSettings, + SettingScope, } from '../../config/settings.js'; -import { SettingScope } from '../../config/settings.js'; import { AuthType, clearCachedCredentialFile, diff --git a/packages/cli/src/ui/auth/useAuth.ts b/packages/cli/src/ui/auth/useAuth.ts index 3faec2d5a83..94e7492ba98 100644 --- a/packages/cli/src/ui/auth/useAuth.ts +++ b/packages/cli/src/ui/auth/useAuth.ts @@ -12,8 +12,8 @@ import { loadApiKey, debugLogger, isAccountSuspendedError, + getErrorMessage, } from '@google/gemini-cli-core'; -import { getErrorMessage } from '@google/gemini-cli-core'; import { AuthState } from '../types.js'; import { validateAuthMethod } from '../../config/auth.js'; diff --git a/packages/cli/src/ui/commands/aboutCommand.ts b/packages/cli/src/ui/commands/aboutCommand.ts index cf21d9b0d5b..8b9e34debd1 100644 --- a/packages/cli/src/ui/commands/aboutCommand.ts +++ b/packages/cli/src/ui/commands/aboutCommand.ts @@ -4,8 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { CommandContext, SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { + type CommandContext, + type SlashCommand, + CommandKind, +} from './types.js'; import process from 'node:process'; import { MessageType, type HistoryItemAbout } from '../types.js'; import { diff --git a/packages/cli/src/ui/commands/agentsCommand.ts b/packages/cli/src/ui/commands/agentsCommand.ts index a7161dfb773..f2259fb5504 100644 --- a/packages/cli/src/ui/commands/agentsCommand.ts +++ b/packages/cli/src/ui/commands/agentsCommand.ts @@ -4,12 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - SlashCommand, - CommandContext, - SlashCommandActionReturn, +import { + type SlashCommand, + type CommandContext, + type SlashCommandActionReturn, + CommandKind, } from './types.js'; -import { CommandKind } from './types.js'; import { MessageType, type HistoryItemAgentsList } from '../types.js'; import { SettingScope } from '../../config/settings.js'; import { disableAgent, enableAgent } from '../../utils/agentSettings.js'; diff --git a/packages/cli/src/ui/commands/authCommand.ts b/packages/cli/src/ui/commands/authCommand.ts index 0314555baf9..3f2518e5112 100644 --- a/packages/cli/src/ui/commands/authCommand.ts +++ b/packages/cli/src/ui/commands/authCommand.ts @@ -4,12 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - OpenDialogActionReturn, - SlashCommand, - LogoutActionReturn, +import { + type OpenDialogActionReturn, + type SlashCommand, + type LogoutActionReturn, + CommandKind, } from './types.js'; -import { CommandKind } from './types.js'; import { clearCachedCredentialFile } from '@google/gemini-cli-core'; import { SettingScope } from '../../config/settings.js'; diff --git a/packages/cli/src/ui/commands/chatCommand.ts b/packages/cli/src/ui/commands/chatCommand.ts index e1969fff670..5d435c0bc2d 100644 --- a/packages/cli/src/ui/commands/chatCommand.ts +++ b/packages/cli/src/ui/commands/chatCommand.ts @@ -8,26 +8,26 @@ import * as fsPromises from 'node:fs/promises'; import React from 'react'; import { Text } from 'ink'; import { theme } from '../semantic-colors.js'; -import type { - CommandContext, - SlashCommand, - SlashCommandActionReturn, +import { + type CommandContext, + type SlashCommand, + type SlashCommandActionReturn, + CommandKind, } from './types.js'; -import { CommandKind } from './types.js'; import { decodeTagName, type MessageActionReturn, INITIAL_HISTORY_LENGTH, + convertToRestPayload, } from '@google/gemini-cli-core'; import path from 'node:path'; -import type { - HistoryItemWithoutId, - HistoryItemChatList, - ChatDetail, +import { + type HistoryItemWithoutId, + type HistoryItemChatList, + type ChatDetail, + MessageType, } from '../types.js'; -import { MessageType } from '../types.js'; import { exportHistoryToFile } from '../utils/historyExportUtils.js'; -import { convertToRestPayload } from '@google/gemini-cli-core'; const getSavedChatTags = async ( context: CommandContext, diff --git a/packages/cli/src/ui/commands/clearCommand.test.ts b/packages/cli/src/ui/commands/clearCommand.test.ts index d33dc5884de..9a90c4be4fb 100644 --- a/packages/cli/src/ui/commands/clearCommand.test.ts +++ b/packages/cli/src/ui/commands/clearCommand.test.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { Mock } from 'vitest'; -import { vi, describe, it, expect, beforeEach } from 'vitest'; +import { type Mock, vi, describe, it, expect, beforeEach } from 'vitest'; import { clearCommand } from './clearCommand.js'; import { type CommandContext } from './types.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; @@ -21,8 +20,7 @@ vi.mock('@google/gemini-cli-core', async () => { }; }); -import type { GeminiClient } from '@google/gemini-cli-core'; -import { uiTelemetryService } from '@google/gemini-cli-core'; +import { type GeminiClient, uiTelemetryService } from '@google/gemini-cli-core'; describe('clearCommand', () => { let mockContext: CommandContext; diff --git a/packages/cli/src/ui/commands/clearCommand.ts b/packages/cli/src/ui/commands/clearCommand.ts index 385d3f95405..f3ed38d2211 100644 --- a/packages/cli/src/ui/commands/clearCommand.ts +++ b/packages/cli/src/ui/commands/clearCommand.ts @@ -10,8 +10,7 @@ import { SessionStartSource, flushTelemetry, } from '@google/gemini-cli-core'; -import type { SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { type SlashCommand, CommandKind } from './types.js'; import { MessageType } from '../types.js'; import { randomUUID } from 'node:crypto'; diff --git a/packages/cli/src/ui/commands/compressCommand.ts b/packages/cli/src/ui/commands/compressCommand.ts index 3bb5b343837..a6881fd5274 100644 --- a/packages/cli/src/ui/commands/compressCommand.ts +++ b/packages/cli/src/ui/commands/compressCommand.ts @@ -4,10 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { HistoryItemCompression } from '../types.js'; -import { MessageType } from '../types.js'; -import type { SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { type HistoryItemCompression, MessageType } from '../types.js'; +import { type SlashCommand, CommandKind } from './types.js'; export const compressCommand: SlashCommand = { name: 'compress', diff --git a/packages/cli/src/ui/commands/copyCommand.test.ts b/packages/cli/src/ui/commands/copyCommand.test.ts index e8aace1bccc..0c3e4681aac 100644 --- a/packages/cli/src/ui/commands/copyCommand.test.ts +++ b/packages/cli/src/ui/commands/copyCommand.test.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { Mock } from 'vitest'; -import { vi, describe, it, expect, beforeEach } from 'vitest'; +import { type Mock, vi, describe, it, expect, beforeEach } from 'vitest'; import { copyCommand } from './copyCommand.js'; import { type CommandContext } from './types.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; diff --git a/packages/cli/src/ui/commands/copyCommand.ts b/packages/cli/src/ui/commands/copyCommand.ts index c2c6ab13d11..f54e2d53f66 100644 --- a/packages/cli/src/ui/commands/copyCommand.ts +++ b/packages/cli/src/ui/commands/copyCommand.ts @@ -6,8 +6,11 @@ import { debugLogger } from '@google/gemini-cli-core'; import { copyToClipboard } from '../utils/commandUtils.js'; -import type { SlashCommand, SlashCommandActionReturn } from './types.js'; -import { CommandKind } from './types.js'; +import { + type SlashCommand, + type SlashCommandActionReturn, + CommandKind, +} from './types.js'; export const copyCommand: SlashCommand = { name: 'copy', diff --git a/packages/cli/src/ui/commands/directoryCommand.test.tsx b/packages/cli/src/ui/commands/directoryCommand.test.tsx index d9c534a89e0..bdfa6ac3a08 100644 --- a/packages/cli/src/ui/commands/directoryCommand.test.tsx +++ b/packages/cli/src/ui/commands/directoryCommand.test.tsx @@ -4,8 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; -import type { Mock } from 'vitest'; +import { + vi, + describe, + it, + expect, + beforeEach, + afterEach, + type Mock, +} from 'vitest'; import { directoryCommand } from './directoryCommand.js'; import { expandHomeDir, diff --git a/packages/cli/src/ui/commands/directoryCommand.tsx b/packages/cli/src/ui/commands/directoryCommand.tsx index 08a65ca78af..b2577c825b7 100644 --- a/packages/cli/src/ui/commands/directoryCommand.tsx +++ b/packages/cli/src/ui/commands/directoryCommand.tsx @@ -9,16 +9,21 @@ import { loadTrustedFolders, } from '../../config/trustedFolders.js'; import { MultiFolderTrustDialog } from '../components/MultiFolderTrustDialog.js'; -import type { SlashCommand, CommandContext } from './types.js'; -import { CommandKind } from './types.js'; +import { + type SlashCommand, + type CommandContext, + CommandKind, +} from './types.js'; import { MessageType, type HistoryItem } from '../types.js'; -import { refreshServerHierarchicalMemory } from '@google/gemini-cli-core'; +import { + refreshServerHierarchicalMemory, + type Config, +} from '@google/gemini-cli-core'; import { expandHomeDir, getDirectorySuggestions, batchAddDirectories, } from '../utils/directoryUtils.js'; -import type { Config } from '@google/gemini-cli-core'; import * as path from 'node:path'; import * as fs from 'node:fs'; diff --git a/packages/cli/src/ui/commands/helpCommand.test.ts b/packages/cli/src/ui/commands/helpCommand.test.ts index 58b02251f99..912b788de3b 100644 --- a/packages/cli/src/ui/commands/helpCommand.test.ts +++ b/packages/cli/src/ui/commands/helpCommand.test.ts @@ -6,10 +6,9 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { helpCommand } from './helpCommand.js'; -import { type CommandContext } from './types.js'; +import { type CommandContext, CommandKind } from './types.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { MessageType } from '../types.js'; -import { CommandKind } from './types.js'; describe('helpCommand', () => { let mockContext: CommandContext; diff --git a/packages/cli/src/ui/commands/helpCommand.ts b/packages/cli/src/ui/commands/helpCommand.ts index ce2ff36d9c3..91383ced145 100644 --- a/packages/cli/src/ui/commands/helpCommand.ts +++ b/packages/cli/src/ui/commands/helpCommand.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { type SlashCommand, CommandKind } from './types.js'; import { MessageType, type HistoryItemHelp } from '../types.js'; export const helpCommand: SlashCommand = { diff --git a/packages/cli/src/ui/commands/hooksCommand.test.ts b/packages/cli/src/ui/commands/hooksCommand.test.ts index ed7f7bb7477..710d02902f4 100644 --- a/packages/cli/src/ui/commands/hooksCommand.test.ts +++ b/packages/cli/src/ui/commands/hooksCommand.test.ts @@ -8,8 +8,12 @@ import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; import { hooksCommand } from './hooksCommand.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { MessageType } from '../types.js'; -import type { HookRegistryEntry } from '@google/gemini-cli-core'; -import { HookType, HookEventName, ConfigSource } from '@google/gemini-cli-core'; +import { + type HookRegistryEntry, + HookType, + HookEventName, + ConfigSource, +} from '@google/gemini-cli-core'; import type { CommandContext } from './types.js'; import { SettingScope } from '../../config/settings.js'; diff --git a/packages/cli/src/ui/commands/hooksCommand.ts b/packages/cli/src/ui/commands/hooksCommand.ts index 92fa72b2352..6a11cd39aaa 100644 --- a/packages/cli/src/ui/commands/hooksCommand.ts +++ b/packages/cli/src/ui/commands/hooksCommand.ts @@ -4,14 +4,17 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { SlashCommand, CommandContext } from './types.js'; -import { CommandKind } from './types.js'; +import { + type SlashCommand, + type CommandContext, + CommandKind, +} from './types.js'; import { MessageType, type HistoryItemHooksList } from '../types.js'; -import type { - HookRegistryEntry, - MessageActionReturn, +import { + type HookRegistryEntry, + type MessageActionReturn, + getErrorMessage, } from '@google/gemini-cli-core'; -import { getErrorMessage } from '@google/gemini-cli-core'; import { SettingScope, isLoadableSettingScope } from '../../config/settings.js'; import { enableHook, disableHook } from '../../utils/hookSettings.js'; import { renderHookActionFeedback } from '../../utils/hookUtils.js'; diff --git a/packages/cli/src/ui/commands/ideCommand.test.ts b/packages/cli/src/ui/commands/ideCommand.test.ts index 73486e2bf15..070359eda8d 100644 --- a/packages/cli/src/ui/commands/ideCommand.test.ts +++ b/packages/cli/src/ui/commands/ideCommand.test.ts @@ -4,8 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { MockInstance } from 'vitest'; -import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; +import { + type MockInstance, + vi, + describe, + it, + expect, + beforeEach, + afterEach, +} from 'vitest'; import { ideCommand } from './ideCommand.js'; import { type CommandContext } from './types.js'; import { IDE_DEFINITIONS } from '@google/gemini-cli-core'; diff --git a/packages/cli/src/ui/commands/ideCommand.ts b/packages/cli/src/ui/commands/ideCommand.ts index 1f726f90e55..6bd2f4af78e 100644 --- a/packages/cli/src/ui/commands/ideCommand.ts +++ b/packages/cli/src/ui/commands/ideCommand.ts @@ -11,20 +11,18 @@ import { logIdeConnection, IdeConnectionEvent, IdeConnectionType, -} from '@google/gemini-cli-core'; -import { getIdeInstaller, IDEConnectionStatus, ideContextStore, GEMINI_CLI_COMPANION_EXTENSION_NAME, } from '@google/gemini-cli-core'; import path from 'node:path'; -import type { - CommandContext, - SlashCommand, - SlashCommandActionReturn, +import { + type CommandContext, + type SlashCommand, + type SlashCommandActionReturn, + CommandKind, } from './types.js'; -import { CommandKind } from './types.js'; import { SettingScope } from '../../config/settings.js'; function getIdeStatusMessage(ideClient: IdeClient): { diff --git a/packages/cli/src/ui/commands/initCommand.ts b/packages/cli/src/ui/commands/initCommand.ts index ea0d1ea0c62..f4c02fda133 100644 --- a/packages/cli/src/ui/commands/initCommand.ts +++ b/packages/cli/src/ui/commands/initCommand.ts @@ -6,12 +6,12 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; -import type { - CommandContext, - SlashCommand, - SlashCommandActionReturn, +import { + type CommandContext, + type SlashCommand, + type SlashCommandActionReturn, + CommandKind, } from './types.js'; -import { CommandKind } from './types.js'; import { performInit } from '@google/gemini-cli-core'; export const initCommand: SlashCommand = { diff --git a/packages/cli/src/ui/commands/mcpCommand.ts b/packages/cli/src/ui/commands/mcpCommand.ts index e488db780fe..62c1e87c4a1 100644 --- a/packages/cli/src/ui/commands/mcpCommand.ts +++ b/packages/cli/src/ui/commands/mcpCommand.ts @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - SlashCommand, - SlashCommandActionReturn, - CommandContext, +import { + type SlashCommand, + type SlashCommandActionReturn, + type CommandContext, + CommandKind, } from './types.js'; -import { CommandKind } from './types.js'; -import type { MessageActionReturn } from '@google/gemini-cli-core'; import { + type MessageActionReturn, DiscoveredMCPTool, getMCPDiscoveryState, getMCPServerStatus, diff --git a/packages/cli/src/ui/commands/memoryCommand.test.ts b/packages/cli/src/ui/commands/memoryCommand.test.ts index 1a2c7e39362..4e036577ff7 100644 --- a/packages/cli/src/ui/commands/memoryCommand.test.ts +++ b/packages/cli/src/ui/commands/memoryCommand.test.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { Mock } from 'vitest'; -import { vi, describe, it, expect, beforeEach } from 'vitest'; +import { type Mock, vi, describe, it, expect, beforeEach } from 'vitest'; import { memoryCommand } from './memoryCommand.js'; import type { SlashCommand, CommandContext } from './types.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; diff --git a/packages/cli/src/ui/commands/memoryCommand.ts b/packages/cli/src/ui/commands/memoryCommand.ts index a31280f824b..b4dba10bbe3 100644 --- a/packages/cli/src/ui/commands/memoryCommand.ts +++ b/packages/cli/src/ui/commands/memoryCommand.ts @@ -11,8 +11,11 @@ import { showMemory, } from '@google/gemini-cli-core'; import { MessageType } from '../types.js'; -import type { SlashCommand, SlashCommandActionReturn } from './types.js'; -import { CommandKind } from './types.js'; +import { + type SlashCommand, + type SlashCommandActionReturn, + CommandKind, +} from './types.js'; export const memoryCommand: SlashCommand = { name: 'memory', diff --git a/packages/cli/src/ui/commands/permissionsCommand.ts b/packages/cli/src/ui/commands/permissionsCommand.ts index 7aecbcf2a2a..01519165c4e 100644 --- a/packages/cli/src/ui/commands/permissionsCommand.ts +++ b/packages/cli/src/ui/commands/permissionsCommand.ts @@ -4,12 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - OpenDialogActionReturn, - SlashCommand, - SlashCommandActionReturn, +import { + type OpenDialogActionReturn, + type SlashCommand, + type SlashCommandActionReturn, + CommandKind, } from './types.js'; -import { CommandKind } from './types.js'; import * as process from 'node:process'; import * as path from 'node:path'; import * as fs from 'node:fs'; diff --git a/packages/cli/src/ui/commands/privacyCommand.ts b/packages/cli/src/ui/commands/privacyCommand.ts index 4526de500e7..d7712a6b141 100644 --- a/packages/cli/src/ui/commands/privacyCommand.ts +++ b/packages/cli/src/ui/commands/privacyCommand.ts @@ -4,8 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { OpenDialogActionReturn, SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { + type OpenDialogActionReturn, + type SlashCommand, + CommandKind, +} from './types.js'; export const privacyCommand: SlashCommand = { name: 'privacy', diff --git a/packages/cli/src/ui/commands/resumeCommand.ts b/packages/cli/src/ui/commands/resumeCommand.ts index 636dfef1b6b..4e15a10543f 100644 --- a/packages/cli/src/ui/commands/resumeCommand.ts +++ b/packages/cli/src/ui/commands/resumeCommand.ts @@ -4,12 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - OpenDialogActionReturn, - CommandContext, - SlashCommand, +import { + type OpenDialogActionReturn, + type CommandContext, + type SlashCommand, + CommandKind, } from './types.js'; -import { CommandKind } from './types.js'; export const resumeCommand: SlashCommand = { name: 'resume', diff --git a/packages/cli/src/ui/commands/settingsCommand.ts b/packages/cli/src/ui/commands/settingsCommand.ts index 91b2c50cc6a..40757496141 100644 --- a/packages/cli/src/ui/commands/settingsCommand.ts +++ b/packages/cli/src/ui/commands/settingsCommand.ts @@ -4,8 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { OpenDialogActionReturn, SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { + type OpenDialogActionReturn, + type SlashCommand, + CommandKind, +} from './types.js'; export const settingsCommand: SlashCommand = { name: 'settings', diff --git a/packages/cli/src/ui/commands/setupGithubCommand.test.ts b/packages/cli/src/ui/commands/setupGithubCommand.test.ts index 0125ae70bd5..d53dcc19e7e 100644 --- a/packages/cli/src/ui/commands/setupGithubCommand.test.ts +++ b/packages/cli/src/ui/commands/setupGithubCommand.test.ts @@ -17,8 +17,7 @@ import { } from './setupGithubCommand.js'; import type { CommandContext } from './types.js'; import * as commandUtils from '../utils/commandUtils.js'; -import type { ToolActionReturn } from '@google/gemini-cli-core'; -import { debugLogger } from '@google/gemini-cli-core'; +import { type ToolActionReturn, debugLogger } from '@google/gemini-cli-core'; vi.mock('child_process'); diff --git a/packages/cli/src/ui/commands/setupGithubCommand.ts b/packages/cli/src/ui/commands/setupGithubCommand.ts index a125b1eda4c..31692e66c13 100644 --- a/packages/cli/src/ui/commands/setupGithubCommand.ts +++ b/packages/cli/src/ui/commands/setupGithubCommand.ts @@ -17,8 +17,11 @@ import { getGitHubRepoInfo, } from '../../utils/gitUtils.js'; -import type { SlashCommand, SlashCommandActionReturn } from './types.js'; -import { CommandKind } from './types.js'; +import { + type SlashCommand, + type SlashCommandActionReturn, + CommandKind, +} from './types.js'; import { getUrlOpenCommand } from '../../ui/utils/commandUtils.js'; import { debugLogger } from '@google/gemini-cli-core'; diff --git a/packages/cli/src/ui/commands/shortcutsCommand.ts b/packages/cli/src/ui/commands/shortcutsCommand.ts index 49dc869e6bb..cb56dc22b23 100644 --- a/packages/cli/src/ui/commands/shortcutsCommand.ts +++ b/packages/cli/src/ui/commands/shortcutsCommand.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { type SlashCommand, CommandKind } from './types.js'; export const shortcutsCommand: SlashCommand = { name: 'shortcuts', diff --git a/packages/cli/src/ui/commands/statsCommand.ts b/packages/cli/src/ui/commands/statsCommand.ts index 1ded0066188..255d2b04d2d 100644 --- a/packages/cli/src/ui/commands/statsCommand.ts +++ b/packages/cli/src/ui/commands/statsCommand.ts @@ -4,12 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - HistoryItemStats, - HistoryItemModelStats, - HistoryItemToolStats, +import { + type HistoryItemStats, + type HistoryItemModelStats, + type HistoryItemToolStats, + MessageType, } from '../types.js'; -import { MessageType } from '../types.js'; import { formatDuration } from '../utils/formatters.js'; import { UserAccountManager, diff --git a/packages/cli/src/ui/commands/terminalSetupCommand.ts b/packages/cli/src/ui/commands/terminalSetupCommand.ts index 780513ab6c6..e66f0cde096 100644 --- a/packages/cli/src/ui/commands/terminalSetupCommand.ts +++ b/packages/cli/src/ui/commands/terminalSetupCommand.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { type SlashCommand, CommandKind } from './types.js'; import { terminalSetup } from '../utils/terminalSetup.js'; import { type MessageActionReturn } from '@google/gemini-cli-core'; diff --git a/packages/cli/src/ui/commands/themeCommand.ts b/packages/cli/src/ui/commands/themeCommand.ts index 4b72625d556..a5406942dbb 100644 --- a/packages/cli/src/ui/commands/themeCommand.ts +++ b/packages/cli/src/ui/commands/themeCommand.ts @@ -4,8 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { OpenDialogActionReturn, SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { + type OpenDialogActionReturn, + type SlashCommand, + CommandKind, +} from './types.js'; export const themeCommand: SlashCommand = { name: 'theme', diff --git a/packages/cli/src/ui/commands/toolsCommand.test.ts b/packages/cli/src/ui/commands/toolsCommand.test.ts index 257e6ba1679..8c8ea451ce6 100644 --- a/packages/cli/src/ui/commands/toolsCommand.test.ts +++ b/packages/cli/src/ui/commands/toolsCommand.test.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { vi } from 'vitest'; -import { describe, it, expect } from 'vitest'; +import { type vi, describe, it, expect } from 'vitest'; import { toolsCommand } from './toolsCommand.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { MessageType } from '../types.js'; diff --git a/packages/cli/src/ui/commands/vimCommand.ts b/packages/cli/src/ui/commands/vimCommand.ts index 972a230d351..01c7ec40d36 100644 --- a/packages/cli/src/ui/commands/vimCommand.ts +++ b/packages/cli/src/ui/commands/vimCommand.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { SlashCommand } from './types.js'; -import { CommandKind } from './types.js'; +import { type SlashCommand, CommandKind } from './types.js'; export const vimCommand: SlashCommand = { name: 'vim', diff --git a/packages/cli/src/ui/components/AgentConfigDialog.tsx b/packages/cli/src/ui/components/AgentConfigDialog.tsx index 5b4eb1e912f..b7454108dcd 100644 --- a/packages/cli/src/ui/components/AgentConfigDialog.tsx +++ b/packages/cli/src/ui/components/AgentConfigDialog.tsx @@ -8,11 +8,11 @@ import type React from 'react'; import { useState, useEffect, useMemo, useCallback } from 'react'; import { Text } from 'ink'; import { theme } from '../semantic-colors.js'; -import type { - LoadableSettingScope, - LoadedSettings, +import { + type LoadableSettingScope, + type LoadedSettings, + SettingScope, } from '../../config/settings.js'; -import { SettingScope } from '../../config/settings.js'; import type { AgentDefinition, AgentOverride } from '@google/gemini-cli-core'; import { getCachedStringWidth } from '../utils/textUtils.js'; import { diff --git a/packages/cli/src/ui/components/AskUserDialog.tsx b/packages/cli/src/ui/components/AskUserDialog.tsx index 96065135100..1bb0f553051 100644 --- a/packages/cli/src/ui/components/AskUserDialog.tsx +++ b/packages/cli/src/ui/components/AskUserDialog.tsx @@ -15,13 +15,12 @@ import { } from 'react'; import { Box, Text } from 'ink'; import { theme } from '../semantic-colors.js'; -import type { Question } from '@google/gemini-cli-core'; +import { type Question, checkExhaustive } from '@google/gemini-cli-core'; import { BaseSelectionList } from './shared/BaseSelectionList.js'; import type { SelectionListItem } from '../hooks/useSelectionList.js'; import { TabHeader, type Tab } from './shared/TabHeader.js'; import { useKeypress, type Key } from '../hooks/useKeypress.js'; import { keyMatchers, Command } from '../keyMatchers.js'; -import { checkExhaustive } from '@google/gemini-cli-core'; import { TextInput } from './shared/TextInput.js'; import { useTextBuffer } from './shared/text-buffer.js'; import { getCachedStringWidth } from '../utils/textUtils.js'; diff --git a/packages/cli/src/ui/components/Checklist.tsx b/packages/cli/src/ui/components/Checklist.tsx index cfbd4268fda..d9fb51278c3 100644 --- a/packages/cli/src/ui/components/Checklist.tsx +++ b/packages/cli/src/ui/components/Checklist.tsx @@ -5,9 +5,9 @@ */ import type React from 'react'; +import { useMemo } from 'react'; import { Box, Text } from 'ink'; import { theme } from '../semantic-colors.js'; -import { useMemo } from 'react'; import { ChecklistItem, type ChecklistItemData } from './ChecklistItem.js'; export interface ChecklistProps { diff --git a/packages/cli/src/ui/components/Composer.test.tsx b/packages/cli/src/ui/components/Composer.test.tsx index 999b1531f9e..08ed6efd801 100644 --- a/packages/cli/src/ui/components/Composer.test.tsx +++ b/packages/cli/src/ui/components/Composer.test.tsx @@ -28,8 +28,8 @@ import { ApprovalMode, tokenLimit, CoreToolCallStatus, + type Config, } from '@google/gemini-cli-core'; -import type { Config } from '@google/gemini-cli-core'; import { StreamingState } from '../types.js'; import { TransientMessageType } from '../../utils/events.js'; import type { LoadedSettings } from '../../config/settings.js'; diff --git a/packages/cli/src/ui/components/DetailedMessagesDisplay.tsx b/packages/cli/src/ui/components/DetailedMessagesDisplay.tsx index 097ebe13786..df58bdb5004 100644 --- a/packages/cli/src/ui/components/DetailedMessagesDisplay.tsx +++ b/packages/cli/src/ui/components/DetailedMessagesDisplay.tsx @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { useRef, useCallback } from 'react'; import type React from 'react'; +import { useRef, useCallback } from 'react'; import { Box, Text } from 'ink'; import { theme } from '../semantic-colors.js'; import type { ConsoleMessageItem } from '../types.js'; diff --git a/packages/cli/src/ui/components/EditorSettingsDialog.test.tsx b/packages/cli/src/ui/components/EditorSettingsDialog.test.tsx index 36832c16628..6ebe22d9825 100644 --- a/packages/cli/src/ui/components/EditorSettingsDialog.test.tsx +++ b/packages/cli/src/ui/components/EditorSettingsDialog.test.tsx @@ -7,8 +7,7 @@ import { render } from '../../test-utils/render.js'; import { EditorSettingsDialog } from './EditorSettingsDialog.js'; import { describe, it, expect, vi, beforeEach } from 'vitest'; -import { SettingScope } from '../../config/settings.js'; -import type { LoadedSettings } from '../../config/settings.js'; +import { SettingScope, type LoadedSettings } from '../../config/settings.js'; import { KeypressProvider } from '../contexts/KeypressContext.js'; import { act } from 'react'; import { waitFor } from '../../test-utils/async.js'; diff --git a/packages/cli/src/ui/components/EditorSettingsDialog.tsx b/packages/cli/src/ui/components/EditorSettingsDialog.tsx index f75b1c27b89..8a41da92462 100644 --- a/packages/cli/src/ui/components/EditorSettingsDialog.tsx +++ b/packages/cli/src/ui/components/EditorSettingsDialog.tsx @@ -13,18 +13,18 @@ import { type EditorDisplay, } from '../editors/editorSettingsManager.js'; import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; -import type { - LoadableSettingScope, - LoadedSettings, +import { + type LoadableSettingScope, + type LoadedSettings, + SettingScope, } from '../../config/settings.js'; -import { SettingScope } from '../../config/settings.js'; import { type EditorType, isEditorAvailable, EDITOR_DISPLAY_NAMES, + coreEvents, } from '@google/gemini-cli-core'; import { useKeypress } from '../hooks/useKeypress.js'; -import { coreEvents } from '@google/gemini-cli-core'; interface EditorDialogProps { onSelect: ( diff --git a/packages/cli/src/ui/components/FolderTrustDialog.tsx b/packages/cli/src/ui/components/FolderTrustDialog.tsx index 2067a5dc3a4..8da424260a4 100644 --- a/packages/cli/src/ui/components/FolderTrustDialog.tsx +++ b/packages/cli/src/ui/components/FolderTrustDialog.tsx @@ -9,8 +9,10 @@ import type React from 'react'; import { useEffect, useState, useCallback } from 'react'; import { theme } from '../semantic-colors.js'; import stripAnsi from 'strip-ansi'; -import type { RadioSelectItem } from './shared/RadioButtonSelect.js'; -import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; +import { + type RadioSelectItem, + RadioButtonSelect, +} from './shared/RadioButtonSelect.js'; import { MaxSizedBox } from './shared/MaxSizedBox.js'; import { Scrollable } from './shared/Scrollable.js'; import { useKeypress } from '../hooks/useKeypress.js'; diff --git a/packages/cli/src/ui/components/Help.test.tsx b/packages/cli/src/ui/components/Help.test.tsx index e16364a7ea5..60532905110 100644 --- a/packages/cli/src/ui/components/Help.test.tsx +++ b/packages/cli/src/ui/components/Help.test.tsx @@ -7,8 +7,7 @@ import { render } from '../../test-utils/render.js'; import { describe, it, expect } from 'vitest'; import { Help } from './Help.js'; -import type { SlashCommand } from '../commands/types.js'; -import { CommandKind } from '../commands/types.js'; +import { type SlashCommand, CommandKind } from '../commands/types.js'; const mockCommands: readonly SlashCommand[] = [ { diff --git a/packages/cli/src/ui/components/HistoryItemDisplay.test.tsx b/packages/cli/src/ui/components/HistoryItemDisplay.test.tsx index f8c251fbfad..bbd5f8bc085 100644 --- a/packages/cli/src/ui/components/HistoryItemDisplay.test.tsx +++ b/packages/cli/src/ui/components/HistoryItemDisplay.test.tsx @@ -6,8 +6,7 @@ import { describe, it, expect, vi } from 'vitest'; import { HistoryItemDisplay } from './HistoryItemDisplay.js'; -import { type HistoryItem } from '../types.js'; -import { MessageType } from '../types.js'; +import { type HistoryItem, MessageType } from '../types.js'; import { SessionStatsProvider } from '../contexts/SessionContext.js'; import { type Config, diff --git a/packages/cli/src/ui/components/InputPrompt.test.tsx b/packages/cli/src/ui/components/InputPrompt.test.tsx index 65a4440d770..d44112f68d6 100644 --- a/packages/cli/src/ui/components/InputPrompt.test.tsx +++ b/packages/cli/src/ui/components/InputPrompt.test.tsx @@ -8,31 +8,46 @@ import { renderWithProviders } from '../../test-utils/render.js'; import { createMockSettings } from '../../test-utils/settings.js'; import { waitFor } from '../../test-utils/async.js'; import { act, useState } from 'react'; -import type { InputPromptProps } from './InputPrompt.js'; -import { InputPrompt, tryTogglePasteExpansion } from './InputPrompt.js'; -import type { TextBuffer } from './shared/text-buffer.js'; import { + type InputPromptProps, + InputPrompt, + tryTogglePasteExpansion, +} from './InputPrompt.js'; +import { + type TextBuffer, calculateTransformationsForLine, calculateTransformedLine, } from './shared/text-buffer.js'; -import type { Config } from '@google/gemini-cli-core'; -import { ApprovalMode, debugLogger } from '@google/gemini-cli-core'; +import { + type Config, + ApprovalMode, + debugLogger, +} from '@google/gemini-cli-core'; import * as path from 'node:path'; -import type { CommandContext, SlashCommand } from '../commands/types.js'; -import { CommandKind } from '../commands/types.js'; +import { + type CommandContext, + type SlashCommand, + CommandKind, +} from '../commands/types.js'; import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest'; import { Text } from 'ink'; -import type { UseShellHistoryReturn } from '../hooks/useShellHistory.js'; -import { useShellHistory } from '../hooks/useShellHistory.js'; -import type { UseCommandCompletionReturn } from '../hooks/useCommandCompletion.js'; import { + type UseShellHistoryReturn, + useShellHistory, +} from '../hooks/useShellHistory.js'; +import { + type UseCommandCompletionReturn, useCommandCompletion, CompletionMode, } from '../hooks/useCommandCompletion.js'; -import type { UseInputHistoryReturn } from '../hooks/useInputHistory.js'; -import { useInputHistory } from '../hooks/useInputHistory.js'; -import type { UseReverseSearchCompletionReturn } from '../hooks/useReverseSearchCompletion.js'; -import { useReverseSearchCompletion } from '../hooks/useReverseSearchCompletion.js'; +import { + type UseInputHistoryReturn, + useInputHistory, +} from '../hooks/useInputHistory.js'; +import { + type UseReverseSearchCompletionReturn, + useReverseSearchCompletion, +} from '../hooks/useReverseSearchCompletion.js'; import clipboardy from 'clipboardy'; import * as clipboardUtils from '../utils/clipboardUtils.js'; import { useKittyKeyboardProtocol } from '../hooks/useKittyKeyboardProtocol.js'; diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx index 38b62ad9270..2662cac14b3 100644 --- a/packages/cli/src/ui/components/InputPrompt.tsx +++ b/packages/cli/src/ui/components/InputPrompt.tsx @@ -5,8 +5,14 @@ */ import type React from 'react'; +import { + useCallback, + useEffect, + useState, + useRef, + useMemo, +} from 'react'; import clipboardy from 'clipboardy'; -import { useCallback, useEffect, useState, useRef, useMemo } from 'react'; import { Box, Text, useStdout, type DOMElement } from 'ink'; import { SuggestionsDisplay, MAX_WIDTH } from './SuggestionsDisplay.js'; import { theme } from '../semantic-colors.js'; @@ -34,12 +40,15 @@ import { useCommandCompletion, CompletionMode, } from '../hooks/useCommandCompletion.js'; -import type { Key } from '../hooks/useKeypress.js'; -import { useKeypress } from '../hooks/useKeypress.js'; +import { type Key, useKeypress } from '../hooks/useKeypress.js'; import { keyMatchers, Command } from '../keyMatchers.js'; import type { CommandContext, SlashCommand } from '../commands/types.js'; -import type { Config } from '@google/gemini-cli-core'; -import { ApprovalMode, coreEvents, debugLogger } from '@google/gemini-cli-core'; +import { + type Config, + ApprovalMode, + coreEvents, + debugLogger, +} from '@google/gemini-cli-core'; import { parseInputForHighlighting, parseSegmentsFromTokens, diff --git a/packages/cli/src/ui/components/LogoutConfirmationDialog.tsx b/packages/cli/src/ui/components/LogoutConfirmationDialog.tsx index e50d7ef5680..61319ba418b 100644 --- a/packages/cli/src/ui/components/LogoutConfirmationDialog.tsx +++ b/packages/cli/src/ui/components/LogoutConfirmationDialog.tsx @@ -7,8 +7,10 @@ import { Box, Text } from 'ink'; import type React from 'react'; import { theme } from '../semantic-colors.js'; -import type { RadioSelectItem } from './shared/RadioButtonSelect.js'; -import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; +import { + type RadioSelectItem, + RadioButtonSelect, +} from './shared/RadioButtonSelect.js'; import { useKeypress } from '../hooks/useKeypress.js'; export enum LogoutChoice { diff --git a/packages/cli/src/ui/components/LoopDetectionConfirmation.tsx b/packages/cli/src/ui/components/LoopDetectionConfirmation.tsx index 5d4690e51bf..3339b9c7c05 100644 --- a/packages/cli/src/ui/components/LoopDetectionConfirmation.tsx +++ b/packages/cli/src/ui/components/LoopDetectionConfirmation.tsx @@ -5,8 +5,10 @@ */ import { Box, Text } from 'ink'; -import type { RadioSelectItem } from './shared/RadioButtonSelect.js'; -import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; +import { + type RadioSelectItem, + RadioButtonSelect, +} from './shared/RadioButtonSelect.js'; import { useKeypress } from '../hooks/useKeypress.js'; import { theme } from '../semantic-colors.js'; diff --git a/packages/cli/src/ui/components/ModelDialog.test.tsx b/packages/cli/src/ui/components/ModelDialog.test.tsx index d5c89215b87..0a7e8180ba5 100644 --- a/packages/cli/src/ui/components/ModelDialog.test.tsx +++ b/packages/cli/src/ui/components/ModelDialog.test.tsx @@ -20,8 +20,9 @@ import { PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, AuthType, + type Config, + type ModelSlashCommandEvent, } from '@google/gemini-cli-core'; -import type { Config, ModelSlashCommandEvent } from '@google/gemini-cli-core'; // Mock dependencies const mockGetDisplayString = vi.fn(); diff --git a/packages/cli/src/ui/components/MultiFolderTrustDialog.tsx b/packages/cli/src/ui/components/MultiFolderTrustDialog.tsx index 0c2c4e362d9..d96a495034f 100644 --- a/packages/cli/src/ui/components/MultiFolderTrustDialog.tsx +++ b/packages/cli/src/ui/components/MultiFolderTrustDialog.tsx @@ -8,8 +8,10 @@ import { Box, Text } from 'ink'; import type React from 'react'; import { useState } from 'react'; import { theme } from '../semantic-colors.js'; -import type { RadioSelectItem } from './shared/RadioButtonSelect.js'; -import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; +import { + type RadioSelectItem, + RadioButtonSelect, +} from './shared/RadioButtonSelect.js'; import { useKeypress } from '../hooks/useKeypress.js'; import { loadTrustedFolders, TrustLevel } from '../../config/trustedFolders.js'; import { expandHomeDir } from '../utils/directoryUtils.js'; diff --git a/packages/cli/src/ui/components/PermissionsModifyTrustDialog.test.tsx b/packages/cli/src/ui/components/PermissionsModifyTrustDialog.test.tsx index 9ffaa8797be..3047922e09e 100644 --- a/packages/cli/src/ui/components/PermissionsModifyTrustDialog.test.tsx +++ b/packages/cli/src/ui/components/PermissionsModifyTrustDialog.test.tsx @@ -4,8 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; -import type { Mock } from 'vitest'; +import { + describe, + it, + expect, + vi, + beforeEach, + afterEach, + type Mock, +} from 'vitest'; import { renderWithProviders } from '../../test-utils/render.js'; import { waitFor } from '../../test-utils/async.js'; import { PermissionsModifyTrustDialog } from './PermissionsModifyTrustDialog.js'; diff --git a/packages/cli/src/ui/components/PolicyUpdateDialog.tsx b/packages/cli/src/ui/components/PolicyUpdateDialog.tsx index e6ed75c4dbd..fa3e4086a00 100644 --- a/packages/cli/src/ui/components/PolicyUpdateDialog.tsx +++ b/packages/cli/src/ui/components/PolicyUpdateDialog.tsx @@ -5,16 +5,18 @@ */ import { Box, Text } from 'ink'; -import { useCallback, useRef } from 'react'; import type React from 'react'; +import { useCallback, useRef } from 'react'; import { type Config, type PolicyUpdateConfirmationRequest, PolicyIntegrityManager, } from '@google/gemini-cli-core'; import { theme } from '../semantic-colors.js'; -import type { RadioSelectItem } from './shared/RadioButtonSelect.js'; -import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; +import { + type RadioSelectItem, + RadioButtonSelect, +} from './shared/RadioButtonSelect.js'; import { useKeypress } from '../hooks/useKeypress.js'; import { keyMatchers, Command } from '../keyMatchers.js'; diff --git a/packages/cli/src/ui/components/RewindConfirmation.tsx b/packages/cli/src/ui/components/RewindConfirmation.tsx index 5ff7e5e10ca..96fa9c09348 100644 --- a/packages/cli/src/ui/components/RewindConfirmation.tsx +++ b/packages/cli/src/ui/components/RewindConfirmation.tsx @@ -8,8 +8,10 @@ import { Box, Text } from 'ink'; import type React from 'react'; import { useMemo } from 'react'; import { theme } from '../semantic-colors.js'; -import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; -import type { RadioSelectItem } from './shared/RadioButtonSelect.js'; +import { + RadioButtonSelect, + type RadioSelectItem, +} from './shared/RadioButtonSelect.js'; import type { FileChangeStats } from '../utils/rewindFileOps.js'; import { useKeypress } from '../hooks/useKeypress.js'; import { formatTimeAgo } from '../utils/formatters.js'; diff --git a/packages/cli/src/ui/components/SessionBrowser.test.tsx b/packages/cli/src/ui/components/SessionBrowser.test.tsx index 2e68cb68981..708a1b5ef85 100644 --- a/packages/cli/src/ui/components/SessionBrowser.test.tsx +++ b/packages/cli/src/ui/components/SessionBrowser.test.tsx @@ -9,8 +9,7 @@ import { act } from 'react'; import { render } from '../../test-utils/render.js'; import { waitFor } from '../../test-utils/async.js'; import type { Config } from '@google/gemini-cli-core'; -import { SessionBrowser } from './SessionBrowser.js'; -import type { SessionBrowserProps } from './SessionBrowser.js'; +import { SessionBrowser, type SessionBrowserProps } from './SessionBrowser.js'; import type { SessionInfo } from '../../utils/sessionUtils.js'; // Collect key handlers registered via useKeypress so tests can diff --git a/packages/cli/src/ui/components/SessionBrowser.tsx b/packages/cli/src/ui/components/SessionBrowser.tsx index 9d1ce57f52a..a6dbe207522 100644 --- a/packages/cli/src/ui/components/SessionBrowser.tsx +++ b/packages/cli/src/ui/components/SessionBrowser.tsx @@ -5,15 +5,22 @@ */ import type React from 'react'; -import { useState, useCallback, useMemo, useEffect, useRef } from 'react'; +import { + useState, + useCallback, + useMemo, + useEffect, + useRef, +} from 'react'; import { Box, Text } from 'ink'; import { Colors } from '../colors.js'; import { useTerminalSize } from '../hooks/useTerminalSize.js'; import { useKeypress } from '../hooks/useKeypress.js'; import path from 'node:path'; import type { Config } from '@google/gemini-cli-core'; -import type { SessionInfo, TextMatch } from '../../utils/sessionUtils.js'; import { + type SessionInfo, + type TextMatch, cleanMessage, formatRelativeTime, getSessionFiles, diff --git a/packages/cli/src/ui/components/SettingsDialog.tsx b/packages/cli/src/ui/components/SettingsDialog.tsx index e426e9bbe33..7d7ed1d16d2 100644 --- a/packages/cli/src/ui/components/SettingsDialog.tsx +++ b/packages/cli/src/ui/components/SettingsDialog.tsx @@ -10,12 +10,12 @@ import { Text } from 'ink'; import { AsyncFzf } from 'fzf'; import type { Key } from '../hooks/useKeypress.js'; import { theme } from '../semantic-colors.js'; -import type { - LoadableSettingScope, - LoadedSettings, - Settings, +import { + type LoadableSettingScope, + type LoadedSettings, + type Settings, + SettingScope, } from '../../config/settings.js'; -import { SettingScope } from '../../config/settings.js'; import { getScopeMessageForSetting } from '../../utils/dialogScopeUtils.js'; import { getDialogSettingKeys, @@ -37,8 +37,7 @@ import { type SettingsValue, TOGGLE_TYPES, } from '../../config/settingsSchema.js'; -import { coreEvents, debugLogger } from '@google/gemini-cli-core'; -import type { Config } from '@google/gemini-cli-core'; +import { coreEvents, debugLogger, type Config } from '@google/gemini-cli-core'; import { useSearchBuffer } from '../hooks/useSearchBuffer.js'; import { diff --git a/packages/cli/src/ui/components/ShellInputPrompt.tsx b/packages/cli/src/ui/components/ShellInputPrompt.tsx index 26e32d946f7..4b32e78c27f 100644 --- a/packages/cli/src/ui/components/ShellInputPrompt.tsx +++ b/packages/cli/src/ui/components/ShellInputPrompt.tsx @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { useCallback } from 'react'; import type React from 'react'; +import { useCallback } from 'react'; import { useKeypress } from '../hooks/useKeypress.js'; import { ShellExecutionService } from '@google/gemini-cli-core'; import { keyToAnsi, type Key } from '../hooks/keyToAnsi.js'; diff --git a/packages/cli/src/ui/components/StatsDisplay.tsx b/packages/cli/src/ui/components/StatsDisplay.tsx index 65169f6d74f..b70e8a98046 100644 --- a/packages/cli/src/ui/components/StatsDisplay.tsx +++ b/packages/cli/src/ui/components/StatsDisplay.tsx @@ -9,8 +9,10 @@ import { Box, Text } from 'ink'; import { ThemedGradient } from './ThemedGradient.js'; import { theme } from '../semantic-colors.js'; import { formatDuration, formatResetTime } from '../utils/formatters.js'; -import type { ModelMetrics } from '../contexts/SessionContext.js'; -import { useSessionStats } from '../contexts/SessionContext.js'; +import { + type ModelMetrics, + useSessionStats, +} from '../contexts/SessionContext.js'; import { getStatusColor, TOOL_SUCCESS_RATE_HIGH, diff --git a/packages/cli/src/ui/components/ThemeDialog.tsx b/packages/cli/src/ui/components/ThemeDialog.tsx index c4bfe668978..4722190afaa 100644 --- a/packages/cli/src/ui/components/ThemeDialog.tsx +++ b/packages/cli/src/ui/components/ThemeDialog.tsx @@ -13,11 +13,11 @@ import { pickDefaultThemeName, type Theme } from '../themes/theme.js'; import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; import { DiffRenderer } from './messages/DiffRenderer.js'; import { colorizeCode } from '../utils/CodeColorizer.js'; -import type { - LoadableSettingScope, - LoadedSettings, +import { + type LoadableSettingScope, + type LoadedSettings, + SettingScope, } from '../../config/settings.js'; -import { SettingScope } from '../../config/settings.js'; import { getScopeMessageForSetting } from '../../utils/dialogScopeUtils.js'; import { useKeypress } from '../hooks/useKeypress.js'; import { useAlternateBuffer } from '../hooks/useAlternateBuffer.js'; diff --git a/packages/cli/src/ui/components/messages/CompressionMessage.test.tsx b/packages/cli/src/ui/components/messages/CompressionMessage.test.tsx index 7a4b9bc42d9..06ff0492327 100644 --- a/packages/cli/src/ui/components/messages/CompressionMessage.test.tsx +++ b/packages/cli/src/ui/components/messages/CompressionMessage.test.tsx @@ -5,8 +5,10 @@ */ import { renderWithProviders } from '../../../test-utils/render.js'; -import type { CompressionDisplayProps } from './CompressionMessage.js'; -import { CompressionMessage } from './CompressionMessage.js'; +import { + type CompressionDisplayProps, + CompressionMessage, +} from './CompressionMessage.js'; import { CompressionStatus } from '@google/gemini-cli-core'; import type { CompressionProps } from '../../types.js'; import { describe, it, expect } from 'vitest'; diff --git a/packages/cli/src/ui/components/messages/RedirectionConfirmation.test.tsx b/packages/cli/src/ui/components/messages/RedirectionConfirmation.test.tsx index 15763bdae7e..fbb7b6fedb2 100644 --- a/packages/cli/src/ui/components/messages/RedirectionConfirmation.test.tsx +++ b/packages/cli/src/ui/components/messages/RedirectionConfirmation.test.tsx @@ -6,11 +6,11 @@ import { describe, it, expect, beforeAll } from 'vitest'; import { ToolConfirmationMessage } from './ToolConfirmationMessage.js'; -import type { - SerializableConfirmationDetails, - Config, +import { + type SerializableConfirmationDetails, + type Config, + initializeShellParsers, } from '@google/gemini-cli-core'; -import { initializeShellParsers } from '@google/gemini-cli-core'; import { renderWithProviders } from '../../../test-utils/render.js'; describe('ToolConfirmationMessage Redirection', () => { diff --git a/packages/cli/src/ui/components/messages/Todo.test.tsx b/packages/cli/src/ui/components/messages/Todo.test.tsx index b6413e496ab..d727790638d 100644 --- a/packages/cli/src/ui/components/messages/Todo.test.tsx +++ b/packages/cli/src/ui/components/messages/Todo.test.tsx @@ -8,11 +8,9 @@ import { render } from '../../../test-utils/render.js'; import { describe, it, expect } from 'vitest'; import { Box } from 'ink'; import { TodoTray } from './Todo.js'; -import type { Todo } from '@google/gemini-cli-core'; -import type { UIState } from '../../contexts/UIStateContext.js'; -import { UIStateContext } from '../../contexts/UIStateContext.js'; +import { type Todo, CoreToolCallStatus } from '@google/gemini-cli-core'; +import { type UIState, UIStateContext } from '../../contexts/UIStateContext.js'; import type { HistoryItem } from '../../types.js'; -import { CoreToolCallStatus } from '@google/gemini-cli-core'; const createTodoHistoryItem = (todos: Todo[]): HistoryItem => ({ diff --git a/packages/cli/src/ui/components/messages/Todo.tsx b/packages/cli/src/ui/components/messages/Todo.tsx index 4f2b95fd3c8..a8c340db624 100644 --- a/packages/cli/src/ui/components/messages/Todo.tsx +++ b/packages/cli/src/ui/components/messages/Todo.tsx @@ -5,9 +5,9 @@ */ import type React from 'react'; +import { useMemo } from 'react'; import { type TodoList } from '@google/gemini-cli-core'; import { useUIState } from '../../contexts/UIStateContext.js'; -import { useMemo } from 'react'; import type { HistoryItemToolGroup } from '../../types.js'; import { Checklist } from '../Checklist.js'; import type { ChecklistItemData } from '../ChecklistItem.js'; diff --git a/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx b/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx index 022a68e9538..864ae050e0d 100644 --- a/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx +++ b/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx @@ -18,9 +18,11 @@ import { hasRedirection, debugLogger, } from '@google/gemini-cli-core'; -import type { RadioSelectItem } from '../shared/RadioButtonSelect.js'; +import { + type RadioSelectItem, + RadioButtonSelect, +} from '../shared/RadioButtonSelect.js'; import { useToolActions } from '../../contexts/ToolActionsContext.js'; -import { RadioButtonSelect } from '../shared/RadioButtonSelect.js'; import { MaxSizedBox, MINIMUM_MAX_HEIGHT } from '../shared/MaxSizedBox.js'; import { sanitizeForDisplay, diff --git a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx index 29e485a27ce..542ae84605a 100644 --- a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx +++ b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx @@ -7,12 +7,13 @@ import type React from 'react'; import { useMemo } from 'react'; import { Box, Text } from 'ink'; -import type { - HistoryItem, - HistoryItemWithoutId, - IndividualToolCallDisplay, +import { + type HistoryItem, + type HistoryItemWithoutId, + type IndividualToolCallDisplay, + ToolCallStatus, + mapCoreStatusToDisplayStatus, } from '../../types.js'; -import { ToolCallStatus, mapCoreStatusToDisplayStatus } from '../../types.js'; import { ToolMessage } from './ToolMessage.js'; import { ShellToolMessage } from './ShellToolMessage.js'; import { theme } from '../../semantic-colors.js'; diff --git a/packages/cli/src/ui/components/messages/ToolMessageRawMarkdown.test.tsx b/packages/cli/src/ui/components/messages/ToolMessageRawMarkdown.test.tsx index b81c9519782..b356f8c385a 100644 --- a/packages/cli/src/ui/components/messages/ToolMessageRawMarkdown.test.tsx +++ b/packages/cli/src/ui/components/messages/ToolMessageRawMarkdown.test.tsx @@ -5,8 +5,7 @@ */ import { describe, it, expect } from 'vitest'; -import type { ToolMessageProps } from './ToolMessage.js'; -import { ToolMessage } from './ToolMessage.js'; +import { type ToolMessageProps, ToolMessage } from './ToolMessage.js'; import { StreamingState } from '../../types.js'; import { StreamingContext } from '../../contexts/StreamingContext.js'; import { renderWithProviders } from '../../../test-utils/render.js'; diff --git a/packages/cli/src/ui/components/shared/BaseSelectionList.tsx b/packages/cli/src/ui/components/shared/BaseSelectionList.tsx index db0d624a74b..61e6ed8e935 100644 --- a/packages/cli/src/ui/components/shared/BaseSelectionList.tsx +++ b/packages/cli/src/ui/components/shared/BaseSelectionList.tsx @@ -8,9 +8,10 @@ import type React from 'react'; import { useEffect, useState } from 'react'; import { Text, Box } from 'ink'; import { theme } from '../../semantic-colors.js'; -import { useSelectionList } from '../../hooks/useSelectionList.js'; - -import type { SelectionListItem } from '../../hooks/useSelectionList.js'; +import { + useSelectionList, + type SelectionListItem, +} from '../../hooks/useSelectionList.js'; export interface RenderItemContext { isSelected: boolean; diff --git a/packages/cli/src/ui/components/shared/EnumSelector.tsx b/packages/cli/src/ui/components/shared/EnumSelector.tsx index a86efd8ff13..5553e6ff0d0 100644 --- a/packages/cli/src/ui/components/shared/EnumSelector.tsx +++ b/packages/cli/src/ui/components/shared/EnumSelector.tsx @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { useState, useEffect } from 'react'; import type React from 'react'; +import { useState, useEffect } from 'react'; import { Box, Text } from 'ink'; import { Colors } from '../../colors.js'; import type { SettingEnumOption } from '../../../config/settingsSchema.js'; diff --git a/packages/cli/src/ui/components/shared/RadioButtonSelect.test.tsx b/packages/cli/src/ui/components/shared/RadioButtonSelect.test.tsx index 33c77f1a25f..b9d7442f8aa 100644 --- a/packages/cli/src/ui/components/shared/RadioButtonSelect.test.tsx +++ b/packages/cli/src/ui/components/shared/RadioButtonSelect.test.tsx @@ -6,8 +6,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { renderWithProviders } from '../../../test-utils/render.js'; -import type { Text } from 'ink'; -import { Box } from 'ink'; +import { type Text, Box } from 'ink'; import type React from 'react'; import { RadioButtonSelect, diff --git a/packages/cli/src/ui/components/shared/ScrollableList.tsx b/packages/cli/src/ui/components/shared/ScrollableList.tsx index b7085329a31..73cf3dd7a98 100644 --- a/packages/cli/src/ui/components/shared/ScrollableList.tsx +++ b/packages/cli/src/ui/components/shared/ScrollableList.tsx @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import type React from 'react'; import { useRef, forwardRef, @@ -12,7 +13,6 @@ import { useMemo, useLayoutEffect, } from 'react'; -import type React from 'react'; import { VirtualizedList, type VirtualizedListRef, diff --git a/packages/cli/src/ui/components/shared/TextInput.tsx b/packages/cli/src/ui/components/shared/TextInput.tsx index 40f44cda534..720a42bab21 100644 --- a/packages/cli/src/ui/components/shared/TextInput.tsx +++ b/packages/cli/src/ui/components/shared/TextInput.tsx @@ -6,9 +6,8 @@ import type React from 'react'; import { useCallback } from 'react'; -import type { Key } from '../../hooks/useKeypress.js'; +import { type Key, useKeypress } from '../../hooks/useKeypress.js'; import { Text, Box } from 'ink'; -import { useKeypress } from '../../hooks/useKeypress.js'; import chalk from 'chalk'; import { theme } from '../../semantic-colors.js'; import type { TextBuffer } from './text-buffer.js'; diff --git a/packages/cli/src/ui/components/shared/VirtualizedList.tsx b/packages/cli/src/ui/components/shared/VirtualizedList.tsx index 669b1bc0352..150b6b5e897 100644 --- a/packages/cli/src/ui/components/shared/VirtualizedList.tsx +++ b/packages/cli/src/ui/components/shared/VirtualizedList.tsx @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import type React from 'react'; import { useState, useRef, @@ -13,7 +14,6 @@ import { useMemo, useCallback, } from 'react'; -import type React from 'react'; import { theme } from '../../semantic-colors.js'; import { useBatchedScroll } from '../../hooks/useBatchedScroll.js'; import { useUIState } from '../../contexts/UIStateContext.js'; diff --git a/packages/cli/src/ui/components/shared/text-buffer.test.ts b/packages/cli/src/ui/components/shared/text-buffer.test.ts index 51fa728c913..4d7c603053f 100644 --- a/packages/cli/src/ui/components/shared/text-buffer.test.ts +++ b/packages/cli/src/ui/components/shared/text-buffer.test.ts @@ -15,16 +15,14 @@ import { renderHookWithProviders, } from '../../../test-utils/render.js'; -import type { - Viewport, - TextBuffer, - TextBufferState, - TextBufferAction, - Transformation, - VisualLayout, - TextBufferOptions, -} from './text-buffer.js'; import { + type Viewport, + type TextBuffer, + type TextBufferState, + type TextBufferAction, + type Transformation, + type VisualLayout, + type TextBufferOptions, useTextBuffer, offsetToLogicalPos, logicalPosToOffset, diff --git a/packages/cli/src/ui/components/shared/text-buffer.ts b/packages/cli/src/ui/components/shared/text-buffer.ts index 71ee40b6425..411bb054cfd 100644 --- a/packages/cli/src/ui/components/shared/text-buffer.ts +++ b/packages/cli/src/ui/components/shared/text-buffer.ts @@ -26,8 +26,7 @@ import { import { parsePastedPaths } from '../../utils/clipboardUtils.js'; import type { Key } from '../../contexts/KeypressContext.js'; import { keyMatchers, Command } from '../../keyMatchers.js'; -import type { VimAction } from './vim-buffer-actions.js'; -import { handleVimAction } from './vim-buffer-actions.js'; +import { type VimAction, handleVimAction } from './vim-buffer-actions.js'; import { LRU_BUFFER_PERF_CACHE_LIMIT } from '../../constants.js'; import { openFileInEditor } from '../../utils/editorUtils.js'; diff --git a/packages/cli/src/ui/components/shared/vim-buffer-actions.ts b/packages/cli/src/ui/components/shared/vim-buffer-actions.ts index 1479f6c3c3c..0072807dcb3 100644 --- a/packages/cli/src/ui/components/shared/vim-buffer-actions.ts +++ b/packages/cli/src/ui/components/shared/vim-buffer-actions.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { TextBufferState, TextBufferAction } from './text-buffer.js'; import { + type TextBufferState, + type TextBufferAction, getLineRangeOffsets, getPositionFromOffsets, replaceRangeInternal, diff --git a/packages/cli/src/ui/components/triage/TriageDuplicates.tsx b/packages/cli/src/ui/components/triage/TriageDuplicates.tsx index 878cacfed07..3c653f31288 100644 --- a/packages/cli/src/ui/components/triage/TriageDuplicates.tsx +++ b/packages/cli/src/ui/components/triage/TriageDuplicates.tsx @@ -7,8 +7,12 @@ import { useState, useEffect, useCallback } from 'react'; import { Box, Text } from 'ink'; import Spinner from 'ink-spinner'; -import type { Config } from '@google/gemini-cli-core'; -import { debugLogger, spawnAsync, LlmRole } from '@google/gemini-cli-core'; +import { + type Config, + debugLogger, + spawnAsync, + LlmRole, +} from '@google/gemini-cli-core'; import { useKeypress } from '../../hooks/useKeypress.js'; import { keyMatchers, Command } from '../../keyMatchers.js'; diff --git a/packages/cli/src/ui/components/triage/TriageIssues.tsx b/packages/cli/src/ui/components/triage/TriageIssues.tsx index 595384a1248..28304a15f68 100644 --- a/packages/cli/src/ui/components/triage/TriageIssues.tsx +++ b/packages/cli/src/ui/components/triage/TriageIssues.tsx @@ -7,8 +7,12 @@ import { useState, useEffect, useCallback, useRef } from 'react'; import { Box, Text } from 'ink'; import Spinner from 'ink-spinner'; -import type { Config } from '@google/gemini-cli-core'; -import { debugLogger, spawnAsync, LlmRole } from '@google/gemini-cli-core'; +import { + type Config, + debugLogger, + spawnAsync, + LlmRole, +} from '@google/gemini-cli-core'; import { useKeypress } from '../../hooks/useKeypress.js'; import { keyMatchers, Command } from '../../keyMatchers.js'; import { TextInput } from '../shared/TextInput.js'; diff --git a/packages/cli/src/ui/components/views/McpStatus.tsx b/packages/cli/src/ui/components/views/McpStatus.tsx index 473c3de547c..04bdbfd4772 100644 --- a/packages/cli/src/ui/components/views/McpStatus.tsx +++ b/packages/cli/src/ui/components/views/McpStatus.tsx @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { MCPServerConfig } from '@google/gemini-cli-core'; -import { MCPServerStatus } from '@google/gemini-cli-core'; +import { type MCPServerConfig, MCPServerStatus } from '@google/gemini-cli-core'; import { Box, Text } from 'ink'; import type React from 'react'; import { MAX_MCP_RESOURCES_TO_SHOW } from '../../constants.js'; diff --git a/packages/cli/src/ui/contexts/KeypressContext.test.tsx b/packages/cli/src/ui/contexts/KeypressContext.test.tsx index e25ff576428..6500f627523 100644 --- a/packages/cli/src/ui/contexts/KeypressContext.test.tsx +++ b/packages/cli/src/ui/contexts/KeypressContext.test.tsx @@ -9,10 +9,9 @@ import type React from 'react'; import { act } from 'react'; import { renderHook } from '../../test-utils/render.js'; import { waitFor } from '../../test-utils/async.js'; -import type { Mock } from 'vitest'; -import { vi, afterAll, beforeAll } from 'vitest'; -import type { Key } from './KeypressContext.js'; +import { type Mock, vi, afterAll, beforeAll } from 'vitest'; import { + type Key, KeypressProvider, useKeypressContext, ESC_TIMEOUT, diff --git a/packages/cli/src/ui/contexts/MouseContext.test.tsx b/packages/cli/src/ui/contexts/MouseContext.test.tsx index 2f0d9ed1eda..c6288ab4efa 100644 --- a/packages/cli/src/ui/contexts/MouseContext.test.tsx +++ b/packages/cli/src/ui/contexts/MouseContext.test.tsx @@ -5,10 +5,10 @@ */ import { renderHook } from '../../test-utils/render.js'; +import type React from 'react'; import { act } from 'react'; import { MouseProvider, useMouseContext, useMouse } from './MouseContext.js'; import { vi, type Mock } from 'vitest'; -import type React from 'react'; import { useStdin } from 'ink'; import { EventEmitter } from 'node:events'; import { appEvents, AppEvent } from '../../utils/events.js'; diff --git a/packages/cli/src/ui/contexts/SessionContext.test.tsx b/packages/cli/src/ui/contexts/SessionContext.test.tsx index 5ab76e45191..40cef48f34b 100644 --- a/packages/cli/src/ui/contexts/SessionContext.test.tsx +++ b/packages/cli/src/ui/contexts/SessionContext.test.tsx @@ -4,12 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { type MutableRefObject, Component, type ReactNode } from 'react'; +import { type MutableRefObject, Component, type ReactNode, act } from 'react'; import { render } from '../../test-utils/render.js'; -import { act } from 'react'; -import type { SessionMetrics } from './SessionContext.js'; -import { SessionStatsProvider, useSessionStats } from './SessionContext.js'; +import { + type SessionMetrics, + SessionStatsProvider, + useSessionStats, +} from './SessionContext.js'; import { describe, it, expect, vi } from 'vitest'; import { uiTelemetryService } from '@google/gemini-cli-core'; diff --git a/packages/cli/src/ui/contexts/SessionContext.tsx b/packages/cli/src/ui/contexts/SessionContext.tsx index 7102bc9fa0f..3dcdcc43ded 100644 --- a/packages/cli/src/ui/contexts/SessionContext.tsx +++ b/packages/cli/src/ui/contexts/SessionContext.tsx @@ -14,12 +14,13 @@ import { useEffect, } from 'react'; -import type { - SessionMetrics, - ModelMetrics, - ToolCallStats, +import { + type SessionMetrics, + type ModelMetrics, + type ToolCallStats, + uiTelemetryService, + sessionId, } from '@google/gemini-cli-core'; -import { uiTelemetryService, sessionId } from '@google/gemini-cli-core'; export enum ToolCallDecision { ACCEPT = 'accept', diff --git a/packages/cli/src/ui/contexts/SettingsContext.test.tsx b/packages/cli/src/ui/contexts/SettingsContext.test.tsx index 3124108f900..a6b58339cdb 100644 --- a/packages/cli/src/ui/contexts/SettingsContext.test.tsx +++ b/packages/cli/src/ui/contexts/SettingsContext.test.tsx @@ -5,9 +5,8 @@ */ import type React from 'react'; -import { Component, type ReactNode } from 'react'; +import { Component, type ReactNode, act } from 'react'; import { renderHook, render } from '../../test-utils/render.js'; -import { act } from 'react'; import { describe, it, expect, vi, beforeEach } from 'vitest'; import { SettingsContext, useSettingsStore } from './SettingsContext.js'; import { diff --git a/packages/cli/src/ui/contexts/SettingsContext.tsx b/packages/cli/src/ui/contexts/SettingsContext.tsx index 2c5ae37dfdf..60cbf4b7f45 100644 --- a/packages/cli/src/ui/contexts/SettingsContext.tsx +++ b/packages/cli/src/ui/contexts/SettingsContext.tsx @@ -5,13 +5,13 @@ */ import React, { useContext, useMemo, useSyncExternalStore } from 'react'; -import type { - LoadableSettingScope, - LoadedSettings, - LoadedSettingsSnapshot, - SettingsFile, +import { + type LoadableSettingScope, + type LoadedSettings, + type LoadedSettingsSnapshot, + type SettingsFile, + SettingScope, } from '../../config/settings.js'; -import { SettingScope } from '../../config/settings.js'; export const SettingsContext = React.createContext( undefined, diff --git a/packages/cli/src/ui/contexts/VimModeContext.tsx b/packages/cli/src/ui/contexts/VimModeContext.tsx index d4495846d26..3d69c8b733a 100644 --- a/packages/cli/src/ui/contexts/VimModeContext.tsx +++ b/packages/cli/src/ui/contexts/VimModeContext.tsx @@ -11,8 +11,7 @@ import { useEffect, useState, } from 'react'; -import type { LoadedSettings } from '../../config/settings.js'; -import { SettingScope } from '../../config/settings.js'; +import { type LoadedSettings, SettingScope } from '../../config/settings.js'; export type VimMode = 'NORMAL' | 'INSERT'; diff --git a/packages/cli/src/ui/hooks/atCommandProcessor.test.ts b/packages/cli/src/ui/hooks/atCommandProcessor.test.ts index eab3a829627..e9a1575126a 100644 --- a/packages/cli/src/ui/hooks/atCommandProcessor.test.ts +++ b/packages/cli/src/ui/hooks/atCommandProcessor.test.ts @@ -4,11 +4,19 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { Mock } from 'vitest'; -import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +import { + type Mock, + describe, + it, + expect, + vi, + beforeEach, + afterEach, +} from 'vitest'; import { handleAtCommand } from './atCommandProcessor.js'; -import type { Config, DiscoveredMCPResource } from '@google/gemini-cli-core'; import { + type Config, + type DiscoveredMCPResource, FileDiscoveryService, GlobTool, ReadManyFilesTool, diff --git a/packages/cli/src/ui/hooks/atCommandProcessor.ts b/packages/cli/src/ui/hooks/atCommandProcessor.ts index c23c9fa2db7..c476adcfa07 100644 --- a/packages/cli/src/ui/hooks/atCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/atCommandProcessor.ts @@ -7,8 +7,9 @@ import * as fs from 'node:fs/promises'; import * as path from 'node:path'; import type { PartListUnion, PartUnion } from '@google/genai'; -import type { AnyToolInvocation, Config } from '@google/gemini-cli-core'; import { + type AnyToolInvocation, + type Config, debugLogger, getErrorMessage, isNodeError, diff --git a/packages/cli/src/ui/hooks/atCommandProcessor_agents.test.ts b/packages/cli/src/ui/hooks/atCommandProcessor_agents.test.ts index 90267e64c08..f2283a2d975 100644 --- a/packages/cli/src/ui/hooks/atCommandProcessor_agents.test.ts +++ b/packages/cli/src/ui/hooks/atCommandProcessor_agents.test.ts @@ -6,12 +6,10 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { handleAtCommand } from './atCommandProcessor.js'; -import type { - Config, - AgentDefinition, - MessageBus, -} from '@google/gemini-cli-core'; import { + type Config, + type AgentDefinition, + type MessageBus, FileDiscoveryService, GlobTool, ReadManyFilesTool, diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.ts index 364b3958760..f39279d4f8a 100644 --- a/packages/cli/src/ui/hooks/shellCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/shellCommandProcessor.ts @@ -9,8 +9,10 @@ import type { IndividualToolCallDisplay, } from '../types.js'; import { useCallback, useReducer, useRef, useEffect } from 'react'; -import type { AnsiOutput, Config, GeminiClient } from '@google/gemini-cli-core'; import { + type AnsiOutput, + type Config, + type GeminiClient, isBinary, ShellExecutionService, CoreToolCallStatus, diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.test.tsx b/packages/cli/src/ui/hooks/slashCommandProcessor.test.tsx index 6190d163f78..e64e34d5509 100644 --- a/packages/cli/src/ui/hooks/slashCommandProcessor.test.tsx +++ b/packages/cli/src/ui/hooks/slashCommandProcessor.test.tsx @@ -9,8 +9,7 @@ import { act } from 'react'; import { renderHook } from '../../test-utils/render.js'; import { waitFor } from '../../test-utils/async.js'; import { useSlashCommandProcessor } from './slashCommandProcessor.js'; -import type { SlashCommand } from '../commands/types.js'; -import { CommandKind } from '../commands/types.js'; +import { type SlashCommand, CommandKind } from '../commands/types.js'; import type { LoadedSettings } from '../../config/settings.js'; import { MessageType } from '../types.js'; import { BuiltinCommandLoader } from '../../services/BuiltinCommandLoader.js'; diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts index c3f178ad1bb..b0fb6e69fee 100644 --- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts @@ -14,14 +14,12 @@ import { import { type PartListUnion } from '@google/genai'; import process from 'node:process'; import type { UseHistoryManagerReturn } from './useHistoryManager.js'; -import type { - Config, - ExtensionsStartingEvent, - ExtensionsStoppingEvent, - ToolCallConfirmationDetails, - AgentDefinition, -} from '@google/gemini-cli-core'; import { + type Config, + type ExtensionsStartingEvent, + type ExtensionsStoppingEvent, + type ToolCallConfirmationDetails, + type AgentDefinition, GitService, Logger, logSlashCommand, @@ -37,15 +35,15 @@ import { CoreToolCallStatus, } from '@google/gemini-cli-core'; import { useSessionStats } from '../contexts/SessionContext.js'; -import type { - Message, - HistoryItemWithoutId, - SlashCommandProcessorResult, - HistoryItem, - ConfirmationRequest, - IndividualToolCallDisplay, +import { + type Message, + type HistoryItemWithoutId, + type SlashCommandProcessorResult, + type HistoryItem, + type ConfirmationRequest, + type IndividualToolCallDisplay, + MessageType, } from '../types.js'; -import { MessageType } from '../types.js'; import type { LoadedSettings } from '../../config/settings.js'; import { type CommandContext, type SlashCommand } from '../commands/types.js'; import { CommandService } from '../../services/CommandService.js'; diff --git a/packages/cli/src/ui/hooks/useApprovalModeIndicator.test.ts b/packages/cli/src/ui/hooks/useApprovalModeIndicator.test.ts index 08ddd362f7d..791a9431079 100644 --- a/packages/cli/src/ui/hooks/useApprovalModeIndicator.test.ts +++ b/packages/cli/src/ui/hooks/useApprovalModeIndicator.test.ts @@ -17,10 +17,12 @@ import { act } from 'react'; import { renderHook } from '../../test-utils/render.js'; import { useApprovalModeIndicator } from './useApprovalModeIndicator.js'; -import { Config, ApprovalMode } from '@google/gemini-cli-core'; -import type { Config as ActualConfigType } from '@google/gemini-cli-core'; -import type { Key } from './useKeypress.js'; -import { useKeypress } from './useKeypress.js'; +import { + Config, + ApprovalMode, + type Config as ActualConfigType, +} from '@google/gemini-cli-core'; +import { type Key, useKeypress } from './useKeypress.js'; import { MessageType } from '../types.js'; vi.mock('./useKeypress.js'); diff --git a/packages/cli/src/ui/hooks/useApprovalModeIndicator.ts b/packages/cli/src/ui/hooks/useApprovalModeIndicator.ts index 1b5076027fd..b517ca03466 100644 --- a/packages/cli/src/ui/hooks/useApprovalModeIndicator.ts +++ b/packages/cli/src/ui/hooks/useApprovalModeIndicator.ts @@ -12,8 +12,7 @@ import { } from '@google/gemini-cli-core'; import { useKeypress } from './useKeypress.js'; import { keyMatchers, Command } from '../keyMatchers.js'; -import type { HistoryItemWithoutId } from '../types.js'; -import { MessageType } from '../types.js'; +import { type HistoryItemWithoutId, MessageType } from '../types.js'; export interface UseApprovalModeIndicatorArgs { config: Config; diff --git a/packages/cli/src/ui/hooks/useAtCompletion.test.ts b/packages/cli/src/ui/hooks/useAtCompletion.test.ts index 02eb4c47f84..34c8bc5b89c 100644 --- a/packages/cli/src/ui/hooks/useAtCompletion.test.ts +++ b/packages/cli/src/ui/hooks/useAtCompletion.test.ts @@ -10,14 +10,18 @@ import * as path from 'node:path'; import { renderHook } from '../../test-utils/render.js'; import { waitFor } from '../../test-utils/async.js'; import { useAtCompletion } from './useAtCompletion.js'; -import type { Config, FileSearch } from '@google/gemini-cli-core'; import { + type Config, + type FileSearch, FileSearchFactory, FileDiscoveryService, escapePath, } from '@google/gemini-cli-core'; -import type { FileSystemStructure } from '@google/gemini-cli-test-utils'; -import { createTmpDir, cleanupTmpDir } from '@google/gemini-cli-test-utils'; +import { + type FileSystemStructure, + createTmpDir, + cleanupTmpDir, +} from '@google/gemini-cli-test-utils'; import type { Suggestion } from '../components/SuggestionsDisplay.js'; // Test harness to capture the state from the hook's callbacks. diff --git a/packages/cli/src/ui/hooks/useAtCompletion.ts b/packages/cli/src/ui/hooks/useAtCompletion.ts index 8d860bb6ce9..6abfa66576e 100644 --- a/packages/cli/src/ui/hooks/useAtCompletion.ts +++ b/packages/cli/src/ui/hooks/useAtCompletion.ts @@ -7,14 +7,17 @@ import { useEffect, useReducer, useRef } from 'react'; import { setTimeout as setTimeoutPromise } from 'node:timers/promises'; import * as path from 'node:path'; -import type { Config, FileSearch } from '@google/gemini-cli-core'; import { + type Config, + type FileSearch, FileSearchFactory, escapePath, FileDiscoveryService, } from '@google/gemini-cli-core'; -import type { Suggestion } from '../components/SuggestionsDisplay.js'; -import { MAX_SUGGESTIONS_TO_SHOW } from '../components/SuggestionsDisplay.js'; +import { + type Suggestion, + MAX_SUGGESTIONS_TO_SHOW, +} from '../components/SuggestionsDisplay.js'; import { CommandKind } from '../commands/types.js'; import { AsyncFzf } from 'fzf'; diff --git a/packages/cli/src/ui/hooks/useCommandCompletion.tsx b/packages/cli/src/ui/hooks/useCommandCompletion.tsx index f9b772bc933..93e61957ab5 100644 --- a/packages/cli/src/ui/hooks/useCommandCompletion.tsx +++ b/packages/cli/src/ui/hooks/useCommandCompletion.tsx @@ -7,20 +7,22 @@ import { useCallback, useMemo, useEffect } from 'react'; import type { Suggestion } from '../components/SuggestionsDisplay.js'; import type { CommandContext, SlashCommand } from '../commands/types.js'; -import type { TextBuffer } from '../components/shared/text-buffer.js'; -import { logicalPosToOffset } from '../components/shared/text-buffer.js'; +import { + type TextBuffer, + logicalPosToOffset, +} from '../components/shared/text-buffer.js'; import { isSlashCommand } from '../utils/commandUtils.js'; import { toCodePoints } from '../utils/textUtils.js'; import { useAtCompletion } from './useAtCompletion.js'; import { useSlashCompletion } from './useSlashCompletion.js'; import { useShellCompletion } from './useShellCompletion.js'; -import type { PromptCompletion } from './usePromptCompletion.js'; import { + type PromptCompletion, usePromptCompletion, PROMPT_COMPLETION_MIN_LENGTH, } from './usePromptCompletion.js'; -import type { Config } from '@google/gemini-cli-core'; import { useCompletion } from './useCompletion.js'; +import type { Config } from '@google/gemini-cli-core'; export enum CompletionMode { IDLE = 'IDLE', diff --git a/packages/cli/src/ui/hooks/useCompletion.ts b/packages/cli/src/ui/hooks/useCompletion.ts index 1483564691a..96dc4634e42 100644 --- a/packages/cli/src/ui/hooks/useCompletion.ts +++ b/packages/cli/src/ui/hooks/useCompletion.ts @@ -6,8 +6,10 @@ import { useState, useCallback } from 'react'; -import type { Suggestion } from '../components/SuggestionsDisplay.js'; -import { MAX_SUGGESTIONS_TO_SHOW } from '../components/SuggestionsDisplay.js'; +import { + type Suggestion, + MAX_SUGGESTIONS_TO_SHOW, +} from '../components/SuggestionsDisplay.js'; export interface UseCompletionReturn { suggestions: Suggestion[]; diff --git a/packages/cli/src/ui/hooks/useConfirmingTool.ts b/packages/cli/src/ui/hooks/useConfirmingTool.ts index 210238cafe5..2ff11d8e4b7 100644 --- a/packages/cli/src/ui/hooks/useConfirmingTool.ts +++ b/packages/cli/src/ui/hooks/useConfirmingTool.ts @@ -6,8 +6,10 @@ import { useMemo } from 'react'; import { useUIState } from '../contexts/UIStateContext.js'; -import { getConfirmingToolState } from '../utils/confirmingTool.js'; -import type { ConfirmingToolState } from '../utils/confirmingTool.js'; +import { + getConfirmingToolState, + type ConfirmingToolState, +} from '../utils/confirmingTool.js'; export type { ConfirmingToolState } from '../utils/confirmingTool.js'; diff --git a/packages/cli/src/ui/hooks/useEditorSettings.test.tsx b/packages/cli/src/ui/hooks/useEditorSettings.test.tsx index 68c2b93f22c..944b41db6c6 100644 --- a/packages/cli/src/ui/hooks/useEditorSettings.test.tsx +++ b/packages/cli/src/ui/hooks/useEditorSettings.test.tsx @@ -16,11 +16,11 @@ import { import { act } from 'react'; import { render } from '../../test-utils/render.js'; import { useEditorSettings } from './useEditorSettings.js'; -import type { - LoadableSettingScope, - LoadedSettings, +import { + type LoadableSettingScope, + type LoadedSettings, + SettingScope, } from '../../config/settings.js'; -import { SettingScope } from '../../config/settings.js'; import { MessageType } from '../types.js'; import { type EditorType, diff --git a/packages/cli/src/ui/hooks/useEditorSettings.ts b/packages/cli/src/ui/hooks/useEditorSettings.ts index 0a432e303b4..462e6ba9f02 100644 --- a/packages/cli/src/ui/hooks/useEditorSettings.ts +++ b/packages/cli/src/ui/hooks/useEditorSettings.ts @@ -10,8 +10,8 @@ import type { LoadedSettings, } from '../../config/settings.js'; import { MessageType } from '../types.js'; -import type { EditorType } from '@google/gemini-cli-core'; import { + type EditorType, allowEditorTypeInSandbox, hasValidEditorCommand, getEditorDisplayName, diff --git a/packages/cli/src/ui/hooks/useExtensionUpdates.ts b/packages/cli/src/ui/hooks/useExtensionUpdates.ts index 1c83c26cf6f..f3f5a05633c 100644 --- a/packages/cli/src/ui/hooks/useExtensionUpdates.ts +++ b/packages/cli/src/ui/hooks/useExtensionUpdates.ts @@ -4,7 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { debugLogger, type GeminiCLIExtension } from '@google/gemini-cli-core'; +import { + debugLogger, + type GeminiCLIExtension, + checkExhaustive, +} from '@google/gemini-cli-core'; import { getErrorMessage } from '../../utils/errors.js'; import { ExtensionUpdateState, @@ -19,7 +23,6 @@ import { updateExtension, } from '../../config/extensions/update.js'; import { type ExtensionUpdateInfo } from '../../config/extension.js'; -import { checkExhaustive } from '@google/gemini-cli-core'; import type { ExtensionManager } from '../../config/extension-manager.js'; type ConfirmationRequestWrapper = { diff --git a/packages/cli/src/ui/hooks/useFlickerDetector.test.ts b/packages/cli/src/ui/hooks/useFlickerDetector.test.ts index cbe5e4f14ea..8328a8c9d4a 100644 --- a/packages/cli/src/ui/hooks/useFlickerDetector.test.ts +++ b/packages/cli/src/ui/hooks/useFlickerDetector.test.ts @@ -8,8 +8,7 @@ import { renderHook } from '../../test-utils/render.js'; import { vi, type Mock } from 'vitest'; import { useFlickerDetector } from './useFlickerDetector.js'; import { useConfig } from '../contexts/ConfigContext.js'; -import { recordFlickerFrame } from '@google/gemini-cli-core'; -import { type Config } from '@google/gemini-cli-core'; +import { recordFlickerFrame, type Config } from '@google/gemini-cli-core'; import { type DOMElement, measureElement } from 'ink'; import { useUIState } from '../contexts/UIStateContext.js'; import { appEvents, AppEvent } from '../../utils/events.js'; diff --git a/packages/cli/src/ui/hooks/useFolderTrust.test.ts b/packages/cli/src/ui/hooks/useFolderTrust.test.ts index 277180404c6..4a3c325ac92 100644 --- a/packages/cli/src/ui/hooks/useFolderTrust.test.ts +++ b/packages/cli/src/ui/hooks/useFolderTrust.test.ts @@ -20,8 +20,10 @@ import { waitFor } from '../../test-utils/async.js'; import { useFolderTrust } from './useFolderTrust.js'; import type { LoadedSettings } from '../../config/settings.js'; import { FolderTrustChoice } from '../components/FolderTrustDialog.js'; -import type { LoadedTrustedFolders } from '../../config/trustedFolders.js'; -import { TrustLevel } from '../../config/trustedFolders.js'; +import { + type LoadedTrustedFolders, + TrustLevel, +} from '../../config/trustedFolders.js'; import * as trustedFolders from '../../config/trustedFolders.js'; import { coreEvents, ExitCodes, isHeadlessMode } from '@google/gemini-cli-core'; import { MessageType } from '../types.js'; diff --git a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx index df8c17bd231..06cfa59bf62 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx +++ b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx @@ -13,21 +13,19 @@ import { waitFor } from '../../test-utils/async.js'; import { useGeminiStream } from './useGeminiStream.js'; import { useKeypress } from './useKeypress.js'; import * as atCommandProcessor from './atCommandProcessor.js'; -import type { - TrackedToolCall, - TrackedCompletedToolCall, - TrackedExecutingToolCall, - TrackedCancelledToolCall, - TrackedWaitingToolCall, +import { + type TrackedToolCall, + type TrackedCompletedToolCall, + type TrackedExecutingToolCall, + type TrackedCancelledToolCall, + type TrackedWaitingToolCall, + useToolScheduler, } from './useToolScheduler.js'; -import { useToolScheduler } from './useToolScheduler.js'; -import type { - Config, - EditorType, - AnyToolInvocation, - SpanMetadata, -} from '@google/gemini-cli-core'; import { + type Config, + type EditorType, + type AnyToolInvocation, + type SpanMetadata, CoreToolCallStatus, ApprovalMode, AuthType, @@ -45,8 +43,11 @@ import { } from '@google/gemini-cli-core'; import type { Part, PartListUnion } from '@google/genai'; import type { UseHistoryManagerReturn } from './useHistoryManager.js'; -import type { SlashCommandProcessorResult } from '../types.js'; -import { MessageType, StreamingState } from '../types.js'; +import { + type SlashCommandProcessorResult, + MessageType, + StreamingState, +} from '../types.js'; import type { LoadedSettings } from '../../config/settings.js'; import { findLastSafeSplitPoint } from '../utils/markdownUtilities.js'; diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts index 36374a5e20b..a2605e054e2 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.ts +++ b/packages/cli/src/ui/hooks/useGeminiStream.ts @@ -54,17 +54,18 @@ import type { RetryAttemptPayload, } from '@google/gemini-cli-core'; import { type Part, type PartListUnion, FinishReason } from '@google/genai'; -import type { - HistoryItem, - HistoryItemThinking, - HistoryItemWithoutId, - HistoryItemToolGroup, - HistoryItemInfo, - IndividualToolCallDisplay, - SlashCommandProcessorResult, - HistoryItemModel, +import { + type HistoryItem, + type HistoryItemThinking, + type HistoryItemWithoutId, + type HistoryItemToolGroup, + type HistoryItemInfo, + type IndividualToolCallDisplay, + type SlashCommandProcessorResult, + type HistoryItemModel, + StreamingState, + MessageType, } from '../types.js'; -import { StreamingState, MessageType } from '../types.js'; import { isAtCommand, isSlashCommand } from '../utils/commandUtils.js'; import { useShellCommandProcessor } from './shellCommandProcessor.js'; import { handleAtCommand } from './atCommandProcessor.js'; diff --git a/packages/cli/src/ui/hooks/useGitBranchName.test.tsx b/packages/cli/src/ui/hooks/useGitBranchName.test.tsx index dd85e73e7ee..613218b5311 100644 --- a/packages/cli/src/ui/hooks/useGitBranchName.test.tsx +++ b/packages/cli/src/ui/hooks/useGitBranchName.test.tsx @@ -4,8 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { MockedFunction } from 'vitest'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { + type MockedFunction, + afterEach, + beforeEach, + describe, + expect, + it, + vi, +} from 'vitest'; import { act } from 'react'; import { render } from '../../test-utils/render.js'; import { waitFor } from '../../test-utils/async.js'; diff --git a/packages/cli/src/ui/hooks/useIncludeDirsTrust.test.tsx b/packages/cli/src/ui/hooks/useIncludeDirsTrust.test.tsx index 87fb0cc3588..3f9c6560488 100644 --- a/packages/cli/src/ui/hooks/useIncludeDirsTrust.test.tsx +++ b/packages/cli/src/ui/hooks/useIncludeDirsTrust.test.tsx @@ -4,8 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; -import type { Mock } from 'vitest'; +import { + vi, + describe, + it, + expect, + beforeEach, + afterEach, + type Mock, +} from 'vitest'; import { renderHook } from '../../test-utils/render.js'; import { waitFor } from '../../test-utils/async.js'; import { useIncludeDirsTrust } from './useIncludeDirsTrust.js'; diff --git a/packages/cli/src/ui/hooks/useIncludeDirsTrust.tsx b/packages/cli/src/ui/hooks/useIncludeDirsTrust.tsx index ec29a8180ce..f7cc9dc1e3f 100644 --- a/packages/cli/src/ui/hooks/useIncludeDirsTrust.tsx +++ b/packages/cli/src/ui/hooks/useIncludeDirsTrust.tsx @@ -5,13 +5,13 @@ */ import { useEffect } from 'react'; -import { type Config } from '@google/gemini-cli-core'; -import { loadTrustedFolders } from '../../config/trustedFolders.js'; -import { expandHomeDir, batchAddDirectories } from '../utils/directoryUtils.js'; import { + type Config, debugLogger, refreshServerHierarchicalMemory, } from '@google/gemini-cli-core'; +import { loadTrustedFolders } from '../../config/trustedFolders.js'; +import { expandHomeDir, batchAddDirectories } from '../utils/directoryUtils.js'; import { MultiFolderTrustDialog } from '../components/MultiFolderTrustDialog.js'; import type { UseHistoryManagerReturn } from './useHistoryManager.js'; import { MessageType, type HistoryItem } from '../types.js'; diff --git a/packages/cli/src/ui/hooks/useLogger.ts b/packages/cli/src/ui/hooks/useLogger.ts index 23373426c05..9aceaf63630 100644 --- a/packages/cli/src/ui/hooks/useLogger.ts +++ b/packages/cli/src/ui/hooks/useLogger.ts @@ -5,8 +5,7 @@ */ import { useState, useEffect } from 'react'; -import type { Storage } from '@google/gemini-cli-core'; -import { sessionId, Logger } from '@google/gemini-cli-core'; +import { type Storage, sessionId, Logger } from '@google/gemini-cli-core'; /** * Hook to manage the logger instance. diff --git a/packages/cli/src/ui/hooks/useMouse.ts b/packages/cli/src/ui/hooks/useMouse.ts index 9db86320816..2994d64fb93 100644 --- a/packages/cli/src/ui/hooks/useMouse.ts +++ b/packages/cli/src/ui/hooks/useMouse.ts @@ -5,8 +5,11 @@ */ import { useEffect } from 'react'; -import type { MouseHandler, MouseEvent } from '../contexts/MouseContext.js'; -import { useMouseContext } from '../contexts/MouseContext.js'; +import { + type MouseHandler, + type MouseEvent, + useMouseContext, +} from '../contexts/MouseContext.js'; export type { MouseEvent }; diff --git a/packages/cli/src/ui/hooks/usePermissionsModifyTrust.test.ts b/packages/cli/src/ui/hooks/usePermissionsModifyTrust.test.ts index 806624d6d75..0fcf3d62d71 100644 --- a/packages/cli/src/ui/hooks/usePermissionsModifyTrust.test.ts +++ b/packages/cli/src/ui/hooks/usePermissionsModifyTrust.test.ts @@ -16,9 +16,11 @@ import { import { act } from 'react'; import { renderHook } from '../../test-utils/render.js'; import { usePermissionsModifyTrust } from './usePermissionsModifyTrust.js'; -import { TrustLevel } from '../../config/trustedFolders.js'; +import { + TrustLevel, + type LoadedTrustedFolders, +} from '../../config/trustedFolders.js'; import type { LoadedSettings } from '../../config/settings.js'; -import type { LoadedTrustedFolders } from '../../config/trustedFolders.js'; import { coreEvents } from '@google/gemini-cli-core'; // Hoist mocks diff --git a/packages/cli/src/ui/hooks/usePrivacySettings.test.tsx b/packages/cli/src/ui/hooks/usePrivacySettings.test.tsx index f385ba2e60a..115dcbecf6c 100644 --- a/packages/cli/src/ui/hooks/usePrivacySettings.test.tsx +++ b/packages/cli/src/ui/hooks/usePrivacySettings.test.tsx @@ -7,8 +7,12 @@ import { describe, it, expect, beforeEach, vi } from 'vitest'; import { act } from 'react'; import { render } from '../../test-utils/render.js'; -import type { Config, CodeAssistServer } from '@google/gemini-cli-core'; -import { UserTierId, getCodeAssistServer } from '@google/gemini-cli-core'; +import { + type Config, + type CodeAssistServer, + UserTierId, + getCodeAssistServer, +} from '@google/gemini-cli-core'; import { usePrivacySettings } from './usePrivacySettings.js'; import { waitFor } from '../../test-utils/async.js'; diff --git a/packages/cli/src/ui/hooks/usePromptCompletion.ts b/packages/cli/src/ui/hooks/usePromptCompletion.ts index d6dbc8b18c8..3688ef761d3 100644 --- a/packages/cli/src/ui/hooks/usePromptCompletion.ts +++ b/packages/cli/src/ui/hooks/usePromptCompletion.ts @@ -5,8 +5,12 @@ */ import { useState, useCallback, useRef, useEffect, useMemo } from 'react'; -import type { Config } from '@google/gemini-cli-core'; -import { debugLogger, getResponseText, LlmRole } from '@google/gemini-cli-core'; +import { + type Config, + debugLogger, + getResponseText, + LlmRole, +} from '@google/gemini-cli-core'; import type { Content } from '@google/genai'; import type { TextBuffer } from '../components/shared/text-buffer.js'; import { isSlashCommand } from '../utils/commandUtils.js'; diff --git a/packages/cli/src/ui/hooks/useSessionBrowser.test.ts b/packages/cli/src/ui/hooks/useSessionBrowser.test.ts index ceff3e9c8cb..8d89a47fb8c 100644 --- a/packages/cli/src/ui/hooks/useSessionBrowser.test.ts +++ b/packages/cli/src/ui/hooks/useSessionBrowser.test.ts @@ -19,8 +19,6 @@ import { type ConversationRecord, type MessageRecord, CoreToolCallStatus, -} from '@google/gemini-cli-core'; -import { coreEvents, convertSessionToClientHistory, } from '@google/gemini-cli-core'; diff --git a/packages/cli/src/ui/hooks/useSessionBrowser.ts b/packages/cli/src/ui/hooks/useSessionBrowser.ts index 9c6d05b3227..ed982174392 100644 --- a/packages/cli/src/ui/hooks/useSessionBrowser.ts +++ b/packages/cli/src/ui/hooks/useSessionBrowser.ts @@ -8,12 +8,10 @@ import { useState, useCallback } from 'react'; import type { HistoryItemWithoutId } from '../types.js'; import * as fs from 'node:fs/promises'; import path from 'node:path'; -import type { - Config, - ConversationRecord, - ResumedSessionData, -} from '@google/gemini-cli-core'; import { + type Config, + type ConversationRecord, + type ResumedSessionData, coreEvents, convertSessionToClientHistory, } from '@google/gemini-cli-core'; diff --git a/packages/cli/src/ui/hooks/useSlashCompletion.test.ts b/packages/cli/src/ui/hooks/useSlashCompletion.test.ts index ea320b80a13..a3d11b87202 100644 --- a/packages/cli/src/ui/hooks/useSlashCompletion.test.ts +++ b/packages/cli/src/ui/hooks/useSlashCompletion.test.ts @@ -9,8 +9,11 @@ import { act, useState } from 'react'; import { renderHook } from '../../test-utils/render.js'; import { waitFor } from '../../test-utils/async.js'; import { useSlashCompletion } from './useSlashCompletion.js'; -import type { CommandContext, SlashCommand } from '../commands/types.js'; -import { CommandKind } from '../commands/types.js'; +import { + type CommandContext, + type SlashCommand, + CommandKind, +} from '../commands/types.js'; import type { Suggestion } from '../components/SuggestionsDisplay.js'; // Test utility type and helper function for creating test SlashCommands diff --git a/packages/cli/src/ui/hooks/vim-passthrough.test.tsx b/packages/cli/src/ui/hooks/vim-passthrough.test.tsx index 3b11bc7ce30..17a4bd5b742 100644 --- a/packages/cli/src/ui/hooks/vim-passthrough.test.tsx +++ b/packages/cli/src/ui/hooks/vim-passthrough.test.tsx @@ -7,8 +7,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { renderHook } from '../../test-utils/render.js'; import { act } from 'react'; -import { useVim } from './vim.js'; -import type { VimMode } from './vim.js'; +import { useVim, type VimMode } from './vim.js'; import type { TextBuffer } from '../components/shared/text-buffer.js'; import type { Key } from './useKeypress.js'; diff --git a/packages/cli/src/ui/hooks/vim.test.tsx b/packages/cli/src/ui/hooks/vim.test.tsx index 7b03354eae3..f5bafca6420 100644 --- a/packages/cli/src/ui/hooks/vim.test.tsx +++ b/packages/cli/src/ui/hooks/vim.test.tsx @@ -9,15 +9,14 @@ import type React from 'react'; import { act } from 'react'; import { renderHook } from '../../test-utils/render.js'; import { waitFor } from '../../test-utils/async.js'; -import { useVim } from './vim.js'; -import type { VimMode } from './vim.js'; +import { useVim, type VimMode } from './vim.js'; import type { Key } from './useKeypress.js'; -import type { - TextBuffer, - TextBufferState, - TextBufferAction, +import { + type TextBuffer, + type TextBufferState, + type TextBufferAction, + textBufferReducer, } from '../components/shared/text-buffer.js'; -import { textBufferReducer } from '../components/shared/text-buffer.js'; // Mock the VimModeContext const mockVimContext = { diff --git a/packages/cli/src/ui/keyMatchers.test.ts b/packages/cli/src/ui/keyMatchers.test.ts index 763754ec951..c620cae1866 100644 --- a/packages/cli/src/ui/keyMatchers.test.ts +++ b/packages/cli/src/ui/keyMatchers.test.ts @@ -6,8 +6,10 @@ import { describe, it, expect } from 'vitest'; import { keyMatchers, Command, createKeyMatchers } from './keyMatchers.js'; -import type { KeyBindingConfig } from '../config/keyBindings.js'; -import { defaultKeyBindings } from '../config/keyBindings.js'; +import { + type KeyBindingConfig, + defaultKeyBindings, +} from '../config/keyBindings.js'; import type { Key } from './hooks/useKeypress.js'; describe('keyMatchers', () => { diff --git a/packages/cli/src/ui/keyMatchers.ts b/packages/cli/src/ui/keyMatchers.ts index 7c61db10163..0c54a239728 100644 --- a/packages/cli/src/ui/keyMatchers.ts +++ b/packages/cli/src/ui/keyMatchers.ts @@ -5,8 +5,12 @@ */ import type { Key } from './hooks/useKeypress.js'; -import type { KeyBinding, KeyBindingConfig } from '../config/keyBindings.js'; -import { Command, defaultKeyBindings } from '../config/keyBindings.js'; +import { + type KeyBinding, + type KeyBindingConfig, + Command, + defaultKeyBindings, +} from '../config/keyBindings.js'; /** * Matches a KeyBinding against an actual Key press diff --git a/packages/cli/src/ui/themes/no-color.ts b/packages/cli/src/ui/themes/no-color.ts index 30e34c2c120..344996a5f36 100644 --- a/packages/cli/src/ui/themes/no-color.ts +++ b/packages/cli/src/ui/themes/no-color.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { ColorsTheme } from './theme.js'; -import { Theme } from './theme.js'; +import { type ColorsTheme, Theme } from './theme.js'; import type { SemanticColors } from './semantic-tokens.js'; const noColorColorsTheme: ColorsTheme = { diff --git a/packages/cli/src/ui/themes/theme-manager.test.ts b/packages/cli/src/ui/themes/theme-manager.test.ts index a655530b3b6..4c7bdfc8a43 100644 --- a/packages/cli/src/ui/themes/theme-manager.test.ts +++ b/packages/cli/src/ui/themes/theme-manager.test.ts @@ -11,11 +11,10 @@ if (process.env['NO_COLOR'] !== undefined) { import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import { themeManager, DEFAULT_THEME } from './theme-manager.js'; -import type { CustomTheme } from '@google/gemini-cli-core'; +import { type CustomTheme, debugLogger } from '@google/gemini-cli-core'; import * as fs from 'node:fs'; import * as os from 'node:os'; import type * as osActual from 'node:os'; -import { debugLogger } from '@google/gemini-cli-core'; vi.mock('node:fs'); vi.mock('node:os', async (importOriginal) => { diff --git a/packages/cli/src/ui/themes/theme-manager.ts b/packages/cli/src/ui/themes/theme-manager.ts index da54ba5d3eb..ae3f3f028ac 100644 --- a/packages/cli/src/ui/themes/theme-manager.ts +++ b/packages/cli/src/ui/themes/theme-manager.ts @@ -20,9 +20,18 @@ import { SolarizedLight } from './solarized-light.js'; import { XCode } from './xcode.js'; import * as fs from 'node:fs'; import * as path from 'node:path'; -import type { Theme, ThemeType, ColorsTheme } from './theme.js'; -import type { CustomTheme } from '@google/gemini-cli-core'; -import { createCustomTheme, validateCustomTheme } from './theme.js'; +import { + type Theme, + type ThemeType, + type ColorsTheme, + createCustomTheme, + validateCustomTheme, +} from './theme.js'; +import { + type CustomTheme, + debugLogger, + homedir, +} from '@google/gemini-cli-core'; import type { SemanticColors } from './semantic-tokens.js'; import { interpolateColor, @@ -38,7 +47,6 @@ import { ANSI } from './ansi.js'; import { ANSILight } from './ansi-light.js'; import { NoColorTheme } from './no-color.js'; import process from 'node:process'; -import { debugLogger, homedir } from '@google/gemini-cli-core'; export interface ThemeDisplay { name: string; diff --git a/packages/cli/src/ui/utils/commandUtils.test.ts b/packages/cli/src/ui/utils/commandUtils.test.ts index 737948ce981..80ce434f860 100644 --- a/packages/cli/src/ui/utils/commandUtils.test.ts +++ b/packages/cli/src/ui/utils/commandUtils.test.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { Mock } from 'vitest'; -import { vi, describe, it, expect, beforeEach } from 'vitest'; +import { type Mock, vi, describe, it, expect, beforeEach } from 'vitest'; import { EventEmitter } from 'node:events'; import clipboardy from 'clipboardy'; import { diff --git a/packages/cli/src/ui/utils/rewindFileOps.ts b/packages/cli/src/ui/utils/rewindFileOps.ts index 7eaebe90ed9..c7a1d361429 100644 --- a/packages/cli/src/ui/utils/rewindFileOps.ts +++ b/packages/cli/src/ui/utils/rewindFileOps.ts @@ -4,18 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - ConversationRecord, - MessageRecord, -} from '@google/gemini-cli-core'; -import fs from 'node:fs/promises'; -import * as Diff from 'diff'; import { + type ConversationRecord, + type MessageRecord, coreEvents, debugLogger, getFileDiffFromResultDisplay, computeModelAddedAndRemovedLines, } from '@google/gemini-cli-core'; +import fs from 'node:fs/promises'; +import * as Diff from 'diff'; export interface FileChangeDetail { fileName: string; diff --git a/packages/cli/src/ui/utils/textOutput.test.ts b/packages/cli/src/ui/utils/textOutput.test.ts index b8a0882d648..6c66d0a0484 100644 --- a/packages/cli/src/ui/utils/textOutput.test.ts +++ b/packages/cli/src/ui/utils/textOutput.test.ts @@ -6,8 +6,7 @@ /// -import type { MockInstance } from 'vitest'; -import { vi } from 'vitest'; +import { type MockInstance, vi } from 'vitest'; import { TextOutput } from './textOutput.js'; describe('TextOutput', () => { diff --git a/packages/cli/src/utils/cleanup.ts b/packages/cli/src/utils/cleanup.ts index 6185b34fe5c..e15ed74f831 100644 --- a/packages/cli/src/utils/cleanup.ts +++ b/packages/cli/src/utils/cleanup.ts @@ -11,8 +11,8 @@ import { shutdownTelemetry, isTelemetrySdkInitialized, ExitCodes, + type Config, } from '@google/gemini-cli-core'; -import type { Config } from '@google/gemini-cli-core'; const cleanupFunctions: Array<(() => void) | (() => Promise)> = []; const syncCleanupFunctions: Array<() => void> = []; @@ -53,7 +53,7 @@ export function runSyncCleanup() { * Register the config instance for telemetry shutdown. * This must be called early in the application lifecycle. */ -export function registerTelemetryConfig(config: Config) { +export function registerTelemetryConfig(config: Config): void { configForTelemetry = config; } diff --git a/packages/cli/src/utils/devtoolsService.ts b/packages/cli/src/utils/devtoolsService.ts index 401e33de886..448e2acb809 100644 --- a/packages/cli/src/utils/devtoolsService.ts +++ b/packages/cli/src/utils/devtoolsService.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { debugLogger } from '@google/gemini-cli-core'; -import type { Config } from '@google/gemini-cli-core'; +import { debugLogger, type Config } from '@google/gemini-cli-core'; import WebSocket from 'ws'; import { initActivityLogger, diff --git a/packages/cli/src/utils/dialogScopeUtils.test.ts b/packages/cli/src/utils/dialogScopeUtils.test.ts index a2032bda6d0..28d85902d5b 100644 --- a/packages/cli/src/utils/dialogScopeUtils.test.ts +++ b/packages/cli/src/utils/dialogScopeUtils.test.ts @@ -5,8 +5,7 @@ */ import { describe, it, expect, vi, beforeEach } from 'vitest'; -import { SettingScope } from '../config/settings.js'; -import type { LoadedSettings } from '../config/settings.js'; +import { SettingScope, type LoadedSettings } from '../config/settings.js'; import { getScopeItems, getScopeMessageForSetting, diff --git a/packages/cli/src/utils/dialogScopeUtils.ts b/packages/cli/src/utils/dialogScopeUtils.ts index ccf93b6a68b..0171fd3d0c3 100644 --- a/packages/cli/src/utils/dialogScopeUtils.ts +++ b/packages/cli/src/utils/dialogScopeUtils.ts @@ -4,11 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - LoadableSettingScope, - LoadedSettings, +import { + type LoadableSettingScope, + type LoadedSettings, + isLoadableSettingScope, + SettingScope, } from '../config/settings.js'; -import { isLoadableSettingScope, SettingScope } from '../config/settings.js'; import { settingExistsInScope } from './settingsUtils.js'; /** diff --git a/packages/cli/src/utils/errors.test.ts b/packages/cli/src/utils/errors.test.ts index c5b7a7e7fee..dba09636ba2 100644 --- a/packages/cli/src/utils/errors.test.ts +++ b/packages/cli/src/utils/errors.test.ts @@ -13,8 +13,8 @@ import { beforeEach, afterEach, } from 'vitest'; -import type { Config } from '@google/gemini-cli-core'; import { + type Config, OutputFormat, FatalInputError, debugLogger, diff --git a/packages/cli/src/utils/errors.ts b/packages/cli/src/utils/errors.ts index 89c0fe6b220..6ce4aa01c43 100644 --- a/packages/cli/src/utils/errors.ts +++ b/packages/cli/src/utils/errors.ts @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { Config } from '@google/gemini-cli-core'; import { + type Config, OutputFormat, JsonFormatter, StreamJsonFormatter, diff --git a/packages/cli/src/utils/handleAutoUpdate.test.ts b/packages/cli/src/utils/handleAutoUpdate.test.ts index 0af2de37b18..bac763c6cfd 100644 --- a/packages/cli/src/utils/handleAutoUpdate.test.ts +++ b/packages/cli/src/utils/handleAutoUpdate.test.ts @@ -4,8 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { Mock } from 'vitest'; -import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +import { + type Mock, + describe, + it, + expect, + vi, + beforeEach, + afterEach, +} from 'vitest'; import { getInstallationInfo, PackageManager } from './installationInfo.js'; import { updateEventEmitter } from './updateEventEmitter.js'; import type { UpdateObject } from '../ui/utils/updateCheck.js'; diff --git a/packages/cli/src/utils/handleAutoUpdate.ts b/packages/cli/src/utils/handleAutoUpdate.ts index a6d0cdc574d..668079ddf34 100644 --- a/packages/cli/src/utils/handleAutoUpdate.ts +++ b/packages/cli/src/utils/handleAutoUpdate.ts @@ -8,8 +8,7 @@ import type { UpdateObject } from '../ui/utils/updateCheck.js'; import type { LoadedSettings } from '../config/settings.js'; import { getInstallationInfo, PackageManager } from './installationInfo.js'; import { updateEventEmitter } from './updateEventEmitter.js'; -import type { HistoryItem } from '../ui/types.js'; -import { MessageType } from '../ui/types.js'; +import { type HistoryItem, MessageType } from '../ui/types.js'; import { spawnWrapper } from './spawnWrapper.js'; import type { spawn } from 'node:child_process'; diff --git a/packages/cli/src/utils/relaunch.test.ts b/packages/cli/src/utils/relaunch.test.ts index 2ad5e06a736..a1fb1fa3eef 100644 --- a/packages/cli/src/utils/relaunch.test.ts +++ b/packages/cli/src/utils/relaunch.test.ts @@ -15,8 +15,7 @@ import { } from 'vitest'; import { EventEmitter } from 'node:events'; import { RELAUNCH_EXIT_CODE } from './processUtils.js'; -import type { ChildProcess } from 'node:child_process'; -import { spawn } from 'node:child_process'; +import { type ChildProcess, spawn } from 'node:child_process'; const mocks = vi.hoisted(() => ({ writeToStderr: vi.fn(), diff --git a/packages/cli/src/utils/sandbox.ts b/packages/cli/src/utils/sandbox.ts index ffd77fb1198..70648e824c2 100644 --- a/packages/cli/src/utils/sandbox.ts +++ b/packages/cli/src/utils/sandbox.ts @@ -11,8 +11,9 @@ import os from 'node:os'; import { fileURLToPath } from 'node:url'; import { quote, parse } from 'shell-quote'; import { promisify } from 'node:util'; -import type { Config, SandboxConfig } from '@google/gemini-cli-core'; import { + type Config, + type SandboxConfig, coreEvents, debugLogger, FatalSandboxError, diff --git a/packages/cli/src/utils/sessionUtils.test.ts b/packages/cli/src/utils/sessionUtils.test.ts index 8491f748bd5..ce299c34c2e 100644 --- a/packages/cli/src/utils/sessionUtils.test.ts +++ b/packages/cli/src/utils/sessionUtils.test.ts @@ -12,8 +12,11 @@ import { hasUserOrAssistantMessage, SessionError, } from './sessionUtils.js'; -import type { Config, MessageRecord } from '@google/gemini-cli-core'; -import { SESSION_FILE_PREFIX } from '@google/gemini-cli-core'; +import { + type Config, + type MessageRecord, + SESSION_FILE_PREFIX, +} from '@google/gemini-cli-core'; import * as fs from 'node:fs/promises'; import path from 'node:path'; import { randomUUID } from 'node:crypto'; diff --git a/packages/cli/src/utils/sessions.test.ts b/packages/cli/src/utils/sessions.test.ts index 8fe22cebba7..b3d998753f5 100644 --- a/packages/cli/src/utils/sessions.test.ts +++ b/packages/cli/src/utils/sessions.test.ts @@ -5,8 +5,7 @@ */ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; -import type { Config } from '@google/gemini-cli-core'; -import { ChatRecordingService } from '@google/gemini-cli-core'; +import { type Config, ChatRecordingService } from '@google/gemini-cli-core'; import { listSessions, deleteSession } from './sessions.js'; import { SessionSelector, type SessionInfo } from './sessionUtils.js'; diff --git a/packages/cli/src/utils/settingsUtils.ts b/packages/cli/src/utils/settingsUtils.ts index 3fa1d8bd5d7..51ba426905d 100644 --- a/packages/cli/src/utils/settingsUtils.ts +++ b/packages/cli/src/utils/settingsUtils.ts @@ -9,15 +9,14 @@ import type { LoadedSettings, LoadableSettingScope, } from '../config/settings.js'; -import type { - SettingDefinition, - SettingsSchema, - SettingsType, - SettingsValue, +import { + type SettingDefinition, + type SettingsSchema, + type SettingsType, + type SettingsValue, + getSettingsSchema, } from '../config/settingsSchema.js'; -import { getSettingsSchema } from '../config/settingsSchema.js'; -import type { Config } from '@google/gemini-cli-core'; -import { ExperimentFlags } from '@google/gemini-cli-core'; +import { type Config, ExperimentFlags } from '@google/gemini-cli-core'; // The schema is now nested, but many parts of the UI and logic work better // with a flattened structure and dot-notation keys. This section flattens the diff --git a/packages/cli/src/validateNonInterActiveAuth.test.ts b/packages/cli/src/validateNonInterActiveAuth.test.ts index 819a4c2924c..348dc0de7ad 100644 --- a/packages/cli/src/validateNonInterActiveAuth.test.ts +++ b/packages/cli/src/validateNonInterActiveAuth.test.ts @@ -21,8 +21,8 @@ import { debugLogger, ExitCodes, coreEvents, + type Config, } from '@google/gemini-cli-core'; -import type { Config } from '@google/gemini-cli-core'; import * as auth from './config/auth.js'; import { type LoadedSettings } from './config/settings.js'; diff --git a/packages/cli/src/validateNonInterActiveAuth.ts b/packages/cli/src/validateNonInterActiveAuth.ts index a9a6bf60352..cbfb41760cf 100644 --- a/packages/cli/src/validateNonInterActiveAuth.ts +++ b/packages/cli/src/validateNonInterActiveAuth.ts @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { Config, AuthType } from '@google/gemini-cli-core'; import { + type Config, + type AuthType, debugLogger, OutputFormat, ExitCodes, getAuthTypeFromEnv, } from '@google/gemini-cli-core'; -import { USER_SETTINGS_PATH } from './config/settings.js'; +import { USER_SETTINGS_PATH, type LoadedSettings } from './config/settings.js'; import { validateAuthMethod } from './config/auth.js'; -import { type LoadedSettings } from './config/settings.js'; import { handleError } from './utils/errors.js'; import { runExitCleanup } from './utils/cleanup.js'; diff --git a/packages/cli/src/zed-integration/zedIntegration.ts b/packages/cli/src/zed-integration/zedIntegration.ts index 98c9efdc756..13028d69edc 100644 --- a/packages/cli/src/zed-integration/zedIntegration.ts +++ b/packages/cli/src/zed-integration/zedIntegration.ts @@ -4,15 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { - Config, - GeminiChat, - ToolResult, - ToolCallConfirmationDetails, - FilterFilesOptions, - ConversationRecord, -} from '@google/gemini-cli-core'; import { + type Config, + type GeminiChat, + type ToolResult, + type ToolCallConfirmationDetails, + type FilterFilesOptions, + type ConversationRecord, CoreToolCallStatus, AuthType, logToolCall, @@ -49,15 +47,17 @@ function hasMeta(obj: unknown): obj is { _meta?: Record } { return typeof obj === 'object' && obj !== null && '_meta' in obj; } import type { Content, Part, FunctionCall } from '@google/genai'; -import type { LoadedSettings } from '../config/settings.js'; -import { SettingScope, loadSettings } from '../config/settings.js'; +import { + type LoadedSettings, + SettingScope, + loadSettings, +} from '../config/settings.js'; import * as fs from 'node:fs/promises'; import * as path from 'node:path'; import { z } from 'zod'; import { randomUUID } from 'node:crypto'; -import type { CliArgs } from '../config/config.js'; -import { loadCliConfig } from '../config/config.js'; +import { type CliArgs, loadCliConfig } from '../config/config.js'; import { runExitCleanup } from '../utils/cleanup.js'; import { SessionSelector } from '../utils/sessionUtils.js';