Skip to content

fix: merge duplicate imports in packages/core (3/4)#20928

Merged
scidomino merged 15 commits intogoogle-gemini:mainfrom
Nixxx19:nityam/core-duplicate-fix
Mar 4, 2026
Merged

fix: merge duplicate imports in packages/core (3/4)#20928
scidomino merged 15 commits intogoogle-gemini:mainfrom
Nixxx19:nityam/core-duplicate-fix

Conversation

@Nixxx19
Copy link
Copy Markdown
Contributor

@Nixxx19 Nixxx19 commented Mar 3, 2026

Summary

  • Merged duplicate import statements across 141 files in packages/core
  • Combined type and value imports from the same module using inline type syntax
  • Fixed import ordering to comply with import/no-duplicates ESLint rule

Changes

  • Used ESLint's --fix with import/no-duplicates rule to automatically merge most duplicates
  • Manually fixed edge cases where ESLint's autofix created malformed imports
  • Ensured proper separation of value imports and type imports
  • Fixed getFolderStructure.test.ts to use correct namespace import references

Testing

  • ✅ All 265 test suites pass (4998 tests)
  • ✅ TypeScript compilation successful
  • ✅ ESLint passes with only 2 pre-existing warnings (unrelated to this PR)
  • ✅ No breaking changes

Stats

  • 143 files changed

Related

Fixes #19753 - PR 3 of 4 (packages/core)

Previous PRs:

@Nixxx19 Nixxx19 requested a review from a team as a code owner March 3, 2026 07:01
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

You already have 7 pull requests open. Please work on getting existing PRs merged before opening more.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request systematically refactors import statements across 141 files within the packages/core directory. The primary goal was to eliminate duplicate import statements and enforce a consistent import style by utilizing TypeScript's inline type keyword for type-only imports. This change improves code readability, reduces redundancy, and ensures compliance with ESLint's import/no-duplicates rule, contributing to a cleaner and more maintainable codebase.

Highlights

  • Consolidated Type Imports: Merged import type statements into existing value import statements from the same module using TypeScript's inline type keyword across 141 files.
  • ESLint Compliance: Addressed import/no-duplicates ESLint rule violations by consolidating imports, improving code consistency and maintainability.
  • Refactored Import Ordering: Ensured proper separation of value and type imports and fixed ordering to comply with ESLint rules.
