From 9ffe3e48d036a187d0367f2c0c2fa6dcc33079bb Mon Sep 17 00:00:00 2001 From: Matt Cowger Date: Mon, 6 Oct 2025 15:03:28 -0700 Subject: [PATCH 1/4] feat(fast-apply): add provider and profile selection This commit introduces new settings to configure Fast Apply with various API providers, even if the core chat model is not provided via Openrouter/Kilocode. Users can now select 'Morph', 'OpenRouter', or 'Kilo Code' as their preferred Fast Apply provider. For OpenRouter and Kilo Code, an existing API profile can be chosen, enhancing flexibility and leveraging existing API configurations. The underlying Fast Apply configuration logic has been refactored to support this new approach, making it more robust and extensible. This includes updates to global settings, webview messages, and UI components to manage the new provider type and profile ID. --- packages/types/src/global-settings.ts | 2 + src/core/prompts/sections/rules.ts | 6 +- src/core/prompts/tools/edit-file.ts | 6 +- src/core/tools/editFileTool.ts | 98 ++++---- src/core/webview/ClineProvider.ts | 6 + src/core/webview/webviewMessageHandler.ts | 10 + src/shared/ExtensionMessage.ts | 2 + src/shared/WebviewMessage.ts | 2 + .../settings/ExperimentalSettings.tsx | 21 +- .../components/settings/FastApplySettings.tsx | 225 +++++++++++++++--- .../src/components/settings/SettingsView.tsx | 61 ++++- webview-ui/src/i18n/locales/en/settings.json | 19 +- 12 files changed, 375 insertions(+), 83 deletions(-) diff --git a/packages/types/src/global-settings.ts b/packages/types/src/global-settings.ts index 016c0888ee..4f05b272b6 100644 --- a/packages/types/src/global-settings.ts +++ b/packages/types/src/global-settings.ts @@ -142,6 +142,8 @@ export const globalSettingsSchema = z.object({ // kilocode_change start: Morph fast apply morphApiKey: z.string().optional(), fastApplyModel: fastApplyModelSchema.optional(), + fastApplyProviderType: z.enum(["morph", "openrouter", "kilocode"]).optional(), + fastApplyProfileId: z.string().optional(), // kilocode_change end codebaseIndexModels: codebaseIndexModelsSchema.optional(), diff --git a/src/core/prompts/sections/rules.ts b/src/core/prompts/sections/rules.ts index cbb8575169..e925dde574 100644 --- a/src/core/prompts/sections/rules.ts +++ b/src/core/prompts/sections/rules.ts @@ -4,7 +4,7 @@ import { CodeIndexManager } from "../../../services/code-index/manager" // kilocode_change start import { getFastApplyEditingInstructions } from "../tools/edit-file" import { type ClineProviderState } from "../../webview/ClineProvider" -import { getFastApplyModelType, isFastApplyAvailable } from "../../tools/editFileTool" +import { isFastApplyAvailable } from "../../tools/editFileTool" // kilocode_change end function getEditingInstructions(diffStrategy?: DiffStrategy): string { @@ -68,7 +68,7 @@ export function getRulesSection( ? "- **CRITICAL: For ANY exploration of code you haven't examined yet in this conversation, you MUST use the `codebase_search` tool FIRST before using search_files or other file exploration tools.** This requirement applies throughout the entire conversation, not just when starting a task. The codebase_search tool uses semantic search to find relevant code based on meaning, not just keywords, making it much more effective for understanding how features are implemented. Even if you've already explored some parts of the codebase, any new area or functionality you need to understand requires using codebase_search first.\n" : "" - const kiloCodeUseMorph = isFastApplyAvailable(clineProviderState) + const kiloCodeUseMorph = isFastApplyAvailable() return `==== @@ -81,7 +81,7 @@ RULES - Before using the execute_command tool, you must first think about the SYSTEM INFORMATION context provided to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory outside of the current working directory '${cwd.toPosix()}', and if so prepend with \`cd\`'ing into that directory && then executing the command (as one command since you are stuck operating from '${cwd.toPosix()}'). For example, if you needed to run \`npm install\` in a project outside of '${cwd.toPosix()}', you would need to prepend with a \`cd\` i.e. pseudocode for this would be \`cd (path to project) && (command, in this case npm install)\`. ${codebaseSearchRule}- When using the search_files tool${isCodebaseSearchAvailable ? " (after codebase_search)" : ""}, craft your regex patterns carefully to balance specificity and flexibility. Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the search_files tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use read_file to examine the full context of interesting matches before using ${kiloCodeUseMorph ? "edit_file" : diffStrategy ? "apply_diff or write_to_file" : "write_to_file"} to make informed changes. - When creating a new project (such as an app, website, or any software project), organize all new files within a dedicated project directory unless the user specifies otherwise. Use appropriate file paths when writing files, as the ${kiloCodeUseMorph ? "edit_file" : "write_to_file"} tool will automatically create any necessary directories. Structure the project logically, adhering to best practices for the specific type of project being created. Unless otherwise specified, new projects should be easily run without additional setup, for example most projects can be built in HTML, CSS, and JavaScript - which you can open in a browser. -${kiloCodeUseMorph ? getFastApplyEditingInstructions(getFastApplyModelType(clineProviderState)) : getEditingInstructions(diffStrategy)} +${kiloCodeUseMorph ? getFastApplyEditingInstructions() : getEditingInstructions(diffStrategy)} - Some modes have restrictions on which files they can edit. If you attempt to edit a restricted file, the operation will be rejected with a FileRestrictionError that will specify which file patterns are allowed for the current mode. - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" diff --git a/src/core/prompts/tools/edit-file.ts b/src/core/prompts/tools/edit-file.ts index a2039d26ed..7071b50cae 100644 --- a/src/core/prompts/tools/edit-file.ts +++ b/src/core/prompts/tools/edit-file.ts @@ -1,8 +1,8 @@ // kilocode_change: Morph fast apply - file added -export function getFastApplyEditingInstructions(modelType: "Morph" | "Relace"): string { - return `- **${modelType} FastApply is enabled.** You have access to the \`edit_file\` tool which uses a specialized model optimized for intelligent code understanding and modification. -- **ONLY use the edit_file tool for file modifications.** Traditional editing tools (apply_diff, write_to_file, insert_content, search_and_replace) are disabled in ${modelType} mode. +export function getFastApplyEditingInstructions(): string { + return `- **FastApply is enabled.** You have access to the \`edit_file\` tool which uses a specialized model optimized for intelligent code understanding and modification. +- **ONLY use the edit_file tool for file modifications.** Traditional editing tools (apply_diff, write_to_file, insert_content, search_and_replace) are disabled in Fast Apply mode. - **Focus on clear instructions and precise code edits** using the edit_file format with \`// ... existing code ...\` placeholders to represent unchanged sections. - **The edit_file tool requires three parameters:** - \`target_file\`: Full path to the file to modify diff --git a/src/core/tools/editFileTool.ts b/src/core/tools/editFileTool.ts index 72a52580e2..73da69f527 100644 --- a/src/core/tools/editFileTool.ts +++ b/src/core/tools/editFileTool.ts @@ -14,6 +14,7 @@ import { DEFAULT_HEADERS } from "../../api/providers/constants" import { TelemetryService } from "@roo-code/telemetry" import { type ClineProviderState } from "../webview/ClineProvider" import { ClineSayTool } from "../../shared/ExtensionMessage" +import { ProviderSettingsManager } from "../config/ProviderSettingsManager" import { X_KILOCODE_ORGANIZATIONID, X_KILOCODE_TASKID, X_KILOCODE_TESTER } from "../../shared/kilocode/headers" const FAST_APPLY_MODEL_PRICING = { @@ -225,16 +226,18 @@ async function applyFastApplyEdit( filePath: string, ): Promise { try { - // Get the current API configuration + const state = await cline.providerRef.deref()?.getState() + if (!state) { + return { success: false, error: "Unable to get provider state" } + } + const provider = cline.providerRef.deref() if (!provider) { - return { success: false, error: "No API provider available for Fast Apply" } + return { success: false, error: "Unable to get provider reference" } } - const state = await provider.getState() - // Check if user has Fast Apply enabled via OpenRouter or direct API - const morphConfig = await getFastApplyConfiguration(state) + const morphConfig = await getFastApplyConfiguration(state, provider.providerSettingsManager) if (!morphConfig.available) { return { success: false, error: morphConfig.error || "Fast Apply is not available" } } @@ -328,7 +331,10 @@ interface FastApplyConfiguration { kiloCodeOrganizationId?: string } -function getFastApplyConfiguration(state: ClineProviderState): FastApplyConfiguration { +async function getFastApplyConfiguration( + state: ClineProviderState, + providerSettingsManager: ProviderSettingsManager, +): Promise { // Check if Fast Apply is enabled in API configuration if (state.experiments.morphFastApply !== true) { return { @@ -339,6 +345,9 @@ function getFastApplyConfiguration(state: ClineProviderState): FastApplyConfigur // Read the selected model from state const selectedModel = state.fastApplyModel || "auto" + // Get the provider type and profile ID from state + const providerType = state.fastApplyProviderType || "morph" + const profileId = state.fastApplyProfileId // Priority 1: Use direct Morph API key if available // Allow human-relay for debugging @@ -351,46 +360,51 @@ function getFastApplyConfiguration(state: ClineProviderState): FastApplyConfigur model: org === "morph" ? model : "auto", // Use selected model instead of hardcoded "auto" } } - - // Priority 2: Use KiloCode provider - if (state.apiConfiguration?.apiProvider === "kilocode") { - const token = state.apiConfiguration.kilocodeToken - if (!token) { - return { available: false, error: "No KiloCode token available to use Fast Apply" } - } - return { - available: true, - apiKey: token, - baseUrl: `${getKiloBaseUriFromToken(token)}/api/openrouter/`, - model: selectedModel === "auto" ? "morph/morph-v3-large" : selectedModel, // Use selected model - kiloCodeOrganizationId: state.apiConfiguration.kilocodeOrganizationId, - } - } - - // Priority 3: Use OpenRouter provider - if (state.apiConfiguration?.apiProvider === "openrouter") { - const token = state.apiConfiguration.openRouterApiKey - if (!token) { - return { available: false, error: "No OpenRouter API token available to use Fast Apply" } - } - return { - available: true, - apiKey: token, - baseUrl: state.apiConfiguration.openRouterBaseUrl || "https://openrouter.ai/api/v1", - model: selectedModel === "auto" ? "morph/morph-v3-large" : selectedModel, // Use selected model + // Priority 2: Use profile-based configuration if provider type is openrouter or kilocode + if ((providerType === "openrouter" || providerType === "kilocode") && profileId) { + try { + // Get the profile details from the provider settings manager + const profile = await providerSettingsManager.getProfile({ id: profileId }) + + if (providerType === "kilocode") { + // KiloCode provider + const token = profile.kilocodeToken + if (!token) { + return { available: false, error: "No KiloCode token available in selected profile" } + } + return { + available: true, + apiKey: token, + baseUrl: `${getKiloBaseUriFromToken(token)}/api/openrouter/`, + model: selectedModel === "auto" ? "morph/morph-v3-large" : selectedModel, // Use selected model + kiloCodeOrganizationId: profile.kilocodeOrganizationId, + } + } else if (providerType === "openrouter") { + // OpenRouter provider + const token = profile.openRouterApiKey + if (!token) { + return { available: false, error: "No OpenRouter API token available in selected profile" } + } + return { + available: true, + apiKey: token, + baseUrl: profile.openRouterBaseUrl, + model: selectedModel === "auto" ? "morph/morph-v3-large" : selectedModel, // Use selected model + } + } + } catch (error) { + return { + available: false, + error: `Failed to load profile: ${error instanceof Error ? error.message : "Unknown error"}`, + } } } - return { - available: false, - error: "Fast Apply configuration error. Please check your settings.", - } + return { available: false, error: "No valid Fast Apply configuration found" } } export function isFastApplyAvailable(state?: ClineProviderState): boolean { - return (state && getFastApplyConfiguration(state).available) || false -} - -export function getFastApplyModelType(state?: ClineProviderState): "Morph" | "Relace" { - return state && getFastApplyConfiguration(state).model?.startsWith("relace/") ? "Relace" : "Morph" + // For availability check, we only check if morphFastApply is enabled + // We don't validate the full configuration since we don't have providerSettingsManager here + return state?.experiments?.morphFastApply === true } diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index a5ec83b596..534b416fde 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1889,6 +1889,8 @@ export class ClineProvider dismissedNotificationIds, // kilocode_change morphApiKey, // kilocode_change fastApplyModel, // kilocode_change: Fast Apply model selection + fastApplyProviderType, // kilocode_change: Fast Apply provider type + fastApplyProfileId, // kilocode_change: Fast Apply profile ID alwaysAllowFollowupQuestions, followupAutoApproveTimeoutMs, includeDiagnosticMessages, @@ -2068,6 +2070,8 @@ export class ClineProvider dismissedNotificationIds: dismissedNotificationIds ?? [], // kilocode_change morphApiKey, // kilocode_change fastApplyModel: fastApplyModel ?? "auto", // kilocode_change: Fast Apply model selection + fastApplyProviderType, // kilocode_change: Fast Apply provider type + fastApplyProfileId, // kilocode_change: Fast Apply profile ID alwaysAllowFollowupQuestions: alwaysAllowFollowupQuestions ?? false, followupAutoApproveTimeoutMs: followupAutoApproveTimeoutMs ?? 60000, includeDiagnosticMessages: includeDiagnosticMessages ?? true, @@ -2282,6 +2286,8 @@ export class ClineProvider dismissedNotificationIds: stateValues.dismissedNotificationIds ?? [], // kilocode_change morphApiKey: stateValues.morphApiKey, // kilocode_change fastApplyModel: stateValues.fastApplyModel ?? "auto", // kilocode_change: Fast Apply model selection + fastApplyProviderType: stateValues.fastApplyProviderType, // kilocode_change: Fast Apply provider type selection + fastApplyProfileId: stateValues.fastApplyProfileId, // kilocode_change: Fast Apply profile ID historyPreviewCollapsed: stateValues.historyPreviewCollapsed ?? false, reasoningBlockCollapsed: stateValues.reasoningBlockCollapsed ?? true, cloudUserInfo, diff --git a/src/core/webview/webviewMessageHandler.ts b/src/core/webview/webviewMessageHandler.ts index f9e839ceb4..40e632191f 100644 --- a/src/core/webview/webviewMessageHandler.ts +++ b/src/core/webview/webviewMessageHandler.ts @@ -1438,6 +1438,16 @@ export const webviewMessageHandler = async ( await provider.postStateToWebview() break } + case "fastApplyProviderType": + const providerType = message.text as "morph" | "openrouter" | "kilocode" | undefined + await updateGlobalState("fastApplyProviderType", providerType) + await provider.postStateToWebview() + break + + case "fastApplyProfileId": + await updateGlobalState("fastApplyProfileId", message.text) + await provider.postStateToWebview() + break // kilocode_change end case "updateVSCodeSetting": { const { setting, value } = message diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 8e2d1ecfa6..b50134566a 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -332,6 +332,8 @@ export type ExtensionState = Pick< | "fuzzyMatchThreshold" | "morphApiKey" // kilocode_change: Morph fast apply - global setting | "fastApplyModel" // kilocode_change: Fast Apply model selection + | "fastApplyProviderType" // kilocode_change: Fast Apply provider type selection + | "fastApplyProfileId" // kilocode_change: Fast Apply profile ID // | "experiments" // Optional in GlobalSettings, required here. | "language" // | "telemetrySetting" // Optional in GlobalSettings, required here. diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index bd509cafff..c5f97165f4 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -128,6 +128,8 @@ export interface WebviewMessage { | "fuzzyMatchThreshold" | "morphApiKey" // kilocode_change: Morph fast apply - global setting | "fastApplyModel" // kilocode_change: Fast Apply model selection + | "fastApplyProviderType" // kilocode_change: Fast Apply provider type + | "fastApplyProfileId" // kilocode_change: Fast Apply profile ID | "writeDelayMs" | "diagnosticsEnabled" | "enhancePrompt" diff --git a/webview-ui/src/components/settings/ExperimentalSettings.tsx b/webview-ui/src/components/settings/ExperimentalSettings.tsx index b98fb03e5e..01296393ed 100644 --- a/webview-ui/src/components/settings/ExperimentalSettings.tsx +++ b/webview-ui/src/components/settings/ExperimentalSettings.tsx @@ -24,7 +24,12 @@ type ExperimentalSettingsProps = HTMLAttributes & { // kilocode_change start morphApiKey?: string fastApplyModel?: string - setCachedStateField: SetCachedStateField<"morphApiKey" | "fastApplyModel"> + fastApplyProviderType?: "morph" | "openrouter" | "kilocode" + fastApplyProfileId?: string + setMorphApiKey: (apiKey: string) => void + setFastApplyModel: (model: string) => void + setFastApplyProviderType: (providerType: "morph" | "openrouter" | "kilocode") => void + setFastApplyProfileId: (profileId: string) => void kiloCodeImageApiKey?: string setKiloCodeImageApiKey?: (apiKey: string) => void currentProfileKilocodeToken?: string @@ -50,7 +55,12 @@ export const ExperimentalSettings = ({ // kilocode_change start morphApiKey, fastApplyModel, // kilocode_change: Fast Apply model selection - setCachedStateField, + fastApplyProviderType, + fastApplyProfileId, + setMorphApiKey, + setFastApplyModel, + setFastApplyProviderType, + setFastApplyProfileId, setKiloCodeImageApiKey, kiloCodeImageApiKey, currentProfileKilocodeToken, @@ -104,9 +114,14 @@ export const ExperimentalSettings = ({ /> {enabled && ( )} diff --git a/webview-ui/src/components/settings/FastApplySettings.tsx b/webview-ui/src/components/settings/FastApplySettings.tsx index 4743d6e10f..ceea57ae58 100644 --- a/webview-ui/src/components/settings/FastApplySettings.tsx +++ b/webview-ui/src/components/settings/FastApplySettings.tsx @@ -1,52 +1,223 @@ -// kilocode_change: Fast Apply - global settings version +import React, { useState, useEffect } from "react" import { VSCodeDropdown, VSCodeOption, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import { useAppTranslation } from "@/i18n/TranslationContext" -import { SetCachedStateField } from "./types" +import { useExtensionState } from "@src/context/ExtensionStateContext" + +interface FastApplySettingsProps { + morphApiKey?: string + fastApplyModel?: string + fastApplyProviderType?: "morph" | "openrouter" | "kilocode" + fastApplyProfileId?: string + setMorphApiKey: (apiKey: string) => void + setFastApplyModel: (model: string) => void + setFastApplyProviderType: (providerType: "morph" | "openrouter" | "kilocode") => void + setFastApplyProfileId: (profileId: string) => void +} + +const FAST_APPLY_MODELS = [ + { value: "auto", label: "Auto" }, + { value: "morph/morph-v3-fast", label: "Morph v3 Fast" }, + { value: "morph/morph-v3-large", label: "Morph v3 Large" }, + { value: "relace/relace-apply-3", label: "Relace Apply 3" }, +] export const FastApplySettings = ({ morphApiKey, fastApplyModel, - setCachedStateField, -}: { - morphApiKey?: string - fastApplyModel?: string - setCachedStateField: SetCachedStateField<"morphApiKey" | "fastApplyModel"> -}) => { + fastApplyProviderType, + fastApplyProfileId, + setMorphApiKey, + setFastApplyModel, + setFastApplyProviderType, + setFastApplyProfileId, +}: FastApplySettingsProps) => { const { t } = useAppTranslation() + const { listApiConfigMeta = [] } = useExtensionState() + + // Local state to track which provider is selected (like isUsingOpenRouter) + const [currentProviderType, setCurrentProviderType] = useState<"morph" | "openrouter" | "kilocode">( + fastApplyProviderType || "morph", + ) + + // DEBUG: Log when props are received + useEffect(() => { + console.log("[FastApplySettings] Props received:", { + fastApplyProviderType, + fastApplyProfileId, + morphApiKey: morphApiKey ? `***${morphApiKey.length}chars` : undefined, + fastApplyModel, + }) + }, [fastApplyProviderType, fastApplyProfileId, morphApiKey, fastApplyModel]) + + // Effect to handle side effects like default models (like ImageGenerationSettings lines 43-70) + useEffect(() => { + const defaultModel = FAST_APPLY_MODELS[0].value + + // Ensure model has a default value + if (!fastApplyModel) { + setFastApplyModel(defaultModel) + } + }, [fastApplyModel, setFastApplyModel]) + + // Get available profiles + const openRouterProfiles = listApiConfigMeta.filter((profile) => profile.apiProvider === "openrouter") + const kiloCodeProfiles = listApiConfigMeta.filter((profile) => profile.apiProvider === "kilocode") + const selectedProfile = listApiConfigMeta.find((profile) => profile.id === fastApplyProfileId) + + // Handler functions (like lines 74-87) + const handleMorphApiKeyChange = (value: string) => { + setMorphApiKey(value) + } + + const handleModelChange = (value: string) => { + setFastApplyModel(value) + } + + const handleProfileIdChange = (value: string) => { + setFastApplyProfileId(value) + } + + // Determine if configuration is valid + const isConfigValid = () => { + if (currentProviderType === "morph") { + return morphApiKey && morphApiKey.trim() !== "" + } else { + const profiles = currentProviderType === "openrouter" ? openRouterProfiles : kiloCodeProfiles + return profiles.length > 0 && fastApplyProfileId && selectedProfile?.apiProvider === currentProviderType + } + } + return ( -
+
+ {/* Provider Type Selector */}
setCachedStateField("fastApplyModel", (e.target as any)?.value || "auto")} + value={currentProviderType} + onChange={(e: any) => { + const newValue = (e.target as any)?.value || "morph" + // Update local state AND parent (this is where user action happens) + setCurrentProviderType(newValue) + setFastApplyProviderType(newValue) + }} className="w-full"> - {t("settings:experimental.MORPH_FAST_APPLY.models.auto")} - - {t("settings:experimental.MORPH_FAST_APPLY.models.morphFast")} + + {t("settings:experimental.MORPH_FAST_APPLY.providerTypes.morph")} - - {t("settings:experimental.MORPH_FAST_APPLY.models.morphLarge")} + + {t("settings:experimental.MORPH_FAST_APPLY.providerTypes.openrouter")} - - {t("settings:experimental.MORPH_FAST_APPLY.models.relace")} + + {t("settings:experimental.MORPH_FAST_APPLY.providerTypes.kilocode")} +
+ + {/* Morph API Key Input */} + {currentProviderType === "morph" && ( + handleMorphApiKeyChange((e.target as any)?.value || "")} + className="w-full"> + {t("settings:experimental.MORPH_FAST_APPLY.apiKey")} + + )} + + {/* OpenRouter Profile Selector */} + {currentProviderType === "openrouter" && ( +
+ + {openRouterProfiles.length > 0 ? ( + handleProfileIdChange((e.target as any)?.value || "")} + className="w-full"> + + {t("settings:experimental.MORPH_FAST_APPLY.selectProfile")} + + {openRouterProfiles.map((profile) => ( + + {profile.name} + + ))} + + ) : ( +

+ {t("settings:experimental.MORPH_FAST_APPLY.noOpenRouterProfiles")} +

+ )} +
+ )} + + {/* KiloCode Profile Selector */} + {currentProviderType === "kilocode" && ( +
+ + {kiloCodeProfiles.length > 0 ? ( + handleProfileIdChange((e.target as any)?.value || "")} + className="w-full"> + + {t("settings:experimental.MORPH_FAST_APPLY.selectProfile")} + + {kiloCodeProfiles.map((profile) => ( + + {profile.name} + + ))} + + ) : ( +

+ {t("settings:experimental.MORPH_FAST_APPLY.noKiloCodeProfiles")} +

+ )} +
+ )} + + {/* Model Selection */} +
+ + handleModelChange((e.target as any)?.value || "auto")} + className="w-full"> + {FAST_APPLY_MODELS.map((model) => ( + + {t( + `settings:experimental.MORPH_FAST_APPLY.models.${model.value === "auto" ? "auto" : model.value.replace("/", "_").replace("-", "_")}`, + )} + + ))} +

