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

This commit is contained in:
nityam
2026-03-04 05:42:59 +05:30
committed by GitHub
parent d25088956d
commit 28af4e127f
143 changed files with 909 additions and 712 deletions
@@ -10,12 +10,13 @@ import {
type SendMessageResult,
} from './a2a-client-manager.js';
import type { AgentCard, Task } from '@a2a-js/sdk';
import type { AuthenticationHandler, Client } from '@a2a-js/sdk/client';
import {
ClientFactory,
DefaultAgentCardResolver,
createAuthenticatingFetchWithRetry,
ClientFactoryOptions,
type AuthenticationHandler,
type Client,
} from '@a2a-js/sdk/client';
import { debugLogger } from '../utils/debugLogger.js';
+5 -2
View File
@@ -15,8 +15,11 @@ import {
AgentLoadError,
} from './agentLoader.js';
import { GEMINI_MODEL_ALIAS_PRO } from '../config/models.js';
import type { LocalAgentDefinition } from './types.js';
import { DEFAULT_MAX_TIME_MINUTES, DEFAULT_MAX_TURNS } from './types.js';
import {
DEFAULT_MAX_TIME_MINUTES,
DEFAULT_MAX_TURNS,
type LocalAgentDefinition,
} from './types.js';
describe('loader', () => {
let tempDir: string;
@@ -54,13 +54,13 @@ import {
AgentFinishEvent,
RecoveryAttemptEvent,
} from '../telemetry/types.js';
import type {
AgentInputs,
LocalAgentDefinition,
SubagentActivityEvent,
OutputConfig,
import {
AgentTerminateMode,
type AgentInputs,
type LocalAgentDefinition,
type SubagentActivityEvent,
type OutputConfig,
} from './types.js';
import { AgentTerminateMode } from './types.js';
import type { AnyDeclarativeTool, AnyToolInvocation } from '../tools/tools.js';
import type { ToolCallRequestInfo } from '../scheduler/types.js';
import { CompressionStatus } from '../core/turn.js';
@@ -69,8 +69,7 @@ import type {
ModelConfigKey,
ResolvedModelConfig,
} from '../services/modelConfigService.js';
import type { AgentRegistry } from './registry.js';
import { getModelConfigAlias } from './registry.js';
import { getModelConfigAlias, type AgentRegistry } from './registry.js';
import type { ModelRouterService } from '../routing/modelRouterService.js';
const {
+11 -13
View File
@@ -7,13 +7,13 @@
import type { Config } from '../config/config.js';
import { reportError } from '../utils/errorReporting.js';
import { GeminiChat, StreamEventType } from '../core/geminiChat.js';
import { Type } from '@google/genai';
import type {
Content,
Part,
FunctionCall,
FunctionDeclaration,
Schema,
import {
Type,
type Content,
type Part,
type FunctionCall,
type FunctionDeclaration,
type Schema,
} from '@google/genai';
import { ToolRegistry } from '../tools/tool-registry.js';
import { DiscoveredMCPTool } from '../tools/mcp-tool.js';
@@ -33,17 +33,15 @@ import {
LlmRole,
RecoveryAttemptEvent,
} from '../telemetry/types.js';
import type {
LocalAgentDefinition,
AgentInputs,
OutputObject,
SubagentActivityEvent,
} from './types.js';
import {
AgentTerminateMode,
DEFAULT_QUERY_STRING,
DEFAULT_MAX_TURNS,
DEFAULT_MAX_TIME_MINUTES,
type LocalAgentDefinition,
type AgentInputs,
type OutputObject,
type SubagentActivityEvent,
} from './types.js';
import { getErrorMessage } from '../utils/errors.js';
import { templateString } from './utils.js';
@@ -13,15 +13,15 @@ import {
afterEach,
type Mocked,
} from 'vitest';
import type {
LocalAgentDefinition,
SubagentActivityEvent,
AgentInputs,
SubagentProgress,
import {
AgentTerminateMode,
type LocalAgentDefinition,
type SubagentActivityEvent,
type AgentInputs,
type SubagentProgress,
} from './types.js';
import { LocalSubagentInvocation } from './local-invocation.js';
import { LocalAgentExecutor } from './local-executor.js';
import { AgentTerminateMode } from './types.js';
import { makeFakeConfig } from '../test-utils/config.js';
import type { Config } from '../config/config.js';
import type { MessageBus } from '../confirmation-bus/message-bus.js';
+14 -12
View File
@@ -4,26 +4,28 @@
* SPDX-License-Identifier: Apache-2.0
*/
import type {
ToolConfirmationOutcome,
ToolResult,
ToolCallConfirmationDetails,
import {
BaseToolInvocation,
type ToolConfirmationOutcome,
type ToolResult,
type ToolCallConfirmationDetails,
} from '../tools/tools.js';
import { BaseToolInvocation } from '../tools/tools.js';
import { DEFAULT_QUERY_STRING } from './types.js';
import type {
RemoteAgentInputs,
RemoteAgentDefinition,
AgentInputs,
import {
DEFAULT_QUERY_STRING,
type RemoteAgentInputs,
type RemoteAgentDefinition,
type AgentInputs,
} from './types.js';
import type { MessageBus } from '../confirmation-bus/message-bus.js';
import { A2AClientManager } from './a2a-client-manager.js';
import {
A2AClientManager,
type SendMessageResult,
} from './a2a-client-manager.js';
import { extractIdsFromResponse, A2AResultReassembler } from './a2aUtils.js';
import { GoogleAuth } from 'google-auth-library';
import type { AuthenticationHandler } from '@a2a-js/sdk/client';
import { debugLogger } from '../utils/debugLogger.js';
import type { AnsiOutput } from '../utils/terminalSerializer.js';
import type { SendMessageResult } from './a2a-client-manager.js';
import { A2AAuthProviderFactory } from './auth-provider/factory.js';
/**
@@ -7,7 +7,13 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { SubagentTool } from './subagent-tool.js';
import { SubagentToolWrapper } from './subagent-tool-wrapper.js';
import { Kind } from '../tools/tools.js';
import {
Kind,
type DeclarativeTool,
type ToolCallConfirmationDetails,
type ToolInvocation,
type ToolResult,
} from '../tools/tools.js';
import type {
LocalAgentDefinition,
RemoteAgentDefinition,
@@ -17,12 +23,6 @@ import { makeFakeConfig } from '../test-utils/config.js';
import { createMockMessageBus } from '../test-utils/mock-message-bus.js';
import type { Config } from '../config/config.js';
import type { MessageBus } from '../confirmation-bus/message-bus.js';
import type {
DeclarativeTool,
ToolCallConfirmationDetails,
ToolInvocation,
ToolResult,
} from '../tools/tools.js';
import {
GeminiCliOperation,
GEN_AI_AGENT_DESCRIPTION,