Changelog
  • packages/core/src/agents/a2a-client-manager.test.ts
    • Consolidated type imports for AuthenticationHandler and Client by moving them inline with value imports from @a2a-js/sdk/client.
  • packages/core/src/agents/agentLoader.test.ts
    • Consolidated type import for LocalAgentDefinition by moving it inline with value imports from ./types.js.
  • packages/core/src/agents/local-executor.test.ts
    • Consolidated multiple type imports (AgentInputs, LocalAgentDefinition, SubagentActivityEvent, OutputConfig) by moving them inline with value imports from ./types.js.
    • Consolidated type import for AgentRegistry by moving it inline with value imports from ./registry.js.
  • packages/core/src/agents/local-executor.ts
    • Consolidated multiple type imports (Content, Part, FunctionCall, FunctionDeclaration, Schema) by moving them inline with value imports from @google/genai.
    • Consolidated multiple type imports (LocalAgentDefinition, AgentInputs, OutputObject, SubagentActivityEvent) by moving them inline with value imports from ./types.js.
  • packages/core/src/agents/local-invocation.test.ts
    • Consolidated multiple type imports (LocalAgentDefinition, SubagentActivityEvent, AgentInputs, SubagentProgress) by moving them inline with value imports from ./types.js.
  • packages/core/src/agents/remote-invocation.ts
    • Consolidated multiple type imports (ToolConfirmationOutcome, ToolResult, ToolCallConfirmationDetails) by moving them inline with value imports from ../tools/tools.js.
    • Consolidated multiple type imports (RemoteAgentInputs, RemoteAgentDefinition, AgentInputs) by moving them inline with value imports from ./types.js.
    • Consolidated type import for SendMessageResult by moving it inline with value imports from ./a2a-client-manager.js.
  • packages/core/src/agents/subagent-tool.test.ts
    • Consolidated multiple type imports (DeclarativeTool, ToolCallConfirmationDetails, ToolInvocation, ToolResult) by moving them inline with value imports from ../tools/tools.js.
    • Removed duplicate type import statements for DeclarativeTool, ToolCallConfirmationDetails, ToolInvocation, ToolResult.
  • packages/core/src/code_assist/codeAssist.ts
    • Consolidated type import for ContentGenerator by moving it inline with value imports from ../core/contentGenerator.js.
    • Consolidated type import for HttpOptions by moving it inline with value imports from ./server.js.
  • packages/core/src/code_assist/converter.test.ts
    • Consolidated multiple type imports (CaGenerateContentResponse, ContentListUnion, GenerateContentParameters, Part) by moving them inline with value imports from ./converter.js and @google/genai.
  • packages/core/src/code_assist/converter.ts
    • Consolidated numerous type imports from @google/genai by moving them inline with the GenerateContentResponse import.
  • packages/core/src/code_assist/oauth2.test.ts
    • Consolidated multiple type imports (Credentials, Mock) by moving them inline with value imports from google-auth-library and vitest.
    • Removed duplicate import statement for OAuth2Client, Compute, GoogleAuth.
  • packages/core/src/code_assist/oauth2.ts
    • Consolidated multiple type imports (Credentials, AuthClient, JWTInput) by moving them inline with value imports from google-auth-library.
  • packages/core/src/code_assist/server.ts
    • Consolidated numerous type imports from ./types.js by moving them inline with the UserTierId import.
    • Consolidated multiple type imports (CaCountTokenResponse, CaGenerateContentResponse) by moving them inline with value imports from ./converter.js.
  • packages/core/src/code_assist/setup.test.ts
    • Consolidated type import for GeminiUserTier by moving it inline with value imports from ./types.js.
  • packages/core/src/code_assist/setup.ts
    • Consolidated numerous type imports from ./types.js by moving them inline with the UserTierId import.
    • Consolidated type import for HttpOptions by moving it inline with value imports from ./server.js.
  • packages/core/src/config/config.test.ts
    • Consolidated multiple type imports (Mock, ConfigParameters, SandboxConfig) by moving them inline with value imports from vitest and ./config.js.
    • Consolidated multiple type imports (ContentGeneratorConfig, ContentGenerator) by moving them inline with value imports from ../core/contentGenerator.js.
    • Consolidated type import for HookDefinition by moving it inline with value imports from ../hooks/types.js.
  • packages/core/src/config/config.ts
    • Consolidated multiple type imports (ContentGenerator, ContentGeneratorConfig) by moving them inline with value imports from ../core/contentGenerator.js.
    • Consolidated type import for TelemetryTarget by moving it inline with value imports from ../telemetry/index.js.
    • Consolidated type import for FileSystemService by moving it inline with value imports from ../services/fileSystemService.js.
    • Consolidated multiple type imports (ModelConfig, ModelConfigServiceConfig) by moving them inline with value imports from ../services/modelConfigService.js.
    • Consolidated type import for Experiments by moving it inline with value imports from ../code_assist/experiments/experiments.js.
    • Consolidated type import for FileFilteringOptions by moving it inline with value imports from ./constants.js.
  • packages/core/src/core/baseLlmClient.test.ts
    • Consolidated multiple type imports (GenerateContentOptions, GenerateJsonOptions) by moving them inline with value imports from ./baseLlmClient.js.
    • Consolidated type import for ContentGenerator by moving it inline with value imports from ./contentGenerator.js.
  • packages/core/src/core/client.ts
    • Consolidated multiple type imports (GenerateContentConfig, PartListUnion, Content, Tool, GenerateContentResponse) by moving them inline with value imports from @google/genai.
    • Consolidated multiple type imports (ServerGeminiStreamEvent, ChatCompressionInfo) by moving them inline with value imports from ./turn.js.
    • Consolidated type import for RetryAvailabilityContext by moving it inline with value imports from ../utils/retry.js.
    • Consolidated type import for LlmRole by moving it inline with value imports from ../telemetry/types.js.
    • Removed duplicate type import statements for RetryAvailabilityContext and LlmRole.
  • packages/core/src/core/contentGenerator.test.ts
    • Consolidated type import for ContentGenerator by moving it inline with value imports from ./contentGenerator.js.
  • packages/core/src/core/contentGenerator.ts
    • Consolidated multiple type imports (CountTokensResponse, GenerateContentResponse, GenerateContentParameters, CountTokensParameters, EmbedContentResponse, EmbedContentParameters) by moving them inline with value imports from @google/genai.
  • packages/core/src/core/coreToolScheduler.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
  • packages/core/src/core/coreToolScheduler.ts
    • Consolidated type import for ToolConfirmationRequest by moving it inline with value imports from ../confirmation-bus/types.js.
    • Consolidated value import for CoreToolCallStatus by moving it inline as a type import within an existing import from ./types.js.
  • packages/core/src/core/geminiChat.test.ts
    • Consolidated multiple type imports (Content, GenerateContentResponse) by moving them inline with value imports from @google/genai.
  • packages/core/src/core/geminiChat.ts
    • Consolidated multiple type imports (GenerateContentResponse, Content, Part, Tool, PartListUnion, GenerateContentConfig, GenerateContentParameters) by moving them inline with value imports from @google/genai.
    • Consolidated type import for LlmRole by moving it inline with value imports from ../telemetry/types.js.
    • Removed duplicate type import statement for LlmRole.
  • packages/core/src/core/geminiChat_network_retry.test.ts
    • Consolidated type import for GenerateContentResponse by moving it inline with value imports from @google/genai.
  • packages/core/src/core/localLiteRtLmClient.ts
    • Consolidated type import for Content by moving it inline with value imports from @google/genai.
  • packages/core/src/core/logger.test.ts
    • Consolidated type import for LogEntry by moving it inline with value imports from ./logger.js.
  • packages/core/src/core/loggingContentGenerator.ts
    • Consolidated multiple type imports (ServerDetails, ContextBreakdown) by moving them inline with value imports from ../telemetry/types.js.
  • packages/core/src/core/turn.test.ts
    • Consolidated multiple type imports (ServerGeminiToolCallRequestEvent, ServerGeminiErrorEvent) by moving them inline with value imports from ./turn.js.
    • Consolidated type import for GeminiChat by moving it inline with value imports from ./geminiChat.js.
  • packages/core/src/core/turn.ts
    • Consolidated multiple type imports (PartListUnion, GenerateContentResponse, FunctionCall, FunctionDeclaration, FinishReason, GenerateContentResponseUsageMetadata) by moving them inline with value imports from @google/genai.
    • Consolidated type import for GeminiChat by moving it inline with value imports from ./geminiChat.js.
  • packages/core/src/hooks/hookAggregator.test.ts
    • Consolidated multiple type imports (HookExecutionResult, BeforeToolSelectionOutput, BeforeModelOutput, HookOutput) by moving them inline with value imports from ./types.js.
  • packages/core/src/hooks/hookAggregator.ts
    • Consolidated multiple type imports (HookOutput, HookExecutionResult, BeforeToolSelectionOutput) by moving them inline with value imports from ./types.js.
  • packages/core/src/hooks/hookEventHandler.test.ts
    • Consolidated multiple type imports (HookConfig, HookExecutionResult) by moving them inline with value imports from ./types.js.
  • packages/core/src/hooks/hookEventHandler.ts
    • Consolidated numerous type imports from ./types.js by moving them inline with the HookEventName import.
  • packages/core/src/hooks/hookPlanner.ts
    • Consolidated multiple type imports (HookExecutionPlan, HookEventName) by moving them inline with value imports from ./types.js.
  • packages/core/src/hooks/hookRegistry.ts
    • Consolidated multiple type imports (HookDefinition, HookConfig) by moving them inline with value imports from ./types.js.
  • packages/core/src/hooks/hookRunner.test.ts
    • Consolidated multiple type imports (HookConfig, HookInput) by moving them inline with value imports from ./types.js.
  • packages/core/src/hooks/hookRunner.ts
    • Consolidated multiple type imports (HookEventName, ConfigSource, HookType) by moving them inline with value imports from ./types.js.
  • packages/core/src/hooks/hookSystem.test.ts
    • Consolidated type import for ChildProcessWithoutNullStreams by moving it inline with value imports from node:child_process.
  • packages/core/src/hooks/hookSystem.ts
    • Consolidated numerous type imports from ./types.js by moving them inline with the NotificationType import.
    • Consolidated type import for HookRegistryEntry by moving it inline with value imports from ./hookRegistry.js.
    • Consolidated type import for AggregatedHookResult by moving it inline with value imports from ./hookAggregator.js.
  • packages/core/src/hooks/types.test.ts
    • Consolidated type import for HookDecision by moving it inline with value imports from ./types.js.
    • Consolidated multiple type imports (LLMRequest, LLMResponse) by moving them inline with value imports from ./hookTranslator.js.
  • packages/core/src/hooks/types.ts
    • Consolidated multiple type imports (LLMRequest, LLMResponse, HookToolConfig) by moving them inline with value imports from ./hookTranslator.js.
  • packages/core/src/mcp/google-auth-provider.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
  • packages/core/src/mcp/oauth-provider.test.ts
    • Consolidated multiple type imports (MCPOAuthConfig, OAuthTokenResponse, OAuthClientRegistrationResponse) by moving them inline with value imports from ./oauth-provider.js.
  • packages/core/src/mcp/oauth-utils.test.ts
    • Consolidated multiple type imports (OAuthAuthorizationServerMetadata, OAuthProtectedResourceMetadata) by moving them inline with value imports from ./oauth-utils.js.
  • packages/core/src/mcp/token-storage/hybrid-token-storage.ts
    • Consolidated multiple type imports (TokenStorage, OAuthCredentials) by moving them inline with value imports from ./types.js.
  • packages/core/src/output/stream-json-formatter.test.ts
    • Consolidated multiple type imports (InitEvent, MessageEvent, ToolUseEvent, ToolResultEvent, ErrorEvent, ResultEvent) by moving them inline with value imports from ./types.js.
  • packages/core/src/policy/config.test.ts
    • Consolidated type import for PolicySettings by moving it inline with value imports from ./types.js.
  • packages/core/src/policy/toml-loader.test.ts
    • Consolidated type import for PolicyLoadResult by moving it inline with value imports from ./toml-loader.js.
  • packages/core/src/routing/strategies/gemmaClassifierStrategy.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
  • packages/core/src/safety/built-in.test.ts
    • Consolidated type import for SafetyCheckInput by moving it inline with value imports from ./protocol.js.
  • packages/core/src/safety/built-in.ts
    • Consolidated multiple type imports (SafetyCheckInput, SafetyCheckResult) by moving them inline with value imports from ./protocol.js.
  • packages/core/src/safety/checker-runner.test.ts
    • Consolidated type import for SafetyCheckResult by moving it inline with value imports from ./protocol.js.
  • packages/core/src/safety/checker-runner.ts
    • Consolidated multiple type imports (SafetyCheckInput, SafetyCheckResult) by moving them inline with value imports from ./protocol.js.
  • packages/core/src/safety/conseca/conseca.test.ts
    • Consolidated type import for SafetyCheckInput by moving it inline with value imports from ../protocol.js.
  • packages/core/src/safety/conseca/conseca.ts
    • Consolidated multiple type imports (SafetyCheckInput, SafetyCheckResult) by moving them inline with value imports from ../protocol.js.
  • packages/core/src/scheduler/confirmation.test.ts
    • Consolidated multiple type imports (ValidatingToolCall, WaitingToolCall) by moving them inline with value imports from ./types.js.
  • packages/core/src/scheduler/policy.test.ts
    • Consolidated multiple type imports (ValidatingToolCall, ToolCallRequestInfo, CompletedToolCall) by moving them inline with value imports from ./types.js.
  • packages/core/src/scheduler/scheduler.test.ts
    • Consolidated value imports for CoreToolCallStatus and ROOT_SCHEDULER_ID by moving them inline as type imports within an existing import from ./types.js.
  • packages/core/src/scheduler/scheduler.ts
    • Consolidated type import for ApprovalMode by moving it inline with value imports from ../policy/types.js.
  • packages/core/src/scheduler/scheduler_parallel.test.ts
    • Consolidated multiple type imports (ToolCallRequestInfo, CompletedToolCall, SuccessfulToolCall, Status, ToolCall) by moving them inline with value imports from ./types.js.
  • packages/core/src/scheduler/state-manager.test.ts
    • Consolidated value imports for CoreToolCallStatus and ROOT_SCHEDULER_ID by moving them inline as type imports within an existing import from ./types.js.
  • packages/core/src/scheduler/state-manager.ts
    • Consolidated value imports for CoreToolCallStatus and ROOT_SCHEDULER_ID by moving them inline as type imports within an existing import from ./types.js.
  • packages/core/src/scheduler/tool-executor.test.ts
    • Consolidated type import for ScheduledToolCall by moving it inline with value imports from ./types.js.
  • packages/core/src/scheduler/tool-executor.ts
    • Consolidated multiple type imports (ToolCallRequestInfo, ToolCallResponseInfo, ToolResult, Config, ToolResultDisplay, ToolLiveOutput) by moving them inline with value imports from ../index.js.
    • Consolidated multiple type imports (CompletedToolCall, ToolCall, ExecutingToolCall, ErroredToolCall, SuccessfulToolCall, CancelledToolCall) by moving them inline with value imports from ./types.js.
  • packages/core/src/scheduler/tool-modifier.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
    • Consolidated multiple type imports (WaitingToolCall, ToolCallRequestInfo) by moving them inline with value imports from ./types.js.
  • packages/core/src/services/chatCompressionService.test.ts
    • Refactored import of TOOL_OUTPUTS_DIR to use destructuring from fileUtils.
  • packages/core/src/services/chatRecordingService.test.ts
    • Consolidated multiple type imports (ConversationRecord, ToolCallRecord, MessageRecord) by moving them inline with value imports from ./chatRecordingService.js.
  • packages/core/src/services/fileDiscoveryService.ts
    • Consolidated multiple type imports (GitIgnoreFilter, IgnoreFileFilter) by moving them inline with value imports from ../utils/gitIgnoreParser.js and ../utils/ignoreFileParser.js.
  • packages/core/src/services/gitService.ts
    • Consolidated type import for SimpleGit by moving it inline with value imports from simple-git.
  • packages/core/src/services/loopDetectionService.test.ts
    • Consolidated multiple type imports (ServerGeminiContentEvent, ServerGeminiStreamEvent, ServerGeminiToolCallRequestEvent) by moving them inline with value imports from ../core/turn.js.
  • packages/core/src/services/loopDetectionService.ts
    • Consolidated type import for ServerGeminiStreamEvent by moving it inline with value imports from ../core/turn.js.
  • packages/core/src/services/modelConfig.integration.test.ts
    • Consolidated type import for ModelConfigServiceConfig by moving it inline with value imports from ./modelConfigService.js.
  • packages/core/src/services/modelConfigService.test.ts
    • Consolidated multiple type imports (ModelConfigAlias, ModelConfigServiceConfig) by moving them inline with value imports from ./modelConfigService.js.
  • packages/core/src/services/shellExecutionService.test.ts
    • Consolidated multiple type imports (ShellOutputEvent, ShellExecutionConfig) by moving them inline with value imports from ./shellExecutionService.js.
  • packages/core/src/services/shellExecutionService.ts
    • Consolidated type import for PtyImplementation by moving it inline with value imports from ../utils/getPty.js.
  • packages/core/src/telemetry/activity-monitor.test.ts
    • Consolidated type import for ActivityEvent by moving it inline with value imports from ./activity-monitor.js.
  • packages/core/src/telemetry/clearcut-logger/clearcut-logger.test.ts
    • Consolidated multiple type imports (LogEvent, LogEventEntry) by moving them inline with value imports from ./clearcut-logger.js.
    • Consolidated type import for ContentGeneratorConfig by moving it inline with value imports from ../../core/contentGenerator.js.
    • Consolidated type import for Systeminformation by moving it inline with value imports from systeminformation.
  • packages/core/src/telemetry/conseca-logger.ts
    • Consolidated type import for LogRecord by moving it inline with value imports from @opentelemetry/api-logs.
  • packages/core/src/telemetry/file-exporters.test.ts
    • Consolidated type import for ResourceMetrics by moving it inline with value imports from @opentelemetry/sdk-metrics.
  • packages/core/src/telemetry/file-exporters.ts
    • Consolidated type import for ExportResult by moving it inline with value imports from @opentelemetry/core.
    • Consolidated multiple type imports (ResourceMetrics, PushMetricExporter) by moving them inline with value imports from @opentelemetry/sdk-metrics.
  • packages/core/src/telemetry/gcp-exporters.ts
    • Consolidated type import for Log by moving it inline with value imports from @google-cloud/logging.
    • Consolidated type import for ExportResult by moving it inline with value imports from @opentelemetry/core.
  • packages/core/src/telemetry/loggers.test.circular.ts
    • Consolidated multiple type imports (ToolCallRequestInfo, ToolCallResponseInfo) by moving them inline with value imports from ../scheduler/types.js.
  • packages/core/src/telemetry/loggers.test.ts
    • Consolidated multiple type imports (ContentGeneratorConfig, ErroredToolCall, MessageBus) by moving them inline with value imports from ../index.js.
  • packages/core/src/telemetry/loggers.ts
    • Consolidated type import for LogRecord by moving it inline with value imports from @opentelemetry/api-logs.
    • Consolidated numerous type imports from ./types.js by moving them inline with the EVENT_API_ERROR import.
    • Consolidated type import for UiEvent by moving it inline with value imports from ./uiTelemetry.js.
  • packages/core/src/telemetry/metrics.ts
    • Consolidated multiple type imports (Attributes, Meter, Counter, Histogram) by moving them inline with value imports from @opentelemetry/api.
  • packages/core/src/telemetry/semantic.ts
    • Consolidated multiple type imports (Candidate, Content, ContentUnion, Part, PartUnion) by moving them inline with value imports from @google/genai.
  • packages/core/src/telemetry/types.ts
    • Consolidated type import for OTelFinishReason by moving it inline with value imports from ./semantic.js.
  • packages/core/src/telemetry/uiTelemetry.test.ts
    • Consolidated multiple type imports (ApiErrorEvent, ApiResponseEvent) by moving them inline with value imports from ./types.js.
  • packages/core/src/telemetry/uiTelemetry.ts
    • Consolidated multiple type imports (ApiErrorEvent, ApiResponseEvent, ToolCallEvent, LlmRole) by moving them inline with value imports from ./types.js.
  • packages/core/src/test-utils/config.ts
    • Consolidated type import for ConfigParameters by moving it inline with value imports from ../config/config.js.
  • packages/core/src/test-utils/mock-tool.ts
    • Consolidated multiple type imports (ToolCallConfirmationDetails, ToolInvocation, ToolResult) by moving them inline with value imports from ../tools/tools.js.
  • packages/core/src/tools/activate-skill.ts
    • Consolidated multiple type imports (ToolResult, ToolCallConfirmationDetails, ToolInvocation, ToolConfirmationOutcome) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/glob.test.ts
    • Consolidated multiple type imports (GlobToolParams, GlobPath) by moving them inline with value imports from ./glob.js.
  • packages/core/src/tools/glob.ts
    • Consolidated multiple type imports (ToolInvocation, ToolResult) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/grep.test.ts
    • Consolidated type import for GrepToolParams by moving it inline with value imports from ./grep.js.
  • packages/core/src/tools/grep.ts
    • Consolidated multiple type imports (ToolInvocation, ToolResult) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/ls.ts
    • Consolidated multiple type imports (ToolInvocation, ToolResult) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/mcp-client.ts
    • Consolidated type import for SSEClientTransportOptions by moving it inline with value imports from @modelcontextprotocol/sdk/client/sse.js.
    • Consolidated type import for StreamableHTTPClientTransportOptions by moving it inline with value imports from @modelcontextprotocol/sdk/client/streamableHttp.js.
    • Consolidated multiple type imports (GetPromptResult, Prompt, ReadResourceResult, Resource, Tool as McpTool) by moving them inline with value imports from @modelcontextprotocol/sdk/types.js.
    • Consolidated multiple type imports (Config, MCPServerConfig, GeminiCLIExtension) by moving them inline with value imports from ../config/config.js.
  • packages/core/src/tools/mcp-tool.test.ts
    • Consolidated type import for Mocked by moving it inline with value imports from vitest.
    • Consolidated type import for ToolResult by moving it inline with value imports from ./tools.js.
  • packages/core/src/tools/mcp-tool.ts
    • Consolidated multiple type imports (ToolCallConfirmationDetails, ToolInvocation, ToolMcpConfirmationDetails, ToolResult, PolicyUpdateOptions) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/memoryTool.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
  • packages/core/src/tools/memoryTool.ts
    • Consolidated multiple type imports (ToolEditConfirmationDetails, ToolResult) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/modifiable-tool.test.ts
    • Consolidated multiple type imports (ModifyContext, ModifiableDeclarativeTool) by moving them inline with value imports from ./modifiable-tool.js.
  • packages/core/src/tools/modifiable-tool.ts
    • Consolidated type import for EditorType by moving it inline with value imports from ../utils/editor.js.
  • packages/core/src/tools/read-file.test.ts
    • Consolidated type import for ReadFileToolParams by moving it inline with value imports from ./read-file.js.
  • packages/core/src/tools/read-file.ts
    • Consolidated multiple type imports (ToolInvocation, ToolLocation, ToolResult) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/read-many-files.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
  • packages/core/src/tools/read-many-files.ts
    • Consolidated multiple type imports (ToolInvocation, ToolResult) by moving them inline with value imports from ./tools.js.
    • Consolidated type import for ProcessedFileReadResult by moving it inline with value imports from ../utils/fileUtils.js.
  • packages/core/src/tools/ripGrep.test.ts
    • Consolidated type import for RipGrepToolParams by moving it inline with value imports from ./ripGrep.js.
    • Consolidated type import for ChildProcess by moving it inline with value imports from node:child_process.
  • packages/core/src/tools/ripGrep.ts
    • Consolidated multiple type imports (ToolInvocation, ToolResult) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/shell.test.ts
    • Removed direct import of EOL from node:os and used os.EOL instead.
    • Updated fs.writeFileSync to use os.EOL for consistency.
  • packages/core/src/tools/shell.ts
    • Removed direct import of EOL from node:os and used os.EOL instead.
    • Consolidated multiple type imports (ToolInvocation, ToolResult, ToolCallConfirmationDetails, ToolExecuteConfirmationDetails, PolicyUpdateOptions, ToolLiveOutput) by moving them inline with value imports from ./tools.js.
    • Consolidated multiple type imports (ShellExecutionConfig, ShellOutputEvent) by moving them inline with value imports from ../services/shellExecutionService.js.
    • Updated pgrepContent.split to use os.EOL for consistency.
  • packages/core/src/tools/tool-registry.test.ts
    • Consolidated multiple type imports (Mocked, MockInstance) by moving them inline with value imports from vitest.
    • Consolidated type import for ConfigParameters by moving it inline with value imports from ../config/config.js.
    • Consolidated multiple type imports (FunctionDeclaration, CallableTool) by moving them inline with value imports from @google/genai.
  • packages/core/src/tools/tool-registry.ts
    • Consolidated multiple type imports (AnyDeclarativeTool, ToolResult, ToolInvocation) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/tools.test.ts
    • Consolidated multiple type imports (ToolInvocation, ToolResult) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/web-fetch.ts
    • Consolidated multiple type imports (ToolCallConfirmationDetails, ToolInvocation, ToolResult, ToolConfirmationOutcome) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/web-search.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
    • Consolidated type import for WebSearchToolParams by moving it inline with value imports from ./web-search.js.
  • packages/core/src/tools/web-search.ts
    • Consolidated multiple type imports (ToolInvocation, ToolResult) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/write-file.test.ts
    • Consolidated type import for Mocked by moving it inline with value imports from vitest.
    • Consolidated type import for WriteFileToolParams by moving it inline with value imports from ./write-file.js.
    • Consolidated multiple type imports (FileDiff, ToolEditConfirmationDetails, ToolInvocation, ToolResult) by moving them inline with value imports from ./tools.js.
    • Consolidated type import for DiffUpdateResult by moving it inline with value imports from ../ide/ide-client.js.
  • packages/core/src/tools/write-file.ts
    • Consolidated multiple type imports (FileDiff, ToolCallConfirmationDetails, ToolEditConfirmationDetails, ToolInvocation, ToolLocation, ToolResult, ToolConfirmationOutcome) by moving them inline with value imports from ./tools.js.
  • packages/core/src/tools/write-todos.ts
    • Consolidated multiple type imports (ToolInvocation, Todo, ToolResult) by moving them inline with value imports from ./tools.js.
  • packages/core/src/utils/apiConversionUtils.test.ts
    • Consolidated type import for GenerateContentParameters by moving it inline with value imports from @google/genai.
  • packages/core/src/utils/authConsent.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
  • packages/core/src/utils/editCorrector.test.ts
    • Consolidated type import for Mocked by moving it inline with value imports from vitest.
  • packages/core/src/utils/fileUtils.test.ts
    • Reordered import statements for fs and actualNodeFs.
  • packages/core/src/utils/filesearch/crawler.test.ts
    • Consolidated type import for Ignore by moving it inline with value imports from ./ignore.js.
  • packages/core/src/utils/filesearch/fileSearch.ts
    • Consolidated type import for Ignore by moving it inline with value imports from ./ignore.js.
    • Consolidated type import for FzfResultItem by moving it inline with value imports from fzf.
  • packages/core/src/utils/generateContentResponseUtilities.test.ts
    • Consolidated multiple type imports (GenerateContentResponse, Part, SafetyRating, CitationMetadata, PartListUnion) by moving them inline with value imports from @google/genai.
  • packages/core/src/utils/getFolderStructure.ts
    • Consolidated type import for FileFilteringOptions by moving it inline with value imports from ../config/constants.js.
  • packages/core/src/utils/googleErrors.test.ts
    • Consolidated type import for QuotaFailure by moving it inline with value imports from ./googleErrors.js.
  • packages/core/src/utils/googleQuotaErrors.ts
    • Consolidated multiple type imports (ErrorInfo, GoogleApiError, Help, QuotaFailure, RetryInfo) by moving them inline with value imports from ./googleErrors.js.
  • packages/core/src/utils/installationManager.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
  • packages/core/src/utils/memoryDiscovery.test.ts
    • Consolidated type import for HierarchicalMemory by moving it inline with value imports from ../config/memory.js.
  • packages/core/src/utils/memoryDiscovery.ts
    • Consolidated type import for FileFilteringOptions by moving it inline with value imports from ../config/constants.js.
  • packages/core/src/utils/nextSpeakerChecker.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
    • Consolidated type import for NextSpeakerResponse by moving it inline with value imports from ./nextSpeakerChecker.js.
  • packages/core/src/utils/retry.ts
    • Consolidated type import for GenerateContentResponse by moving it inline with value imports from @google/genai.
  • packages/core/src/utils/shell-utils.ts
    • Consolidated multiple type imports (Node, Tree) by moving them inline with value imports from web-tree-sitter.
  • packages/core/src/utils/summarizer.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
  • packages/core/src/utils/tool-utils.test.ts
    • Consolidated multiple type imports (AnyToolInvocation, Config) by moving them inline with value imports from ../index.js.
  • packages/core/src/utils/tool-utils.ts
    • Consolidated multiple type imports (AnyDeclarativeTool, AnyToolInvocation) by moving them inline with value imports from ../index.js.
  • packages/core/src/utils/userAccountManager.test.ts
    • Consolidated type import for Mock by moving it inline with value imports from vitest.
