mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
fix: merge duplicate imports in packages/core (3/4) (#20928)
This commit is contained in:
@@ -16,8 +16,9 @@ import type { BaseLlmClient } from '../core/baseLlmClient.js';
|
||||
import type { GeminiChat } from '../core/geminiChat.js';
|
||||
import type { Config } from '../config/config.js';
|
||||
import * as fileUtils from '../utils/fileUtils.js';
|
||||
import { TOOL_OUTPUTS_DIR } from '../utils/fileUtils.js';
|
||||
import { getInitialChatHistory } from '../utils/environmentContext.js';
|
||||
|
||||
const { TOOL_OUTPUTS_DIR } = fileUtils;
|
||||
import * as tokenCalculation from '../utils/tokenCalculation.js';
|
||||
import { tokenLimit } from '../core/tokenLimits.js';
|
||||
import os from 'node:os';
|
||||
|
||||
@@ -8,14 +8,14 @@ import { expect, it, describe, vi, beforeEach, afterEach } from 'vitest';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
import type {
|
||||
ConversationRecord,
|
||||
ToolCallRecord,
|
||||
MessageRecord,
|
||||
import {
|
||||
ChatRecordingService,
|
||||
type ConversationRecord,
|
||||
type ToolCallRecord,
|
||||
type MessageRecord,
|
||||
} from './chatRecordingService.js';
|
||||
import { CoreToolCallStatus } from '../scheduler/types.js';
|
||||
import type { Content, Part } from '@google/genai';
|
||||
import { ChatRecordingService } from './chatRecordingService.js';
|
||||
import type { Config } from '../config/config.js';
|
||||
import { getProjectHash } from '../utils/paths.js';
|
||||
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { GitIgnoreFilter } from '../utils/gitIgnoreParser.js';
|
||||
import type { IgnoreFileFilter } from '../utils/ignoreFileParser.js';
|
||||
import { GitIgnoreParser } from '../utils/gitIgnoreParser.js';
|
||||
import { IgnoreFileParser } from '../utils/ignoreFileParser.js';
|
||||
import {
|
||||
GitIgnoreParser,
|
||||
type GitIgnoreFilter,
|
||||
} from '../utils/gitIgnoreParser.js';
|
||||
import {
|
||||
IgnoreFileParser,
|
||||
type IgnoreFileFilter,
|
||||
} from '../utils/ignoreFileParser.js';
|
||||
import { isGitRepository } from '../utils/gitUtils.js';
|
||||
import { GEMINI_IGNORE_FILE_NAME } from '../config/constants.js';
|
||||
import fs from 'node:fs';
|
||||
|
||||
@@ -8,8 +8,7 @@ import * as fs from 'node:fs/promises';
|
||||
import * as path from 'node:path';
|
||||
import { isNodeError } from '../utils/errors.js';
|
||||
import { spawnAsync } from '../utils/shell-utils.js';
|
||||
import type { SimpleGit } from 'simple-git';
|
||||
import { simpleGit, CheckRepoActions } from 'simple-git';
|
||||
import { simpleGit, CheckRepoActions, type SimpleGit } from 'simple-git';
|
||||
import type { Storage } from '../config/storage.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@ import type { Content } from '@google/genai';
|
||||
import type { Config } from '../config/config.js';
|
||||
import type { GeminiClient } from '../core/client.js';
|
||||
import type { BaseLlmClient } from '../core/baseLlmClient.js';
|
||||
import type {
|
||||
ServerGeminiContentEvent,
|
||||
ServerGeminiStreamEvent,
|
||||
ServerGeminiToolCallRequestEvent,
|
||||
import {
|
||||
GeminiEventType,
|
||||
type ServerGeminiContentEvent,
|
||||
type ServerGeminiStreamEvent,
|
||||
type ServerGeminiToolCallRequestEvent,
|
||||
} from '../core/turn.js';
|
||||
import { GeminiEventType } from '../core/turn.js';
|
||||
import * as loggers from '../telemetry/loggers.js';
|
||||
import { LoopType } from '../telemetry/types.js';
|
||||
import { LoopDetectionService } from './loopDetectionService.js';
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
import type { Content } from '@google/genai';
|
||||
import { createHash } from 'node:crypto';
|
||||
import type { ServerGeminiStreamEvent } from '../core/turn.js';
|
||||
import { GeminiEventType } from '../core/turn.js';
|
||||
import { GeminiEventType, type ServerGeminiStreamEvent } from '../core/turn.js';
|
||||
import {
|
||||
logLoopDetected,
|
||||
logLoopDetectionDisabled,
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { ModelConfigService } from './modelConfigService.js';
|
||||
import type { ModelConfigServiceConfig } from './modelConfigService.js';
|
||||
import {
|
||||
ModelConfigService,
|
||||
type ModelConfigServiceConfig,
|
||||
} from './modelConfigService.js';
|
||||
|
||||
// This test suite is designed to validate the end-to-end logic of the
|
||||
// ModelConfigService with a complex, realistic configuration.
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import type {
|
||||
ModelConfigAlias,
|
||||
ModelConfigServiceConfig,
|
||||
import {
|
||||
ModelConfigService,
|
||||
type ModelConfigAlias,
|
||||
type ModelConfigServiceConfig,
|
||||
} from './modelConfigService.js';
|
||||
import { ModelConfigService } from './modelConfigService.js';
|
||||
|
||||
describe('ModelConfigService', () => {
|
||||
it('should resolve a basic alias to its model and settings', () => {
|
||||
|
||||
@@ -16,11 +16,11 @@ import {
|
||||
import EventEmitter from 'node:events';
|
||||
import type { Readable } from 'node:stream';
|
||||
import { type ChildProcess } from 'node:child_process';
|
||||
import type {
|
||||
ShellOutputEvent,
|
||||
ShellExecutionConfig,
|
||||
import {
|
||||
ShellExecutionService,
|
||||
type ShellOutputEvent,
|
||||
type ShellExecutionConfig,
|
||||
} from './shellExecutionService.js';
|
||||
import { ShellExecutionService } from './shellExecutionService.js';
|
||||
import type { AnsiOutput, AnsiToken } from '../utils/terminalSerializer.js';
|
||||
|
||||
// Hoisted Mocks
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
*/
|
||||
|
||||
import stripAnsi from 'strip-ansi';
|
||||
import type { PtyImplementation } from '../utils/getPty.js';
|
||||
import { getPty } from '../utils/getPty.js';
|
||||
import { getPty, type PtyImplementation } from '../utils/getPty.js';
|
||||
import { spawn as cpSpawn, type ChildProcess } from 'node:child_process';
|
||||
import { TextDecoder } from 'node:util';
|
||||
import os from 'node:os';
|
||||
|
||||
Reference in New Issue
Block a user