import type { ProviderMoniker } from '@xyo-network/xl1-protocol/protocol-model';
import type { ConnectionConfig } from '../config/connections/Connection.js';
import type { ProviderDescriptor } from './Provider.js';
/** Public contract for Resolution Plan. */
export interface ResolutionPlan {
    /** Capability moniker -> winning descriptor id (for snapshot diffing). */
    readonly bindings: Readonly<Record<ProviderMoniker, string>>;
    /** Descriptors that lost; included for diagnostics. */
    readonly rejected: readonly RejectedDescriptor[];
    /** Descriptors that should be instantiated, in topological order. */
    readonly selected: readonly ProviderDescriptor[];
}
/** Public contract for Rejected Descriptor. */
export interface RejectedDescriptor {
    /** descriptor configuration or state exposed by this contract. */
    readonly descriptor: ProviderDescriptor;
    /** reason configuration or state exposed by this contract. */
    readonly reason: string;
}
/** Implements Missing Capability Error behavior for the SDK provider graph. */
export declare class MissingCapabilityError extends Error {
    /** Moniker implemented by this provider instance. */
    readonly moniker: ProviderMoniker;
    /** reasons configuration or state exposed by this contract. */
    readonly reasons: readonly string[];
    /** Creates an instance with the supplied configuration. */
    constructor(moniker: ProviderMoniker, reasons: readonly string[]);
}
/** Implements Ambiguous Provider Error behavior for the SDK provider graph. */
export declare class AmbiguousProviderError extends Error {
    /** Provider factories available for dependency resolution. */
    readonly candidates: readonly string[];
    /** Moniker implemented by this provider instance. */
    readonly moniker: ProviderMoniker;
    /** Creates an instance with the supplied configuration. */
    constructor(moniker: ProviderMoniker, candidates: readonly ProviderDescriptor[]);
}
/** Implements Unbound Provider Error behavior for the SDK provider graph. */
export declare class UnboundProviderError extends Error {
    /** Moniker implemented by this provider instance. */
    readonly moniker: ProviderMoniker;
    /** Creates an instance with the supplied configuration. */
    constructor(moniker: ProviderMoniker);
}
/** Implements Unknown Connection Error behavior for the SDK provider graph. */
export declare class UnknownConnectionError extends Error {
    /** connection Name configuration or state exposed by this contract. */
    readonly connectionName: string;
    /** Moniker implemented by this provider instance. */
    readonly moniker: ProviderMoniker;
    /** Creates an instance with the supplied configuration. */
    constructor(moniker: ProviderMoniker, connectionName: string);
}
interface ProviderBindingLike {
    connection?: string;
}
/** Public contract for Resolve Providers Options. */
export interface ResolveProvidersOptions {
    /** connections configuration or state exposed by this contract. */
    readonly connections?: Readonly<Record<string, ConnectionConfig>>;
    /** provider Bindings configuration or state exposed by this contract. */
    readonly providerBindings?: Readonly<Partial<Record<ProviderMoniker, ProviderBindingLike>>>;
}
/**
 * Plans which providers to register for a given set of needs.
 *
 * 1. Fixpoint-expand monikers from selected descriptor `dependencies`.
 * 2. Select a single `none` candidate when no connection is bound. Connection-consuming
 *    providers require `providerBindings[moniker].connection`.
 * 3. Filter candidates by bound connection type.
 * 4. Throw when zero or multiple candidates remain.
 * 5. Toposort selected descriptors using `dependencies`.
 */
export declare function resolveProviders(needs: ReadonlySet<ProviderMoniker>, candidates: readonly ProviderDescriptor[], options?: ResolveProvidersOptions): ResolutionPlan;
export {};
//# sourceMappingURL=resolveProviders.d.ts.map