@@ -14,7 +14,7 @@ import { getTheme } from "../../integrations/theme/getTheme"
1414import { getDiffStrategy } from "../diff/DiffStrategy"
1515import WorkspaceTracker from "../../integrations/workspace/WorkspaceTracker"
1616import { McpHub } from "../../services/mcp/McpHub"
17- import { ApiConfiguration , ApiProvider , ModelInfo } from "../../shared/api"
17+ import { ApiConfiguration , ApiProvider , ModelInfo , PEARAI_URL } from "../../shared/api"
1818import { findLast } from "../../shared/array"
1919import { ApiConfigMeta , ExtensionMessage } from "../../shared/ExtensionMessage"
2020import { HistoryItem } from "../../shared/HistoryItem"
@@ -45,6 +45,9 @@ import { CustomSupportPrompts, supportPrompt } from "../../shared/support-prompt
4545
4646import { ACTION_NAMES } from "../CodeActionProvider"
4747
48+ // Todo: Remove
49+ const PEARAI_TOKEN = "temp"
50+
4851/*
4952https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/default/weather-webview/src/providers/WeatherViewProvider.ts
5053
@@ -126,7 +129,9 @@ type GlobalStateKey =
126129 | "enhancementApiConfigId"
127130 | "experiments" // Map of experiment IDs to their enabled state
128131 | "autoApprovalEnabled"
129- | "customModes" // Array of custom modes
132+ | "customModes"
133+ | "pearai-token"
134+ | "pearai-refresh" // Array of custom modes
130135
131136export const GlobalFileNames = {
132137 apiConversationHistory : "api_conversation_history.json" ,
@@ -1410,10 +1415,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
14101415 await this . updateGlobalState ( "openRouterUseMiddleOutTransform" , openRouterUseMiddleOutTransform )
14111416 await this . updateGlobalState ( "vsCodeLmModelSelector" , vsCodeLmModelSelector )
14121417 await this . storeSecret ( "mistralApiKey" , mistralApiKey )
1418+ await this . updateGlobalState ( "pearai-token" , PEARAI_TOKEN )
1419+ await this . updateGlobalState ( "pearaiBaseUrl" , PEARAI_URL )
14131420 await this . updateGlobalState ( "pearaiModelId" , pearaiModelId )
14141421 await this . updateGlobalState ( "pearaiModelInfo" , pearaiModelInfo )
1415- await this . storeSecret ( "pearaiApiKey" , pearaiApiKey )
1416- await this . updateGlobalState ( "pearaiBaseUrl" , pearaiBaseUrl )
14171422 if ( this . cline ) {
14181423 this . cline . api = buildApiHandler ( apiConfiguration )
14191424 }
@@ -2033,6 +2038,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
20332038 deepSeekApiKey ,
20342039 mistralApiKey ,
20352040 pearaiApiKey ,
2041+ pearaiRefreshKey ,
20362042 pearaiBaseUrl ,
20372043 pearaiModelId ,
20382044 pearaiModelInfo ,
@@ -2106,7 +2112,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
21062112 this . getSecret ( "openAiNativeApiKey" ) as Promise < string | undefined > ,
21072113 this . getSecret ( "deepSeekApiKey" ) as Promise < string | undefined > ,
21082114 this . getSecret ( "mistralApiKey" ) as Promise < string | undefined > ,
2109- this . getSecret ( "pearaiApiKey" ) as Promise < string | undefined > ,
2115+ this . getGlobalState ( "pearai-token" ) as Promise < string | undefined > ,
2116+ this . getGlobalState ( "pearai-refresh" ) as Promise < string | undefined > ,
21102117 this . getGlobalState ( "pearaiBaseUrl" ) as Promise < string | undefined > ,
21112118 this . getGlobalState ( "pearaiModelId" ) as Promise < string | undefined > ,
21122119 this . getGlobalState ( "pearaiModelInfo" ) as Promise < ModelInfo | undefined > ,
0 commit comments