import { type ChatCompletionParams, type LLMProvider, type ModelInfo, type ProviderCapabilities, type ReasoningEffort, type StreamChunk, type ThinkingConfig } from '@namzu/sdk'; import type { ZenService } from './models.js'; import type { ZenConfig, ZenGoConfig } from './types.js'; export declare const ZEN_CAPABILITIES: ProviderCapabilities; export declare const ZEN_BASE_URL = "https://opencode.ai/zen/v1"; export declare const ZEN_GO_BASE_URL = "https://opencode.ai/zen/go/v1"; /** * The host the anonymous free tier is served from. * * `ZEN_BASE_URL` remains the route for every keyed request, but the free-tier * gateway refuses anonymous traffic on it: `POST /zen/v1/chat/completions` * answers `403 FreeTierError` ("can only be used from within OpenCode") no * matter how faithfully the request is shaped. The same request against * `/inference/v1/chat/completions` is admitted, and that is the path OpenCode * itself now speaks. Only the chat route is reachable anonymously — `/models` * answers on both, and the Anthropic and Responses routes answer `401 Missing * API key` on either, which is why the gate never offered them free access to * begin with. */ export declare const ZEN_FREE_TIER_BASE_URL = "https://opencode.ai/inference/v1"; /** A provider instance belongs to one conversation; it never owns an agent loop. */ export declare class ZenProvider implements LLMProvider { private readonly config; readonly service: ZenService; readonly id: 'zen' | 'zen-go'; readonly name: string; readonly capabilities: ProviderCapabilities; readonly sessionId: string; private readonly baseURL; private readonly timeout; private readonly requestFetch; private readonly apiKey; private readonly anonymous; constructor(config?: ZenConfig, service?: ZenService); chatStream(params: ChatCompletionParams): AsyncIterable; listModels(signal?: AbortSignal): Promise; reasoningEffortLevelsFor(model: string, _thinking?: ThinkingConfig): readonly ReasoningEffort[] | undefined; resolveContextWindow(model: string, signal?: AbortSignal): Promise; /** * Whether `model` reads images. One Zen account serves vision and text-only * models side by side, and a text-only one refuses the whole request when the * conversation holds an image; the catalogue says which is which. A model the * catalogue does not know is assumed to read them. */ supportsImageInputFor(model: string): boolean; /** * Whether `model` takes a forced tool choice. The Go models that refuse * `required` or a named function (the DeepSeek V4 ones among them) are * refused before transport by the same rule, so the kernel asks first and * puts the instruction in words instead of failing the step. */ acceptsForcedToolChoiceFor(model: string): boolean; /** The injected runtime catalogue as it stands now, or undefined for the bundled one alone. */ private runtimeCatalogue; /** Exact lookup: the runtime catalogue first, then the bundled snapshot. */ private model; /** * Classify a caught throwable into a `ProviderRequestError`. * * `model`, when given, names the request that failed: a driver-level * detail like "the operation was aborted due to timeout" says nothing * about WHICH model was unreachable, and an operator watching a run that * spans several models (a fallback chain, `resolveContextWindow`, a * chat vs. a catalogue call) needs that in the one sentence the error * carries, not just in a status line above it that a log line will not * repeat. `listModels()` has no single model to name and omits it. */ private failure; } export declare class ZenGoProvider extends ZenProvider { constructor(config: ZenGoConfig); } //# sourceMappingURL=client.d.ts.map