{t("settings:experimental.MORPH_FAST_APPLY.modelDescription")}

- setCachedStateField("morphApiKey", (e.target as any)?.value || "")} - className="w-full"> - {t("settings:experimental.MORPH_FAST_APPLY.apiKey")} - + {/* Warning Message */} + {!isConfigValid() && ( +
+ {t("settings:experimental.MORPH_FAST_APPLY.warningInvalidConfig")} +
+ )} + + {/* Success Message */} + {isConfigValid() && ( +
+ {t("settings:experimental.MORPH_FAST_APPLY.successConfigured")} +
+ )}
) } diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index aee0bd3cbc..377beaef28 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -182,6 +182,8 @@ const SettingsView = forwardRef(({ onDone, t experiments, morphApiKey, // kilocode_change fastApplyModel, // kilocode_change: Fast Apply model selection + fastApplyProviderType, // kilocode_change: Fast Apply provider type + fastApplyProfileId, // kilocode_change: Fast Apply profile ID fuzzyMatchThreshold, maxOpenTabsContext, maxWorkspaceFiles, @@ -354,7 +356,51 @@ const SettingsView = forwardRef(({ onDone, t return { ...prevState, kiloCodeImageApiKey: apiKey } }) }, []) + const setMorphApiKey = useCallback((apiKey: string) => { + console.log(`[SettingsView] setMorphApiKey called with length: ${apiKey.length}`) + setCachedState((prevState) => { + console.log(`[SettingsView] setMorphApiKey updating cachedState`) + setChangeDetected(true) + return { ...prevState, morphApiKey: apiKey } + }) + }, []) + + const setFastApplyModel = useCallback((model: string) => { + console.log(`[SettingsView] setFastApplyModel called with: ${model}`) + setCachedState((prevState) => { + console.log(`[SettingsView] setFastApplyModel updating cachedState`) + setChangeDetected(true) + return { + ...prevState, + fastApplyModel: model as + | "auto" + | "morph/morph-v3-fast" + | "morph/morph-v3-large" + | "relace/relace-apply-3" + | undefined, + } + }) + }, []) + const setFastApplyProviderType = useCallback((providerType: "morph" | "openrouter" | "kilocode") => { + console.log(`[SettingsView] setFastApplyProviderType called with: ${providerType}`) + setCachedState((prevState) => { + console.log( + `[SettingsView] setFastApplyProviderType updating cachedState, current value: ${prevState.fastApplyProviderType}`, + ) + setChangeDetected(true) + return { ...prevState, fastApplyProviderType: providerType } + }) + }, []) + + const setFastApplyProfileId = useCallback((profileId: string) => { + console.log(`[SettingsView] setFastApplyProfileId called with: ${profileId}`) + setCachedState((prevState) => { + console.log(`[SettingsView] setFastApplyProfileId updating cachedState`) + setChangeDetected(true) + return { ...prevState, fastApplyProfileId: profileId } + }) + }, []) const setImageGenerationSelectedModel = useCallback((model: string) => { setCachedState((prevState) => { setChangeDetected(true) @@ -454,14 +500,18 @@ const SettingsView = forwardRef(({ onDone, t vscode.postMessage({ type: "ghostServiceSettings", values: ghostServiceSettings }) // kilocode_change vscode.postMessage({ type: "morphApiKey", text: morphApiKey }) // kilocode_change vscode.postMessage({ type: "fastApplyModel", text: fastApplyModel }) // kilocode_change: Fast Apply model selection + console.log(`[SettingsView.handleSubmit] Sending fastApplyProviderType: ${fastApplyProviderType}`) + vscode.postMessage({ type: "fastApplyProviderType", text: fastApplyProviderType }) // kilocode_change: Fast Apply provider type + console.log(`[SettingsView.handleSubmit] Sending fastApplyProfileId: ${fastApplyProfileId}`) + vscode.postMessage({ type: "fastApplyProfileId", text: fastApplyProfileId }) // kilocode_change: Fast Apply profile ID vscode.postMessage({ type: "openRouterImageApiKey", text: openRouterImageApiKey }) vscode.postMessage({ type: "kiloCodeImageApiKey", text: kiloCodeImageApiKey }) vscode.postMessage({ type: "openRouterImageGenerationSelectedModel", text: openRouterImageGenerationSelectedModel, }) - // Update cachedState to match the current state to prevent isChangeDetected from being set back to true - setCachedState((prevState) => ({ ...prevState, ...extensionState })) + // CRITICAL: Set this synchronously BEFORE any async operations + // This prevents the "overwrite unsaved changes" workaround from firing setChangeDetected(false) } } @@ -919,9 +969,14 @@ const SettingsView = forwardRef(({ onDone, t setExperimentEnabled={setExperimentEnabled} experiments={experiments} // kilocode_change start - setCachedStateField={setCachedStateField} morphApiKey={morphApiKey} fastApplyModel={fastApplyModel} + fastApplyProviderType={fastApplyProviderType} + fastApplyProfileId={fastApplyProfileId} + setMorphApiKey={setMorphApiKey} + setFastApplyModel={setFastApplyModel} + setFastApplyProviderType={setFastApplyProviderType} + setFastApplyProfileId={setFastApplyProfileId} // kilocode_change end apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 432512e94e..6ec5ee5f74 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -781,16 +781,31 @@ "MORPH_FAST_APPLY": { "name": "Enable Fast Apply", "description": "When enabled, Kilo Code can edit files using Fast Apply with specialized models optimized for code modifications. Requires the Kilo Code API Provider, OpenRouter, or a Morph API key.", + "providerTypeLabel": "Provider Type", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilo Code" + }, "apiKey": "Morph API key (optional)", "placeholder": "Enter your Morph API key (optional)", + "profileLabel": "API Profile", + "selectProfile": "Select a profile", + "noOpenRouterProfiles": "No OpenRouter profiles configured. Please add an OpenRouter profile in the Providers section.", + "noKiloCodeProfiles": "No Kilo Code profiles configured. Please add a Kilo Code profile in the Providers section.", "modelLabel": "Model Selection", "modelDescription": "Choose which Fast Apply model to use for file edits", "models": { "auto": "Auto (Default - chooses best available)", "morphFast": "Morph v3 Fast (Faster, lower cost)", "morphLarge": "Morph v3 Large (More capable)", - "relace": "Relace Apply v3" - } + "relace": "Relace Apply v3", + "morph_morph_v3_fast": "Morph v3 Fast", + "morph_morph_v3_large": "Morph v3 Large", + "relace_relace_apply_3": "Relace Apply 3" + }, + "warningInvalidConfig": "⚠️ Configuration incomplete. Please select a provider and configure the required settings above.", + "successConfigured": "✓ Fast Apply is configured and ready to use" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Background editing", From 332afd76043030ff00ef32b0176208be56cad25a Mon Sep 17 00:00:00 2001 From: Matt Cowger Date: Mon, 6 Oct 2025 15:03:51 -0700 Subject: [PATCH 2/4] Missed unused item. --- webview-ui/src/components/settings/ExperimentalSettings.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/webview-ui/src/components/settings/ExperimentalSettings.tsx b/webview-ui/src/components/settings/ExperimentalSettings.tsx index 01296393ed..46366fea6d 100644 --- a/webview-ui/src/components/settings/ExperimentalSettings.tsx +++ b/webview-ui/src/components/settings/ExperimentalSettings.tsx @@ -8,10 +8,7 @@ import { EXPERIMENT_IDS, experimentConfigsMap } from "@roo/experiments" import { useAppTranslation } from "@src/i18n/TranslationContext" import { cn } from "@src/lib/utils" -import { - SetCachedStateField, // kilocode_change - SetExperimentEnabled, -} from "./types" +import { SetExperimentEnabled } from "./types" import { SectionHeader } from "./SectionHeader" import { Section } from "./Section" import { ExperimentalFeature } from "./ExperimentalFeature" From c8d55e1743dd2844252fd20964dba8cec89400fb Mon Sep 17 00:00:00 2001 From: Matt Cowger Date: Mon, 6 Oct 2025 15:13:04 -0700 Subject: [PATCH 3/4] Fixed label display --- webview-ui/src/components/settings/FastApplySettings.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webview-ui/src/components/settings/FastApplySettings.tsx b/webview-ui/src/components/settings/FastApplySettings.tsx index ceea57ae58..090856e902 100644 --- a/webview-ui/src/components/settings/FastApplySettings.tsx +++ b/webview-ui/src/components/settings/FastApplySettings.tsx @@ -194,9 +194,7 @@ export const FastApplySettings = ({ className="w-full"> {FAST_APPLY_MODELS.map((model) => ( - {t( - `settings:experimental.MORPH_FAST_APPLY.models.${model.value === "auto" ? "auto" : model.value.replace("/", "_").replace("-", "_")}`, - )} + {model.label} ))} From 6c4ed0398f32e975310710cf4d3d720b2e0cc024 Mon Sep 17 00:00:00 2001 From: Matt Cowger Date: Mon, 6 Oct 2025 19:24:49 -0700 Subject: [PATCH 4/4] Add translations --- webview-ui/src/i18n/locales/ar/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/ca/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/cs/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/de/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/en/settings.json | 23 ++++++------------- webview-ui/src/i18n/locales/es/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/fr/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/hi/settings.json | 18 ++++++++++----- webview-ui/src/i18n/locales/id/settings.json | 12 ++++++++++ webview-ui/src/i18n/locales/it/settings.json | 17 +++++++++++--- webview-ui/src/i18n/locales/ja/settings.json | 18 ++++++++++----- webview-ui/src/i18n/locales/ko/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/nl/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/pl/settings.json | 14 ++++++++++- .../src/i18n/locales/pt-BR/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/ru/settings.json | 14 ++++++++++- webview-ui/src/i18n/locales/th/settings.json | 18 ++++++++++----- webview-ui/src/i18n/locales/tr/settings.json | 18 ++++++++++----- webview-ui/src/i18n/locales/uk/settings.json | 22 ++++++++++++++---- webview-ui/src/i18n/locales/vi/settings.json | 18 ++++++++++----- .../src/i18n/locales/zh-CN/settings.json | 18 ++++++++++----- .../src/i18n/locales/zh-TW/settings.json | 14 ++++++++++- 22 files changed, 278 insertions(+), 72 deletions(-) diff --git a/webview-ui/src/i18n/locales/ar/settings.json b/webview-ui/src/i18n/locales/ar/settings.json index bde8480e13..66cba3517e 100644 --- a/webview-ui/src/i18n/locales/ar/settings.json +++ b/webview-ui/src/i18n/locales/ar/settings.json @@ -831,7 +831,19 @@ "morphFast": "Morph v3 السريع (أسرع، تكلفة أقل)", "morphLarge": "Morph v3 الكبير (أكثر قدرة)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "نوع المزوّد", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "ملف API", + "selectProfile": "اختر ملف", + "noOpenRouterProfiles": "لم يتم تكوين ملفات OpenRouter. يرجى إضافة ملف OpenRouter في قسم المزوّدين.", + "noKiloCodeProfiles": "لم يتم تكوين ملفات Kilocode. يرجى إضافة ملف Kilocode في قسم المزوّدين.", + "warningInvalidConfig": "التكوين غير مكتمل. يرجى اختيار مزوّد وتكوين الإعدادات المطلوبة أعلاه.", + "successConfigured": "تم تكوين التطبيق السريع وهو جاهز للاستخدام" }, "PREVENT_FOCUS_DISRUPTION": { "name": "التحرير في الخلفية", diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index 69d8b7296c..cb7514bfab 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -803,7 +803,19 @@ "morphFast": "Morph v3 Fast (Més ràpid, cost més baix)", "morphLarge": "Morph v3 Large (Més capaç)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Tipus de proveïdor", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Perfil d'API", + "selectProfile": "Selecciona un perfil", + "noOpenRouterProfiles": "No hi ha perfils d'OpenRouter configurats. Si us plau, afegiu un perfil d'OpenRouter a la secció de Proveïdors.", + "noKiloCodeProfiles": "No hi ha perfils de Kilocode configurats. Si us plau, afegiu un perfil de Kilocode a la secció de Proveïdors.", + "warningInvalidConfig": "Configuració incompleta. Si us plau, seleccioneu un proveïdor i configureu els ajustos requerits a dalt.", + "successConfigured": "Fast Apply està configurat i llest per utilitzar" }, "RUN_SLASH_COMMAND": { "name": "Habilitar comandes de barra diagonal iniciades pel model", diff --git a/webview-ui/src/i18n/locales/cs/settings.json b/webview-ui/src/i18n/locales/cs/settings.json index 5f5ce355f0..63761ae7fb 100644 --- a/webview-ui/src/i18n/locales/cs/settings.json +++ b/webview-ui/src/i18n/locales/cs/settings.json @@ -814,7 +814,19 @@ "morphFast": "Morph v3 Fast (rychlejší, nižší náklady)", "morphLarge": "Morph v3 Large (schopnější)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Typ poskytovatele", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "API profil", + "selectProfile": "Vyberte profil", + "noOpenRouterProfiles": "Nenakonfigurovány žádné profily OpenRouter. Přidejte prosím profil OpenRouter v sekci Poskytovatelé.", + "noKiloCodeProfiles": "Nenakonfigurovány žádné profily Kilocode. Přidejte prosím profil Kilocode v sekci Poskytovatelé.", + "warningInvalidConfig": "Konfigurace neúplná. Vyberte prosím poskytovatele a nakonfigurujte požadovaná nastavení výše.", + "successConfigured": "Rychlé aplikování je nakonfigurováno a připraveno k použití" }, "SEARCH_AND_REPLACE": { "name": "Použít experimentální nástroj hledání a nahrazování", diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index 06daa3af3a..a18267be81 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -772,7 +772,19 @@ "morphFast": "Morph v3 Fast (Schneller, niedrigere Kosten)", "morphLarge": "Morph v3 Large (Leistungsfähiger)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Anbietertyp", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "API-Profil", + "selectProfile": "Profil auswählen", + "noOpenRouterProfiles": "Keine OpenRouter-Profile konfiguriert. Bitte füge ein OpenRouter-Profil im Abschnitt 'Anbieter' hinzu.", + "noKiloCodeProfiles": "Keine Kilocode-Profile konfiguriert. Bitte füge ein Kilocode-Profil im Abschnitt 'Anbieter' hinzu.", + "warningInvalidConfig": "Konfiguration unvollständig. Bitte wähle einen Anbieter aus und konfiguriere die erforderlichen Einstellungen oben.", + "successConfigured": "Fast Apply ist konfiguriert und einsatzbereit" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Hintergrundbearbeitung", diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 6ec5ee5f74..e957c18db2 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -780,32 +780,23 @@ }, "MORPH_FAST_APPLY": { "name": "Enable Fast Apply", - "description": "When enabled, Kilo Code can edit files using Fast Apply with specialized models optimized for code modifications. Requires the Kilo Code API Provider, OpenRouter, or a Morph API key.", + "description": "When enabled, Kilocode edits files with Fast Apply using code-optimized models. Requires one configured Kilocode API provider, OpenRouter, or Morph API key.", "providerTypeLabel": "Provider Type", "providerTypes": { "morph": "Morph", "openrouter": "OpenRouter", - "kilocode": "Kilo Code" + "kilocode": "Kilocode" }, - "apiKey": "Morph API key (optional)", - "placeholder": "Enter your Morph API key (optional)", + "apiKey": "Morph API key", + "placeholder": "Enter your Morph API key", "profileLabel": "API Profile", "selectProfile": "Select a profile", "noOpenRouterProfiles": "No OpenRouter profiles configured. Please add an OpenRouter profile in the Providers section.", - "noKiloCodeProfiles": "No Kilo Code profiles configured. Please add a Kilo Code profile in the Providers section.", + "noKiloCodeProfiles": "No Kilocode profiles configured. Please add a Kilocode profile in the Providers section.", "modelLabel": "Model Selection", "modelDescription": "Choose which Fast Apply model to use for file edits", - "models": { - "auto": "Auto (Default - chooses best available)", - "morphFast": "Morph v3 Fast (Faster, lower cost)", - "morphLarge": "Morph v3 Large (More capable)", - "relace": "Relace Apply v3", - "morph_morph_v3_fast": "Morph v3 Fast", - "morph_morph_v3_large": "Morph v3 Large", - "relace_relace_apply_3": "Relace Apply 3" - }, - "warningInvalidConfig": "⚠️ Configuration incomplete. Please select a provider and configure the required settings above.", - "successConfigured": "✓ Fast Apply is configured and ready to use" + "warningInvalidConfig": "Configuration incomplete. Please select a provider and configure the required settings above.", + "successConfigured": "Fast Apply is configured and ready to use" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Background editing", diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 022d20d355..13c535c8a6 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -772,7 +772,19 @@ "morphFast": "Morph v3 Fast (Más rápido, menor costo)", "morphLarge": "Morph v3 Large (Más capaz)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Tipo de proveedor", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Perfil de API", + "selectProfile": "Seleccionar un perfil", + "noOpenRouterProfiles": "No hay perfiles de OpenRouter configurados. Por favor, añade un perfil de OpenRouter en la sección de Proveedores.", + "noKiloCodeProfiles": "No hay perfiles de Kilocode configurados. Por favor, añade un perfil de Kilocode en la sección de Proveedores.", + "warningInvalidConfig": "Configuración incompleta. Por favor, selecciona un proveedor y configura los ajustes requeridos arriba.", + "successConfigured": "Fast Apply está configurado y listo para usar" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Edición en segundo plano", diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 92f9c90ed7..44d97f8754 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -772,7 +772,19 @@ "morphFast": "Morph v3 Fast (Plus rapide, coût réduit)", "morphLarge": "Morph v3 Large (Plus performant)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Type de fournisseur", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Profil API", + "selectProfile": "Sélectionner un profil", + "noOpenRouterProfiles": "Aucun profil OpenRouter configuré. Veuillez ajouter un profil OpenRouter dans la section Fournisseurs.", + "noKiloCodeProfiles": "Aucun profil Kilocode configuré. Veuillez ajouter un profil Kilocode dans la section Fournisseurs.", + "warningInvalidConfig": "Configuration incomplète. Veuillez sélectionner un fournisseur et configurer les paramètres requis ci-dessus.", + "successConfigured": "Fast Apply est configuré et prêt à l'emploi" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Édition en arrière-plan", diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index 38278c8da3..625ceda839 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -768,12 +768,18 @@ "placeholder": "अपनी Morph API कुंजी दर्ज करें (वैकल्पिक)", "modelLabel": "मॉडल चयन", "modelDescription": "फ़ाइल संपादन के लिए किस Fast Apply मॉडल का उपयोग करना है चुनें", - "models": { - "auto": "स्वचालित (डिफ़ॉल्ट - सर्वोत्तम उपलब्ध चुनता है)", - "morphFast": "Morph v3 Fast (तेज़, कम लागत)", - "morphLarge": "Morph v3 Large (अधिक सक्षम)", - "relace": "Relace Apply v3" - } + "providerTypeLabel": "प्रदाता प्रकार", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "प्रोफ़ाइल API", + "selectProfile": "प्रोफ़ाइल चुनें", + "noOpenRouterProfiles": "कोई OpenRouter प्रोफ़ाइल कॉन्फ़िगर नहीं है। कृपया प्रदाताओं अनुभाग में एक OpenRouter प्रोफ़ाइल जोड़ें।", + "noKiloCodeProfiles": "कोई Kilocode प्रोफ़ाइल कॉन्फ़िगर नहीं है। कृपया प्रदाताओं अनुभाग में एक Kilocode प्रोफ़ाइल जोड़ें।", + "warningInvalidConfig": "अधूरी कॉन्फ़िगरेशन। कृपया एक प्रदाता चुनें और ऊपर आवश्यक सेटिंग्स कॉन्फ़िगर करें।", + "successConfigured": "Fast Apply कॉन्फ़िगर किया गया है और उपयोग के लिए तैयार है" }, "PREVENT_FOCUS_DISRUPTION": { "name": "बैकग्राउंड संपादन", diff --git a/webview-ui/src/i18n/locales/id/settings.json b/webview-ui/src/i18n/locales/id/settings.json index 7e9f0f524c..64369410c4 100644 --- a/webview-ui/src/i18n/locales/id/settings.json +++ b/webview-ui/src/i18n/locales/id/settings.json @@ -785,6 +785,18 @@ "MORPH_FAST_APPLY": { "name": "Aktifkan Fast Apply", "description": "Ketika diaktifkan, Kilo Code dapat mengedit file menggunakan Fast Apply dengan model khusus yang dioptimalkan untuk modifikasi kode. Memerlukan Kilo Code API Provider, OpenRouter, atau kunci API Morph.", + "providerTypeLabel": "Jenis Provider", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Profil API", + "selectProfile": "Pilih profil", + "noOpenRouterProfiles": "Tidak ada profil OpenRouter yang dikonfigurasi. Harap tambahkan profil OpenRouter di bagian Provider.", + "noKiloCodeProfiles": "Tidak ada profil Kilocode yang dikonfigurasi. Harap tambahkan profil Kilocode di bagian Provider.", + "warningInvalidConfig": "Konfigurasi tidak lengkap. Harap pilih provider dan konfigurasikan pengaturan yang diperlukan di atas.", + "successConfigured": "Fast Apply telah dikonfigurasi dan siap digunakan", "apiKey": "Kunci API Morph (opsional)", "placeholder": "Masukkan kunci API Morph kamu (opsional)", "modelLabel": "Pemilihan Model", diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index 1ba8a857b8..879493e7b8 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -34,8 +34,7 @@ "experimental": "Sperimentale", "language": "Lingua", "about": "Informazioni su Kilo Code", - "display": "Mostra", - "ghost": "Ghost" + "display": "Mostra" }, "slashCommands": { "description": "Gestisci i tuoi comandi slash per eseguire rapidamente flussi di lavoro e azioni personalizzate. Scopri di più" @@ -805,7 +804,19 @@ "morphFast": "Morph v3 Fast (Più veloce, costo inferiore)", "morphLarge": "Morph v3 Large (Più capace)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Tipo di Provider", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Profilo API", + "selectProfile": "Seleziona un profilo", + "noOpenRouterProfiles": "Nessun profilo OpenRouter configurato. Aggiungi un profilo OpenRouter nella sezione Provider.", + "noKiloCodeProfiles": "Nessun profilo Kilocode configurato. Aggiungi un profilo Kilocode nella sezione Provider.", + "warningInvalidConfig": "Configurazione incompleta. Seleziona un provider e configura le impostazioni richieste sopra.", + "successConfigured": "Fast Apply è configurato e pronto all'uso" }, "RUN_SLASH_COMMAND": { "name": "Abilita comandi slash avviati dal modello", diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index 44ef6e37dc..31ebdb15b1 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -796,16 +796,22 @@ "MORPH_FAST_APPLY": { "name": "Fast Applyを有効化", "description": "有効にすると、Kilo Codeはコード変更に最適化された専用モデルを使用してFast Applyでファイルを編集できます。Kilo Code APIプロバイダー、OpenRouter、またはMorph APIキーが必要です。", + "providerTypeLabel": "プロバイダータイプ", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, "apiKey": "Morph APIキー(オプション)", "placeholder": "Morph APIキーを入力してください(オプション)", + "profileLabel": "APIプロファイル", + "selectProfile": "プロファイルを選択", + "noOpenRouterProfiles": "OpenRouterプロファイルが設定されていません。プロバイダーセクションでOpenRouterプロファイルを追加してください。", + "noKiloCodeProfiles": "Kilocodeプロファイルが設定されていません。プロバイダーセクションでKilocodeプロファイルを追加してください。", "modelLabel": "モデル選択", "modelDescription": "ファイル編集に使用するFast Applyモデルを選択", - "models": { - "auto": "自動(デフォルト - 最適なものを選択)", - "morphFast": "Morph v3 Fast(高速、低コスト)", - "morphLarge": "Morph v3 Large(より高性能)", - "relace": "Relace Apply v3" - } + "warningInvalidConfig": "設定が不完全です。プロバイダーを選択し、上記の必要な設定を構成してください。", + "successConfigured": "Fast Applyが設定され、使用準備完了です" }, "RUN_SLASH_COMMAND": { "name": "モデル開始スラッシュコマンドを有効にする", diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index 2ad05f2948..ac9593d179 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -773,7 +773,19 @@ "morphFast": "Morph v3 Fast (더 빠르고 저렴한 비용)", "morphLarge": "Morph v3 Large (더 강력함)", "relace": "Relace Apply v3" - } + }, + "warningInvalidConfig": "구성이 불완전합니다. 제공자를 선택하고 위에 필요한 설정을 구성하세요.", + "successConfigured": "Fast Apply가 구성되었으며 사용할 준비가 되었습니다.", + "providerTypeLabel": "제공자 유형", + "providerTypes": { + "morph": "모프", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "API 프로필", + "selectProfile": "프로필 선택", + "noOpenRouterProfiles": "OpenRouter 프로필이 구성되지 않았습니다. 공급자 섹션에서 OpenRouter 프로필을 추가하세요.", + "noKiloCodeProfiles": "Kilocode 프로필이 구성되지 않았습니다. 공급자 섹션에서 Kilocode 프로필을 추가하세요." }, "PREVENT_FOCUS_DISRUPTION": { "name": "백그라운드 편집", diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index 16b2bdf53b..96dc163edd 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -773,7 +773,19 @@ "morphFast": "Morph v3 Fast (Sneller, lagere kosten)", "morphLarge": "Morph v3 Large (Meer capabel)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Provider Type", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "API-profiel", + "selectProfile": "Selecteer een profiel", + "noOpenRouterProfiles": "Geen OpenRouter-profielen geconfigureerd. Voeg een OpenRouter-profiel toe in de sectie Providers.", + "noKiloCodeProfiles": "Geen Kilocode-profielen geconfigureerd. Voeg een Kilocode-profiel toe in de sectie Providers.", + "warningInvalidConfig": "Configuratie onvolledig. Selecteer een provider en configureer de vereiste instellingen hierboven.", + "successConfigured": "Fast Apply is geconfigureerd en klaar voor gebruik" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Achtergrondbewerking", diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index 01008b2e40..d11f9af785 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -773,7 +773,19 @@ "morphFast": "Morph v3 Fast (Szybszy, niższy koszt)", "morphLarge": "Morph v3 Large (Bardziej zaawansowany)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Typ dostawcy", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Profil API", + "selectProfile": "Wybierz profil", + "noOpenRouterProfiles": "Brak skonfigurowanych profili OpenRouter. Dodaj profil OpenRouter w sekcji Dostawcy.", + "noKiloCodeProfiles": "Brak skonfigurowanych profili Kilocode. Dodaj profil Kilocode w sekcji Dostawcy.", + "warningInvalidConfig": "Konfiguracja niekompletna. Wybierz dostawcę i skonfiguruj wymagane ustawienia powyżej.", + "successConfigured": "Szybkie stosowanie jest skonfigurowane i gotowe do użycia" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Edycja w tle", diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 20b8a68318..d1cbc54d53 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -773,7 +773,19 @@ "morphFast": "Morph v3 Fast (Mais rápido, menor custo)", "morphLarge": "Morph v3 Large (Mais capaz)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Tipo de Provedor", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Perfil da API", + "selectProfile": "Selecionar um perfil", + "noOpenRouterProfiles": "Nenhum perfil OpenRouter configurado. Por favor, adicione um perfil OpenRouter na seção Provedores.", + "noKiloCodeProfiles": "Nenhum perfil Kilocode configurado. Por favor, adicione um perfil Kilocode na seção Provedores.", + "warningInvalidConfig": "Configuração incompleta. Por favor, selecione um provedor e configure as configurações necessárias acima.", + "successConfigured": "Fast Apply está configurado e pronto para usar" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Edição em segundo plano", diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index ed42406623..292675ed97 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -773,7 +773,19 @@ "morphFast": "Morph v3 Fast (быстрее, ниже стоимость)", "morphLarge": "Morph v3 Large (более мощная)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "Тип провайдера", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Профиль API", + "selectProfile": "Выберите профиль", + "noOpenRouterProfiles": "Профили OpenRouter не настроены. Пожалуйста, добавьте профиль OpenRouter в разделе «Провайдеры».", + "noKiloCodeProfiles": "Профили Kilocode не настроены. Пожалуйста, добавьте профиль Kilocode в разделе «Провайдеры».", + "warningInvalidConfig": "Конфигурация неполная. Пожалуйста, выберите провайдера и настройте необходимые параметры выше.", + "successConfigured": "Fast Apply настроен и готов к использованию" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Фоновое редактирование", diff --git a/webview-ui/src/i18n/locales/th/settings.json b/webview-ui/src/i18n/locales/th/settings.json index e4e188cbd7..c522f28896 100644 --- a/webview-ui/src/i18n/locales/th/settings.json +++ b/webview-ui/src/i18n/locales/th/settings.json @@ -847,12 +847,18 @@ "placeholder": "ป้อน Morph API key ของคุณ (ไม่บังคับ)", "modelLabel": "การเลือกโมเดล", "modelDescription": "เลือกโมเดล Fast Apply ที่จะใช้สำหรับการแก้ไขไฟล์", - "models": { - "auto": "อัตโนมัติ (ค่าเริ่มต้น - เลือกที่ดีที่สุดที่มี)", - "morphFast": "Morph v3 Fast (เร็วกว่า ค่าใช้จ่ายต่ำกว่า)", - "morphLarge": "Morph v3 Large (มีความสามารถมากกว่า)", - "relace": "Relace Apply v3" - } + "providerTypeLabel": "ประเภทผู้ให้บริการ", + "profileLabel": "โปรไฟล์ API", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "selectProfile": "เลือกโปรไฟล์", + "noOpenRouterProfiles": "ไม่มีโปรไฟล์ OpenRouter ที่กำหนดค่าไว้ โปรดเพิ่มโปรไฟล์ OpenRouter ในส่วนผู้ให้บริการ", + "noKiloCodeProfiles": "ไม่มีโปรไฟล์ Kilocode ที่กำหนดค่าไว้ โปรดเพิ่มโปรไฟล์ Kilocode ในส่วนผู้ให้บริการ", + "warningInvalidConfig": "การกำหนดค่าไม่สมบูรณ์ โปรดเลือกผู้ให้บริการและกำหนดค่าการตั้งค่าที่จำเป็นด้านบน", + "successConfigured": "Fast Apply ได้รับการกำหนดค่าและพร้อมใช้งาน" }, "INLINE_ASSIST": { "name": "Autocomplete", diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index 0f45ffa54d..5c86e9468b 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -769,12 +769,18 @@ "placeholder": "Morph API anahtarınızı girin (isteğe bağlı)", "modelLabel": "Model Seçimi", "modelDescription": "Dosya düzenlemeleri için hangi Hızlı Uygulama modelinin kullanılacağını seçin", - "models": { - "auto": "Otomatik (Varsayılan - en uygun olanı seçer)", - "morphFast": "Morph v3 Fast (Daha hızlı, düşük maliyet)", - "morphLarge": "Morph v3 Large (Daha yetenekli)", - "relace": "Relace Apply v3" - } + "providerTypeLabel": "Sağlayıcı Türü", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "API Profili", + "selectProfile": "Bir profil seçin", + "noOpenRouterProfiles": "OpenRouter profili yapılandırılmamış. Lütfen Sağlayıcılar bölümünde bir OpenRouter profili ekleyin.", + "noKiloCodeProfiles": "Kilocode profili yapılandırılmamış. Lütfen Sağlayıcılar bölümünde bir Kilocode profili ekleyin.", + "warningInvalidConfig": "Yapılandırma eksik. Lütfen bir sağlayıcı seçin ve yukarıdaki gerekli ayarları yapılandırın.", + "successConfigured": "Hızlı Uygulama yapılandırıldı ve kullanıma hazır" }, "PREVENT_FOCUS_DISRUPTION": { "name": "Arka plan düzenleme", diff --git a/webview-ui/src/i18n/locales/uk/settings.json b/webview-ui/src/i18n/locales/uk/settings.json index 3443ff654d..be0b5df613 100644 --- a/webview-ui/src/i18n/locales/uk/settings.json +++ b/webview-ui/src/i18n/locales/uk/settings.json @@ -862,13 +862,25 @@ "morphFast": "Morph v3 Fast (Швидше, нижча вартість)", "morphLarge": "Morph v3 Large (Більш здатна)", "relace": "Relace Apply v3" - } - }, - "INLINE_ASSIST": { - "name": "Autocomplete", - "description": "Увімкни функції Autocomplete для швидких пропозицій коду та покращень безпосередньо у твоєму редакторі. Включає Швидке Завдання (Cmd+I) для цільових змін та Autocomplete для контекстуальних покращень." + }, + "providerTypeLabel": "Тип провайдера", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Профіль API", + "selectProfile": "Виберіть профіль", + "noOpenRouterProfiles": "Профілі OpenRouter не налаштовані. Будь ласка, додайте профіль OpenRouter у розділі «Провайдери».", + "noKiloCodeProfiles": "Профілі Kilocode не налаштовані. Будь ласка, додайте профіль Kilocode у розділі «Провайдери».", + "warningInvalidConfig": "Конфігурація неповна. Будь ласка, виберіть провайдера та налаштуйте необхідні параметри вище.", + "successConfigured": "Швидке застосування налаштовано та готове до використання" } }, + "INLINE_ASSIST": { + "name": "Autocomplete", + "description": "Увімкни функції Autocomplete для швидких пропозицій коду та покращень безпосередньо у твоєму редакторі. Включає Швидке Завдання (Cmd+I) для цільових змін та Autocomplete для контекстуальних покращень." + }, "promptCaching": { "label": "Вимкнути кешування підказок", "description": "Якщо відмічено, Kilo Code не використовуватиме кешування підказок для цієї моделі." diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index 5a15d726ed..1c24fff4dd 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -799,12 +799,18 @@ "placeholder": "Nhập khóa API Morph của bạn (tùy chọn)", "modelLabel": "Lựa chọn mô hình", "modelDescription": "Chọn mô hình Fast Apply nào để sử dụng cho việc chỉnh sửa tệp", - "models": { - "auto": "Tự động (Mặc định - chọn tốt nhất có sẵn)", - "morphFast": "Morph v3 Fast (Nhanh hơn, chi phí thấp hơn)", - "morphLarge": "Morph v3 Large (Khả năng cao hơn)", - "relace": "Relace Apply v3" - } + "providerTypeLabel": "Loại nhà cung cấp", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "Hồ sơ API", + "selectProfile": "Chọn một hồ sơ", + "noOpenRouterProfiles": "Chưa cấu hình hồ sơ OpenRouter nào. Vui lòng thêm hồ sơ OpenRouter trong phần Nhà cung cấp.", + "noKiloCodeProfiles": "Chưa cấu hình hồ sơ Kilocode nào. Vui lòng thêm hồ sơ Kilocode trong phần Nhà cung cấp.", + "warningInvalidConfig": "Cấu hình chưa hoàn tất. Vui lòng chọn nhà cung cấp và cấu hình các cài đặt bắt buộc ở trên.", + "successConfigured": "Fast Apply đã được cấu hình và sẵn sàng sử dụng" }, "RUN_SLASH_COMMAND": { "name": "Bật lệnh slash do mô hình khởi tạo", diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index f80875850f..f6c20ab057 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -804,12 +804,18 @@ "placeholder": "输入您的 Morph API 密钥(可选)", "modelLabel": "模型选择", "modelDescription": "选择用于文件编辑的快速应用模型", - "models": { - "auto": "自动(默认 - 选择最佳可用)", - "morphFast": "Morph v3 Fast(更快,成本更低)", - "morphLarge": "Morph v3 Large(功能更强)", - "relace": "Relace Apply v3" - } + "providerTypeLabel": "提供商类型", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "API 配置文件", + "selectProfile": "选择配置文件", + "noOpenRouterProfiles": "未配置 OpenRouter 配置文件。请在“提供商”部分添加 OpenRouter 配置文件。", + "noKiloCodeProfiles": "未配置 Kilocode 配置文件。请在“提供商”部分添加 Kilocode 配置文件。", + "warningInvalidConfig": "配置不完整。请选择提供商并在上方配置所需设置。", + "successConfigured": "快速应用已配置完成,可以使用" }, "RUN_SLASH_COMMAND": { "name": "启用模型发起的斜杠命令", diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 55d7380b4b..87ce90626f 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -774,7 +774,19 @@ "morphFast": "Morph v3 Fast(更快、成本更低)", "morphLarge": "Morph v3 Large(功能更強)", "relace": "Relace Apply v3" - } + }, + "providerTypeLabel": "供應商類型", + "providerTypes": { + "morph": "Morph", + "openrouter": "OpenRouter", + "kilocode": "Kilocode" + }, + "profileLabel": "API 設定檔", + "selectProfile": "選擇設定檔", + "noOpenRouterProfiles": "未設定 OpenRouter 設定檔。請在「供應商」區段新增 OpenRouter 設定檔。", + "noKiloCodeProfiles": "未設定 Kilocode 設定檔。請在「供應商」區段新增 Kilocode 設定檔。", + "warningInvalidConfig": "設定不完整。請選擇供應商並設定上方所需的設定。", + "successConfigured": "快速套用已設定完成並準備使用" }, "PREVENT_FOCUS_DISRUPTION": { "name": "背景編輯",