Activity
  • All 265 test suites passed (4998 tests).
  • TypeScript compilation was successful.
  • ESLint passed with only 2 pre-existing warnings, unrelated to this PR.
  • No breaking changes were introduced.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly merges duplicate import statements across a large number of files in packages/core, improving code consistency. The changes align with modern TypeScript syntax by combining type and value imports. However, I found one critical issue in packages/core/src/telemetry/loggers.test.ts where value imports were incorrectly merged into a type-only import statement. This will likely break the build and needs to be corrected to follow the pattern used elsewhere in this PR.

@scidomino scidomino enabled auto-merge March 3, 2026 22:09
@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. area/core Issues related to User Interface, OS Support, Core Functionality area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels Mar 3, 2026
@scidomino
Copy link
Copy Markdown
Collaborator

@Nixxx19 Run the preflight.

If you don't get it right on the next try I will ask you to break this into chunk and send me small PRs with no more than 30 files in each one.

- Move enums (CoreToolCallStatus, ROOT_SCHEDULER_ID, HookEventName, ConfigSource, HookType, AuthType, ToolConfirmationOutcome, ToolErrorType) from type imports to value imports
- Move classes (ToolRegistry, GeminiClient, EditTool) from type imports to value imports
- These were incorrectly marked as type-only imports during duplicate import merge
- Fixes TypeScript error TS1361: cannot be used as a value because it was imported using 'import type'
auto-merge was automatically disabled March 3, 2026 22:28

Head branch was pushed to by a user without write access

@Nixxx19
Copy link
Copy Markdown
Contributor Author

Nixxx19 commented Mar 3, 2026

@scidomino ran preflight locally and the build passed.

@scidomino scidomino added this pull request to the merge queue Mar 4, 2026
Merged via the queue into google-gemini:main with commit 28af4e1 Mar 4, 2026
27 checks passed
@Nixxx19
Copy link
Copy Markdown
Contributor Author

Nixxx19 commented Mar 4, 2026

thank you so much @scidomino !!

BryanBradfo pushed a commit to BryanBradfo/gemini-cli that referenced this pull request Mar 5, 2026
struckoff pushed a commit to struckoff/gemini-cli that referenced this pull request Mar 6, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
yashodipmore pushed a commit to yashodipmore/geemi-cli that referenced this pull request Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup existing import/no-duplicates warnings and suppressions

2 participants