fi: import type errors

This commit is contained in:
mingholy.lmh
2025-09-15 14:26:01 +08:00
parent f3cf732493
commit e9b423b43a
29 changed files with 289 additions and 282 deletions

View File

@@ -416,7 +416,7 @@ export class Task {
private createScheduler(): CoreToolScheduler {
const scheduler = new CoreToolScheduler({
/* @ts-expect-error */
/* @ts-expect-error We have extended the type of ToolResultDisplay */
outputUpdateHandler: this._schedulerOutputUpdate.bind(this),
onAllToolCallsComplete: this._schedulerAllToolCallsComplete.bind(this),
onToolCallsUpdate: this._schedulerToolCallsUpdate.bind(this),

View File

@@ -5,7 +5,7 @@
*/
import { Box, Text } from 'ink';
import React from 'react';
import type React from 'react';
import { Colors } from '../colors.js';
import {
RadioButtonSelect,

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react';
import type React from 'react';
import { Box, Text } from 'ink';
import type { SummaryProps } from '../../types.js';
import Spinner from 'ink-spinner';

View File

@@ -294,4 +294,4 @@ export const ToolConfirmationMessage: React.FC<
</Box>
</Box>
);
};
};

View File

@@ -11,6 +11,7 @@ import { ToolMessage } from './ToolMessage.js';
import { StreamingState, ToolCallStatus } from '../../types.js';
import { Text } from 'ink';
import { StreamingContext } from '../../contexts/StreamingContext.js';
import type { Config } from '@qwen-code/qwen-code-core';
// Mock child components or utilities if they are complex or have side effects
vi.mock('../GeminiRespondingSpinner.js', () => ({
@@ -68,7 +69,7 @@ const renderWithContext = (
};
describe('<ToolMessage />', () => {
const mockConfig = {} as any; // Mock config for tests
const mockConfig = {} as Config;
const baseProps: ToolMessageProps = {
callId: 'tool-123',

View File

@@ -16,7 +16,7 @@ import { CreationSummary } from './CreationSummary.js';
import { type WizardStepProps } from '../types.js';
import { WIZARD_STEPS } from '../constants.js';
import { getStepKind } from '../utils.js';
import { Config } from '@qwen-code/qwen-code-core';
import type { Config } from '@qwen-code/qwen-code-core';
import { Colors } from '../../../colors.js';
import { theme } from '../../../semantic-colors.js';
import { TextEntryStep } from './TextEntryStep.js';

View File

@@ -6,8 +6,11 @@
import { useCallback, useState, useEffect } from 'react';
import { Box, Text, useInput } from 'ink';
import { type WizardStepProps } from '../types.js';
import { SubagentManager, type SubagentConfig } from '@qwen-code/qwen-code-core';
import type { WizardStepProps } from '../types.js';
import type {
SubagentManager,
SubagentConfig,
} from '@qwen-code/qwen-code-core';
import { theme } from '../../../semantic-colors.js';
import { shouldShowColor, getColorForDisplay } from '../utils.js';
import { useLaunchEditor } from '../../../hooks/useLaunchEditor.js';

View File

@@ -9,7 +9,7 @@ import { Box, Text } from 'ink';
import Spinner from 'ink-spinner';
import type { WizardStepProps, WizardAction } from '../types.js';
import { sanitizeInput } from '../utils.js';
import { Config, subagentGenerator } from '@qwen-code/qwen-code-core';
import { type Config, subagentGenerator } from '@qwen-code/qwen-code-core';
import { useKeypress, type Key } from '../../../hooks/useKeypress.js';
import { keyMatchers, Command } from '../../../keyMatchers.js';
import { theme } from '../../../semantic-colors.js';

View File

@@ -8,7 +8,7 @@ import { useState, useMemo, useEffect } from 'react';
import { Box, Text } from 'ink';
import { RadioButtonSelect } from '../../shared/RadioButtonSelect.js';
import type { ToolCategory } from '../types.js';
import { Kind, Config } from '@qwen-code/qwen-code-core';
import { Kind, type Config } from '@qwen-code/qwen-code-core';
import { Colors } from '../../../colors.js';
interface ToolOption {

View File

@@ -17,7 +17,7 @@ import { MANAGEMENT_STEPS } from '../types.js';
import { Colors } from '../../../colors.js';
import { theme } from '../../../semantic-colors.js';
import { getColorForDisplay, shouldShowColor } from '../utils.js';
import { Config, type SubagentConfig } from '@qwen-code/qwen-code-core';
import type { Config, SubagentConfig } from '@qwen-code/qwen-code-core';
interface AgentsManagerDialogProps {
onClose: () => void;

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { type SubagentLevel, Config } from '@qwen-code/qwen-code-core';
import type { SubagentLevel, Config } from '@qwen-code/qwen-code-core';
/**
* State management for the subagent creation wizard.

View File

@@ -6,7 +6,7 @@
import { useCallback } from 'react';
import { SettingScope } from '../../config/settings.js';
import { AuthType } from '@qwen-code/qwen-code-core';
import type { AuthType } from '@qwen-code/qwen-code-core';
export interface DialogCloseOptions {
// Theme dialog

View File

@@ -15,8 +15,8 @@ import type {
Tool,
} from '@google/genai';
import { ProxyAgent, setGlobalDispatcher } from 'undici';
import { UserTierId } from '../code_assist/types.js';
import { Config } from '../config/config.js';
import type { UserTierId } from '../code_assist/types.js';
import type { Config } from '../config/config.js';
import { DEFAULT_GEMINI_FLASH_MODEL } from '../config/models.js';
import type { File, IdeContext } from '../ide/ideContext.js';
import { ideContext } from '../ide/ideContext.js';

View File

@@ -4,12 +4,12 @@
* SPDX-License-Identifier: Apache-2.0
*/
import OpenAI from 'openai';
import type OpenAI from 'openai';
import {
type GenerateContentParameters,
GenerateContentResponse,
} from '@google/genai';
import { Config } from '../../config/config.js';
import type { Config } from '../../config/config.js';
import { type ContentGeneratorConfig } from '../contentGenerator.js';
import { type OpenAICompatibleProvider } from './provider/index.js';
import { OpenAIContentConverter } from './converter.js';

View File

@@ -5,8 +5,8 @@
*/
import { EventEmitter } from 'events';
import {
type ToolCallConfirmationDetails,
import type {
ToolCallConfirmationDetails,
ToolConfirmationOutcome,
} from '../tools/tools.js';

View File

@@ -10,8 +10,8 @@ import * as path from 'path';
import * as os from 'os';
import { SubagentManager } from './subagent-manager.js';
import { type SubagentConfig, SubagentError } from './types.js';
import { ToolRegistry } from '../tools/tool-registry.js';
import { Config } from '../config/config.js';
import type { ToolRegistry } from '../tools/tool-registry.js';
import type { Config } from '../config/config.js';
import { makeFakeConfig } from '../test-utils/config.js';
// Mock file system operations

View File

@@ -27,7 +27,7 @@ import type {
import { SubagentError, SubagentErrorCode } from './types.js';
import { SubagentValidator } from './validation.js';
import { SubAgentScope } from './subagent.js';
import { Config } from '../config/config.js';
import type { Config } from '../config/config.js';
import { BuiltinAgentRegistry } from './builtin-agents.js';
const QWEN_CONFIG_DIR = '.qwen';

View File

@@ -26,7 +26,7 @@ import { DEFAULT_GEMINI_MODEL } from '../config/models.js';
import { createContentGenerator } from '../core/contentGenerator.js';
import { GeminiChat } from '../core/geminiChat.js';
import { executeToolCall } from '../core/nonInteractiveToolExecutor.js';
import { ToolRegistry } from '../tools/tool-registry.js';
import type { ToolRegistry } from '../tools/tool-registry.js';
import { type AnyDeclarativeTool } from '../tools/tools.js';
import { getEnvironmentContext } from '../utils/environmentContext.js';
import { ContextState, SubAgentScope } from './subagent.js';

View File

@@ -5,7 +5,7 @@
*/
import { reportError } from '../utils/errorReporting.js';
import { Config } from '../config/config.js';
import type { Config } from '../config/config.js';
import { type ToolCallRequestInfo } from '../core/turn.js';
import {
CoreToolScheduler,
@@ -43,7 +43,10 @@ import type {
SubAgentStreamTextEvent,
SubAgentErrorEvent,
} from './subagent-events.js';
import { SubAgentEventEmitter, SubAgentEventType } from './subagent-events.js';
import {
type SubAgentEventEmitter,
SubAgentEventType,
} from './subagent-events.js';
import {
SubagentStatistics,
type SubagentStatsSummary,

View File

@@ -8,13 +8,13 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import { TaskTool, type TaskParams } from './task.js';
import type { PartListUnion } from '@google/genai';
import type { ToolResultDisplay, TaskResultDisplay } from './tools.js';
import { Config } from '../config/config.js';
import type { Config } from '../config/config.js';
import { SubagentManager } from '../subagents/subagent-manager.js';
import {
type SubagentConfig,
SubagentTerminateMode,
} from '../subagents/types.js';
import { SubAgentScope, ContextState } from '../subagents/subagent.js';
import { type SubAgentScope, ContextState } from '../subagents/subagent.js';
import { partToString } from '../utils/partUtils.js';
// Type for accessing protected methods in tests

View File

@@ -15,8 +15,8 @@ import type {
ToolCallConfirmationDetails,
ToolConfirmationPayload,
} from './tools.js';
import { Config } from '../config/config.js';
import { SubagentManager } from '../subagents/subagent-manager.js';
import type { Config } from '../config/config.js';
import type { SubagentManager } from '../subagents/subagent-manager.js';
import {
type SubagentConfig,
SubagentTerminateMode,

View File

@@ -13,7 +13,7 @@ import {
type Mock,
afterEach,
} from 'vitest';
import { type Content, GoogleGenAI, Models } from '@google/genai';
import type { Content, GoogleGenAI, Models } from '@google/genai';
import { DEFAULT_QWEN_FLASH_MODEL } from '../config/models.js';
import { GeminiClient } from '../core/client.js';
import { Config } from '../config/config.js';

View File

@@ -13,7 +13,7 @@ import {
type Mock,
afterEach,
} from 'vitest';
import { type Content, GoogleGenAI, Models } from '@google/genai';
import type { Content, GoogleGenAI, Models } from '@google/genai';
import { DEFAULT_QWEN_MODEL } from '../config/models.js';
import { GeminiClient } from '../core/client.js';
import { Config } from '../config/config.js';

View File

@@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { type Content } from '@google/genai';
import type { Content } from '@google/genai';
import { DEFAULT_QWEN_MODEL } from '../config/models.js';
import { GeminiClient } from '../core/client.js';
import type { GeminiClient } from '../core/client.js';
const SYSTEM_PROMPT = `You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.