//#region src/services/models/probe.d.ts /** * A single model entry returned by the probe */ interface ProbedModel { id: string; /** Owner/organization, when the provider reports it */ ownedBy?: string; /** Creation timestamp (unix seconds), when the provider reports it */ created?: number; } /** * Result of probing a provider for its available models */ interface ProbeResult { /** The fully-resolved endpoint that was queried */ endpoint: string; /** Models sorted by id */ models: ProbedModel[]; /** Raw response body, preserved for `--json` output */ raw: unknown; } interface ProbeOptions { baseUrl: string; apiKey?: string; /** Extra headers to merge into the request */ headers?: Record; /** Request timeout in milliseconds (default: 30000) */ timeoutMs?: number; /** Injectable fetch for testing */ fetchImpl?: typeof fetch; } /** * Resolve a user-provided URL into a `/models` endpoint. * * Smart completion rules: * - If the URL already targets a models listing (ends with `/models`), use it. * - If it ends with a version segment (e.g. `/v1`), append `/models`. * - Otherwise append `/v1/models`. * * Query strings and trailing slashes are normalized away before matching. */ declare function resolveModelsEndpoint(rawUrl: string): string; /** * Parse a raw `/v1/models` response body into a sorted list of models. * Tolerates both the standard `{ data: [...] }` shape and bare arrays. */ declare function parseModelsResponse(body: unknown): ProbedModel[]; /** * Probe a provider for the models it exposes. */ declare function probeModels(options: ProbeOptions): Promise; //#endregion export { ProbeOptions, ProbeResult, ProbedModel, parseModelsResponse, probeModels, resolveModelsEndpoint };