refactor: reapply provider and settings localization on v3.86.1
This commit is contained in:
1 parent
9cfe31a509
commit
f3a4d6ce2a
35 files changed
+166
-184
No files matched your search
@@ -176,7 +176,13 @@ export const ClineAccountView = ({ clineUser, userOrganizations, activeOrganizat
|
||||
setIsLoading(false)
|
||||
}
|
||||
},
|
||||
[isLoading, uid, fetchUserCredit, loadCachedData],
|
||||
[
|
||||
isLoading,
|
||||
uid,
|
||||
fetchUserCredit,
|
||||
loadCachedData, // Cache the updated data
|
||||
cacheCurrentData,
|
||||
],
|
||||
)
|
||||
|
||||
const handleOrganizationChange = useCallback(
|
||||
@@ -241,7 +247,7 @@ export const ClineAccountView = ({ clineUser, userOrganizations, activeOrganizat
|
||||
initialFetchCompleteRef.current = true
|
||||
}
|
||||
initialFetch()
|
||||
}, [])
|
||||
}, [dropdownValue, fetchCreditBalance])
|
||||
|
||||
useEffect(() => {
|
||||
// Handle organization changes with 500ms debounce
|
||||
@@ -310,7 +316,7 @@ export const ClineAccountView = ({ clineUser, userOrganizations, activeOrganizat
|
||||
<div className="flex flex-col w-full gap-1 mb-6">
|
||||
<div className="flex items-center flex-wrap gap-y-4">
|
||||
{/* {user.photoUrl ? (
|
||||
<img src={user.photoUrl} alt="Profile" className="size-16 rounded-full mr-4" />
|
||||
<img src={user.photoUrl} alt={t("account.profile")} className="size-16 rounded-full mr-4" />
|
||||
) : ( */}
|
||||
<div className="size-16 rounded-full bg-button-background flex items-center justify-center text-2xl text-button-foreground mr-4">
|
||||
{displayName?.[0] || email?.[0] || "?"}
|
||||
@@ -360,11 +366,11 @@ export const ClineAccountView = ({ clineUser, userOrganizations, activeOrganizat
|
||||
<div className="w-full flex gap-2 flex-col min-[225px]:flex-row">
|
||||
<div className="w-full min-[225px]:w-1/2">
|
||||
<VSCodeButtonLink appearance="primary" className="w-full" href={getClineUris(clineUrl, "dashboard").href}>
|
||||
Dashboard
|
||||
{t("account.dashboard")}
|
||||
</VSCodeButtonLink>
|
||||
</div>
|
||||
<VSCodeButton appearance="secondary" className="w-full min-[225px]:w-1/2" onClick={() => handleSignOut()}>
|
||||
Log out
|
||||
{t("account.logOut")}
|
||||
</VSCodeButton>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { getEnvironmentColor } from "@/utils/environmentColors"
|
||||
import type { Environment } from "../../../../src/shared/config-types"
|
||||
|
||||
const ENV_DISPLAY_NAMES: Record<Environment, string> = {
|
||||
production: "Production",
|
||||
staging: "Staging",
|
||||
local: "Local",
|
||||
selfHosted: "Self-hosted",
|
||||
}
|
||||
|
||||
type ViewHeaderProps = {
|
||||
title: string
|
||||
@@ -20,7 +12,8 @@ type ViewHeaderProps = {
|
||||
const ViewHeader = ({ title, onDone, showEnvironmentSuffix, environment }: ViewHeaderProps) => {
|
||||
const { t } = useTranslation("misc")
|
||||
const showSubtext = showEnvironmentSuffix && environment && environment !== "production"
|
||||
const capitalizedEnv = environment ? ENV_DISPLAY_NAMES[environment] : ""
|
||||
const envKey = environment ? `common.environment.${environment}` : ""
|
||||
const envDisplayName = environment ? t(envKey) : ""
|
||||
const titleColor = getEnvironmentColor(environment)
|
||||
|
||||
return (
|
||||
@@ -31,7 +24,7 @@ const ViewHeader = ({ title, onDone, showEnvironmentSuffix, environment }: ViewH
|
||||
</h3>
|
||||
{showSubtext && (
|
||||
<span className="absolute left-0 top-8 -translate-y-1 text-xs text-description whitespace-nowrap">
|
||||
{t("common.viewHeader.environment", { env: capitalizedEnv })}
|
||||
{t("common.viewHeader.environment", { env: envDisplayName })}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -71,7 +71,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
|
||||
} catch (error) {
|
||||
console.error("Error loading task history:", error)
|
||||
}
|
||||
}, [showFavoritesOnly, showCurrentWorkspaceOnly, searchQuery, sortOption, taskHistory])
|
||||
}, [showFavoritesOnly, showCurrentWorkspaceOnly, searchQuery, sortOption])
|
||||
|
||||
// Load when filters change
|
||||
useEffect(() => {
|
||||
@@ -119,7 +119,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
[showFavoritesOnly, loadTaskHistory],
|
||||
[showFavoritesOnly, loadTaskHistory, showCurrentWorkspaceOnly],
|
||||
)
|
||||
|
||||
// Use the onRelinquishControl hook instead of message event
|
||||
@@ -203,7 +203,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
|
||||
const results = searchQuery
|
||||
? fuse
|
||||
.search(searchQuery)
|
||||
?.filter(({ matches }) => matches && matches.length)
|
||||
?.filter(({ matches }) => matches?.length)
|
||||
.map(({ item }) => item)
|
||||
: tasks
|
||||
|
||||
@@ -224,7 +224,6 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
|
||||
case "mostRelevant":
|
||||
// NOTE: you must never sort directly on object since it will cause members to be reordered
|
||||
return searchQuery ? 0 : b.ts - a.ts // Keep fuse order if searching, otherwise sort by newest
|
||||
case "newest":
|
||||
default:
|
||||
return b.ts - a.ts
|
||||
}
|
||||
@@ -259,10 +258,10 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
|
||||
|
||||
const groups: { tasks: any[]; label: string }[] = []
|
||||
if (todayTasks.length > 0) {
|
||||
groups.push({ tasks: todayTasks, label: "Today" })
|
||||
groups.push({ tasks: todayTasks, label: t("history.today") })
|
||||
}
|
||||
if (olderTasks.length > 0) {
|
||||
groups.push({ tasks: olderTasks, label: "Older" })
|
||||
groups.push({ tasks: olderTasks, label: t("history.older") })
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -270,7 +269,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
|
||||
groupCounts: groups.map((g) => g.tasks.length),
|
||||
groupLabels: groups.map((g) => g.label),
|
||||
}
|
||||
}, [taskHistorySearchResults, sortOption])
|
||||
}, [taskHistorySearchResults, sortOption, t])
|
||||
|
||||
// Calculate total size of selected items
|
||||
const selectedItemsSize = useMemo(() => {
|
||||
@@ -424,10 +423,10 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
|
||||
<div className="p-2.5 border-t border-t-border-panel">
|
||||
<div className="flex gap-2.5 mb-2.5">
|
||||
<Button className="flex-1" onClick={() => handleBatchHistorySelect(true)} variant="secondary">
|
||||
Select All
|
||||
{t("history.selectAll")}
|
||||
</Button>
|
||||
<Button className="flex-1" onClick={() => handleBatchHistorySelect(false)} variant="secondary">
|
||||
Select None
|
||||
{t("history.selectNone")}
|
||||
</Button>
|
||||
</div>
|
||||
{selectedItems.length > 0 ? (
|
||||
@@ -438,7 +437,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
|
||||
handleDeleteSelectedHistoryItems(selectedItems)
|
||||
}}
|
||||
variant="danger">
|
||||
Delete {selectedItems.length > 1 ? selectedItems.length : ""} Selected
|
||||
{t("history.deleteSelectedCount", { count: selectedItems.length > 1 ? selectedItems.length : "" })}
|
||||
{selectedItemsSize > 0 ? ` (${formatSize(selectedItemsSize)})` : ""}
|
||||
</Button>
|
||||
) : (
|
||||
@@ -454,7 +453,8 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
|
||||
.finally(() => setDeleteAllDisabled(false))
|
||||
}}
|
||||
variant="danger">
|
||||
Delete All History{totalTasksSize !== null ? ` (${formatSize(totalTasksSize)})` : ""}
|
||||
{t("history.deleteAllHistory")}
|
||||
{totalTasksSize !== null ? ` (${formatSize(totalTasksSize)})` : ""}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
@@ -533,7 +533,7 @@ export const highlight = (fuseSearchResult: FuseResult<any>[], highlightClassNam
|
||||
}
|
||||
|
||||
return fuseSearchResult
|
||||
.filter(({ matches }) => matches && matches.length)
|
||||
.filter(({ matches }) => matches?.length)
|
||||
.map(({ item, matches }) => {
|
||||
const highlightedItem = { ...item }
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ const ModelSelection = ({
|
||||
setSearchTerm(e.target.value)
|
||||
}}
|
||||
onClick={() => onSelectModel("")}
|
||||
placeholder="Search model..."
|
||||
placeholder={t("modelPicker.searchModel")}
|
||||
type="search"
|
||||
value={searchTerm}
|
||||
/>
|
||||
|
||||
@@ -152,7 +152,7 @@ const VercelModelPicker: React.FC<VercelModelPickerProps> = ({ isPopup, currentM
|
||||
if (dropdownListRef.current) {
|
||||
dropdownListRef.current.scrollTop = 0
|
||||
}
|
||||
}, [searchTerm])
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedIndex >= 0 && itemRefs.current[selectedIndex]) {
|
||||
@@ -269,7 +269,7 @@ const VercelModelPicker: React.FC<VercelModelPickerProps> = ({ isPopup, currentM
|
||||
<DropdownItem isSelected={false}>
|
||||
<span style={{ color: "var(--vscode-descriptionForeground)" }}>
|
||||
{Object.keys(vercelAiGatewayModels).length === 0
|
||||
? "Loading models..."
|
||||
? t("modelPicker.refreshing")
|
||||
: t("modelPicker.noModelsFound")}
|
||||
</span>
|
||||
</DropdownItem>
|
||||
|
||||
@@ -80,7 +80,7 @@ export const AnthropicProvider = ({ showModelOptions, isPopup, currentMode }: An
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={anthropicModels}
|
||||
onChange={(e) =>
|
||||
handleModeFieldChange(
|
||||
|
||||
@@ -81,7 +81,7 @@ export const AskSageProvider = ({ showModelOptions, isPopup, currentMode }: AskS
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.asksageApiUrl || askSageDefaultURL}
|
||||
onChange={(value) => handleFieldChange("asksageApiUrl", value)}
|
||||
placeholder="Enter AskSage API URL..."
|
||||
placeholder={t("providers.askSage.enterApiUrl")}
|
||||
style={{ width: "100%" }}
|
||||
type="text">
|
||||
<span style={{ fontWeight: 500 }}>{t("providers.askSage.apiUrl")}</span>
|
||||
@@ -90,7 +90,7 @@ export const AskSageProvider = ({ showModelOptions, isPopup, currentMode }: AskS
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={availableModels}
|
||||
onChange={(e) =>
|
||||
handleModeFieldChange(
|
||||
|
||||
@@ -182,7 +182,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
initialValue={apiConfiguration?.awsProfile ?? ""}
|
||||
key="profile"
|
||||
onChange={(value) => handleFieldChange("awsProfile", value)}
|
||||
placeholder="Enter profile name (default if empty)">
|
||||
placeholder={t("providers.bedrock.enterProfileName")}>
|
||||
<span className="font-medium">{t("providers.bedrock.awsProfileName")}</span>
|
||||
</DebouncedTextField>
|
||||
) : apiConfiguration?.awsAuthentication === "apikey" ? (
|
||||
@@ -191,7 +191,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
initialValue={apiConfiguration?.awsBedrockApiKey ?? ""}
|
||||
key="apikey"
|
||||
onChange={(value) => handleFieldChange("awsBedrockApiKey", value)}
|
||||
placeholder="Enter Bedrock Api Key"
|
||||
placeholder={t("providers.bedrock.enterBedrockApiKey")}
|
||||
type="password">
|
||||
<span className="font-medium">{t("providers.bedrock.awsBedrockApiKey")}</span>
|
||||
</DebouncedTextField>
|
||||
@@ -202,7 +202,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
initialValue={apiConfiguration?.awsAccessKey || ""}
|
||||
key="accessKey"
|
||||
onChange={(value) => handleFieldChange("awsAccessKey", value)}
|
||||
placeholder="Enter Access Key..."
|
||||
placeholder={t("providers.bedrock.enterAccessKey")}
|
||||
type="password">
|
||||
<span className="font-medium">{t("providers.bedrock.awsAccessKey")}</span>
|
||||
</DebouncedTextField>
|
||||
@@ -210,7 +210,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
className="w-full"
|
||||
initialValue={apiConfiguration?.awsSecretKey || ""}
|
||||
onChange={(value) => handleFieldChange("awsSecretKey", value)}
|
||||
placeholder="Enter Secret Key..."
|
||||
placeholder={t("providers.bedrock.enterSecretKey")}
|
||||
type="password">
|
||||
<span className="font-medium">{t("providers.bedrock.awsSecretKey")}</span>
|
||||
</DebouncedTextField>
|
||||
@@ -218,7 +218,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
className="w-full"
|
||||
initialValue={apiConfiguration?.awsSessionToken || ""}
|
||||
onChange={(value) => handleFieldChange("awsSessionToken", value)}
|
||||
placeholder="Enter Session Token..."
|
||||
placeholder={t("providers.bedrock.enterSessionToken")}
|
||||
type="password">
|
||||
<span className="font-medium">{t("providers.bedrock.awsSessionToken")}</span>
|
||||
</DebouncedTextField>
|
||||
@@ -334,7 +334,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
handleFieldChange("awsBedrockEndpoint", "")
|
||||
}
|
||||
}}>
|
||||
Use custom VPC endpoint
|
||||
{t("providers.bedrock.useCustomVpcEndpoint")}
|
||||
</VSCodeCheckbox>
|
||||
{remoteConfigSettings?.awsBedrockEndpoint !== undefined && (
|
||||
<i className="codicon codicon-lock text-description text-sm flex items-center" />
|
||||
@@ -368,7 +368,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
|
||||
handleFieldChange("awsUseCrossRegionInference", isChecked)
|
||||
}}>
|
||||
Use cross-region inference
|
||||
{t("providers.bedrock.useCrossRegionInference")}
|
||||
</VSCodeCheckbox>
|
||||
{remoteConfigSettings?.awsUseCrossRegionInference !== undefined && (
|
||||
<i className="codicon codicon-lock text-description text-sm" />
|
||||
@@ -391,7 +391,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
const isChecked = e.target.checked === true
|
||||
handleFieldChange("awsUseGlobalInference", isChecked)
|
||||
}}>
|
||||
Use global inference profile
|
||||
{t("providers.bedrock.useGlobalInference")}
|
||||
</VSCodeCheckbox>
|
||||
{remoteConfigSettings?.awsUseGlobalInference !== undefined && (
|
||||
<i className="codicon codicon-lock text-description text-sm" />
|
||||
@@ -415,7 +415,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
const isChecked = e.target.checked === true
|
||||
handleFieldChange("awsBedrockUsePromptCache", isChecked)
|
||||
}}>
|
||||
Use prompt caching
|
||||
{t("providers.bedrock.usePromptCaching")}
|
||||
</VSCodeCheckbox>
|
||||
{remoteConfigSettings?.awsBedrockUsePromptCache !== undefined && (
|
||||
<i className="codicon codicon-lock text-description text-sm" />
|
||||
@@ -435,7 +435,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<label htmlFor="bedrock-model-dropdown">
|
||||
<span className="font-medium">Model</span>
|
||||
<span className="font-medium">{t("settings.model")}</span>
|
||||
</label>
|
||||
<DropdownContainer className="dropdown-container" zIndex={DROPDOWN_Z_INDEX - 2}>
|
||||
<VSCodeDropdown
|
||||
@@ -465,7 +465,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
)
|
||||
}}
|
||||
value={modeFields.awsBedrockCustomSelected ? "custom" : selectedModelId}>
|
||||
<VSCodeOption value="">Select a model...</VSCodeOption>
|
||||
<VSCodeOption value="">{t("settings.selectModel")}</VSCodeOption>
|
||||
{Object.keys(bedrockModels).map((modelId) => (
|
||||
<VSCodeOption
|
||||
className="whitespace-normal wrap-break-word max-w-full"
|
||||
@@ -474,7 +474,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
{modelId}
|
||||
</VSCodeOption>
|
||||
))}
|
||||
<VSCodeOption value="custom">Custom</VSCodeOption>
|
||||
<VSCodeOption value="custom">{t("providers.bedrock.customOption")}</VSCodeOption>
|
||||
</VSCodeDropdown>
|
||||
</DropdownContainer>
|
||||
|
||||
@@ -495,8 +495,8 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
currentMode,
|
||||
)
|
||||
}
|
||||
placeholder="Enter custom model ID...">
|
||||
<span className="font-medium">Model ID</span>
|
||||
placeholder={t("providers.bedrock.enterCustomModelId")}>
|
||||
<span className="font-medium">{t("commonFields.modelId")}</span>
|
||||
</DebouncedTextField>
|
||||
<label htmlFor="bedrock-base-model-dropdown">
|
||||
<span className="font-medium">{t("providers.bedrock.baseInferenceModel")}</span>
|
||||
@@ -516,7 +516,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
)
|
||||
}
|
||||
value={modeFields.awsBedrockCustomModelBaseId || bedrockDefaultModelId}>
|
||||
<VSCodeOption value="">Select a model...</VSCodeOption>
|
||||
<VSCodeOption value="">{t("settings.selectModel")}</VSCodeOption>
|
||||
{Object.keys(bedrockModels).map((modelId) => (
|
||||
<VSCodeOption
|
||||
className="whitespace-normal wrap-break-word max-w-full"
|
||||
|
||||
@@ -48,7 +48,7 @@ export const ClaudeCodeProvider = ({ showModelOptions, isPopup, currentMode }: C
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.claudeCodePath || ""}
|
||||
onChange={(value) => handleFieldChange("claudeCodePath", value)}
|
||||
placeholder="Default: claude"
|
||||
placeholder={t("providers.claudeCode.defaultClaudePlaceholder")}
|
||||
style={{ width: "100%", marginTop: 3 }}
|
||||
type="text">
|
||||
<span style={{ fontWeight: 500 }}>{t("providers.claudeCode.cliPath")}</span>
|
||||
@@ -66,9 +66,9 @@ export const ClaudeCodeProvider = ({ showModelOptions, isPopup, currentMode }: C
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={claudeCodeModels}
|
||||
onChange={(e: any) =>
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) =>
|
||||
handleModeFieldChange(
|
||||
{ plan: "planModeApiModelId", act: "actModeApiModelId" },
|
||||
e.target.value,
|
||||
@@ -86,7 +86,7 @@ export const ClaudeCodeProvider = ({ showModelOptions, isPopup, currentMode }: C
|
||||
marginTop: 2,
|
||||
color: "var(--vscode-descriptionForeground)",
|
||||
}}>
|
||||
Use the latest version of {selectedModelId} by default.
|
||||
{t("providers.lmStudio.useLatestVersion")} {selectedModelId} {t("providers.lmStudio.byDefault")}
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ export const DifyProvider = ({ showModelOptions, isPopup, currentMode }: DifyPro
|
||||
instance URL and API key to get started.
|
||||
</p>
|
||||
<p style={{ marginTop: "8px" }}>
|
||||
<strong>Note:</strong> {t("providers.dify.noteModelSelection")}
|
||||
<strong>{t("commonFields.note")}:</strong> {t("providers.dify.noteModelSelection")}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -50,7 +50,7 @@ export const GeminiProvider = ({ showModelOptions, isPopup, currentMode }: Gemin
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={geminiModels}
|
||||
onChange={(e: any) =>
|
||||
handleModeFieldChange(
|
||||
|
||||
@@ -43,7 +43,7 @@ export const HicapProvider = ({ showModelOptions, isPopup, currentMode }: HicapP
|
||||
refreshHicapModels()
|
||||
}
|
||||
}}
|
||||
placeholder="Enter API Key..."
|
||||
placeholder={t("commonFields.enterApiKey")}
|
||||
style={{ width: "100%" }}
|
||||
type="password">
|
||||
<div
|
||||
|
||||
@@ -31,7 +31,7 @@ export const HuggingFaceProvider = ({ showModelOptions, isPopup, currentMode }:
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.huggingFaceApiKey || ""}
|
||||
onChange={(value) => handleFieldChange("huggingFaceApiKey", value)}
|
||||
placeholder="Enter API Key..."
|
||||
placeholder={t("commonFields.enterApiKey")}
|
||||
style={{ width: "100%" }}
|
||||
type="password">
|
||||
<span style={{ fontWeight: 500 }}>{t("providers.huggingface.apiKey")}</span>
|
||||
@@ -45,7 +45,7 @@ export const HuggingFaceProvider = ({ showModelOptions, isPopup, currentMode }:
|
||||
This key is stored locally and only used to make API requests from this extension. We don’t show pricing here
|
||||
because it depends on your Hugging Face provider settings and isn’t consistently available via their API{" "}
|
||||
<a href="https://huggingface.co/settings/tokens" rel="noopener noreferrer" target="_blank">
|
||||
Get your API key here
|
||||
{t("commonFields.getApiKeyHere")}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ export const LMStudioProvider = ({ currentMode }: LMStudioProviderProps) => {
|
||||
|
||||
useEffect(() => {
|
||||
requestLmStudioModels()
|
||||
}, [])
|
||||
}, [requestLmStudioModels])
|
||||
|
||||
const lmStudioMaxTokens = currentLMStudioModel?.max_context_length?.toString()
|
||||
const currentLoadedContext = currentLMStudioModel?.loaded_context_length?.toString()
|
||||
@@ -100,16 +100,16 @@ export const LMStudioProvider = ({ currentMode }: LMStudioProviderProps) => {
|
||||
initialValue={apiConfiguration?.lmStudioBaseUrl}
|
||||
label={t("providers.lmStudio.useCustomBaseUrl")}
|
||||
onChange={(value) => handleFieldChange("lmStudioBaseUrl", value)}
|
||||
placeholder="Default: http://localhost:1234"
|
||||
placeholder={t("providers.lmstudio.defaultBaseUrl")}
|
||||
/>
|
||||
|
||||
<div className="font-semibold">Model</div>
|
||||
<div className="font-semibold">{t("settings.model")}</div>
|
||||
{lmStudioModels.length > 0 ? (
|
||||
<DropdownContainer className="dropdown-container" zIndex={10}>
|
||||
<VSCodeDropdown
|
||||
className="w-full mb-3"
|
||||
onChange={(e: any) => {
|
||||
const value = e?.target?.value
|
||||
onChange={(e: Event) => {
|
||||
const value = (e.target as HTMLSelectElement)?.value
|
||||
handleModeFieldChange(
|
||||
{
|
||||
plan: "planModeLmStudioModelId",
|
||||
@@ -145,11 +145,11 @@ export const LMStudioProvider = ({ currentMode }: LMStudioProviderProps) => {
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="font-semibold">Context Window</div>
|
||||
<div className="font-semibold">{t("providers.lmStudio.contextWindow")}</div>
|
||||
<VSCodeTextField
|
||||
className="w-full pointer-events-none"
|
||||
disabled={true}
|
||||
title="Not editable - the value is returned by the connected endpoint"
|
||||
title={t("providers.lmstudio.notEditable")}
|
||||
value={String(currentLoadedContext ?? lmStudioMaxTokens ?? "0")}
|
||||
/>
|
||||
|
||||
@@ -158,16 +158,15 @@ export const LMStudioProvider = ({ currentMode }: LMStudioProviderProps) => {
|
||||
<div className="text-xs text-description">
|
||||
LM Studio allows you to run models locally on your computer. For instructions on how to get started, see their
|
||||
<VSCodeLink href="https://lmstudio.ai/docs" style={{ display: "inline", fontSize: "inherit" }}>
|
||||
quickstart guide.
|
||||
{t("providers.lmStudio.quickstartGuide")}
|
||||
</VSCodeLink>
|
||||
You will also need to start LM Studio's{" "}
|
||||
<VSCodeLink className="inline" href="https://lmstudio.ai/docs/basics/server">
|
||||
local server
|
||||
{t("providers.lmStudio.localServer")}
|
||||
</VSCodeLink>{" "}
|
||||
feature with <code>lms server start</code> to use it with this extension.{" "}
|
||||
<div className="text-error">
|
||||
<span className="font-semibold">Note:</span> Cline uses complex prompts and works best with Claude models.
|
||||
Less capable models may not work as expected.
|
||||
<span className="font-semibold">{t("commonFields.note")}:</span> {t("providers.lmStudio.noteComplexPrompts")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -100,7 +100,7 @@ export const LiteLlmProvider = ({ showModelOptions, isPopup, currentMode }: Lite
|
||||
}),
|
||||
)
|
||||
}}
|
||||
placeholder="Default: noop"
|
||||
placeholder={t("providers.litellm.defaultNoopPlaceholder")}
|
||||
style={{ width: "100%" }}
|
||||
type="password">
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
@@ -112,10 +112,10 @@ export const LiteLlmProvider = ({ showModelOptions, isPopup, currentMode }: Lite
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelAutocomplete
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={liteLlmModels}
|
||||
onChange={handleModelChange}
|
||||
placeholder="Search or enter a custom model ID..."
|
||||
placeholder={t("providers.litellm.searchModelPlaceholder")}
|
||||
selectedModelId={selectedModelId}
|
||||
/>
|
||||
<VSCodeButton
|
||||
@@ -123,7 +123,7 @@ export const LiteLlmProvider = ({ showModelOptions, isPopup, currentMode }: Lite
|
||||
disabled={isLoading}
|
||||
onClick={onRefreshModels}>
|
||||
{isLoading ? (
|
||||
"Loading..."
|
||||
t("commonFields.loading")
|
||||
) : (
|
||||
<>
|
||||
Refresh models <RefreshCwIcon className="ml-1" />
|
||||
@@ -156,11 +156,7 @@ export const LiteLlmProvider = ({ showModelOptions, isPopup, currentMode }: Lite
|
||||
marginTop: "5px",
|
||||
color: "var(--vscode-descriptionForeground)",
|
||||
}}>
|
||||
LiteLLM provides a unified interface to access various LLM providers' models. See their{" "}
|
||||
<VSCodeLink href="https://docs.litellm.ai/docs/" style={{ display: "inline", fontSize: "inherit" }}>
|
||||
quickstart guide
|
||||
</VSCodeLink>{" "}
|
||||
for more information.
|
||||
{t("providers.litellm.seeQuickstart")}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -71,7 +71,7 @@ export const MinimaxProvider = ({ showModelOptions, isPopup, currentMode }: Mini
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={minimaxModels}
|
||||
onChange={(e: any) =>
|
||||
handleModeFieldChange(
|
||||
|
||||
@@ -85,7 +85,7 @@ export const MoonshotProvider = ({ showModelOptions, isPopup, currentMode }: Moo
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={moonshotModels}
|
||||
onChange={async (e: any) => {
|
||||
const value = e.target.value
|
||||
|
||||
@@ -60,8 +60,8 @@ export const NousResearchProvider = ({ showModelOptions, isPopup, currentMode }:
|
||||
color: "var(--vscode-descriptionForeground)",
|
||||
}}>
|
||||
<span style={{ color: "var(--vscode-errorForeground)" }}>
|
||||
(<span style={{ fontWeight: 500 }}>Note:</span> Cline uses complex prompts and works best with Claude
|
||||
models. Less capable models may not work as expected.)
|
||||
(<span style={{ fontWeight: 500 }}>{t("commonFields.note")}:</span>{" "}
|
||||
{t("providers.nousresearch.noteComplexPrompts")})
|
||||
</span>
|
||||
</p>
|
||||
</>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { EmptyRequest, StringRequest } from "@shared/proto/index.cline"
|
||||
import { Mode } from "@shared/storage/types"
|
||||
import { VSCodeButton, VSCodeCheckbox, VSCodeLink, VSCodeProgressRing } from "@vscode/webview-ui-toolkit/react"
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { useExtensionState } from "@/context/ExtensionStateContext"
|
||||
import { ModelsServiceClient, OcaAccountServiceClient } from "@/services/grpc-client"
|
||||
import { VSC_BUTTON_BACKGROUND, VSC_BUTTON_FOREGROUND, VSC_DESCRIPTION_FOREGROUND } from "@/utils/vscStyles"
|
||||
@@ -220,6 +221,7 @@ function useOcaModels({
|
||||
* The Oca provider configuration component
|
||||
*/
|
||||
export const OcaProvider = ({ isPopup, currentMode }: OcaProviderProps) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const { apiConfiguration } = useExtensionState()
|
||||
const { handleFieldChange } = useApiConfigurationHandlers()
|
||||
|
||||
@@ -266,12 +268,14 @@ export const OcaProvider = ({ isPopup, currentMode }: OcaProviderProps) => {
|
||||
{!ready ? (
|
||||
<div aria-live="polite" className="flex items-center gap-2 py-2" role="status">
|
||||
<VSCodeProgressRing />
|
||||
<span className={`text-[13px] [color:var(${VSC_DESCRIPTION_FOREGROUND})]`}>Connecting…</span>
|
||||
<span className={`text-[13px] [color:var(${VSC_DESCRIPTION_FOREGROUND})]`}>
|
||||
{t("providers.oca.connecting")}
|
||||
</span>
|
||||
</div>
|
||||
) : !isAuthenticated ? (
|
||||
<div>
|
||||
<div
|
||||
aria-label="Oracle employment"
|
||||
aria-label={t("providers.oca.oracleEmployment")}
|
||||
style={{
|
||||
marginTop: 12,
|
||||
marginBottom: 4,
|
||||
@@ -282,7 +286,7 @@ export const OcaProvider = ({ isPopup, currentMode }: OcaProviderProps) => {
|
||||
const checked = (e?.target as HTMLInputElement)?.checked
|
||||
handleToggleMode(checked ? "internal" : "external")
|
||||
}}>
|
||||
I’m an Oracle Employee
|
||||
{t("providers.oca.oracleEmployee")}
|
||||
</VSCodeCheckbox>
|
||||
</div>
|
||||
<VSCodeButton
|
||||
@@ -297,16 +301,16 @@ export const OcaProvider = ({ isPopup, currentMode }: OcaProviderProps) => {
|
||||
minWidth: 0,
|
||||
margin: "12px 0",
|
||||
}}>
|
||||
Sign in with Oracle Code Assist
|
||||
{t("providers.oca.signIn")}
|
||||
</VSCodeButton>
|
||||
<p className="text-xs mt-0 text-(--vscode-descriptionForeground)">
|
||||
Please ask your IT administrator to set up Oracle Code Assist as a model provider. Oracle Employees,
|
||||
please see the{" "}
|
||||
{t("providers.oca.itAdminMessage")}
|
||||
{t("providers.oca.pleaseSeeThe")}{" "}
|
||||
<VSCodeLink
|
||||
href="https://confluence.oraclecorp.com/confluence/display/AICODE/Oracle+Code+Assist+via+Cline"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank">
|
||||
quickstart guide
|
||||
{t("providers.oca.quickstartGuide")}
|
||||
</VSCodeLink>
|
||||
</p>
|
||||
</div>
|
||||
@@ -314,20 +318,20 @@ export const OcaProvider = ({ isPopup, currentMode }: OcaProviderProps) => {
|
||||
<div>
|
||||
<div className={`flex items-center justify-between mt-0 mb-0 [color:var(${VSC_DESCRIPTION_FOREGROUND})]`}>
|
||||
<div className="flex flex-col gap-0 font-semibold text-[13px]">
|
||||
<span>Signed in</span>
|
||||
<span>{t("providers.oca.signedIn")}</span>
|
||||
{ocaUser?.email ? (
|
||||
<span className="font-semibold opacity-95 mt-2">{ocaUser.email}</span>
|
||||
) : ocaUser?.uid ? (
|
||||
<span className="font-semibold opacity-95 mt-2">{ocaUser.uid}</span>
|
||||
) : (
|
||||
<span className="font-semibold opacity-95 mt-2">Unknown User</span>
|
||||
<span className="font-semibold opacity-95 mt-2">{t("providers.oca.unknownUser")}</span>
|
||||
)}
|
||||
</div>
|
||||
<VSCodeButton
|
||||
onClick={async () => {
|
||||
await logout()
|
||||
}}>
|
||||
Log out
|
||||
{t("providers.oca.logOut")}
|
||||
</VSCodeButton>
|
||||
</div>
|
||||
|
||||
@@ -335,7 +339,7 @@ export const OcaProvider = ({ isPopup, currentMode }: OcaProviderProps) => {
|
||||
<BaseUrlField
|
||||
defaultValue={undefined}
|
||||
initialValue={ocaBaseUrl}
|
||||
label="Custom Base URL (optional)"
|
||||
label={t("providers.oca.customBaseUrlOptional")}
|
||||
onChange={(value) => handleFieldChange("ocaBaseUrl", value)}
|
||||
/>
|
||||
</div>
|
||||
@@ -355,17 +359,17 @@ export const OcaProvider = ({ isPopup, currentMode }: OcaProviderProps) => {
|
||||
aria-live="polite"
|
||||
className={`mt-2 text-[13px] [color:var(${VSC_DESCRIPTION_FOREGROUND})]`}
|
||||
role="status">
|
||||
<div>Failed to refresh models. Check your session or network.</div>
|
||||
<div>{t("providers.oca.failedRefreshModels")}</div>
|
||||
<div className="mt-2 flex gap-2">
|
||||
<VSCodeButton appearance="secondary" onClick={handleRefresh}>
|
||||
Retry
|
||||
{t("providers.oca.retry")}
|
||||
</VSCodeButton>
|
||||
<VSCodeButton
|
||||
appearance="secondary"
|
||||
onClick={async () => {
|
||||
await login()
|
||||
}}>
|
||||
Sign in again
|
||||
{t("providers.oca.signInAgain")}
|
||||
</VSCodeButton>
|
||||
</div>
|
||||
</div>
|
||||
@@ -431,7 +435,7 @@ export const OcaProvider = ({ isPopup, currentMode }: OcaProviderProps) => {
|
||||
marginBottom: 18,
|
||||
marginTop: 2,
|
||||
}}>
|
||||
Have an idea for Oracle Code Assist?
|
||||
{t("providers.oca.haveIdea")}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@@ -466,7 +470,7 @@ export const OcaProvider = ({ isPopup, currentMode }: OcaProviderProps) => {
|
||||
cursor: "pointer",
|
||||
}}
|
||||
target="_blank">
|
||||
Provide feedback
|
||||
{t("providers.oca.provideFeedback")}
|
||||
</a>
|
||||
</div>
|
||||
</InfoCard>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { StringRequest } from "@shared/proto/cline/common"
|
||||
import { Mode } from "@shared/storage/types"
|
||||
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react"
|
||||
import { useCallback, useEffect, useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { useInterval } from "react-use"
|
||||
@@ -26,7 +25,7 @@ interface OllamaProviderProps {
|
||||
/**
|
||||
* The Ollama provider configuration component
|
||||
*/
|
||||
export const OllamaProvider = ({ showModelOptions, isPopup, currentMode }: OllamaProviderProps) => {
|
||||
export const OllamaProvider = ({ showModelOptions, currentMode }: OllamaProviderProps) => {
|
||||
const { t } = useTranslation("settings")
|
||||
const { apiConfiguration } = useExtensionState()
|
||||
const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers()
|
||||
@@ -43,7 +42,7 @@ export const OllamaProvider = ({ showModelOptions, isPopup, currentMode }: Ollam
|
||||
value: apiConfiguration?.ollamaBaseUrl || "",
|
||||
}),
|
||||
)
|
||||
if (response && response.values) {
|
||||
if (response?.values) {
|
||||
setOllamaModels(response.values)
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -79,23 +78,20 @@ export const OllamaProvider = ({ showModelOptions, isPopup, currentMode }: Ollam
|
||||
|
||||
{/* Model selection - use filterable picker */}
|
||||
<label htmlFor="ollama-model-selection">
|
||||
<span className="font-semibold">Model</span>
|
||||
<span className="font-semibold">{t("settings.model")}</span>
|
||||
</label>
|
||||
<OllamaModelPicker
|
||||
ollamaModels={ollamaModels}
|
||||
onModelChange={(modelId) => {
|
||||
handleModeFieldChange({ plan: "planModeOllamaModelId", act: "actModeOllamaModelId" }, modelId, currentMode)
|
||||
}}
|
||||
placeholder={ollamaModels.length > 0 ? "Search and select a model..." : "e.g. llama3.1"}
|
||||
placeholder={ollamaModels.length > 0 ? t("settings.searchSelectModel") : "e.g. llama3.1"}
|
||||
selectedModelId={ollamaModelId || ""}
|
||||
/>
|
||||
|
||||
{/* Show status message based on model availability */}
|
||||
{ollamaModels.length === 0 && (
|
||||
<p className="text-sm mt-1 text-description italic">
|
||||
Unable to fetch models from Ollama server. Please ensure Ollama is running and accessible, or enter the model
|
||||
ID manually above.
|
||||
</p>
|
||||
<p className="text-sm mt-1 text-description italic">{t("providers.ollama.unableToFetch")}</p>
|
||||
)}
|
||||
|
||||
<DebouncedTextField
|
||||
@@ -133,12 +129,7 @@ export const OllamaProvider = ({ showModelOptions, isPopup, currentMode }: Ollam
|
||||
marginTop: "5px",
|
||||
color: "var(--vscode-descriptionForeground)",
|
||||
}}>
|
||||
Ollama allows you to run models locally on your computer. For instructions on how to get started, see their{" "}
|
||||
<VSCodeLink
|
||||
href="https://github.com/ollama/ollama/blob/main/README.md"
|
||||
style={{ display: "inline", fontSize: "inherit" }}>
|
||||
quickstart guide.
|
||||
</VSCodeLink>{" "}
|
||||
{t("providers.ollama.seeQuickstart")}{" "}
|
||||
<span style={{ color: "var(--vscode-errorForeground)" }}>
|
||||
{t("providers.openaiCompatible.noteComplexPrompts")}
|
||||
</span>
|
||||
|
||||
@@ -92,7 +92,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
|
||||
handleFieldChange("openAiBaseUrl", value)
|
||||
debouncedRefreshOpenAiModels(value, apiConfiguration?.openAiApiKey)
|
||||
}}
|
||||
placeholder={"Enter base URL..."}
|
||||
placeholder={t("commonFields.enterBaseUrl")}
|
||||
style={{ width: "100%", marginBottom: 10 }}
|
||||
type="text"
|
||||
/>
|
||||
@@ -117,7 +117,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
|
||||
onChange={(value) =>
|
||||
handleModeFieldChange({ plan: "planModeOpenAiModelId", act: "actModeOpenAiModelId" }, value, currentMode)
|
||||
}
|
||||
placeholder={"Enter Model ID..."}
|
||||
placeholder={t("providers.openaiCompatible.enterModelId")}
|
||||
style={{ width: "100%", marginBottom: 10 }}>
|
||||
<span style={{ fontWeight: 500 }}>{t("providers.openaiCompatible.modelId")}</span>
|
||||
</DebouncedTextField>
|
||||
@@ -151,7 +151,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
|
||||
currentHeaders[newKey] = ""
|
||||
handleFieldChange("openAiHeaders", currentHeaders)
|
||||
}}>
|
||||
Add Header
|
||||
{t("commonFields.addHeaderButton")}
|
||||
</VSCodeButton>
|
||||
</div>
|
||||
|
||||
@@ -193,7 +193,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
|
||||
const { [key]: _, ...rest } = apiConfiguration?.openAiHeaders ?? {}
|
||||
handleFieldChange("openAiHeaders", rest)
|
||||
}}>
|
||||
Remove
|
||||
{t("commonFields.removeButton")}
|
||||
</VSCodeButton>
|
||||
</div>
|
||||
))}
|
||||
@@ -231,7 +231,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
|
||||
const isChecked = e.target.checked === true
|
||||
return handleFieldChange("azureIdentity", isChecked)
|
||||
}}>
|
||||
Use Azure Identity Authentication
|
||||
{t("providers.openaiCompatible.useAzureIdentity")}
|
||||
</VSCodeCheckbox>
|
||||
|
||||
<div
|
||||
@@ -254,7 +254,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
|
||||
fontWeight: 700,
|
||||
textTransform: "uppercase",
|
||||
}}>
|
||||
Model Configuration
|
||||
{t("providers.openaiCompatible.modelConfiguration")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -272,7 +272,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
|
||||
currentMode,
|
||||
)
|
||||
}}>
|
||||
Supports Images
|
||||
{t("providers.openaiCompatible.supportsImages")}
|
||||
</VSCodeCheckbox>
|
||||
|
||||
<VSCodeCheckbox
|
||||
@@ -288,7 +288,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
|
||||
currentMode,
|
||||
)
|
||||
}}>
|
||||
Enable R1 messages format
|
||||
{t("providers.openaiCompatible.enableR1Format")}
|
||||
</VSCodeCheckbox>
|
||||
|
||||
<div style={{ display: "flex", gap: 10, marginTop: "5px" }}>
|
||||
|
||||
@@ -64,7 +64,7 @@ export const OpenAiCodexProvider = ({ showModelOptions, isPopup, currentMode }:
|
||||
color: "var(--vscode-descriptionForeground)",
|
||||
marginBottom: "10px",
|
||||
}}>
|
||||
Sign in with your ChatGPT Plus or Pro subscription to use GPT-5 models without an API key.
|
||||
{t("providers.openAiCodex.signInDescription")}
|
||||
</p>
|
||||
<VSCodeButton onClick={handleSignIn}>{t("providers.openAiCodex.signIn")}</VSCodeButton>
|
||||
</div>
|
||||
@@ -74,7 +74,7 @@ export const OpenAiCodexProvider = ({ showModelOptions, isPopup, currentMode }:
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={openAiCodexModels}
|
||||
onChange={(e: any) =>
|
||||
handleModeFieldChange(
|
||||
|
||||
@@ -74,7 +74,7 @@ export const OpenRouterProvider = ({ showModelOptions, isPopup, currentMode }: O
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.openRouterApiKey || ""}
|
||||
onChange={(value) => handleFieldChange("openRouterApiKey", value)}
|
||||
placeholder="Enter API Key..."
|
||||
placeholder={t("commonFields.enterApiKey")}
|
||||
style={{ width: "100%" }}
|
||||
type="password">
|
||||
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", width: "100%" }}>
|
||||
@@ -95,7 +95,7 @@ export const OpenRouterProvider = ({ showModelOptions, isPopup, currentMode }: O
|
||||
}
|
||||
}}
|
||||
style={{ margin: "5px 0 0 0" }}>
|
||||
Get OpenRouter API Key
|
||||
{t("providers.openRouter.getApiKey")}
|
||||
</VSCodeButton>
|
||||
)}
|
||||
<p
|
||||
|
||||
@@ -32,29 +32,22 @@ export const QwenCodeProvider = ({ showModelOptions, isPopup, currentMode }: Qwe
|
||||
<div>
|
||||
<h3 style={{ color: "var(--vscode-foreground)", margin: "8px 0" }}>{t("providers.qwenCode.title")}</h3>
|
||||
<VSCodeTextField
|
||||
onInput={(e: any) => handleFieldChange("qwenCodeOauthPath", e.target.value)}
|
||||
onInput={(e: Event) => handleFieldChange("qwenCodeOauthPath", (e.target as HTMLInputElement).value)}
|
||||
placeholder="~/.qwen/oauth_creds.json"
|
||||
style={{ width: "100%" }}
|
||||
value={apiConfiguration?.qwenCodeOauthPath || ""}>
|
||||
OAuth Credentials Path
|
||||
{t("providers.qwenCode.oauthCredsPath")}
|
||||
</VSCodeTextField>
|
||||
<div style={{ fontSize: "12px", color: "var(--vscode-descriptionForeground)", marginTop: "4px" }}>
|
||||
Path to your Qwen OAuth credentials file. Use ~/.qwen/oauth_creds.json or provide a custom path.
|
||||
{t("providers.qwenCode.credsPathDescription")}
|
||||
</div>
|
||||
|
||||
<div style={{ fontSize: "12px", color: "var(--vscode-descriptionForeground)", marginTop: "12px" }}>
|
||||
Qwen Code is an OAuth-based API that requires authentication through the official Qwen client. You'll need to set
|
||||
up OAuth credentials first.
|
||||
{t("providers.qwenCode.oauthExplanation")}
|
||||
</div>
|
||||
|
||||
<div style={{ fontSize: "12px", color: "var(--vscode-descriptionForeground)", marginTop: "8px" }}>
|
||||
To get started:
|
||||
<br />
|
||||
1. Install the official Qwen client
|
||||
<br />
|
||||
2. Authenticate using your account
|
||||
<br />
|
||||
3. OAuth credentials will be stored automatically
|
||||
{t("providers.qwenCode.getStartedSteps")}
|
||||
</div>
|
||||
|
||||
<VSCodeLink
|
||||
@@ -65,13 +58,13 @@ export const QwenCodeProvider = ({ showModelOptions, isPopup, currentMode }: Qwe
|
||||
display: "inline-block",
|
||||
fontSize: "12px",
|
||||
}}>
|
||||
Setup Instructions
|
||||
{t("providers.qwenCode.setupInstructions")}
|
||||
</VSCodeLink>
|
||||
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={qwenCodeModels}
|
||||
onChange={(modelId) => {
|
||||
const fieldName = currentMode === "plan" ? "planModeApiModelId" : "actModeApiModelId"
|
||||
|
||||
@@ -95,7 +95,7 @@ export const QwenProvider = ({ showModelOptions, isPopup, currentMode }: QwenPro
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={qwenModels}
|
||||
onChange={(e: any) =>
|
||||
handleModeFieldChange(
|
||||
|
||||
@@ -83,7 +83,7 @@ export const SapAiCoreProvider = ({ showModelOptions, isPopup, currentMode }: Sa
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching SAP AI Core models:", error)
|
||||
setModelError("Failed to fetch models. Please check your configuration.")
|
||||
setModelError(t("providers.sapaicore.fetchModelsFailed"))
|
||||
setSapAiCoreModelDeployments([])
|
||||
setOrchestrationAvailable(false)
|
||||
setHasCheckedOrchestration(true)
|
||||
@@ -96,6 +96,8 @@ export const SapAiCoreProvider = ({ showModelOptions, isPopup, currentMode }: Sa
|
||||
apiConfiguration?.sapAiCoreBaseUrl,
|
||||
apiConfiguration?.sapAiCoreTokenUrl,
|
||||
apiConfiguration?.sapAiResourceGroup,
|
||||
hasRequiredCredentials,
|
||||
t,
|
||||
])
|
||||
|
||||
// Fetch models when configuration changes
|
||||
@@ -133,61 +135,57 @@ export const SapAiCoreProvider = ({ showModelOptions, isPopup, currentMode }: Sa
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.sapAiCoreClientId || ""}
|
||||
onChange={(value) => handleFieldChange("sapAiCoreClientId", value)}
|
||||
placeholder="Enter AI Core Client Id..."
|
||||
placeholder={t("providers.sapaicore.enterClientId")}
|
||||
style={{ width: "100%" }}
|
||||
type="password">
|
||||
<span className="font-medium">AI Core Client Id</span>
|
||||
<span className="font-medium">{t("providers.sapaicore.clientId")}</span>
|
||||
</DebouncedTextField>
|
||||
{apiConfiguration?.sapAiCoreClientId && (
|
||||
<p className="text-xs text-(--vscode-descriptionForeground)">
|
||||
Client Id is set. To change it, please re-enter the value.
|
||||
</p>
|
||||
<p className="text-xs text-(--vscode-descriptionForeground)">{t("providers.sapaicore.clientIdSet")}</p>
|
||||
)}
|
||||
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.sapAiCoreClientSecret || ""}
|
||||
onChange={(value) => handleFieldChange("sapAiCoreClientSecret", value)}
|
||||
placeholder="Enter AI Core Client Secret..."
|
||||
placeholder={t("providers.sapaicore.enterClientSecret")}
|
||||
style={{ width: "100%" }}
|
||||
type="password">
|
||||
<span className="font-medium">AI Core Client Secret</span>
|
||||
<span className="font-medium">{t("providers.sapaicore.clientSecret")}</span>
|
||||
</DebouncedTextField>
|
||||
{apiConfiguration?.sapAiCoreClientSecret && (
|
||||
<p className="text-xs text-(--vscode-descriptionForeground)">
|
||||
Client Secret is set. To change it, please re-enter the value.
|
||||
</p>
|
||||
<p className="text-xs text-(--vscode-descriptionForeground)">{t("providers.sapaicore.clientSecretSet")}</p>
|
||||
)}
|
||||
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.sapAiCoreBaseUrl || ""}
|
||||
onChange={(value) => handleFieldChange("sapAiCoreBaseUrl", value)}
|
||||
placeholder="Enter AI Core Base URL..."
|
||||
placeholder={t("providers.sapaicore.enterBaseUrl")}
|
||||
style={{ width: "100%" }}>
|
||||
<span className="font-medium">AI Core Base URL</span>
|
||||
<span className="font-medium">{t("providers.sapaicore.baseUrl")}</span>
|
||||
</DebouncedTextField>
|
||||
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.sapAiCoreTokenUrl || ""}
|
||||
onChange={(value) => handleFieldChange("sapAiCoreTokenUrl", value)}
|
||||
placeholder="Enter AI Core Auth URL..."
|
||||
placeholder={t("providers.sapaicore.enterAuthUrl")}
|
||||
style={{ width: "100%" }}>
|
||||
<span className="font-medium">AI Core Auth URL</span>
|
||||
<span className="font-medium">{t("providers.sapaicore.authUrl")}</span>
|
||||
</DebouncedTextField>
|
||||
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.sapAiResourceGroup || ""}
|
||||
onChange={(value) => handleFieldChange("sapAiResourceGroup", value)}
|
||||
placeholder="Enter AI Core Resource Group..."
|
||||
placeholder={t("providers.sapaicore.enterResourceGroup")}
|
||||
style={{ width: "100%" }}>
|
||||
<span className="font-medium">AI Core Resource Group</span>
|
||||
<span className="font-medium">{t("providers.sapaicore.resourceGroup")}</span>
|
||||
</DebouncedTextField>
|
||||
|
||||
<p className="text-xs mt-1.5 text-(--vscode-descriptionForeground)">
|
||||
These credentials are stored locally and only used to make API requests from this extension.
|
||||
{t("providers.sapaicore.credentialsStoredLocally")}
|
||||
<VSCodeLink
|
||||
className="inline"
|
||||
href="https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/access-sap-ai-core-via-api">
|
||||
You can find more information about SAP AI Core API access here.
|
||||
{t("providers.sapaicore.moreInfoLink")}
|
||||
</VSCodeLink>
|
||||
</p>
|
||||
|
||||
@@ -195,7 +193,7 @@ export const SapAiCoreProvider = ({ showModelOptions, isPopup, currentMode }: Sa
|
||||
<div className="flex flex-col gap-2.5 mt-[15px]">
|
||||
<div className="flex items-center gap-2">
|
||||
<VSCodeCheckbox
|
||||
aria-label="Orchestration Mode"
|
||||
aria-label={t("providers.sapaicore.orchestrationMode")}
|
||||
checked={apiConfiguration?.sapAiCoreUseOrchestrationMode}
|
||||
onChange={(e) => handleOrchestrationChange((e.target as HTMLInputElement).checked)}
|
||||
/>
|
||||
@@ -203,10 +201,10 @@ export const SapAiCoreProvider = ({ showModelOptions, isPopup, currentMode }: Sa
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-(--vscode-descriptionForeground)">
|
||||
When enabled, provides access to all available models without requiring individual deployments.
|
||||
{t("providers.sapaicore.orchestrationDescription")}
|
||||
<br />
|
||||
<br />
|
||||
When disabled, provides access only to deployed models in your AI Core service instance.
|
||||
{t("providers.sapaicore.orchestrationDisabled")}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
@@ -215,7 +213,9 @@ export const SapAiCoreProvider = ({ showModelOptions, isPopup, currentMode }: Sa
|
||||
<>
|
||||
<div className="flex flex-col gap-1.5">
|
||||
{isLoadingModels ? (
|
||||
<div className="text-xs text-(--vscode-descriptionForeground)">Loading models...</div>
|
||||
<div className="text-xs text-(--vscode-descriptionForeground)">
|
||||
{t("providers.sapaicore.loadingModels")}
|
||||
</div>
|
||||
) : modelError ? (
|
||||
<div className="text-xs text-(--vscode-errorForeground)">
|
||||
{modelError}
|
||||
@@ -235,7 +235,7 @@ export const SapAiCoreProvider = ({ showModelOptions, isPopup, currentMode }: Sa
|
||||
)}
|
||||
<SapAiCoreModelPicker
|
||||
onModelChange={handleModelChange}
|
||||
placeholder="Select a model..."
|
||||
placeholder={t("settings.selectModel")}
|
||||
sapAiCoreModelDeployments={sapAiCoreModelDeployments}
|
||||
selectedDeploymentId={
|
||||
apiConfiguration?.[
|
||||
@@ -250,7 +250,7 @@ export const SapAiCoreProvider = ({ showModelOptions, isPopup, currentMode }: Sa
|
||||
</>
|
||||
) : (
|
||||
<div className="text-xs text-(--vscode-errorForeground)">
|
||||
Please configure your SAP AI Core credentials to see available models.
|
||||
{t("providers.sapaicore.configureCredentials")}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@ export const VSCodeLmProvider = ({ currentMode }: VSCodeLmProviderProps) => {
|
||||
? `${vsCodeLmModelSelector.vendor ?? ""}/${vsCodeLmModelSelector.family ?? ""}`
|
||||
: ""
|
||||
}>
|
||||
<VSCodeOption value="">Select a model...</VSCodeOption>
|
||||
<VSCodeOption value="">{t("settings.selectModel")}</VSCodeOption>
|
||||
{vsCodeLmModels.map((model) => (
|
||||
<VSCodeOption key={`${model.vendor}/${model.family}`} value={`${model.vendor}/${model.family}`}>
|
||||
{model.vendor} - {model.family}
|
||||
|
||||
@@ -29,7 +29,7 @@ export const VercelAIGatewayProvider = ({ showModelOptions, isPopup, currentMode
|
||||
<DebouncedTextField
|
||||
initialValue={apiConfiguration?.vercelAiGatewayApiKey || ""}
|
||||
onChange={(value) => handleFieldChange("vercelAiGatewayApiKey", value)}
|
||||
placeholder="Enter API Key..."
|
||||
placeholder={t("commonFields.enterApiKey")}
|
||||
style={{ width: "100%" }}
|
||||
type="password">
|
||||
<span style={{ fontWeight: 500 }}>{t("providers.vercelAiGateway.apiKey")}</span>
|
||||
@@ -40,7 +40,7 @@ export const VercelAIGatewayProvider = ({ showModelOptions, isPopup, currentMode
|
||||
marginTop: "5px",
|
||||
color: "var(--vscode-descriptionForeground)",
|
||||
}}>
|
||||
This key is stored locally and only used to make API requests from this extension.
|
||||
{t("commonFields.apiKeyStoredLocally")}
|
||||
{!apiConfiguration?.vercelAiGatewayApiKey && (
|
||||
<>
|
||||
{" "}
|
||||
|
||||
@@ -71,7 +71,7 @@ export const VertexProvider = ({ showModelOptions, isPopup, currentMode }: Verte
|
||||
disabled={remoteConfigSettings?.vertexProjectId !== undefined}
|
||||
initialValue={apiConfiguration?.vertexProjectId || ""}
|
||||
onChange={(value) => handleFieldChange("vertexProjectId", value)}
|
||||
placeholder="Enter Project ID..."
|
||||
placeholder={t("providers.vertex.enterProjectId")}
|
||||
style={{ width: "100%" }}>
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<span style={{ fontWeight: 500 }}>{t("providers.vertex.googleCloudProjectId")}</span>
|
||||
@@ -128,7 +128,7 @@ export const VertexProvider = ({ showModelOptions, isPopup, currentMode }: Verte
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={modelsToUse}
|
||||
onChange={(e: any) =>
|
||||
handleModeFieldChange(
|
||||
|
||||
@@ -49,8 +49,8 @@ export const XaiProvider = ({ showModelOptions, isPopup, currentMode }: XaiProvi
|
||||
color: "var(--vscode-descriptionForeground)",
|
||||
}}>
|
||||
<span style={{ color: "var(--vscode-errorForeground)" }}>
|
||||
(<span style={{ fontWeight: 500 }}>Note:</span> Cline uses complex prompts and works best with Claude
|
||||
models. Less capable models may not work as expected.)
|
||||
(<span style={{ fontWeight: 500 }}>{t("commonFields.note")}:</span>{" "}
|
||||
{t("providers.xai.noteComplexPrompts")}) models. Less capable models may not work as expected.)
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
@@ -58,7 +58,7 @@ export const XaiProvider = ({ showModelOptions, isPopup, currentMode }: XaiProvi
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={xaiModels}
|
||||
onChange={(e: any) =>
|
||||
handleModeFieldChange(
|
||||
@@ -86,7 +86,7 @@ export const XaiProvider = ({ showModelOptions, isPopup, currentMode }: XaiProvi
|
||||
}
|
||||
}}
|
||||
style={{ marginTop: 0 }}>
|
||||
Modify reasoning effort
|
||||
{t("providers.xai.modifyReasoningEffort")}
|
||||
</VSCodeCheckbox>
|
||||
|
||||
{reasoningEffortSelected && (
|
||||
@@ -117,7 +117,7 @@ export const XaiProvider = ({ showModelOptions, isPopup, currentMode }: XaiProvi
|
||||
marginBottom: 0,
|
||||
color: "var(--vscode-descriptionForeground)",
|
||||
}}>
|
||||
High effort may produce more thorough analysis but takes longer and uses more tokens.
|
||||
{t("providers.xai.reasoningEffortDescription")}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -40,7 +40,7 @@ export const ZAiProvider = ({ showModelOptions, isPopup, currentMode }: ZAiProvi
|
||||
<div>
|
||||
<DropdownContainer className="dropdown-container" style={{ position: "inherit" }}>
|
||||
<label htmlFor="zai-entrypoint">
|
||||
<span style={{ fontWeight: 500, marginTop: 5 }}>Z AI Entrypoint</span>
|
||||
<span style={{ fontWeight: 500, marginTop: 5 }}>{t("providers.zai.entrypoint")}</span>
|
||||
</label>
|
||||
<VSCodeDropdown
|
||||
id="zai-entrypoint"
|
||||
@@ -77,7 +77,7 @@ export const ZAiProvider = ({ showModelOptions, isPopup, currentMode }: ZAiProvi
|
||||
{showModelOptions && (
|
||||
<>
|
||||
<ModelSelector
|
||||
label="Model"
|
||||
label={t("settings.model")}
|
||||
models={zaiModels}
|
||||
onChange={(e: any) =>
|
||||
handleModeFieldChange(
|
||||
|
||||
@@ -37,7 +37,7 @@ const ApiConfigurationSection = ({ renderSectionHeader, initialModelTab }: ApiCo
|
||||
opacity: 1,
|
||||
cursor: "pointer",
|
||||
}}>
|
||||
Plan Mode
|
||||
{t("settings.planMode")}
|
||||
</TabButton>
|
||||
<TabButton
|
||||
disabled={currentTab === "act"}
|
||||
@@ -47,7 +47,7 @@ const ApiConfigurationSection = ({ renderSectionHeader, initialModelTab }: ApiCo
|
||||
opacity: 1,
|
||||
cursor: "pointer",
|
||||
}}>
|
||||
Act Mode
|
||||
{t("settings.actMode")}
|
||||
</TabButton>
|
||||
</div>
|
||||
|
||||
@@ -80,7 +80,7 @@ const ApiConfigurationSection = ({ renderSectionHeader, initialModelTab }: ApiCo
|
||||
console.error("Failed to update separate models setting:", error)
|
||||
}
|
||||
}}>
|
||||
Use different models for Plan and Act modes
|
||||
{t("settings.useDifferentModels")}
|
||||
</VSCodeCheckbox>
|
||||
<p className="text-xs mt-[5px] text-(--vscode-descriptionForeground)">
|
||||
Switching between Plan and Act mode will persist the API and model used in the previous mode. This may be
|
||||
|
||||
@@ -331,7 +331,7 @@ export const BrowserSettingsSection: React.FC<BrowserSettingsSectionProps> = ({
|
||||
<label
|
||||
htmlFor="chrome-executable-path"
|
||||
style={{ fontWeight: "500", display: "block", marginBottom: 5 }}>
|
||||
Chrome Executable Path (Optional)
|
||||
{t("settingsSections.browser.chromeExecutablePath")}
|
||||
</label>
|
||||
<DebouncedTextField
|
||||
id="chrome-executable-path"
|
||||
@@ -354,7 +354,7 @@ export const BrowserSettingsSection: React.FC<BrowserSettingsSectionProps> = ({
|
||||
<label
|
||||
htmlFor="custom-browser-args"
|
||||
style={{ fontWeight: "500", display: "block", marginBottom: 5 }}>
|
||||
Custom Browser Arguments (Optional)
|
||||
{t("settingsSections.browser.customBrowserArgs")}
|
||||
</label>
|
||||
<DebouncedTextField
|
||||
id="custom-browser-args"
|
||||
|
||||
@@ -407,7 +407,7 @@ const FeatureSettingsSection = ({ renderSectionHeader }: FeatureSettingsSectionP
|
||||
key={feature.id}
|
||||
label={featureTranslations[feature.id]?.label || feature.label}
|
||||
onChange={(checked) => handleFeatureChange(feature, checked)}
|
||||
remoteTooltip="This setting is managed by your organization's remote configuration"
|
||||
remoteTooltip={t("remoteConfig.settingsManagedByOrg")}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -151,7 +151,7 @@ const CreateWorktreeModal = ({ open, onClose, openAfterCreate = false, onSuccess
|
||||
value={newBranchName}>
|
||||
{newBranchName && (
|
||||
<div
|
||||
aria-label="Clear"
|
||||
aria-label={t("worktrees.clear")}
|
||||
className="input-icon-button codicon codicon-close"
|
||||
onClick={() => setNewBranchName("")}
|
||||
slot="end"
|
||||
@@ -177,7 +177,7 @@ const CreateWorktreeModal = ({ open, onClose, openAfterCreate = false, onSuccess
|
||||
value={newWorktreePath}>
|
||||
{newWorktreePath && (
|
||||
<div
|
||||
aria-label="Clear"
|
||||
aria-label={t("worktrees.clear")}
|
||||
className="input-icon-button codicon codicon-close"
|
||||
onClick={() => setNewWorktreePath("")}
|
||||
slot="end"
|
||||
|
||||
Reference in new issue
Block a user