mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2026-03-23 09:39:29 -04:00
feat: config manager using secret store
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// type that represents json data that is sent from extension to webview, called ExtensionMessage and has 'type' enum which can be 'plusButtonClicked' or 'settingsButtonClicked' or 'hello'
|
||||
|
||||
import { ApiConfiguration, ModelInfo } from "./api"
|
||||
import { ApiConfiguration, ApiProvider, ModelInfo } from "./api"
|
||||
import { HistoryItem } from "./HistoryItem"
|
||||
import { McpServer } from "./mcp"
|
||||
import { GitCommit } from "../utils/git"
|
||||
@@ -23,6 +23,7 @@ export interface ExtensionMessage {
|
||||
| "mcpServers"
|
||||
| "enhancedPrompt"
|
||||
| "commitSearchResults"
|
||||
| "listApiConfig"
|
||||
text?: string
|
||||
action?:
|
||||
| "chatButtonClicked"
|
||||
@@ -42,6 +43,12 @@ export interface ExtensionMessage {
|
||||
openAiModels?: string[]
|
||||
mcpServers?: McpServer[]
|
||||
commits?: GitCommit[]
|
||||
listApiConfig?: ApiConfigMeta[]
|
||||
}
|
||||
|
||||
export interface ApiConfigMeta {
|
||||
name: string
|
||||
apiProvider?: ApiProvider
|
||||
}
|
||||
|
||||
export interface ExtensionState {
|
||||
@@ -50,6 +57,8 @@ export interface ExtensionState {
|
||||
taskHistory: HistoryItem[]
|
||||
shouldShowAnnouncement: boolean
|
||||
apiConfiguration?: ApiConfiguration
|
||||
currentApiConfigName?: string
|
||||
listApiConfigMeta?: ApiConfigMeta[]
|
||||
customInstructions?: string
|
||||
alwaysAllowReadOnly?: boolean
|
||||
alwaysAllowWrite?: boolean
|
||||
|
||||
@@ -5,6 +5,12 @@ export type AudioType = "notification" | "celebration" | "progress_loop"
|
||||
export interface WebviewMessage {
|
||||
type:
|
||||
| "apiConfiguration"
|
||||
| "currentApiConfigName"
|
||||
| "upsertApiConfiguration"
|
||||
| "deleteApiConfiguration"
|
||||
| "loadApiConfiguration"
|
||||
| "renameApiConfiguration"
|
||||
| "getListApiConfiguration"
|
||||
| "customInstructions"
|
||||
| "allowedCommands"
|
||||
| "alwaysAllowReadOnly"
|
||||
@@ -54,6 +60,7 @@ export interface WebviewMessage {
|
||||
| "searchCommits"
|
||||
| "alwaysApproveResubmit"
|
||||
| "requestDelaySeconds"
|
||||
| "setApiConfigPassword"
|
||||
text?: string
|
||||
disabled?: boolean
|
||||
askResponse?: ClineAskResponse
|
||||
|
||||
19
src/shared/checkExistApiConfig.ts
Normal file
19
src/shared/checkExistApiConfig.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ApiConfiguration } from "../shared/api";
|
||||
|
||||
export function checkExistKey(config: ApiConfiguration | undefined) {
|
||||
return config
|
||||
? [
|
||||
config.apiKey,
|
||||
config.glamaApiKey,
|
||||
config.openRouterApiKey,
|
||||
config.awsRegion,
|
||||
config.vertexProjectId,
|
||||
config.openAiApiKey,
|
||||
config.ollamaModelId,
|
||||
config.lmStudioModelId,
|
||||
config.geminiApiKey,
|
||||
config.openAiNativeApiKey,
|
||||
config.deepSeekApiKey
|
||||
].some((key) => key !== undefined)
|
||||
: false;
|
||||
}
|
||||
Reference in New Issue
Block a user