Explict imports & exports with type modifier (#3774)

This commit is contained in:
Pascal Birchler 2025-08-26 00:04:53 +02:00 committed by GitHub
parent 71c090c696
commit 0f031a7f89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
332 changed files with 1086 additions and 1105 deletions

View file

@ -108,6 +108,10 @@ export default tseslint.config(
'error', 'error',
{ ignoreParameters: true, ignoreProperties: true }, { ignoreParameters: true, ignoreProperties: true },
], ],
'@typescript-eslint/consistent-type-imports': [
'error',
{ disallowTypeAnnotations: false },
],
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }], '@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
'@typescript-eslint/no-unused-vars': [ '@typescript-eslint/no-unused-vars': [
'error', 'error',

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandModule } from 'yargs'; import type { CommandModule } from 'yargs';
import { installCommand } from './extensions/install.js'; import { installCommand } from './extensions/install.js';
import { uninstallCommand } from './extensions/uninstall.js'; import { uninstallCommand } from './extensions/uninstall.js';
import { listCommand } from './extensions/list.js'; import { listCommand } from './extensions/list.js';

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandModule } from 'yargs'; import type { CommandModule } from 'yargs';
import { import {
installExtension, installExtension,
ExtensionInstallMetadata, type ExtensionInstallMetadata,
} from '../../config/extension.js'; } from '../../config/extension.js';
interface InstallArgs { interface InstallArgs {

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandModule } from 'yargs'; import type { CommandModule } from 'yargs';
import { loadUserExtensions, toOutputString } from '../../config/extension.js'; import { loadUserExtensions, toOutputString } from '../../config/extension.js';
export async function handleList() { export async function handleList() {

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandModule } from 'yargs'; import type { CommandModule } from 'yargs';
import { uninstallExtension } from '../../config/extension.js'; import { uninstallExtension } from '../../config/extension.js';
interface UninstallArgs { interface UninstallArgs {

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandModule } from 'yargs'; import type { CommandModule } from 'yargs';
import { updateExtension } from '../../config/extension.js'; import { updateExtension } from '../../config/extension.js';
interface UpdateArgs { interface UpdateArgs {

View file

@ -7,7 +7,7 @@
// File for 'gemini mcp add' command // File for 'gemini mcp add' command
import type { CommandModule } from 'yargs'; import type { CommandModule } from 'yargs';
import { loadSettings, SettingScope } from '../../config/settings.js'; import { loadSettings, SettingScope } from '../../config/settings.js';
import { MCPServerConfig } from '@google/gemini-cli-core'; import type { MCPServerConfig } from '@google/gemini-cli-core';
async function addMcpServer( async function addMcpServer(
name: string, name: string,

View file

@ -7,11 +7,8 @@
// File for 'gemini mcp list' command // File for 'gemini mcp list' command
import type { CommandModule } from 'yargs'; import type { CommandModule } from 'yargs';
import { loadSettings } from '../../config/settings.js'; import { loadSettings } from '../../config/settings.js';
import { import type { MCPServerConfig } from '@google/gemini-cli-core';
MCPServerConfig, import { MCPServerStatus, createTransport } from '@google/gemini-cli-core';
MCPServerStatus,
createTransport,
} from '@google/gemini-cli-core';
import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { loadExtensions } from '../../config/extension.js'; import { loadExtensions } from '../../config/extension.js';

View file

@ -8,11 +8,11 @@ import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
import * as fs from 'node:fs'; import * as fs from 'node:fs';
import * as path from 'node:path'; import * as path from 'node:path';
import { tmpdir } from 'node:os'; import { tmpdir } from 'node:os';
import { import type {
Config,
ConfigParameters, ConfigParameters,
ContentGeneratorConfig, ContentGeneratorConfig,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { Config } from '@google/gemini-cli-core';
import { http, HttpResponse } from 'msw'; import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node'; import { setupServer } from 'msw/node';

View file

@ -4,13 +4,21 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest'; import {
describe,
it,
expect,
vi,
beforeEach,
afterEach,
type Mock,
} from 'vitest';
import * as os from 'node:os'; import * as os from 'node:os';
import * as path from 'node:path'; import * as path from 'node:path';
import { ShellTool, EditTool, WriteFileTool } from '@google/gemini-cli-core'; import { ShellTool, EditTool, WriteFileTool } from '@google/gemini-cli-core';
import { loadCliConfig, parseArguments, CliArgs } from './config.js'; import { loadCliConfig, parseArguments, type CliArgs } from './config.js';
import { Settings } from './settings.js'; import type { Settings } from './settings.js';
import { Extension } from './extension.js'; import type { Extension } from './extension.js';
import * as ServerConfig from '@google/gemini-cli-core'; import * as ServerConfig from '@google/gemini-cli-core';
import { isWorkspaceTrusted } from './trustedFolders.js'; import { isWorkspaceTrusted } from './trustedFolders.js';

View file

@ -11,6 +11,11 @@ import yargs from 'yargs/yargs';
import { hideBin } from 'yargs/helpers'; import { hideBin } from 'yargs/helpers';
import process from 'node:process'; import process from 'node:process';
import { mcpCommand } from '../commands/mcp.js'; import { mcpCommand } from '../commands/mcp.js';
import type {
TelemetryTarget,
FileFilteringOptions,
MCPServerConfig,
} from '@google/gemini-cli-core';
import { extensionsCommand } from '../commands/extensions.js'; import { extensionsCommand } from '../commands/extensions.js';
import { import {
Config, Config,
@ -22,16 +27,14 @@ import {
DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_GEMINI_EMBEDDING_MODEL,
DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, DEFAULT_MEMORY_FILE_FILTERING_OPTIONS,
FileDiscoveryService, FileDiscoveryService,
TelemetryTarget,
FileFilteringOptions,
ShellTool, ShellTool,
EditTool, EditTool,
WriteFileTool, WriteFileTool,
MCPServerConfig,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { Settings } from './settings.js'; import type { Settings } from './settings.js';
import { Extension, annotateActiveExtensions } from './extension.js'; import type { Extension } from './extension.js';
import { annotateActiveExtensions } from './extension.js';
import { getCliVersion } from '../utils/version.js'; import { getCliVersion } from '../utils/version.js';
import { loadSandboxConfig } from './sandboxConfig.js'; import { loadSandboxConfig } from './sandboxConfig.js';
import { resolvePath } from '../utils/resolvePath.js'; import { resolvePath } from '../utils/resolvePath.js';

View file

@ -18,14 +18,14 @@ import {
updateExtension, updateExtension,
} from './extension.js'; } from './extension.js';
import { execSync } from 'node:child_process'; import { execSync } from 'node:child_process';
import { SimpleGit, simpleGit } from 'simple-git'; import { type SimpleGit, simpleGit } from 'simple-git';
vi.mock('simple-git', () => ({ vi.mock('simple-git', () => ({
simpleGit: vi.fn(), simpleGit: vi.fn(),
})); }));
vi.mock('os', async (importOriginal) => { vi.mock('os', async (importOriginal) => {
const os = await importOriginal<typeof import('os')>(); const os = await importOriginal<typeof os>();
return { return {
...os, ...os,
homedir: vi.fn(), homedir: vi.fn(),

View file

@ -4,11 +4,11 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { import type {
MCPServerConfig, MCPServerConfig,
GeminiCLIExtension, GeminiCLIExtension,
Storage,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { Storage } from '@google/gemini-cli-core';
import * as fs from 'node:fs'; import * as fs from 'node:fs';
import * as path from 'node:path'; import * as path from 'node:path';
import * as os from 'node:os'; import * as os from 'node:os';

View file

@ -5,11 +5,8 @@
*/ */
import { describe, it, expect } from 'vitest'; import { describe, it, expect } from 'vitest';
import { import type { KeyBindingConfig } from './keyBindings.js';
Command, import { Command, defaultKeyBindings } from './keyBindings.js';
KeyBindingConfig,
defaultKeyBindings,
} from './keyBindings.js';
describe('keyBindings config', () => { describe('keyBindings config', () => {
describe('defaultKeyBindings', () => { describe('defaultKeyBindings', () => {

View file

@ -4,11 +4,11 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { SandboxConfig } from '@google/gemini-cli-core'; import type { SandboxConfig } from '@google/gemini-cli-core';
import commandExists from 'command-exists'; import commandExists from 'command-exists';
import * as os from 'node:os'; import * as os from 'node:os';
import { getPackageJson } from '../utils/package.js'; import { getPackageJson } from '../utils/package.js';
import { Settings } from './settings.js'; import type { Settings } from './settings.js';
// This is a stripped-down version of the CliArgs interface from config.ts // This is a stripped-down version of the CliArgs interface from config.ts
// to avoid circular dependencies. // to avoid circular dependencies.

View file

@ -17,7 +17,7 @@ import stripJsonComments from 'strip-json-comments';
import { DefaultLight } from '../ui/themes/default-light.js'; import { DefaultLight } from '../ui/themes/default-light.js';
import { DefaultDark } from '../ui/themes/default.js'; import { DefaultDark } from '../ui/themes/default.js';
import { isWorkspaceTrusted } from './trustedFolders.js'; import { isWorkspaceTrusted } from './trustedFolders.js';
import { Settings, MemoryImportFormat } from './settingsSchema.js'; import type { Settings, MemoryImportFormat } from './settingsSchema.js';
export type { Settings, MemoryImportFormat }; export type { Settings, MemoryImportFormat };

View file

@ -5,7 +5,8 @@
*/ */
import { describe, it, expect } from 'vitest'; import { describe, it, expect } from 'vitest';
import { SETTINGS_SCHEMA, Settings } from './settingsSchema.js'; import type { Settings } from './settingsSchema.js';
import { SETTINGS_SCHEMA } from './settingsSchema.js';
describe('SettingsSchema', () => { describe('SettingsSchema', () => {
describe('SETTINGS_SCHEMA', () => { describe('SETTINGS_SCHEMA', () => {

View file

@ -4,14 +4,14 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { import type {
MCPServerConfig, MCPServerConfig,
BugCommandSettings, BugCommandSettings,
TelemetrySettings, TelemetrySettings,
AuthType, AuthType,
ChatCompressionSettings, ChatCompressionSettings,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { CustomTheme } from '../ui/themes/theme.js'; import type { CustomTheme } from '../ui/themes/theme.js';
export interface SettingDefinition { export interface SettingDefinition {
type: 'boolean' | 'string' | 'number' | 'array' | 'object'; type: 'boolean' | 'string' | 'number' | 'array' | 'object';

View file

@ -35,7 +35,7 @@ import {
TrustLevel, TrustLevel,
isWorkspaceTrusted, isWorkspaceTrusted,
} from './trustedFolders.js'; } from './trustedFolders.js';
import { Settings } from './settings.js'; import type { Settings } from './settings.js';
vi.mock('fs', async (importOriginal) => { vi.mock('fs', async (importOriginal) => {
const actualFs = await importOriginal<typeof fs>(); const actualFs = await importOriginal<typeof fs>();

View file

@ -8,7 +8,7 @@ import * as fs from 'node:fs';
import * as path from 'node:path'; import * as path from 'node:path';
import { homedir } from 'node:os'; import { homedir } from 'node:os';
import { getErrorMessage, isWithinRoot } from '@google/gemini-cli-core'; import { getErrorMessage, isWithinRoot } from '@google/gemini-cli-core';
import { Settings } from './settings.js'; import type { Settings } from './settings.js';
import stripJsonComments from 'strip-json-comments'; import stripJsonComments from 'strip-json-comments';
export const TRUSTED_FOLDERS_FILENAME = 'trustedFolders.json'; export const TRUSTED_FOLDERS_FILENAME = 'trustedFolders.json';

View file

@ -12,13 +12,10 @@ import {
validateDnsResolutionOrder, validateDnsResolutionOrder,
startInteractiveUI, startInteractiveUI,
} from './gemini.js'; } from './gemini.js';
import { import type { SettingsFile } from './config/settings.js';
LoadedSettings, import { LoadedSettings, loadSettings } from './config/settings.js';
SettingsFile,
loadSettings,
} from './config/settings.js';
import { appEvents, AppEvent } from './utils/events.js'; import { appEvents, AppEvent } from './utils/events.js';
import { Config } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
// Custom error to identify mock process.exit calls // Custom error to identify mock process.exit calls
class MockProcessExitError extends Error { class MockProcessExitError extends Error {

View file

@ -15,12 +15,8 @@ import os from 'node:os';
import dns from 'node:dns'; import dns from 'node:dns';
import { spawn } from 'node:child_process'; import { spawn } from 'node:child_process';
import { start_sandbox } from './utils/sandbox.js'; import { start_sandbox } from './utils/sandbox.js';
import { import type { DnsResolutionOrder, LoadedSettings } from './config/settings.js';
DnsResolutionOrder, import { loadSettings, SettingScope } from './config/settings.js';
LoadedSettings,
loadSettings,
SettingScope,
} from './config/settings.js';
import { themeManager } from './ui/themes/theme-manager.js'; import { themeManager } from './ui/themes/theme-manager.js';
import { getStartupWarnings } from './utils/startupWarnings.js'; import { getStartupWarnings } from './utils/startupWarnings.js';
import { getUserStartupWarnings } from './utils/userStartupWarnings.js'; import { getUserStartupWarnings } from './utils/userStartupWarnings.js';
@ -29,8 +25,8 @@ import { runNonInteractive } from './nonInteractiveCli.js';
import { loadExtensions } from './config/extension.js'; import { loadExtensions } from './config/extension.js';
import { cleanupCheckpoints, registerCleanup } from './utils/cleanup.js'; import { cleanupCheckpoints, registerCleanup } from './utils/cleanup.js';
import { getCliVersion } from './utils/version.js'; import { getCliVersion } from './utils/version.js';
import type { Config } from '@google/gemini-cli-core';
import { import {
Config,
sessionId, sessionId,
logUserPrompt, logUserPrompt,
AuthType, AuthType,

View file

@ -4,16 +4,18 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { import type {
Config, Config,
executeToolCall,
ToolRegistry, ToolRegistry,
ServerGeminiStreamEvent,
} from '@google/gemini-cli-core';
import {
executeToolCall,
ToolErrorType, ToolErrorType,
shutdownTelemetry, shutdownTelemetry,
GeminiEventType, GeminiEventType,
ServerGeminiStreamEvent,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { Part } from '@google/genai'; import type { Part } from '@google/genai';
import { runNonInteractive } from './nonInteractiveCli.js'; import { runNonInteractive } from './nonInteractiveCli.js';
import { vi } from 'vitest'; import { vi } from 'vitest';

View file

@ -4,16 +4,15 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import type { Config, ToolCallRequestInfo } from '@google/gemini-cli-core';
import { import {
Config,
ToolCallRequestInfo,
executeToolCall, executeToolCall,
shutdownTelemetry, shutdownTelemetry,
isTelemetrySdkInitialized, isTelemetrySdkInitialized,
GeminiEventType, GeminiEventType,
parseAndFormatApiError, parseAndFormatApiError,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { Content, Part } from '@google/genai'; import type { Content, Part } from '@google/genai';
import { ConsolePatcher } from './ui/utils/ConsolePatcher.js'; import { ConsolePatcher } from './ui/utils/ConsolePatcher.js';
import { handleAtCommand } from './ui/hooks/atCommandProcessor.js'; import { handleAtCommand } from './ui/hooks/atCommandProcessor.js';

View file

@ -22,7 +22,7 @@ vi.mock('../ui/commands/restoreCommand.js', () => ({
import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest'; import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest';
import { BuiltinCommandLoader } from './BuiltinCommandLoader.js'; import { BuiltinCommandLoader } from './BuiltinCommandLoader.js';
import { Config } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
import { CommandKind } from '../ui/commands/types.js'; import { CommandKind } from '../ui/commands/types.js';
import { ideCommand } from '../ui/commands/ideCommand.js'; import { ideCommand } from '../ui/commands/ideCommand.js';

View file

@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { ICommandLoader } from './types.js'; import type { ICommandLoader } from './types.js';
import { SlashCommand } from '../ui/commands/types.js'; import type { SlashCommand } from '../ui/commands/types.js';
import { Config } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
import { aboutCommand } from '../ui/commands/aboutCommand.js'; import { aboutCommand } from '../ui/commands/aboutCommand.js';
import { authCommand } from '../ui/commands/authCommand.js'; import { authCommand } from '../ui/commands/authCommand.js';
import { bugCommand } from '../ui/commands/bugCommand.js'; import { bugCommand } from '../ui/commands/bugCommand.js';

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { SlashCommand } from '../ui/commands/types.js'; import type { SlashCommand } from '../ui/commands/types.js';
import { ICommandLoader } from './types.js'; import type { ICommandLoader } from './types.js';
/** /**
* Orchestrates the discovery and loading of all slash commands for the CLI. * Orchestrates the discovery and loading of all slash commands for the CLI.

View file

@ -5,7 +5,8 @@
*/ */
import * as path from 'node:path'; import * as path from 'node:path';
import { Config, Storage } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
import { Storage } from '@google/gemini-cli-core';
import mock from 'mock-fs'; import mock from 'mock-fs';
import { FileCommandLoader } from './FileCommandLoader.js'; import { FileCommandLoader } from './FileCommandLoader.js';
import { assert, vi } from 'vitest'; import { assert, vi } from 'vitest';
@ -19,7 +20,7 @@ import {
ShellProcessor, ShellProcessor,
} from './prompt-processors/shellProcessor.js'; } from './prompt-processors/shellProcessor.js';
import { DefaultArgumentProcessor } from './prompt-processors/argumentProcessor.js'; import { DefaultArgumentProcessor } from './prompt-processors/argumentProcessor.js';
import { CommandContext } from '../ui/commands/types.js'; import type { CommandContext } from '../ui/commands/types.js';
const mockShellProcess = vi.hoisted(() => vi.fn()); const mockShellProcess = vi.hoisted(() => vi.fn());
vi.mock('./prompt-processors/shellProcessor.js', () => ({ vi.mock('./prompt-processors/shellProcessor.js', () => ({

View file

@ -9,17 +9,18 @@ import path from 'node:path';
import toml from '@iarna/toml'; import toml from '@iarna/toml';
import { glob } from 'glob'; import { glob } from 'glob';
import { z } from 'zod'; import { z } from 'zod';
import { Config, Storage } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
import { ICommandLoader } from './types.js'; import { Storage } from '@google/gemini-cli-core';
import { import type { ICommandLoader } from './types.js';
import type {
CommandContext, CommandContext,
CommandKind,
SlashCommand, SlashCommand,
SlashCommandActionReturn, SlashCommandActionReturn,
} from '../ui/commands/types.js'; } from '../ui/commands/types.js';
import { CommandKind } from '../ui/commands/types.js';
import { DefaultArgumentProcessor } from './prompt-processors/argumentProcessor.js'; import { DefaultArgumentProcessor } from './prompt-processors/argumentProcessor.js';
import type { IPromptProcessor } from './prompt-processors/types.js';
import { import {
IPromptProcessor,
SHORTHAND_ARGS_PLACEHOLDER, SHORTHAND_ARGS_PLACEHOLDER,
SHELL_INJECTION_TRIGGER, SHELL_INJECTION_TRIGGER,
} from './prompt-processors/types.js'; } from './prompt-processors/types.js';

View file

@ -5,8 +5,8 @@
*/ */
import { McpPromptLoader } from './McpPromptLoader.js'; import { McpPromptLoader } from './McpPromptLoader.js';
import { Config } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
import { PromptArgument } from '@modelcontextprotocol/sdk/types.js'; import type { PromptArgument } from '@modelcontextprotocol/sdk/types.js';
import { describe, it, expect } from 'vitest'; import { describe, it, expect } from 'vitest';
describe('McpPromptLoader', () => { describe('McpPromptLoader', () => {

View file

@ -4,19 +4,16 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { import type { Config } from '@google/gemini-cli-core';
Config, import { getErrorMessage, getMCPServerPrompts } from '@google/gemini-cli-core';
getErrorMessage, import type {
getMCPServerPrompts,
} from '@google/gemini-cli-core';
import {
CommandContext, CommandContext,
CommandKind,
SlashCommand, SlashCommand,
SlashCommandActionReturn, SlashCommandActionReturn,
} from '../ui/commands/types.js'; } from '../ui/commands/types.js';
import { ICommandLoader } from './types.js'; import { CommandKind } from '../ui/commands/types.js';
import { PromptArgument } from '@modelcontextprotocol/sdk/types.js'; import type { ICommandLoader } from './types.js';
import type { PromptArgument } from '@modelcontextprotocol/sdk/types.js';
/** /**
* Discovers and loads executable slash commands from prompts exposed by * Discovers and loads executable slash commands from prompts exposed by

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { IPromptProcessor } from './types.js'; import type { IPromptProcessor } from './types.js';
import { CommandContext } from '../../ui/commands/types.js'; import type { CommandContext } from '../../ui/commands/types.js';
/** /**
* Appends the user's full command invocation to the prompt if arguments are * Appends the user's full command invocation to the prompt if arguments are

View file

@ -7,8 +7,9 @@
import { describe, it, expect, beforeEach, vi, type Mock } from 'vitest'; import { describe, it, expect, beforeEach, vi, type Mock } from 'vitest';
import { ConfirmationRequiredError, ShellProcessor } from './shellProcessor.js'; import { ConfirmationRequiredError, ShellProcessor } from './shellProcessor.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
import { CommandContext } from '../../ui/commands/types.js'; import type { CommandContext } from '../../ui/commands/types.js';
import { ApprovalMode, Config } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
import { ApprovalMode } from '@google/gemini-cli-core';
import os from 'node:os'; import os from 'node:os';
import { quote } from 'shell-quote'; import { quote } from 'shell-quote';

View file

@ -12,9 +12,9 @@ import {
ShellExecutionService, ShellExecutionService,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { CommandContext } from '../../ui/commands/types.js'; import type { CommandContext } from '../../ui/commands/types.js';
import type { IPromptProcessor } from './types.js';
import { import {
IPromptProcessor,
SHELL_INJECTION_TRIGGER, SHELL_INJECTION_TRIGGER,
SHORTHAND_ARGS_PLACEHOLDER, SHORTHAND_ARGS_PLACEHOLDER,
} from './types.js'; } from './types.js';

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandContext } from '../../ui/commands/types.js'; import type { CommandContext } from '../../ui/commands/types.js';
/** /**
* Defines the interface for a prompt processor, a module that can transform * Defines the interface for a prompt processor, a module that can transform

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { SlashCommand } from '../ui/commands/types.js'; import type { SlashCommand } from '../ui/commands/types.js';
/** /**
* Defines the contract for any class that can load and provide slash commands. * Defines the contract for any class that can load and provide slash commands.

View file

@ -12,7 +12,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { Assertion, expect } from 'vitest'; import type { Assertion } from 'vitest';
import { expect } from 'vitest';
import type { TextBuffer } from '../ui/components/shared/text-buffer.js'; import type { TextBuffer } from '../ui/components/shared/text-buffer.js';
// RegExp to detect invalid characters: backspace, and ANSI escape codes // RegExp to detect invalid characters: backspace, and ANSI escape codes

View file

@ -5,10 +5,10 @@
*/ */
import { vi } from 'vitest'; import { vi } from 'vitest';
import { CommandContext } from '../ui/commands/types.js'; import type { CommandContext } from '../ui/commands/types.js';
import { LoadedSettings } from '../config/settings.js'; import type { LoadedSettings } from '../config/settings.js';
import { GitService } from '@google/gemini-cli-core'; import type { GitService } from '@google/gemini-cli-core';
import { SessionStatsState } from '../ui/contexts/SessionContext.js'; import type { SessionStatsState } from '../ui/contexts/SessionContext.js';
// A utility type to make all properties of an object, and its nested objects, partial. // A utility type to make all properties of an object, and its nested objects, partial.
type DeepPartial<T> = T extends object type DeepPartial<T> = T extends object

View file

@ -5,7 +5,7 @@
*/ */
import { render } from 'ink-testing-library'; import { render } from 'ink-testing-library';
import React from 'react'; import type React from 'react';
import { KeypressProvider } from '../ui/contexts/KeypressContext.js'; import { KeypressProvider } from '../ui/contexts/KeypressContext.js';
export const renderWithProviders = ( export const renderWithProviders = (

View file

@ -4,27 +4,33 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest'; import type { Mock } from 'vitest';
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { renderWithProviders } from '../test-utils/render.js'; import { renderWithProviders } from '../test-utils/render.js';
import { AppWrapper as App } from './App.js'; import { AppWrapper as App } from './App.js';
import { import type {
Config as ServerConfig,
MCPServerConfig,
ApprovalMode,
ToolRegistry,
AccessibilitySettings, AccessibilitySettings,
MCPServerConfig,
ToolRegistry,
SandboxConfig, SandboxConfig,
GeminiClient, GeminiClient,
ideContext, AuthType,
type AuthType,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { LoadedSettings, SettingsFile, Settings } from '../config/settings.js'; import {
ApprovalMode,
ideContext,
Config as ServerConfig,
} from '@google/gemini-cli-core';
import type { SettingsFile, Settings } from '../config/settings.js';
import { LoadedSettings } from '../config/settings.js';
import process from 'node:process'; import process from 'node:process';
import { useGeminiStream } from './hooks/useGeminiStream.js'; import { useGeminiStream } from './hooks/useGeminiStream.js';
import { useConsoleMessages } from './hooks/useConsoleMessages.js'; import { useConsoleMessages } from './hooks/useConsoleMessages.js';
import { StreamingState, ConsoleMessageItem } from './types.js'; import type { ConsoleMessageItem } from './types.js';
import { StreamingState } from './types.js';
import { Tips } from './components/Tips.js'; import { Tips } from './components/Tips.js';
import { checkForUpdates, UpdateObject } from './utils/updateCheck.js'; import type { UpdateObject } from './utils/updateCheck.js';
import { checkForUpdates } from './utils/updateCheck.js';
import { EventEmitter } from 'node:events'; import { EventEmitter } from 'node:events';
import { updateEventEmitter } from '../utils/updateEventEmitter.js'; import { updateEventEmitter } from '../utils/updateEventEmitter.js';
import * as auth from '../config/auth.js'; import * as auth from '../config/auth.js';

View file

@ -5,15 +5,8 @@
*/ */
import { useCallback, useEffect, useMemo, useState, useRef } from 'react'; import { useCallback, useEffect, useMemo, useState, useRef } from 'react';
import { import type { DOMElement } from 'ink';
Box, import { Box, measureElement, Static, Text, useStdin, useStdout } from 'ink';
DOMElement,
measureElement,
Static,
Text,
useStdin,
useStdout,
} from 'ink';
import { StreamingState, type HistoryItem, MessageType } from './types.js'; import { StreamingState, type HistoryItem, MessageType } from './types.js';
import { useTerminalSize } from './hooks/useTerminalSize.js'; import { useTerminalSize } from './hooks/useTerminalSize.js';
import { useGeminiStream } from './hooks/useGeminiStream.js'; import { useGeminiStream } from './hooks/useGeminiStream.js';
@ -41,7 +34,8 @@ import { ShellConfirmationDialog } from './components/ShellConfirmationDialog.js
import { RadioButtonSelect } from './components/shared/RadioButtonSelect.js'; import { RadioButtonSelect } from './components/shared/RadioButtonSelect.js';
import { Colors } from './colors.js'; import { Colors } from './colors.js';
import { loadHierarchicalGeminiMemory } from '../config/config.js'; import { loadHierarchicalGeminiMemory } from '../config/config.js';
import { LoadedSettings, SettingScope } from '../config/settings.js'; import type { LoadedSettings } from '../config/settings.js';
import { SettingScope } from '../config/settings.js';
import { Tips } from './components/Tips.js'; import { Tips } from './components/Tips.js';
import { ConsolePatcher } from './utils/ConsolePatcher.js'; import { ConsolePatcher } from './utils/ConsolePatcher.js';
import { registerCleanup } from '../utils/cleanup.js'; import { registerCleanup } from '../utils/cleanup.js';
@ -50,23 +44,22 @@ import { HistoryItemDisplay } from './components/HistoryItemDisplay.js';
import { ContextSummaryDisplay } from './components/ContextSummaryDisplay.js'; import { ContextSummaryDisplay } from './components/ContextSummaryDisplay.js';
import { useHistory } from './hooks/useHistoryManager.js'; import { useHistory } from './hooks/useHistoryManager.js';
import process from 'node:process'; import process from 'node:process';
import type { EditorType, Config, IdeContext } from '@google/gemini-cli-core';
import { import {
getErrorMessage,
type Config,
getAllGeminiMdFilenames,
ApprovalMode, ApprovalMode,
getAllGeminiMdFilenames,
isEditorAvailable, isEditorAvailable,
EditorType, getErrorMessage,
FlashFallbackEvent,
logFlashFallback,
AuthType, AuthType,
type IdeContext, logFlashFallback,
FlashFallbackEvent,
ideContext, ideContext,
isProQuotaExceededError,
isGenericQuotaExceededError,
UserTierId,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { import type { IdeIntegrationNudgeResult } from './IdeIntegrationNudge.js';
IdeIntegrationNudge, import { IdeIntegrationNudge } from './IdeIntegrationNudge.js';
IdeIntegrationNudgeResult,
} from './IdeIntegrationNudge.js';
import { validateAuthMethod } from '../config/auth.js'; import { validateAuthMethod } from '../config/auth.js';
import { useLogger } from './hooks/useLogger.js'; import { useLogger } from './hooks/useLogger.js';
import { StreamingContext } from './contexts/StreamingContext.js'; import { StreamingContext } from './contexts/StreamingContext.js';
@ -80,18 +73,14 @@ import { useBracketedPaste } from './hooks/useBracketedPaste.js';
import { useTextBuffer } from './components/shared/text-buffer.js'; import { useTextBuffer } from './components/shared/text-buffer.js';
import { useVimMode, VimModeProvider } from './contexts/VimModeContext.js'; import { useVimMode, VimModeProvider } from './contexts/VimModeContext.js';
import { useVim } from './hooks/vim.js'; import { useVim } from './hooks/vim.js';
import { useKeypress, Key } from './hooks/useKeypress.js'; import type { Key } from './hooks/useKeypress.js';
import { useKeypress } from './hooks/useKeypress.js';
import { KeypressProvider } from './contexts/KeypressContext.js'; import { KeypressProvider } from './contexts/KeypressContext.js';
import { useKittyKeyboardProtocol } from './hooks/useKittyKeyboardProtocol.js'; import { useKittyKeyboardProtocol } from './hooks/useKittyKeyboardProtocol.js';
import { keyMatchers, Command } from './keyMatchers.js'; import { keyMatchers, Command } from './keyMatchers.js';
import * as fs from 'node:fs'; import * as fs from 'node:fs';
import { UpdateNotification } from './components/UpdateNotification.js'; import { UpdateNotification } from './components/UpdateNotification.js';
import { import type { UpdateObject } from './utils/updateCheck.js';
isProQuotaExceededError,
isGenericQuotaExceededError,
UserTierId,
} from '@google/gemini-cli-core';
import { UpdateObject } from './utils/updateCheck.js';
import ansiEscapes from 'ansi-escapes'; import ansiEscapes from 'ansi-escapes';
import { OverflowProvider } from './contexts/OverflowContext.js'; import { OverflowProvider } from './contexts/OverflowContext.js';
import { ShowMoreLines } from './components/ShowMoreLines.js'; import { ShowMoreLines } from './components/ShowMoreLines.js';

View file

@ -4,12 +4,11 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { DetectedIde, getIdeInfo } from '@google/gemini-cli-core'; import type { DetectedIde } from '@google/gemini-cli-core';
import { getIdeInfo } from '@google/gemini-cli-core';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { import type { RadioSelectItem } from './components/shared/RadioButtonSelect.js';
RadioButtonSelect, import { RadioButtonSelect } from './components/shared/RadioButtonSelect.js';
RadioSelectItem,
} from './components/shared/RadioButtonSelect.js';
import { useKeypress } from './hooks/useKeypress.js'; import { useKeypress } from './hooks/useKeypress.js';
export type IdeIntegrationNudgeResult = { export type IdeIntegrationNudgeResult = {

View file

@ -5,7 +5,7 @@
*/ */
import { themeManager } from './themes/theme-manager.js'; import { themeManager } from './themes/theme-manager.js';
import { ColorsTheme } from './themes/theme.js'; import type { ColorsTheme } from './themes/theme.js';
export const Colors: ColorsTheme = { export const Colors: ColorsTheme = {
get type() { get type() {

View file

@ -5,7 +5,8 @@
*/ */
import { getCliVersion } from '../../utils/version.js'; import { getCliVersion } from '../../utils/version.js';
import { CommandKind, SlashCommand } from './types.js'; import type { SlashCommand } from './types.js';
import { CommandKind } from './types.js';
import process from 'node:process'; import process from 'node:process';
import { MessageType, type HistoryItemAbout } from '../types.js'; import { MessageType, type HistoryItemAbout } from '../types.js';

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandKind, OpenDialogActionReturn, SlashCommand } from './types.js'; import type { OpenDialogActionReturn, SlashCommand } from './types.js';
import { CommandKind } from './types.js';
export const authCommand: SlashCommand = { export const authCommand: SlashCommand = {
name: 'auth', name: 'auth',

View file

@ -4,29 +4,22 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { import type { Mocked } from 'vitest';
vi, import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest';
describe,
it,
expect,
beforeEach,
afterEach,
Mocked,
} from 'vitest';
import { import type {
type CommandContext,
MessageActionReturn, MessageActionReturn,
SlashCommand, SlashCommand,
type CommandContext,
} from './types.js'; } from './types.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
import { Content } from '@google/genai'; import type { Content } from '@google/genai';
import { GeminiClient } from '@google/gemini-cli-core'; import type { GeminiClient } from '@google/gemini-cli-core';
import * as fsPromises from 'node:fs/promises'; import * as fsPromises from 'node:fs/promises';
import { chatCommand } from './chatCommand.js'; import { chatCommand } from './chatCommand.js';
import { Stats } from 'node:fs'; import type { Stats } from 'node:fs';
import { HistoryItemWithoutId } from '../types.js'; import type { HistoryItemWithoutId } from '../types.js';
vi.mock('fs/promises', () => ({ vi.mock('fs/promises', () => ({
stat: vi.fn(), stat: vi.fn(),

View file

@ -8,16 +8,17 @@ import * as fsPromises from 'node:fs/promises';
import React from 'react'; import React from 'react';
import { Text } from 'ink'; import { Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { import type {
CommandContext, CommandContext,
SlashCommand, SlashCommand,
MessageActionReturn, MessageActionReturn,
CommandKind,
SlashCommandActionReturn, SlashCommandActionReturn,
} from './types.js'; } from './types.js';
import { CommandKind } from './types.js';
import { decodeTagName } from '@google/gemini-cli-core'; import { decodeTagName } from '@google/gemini-cli-core';
import path from 'node:path'; import path from 'node:path';
import { HistoryItemWithoutId, MessageType } from '../types.js'; import type { HistoryItemWithoutId } from '../types.js';
import { MessageType } from '../types.js';
interface ChatDetail { interface ChatDetail {
name: string; name: string;

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { vi, describe, it, expect, beforeEach, Mock } from 'vitest'; import type { Mock } from 'vitest';
import { vi, describe, it, expect, beforeEach } from 'vitest';
import { clearCommand } from './clearCommand.js'; import { clearCommand } from './clearCommand.js';
import { type CommandContext } from './types.js'; import { type CommandContext } from './types.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
@ -20,7 +21,8 @@ vi.mock('@google/gemini-cli-core', async () => {
}; };
}); });
import { GeminiClient, uiTelemetryService } from '@google/gemini-cli-core'; import type { GeminiClient } from '@google/gemini-cli-core';
import { uiTelemetryService } from '@google/gemini-cli-core';
describe('clearCommand', () => { describe('clearCommand', () => {
let mockContext: CommandContext; let mockContext: CommandContext;

View file

@ -5,7 +5,8 @@
*/ */
import { uiTelemetryService } from '@google/gemini-cli-core'; import { uiTelemetryService } from '@google/gemini-cli-core';
import { CommandKind, SlashCommand } from './types.js'; import type { SlashCommand } from './types.js';
import { CommandKind } from './types.js';
export const clearCommand: SlashCommand = { export const clearCommand: SlashCommand = {
name: 'clear', name: 'clear',

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { GeminiClient } from '@google/gemini-cli-core'; import type { GeminiClient } from '@google/gemini-cli-core';
import { vi, describe, it, expect, beforeEach } from 'vitest'; import { vi, describe, it, expect, beforeEach } from 'vitest';
import { compressCommand } from './compressCommand.js'; import { compressCommand } from './compressCommand.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';

View file

@ -4,8 +4,10 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { HistoryItemCompression, MessageType } from '../types.js'; import type { HistoryItemCompression } from '../types.js';
import { CommandKind, SlashCommand } from './types.js'; import { MessageType } from '../types.js';
import type { SlashCommand } from './types.js';
import { CommandKind } from './types.js';
export const compressCommand: SlashCommand = { export const compressCommand: SlashCommand = {
name: 'compress', name: 'compress',

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { vi, describe, it, expect, beforeEach, Mock } from 'vitest'; import type { Mock } from 'vitest';
import { vi, describe, it, expect, beforeEach } from 'vitest';
import { copyCommand } from './copyCommand.js'; import { copyCommand } from './copyCommand.js';
import { type CommandContext } from './types.js'; import { type CommandContext } from './types.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';

View file

@ -5,11 +5,8 @@
*/ */
import { copyToClipboard } from '../utils/commandUtils.js'; import { copyToClipboard } from '../utils/commandUtils.js';
import { import type { SlashCommand, SlashCommandActionReturn } from './types.js';
CommandKind, import { CommandKind } from './types.js';
SlashCommand,
SlashCommandActionReturn,
} from './types.js';
export const copyCommand: SlashCommand = { export const copyCommand: SlashCommand = {
name: 'copy', name: 'copy',

View file

@ -6,8 +6,8 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'; import { describe, it, expect, vi, beforeEach } from 'vitest';
import { directoryCommand, expandHomeDir } from './directoryCommand.js'; import { directoryCommand, expandHomeDir } from './directoryCommand.js';
import { Config, WorkspaceContext } from '@google/gemini-cli-core'; import type { Config, WorkspaceContext } from '@google/gemini-cli-core';
import { CommandContext } from './types.js'; import type { CommandContext } from './types.js';
import { MessageType } from '../types.js'; import { MessageType } from '../types.js';
import * as os from 'node:os'; import * as os from 'node:os';
import * as path from 'node:path'; import * as path from 'node:path';

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { SlashCommand, CommandContext, CommandKind } from './types.js'; import type { SlashCommand, CommandContext } from './types.js';
import { CommandKind } from './types.js';
import { MessageType } from '../types.js'; import { MessageType } from '../types.js';
import * as os from 'node:os'; import * as os from 'node:os';
import * as path from 'node:path'; import * as path from 'node:path';

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandKind, SlashCommand } from './types.js'; import type { SlashCommand } from './types.js';
import { CommandKind } from './types.js';
import { MessageType, type HistoryItemHelp } from '../types.js'; import { MessageType, type HistoryItemHelp } from '../types.js';
export const helpCommand: SlashCommand = { export const helpCommand: SlashCommand = {

View file

@ -4,15 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { import type { MockInstance } from 'vitest';
MockInstance, import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest';
vi,
describe,
it,
expect,
beforeEach,
afterEach,
} from 'vitest';
import { ideCommand } from './ideCommand.js'; import { ideCommand } from './ideCommand.js';
import { type CommandContext } from './types.js'; import { type CommandContext } from './types.js';
import { type Config, DetectedIde } from '@google/gemini-cli-core'; import { type Config, DetectedIde } from '@google/gemini-cli-core';

View file

@ -4,22 +4,20 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import type { Config, IdeClient, File } from '@google/gemini-cli-core';
import { import {
Config,
GEMINI_CLI_COMPANION_EXTENSION_NAME,
IDEConnectionStatus,
getIdeInstaller, getIdeInstaller,
IdeClient, IDEConnectionStatus,
type File,
ideContext, ideContext,
GEMINI_CLI_COMPANION_EXTENSION_NAME,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import path from 'node:path'; import path from 'node:path';
import { import type {
CommandContext, CommandContext,
SlashCommand, SlashCommand,
SlashCommandActionReturn, SlashCommandActionReturn,
CommandKind,
} from './types.js'; } from './types.js';
import { CommandKind } from './types.js';
import { SettingScope } from '../../config/settings.js'; import { SettingScope } from '../../config/settings.js';
function getIdeStatusMessage(ideClient: IdeClient): { function getIdeStatusMessage(ideClient: IdeClient): {

View file

@ -6,12 +6,12 @@
import * as fs from 'node:fs'; import * as fs from 'node:fs';
import * as path from 'node:path'; import * as path from 'node:path';
import { import type {
CommandContext, CommandContext,
SlashCommand, SlashCommand,
SlashCommandActionReturn, SlashCommandActionReturn,
CommandKind,
} from './types.js'; } from './types.js';
import { CommandKind } from './types.js';
export const initCommand: SlashCommand = { export const initCommand: SlashCommand = {
name: 'init', name: 'init',

View file

@ -15,8 +15,9 @@ import {
DiscoveredMCPTool, DiscoveredMCPTool,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { MessageActionReturn } from './types.js'; import type { MessageActionReturn } from './types.js';
import { Type, CallableTool } from '@google/genai'; import type { CallableTool } from '@google/genai';
import { Type } from '@google/genai';
vi.mock('@google/gemini-cli-core', async (importOriginal) => { vi.mock('@google/gemini-cli-core', async (importOriginal) => {
const actual = const actual =

View file

@ -4,15 +4,15 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { import type {
SlashCommand, SlashCommand,
SlashCommandActionReturn, SlashCommandActionReturn,
CommandContext, CommandContext,
CommandKind,
MessageActionReturn, MessageActionReturn,
} from './types.js'; } from './types.js';
import { CommandKind } from './types.js';
import type { DiscoveredMCPPrompt } from '@google/gemini-cli-core';
import { import {
DiscoveredMCPPrompt,
DiscoveredMCPTool, DiscoveredMCPTool,
getMCPDiscoveryState, getMCPDiscoveryState,
getMCPServerStatus, getMCPServerStatus,

View file

@ -4,12 +4,13 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { vi, describe, it, expect, beforeEach, Mock } from 'vitest'; import type { Mock } from 'vitest';
import { vi, describe, it, expect, beforeEach } from 'vitest';
import { memoryCommand } from './memoryCommand.js'; import { memoryCommand } from './memoryCommand.js';
import { type CommandContext, SlashCommand } from './types.js'; import type { SlashCommand, type CommandContext } from './types.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
import { MessageType } from '../types.js'; import { MessageType } from '../types.js';
import { LoadedSettings } from '../../config/settings.js'; import type { LoadedSettings } from '../../config/settings.js';
import { import {
getErrorMessage, getErrorMessage,
loadServerHierarchicalMemory, loadServerHierarchicalMemory,

View file

@ -9,11 +9,8 @@ import {
loadServerHierarchicalMemory, loadServerHierarchicalMemory,
} from '@google/gemini-cli-core'; } from '@google/gemini-cli-core';
import { MessageType } from '../types.js'; import { MessageType } from '../types.js';
import { import type { SlashCommand, SlashCommandActionReturn } from './types.js';
CommandKind, import { CommandKind } from './types.js';
SlashCommand,
SlashCommandActionReturn,
} from './types.js';
export const memoryCommand: SlashCommand = { export const memoryCommand: SlashCommand = {
name: 'memory', name: 'memory',

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandKind, OpenDialogActionReturn, SlashCommand } from './types.js'; import type { OpenDialogActionReturn, SlashCommand } from './types.js';
import { CommandKind } from './types.js';
export const privacyCommand: SlashCommand = { export const privacyCommand: SlashCommand = {
name: 'privacy', name: 'privacy',

View file

@ -11,7 +11,7 @@ import * as path from 'node:path';
import { restoreCommand } from './restoreCommand.js'; import { restoreCommand } from './restoreCommand.js';
import { type CommandContext } from './types.js'; import { type CommandContext } from './types.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
import { Config, GitService } from '@google/gemini-cli-core'; import type { Config, GitService } from '@google/gemini-cli-core';
describe('restoreCommand', () => { describe('restoreCommand', () => {
let mockContext: CommandContext; let mockContext: CommandContext;

View file

@ -12,7 +12,7 @@ import {
type SlashCommandActionReturn, type SlashCommandActionReturn,
CommandKind, CommandKind,
} from './types.js'; } from './types.js';
import { Config } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
async function restoreAction( async function restoreAction(
context: CommandContext, context: CommandContext,

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandKind, OpenDialogActionReturn, SlashCommand } from './types.js'; import type { OpenDialogActionReturn, SlashCommand } from './types.js';
import { CommandKind } from './types.js';
export const settingsCommand: SlashCommand = { export const settingsCommand: SlashCommand = {
name: 'settings', name: 'settings',

View file

@ -15,7 +15,7 @@ import {
updateGitignore, updateGitignore,
GITHUB_WORKFLOW_PATHS, GITHUB_WORKFLOW_PATHS,
} from './setupGithubCommand.js'; } from './setupGithubCommand.js';
import { CommandContext, ToolActionReturn } from './types.js'; import type { CommandContext, ToolActionReturn } from './types.js';
import * as commandUtils from '../utils/commandUtils.js'; import * as commandUtils from '../utils/commandUtils.js';
vi.mock('child_process'); vi.mock('child_process');

View file

@ -9,7 +9,7 @@ import * as fs from 'node:fs';
import { Writable } from 'node:stream'; import { Writable } from 'node:stream';
import { ProxyAgent } from 'undici'; import { ProxyAgent } from 'undici';
import { CommandContext } from '../../ui/commands/types.js'; import type { CommandContext } from '../../ui/commands/types.js';
import { import {
getGitRepoRoot, getGitRepoRoot,
getLatestGitHubRelease, getLatestGitHubRelease,
@ -17,11 +17,8 @@ import {
getGitHubRepoInfo, getGitHubRepoInfo,
} from '../../utils/gitUtils.js'; } from '../../utils/gitUtils.js';
import { import type { SlashCommand, SlashCommandActionReturn } from './types.js';
CommandKind, import { CommandKind } from './types.js';
SlashCommand,
SlashCommandActionReturn,
} from './types.js';
import { getUrlOpenCommand } from '../../ui/utils/commandUtils.js'; import { getUrlOpenCommand } from '../../ui/utils/commandUtils.js';
export const GITHUB_WORKFLOW_PATHS = [ export const GITHUB_WORKFLOW_PATHS = [

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { MessageType, HistoryItemStats } from '../types.js'; import type { HistoryItemStats } from '../types.js';
import { MessageType } from '../types.js';
import { formatDuration } from '../utils/formatters.js'; import { formatDuration } from '../utils/formatters.js';
import { import {
type CommandContext, type CommandContext,

View file

@ -7,7 +7,7 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'; import { describe, it, expect, vi, beforeEach } from 'vitest';
import { terminalSetupCommand } from './terminalSetupCommand.js'; import { terminalSetupCommand } from './terminalSetupCommand.js';
import * as terminalSetupModule from '../utils/terminalSetup.js'; import * as terminalSetupModule from '../utils/terminalSetup.js';
import { CommandContext } from './types.js'; import type { CommandContext } from './types.js';
vi.mock('../utils/terminalSetup.js'); vi.mock('../utils/terminalSetup.js');

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { MessageActionReturn, SlashCommand, CommandKind } from './types.js'; import type { MessageActionReturn, SlashCommand } from './types.js';
import { CommandKind } from './types.js';
import { terminalSetup } from '../utils/terminalSetup.js'; import { terminalSetup } from '../utils/terminalSetup.js';
/** /**

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandKind, OpenDialogActionReturn, SlashCommand } from './types.js'; import type { OpenDialogActionReturn, SlashCommand } from './types.js';
import { CommandKind } from './types.js';
export const themeCommand: SlashCommand = { export const themeCommand: SlashCommand = {
name: 'theme', name: 'theme',

View file

@ -4,11 +4,12 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { describe, it, expect, vi } from 'vitest'; import type { vi } from 'vitest';
import { describe, it, expect } from 'vitest';
import { toolsCommand } from './toolsCommand.js'; import { toolsCommand } from './toolsCommand.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
import { MessageType } from '../types.js'; import { MessageType } from '../types.js';
import { Tool } from '@google/gemini-cli-core'; import type { Tool } from '@google/gemini-cli-core';
// Mock tools for testing // Mock tools for testing
const mockTools = [ const mockTools = [

View file

@ -5,13 +5,12 @@
*/ */
import { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { Content } from '@google/genai'; import type { Content } from '@google/genai';
import { HistoryItemWithoutId } from '../types.js'; import type { HistoryItemWithoutId, HistoryItem } from '../types.js';
import { Config, GitService, Logger } from '@google/gemini-cli-core'; import type { Config, GitService, Logger } from '@google/gemini-cli-core';
import { LoadedSettings } from '../../config/settings.js'; import type { LoadedSettings } from '../../config/settings.js';
import { UseHistoryManagerReturn } from '../hooks/useHistoryManager.js'; import type { UseHistoryManagerReturn } from '../hooks/useHistoryManager.js';
import type { HistoryItem } from '../types.js'; import type { SessionStatsState } from '../contexts/SessionContext.js';
import { SessionStatsState } from '../contexts/SessionContext.js';
// Grouped dependencies for clarity and easier mocking // Grouped dependencies for clarity and easier mocking
export interface CommandContext { export interface CommandContext {

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { CommandKind, SlashCommand } from './types.js'; import type { SlashCommand } from './types.js';
import { CommandKind } from './types.js';
export const vimCommand: SlashCommand = { export const vimCommand: SlashCommand = {
name: 'vim', name: 'vim',

View file

@ -4,11 +4,11 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js'; import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
import { UserTierId } from '@google/gemini-cli-core'; import type { UserTierId } from '@google/gemini-cli-core';
import { getLicenseDisplay } from '../../utils/license.js'; import { getLicenseDisplay } from '../../utils/license.js';
interface AboutBoxProps { interface AboutBoxProps {

View file

@ -4,11 +4,13 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React, { useState } from 'react'; import type React from 'react';
import { useState } from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
import { LoadedSettings, SettingScope } from '../../config/settings.js'; import type { LoadedSettings } from '../../config/settings.js';
import { SettingScope } from '../../config/settings.js';
import { AuthType } from '@google/gemini-cli-core'; import { AuthType } from '@google/gemini-cli-core';
import { validateAuthMethod } from '../../config/auth.js'; import { validateAuthMethod } from '../../config/auth.js';
import { useKeypress } from '../hooks/useKeypress.js'; import { useKeypress } from '../hooks/useKeypress.js';

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React, { useState, useEffect } from 'react'; import type React from 'react';
import { useState, useEffect } from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import Spinner from 'ink-spinner'; import Spinner from 'ink-spinner';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { ApprovalMode } from '@google/gemini-cli-core'; import { ApprovalMode } from '@google/gemini-cli-core';

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { render } from 'ink-testing-library'; import { render } from 'ink-testing-library';
import { describe, it, expect, vi } from 'vitest'; import { describe, it, expect, vi } from 'vitest';
import { ContextSummaryDisplay } from './ContextSummaryDisplay.js'; import { ContextSummaryDisplay } from './ContextSummaryDisplay.js';

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { type IdeContext, type MCPServerConfig } from '@google/gemini-cli-core'; import { type IdeContext, type MCPServerConfig } from '@google/gemini-cli-core';

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { ConsoleMessageItem } from '../types.js'; import type { ConsoleMessageItem } from '../types.js';
import { MaxSizedBox } from './shared/MaxSizedBox.js'; import { MaxSizedBox } from './shared/MaxSizedBox.js';
interface DetailedMessagesDisplayProps { interface DetailedMessagesDisplayProps {

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React, { useState } from 'react'; import type React from 'react';
import { useState } from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { import {
@ -13,8 +14,10 @@ import {
type EditorDisplay, type EditorDisplay,
} from '../editors/editorSettingsManager.js'; } from '../editors/editorSettingsManager.js';
import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
import { LoadedSettings, SettingScope } from '../../config/settings.js'; import type { LoadedSettings } from '../../config/settings.js';
import { EditorType, isEditorAvailable } from '@google/gemini-cli-core'; import { SettingScope } from '../../config/settings.js';
import type { EditorType } from '@google/gemini-cli-core';
import { isEditorAvailable } from '@google/gemini-cli-core';
import { useKeypress } from '../hooks/useKeypress.js'; import { useKeypress } from '../hooks/useKeypress.js';
interface EditorDialogProps { interface EditorDialogProps {

View file

@ -5,12 +5,10 @@
*/ */
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import React from 'react'; import type React from 'react';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { import type { RadioSelectItem } from './shared/RadioButtonSelect.js';
RadioButtonSelect, import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
RadioSelectItem,
} from './shared/RadioButtonSelect.js';
import { useKeypress } from '../hooks/useKeypress.js'; import { useKeypress } from '../hooks/useKeypress.js';
import * as process from 'node:process'; import * as process from 'node:process';

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { theme } from '../semantic-colors.js'; import { theme } from '../semantic-colors.js';
import { shortenPath, tildeifyPath } from '@google/gemini-cli-core'; import { shortenPath, tildeifyPath } from '@google/gemini-cli-core';

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Text } from 'ink'; import { Text } from 'ink';
import Spinner from 'ink-spinner'; import Spinner from 'ink-spinner';
import type { SpinnerName } from 'cli-spinners'; import type { SpinnerName } from 'cli-spinners';

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import Gradient from 'ink-gradient'; import Gradient from 'ink-gradient';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { SlashCommand } from '../commands/types.js'; import type { SlashCommand } from '../commands/types.js';
interface Help { interface Help {
commands: readonly SlashCommand[]; commands: readonly SlashCommand[];

View file

@ -7,7 +7,8 @@
import { render } from 'ink-testing-library'; import { render } from 'ink-testing-library';
import { describe, it, expect, vi } from 'vitest'; import { describe, it, expect, vi } from 'vitest';
import { HistoryItemDisplay } from './HistoryItemDisplay.js'; import { HistoryItemDisplay } from './HistoryItemDisplay.js';
import { HistoryItem, MessageType } from '../types.js'; import type { HistoryItem } from '../types.js';
import { MessageType } from '../types.js';
import { SessionStatsProvider } from '../contexts/SessionContext.js'; import { SessionStatsProvider } from '../contexts/SessionContext.js';
// Mock child components // Mock child components

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import type { HistoryItem } from '../types.js'; import type { HistoryItem } from '../types.js';
import { UserMessage } from './messages/UserMessage.js'; import { UserMessage } from './messages/UserMessage.js';
import { UserShellMessage } from './messages/UserShellMessage.js'; import { UserShellMessage } from './messages/UserShellMessage.js';
@ -20,9 +20,9 @@ import { StatsDisplay } from './StatsDisplay.js';
import { ModelStatsDisplay } from './ModelStatsDisplay.js'; import { ModelStatsDisplay } from './ModelStatsDisplay.js';
import { ToolStatsDisplay } from './ToolStatsDisplay.js'; import { ToolStatsDisplay } from './ToolStatsDisplay.js';
import { SessionSummaryDisplay } from './SessionSummaryDisplay.js'; import { SessionSummaryDisplay } from './SessionSummaryDisplay.js';
import { Config } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
import { Help } from './Help.js'; import { Help } from './Help.js';
import { SlashCommand } from '../commands/types.js'; import type { SlashCommand } from '../commands/types.js';
interface HistoryItemDisplayProps { interface HistoryItemDisplayProps {
item: HistoryItem; item: HistoryItem;

View file

@ -6,28 +6,20 @@
import { renderWithProviders } from '../../test-utils/render.js'; import { renderWithProviders } from '../../test-utils/render.js';
import { waitFor } from '@testing-library/react'; import { waitFor } from '@testing-library/react';
import { InputPrompt, InputPromptProps } from './InputPrompt.js'; import type { InputPromptProps } from './InputPrompt.js';
import { InputPrompt } from './InputPrompt.js';
import type { TextBuffer } from './shared/text-buffer.js'; import type { TextBuffer } from './shared/text-buffer.js';
import { Config } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
import * as path from 'node:path'; import * as path from 'node:path';
import { import type { CommandContext, SlashCommand } from '../commands/types.js';
CommandContext, import { CommandKind } from '../commands/types.js';
SlashCommand,
CommandKind,
} from '../commands/types.js';
import { describe, it, expect, beforeEach, vi } from 'vitest'; import { describe, it, expect, beforeEach, vi } from 'vitest';
import { import type { UseShellHistoryReturn } from '../hooks/useShellHistory.js';
useShellHistory, import { useShellHistory } from '../hooks/useShellHistory.js';
UseShellHistoryReturn, import type { UseCommandCompletionReturn } from '../hooks/useCommandCompletion.js';
} from '../hooks/useShellHistory.js'; import { useCommandCompletion } from '../hooks/useCommandCompletion.js';
import { import type { UseInputHistoryReturn } from '../hooks/useInputHistory.js';
useCommandCompletion, import { useInputHistory } from '../hooks/useInputHistory.js';
UseCommandCompletionReturn,
} from '../hooks/useCommandCompletion.js';
import {
useInputHistory,
UseInputHistoryReturn,
} from '../hooks/useInputHistory.js';
import * as clipboardUtils from '../utils/clipboardUtils.js'; import * as clipboardUtils from '../utils/clipboardUtils.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';

View file

@ -4,22 +4,25 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React, { useCallback, useEffect, useState, useRef } from 'react'; import type React from 'react';
import { useCallback, useEffect, useState, useRef } from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { theme } from '../semantic-colors.js'; import { theme } from '../semantic-colors.js';
import { SuggestionsDisplay } from './SuggestionsDisplay.js'; import { SuggestionsDisplay } from './SuggestionsDisplay.js';
import { useInputHistory } from '../hooks/useInputHistory.js'; import { useInputHistory } from '../hooks/useInputHistory.js';
import { TextBuffer, logicalPosToOffset } from './shared/text-buffer.js'; import type { TextBuffer } from './shared/text-buffer.js';
import { logicalPosToOffset } from './shared/text-buffer.js';
import { cpSlice, cpLen, toCodePoints } from '../utils/textUtils.js'; import { cpSlice, cpLen, toCodePoints } from '../utils/textUtils.js';
import chalk from 'chalk'; import chalk from 'chalk';
import stringWidth from 'string-width'; import stringWidth from 'string-width';
import { useShellHistory } from '../hooks/useShellHistory.js'; import { useShellHistory } from '../hooks/useShellHistory.js';
import { useReverseSearchCompletion } from '../hooks/useReverseSearchCompletion.js'; import { useReverseSearchCompletion } from '../hooks/useReverseSearchCompletion.js';
import { useCommandCompletion } from '../hooks/useCommandCompletion.js'; import { useCommandCompletion } from '../hooks/useCommandCompletion.js';
import { useKeypress, Key } from '../hooks/useKeypress.js'; import type { Key } from '../hooks/useKeypress.js';
import { useKeypress } from '../hooks/useKeypress.js';
import { keyMatchers, Command } from '../keyMatchers.js'; import { keyMatchers, Command } from '../keyMatchers.js';
import { CommandContext, SlashCommand } from '../commands/types.js'; import type { CommandContext, SlashCommand } from '../commands/types.js';
import { Config } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-core';
import { import {
clipboardHasImage, clipboardHasImage,
saveClipboardImage, saveClipboardImage,

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { ThoughtSummary } from '@google/gemini-cli-core'; import type { ThoughtSummary } from '@google/gemini-cli-core';
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { useStreamingContext } from '../contexts/StreamingContext.js'; import { useStreamingContext } from '../contexts/StreamingContext.js';

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React, { useEffect, useState } from 'react'; import type React from 'react';
import { useEffect, useState } from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import process from 'node:process'; import process from 'node:process';

View file

@ -8,7 +8,7 @@ import { render } from 'ink-testing-library';
import { describe, it, expect, vi, beforeAll, afterAll } from 'vitest'; import { describe, it, expect, vi, beforeAll, afterAll } from 'vitest';
import { ModelStatsDisplay } from './ModelStatsDisplay.js'; import { ModelStatsDisplay } from './ModelStatsDisplay.js';
import * as SessionContext from '../contexts/SessionContext.js'; import * as SessionContext from '../contexts/SessionContext.js';
import { SessionMetrics } from '../contexts/SessionContext.js'; import type { SessionMetrics } from '../contexts/SessionContext.js';
// Mock the context to provide controlled data for testing // Mock the context to provide controlled data for testing
vi.mock('../contexts/SessionContext.js', async (importOriginal) => { vi.mock('../contexts/SessionContext.js', async (importOriginal) => {

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { formatDuration } from '../utils/formatters.js'; import { formatDuration } from '../utils/formatters.js';
@ -13,7 +13,8 @@ import {
calculateCacheHitRate, calculateCacheHitRate,
calculateErrorRate, calculateErrorRate,
} from '../utils/computeStats.js'; } from '../utils/computeStats.js';
import { useSessionStats, ModelMetrics } from '../contexts/SessionContext.js'; import type { ModelMetrics } from '../contexts/SessionContext.js';
import { useSessionStats } from '../contexts/SessionContext.js';
const METRIC_COL_WIDTH = 28; const METRIC_COL_WIDTH = 28;
const MODEL_COL_WIDTH = 22; const MODEL_COL_WIDTH = 22;

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import React from 'react'; import type React from 'react';
import { Text } from 'ink'; import { Text } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';

View file

@ -8,7 +8,7 @@ import { render } from 'ink-testing-library';
import { describe, it, expect, vi } from 'vitest'; import { describe, it, expect, vi } from 'vitest';
import { SessionSummaryDisplay } from './SessionSummaryDisplay.js'; import { SessionSummaryDisplay } from './SessionSummaryDisplay.js';
import * as SessionContext from '../contexts/SessionContext.js'; import * as SessionContext from '../contexts/SessionContext.js';
import { SessionMetrics } from '../contexts/SessionContext.js'; import type { SessionMetrics } from '../contexts/SessionContext.js';
vi.mock('../contexts/SessionContext.js', async (importOriginal) => { vi.mock('../contexts/SessionContext.js', async (importOriginal) => {
const actual = await importOriginal<typeof SessionContext>(); const actual = await importOriginal<typeof SessionContext>();

Some files were not shown because too many files have changed in this diff Show more