import type { ValidatedConfig } from '../config-schema.js'; import type { LlmProvider } from './provider-base.js'; /** Role names recognised by Stage 1 callers. Strings rather than enum so * forward-compat roles (added in later stages) compile against an older * agim without type errors. */ export type LlmRole = 'cheap' | 'evaluator' | 'native-chat' | 'distill' | string; /** Resolved backend wiring exposed for engines that drive their own LLM * client (e.g. Agim Agent feeds this to pi-ai). Mirrors the same * resolution loadFromConfig already does for the built-in providers, so the * vendor-env key fallback and per-backend settings stay single-sourced. */ export type LlmThinkingFormat = 'off' | 'deepseek' | 'openai'; export type LlmMaxTokensField = 'max_tokens' | 'max_completion_tokens'; export interface LlmBackendBinding { name: string; providerType: string; model: string; baseUrl?: string; apiKey?: string; extraHeaders?: Record; temperature?: number; maxTokens?: number; contextWindow?: number; thinkingFormat?: LlmThinkingFormat; maxTokensField?: LlmMaxTokensField; } /** * Build the registry from a validated config. Idempotent — repeated * calls fully replace the previous state. Logs (info / warn) the load * outcome so operators see what landed at startup. */ export declare function loadFromConfig(cfg: ValidatedConfig | { llmBackends?: unknown; llmRoles?: unknown; }): void; /** * Get the provider configured for `role`, or null when no usable * backend is wired. Callers should NEVER throw on null — that's how the * registry tells them "fall back to your CLI path". */ export declare function getProvider(role: LlmRole): LlmProvider | null; /** Return the first configured provider regardless of role bindings. * Used as a safe fallback so native chat remains usable after adding * a backend even before optional role wiring is configured. */ export declare function getAnyProvider(): LlmProvider | null; /** Look up a provider directly by backend name (mostly for the web * "Test connection" button and unit tests). */ export declare function getProviderByName(name: string): LlmProvider | null; /** Resolved backend binding for `role`, or null when no usable backend is * wired. Used by engines that drive their own LLM client and * need the raw provider type / model / baseUrl / key rather than agim's * built-in LlmProvider object. */ export declare function getBackendBindingForRole(role: LlmRole): LlmBackendBinding | null; /** First configured backend binding regardless of role bindings. */ export declare function getAnyBackendBinding(): LlmBackendBinding | null; /** Resolved backend binding by backend name. */ export declare function getBackendBindingByName(name: string): LlmBackendBinding | null; /** List all configured backends — handy for the web UI roster. */ export declare function listProviders(): { name: string; providerType: string; model: string; }[]; /** Test/diagnostic: clear the registry. Used by bun tests so module * state doesn't leak across cases. */ export declare function _resetRegistry(): void; /** Diagnostic snapshot for the cost dashboard's "LLM backends" tile. */ export declare function describeRegistry(): { backends: { name: string; providerType: string; model: string; }[]; roles: Record; unconfigured: string[]; }; //# sourceMappingURL=registry.d.ts.map