refactor: import multiple times (#3745)

This commit is contained in:
Noritaka Kobayashi 2025-05-20 22:19:44 +09:00 committed by hannesrudolph
parent a5c59241b3
commit e8daf6298c
11 changed files with 15 additions and 20 deletions

View file

@ -4,6 +4,8 @@ import {
ConverseCommand,
BedrockRuntimeClientConfig,
ContentBlock,
Message,
SystemContentBlock,
} from "@aws-sdk/client-bedrock-runtime"
import { fromIni } from "@aws-sdk/credential-providers"
import { Anthropic } from "@anthropic-ai/sdk"
@ -19,7 +21,6 @@ import { ProviderSettings } from "../../schemas"
import { ApiStream } from "../transform/stream"
import { BaseProvider } from "./base-provider"
import { logger } from "../../utils/logging"
import { Message, SystemContentBlock } from "@aws-sdk/client-bedrock-runtime"
// New cache-related imports
import { MultiPointStrategy } from "../transform/cache-strategy/multi-point-strategy"
import { ModelInfo as CacheModelInfo } from "../transform/cache-strategy/types"

View file

@ -1,6 +1,5 @@
import { ContentBlock, SystemContentBlock } from "@aws-sdk/client-bedrock-runtime"
import { ContentBlock, SystemContentBlock, BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime"
import { Anthropic } from "@anthropic-ai/sdk"
import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime"
import { MultiPointStrategy } from "../multi-point-strategy"
import { CacheStrategyConfig, ModelInfo, CachePointPlacement } from "../types"

View file

@ -8,7 +8,7 @@ import {
getModeBySlug,
getGroupName,
} from "../../shared/modes"
import { PromptVariables } from "./sections/custom-system-prompt"
import { PromptVariables, loadSystemPromptFile } from "./sections/custom-system-prompt"
import { DiffStrategy } from "../../shared/tools"
import { McpHub } from "../../services/mcp/McpHub"
import { getToolDescriptionsForMode } from "./tools"
@ -26,7 +26,6 @@ import {
addCustomInstructions,
markdownFormattingSection,
} from "./sections"
import { loadSystemPromptFile } from "./sections/custom-system-prompt"
import { formatLanguage } from "../../shared/language"
async function generatePrompt(

View file

@ -4,9 +4,8 @@ import fs from "fs/promises"
import { ClineSayTool } from "../../shared/ExtensionMessage"
import { getReadablePath } from "../../utils/path"
import { Task } from "../task/Task"
import { ToolUse, RemoveClosingTag } from "../../shared/tools"
import { ToolUse, RemoveClosingTag, AskApproval, HandleError, PushToolResult } from "../../shared/tools"
import { formatResponse } from "../prompts/responses"
import { AskApproval, HandleError, PushToolResult } from "../../shared/tools"
import { fileExistsAtPath } from "../../utils/fs"
import { addLineNumbers } from "../../integrations/misc/extract-text"
import { RecordSource } from "../context-tracking/FileContextTrackerTypes"

View file

@ -4,7 +4,7 @@ import pWaitFor from "p-wait-for"
import * as vscode from "vscode"
import { ClineProvider } from "./ClineProvider"
import { Language, ProviderSettings } from "../../schemas"
import { Language, ProviderSettings, GlobalState } from "../../schemas"
import { changeLanguage, t } from "../../i18n"
import { RouterName, toRouterName } from "../../shared/api"
import { supportPrompt } from "../../shared/support-prompt"
@ -32,7 +32,6 @@ import { telemetryService } from "../../services/telemetry/TelemetryService"
import { TelemetrySetting } from "../../shared/TelemetrySetting"
import { getWorkspacePath } from "../../utils/path"
import { Mode, defaultModeSlug } from "../../shared/modes"
import { GlobalState } from "../../schemas"
import { getModels, flushModels } from "../../api/providers/fetchers/modelCache"
import { generateSystemPrompt } from "./generateSystemPrompt"

View file

@ -13,8 +13,11 @@ import {
ProviderSettings,
ProviderSettingsEntry,
isSecretStateKey,
IpcOrigin,
IpcMessageType,
TaskCommandName,
TaskEvent,
} from "../schemas"
import { IpcOrigin, IpcMessageType, TaskCommandName, TaskEvent } from "../schemas"
import { RooCodeAPI } from "./interface"
import { IpcServer } from "./ipc"

View file

@ -1,5 +1,4 @@
import fs from "fs"
import { createReadStream } from "fs"
import fs, { createReadStream } from "fs"
import { createInterface } from "readline"
/**

View file

@ -7,8 +7,7 @@ import { TerminalProcess } from "../TerminalProcess"
import { Terminal } from "../Terminal"
import { TerminalRegistry } from "../TerminalRegistry"
import { createPowerShellStream } from "./streamUtils/pwshStream"
import { createPowerShellMockStream } from "./streamUtils"
import { isPowerShellCoreAvailable } from "./streamUtils"
import { createPowerShellMockStream, isPowerShellCoreAvailable } from "./streamUtils"
// Skip this test if PowerShell Core is not available
const hasPwsh = isPowerShellCoreAvailable()

View file

@ -3,8 +3,7 @@ import * as path from "path"
import { listFiles } from "../../services/glob/list-files"
import { ClineProvider } from "../../core/webview/ClineProvider"
import { toRelativePath } from "../../utils/path"
import { getWorkspacePath } from "../../utils/path"
import { toRelativePath, getWorkspacePath } from "../../utils/path"
const MAX_INITIAL_FILES = 1_000

View file

@ -1,7 +1,6 @@
import type { McpHub as McpHubType } from "../McpHub"
import type { McpHub as McpHubType, McpConnection } from "../McpHub"
import type { ClineProvider } from "../../../core/webview/ClineProvider"
import type { ExtensionContext, Uri } from "vscode"
import type { McpConnection } from "../McpHub"
import { ServerConfigSchema } from "../McpHub"
const fs = require("fs/promises")

View file

@ -3,10 +3,9 @@
import { render, screen, fireEvent } from "@testing-library/react"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { ProviderSettings } from "@roo/shared/api"
import { ProviderSettings, openAiModelInfoSaneDefaults } from "@roo/shared/api"
import { ExtensionStateContextProvider } from "@/context/ExtensionStateContext"
import { openAiModelInfoSaneDefaults } from "@roo/shared/api"
import ApiOptions, { ApiOptionsProps } from "../ApiOptions"