import { ResolutionCache, type ResolutionCacheConfig } from './resolution-cache.js';
/** A catalog ref always carries a name + version, and optionally a workspace scope. */
export interface CatalogRef {
    name: string;
    version: string;
    workspace?: string;
}
/** The identity + definition a source resolves a ref to. */
export interface ResolvedSpec<TDef> {
    id: string;
    updatedAt: string;
    definition: TDef;
}
/**
 * The per-type cloud-fetch logic (integrations, plugins, interfaces). A source
 * knows how to turn a ref into a definition from cloud and how to build a typed,
 * actionable error when the ref can't be resolved — but it owns no caching. That
 * lives once in {@link CatalogService}.
 */
export interface CatalogSource<TDef, TRef extends CatalogRef = CatalogRef> {
    /** Cache bucket + on-disk id-field name for this resource type. */
    readonly cacheConfig: ResolutionCacheConfig;
    /**
     * Resolve a ref to its identity + definition from cloud. MUST throw a typed
     * `AdkError` (not return null) when the ref cannot be resolved, so the caller
     * gets an actionable message.
     */
    fetchByRef(ref: TRef): Promise<ResolvedSpec<TDef>>;
}
/**
 * Generic catalog fetch + cache orchestration, unifying the
 * `fetch{Integration,Plugin,Interface}` methods the three managers each
 * duplicated: check the two-level {@link ResolutionCache}, fall through to the
 * source on a miss, then write both cache levels. The type-specific cloud calls
 * and search/list operations live on the concrete {@link CatalogSource}; only the
 * cache-orchestrated definition fetch is generic here.
 */
export declare class CatalogService<TDef, TRef extends CatalogRef = CatalogRef> {
    private readonly source;
    readonly cache: ResolutionCache<TDef>;
    constructor(source: CatalogSource<TDef, TRef>, noCache?: boolean);
    /** Fetch a definition by ref, preferring the cache (resolution → definition). */
    getDefinition(ref: TRef): Promise<TDef>;
    /** Read a cached definition ignoring the resolution TTL, or null if none is cached. */
    private getStaleDefinition;
    /** Combined resolution + definition cache stats (matches the managers' getCacheStats). */
    getCacheStats(): Promise<{
        count: number;
        sizeBytes: number;
    }>;
    clearCache(): Promise<void>;
}
//# sourceMappingURL=catalog-service.d.ts.map