export const AUTH_CONFIG_KEYS = new Set(["provider", "apiKey"]);
export const WRITABLE_CONFIG_KEYS = new Set([
    "imageModels.default",
    "imageModels.reasoningEffort",
    "apiProvider.defaultImageModel",
    "apiProvider.defaultReasoningEffort",
    "log.level",
    "features.cardNews",
    "cardNewsPlanner.enabled",
    "cardNewsPlanner.model",
    "cardNewsPlanner.timeoutMs",
    "cardNewsPlanner.deterministicFallback",
    "grokProvider.plannerModel",
    "grokProvider.plannerTimeoutMs",
    "grokProvider.defaultImageModel",
    "comfy.defaultUrl",
    "comfy.uploadTimeoutMs",
    "comfy.maxUploadBytes",
    "storage.generatedDir",
    "storage.generatedDirName",
    "server.port",
    "server.host",
    "server.bodyLimit",
    "oauth.proxyPort",
    "oauth.statusTimeoutMs",
    "oauth.restartDelayMs",
    "limits.maxRefCount",
    "limits.maxParallel",
    "history.defaultPageSize",
    "history.maxPageCap",
]);
export const KEY_TO_ENV = {
    "imageModels.default": "IMA2_IMAGE_MODEL_DEFAULT",
    "imageModels.reasoningEffort": "IMA2_REASONING_EFFORT",
    "apiProvider.defaultImageModel": "IMA2_API_IMAGE_MODEL_DEFAULT",
    "apiProvider.defaultReasoningEffort": "IMA2_API_REASONING_EFFORT",
    "log.level": "IMA2_LOG_LEVEL",
    "features.cardNews": "IMA2_CARD_NEWS",
    "server.port": "IMA2_PORT",
    "server.host": "IMA2_HOST",
    "server.bodyLimit": "IMA2_BODY_LIMIT",
    "oauth.proxyPort": "IMA2_OAUTH_PROXY_PORT",
    "storage.generatedDir": "IMA2_GENERATED_DIR",
    "cardNewsPlanner.enabled": "IMA2_CARD_NEWS_PLANNER",
    "cardNewsPlanner.model": "IMA2_CARD_NEWS_PLANNER_MODEL",
    "cardNewsPlanner.timeoutMs": "IMA2_CARD_NEWS_PLANNER_TIMEOUT_MS",
    "grokProvider.plannerModel": "IMA2_GROK_PLANNER_MODEL",
    "grokProvider.plannerTimeoutMs": "IMA2_GROK_PLANNER_TIMEOUT_MS",
    "grokProvider.defaultImageModel": "IMA2_GROK_IMAGE_MODEL_DEFAULT",
    "limits.maxParallel": "IMA2_MAX_PARALLEL",
    "limits.maxRefCount": "IMA2_MAX_REF_COUNT",
    "history.defaultPageSize": "IMA2_HISTORY_PAGE_SIZE",
};
const REDACT_PATTERN = /token|secret|apikey|password/i;
const ALWAYS_REDACT = new Set(["provider", "apiKey", "oauth.token", "oauth.refreshToken", "vertexServiceAccountJson"]);
export function isSensitiveConfigKey(key) {
    return ALWAYS_REDACT.has(key) || REDACT_PATTERN.test(key);
}
