|
|
@@ -62,6 +62,7 @@ type SecretKey =
|
|
|
| "openAiNativeApiKey"
|
|
|
| "deepSeekApiKey"
|
|
|
| "mistralApiKey"
|
|
|
+ | "unboundApiKey"
|
|
|
type GlobalStateKey =
|
|
|
| "apiProvider"
|
|
|
| "apiModelId"
|
|
|
@@ -120,6 +121,7 @@ type GlobalStateKey =
|
|
|
| "experimentalDiffStrategy"
|
|
|
| "autoApprovalEnabled"
|
|
|
| "customModes" // Array of custom modes
|
|
|
+ | "unboundModelId"
|
|
|
|
|
|
export const GlobalFileNames = {
|
|
|
apiConversationHistory: "api_conversation_history.json",
|
|
|
@@ -1309,6 +1311,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
openRouterUseMiddleOutTransform,
|
|
|
vsCodeLmModelSelector,
|
|
|
mistralApiKey,
|
|
|
+ unboundApiKey,
|
|
|
+ unboundModelId,
|
|
|
} = apiConfiguration
|
|
|
await this.updateGlobalState("apiProvider", apiProvider)
|
|
|
await this.updateGlobalState("apiModelId", apiModelId)
|
|
|
@@ -1347,6 +1351,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
await this.updateGlobalState("openRouterUseMiddleOutTransform", openRouterUseMiddleOutTransform)
|
|
|
await this.updateGlobalState("vsCodeLmModelSelector", vsCodeLmModelSelector)
|
|
|
await this.storeSecret("mistralApiKey", mistralApiKey)
|
|
|
+ await this.storeSecret("unboundApiKey", unboundApiKey)
|
|
|
+ await this.updateGlobalState("unboundModelId", unboundModelId)
|
|
|
if (this.cline) {
|
|
|
this.cline.api = buildApiHandler(apiConfiguration)
|
|
|
}
|
|
|
@@ -2001,6 +2007,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
experimentalDiffStrategy,
|
|
|
autoApprovalEnabled,
|
|
|
customModes,
|
|
|
+ unboundApiKey,
|
|
|
+ unboundModelId,
|
|
|
] = await Promise.all([
|
|
|
this.getGlobalState("apiProvider") as Promise<ApiProvider | undefined>,
|
|
|
this.getGlobalState("apiModelId") as Promise<string | undefined>,
|
|
|
@@ -2070,6 +2078,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
this.getGlobalState("experimentalDiffStrategy") as Promise<boolean | undefined>,
|
|
|
this.getGlobalState("autoApprovalEnabled") as Promise<boolean | undefined>,
|
|
|
this.customModesManager.getCustomModes(),
|
|
|
+ this.getSecret("unboundApiKey") as Promise<string | undefined>,
|
|
|
+ this.getGlobalState("unboundModelId") as Promise<string | undefined>,
|
|
|
])
|
|
|
|
|
|
let apiProvider: ApiProvider
|
|
|
@@ -2125,6 +2135,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
openRouterBaseUrl,
|
|
|
openRouterUseMiddleOutTransform,
|
|
|
vsCodeLmModelSelector,
|
|
|
+ unboundApiKey,
|
|
|
+ unboundModelId,
|
|
|
},
|
|
|
lastShownAnnouncementId,
|
|
|
customInstructions,
|
|
|
@@ -2273,6 +2285,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
"openAiNativeApiKey",
|
|
|
"deepSeekApiKey",
|
|
|
"mistralApiKey",
|
|
|
+ "unboundApiKey",
|
|
|
]
|
|
|
for (const key of secretKeys) {
|
|
|
await this.storeSecret(key, undefined)
|