mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-29 04:37:12 -07:00
fix: merge duplicate imports in packages/core (3/4) (#20928)
This commit is contained in:
@@ -4,12 +4,10 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { ContentGenerator } from '../core/contentGenerator.js';
|
||||
import { AuthType } from '../core/contentGenerator.js';
|
||||
import { AuthType, type ContentGenerator } from '../core/contentGenerator.js';
|
||||
import { getOauthClient } from './oauth2.js';
|
||||
import { setupUser } from './setup.js';
|
||||
import type { HttpOptions } from './server.js';
|
||||
import { CodeAssistServer } from './server.js';
|
||||
import { CodeAssistServer, type HttpOptions } from './server.js';
|
||||
import type { Config } from '../config/config.js';
|
||||
import { LoggingContentGenerator } from '../core/loggingContentGenerator.js';
|
||||
|
||||
|
||||
@@ -5,21 +5,19 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import type { CaGenerateContentResponse } from './converter.js';
|
||||
import {
|
||||
toGenerateContentRequest,
|
||||
fromGenerateContentResponse,
|
||||
toContents,
|
||||
type CaGenerateContentResponse,
|
||||
} from './converter.js';
|
||||
import type {
|
||||
ContentListUnion,
|
||||
GenerateContentParameters,
|
||||
Part,
|
||||
} from '@google/genai';
|
||||
import {
|
||||
GenerateContentResponse,
|
||||
FinishReason,
|
||||
BlockedReason,
|
||||
type ContentListUnion,
|
||||
type GenerateContentParameters,
|
||||
type Part,
|
||||
} from '@google/genai';
|
||||
|
||||
describe('converter', () => {
|
||||
|
||||
@@ -4,29 +4,29 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type {
|
||||
Content,
|
||||
ContentListUnion,
|
||||
ContentUnion,
|
||||
GenerateContentConfig,
|
||||
GenerateContentParameters,
|
||||
CountTokensParameters,
|
||||
CountTokensResponse,
|
||||
GenerationConfigRoutingConfig,
|
||||
MediaResolution,
|
||||
Candidate,
|
||||
ModelSelectionConfig,
|
||||
GenerateContentResponsePromptFeedback,
|
||||
GenerateContentResponseUsageMetadata,
|
||||
Part,
|
||||
SafetySetting,
|
||||
PartUnion,
|
||||
SpeechConfigUnion,
|
||||
ThinkingConfig,
|
||||
ToolListUnion,
|
||||
ToolConfig,
|
||||
import {
|
||||
GenerateContentResponse,
|
||||
type Content,
|
||||
type ContentListUnion,
|
||||
type ContentUnion,
|
||||
type GenerateContentConfig,
|
||||
type GenerateContentParameters,
|
||||
type CountTokensParameters,
|
||||
type CountTokensResponse,
|
||||
type GenerationConfigRoutingConfig,
|
||||
type MediaResolution,
|
||||
type Candidate,
|
||||
type ModelSelectionConfig,
|
||||
type GenerateContentResponsePromptFeedback,
|
||||
type GenerateContentResponseUsageMetadata,
|
||||
type Part,
|
||||
type SafetySetting,
|
||||
type PartUnion,
|
||||
type SpeechConfigUnion,
|
||||
type ThinkingConfig,
|
||||
type ToolListUnion,
|
||||
type ToolConfig,
|
||||
} from '@google/genai';
|
||||
import { GenerateContentResponse } from '@google/genai';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
import type { Credits } from './types.js';
|
||||
|
||||
|
||||
@@ -4,9 +4,21 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { Credentials } from 'google-auth-library';
|
||||
import type { Mock } from 'vitest';
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import {
|
||||
OAuth2Client,
|
||||
Compute,
|
||||
GoogleAuth,
|
||||
type Credentials,
|
||||
} from 'google-auth-library';
|
||||
import {
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
vi,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
type Mock,
|
||||
} from 'vitest';
|
||||
import {
|
||||
getOauthClient,
|
||||
resetOauthClientForTesting,
|
||||
@@ -15,7 +27,6 @@ import {
|
||||
authEvents,
|
||||
} from './oauth2.js';
|
||||
import { UserAccountManager } from '../utils/userAccountManager.js';
|
||||
import { OAuth2Client, Compute, GoogleAuth } from 'google-auth-library';
|
||||
import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import http from 'node:http';
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { Credentials, AuthClient, JWTInput } from 'google-auth-library';
|
||||
import {
|
||||
OAuth2Client,
|
||||
Compute,
|
||||
CodeChallengeMethod,
|
||||
GoogleAuth,
|
||||
type Credentials,
|
||||
type AuthClient,
|
||||
type JWTInput,
|
||||
} from 'google-auth-library';
|
||||
import * as http from 'node:http';
|
||||
import url from 'node:url';
|
||||
|
||||
@@ -5,26 +5,26 @@
|
||||
*/
|
||||
|
||||
import type { AuthClient } from 'google-auth-library';
|
||||
import type {
|
||||
CodeAssistGlobalUserSettingResponse,
|
||||
LoadCodeAssistRequest,
|
||||
LoadCodeAssistResponse,
|
||||
LongRunningOperationResponse,
|
||||
OnboardUserRequest,
|
||||
SetCodeAssistGlobalUserSettingRequest,
|
||||
ClientMetadata,
|
||||
RetrieveUserQuotaRequest,
|
||||
RetrieveUserQuotaResponse,
|
||||
FetchAdminControlsRequest,
|
||||
FetchAdminControlsResponse,
|
||||
ConversationOffered,
|
||||
ConversationInteraction,
|
||||
StreamingLatency,
|
||||
RecordCodeAssistMetricsRequest,
|
||||
GeminiUserTier,
|
||||
Credits,
|
||||
import {
|
||||
UserTierId,
|
||||
type CodeAssistGlobalUserSettingResponse,
|
||||
type LoadCodeAssistRequest,
|
||||
type LoadCodeAssistResponse,
|
||||
type LongRunningOperationResponse,
|
||||
type OnboardUserRequest,
|
||||
type SetCodeAssistGlobalUserSettingRequest,
|
||||
type ClientMetadata,
|
||||
type RetrieveUserQuotaRequest,
|
||||
type RetrieveUserQuotaResponse,
|
||||
type FetchAdminControlsRequest,
|
||||
type FetchAdminControlsResponse,
|
||||
type ConversationOffered,
|
||||
type ConversationInteraction,
|
||||
type StreamingLatency,
|
||||
type RecordCodeAssistMetricsRequest,
|
||||
type GeminiUserTier,
|
||||
type Credits,
|
||||
} from './types.js';
|
||||
import { UserTierId } from './types.js';
|
||||
import type {
|
||||
ListExperimentsRequest,
|
||||
ListExperimentsResponse,
|
||||
@@ -49,15 +49,13 @@ import {
|
||||
} from '../billing/billing.js';
|
||||
import { logBillingEvent } from '../telemetry/loggers.js';
|
||||
import { CreditsUsedEvent } from '../telemetry/billingEvents.js';
|
||||
import type {
|
||||
CaCountTokenResponse,
|
||||
CaGenerateContentResponse,
|
||||
} from './converter.js';
|
||||
import {
|
||||
fromCountTokenResponse,
|
||||
fromGenerateContentResponse,
|
||||
toCountTokenRequest,
|
||||
toGenerateContentRequest,
|
||||
type CaCountTokenResponse,
|
||||
type CaGenerateContentResponse,
|
||||
} from './converter.js';
|
||||
import {
|
||||
formatProtoJsonDuration,
|
||||
|
||||
@@ -14,8 +14,7 @@ import { ValidationRequiredError } from '../utils/googleQuotaErrors.js';
|
||||
import { ChangeAuthRequestedError } from '../utils/errors.js';
|
||||
import { CodeAssistServer } from '../code_assist/server.js';
|
||||
import type { OAuth2Client } from 'google-auth-library';
|
||||
import type { GeminiUserTier } from './types.js';
|
||||
import { UserTierId } from './types.js';
|
||||
import { UserTierId, type GeminiUserTier } from './types.js';
|
||||
|
||||
vi.mock('../code_assist/server.js');
|
||||
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type {
|
||||
ClientMetadata,
|
||||
GeminiUserTier,
|
||||
IneligibleTier,
|
||||
LoadCodeAssistResponse,
|
||||
OnboardUserRequest,
|
||||
import {
|
||||
UserTierId,
|
||||
IneligibleTierReasonCode,
|
||||
type ClientMetadata,
|
||||
type GeminiUserTier,
|
||||
type IneligibleTier,
|
||||
type LoadCodeAssistResponse,
|
||||
type OnboardUserRequest,
|
||||
} from './types.js';
|
||||
import { UserTierId, IneligibleTierReasonCode } from './types.js';
|
||||
import type { HttpOptions } from './server.js';
|
||||
import { CodeAssistServer } from './server.js';
|
||||
import { CodeAssistServer, type HttpOptions } from './server.js';
|
||||
import type { AuthClient } from 'google-auth-library';
|
||||
import type { ValidationHandler } from '../fallback/types.js';
|
||||
import { ChangeAuthRequestedError } from '../utils/errors.js';
|
||||
|
||||
Reference in New Issue
Block a user