/** * TwelveLabs API Client — wraps the ElevenLabs Conversational AI API. * * Uses the Node 18+ global `fetch`. A single shared client config (just the * API key) is held in module state and pulled in by every request helper — * we only configure auth in one place, and all error handling lives in * `formatError` so individual tools stay clean. * * Every request to ElevenLabs needs the xi-api-key header. We pull the key * from the environment variable ELEVENLABS_API_KEY at startup. */ export declare const BASE_URL = "https://api.elevenlabs.io"; /** Validate that the API key is present before the server starts accepting calls. */ export declare function requireApiKey(): string; /** * Validate that a value is a safe URL path segment. * ElevenLabs IDs are alphanumeric strings, sometimes with hyphens/underscores. * Reject anything containing path separators, dots, or whitespace. */ export declare function validatePathSegment(value: string, label: string): string; export declare function initClient(): void; /** * Perform a typed GET request. * Generic T lets callers declare the expected response shape, keeping * the return type precise without casting everywhere. */ export declare function apiGet(path: string, params?: Record): Promise; /** Typed PATCH — used for partial agent updates. */ export declare function apiPatch(path: string, body: unknown): Promise; /** Typed POST — used for creating KB docs, etc. */ export declare function apiPost(path: string, body: unknown): Promise; /** DELETE — returns nothing meaningful, so no generic needed. */ export declare function apiDelete(path: string): Promise; /** * Convert any thrown value into a readable error string. * HttpError carries status + parsed response body; NetworkError carries the * underlying cause from fetch (TimeoutError, TypeError with system errno, etc.). */ export declare function formatError(error: unknown): string;