import { ModelCatalogPersistence } from './model-catalog-persistence.js'; import { type CatalogSourceOrigin, type ModelCatalogStore } from './model-catalog-store.js'; import { XopcCloudModelSource } from './xopc-cloud-model-source.js'; export type CatalogEnsureReason = 'startup' | 'oauth' | 'agent-run' | 'manual' | 'recovery'; export interface EnsureCatalogOptions { reason: CatalogEnsureReason; network: 'never' | 'if-empty' | 'always'; timeoutMs?: number; } export interface CatalogReadiness { state: 'not-authorized' | 'ready' | 'stale' | 'refreshing' | 'unavailable'; source: CatalogSourceOrigin | 'none'; fetchedAt?: number; catalogVersion?: string | null; modelCount: number; error?: { code: string; message: string; retryable: boolean; }; } interface CatalogCoordinatorOptions { source?: Pick; store?: ModelCatalogStore; persistence?: Pick; staleAfterMs?: number; refreshModels?: () => void; reloadImageProviders?: () => void; withLock?: (operation: () => Promise) => Promise; onPermanentAuthFailure?: () => Promise; } export declare class XopcCloudCatalogCoordinator { private readonly source; private readonly store; private readonly persistence; private readonly staleAfterMs; private readonly refreshModels; private readonly reloadImageProviders; private readonly withLock; private readonly onPermanentAuthFailure; private refreshPromise; private generation; private lastError; private notAuthorized; constructor(options?: CatalogCoordinatorOptions); hydrate(): Promise; ensure(options: EnsureCatalogOptions): Promise; refresh(reason: CatalogEnsureReason, timeoutMs?: number): Promise; clear(reason: 'revoke' | 'invalid-grant'): Promise; snapshot(): CatalogReadiness; private buildSnapshot; private runRefresh; } export declare function getXopcCloudCatalogCoordinator(): XopcCloudCatalogCoordinator; export declare function resetXopcCloudCatalogCoordinator(): void; export {};