/** * Extension validation and conflict detection. * * @module extensions/validation */ import type { Extension, ExtensionSource, ResolvedExtension } from "./types.js"; /** * Information about a contract conflict between extensions. */ export interface ConflictInfo { contract: string; providers: Array<{ name: string; source: ExtensionSource; }>; } /** Immutable contract metadata captured before extension activation. @internal */ export interface ExtensionContractSnapshot { readonly declaredProvides: readonly string[]; readonly requires: readonly string[]; readonly legacyProvides: readonly Readonly<{ contract: string; implementation: unknown; }>[]; } /** * Priority map for extension sources. * Lower number = higher priority. */ export declare const SOURCE_PRIORITY: Readonly>; /** * Select the highest-priority provider for each contract across a list of * resolved extensions. When multiple extensions provide the same contract, * the one whose source has the lowest `SOURCE_PRIORITY` number wins. * Ties break on first-seen order (mirrors detectConflicts semantics). */ export declare function selectContractProviders(extensions: ResolvedExtension[], snapshots?: ReadonlyMap): Map; /** Descriptor-snapshot contract metadata for planning and activation. @internal */ export declare function snapshotExtensionContractMetadata(extension: Extension): ExtensionContractSnapshot; /** * Validate the shape of an extension object. * Returns an array of issue descriptions (empty array = valid). * * Accepts `unknown` so callers at module-boundary / config-loading paths can * validate arbitrary imported values without casting. */ export declare function validateExtension(ext: unknown): string[]; /** * Detect contract conflicts between resolved extensions. * * A conflict exists when two or more extensions provide the same contract * and no single provider has strictly higher source priority than all others. */ export declare function detectConflicts(extensions: ResolvedExtension[], snapshots?: ReadonlyMap, extensionNames?: ReadonlyMap): ConflictInfo[]; //# sourceMappingURL=validation.d.ts.map