// Main entry point for the Optave Client SDK // This will be the primary export for the runtime library // Export TypeScript types and interfaces export * from './types'; // Re-export SDK class type (implementation will be in JavaScript) export { OptaveJavaScriptSDK } from './types'; // Import from generated config so they are usable in this module's scope import { buildWebSocketUrl, buildAuthUrl, SERVER_ENVIRONMENTS, OAUTH2_TOKEN_URL, } from '../../generated/connection-config'; import type { AuthTransport } from '../../generated/connection-config'; // Re-export everything from generated config — single source of truth export { buildWebSocketUrl, buildAuthUrl, SERVER_ENVIRONMENTS, OAUTH2_TOKEN_URL }; export type { AuthTransport } from '../../generated/connection-config'; // Extends the generated interface with SDK-specific runtime field not present in the spec export interface GeneratedClientConfig { websocketUrl: string; authUrl: string; supportedAuthTransports: AuthTransport[]; OptaveTraceChatSessionId?: string; } // Delegates to the canonical URL builders so defaults always match the generated config export const createDefaultConfig = (): GeneratedClientConfig => ({ websocketUrl: buildWebSocketUrl(), authUrl: buildAuthUrl(), supportedAuthTransports: ['subprotocol', 'query'], OptaveTraceChatSessionId: undefined }); // Keep constant export for backwards compatibility export const DEFAULT_CONFIG: GeneratedClientConfig = createDefaultConfig();