import type { Dispatcher } from '../audit-runner.js'; import type { ProviderFetch } from './errors.js'; export type Provider = 'anthropic' | 'deepseek' | 'zai'; export interface ResolveProviderInput { /** Process env. Pass `process.env` in production; inject a stub in tests. */ env: Record; /** Parsed CLI args. `provider` is set when the operator passed `--provider`. */ args: { provider?: string; }; /** Whether the `claude` CLI is available on PATH. Inject in tests. */ claudeOnPath: boolean; } /** * Resolve which LLM provider the audit runner should use. * * Precedence (highest first): * 1. --provider (explicit flag — operator override) * 2. KNOWLEDGE_FRESHNESS_PROVIDER env var * 3. Single API key in env (inferred) * 4. >1 API key present → error (ambiguous) * 5. No env, claude on PATH → anthropic (subprocess uses keychain) * 6. Nothing → error (no provider configured) * * Errors are thrown with operator-facing messages that name the exact env * var or flag the operator should set. */ export declare function resolveProvider(input: ResolveProviderInput): Provider; /** * Construct a Dispatcher for the chosen provider. Each provider's * implementation lives in its own file. This factory is the ONLY place * the audit-run-entry CLI knows about provider differences. */ export interface BuildDispatcherOptions { /** Per-fetch / per-subprocess timeout in seconds. */ timeoutSec: number; /** Process env (production: `process.env`). Used by provider implementations * for API keys and any optional overrides (e.g. model name). */ env: Record; /** Test-injectable fetch for the HTTP providers (zai/deepseek). Production * omits this so the providers use undici's fetch. */ fetchImpl?: ProviderFetch; /** Whether the `claude` CLI is on PATH. Pass `false` to fail construction * of an anthropic dispatcher (primary OR fallback) early, instead of at * first dispatch. Leave undefined to skip the check (back-compat). */ claudeOnPath?: boolean; } export declare function buildDispatcher(provider: Provider, opts: BuildDispatcherOptions): Dispatcher; //# sourceMappingURL=index.d.ts.map