import type { CyberneticConfig, ConfigOptions } from './types.js'; /** * Derive WebSocket URL from API URL for known SaaS domains. * Maps REST API domains to their WebSocket counterparts: * chatapi.astermind.ai → wss://chatws.astermind.ai * chatapi-dev.astermind.ai → wss://chatws-dev.astermind.ai * api.astermind.ai → wss://chatws.astermind.ai * * Returns undefined for non-SaaS (on-prem) URLs. */ export declare function deriveWsUrl(apiUrl: string): string | undefined; /** * Resolve the WebSocket URL for a given config. * Priority: explicit wsUrl → env var → auto-derived from apiUrl */ export declare function resolveWsUrl(config: CyberneticConfig): string | undefined; /** * Validate configuration */ export declare function validateConfig(config: unknown): config is CyberneticConfig; /** * Load config from Node.js process.env (for bundlers that replace process.env) */ declare function loadFromProcessEnv(): CyberneticConfig | null; /** * Load config from Vite's import.meta.env (browser environment) * Note: This only works at build time when Vite replaces the variables */ declare function loadFromViteEnv(): CyberneticConfig | null; /** * Load config from window.astermindConfig global object */ declare function loadFromGlobalObject(): CyberneticConfig | null; /** * Load config from script tag data attributes */ declare function loadFromScriptAttributes(): CyberneticConfig | null; /** * Load config using priority-based fallback chain: * 1. Environment variables (process.env - for bundlers/Node.js) * 2. Vite environment variables (import.meta.env or window.__ASTERMIND_CONFIG__) * 3. Global object (window.astermindConfig) * 4. Script data attributes (data-astermind-key, data-astermind-url) * * @param options - Configuration options * @param options.throwOnMissingKey - If true (default), throws when no API key found. If false, returns null and logs a warning. * @returns Configuration object or null if not found and throwOnMissingKey is false */ export declare function loadConfig(options?: ConfigOptions): CyberneticConfig | null; /** * Export individual loaders for testing and advanced use cases */ export declare const configLoaders: { loadFromProcessEnv: typeof loadFromProcessEnv; loadFromViteEnv: typeof loadFromViteEnv; loadFromGlobalObject: typeof loadFromGlobalObject; loadFromScriptAttributes: typeof loadFromScriptAttributes; }; export {}; //# sourceMappingURL=config.d.ts.map