Files
OmniRoute/src/types/settings.ts
Diego Rodrigues de Sa e Souza bfaf459f3c Release v3.8.32 (#4418)
Release v3.8.32 — see CHANGELOG.md [3.8.32] for the full list. Merged via --admin over documented non-blocking checks: CodeQL alerts ratchet (#665 fixed by #4457/#4462, auto-closes on main rescan), Integration Tests (env-flaky batch-upstream), SonarCloud/SonarQube (advisory new-code).
2026-06-21 08:56:51 -03:00

82 lines
2.5 KiB
TypeScript

import type { HideableSidebarGroupId } from "@/shared/constants/sidebarGroupVisibility";
import type {
HideableSidebarItemId,
SidebarItemOrder,
SidebarPresetId,
SidebarSectionId,
} from "@/shared/constants/sidebarVisibility";
import type { ResilienceSettings } from "@/lib/resilience/settings";
import type {
AccountFallbackStrategyValue,
RoutingStrategyValue,
} from "@/shared/constants/routingStrategies";
/**
* Application settings stored in SQLite key-value pairs.
*/
export interface Settings {
requireLogin: boolean;
hasPassword: boolean;
fallbackStrategy: AccountFallbackStrategyValue;
stickyRoundRobinLimit: number;
requestRetry: number;
maxRetryIntervalSec: number;
maxBodySizeMb?: number;
jwtSecret?: string;
mcpEnabled?: boolean;
mcpTransport?: "stdio" | "sse" | "streamable-http";
a2aEnabled?: boolean;
hideHealthCheckLogs?: boolean;
hideEndpointCloudflaredTunnel?: boolean;
hideEndpointTailscaleFunnel?: boolean;
hideEndpointNgrokTunnel?: boolean;
preferClaudeCodeForUnprefixedClaudeModels?: boolean;
autoRefreshProviderQuota?: boolean;
autoRefreshProviderQuotaInterval?: number;
pinProviderQuotaToHome?: boolean;
showQuickStartOnHome?: boolean;
showProviderTopologyOnHome?: boolean;
hiddenSidebarItems?: HideableSidebarItemId[];
hiddenSidebarGroupLabels?: HideableSidebarGroupId[];
sidebarSectionOrder?: SidebarSectionId[];
sidebarItemOrder?: SidebarItemOrder;
sidebarActivePreset?: SidebarPresetId;
resilienceSettings?: ResilienceSettings;
// LOCAL_ONLY manage-scope bypass policy (DB-stored, hot-reloaded by
// `applyRuntimeSettings` → `applyAuthzBypassSection`). The route guard
// consults `getAuthzBypassSnapshot()` on the hot path; these fields are
// the persisted source of truth that feeds that snapshot.
localOnlyManageScopeBypassEnabled?: boolean;
localOnlyManageScopeBypassPrefixes?: string[];
}
export interface ComboDefaults {
strategy: RoutingStrategyValue;
maxRetries: number;
retryDelayMs: number;
fallbackDelayMs?: number;
maxComboDepth: number;
trackMetrics: boolean;
reasoningTokenBufferEnabled?: boolean;
concurrencyPerModel?: number;
queueTimeoutMs?: number;
queueDepth?: number;
handoffThreshold?: number;
handoffModel?: string;
handoffProviders?: string[];
maxMessagesForSummary?: number;
}
export interface ProxyConfig {
type: "http" | "https" | "socks5";
host: string;
port: number;
username?: string;
password?: string;
}
export interface KVPair {
key: string;
value: string;
}