diff --git a/webview-ui/src/components/prompts/PromptsView.tsx b/webview-ui/src/components/prompts/PromptsView.tsx index 5588aaba025..55c3dcbb182 100644 --- a/webview-ui/src/components/prompts/PromptsView.tsx +++ b/webview-ui/src/components/prompts/PromptsView.tsx @@ -27,6 +27,7 @@ import { vscode } from "../../utils/vscode" import { Tab, TabContent, TabHeader } from "../common/Tab" import i18next from "i18next" import { useAppTranslation } from "../../i18n/TranslationContext" +import { Trans } from "react-i18next" // Get all available groups that should show in prompts view const availableGroups = (Object.keys(TOOL_GROUPS) as ToolGroup[]).filter((group) => !TOOL_GROUPS[group].alwaysAvailable) @@ -781,10 +782,38 @@ const PromptsView = ({ onDone }: PromptsViewProps) => { color: "var(--vscode-descriptionForeground)", marginTop: "5px", }}> - {t("prompts:customInstructions.loadFromFile", { - modeName: getCurrentMode()?.name || "Code", - modeSlug: getCurrentMode()?.slug || "code", - })} + { + const currentMode = getCurrentMode() + if (!currentMode) return + + // Open or create an empty file + vscode.postMessage({ + type: "openFile", + text: `./.clinerules-${currentMode.slug}`, + values: { + create: true, + content: "", + }, + }) + }} + /> + ), + }} + /> @@ -866,9 +895,32 @@ const PromptsView = ({ onDone }: PromptsViewProps) => { {isSystemPromptDisclosureOpen && (
- {t("prompts:advancedSystemPrompt.description", { - modeSlug: getCurrentMode()?.slug || "code", - })} + { + const currentMode = getCurrentMode() + if (!currentMode) return + + vscode.postMessage({ + type: "openFile", + text: `./.roo/system-prompt-${currentMode.slug}`, + values: { + create: true, + content: "", + }, + }) + }} + /> + ), + }} + />
)} @@ -900,7 +952,30 @@ const PromptsView = ({ onDone }: PromptsViewProps) => { data-testid="global-custom-instructions-textarea" />
- {t("prompts:globalCustomInstructions.loadFromFile")} + + vscode.postMessage({ + type: "openFile", + text: "./.clinerules", + values: { + create: true, + content: "", + }, + }) + } + /> + ), + }} + />
diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 2262df28f71..a4babf2ab43 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -412,12 +412,12 @@ const ApiOptions = ({ value={apiConfiguration?.requestyApiKey || ""} type="password" onInput={handleInputChange("requestyApiKey")} - placeholder="Enter API Key..." + placeholder={t("settings:providers.getRequestyApiKey")} className="w-full"> - Requesty API Key + {t("settings:providers.requestyApiKey")}
- This key is stored locally and only used to make API requests from this extension. + {t("settings:providers.apiKeyStorageNotice")}
)} @@ -433,11 +433,11 @@ const ApiOptions = ({ OpenAI API Key
- This key is stored locally and only used to make API requests from this extension. + {t("settings:providers.apiKeyStorageNotice")}
{!apiConfiguration?.openAiNativeApiKey && ( - Get OpenAI API Key + {t("settings:providers.getOpenAiApiKey")} )} @@ -451,14 +451,14 @@ const ApiOptions = ({ onInput={handleInputChange("mistralApiKey")} placeholder="Enter API Key..." className="w-full"> - Mistral API Key + {t("settings:providers.mistralApiKey")}
- This key is stored locally and only used to make API requests from this extension. + {t("settings:providers.apiKeyStorageNotice")}
{!apiConfiguration?.mistralApiKey && ( - Get Mistral / Codestral API Key + {t("settings:providers.getMistralApiKey")} )} {(apiConfiguration?.apiModelId?.startsWith("codestral-") || @@ -470,10 +470,10 @@ const ApiOptions = ({ onInput={handleInputChange("mistralCodestralUrl")} placeholder="https://codestral.mistral.ai" className="w-full"> - Codestral Base URL (Optional) + {t("settings:providers.codestralBaseUrl")}
- Set an alternative URL for the Codestral model. + {t("settings:providers.codestralBaseUrlDesc")}
)} @@ -488,13 +488,11 @@ const ApiOptions = ({ "awsUseProfile", (e) => (e.target as HTMLInputElement).value === "profile", )}> - AWS Credentials - AWS Profile + {t("settings:providers.awsCredentials")} + {t("settings:providers.awsProfile")}
- Authenticate by providing an access key and secret or use the default AWS credential providers, - i.e. ~/.aws/credentials or environment variables. These credentials are only used locally to - make API requests from this extension. + {t("settings:providers.apiKeyStorageNotice")}
{apiConfiguration?.awsUseProfile ? ( - AWS Profile Name + {t("settings:providers.awsProfileName")} ) : ( <> @@ -512,7 +510,7 @@ const ApiOptions = ({ onInput={handleInputChange("awsAccessKey")} placeholder="Enter Access Key..." className="w-full"> - AWS Access Key + {t("settings:providers.awsAccessKey")} - AWS Secret Key + {t("settings:providers.awsSecretKey")} - AWS Session Token + {t("settings:providers.awsSessionToken")} )}
- Use cross-region inference + {t("settings:providers.awsCrossRegion")} )} @@ -572,27 +570,26 @@ const ApiOptions = ({ {selectedProvider === "vertex" && ( <>
-
To use Google Cloud Vertex AI, you need to:
+
{t("settings:providers.googleCloudSetup.title")}
- 1. Create a Google Cloud account, enable the Vertex AI API & enable the desired Claude - models. + {t("settings:providers.googleCloudSetup.step1")}
- 2. Install the Google Cloud CLI & configure application default credentials. + {t("settings:providers.googleCloudSetup.step2")}
- 3. Or create a service account with credentials. + {t("settings:providers.googleCloudSetup.step3")}
@@ -601,25 +598,25 @@ const ApiOptions = ({ onInput={handleInputChange("vertexJsonCredentials")} placeholder="Enter Credentials JSON..." className="w-full"> - Google Cloud Credentials + {t("settings:providers.googleCloudCredentials")} - Google Cloud Key File Path + {t("settings:providers.googleCloudKeyFile")} - Google Cloud Project ID + {t("settings:providers.googleCloudProjectId")}
- Gemini API Key + {t("settings:providers.geminiApiKey")}
- This key is stored locally and only used to make API requests from this extension. + {t("settings:providers.apiKeyStorageNotice")}
{!apiConfiguration?.geminiApiKey && ( - Get Gemini API Key + {t("settings:providers.getGeminiApiKey")} )}
@@ -667,7 +664,7 @@ const ApiOptions = ({ setApiConfigurationField("googleGeminiBaseUrl", "") } }}> - Use custom base URL + {t("settings:providers.useCustomBaseUrl")} {googleGeminiBaseUrlSelected && ( - Base URL + {t("settings:providers.openAiBaseUrl")} - API Key + {t("settings:providers.openAiApiKey")} - Enable streaming + {t("settings:modelInfo.enableStreaming")} - Use Azure + {t("settings:modelInfo.useAzure")}
- Set Azure API version + {t("settings:modelInfo.azureApiVersion")} {azureApiVersionSelected && (
- Configure the capabilities and pricing for your custom OpenAI-compatible model. Be careful - when specifying the model capabilities, as they can affect how Roo Code performs. + {t("settings:providers.customModel.capabilities")}
@@ -770,7 +766,7 @@ const ApiOptions = ({ : "var(--vscode-errorForeground)" })(), }} - title="Maximum number of tokens the model can generate in a single response" + title={t("settings:providers.customModel.maxTokens.description")} onInput={handleInputChange("openAiCustomModelInfo", (e) => { const value = parseInt((e.target as HTMLInputElement).value) @@ -781,11 +777,12 @@ const ApiOptions = ({ })} placeholder="e.g. 4096" className="w-full"> - Max Output Tokens + + {t("settings:providers.customModel.maxTokens.label")} +
- Maximum number of tokens the model can generate in a response. (Specify -1 to allow the - server to set the max tokens.) + {t("settings:providers.customModel.maxTokens.description")}
@@ -810,7 +807,7 @@ const ApiOptions = ({ : "var(--vscode-errorForeground)" })(), }} - title="Total number of tokens (input + output) the model can process in a single request" + title={t("settings:providers.customModel.contextWindow.description")} onInput={handleInputChange("openAiCustomModelInfo", (e) => { const value = (e.target as HTMLInputElement).value const parsed = parseInt(value) @@ -824,10 +821,12 @@ const ApiOptions = ({ })} placeholder="e.g. 128000" className="w-full"> - Context Window Size + + {t("settings:providers.customModel.contextWindow.label")} +
- Total tokens (input + output) the model can process. + {t("settings:providers.customModel.contextWindow.description")}
@@ -844,16 +843,18 @@ const ApiOptions = ({ supportsImages: checked, } })}> - Image Support + + {t("settings:providers.customModel.imageSupport.label")} +
- Is this model capable of processing and understanding images? + {t("settings:providers.customModel.imageSupport.description")}
@@ -867,16 +868,18 @@ const ApiOptions = ({ supportsComputerUse: checked, } })}> - Computer Use + + {t("settings:providers.customModel.computerUse.label")} +
- Is this model capable of interacting with a browser? (e.g. Claude 3.7 Sonnet). + {t("settings:providers.customModel.computerUse.description")}
@@ -890,16 +893,18 @@ const ApiOptions = ({ supportsPromptCache: checked, } })}> - Prompt Caching + + {t("settings:providers.customModel.promptCache.label")} +
- Is this model capable of caching prompts? + {t("settings:providers.customModel.promptCache.description")}
@@ -936,10 +941,12 @@ const ApiOptions = ({ placeholder="e.g. 0.0001" className="w-full">
- Input Price + + {t("settings:providers.customModel.pricing.input.label")} +
@@ -979,10 +986,12 @@ const ApiOptions = ({ placeholder="e.g. 0.0002" className="w-full">
- Output Price + + {t("settings:providers.customModel.pricing.output.label")} +
@@ -1023,10 +1032,14 @@ const ApiOptions = ({ placeholder="e.g. 0.0001" className="w-full">
- Cache Reads Price + + {t("settings:providers.customModel.pricing.cacheReads.label")} +
@@ -1064,10 +1077,14 @@ const ApiOptions = ({ placeholder="e.g. 0.00005" className="w-full">
- Cache Writes Price + + {t("settings:providers.customModel.pricing.cacheWrites.label")} +
@@ -1081,7 +1098,7 @@ const ApiOptions = ({ onClick={() => setApiConfigurationField("openAiCustomModelInfo", openAiModelInfoSaneDefaults) }> - Reset to Defaults + {t("settings:providers.customModel.resetDefaults")} @@ -1095,14 +1112,14 @@ const ApiOptions = ({ onInput={handleInputChange("lmStudioBaseUrl")} placeholder={"Default: http://localhost:1234"} className="w-full"> - Base URL (optional) + {t("settings:providers.lmStudio.baseUrl")} - Model ID + {t("settings:providers.lmStudio.modelId")} {lmStudioModels.length > 0 && ( { - // Explicitly set the boolean value using direct method. setApiConfigurationField("lmStudioSpeculativeDecodingEnabled", checked) }}> - Enable Speculative Decoding + {t("settings:providers.lmStudio.speculativeDecoding")} {apiConfiguration?.lmStudioSpeculativeDecodingEnabled && ( <> @@ -1138,16 +1154,17 @@ const ApiOptions = ({ onInput={handleInputChange("lmStudioDraftModelId")} placeholder={"e.g. lmstudio-community/llama-3.2-1b-instruct"} className="w-full"> - Draft Model ID + {t("settings:providers.lmStudio.draftModelId")}
- Draft model must be from the same model family for speculative decoding to work - correctly. + {t("settings:providers.lmStudio.draftModelDesc")}
{lmStudioModels.length > 0 && ( <> -
Select Draft Model
+
+ {t("settings:providers.lmStudio.selectDraftModel")} +
- No draft models found. Please ensure LM Studio is running with Server Mode - enabled. + {t("settings:providers.lmStudio.noModelsFound")} )} @@ -1178,15 +1194,18 @@ const ApiOptions = ({ )}
- LM Studio allows you to run models locally on your computer. For instructions on how to get - started, see their quickstart guide. - You will also need to start LM Studio's{" "} - local server feature to - use it with this extension. - - Note: Roo Code uses complex prompts and works best with - Claude models. Less capable models may not work as expected. - + , + b: , + span: ( + + Note: + + ), + }} + />
)} @@ -1199,14 +1218,14 @@ const ApiOptions = ({ onInput={handleInputChange("deepSeekApiKey")} placeholder="Enter API Key..." className="w-full"> - DeepSeek API Key + {t("settings:providers.deepSeekApiKey")}
- This key is stored locally and only used to make API requests from this extension. + {t("settings:providers.apiKeyStorageNotice")}
{!apiConfiguration?.deepSeekApiKey && ( - Get DeepSeek API Key + {t("settings:providers.getDeepSeekApiKey")} )} @@ -1216,7 +1235,7 @@ const ApiOptions = ({ <>
{vsCodeLmModels.length > 0 ? (