import type { Logger } from "pino";
import type { AgentClient, AgentMode, AgentModelDefinition, AgentProvider, ProviderSnapshotEntry } from "./agent-sdk-types.js";
import type { ManagedAgent } from "./agent-manager.js";
import type { WorkspaceGitService } from "../workspace-git-service.js";
import type { AgentProviderRuntimeSettingsMap, ProviderOverride } from "./provider-launch-config.js";
import type { MutableDaemonConfig } from "../daemon-config-store.js";
type ProviderSnapshotChangeListener = (entries: ProviderSnapshotEntry[], cwd: string) => void;
export interface ProviderSnapshotManagerOptions {
    logger: Logger;
    runtimeSettings?: AgentProviderRuntimeSettingsMap;
    providerOverrides?: Record<string, ProviderOverride>;
    workspaceGitService?: Pick<WorkspaceGitService, "resolveRepoRoot">;
    isDev?: boolean;
    extraClients?: Partial<Record<AgentProvider, AgentClient>>;
    refreshTimeoutMs?: number;
}
interface ProviderSnapshotRefreshOptions {
    cwd: string;
    providers?: AgentProvider[];
}
interface ProviderSnapshotReadOptions {
    cwd?: string | null;
    providers?: AgentProvider[];
    wait?: boolean;
}
interface ProviderSnapshotProviderOptions {
    cwd?: string | null;
    provider: AgentProvider;
    wait?: boolean;
}
export interface ResolveProviderCreateConfigOptions {
    cwd?: string | null;
    provider: AgentProvider;
    requestedMode: string | undefined;
    featureValues: Record<string, unknown> | undefined;
    parent: ManagedAgent | null;
    unattended: boolean;
}
export interface ResolvedProviderCreateConfig {
    modeId: string | undefined;
    featureValues: Record<string, unknown> | undefined;
}
interface ResolveDefaultModelOptions {
    provider: AgentProvider;
    requestedModel?: string | null;
    cwd?: string;
}
export interface ProviderDiagnosticResult {
    provider: AgentProvider;
    diagnostic: string;
}
export interface AgentManagerProviderState {
    providerDefinitions: Partial<Record<AgentProvider, {
        enabled: boolean;
        derivedFromProviderId: string | null;
    }>>;
    clients: Partial<Record<AgentProvider, AgentClient>>;
}
export declare class ProviderSnapshotManager {
    private readonly snapshots;
    private readonly providerLoads;
    private readonly events;
    private destroyed;
    private readonly refreshTimeoutMs;
    private readonly logger;
    private readonly workspaceGitService?;
    private readonly isDev;
    private readonly extraClients;
    private runtimeSettings;
    private providerOverrides;
    private readonly baseProviderOverrides;
    private providerRegistry;
    private providerClients;
    constructor(options: ProviderSnapshotManagerOptions);
    getSnapshot(cwd?: string): ProviderSnapshotEntry[];
    refreshSnapshotForCwd(options: ProviderSnapshotRefreshOptions): Promise<void>;
    refreshSettingsSnapshot(options?: Omit<ProviderSnapshotRefreshOptions, "cwd">): Promise<void>;
    warmUpSnapshotForCwd(options: ProviderSnapshotRefreshOptions): Promise<void>;
    refresh(options: ProviderSnapshotRefreshOptions): Promise<void>;
    listRegisteredProviderIds(): AgentProvider[];
    hasProvider(provider: AgentProvider): boolean;
    getProviderLabel(provider: AgentProvider): string;
    getAgentManagerProviderState(): AgentManagerProviderState;
    private ensureClient;
    listProviders(input?: ProviderSnapshotReadOptions): Promise<ProviderSnapshotEntry[]>;
    getProvider(input: ProviderSnapshotProviderOptions): Promise<ProviderSnapshotEntry>;
    listModels(input: ProviderSnapshotProviderOptions): Promise<AgentModelDefinition[]>;
    listModes(input: ProviderSnapshotProviderOptions): Promise<AgentMode[]>;
    resolveDefaultModel(input: ResolveDefaultModelOptions): Promise<string | undefined>;
    resolveCreateConfig(input: ResolveProviderCreateConfigOptions): Promise<ResolvedProviderCreateConfig>;
    getProviderDiagnostic(provider: AgentProvider): Promise<ProviderDiagnosticResult>;
    applyMutableProviderConfig(mutableProviders: MutableDaemonConfig["providers"] | undefined): AgentManagerProviderState;
    on(event: "change", listener: ProviderSnapshotChangeListener): this;
    off(event: "change", listener: ProviderSnapshotChangeListener): this;
    shutdown(): Promise<void>;
    destroy(): void;
    private buildRegistry;
    private resolveParent;
    private getReadyProvider;
    private requireProvider;
    private createLoadingEntries;
    private reconcileSnapshotForRegistry;
    private warmUp;
    private refreshProviders;
    private clearCachedProviders;
    private loadProviders;
    private loadProvider;
    private refreshProvider;
    private getProviderLoad;
    private setProviderLoad;
    private isCurrentProviderLoad;
    private emitChange;
    private getOrCreateSnapshot;
    private resetSnapshotToLoading;
    private getProviderIds;
    private resolveRefreshProviders;
}
export declare function resolveSnapshotCwd(cwd?: string | null): string;
export {};
//# sourceMappingURL=provider-snapshot-manager.d.ts.map