import type { AgentActivity, AgentTurnStart, LLMProvider, ProviderDef } from '@moxxy/sdk'; export declare class ProviderRegistry { private readonly defs; private readonly instances; private active; /** * Names the user disabled. Kept name-based (not def-based) so it can be * seeded from preferences BEFORE the plugins register their defs — boot * order doesn't matter. A disabled provider stays registered/listable but * can't be activated. */ private readonly disabled; private readonly agentTurnListeners; private readonly activityListeners; private readonly activeListeners; /** Per provider name: the unsubscribe from its instance's `onAgentTurn` and `onAgentActivity`. */ private readonly agentTurnWatches; /** * Register a provider def. Throws on duplicate — use `replace()` for * explicit overwrite. Matches the semantics of `tools` and `channels`. */ register(def: ProviderDef, instance?: LLMProvider): void; /** * Overwrite an existing def (also drops the cached instance so the new * createClient gets called). * * Invariant: replacing the ACTIVE provider's def leaves `active` pointing at * it but with no cached instance, so `getActive()` throws until the caller * rebuilds the instance. Callers replacing the active provider MUST follow * with `setActive(name, config)` (replace can't rebuild itself — it has no * config). The sole production caller does exactly that. */ replace(def: ProviderDef, instance?: LLMProvider): void; unregister(name: string): void; list(): ReadonlyArray; /** * Enable/disable a provider by name. Disabling the ACTIVE provider is * refused — switch first, then disable — so a session never ends up with an * active-but-disabled provider. Unknown names are accepted (the set seeds * from preferences before plugins register), except when disabling via a * live toggle is meaningless because the provider is active. */ setEnabled(name: string, enabled: boolean): void; isEnabled(name: string): boolean; /** * Activate a provider, building its client on first activation. NOTE: once an * instance is cached, a later `setActive(name, newConfig)` REUSES the cached * instance and DROPS `newConfig` — re-config requires `replace()` first * (which clears the cache), the flow the sole production caller follows. * Reconfiguring by rebuilding here is intentionally avoided so callers don't * silently lose instance identity / in-flight state on a redundant activate. */ setActive(name: string, config?: Record): LLMProvider; /** The active provider changed to `name`. Returns the unsubscribe. */ onActiveChange(listener: (name: string) => void): () => void; getActive(): LLMProvider; getActiveName(): string | null; /** A turn the active provider's agent started by itself (see `LLMProvider.onAgentTurn`). Returns the unsubscribe. */ onAgentTurn(listener: (start: AgentTurnStart) => void): () => void; /** What the active provider's agent did in the background between turns (see `LLMProvider.onAgentActivity`). Returns the unsubscribe. */ onAgentActivity(listener: (activity: AgentActivity) => void): () => void; private keep; private drop; } //# sourceMappingURL=providers.d.ts.map