import { type CredentialValueSource, type JsonObject, type ModelConfig } from "@arnilo/prism"; /** Official OpenCode Go API base (`/chat/completions`, `/messages`, `/models`). */ export declare const OPENCODE_GO_DEFAULT_BASE_URL = "https://opencode.ai/zen/go/v1"; export type OpenCodeGoRoute = "openai" | "anthropic"; export interface OpenCodeGoModelConfig extends Omit { readonly provider?: "opencode-go"; readonly compat?: JsonObject & { /** Dual-route selector: `"anthropic"` → `/messages`; default `"openai"` → `/chat/completions`. */ readonly route?: OpenCodeGoRoute; /** Replay prior thinking (Anthropic thinking blocks / OpenAI `reasoning_content`). */ readonly preserveThinking?: boolean; /** Upstream passthrough for Chat Completions models that accept effort (e.g. Kimi K3). */ readonly reasoning_effort?: string; /** Upstream passthrough for Chat Completions thinking objects (e.g. Kimi K2.x / GLM). */ readonly thinking?: boolean | JsonObject; /** Upstream OpenAI-style `reasoning` object when the gateway forwards it. */ readonly reasoning?: JsonObject; }; } export interface ListOpenCodeGoModelsOptions { readonly apiKey?: CredentialValueSource; readonly fetch?: typeof fetch; /** Defaults to official `https://opencode.ai/zen/go/v1`. */ readonly baseUrl?: string; readonly signal?: AbortSignal; readonly headers?: Readonly>; readonly provider?: string; } /** * Sparse official `GET /zen/go/v1/models` entry (`id` / `object` / `created` / `owned_by`). * If the payload gains capability fields, `capabilities.structured_output` is * honored as gateway-authoritative (see `discoveryStructuredOutput`). * @see https://opencode.ai/docs/go/ */ export interface OpenCodeGoModelEntry { readonly id: string; readonly object?: string; readonly created?: number; readonly owned_by?: string; /** Forward-compatible capability block; absent from the current sparse payload. */ readonly capabilities?: { readonly structured_output?: boolean | "json_schema"; }; } export declare function defineOpenCodeGoModel(config: OpenCodeGoModelConfig): ModelConfig; /** * Official docs endpoint table: MiniMax + Qwen use Anthropic Messages; all other * Go models use OpenAI-compatible Chat Completions. * @see https://opencode.ai/docs/go/ */ export declare function routeForOpenCodeGoModel(modelId: string): OpenCodeGoRoute; /** * Caller-gated OpenCode Go model discovery via official `GET /models`. * Never invoked by `createOpenCodeGoProviderPackage` — hosts call this and pass * results via `models:` (or register themselves). Payload is sparse; route / * limits / cache kind are inferred from the official Go docs endpoint table. * @see https://opencode.ai/docs/go/ */ export declare function listOpenCodeGoModels(options?: ListOpenCodeGoModelsOptions): Promise; /** * Map a sparse official `/models` entry to Prism `ModelConfig`. * Official payload is id/created/owned_by only — route/cache/limits are heuristic * from the docs endpoint + featured metadata tables. */ export declare function mapOpenCodeGoModel(entry: OpenCodeGoModelEntry, options?: { readonly provider?: string; }): ModelConfig; /** * Featured offline bootstrap catalog — docs-verified official Go model ids with * dual-route `compat.route`. Prefer `listOpenCodeGoModels()` for the live set. */ export declare const openCodeGoModels: readonly ModelConfig[];