import type { Client } from '@botpress/client';
import type { Environment, ResourceType, AddSpec, MutationResult, DependencyStateData, ConfigPatch, DiffResult, ApplyResult } from './types.js';
import { IntegrationResolver } from './resolvers/integration-resolver.js';
import { PluginResolver } from './resolvers/plugin-resolver.js';
import { IntegrationRegistry } from './registry/integration-registry.js';
import { PluginRegistry } from './registry/plugin-registry.js';
export interface ResourceEntry {
    type: ResourceType;
    alias: string;
    name: string;
    version: string;
    enabled: boolean;
}
export interface DependencyManagerOptions {
    projectPath: string;
    env: Environment;
    client: Client;
    botId: string;
    integrationRegistry?: IntegrationRegistry;
    pluginRegistry?: PluginRegistry;
    integrationResolver?: IntegrationResolver;
    pluginResolver?: PluginResolver;
}
export interface CopyOptions {
    from: Environment;
    to: Environment;
    dryRun?: boolean;
    yes?: boolean;
    sourceBotId?: string;
}
export declare class DependencyManager {
    private readonly snapshotStore;
    private readonly env;
    private readonly client;
    private readonly projectPath;
    private readonly botId;
    private readonly integrationRegistry;
    private readonly pluginRegistry;
    private readonly integrationResolver;
    private readonly pluginResolver;
    constructor(opts: DependencyManagerOptions);
    static fromProject(opts: {
        projectPath: string;
        env: Environment;
        client: Client;
        integrationRegistry?: IntegrationRegistry;
        pluginRegistry?: PluginRegistry;
        integrationResolver?: IntegrationResolver;
        pluginResolver?: PluginResolver;
        botId?: string;
    }): Promise<DependencyManager>;
    private static getProjectBotId;
    private getProjectBotId;
    private readSnapshot;
    private writeSnapshot;
    private readCloudSnapshot;
    snapshotStateFromCloud(): Promise<DependencyStateData>;
    applyState(state: DependencyStateData, opts?: {
        dryRun?: boolean;
        yes?: boolean;
    }): Promise<ApplyResult>;
    list(type?: ResourceType): Promise<ResourceEntry[]>;
    get(type: ResourceType, alias: string): Promise<ResourceEntry | undefined>;
    waitForIntegrationWebhook(name: string, opts: {
        timeoutMs: number;
        intervalMs: number;
    }): Promise<boolean>;
    add(type: ResourceType, spec: AddSpec): Promise<MutationResult>;
    remove(type: ResourceType, alias: string): Promise<MutationResult>;
    upgrade(type: ResourceType, alias: string, version?: string): Promise<MutationResult>;
    enable(type: ResourceType, alias: string): Promise<MutationResult>;
    disable(type: ResourceType, alias: string): Promise<MutationResult>;
    private toggleEnabled;
    configure(type: ResourceType, alias: string, patch: ConfigPatch): Promise<MutationResult>;
    private applyEntry;
    /**
     * For each interface the plugin requires that is NOT in `userDeps`, scan
     * the current snapshot's installed integrations to find one that implements it.
     *
     * - Exactly one match → auto-resolve (no prompt needed).
     * - Multiple matches → throw AMBIGUOUS_DEPENDENCY (caller / CLI should prompt
     *   the user to pass --dep <iface>=<alias> and retry).
     * - No matches → throw MISSING_DEPENDENCY.
     */
    private resolvePluginDependencies;
    /**
     * Best-effort lookup of hub integrations that implement a given interface.
     * Returns [] if the Cloud call fails — never throws (we don't want to mask
     * the real MISSING_DEPENDENCY error with a network error).
     */
    private findHubImplementersSafely;
    /**
     * Whether the integration's catalog spec gates on an OAuth/connection identifier.
     * Best-effort: an unreachable spec returns `false` so the caller falls back to
     * rethrowing the original error (we never *classify* on an unknown).
     */
    private specRequiresAuthorization;
    private refreshSnapshotFromCloud;
    private integrationEntriesMatch;
    private pluginEntriesMatch;
    diff(): Promise<DiffResult>;
    apply(opts?: {
        dryRun?: boolean;
        yes?: boolean;
    }): Promise<ApplyResult>;
    copy(opts: CopyOptions): Promise<ApplyResult>;
}
//# sourceMappingURL=dependency-manager.d.ts.map