/** * kosha-discovery — Discovery snapshot, delta, and health helpers. * * I keep the versioned discovery-plane projection here so `ModelRegistry` * itself can stay focused on API shape and orchestration. * @module */ import type { DiscoveryDeltaV1, DiscoveryHealthRecord, DiscoveryModelV1, DiscoveryProviderV1, DiscoverySnapshotV1 } from "./discovery-contract.js"; import type { ModelCard } from "./types.js"; import type { ProviderObservation, RegistryState } from "./registry-state.js"; /** * Return the cached snapshot when it is still valid for diff generation. */ export declare function registrySnapshotForDelta(state: RegistryState): DiscoverySnapshotV1 | null; /** * Build and cache the stable v1 discovery snapshot. */ export declare function registryDiscoverySnapshot(state: RegistryState): DiscoverySnapshotV1; /** * Return discovery deltas since a previous cursor. */ export declare function registryDiscoveryDelta(state: RegistryState, options?: { sinceCursor?: string | null; }): DiscoveryDeltaV1; /** * Stream live deltas through the shared registry event bus. */ export declare function registryWatchDiscovery(state: RegistryState, options?: { sinceCursor?: string | null; }): AsyncGenerator; /** * Advance the discovery cursor and emit a delta when the snapshot changes. */ export declare function registryRecordDiscoveryMutation(state: RegistryState, previousSnapshot: DiscoverySnapshotV1 | null): void; /** * Build a monotonic cursor for snapshot and delta consumers. */ export declare function registryMakeCursor(state: RegistryState): string; /** * Build the stable v1 discovery snapshot from in-memory state. */ export declare function registryBuildSnapshot(state: RegistryState, cursor: string): DiscoverySnapshotV1; /** * Serialize one provider entry into the stable v1 schema. */ export declare function registrySerializeProvider(state: RegistryState, providerId: string): DiscoveryProviderV1; /** * Serialize one model route into the stable v1 schema. */ export declare function registrySerializeModel(state: RegistryState, model: ModelCard): DiscoveryModelV1; /** * Build the normalized provider-health projection for the v1 schema. */ export declare function registryBuildHealthRecord(state: RegistryState, providerId: string): DiscoveryHealthRecord; /** * Store one provider observation for later health normalization. */ export declare function registryRecordObservation(state: RegistryState, providerId: string, entry: { latencyMs: number; errorType: ProviderObservation["lastErrorType"]; }): void; /** * Normalize a provider error message into a stable health class. */ export declare function registryClassifyError(errorMessage: string): ProviderObservation["lastErrorType"]; //# sourceMappingURL=registry-discovery.d.ts.map