| 1234567891011121314151617181920212223242526 |
- import { SECRET_STATE_KEYS, ProviderSettings } from "@roo-code/types"
- export function checkExistKey(config: ProviderSettings | undefined) {
- if (!config) {
- return false
- }
- // Special case for human-relay, fake-ai, claude-code, and gemini-cli providers which don't need any configuration.
- if (config.apiProvider && ["human-relay", "fake-ai", "claude-code", "gemini-cli"].includes(config.apiProvider)) {
- return true
- }
- // Check all secret keys from the centralized SECRET_STATE_KEYS array.
- const hasSecretKey = SECRET_STATE_KEYS.some((key) => config[key] !== undefined)
- // Check additional non-secret configuration properties
- const hasOtherConfig = [
- config.awsRegion,
- config.vertexProjectId,
- config.ollamaModelId,
- config.lmStudioModelId,
- config.vsCodeLmModelSelector,
- ].some((value) => value !== undefined)
- return hasSecretKey || hasOtherConfig
- }
|