import type { RetryConfig } from "../runtime/llmRetry.js"; /** * Fields that may be set as LLM defaults via `setLlmOptions`. A * deliberately small subset of the per-call `llm()` options. All ride * the same `stack.other.llmDefaults` bag; `runPrompt` routes * model/temperature/reasoningEffort/maxTokens into the smoltalk config * and `maxToolResultChars` into the tool-result cap. * * Extends `RetryConfig` (single source for `retries` / `timeout` / `backoff`, * shared with `LlmOpts` and the type-checker's `llmOptions` shape). Per-call * `llm()` options override these; these override the built-in defaults. */ export type LlmDefaults = RetryConfig & { model?: string; provider?: string; temperature?: number; reasoningEffort?: "low" | "medium" | "high"; maxTokens?: number; maxToolResultChars?: number; maxToolCallRounds?: number; }; /** * Merge `opts` into the ACTIVE branch stack's LLM defaults * (`stack.other.llmDefaults`). Only present (non-undefined) keys are * written, so a partial update never clears an existing default. * * Branch-scoped: inside a fork/race/tool branch this writes that * branch's own slice (seeded from the parent at fork time by * `runBatch.inheritBranchMemory`), so the change is visible in-branch * and does not leak to siblings or the parent after join. It rides the * serialized `stack.other`, so it survives interrupt/resume. `runPrompt` * merges it over the baked `smoltalkDefaults` and under any per-call * `llm({...})` option. */ export declare function _setLlmOptions(opts: LlmDefaults): void; /** Load a provider module by path at runtime and register its provider into * agency's own smoltalk — the runtime counterpart of `loadProviderModules` * (which runs at bootstrap). Lets any program register a custom provider on * demand. */ export declare function _registerProviderModule(modulePath: string): Promise; /** * Stable, flat view of one hosted model for discovery/pickers. Maps smoltalk's * `ModelType` (union, optional-heavy fields) into a fixed shape the CLI, the * agent, and `std::llm` all share. Field order is mirrored by the Agency-side * `HostedModelInfo` in `stdlib/llm.agency` — keep the two in sync. */ export type HostedModelInfo = { name: string; provider: string; openWeights: boolean; inputCost: number; outputCost: number; contextWindow: number; family: string; }; /** All known hosted TEXT models (baked catalog + any refreshed data). Non-text * members of the `ModelType` union lack pricing/context and are excluded. */ export declare function _listHostedModels(): HostedModelInfo[]; /** Metadata for one hosted text model by name, or null if unknown/non-text. */ export declare function _hostedModelInfo(name: string): HostedModelInfo | null; /** Tri-state modality probe backing `std::llm.modelSupportsInput`. Returns * null (not undefined — Agency has no undefined) when the model is unknown * or carries no modality data; that matches smoltalk's send-time gate, * which only blocks on an explicit false. */ export declare function _modelSupportsInput(model: string, modality: string): boolean | null; /** Fetch the latest model-data blob and return it pre-serialized. No * registration — the CLI prints this to stdout for the user to save and later * load with `std::llm.loadModelData`. */ export declare function _fetchModelData(url: string): Promise<{ ok: boolean; json: string; error: string; }>; /** Read a model-data JSON file (the shape `agency models refresh` prints) and * register it, ACCUMULATING over any previously registered data (this file * wins on provider+name collisions, deep-merging fields) and over the baked * catalog. Errors are returned, never thrown, so the Agency wrapper can map * them to a Result. Returns the number of models in THIS file. */ export declare function _loadModelData(path: string): { ok: boolean; count: number; error: string; };