|
|
@@ -1,6 +1,6 @@
|
|
|
import { z } from "zod"
|
|
|
|
|
|
-import { type Keys, keysOf } from "./type-fu.js"
|
|
|
+import { type Keys } from "./type-fu.js"
|
|
|
import {
|
|
|
type ProviderSettings,
|
|
|
PROVIDER_SETTINGS_KEYS,
|
|
|
@@ -106,89 +106,7 @@ export const globalSettingsSchema = z.object({
|
|
|
|
|
|
export type GlobalSettings = z.infer<typeof globalSettingsSchema>
|
|
|
|
|
|
-export const GLOBAL_SETTINGS_KEYS = keysOf<GlobalSettings>()([
|
|
|
- "currentApiConfigName",
|
|
|
- "listApiConfigMeta",
|
|
|
- "pinnedApiConfigs",
|
|
|
-
|
|
|
- "lastShownAnnouncementId",
|
|
|
- "customInstructions",
|
|
|
- "taskHistory",
|
|
|
-
|
|
|
- "condensingApiConfigId",
|
|
|
- "customCondensingPrompt",
|
|
|
-
|
|
|
- "autoApprovalEnabled",
|
|
|
- "alwaysAllowReadOnly",
|
|
|
- "alwaysAllowReadOnlyOutsideWorkspace",
|
|
|
- "alwaysAllowWrite",
|
|
|
- "alwaysAllowWriteOutsideWorkspace",
|
|
|
- "writeDelayMs",
|
|
|
- "alwaysAllowBrowser",
|
|
|
- "alwaysApproveResubmit",
|
|
|
- "requestDelaySeconds",
|
|
|
- "alwaysAllowMcp",
|
|
|
- "alwaysAllowModeSwitch",
|
|
|
- "alwaysAllowSubtasks",
|
|
|
- "alwaysAllowExecute",
|
|
|
- "allowedCommands",
|
|
|
- "allowedMaxRequests",
|
|
|
- "autoCondenseContext",
|
|
|
- "autoCondenseContextPercent",
|
|
|
- "maxConcurrentFileReads",
|
|
|
-
|
|
|
- "browserToolEnabled",
|
|
|
- "browserViewportSize",
|
|
|
- "screenshotQuality",
|
|
|
- "remoteBrowserEnabled",
|
|
|
- "remoteBrowserHost",
|
|
|
-
|
|
|
- "enableCheckpoints",
|
|
|
-
|
|
|
- "ttsEnabled",
|
|
|
- "ttsSpeed",
|
|
|
- "soundEnabled",
|
|
|
- "soundVolume",
|
|
|
-
|
|
|
- "maxOpenTabsContext",
|
|
|
- "maxWorkspaceFiles",
|
|
|
- "showRooIgnoredFiles",
|
|
|
- "maxReadFileLine",
|
|
|
-
|
|
|
- "terminalOutputLineLimit",
|
|
|
- "terminalShellIntegrationTimeout",
|
|
|
- "terminalShellIntegrationDisabled",
|
|
|
- "terminalCommandDelay",
|
|
|
- "terminalPowershellCounter",
|
|
|
- "terminalZshClearEolMark",
|
|
|
- "terminalZshOhMy",
|
|
|
- "terminalZshP10k",
|
|
|
- "terminalZdotdir",
|
|
|
- "terminalCompressProgressBar",
|
|
|
-
|
|
|
- "rateLimitSeconds",
|
|
|
- "diffEnabled",
|
|
|
- "fuzzyMatchThreshold",
|
|
|
- "experiments",
|
|
|
-
|
|
|
- "codebaseIndexModels",
|
|
|
- "codebaseIndexConfig",
|
|
|
-
|
|
|
- "language",
|
|
|
-
|
|
|
- "telemetrySetting",
|
|
|
- "mcpEnabled",
|
|
|
- "enableMcpServerCreation",
|
|
|
-
|
|
|
- "mode",
|
|
|
- "modeApiConfigs",
|
|
|
- "customModes",
|
|
|
- "customModePrompts",
|
|
|
- "customSupportPrompts",
|
|
|
- "enhancementApiConfigId",
|
|
|
- "cachedChromeHostUrl",
|
|
|
- "historyPreviewCollapsed",
|
|
|
-])
|
|
|
+export const GLOBAL_SETTINGS_KEYS = globalSettingsSchema.keyof().options
|
|
|
|
|
|
/**
|
|
|
* RooCodeSettings
|
|
|
@@ -201,32 +119,7 @@ export type RooCodeSettings = GlobalSettings & ProviderSettings
|
|
|
/**
|
|
|
* SecretState
|
|
|
*/
|
|
|
-
|
|
|
-export type SecretState = Pick<
|
|
|
- ProviderSettings,
|
|
|
- | "apiKey"
|
|
|
- | "glamaApiKey"
|
|
|
- | "openRouterApiKey"
|
|
|
- | "awsAccessKey"
|
|
|
- | "awsSecretKey"
|
|
|
- | "awsSessionToken"
|
|
|
- | "openAiApiKey"
|
|
|
- | "geminiApiKey"
|
|
|
- | "openAiNativeApiKey"
|
|
|
- | "deepSeekApiKey"
|
|
|
- | "mistralApiKey"
|
|
|
- | "unboundApiKey"
|
|
|
- | "requestyApiKey"
|
|
|
- | "xaiApiKey"
|
|
|
- | "groqApiKey"
|
|
|
- | "chutesApiKey"
|
|
|
- | "litellmApiKey"
|
|
|
- | "codeIndexOpenAiKey"
|
|
|
- | "codeIndexQdrantApiKey"
|
|
|
- | "codebaseIndexOpenAiCompatibleApiKey"
|
|
|
->
|
|
|
-
|
|
|
-export const SECRET_STATE_KEYS = keysOf<SecretState>()([
|
|
|
+export const SECRET_STATE_KEYS = [
|
|
|
"apiKey",
|
|
|
"glamaApiKey",
|
|
|
"openRouterApiKey",
|
|
|
@@ -247,7 +140,8 @@ export const SECRET_STATE_KEYS = keysOf<SecretState>()([
|
|
|
"codeIndexOpenAiKey",
|
|
|
"codeIndexQdrantApiKey",
|
|
|
"codebaseIndexOpenAiCompatibleApiKey",
|
|
|
-])
|
|
|
+] as const satisfies readonly (keyof ProviderSettings)[]
|
|
|
+export type SecretState = Pick<ProviderSettings, (typeof SECRET_STATE_KEYS)[number]>
|
|
|
|
|
|
export const isSecretStateKey = (key: string): key is Keys<SecretState> =>
|
|
|
SECRET_STATE_KEYS.includes(key as Keys<SecretState>)
|