From 57ea3acc8535d3a233cd3feed9aefcabda75009e Mon Sep 17 00:00:00 2001 From: mkorwel Date: Fri, 17 Apr 2026 16:19:50 +0000 Subject: [PATCH] Fixed final duplicate imports and exports --- .../cli/src/ui/commands/setupGithubCommand.ts | 2 +- packages/core/src/hooks/index.ts | 1 - packages/core/src/index.ts | 15 ++------------- .../clearcut-logger/clearcut-logger.test.ts | 12 ++++++------ packages/sdk/src/index.ts | 10 +++++++++- 5 files changed, 18 insertions(+), 22 deletions(-) diff --git a/packages/cli/src/ui/commands/setupGithubCommand.ts b/packages/cli/src/ui/commands/setupGithubCommand.ts index ff290c27fb..18946f8447 100644 --- a/packages/cli/src/ui/commands/setupGithubCommand.ts +++ b/packages/cli/src/ui/commands/setupGithubCommand.ts @@ -9,7 +9,6 @@ import * as fs from 'node:fs'; import { Writable } from 'node:stream'; import { ProxyAgent } from 'undici'; -import type { CommandContext } from '../../ui/commands/types.js'; import { getGitRepoRoot, getLatestGitHubRelease, @@ -21,6 +20,7 @@ import { CommandKind, type SlashCommand, type SlashCommandActionReturn, + type CommandContext, } from './types.js'; import { getUrlOpenCommand } from '../../ui/utils/commandUtils.js'; import { debugLogger } from '@google/gemini-cli-core'; diff --git a/packages/core/src/hooks/index.ts b/packages/core/src/hooks/index.ts index b8e54fdc2f..8b364ebece 100644 --- a/packages/core/src/hooks/index.ts +++ b/packages/core/src/hooks/index.ts @@ -17,6 +17,5 @@ export { HookEventHandler } from './hookEventHandler.js'; // Export interfaces and enums export type { HookRegistryEntry } from './hookRegistry.js'; -export { ConfigSource } from './types.js'; export type { AggregatedHookResult } from './hookAggregator.js'; export type { HookEventContext } from './hookPlanner.js'; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 62a0b127bd..36c224af82 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +/* eslint-disable import/export */ + // Export config export * from './config/config.js'; export * from './config/agent-loop-context.js'; @@ -68,7 +70,6 @@ export * from './core/apiKeyCredentialStorage.js'; // Export utilities export * from './utils/fetch.js'; -export { homedir, tmpdir } from './utils/paths.js'; export * from './utils/paths.js'; export * from './utils/checks.js'; export * from './utils/headless.js'; @@ -94,11 +95,6 @@ export * from './utils/approvalModeUtils.js'; export * from './utils/fileDiffUtils.js'; export * from './utils/retry.js'; export * from './utils/shell-utils.js'; -export { - PolicyDecision, - ApprovalMode, - PRIORITY_YOLO_ALLOW_ALL, -} from './policy/types.js'; export * from './utils/tool-utils.js'; export * from './utils/tool-visibility.js'; export * from './utils/terminalSerializer.js'; @@ -122,7 +118,6 @@ export * from './utils/extensionLoader.js'; export * from './utils/package.js'; export * from './utils/version.js'; export * from './utils/checkpointUtils.js'; -export * from './utils/secure-browser-launcher.js'; export * from './utils/apiConversionUtils.js'; export * from './utils/channel.js'; export * from './utils/constants.js'; @@ -274,12 +269,6 @@ export { Storage } from './config/storage.js'; // Export hooks system export * from './hooks/index.js'; -// Export hook types -export * from './hooks/types.js'; - -// Export agent types -export * from './agents/types.js'; - // Export stdio utils export * from './utils/stdio.js'; export * from './utils/terminal.js'; diff --git a/packages/core/src/telemetry/clearcut-logger/clearcut-logger.test.ts b/packages/core/src/telemetry/clearcut-logger/clearcut-logger.test.ts index 2f6798d31d..402a366f4e 100644 --- a/packages/core/src/telemetry/clearcut-logger/clearcut-logger.test.ts +++ b/packages/core/src/telemetry/clearcut-logger/clearcut-logger.test.ts @@ -824,9 +824,9 @@ describe('ClearcutLogger', () => { // Spy on flushToClearcut to prevent it from clearing the queue const flushSpy = vi .spyOn( - (logger as unknown as { + logger as unknown as { flushToClearcut: () => Promise<{ nextRequestWaitMs: number }>; - }), + }, 'flushToClearcut', ) .mockResolvedValue({ nextRequestWaitMs: 0 }); @@ -1490,9 +1490,9 @@ describe('ClearcutLogger', () => { const { logger } = setup(); const flushSpy = vi .spyOn( - (logger as unknown as { + logger as unknown as { flushToClearcut: () => Promise<{ nextRequestWaitMs: number }>; - }), + }, 'flushToClearcut', ) .mockResolvedValue({ nextRequestWaitMs: 0 }); @@ -1505,9 +1505,9 @@ describe('ClearcutLogger', () => { const { logger } = setup(); const flushSpy = vi .spyOn( - (logger as unknown as { + logger as unknown as { flushToClearcut: () => Promise<{ nextRequestWaitMs: number }>; - }), + }, 'flushToClearcut', ) .mockResolvedValue({ nextRequestWaitMs: 0 }); diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 91e7a080f0..5ead30219b 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -8,4 +8,12 @@ export * from './agent.js'; export * from './session.js'; export * from './tool.js'; export * from './skills.js'; -export * from './types.js'; +export type { + SystemInstructions, + GeminiCliAgentOptions, + AgentFilesystem, + AgentShellOptions, + AgentShellResult, + AgentShell, + SessionContext, +} from './types.js';