import { J as JetstreamChangeSourceOptions } from '../jetstream-source-a396D7Z4.js'; import { a as SnapshotSource, P as PreparedSnapshot, b as SnapshotProgress, c as SnapshotBatch, C as ChangeSource, d as SourceSemantics, S as SourcePosition, M as MutationBatch } from '../sources-DKyp_dDd.js'; import { C as ContrailConfig } from '../types-CmjW-xL4.js'; import '@atcute/jetstream'; import '@atcute/identity-resolver'; import '@atcute/lexicons/syntax'; interface AlluviumSourceIdentity { /** Logical source ID shared by archived and direct Jetstream mutations. */ id: string; /** Operator-owned continuity epoch. Protocol v1 does not publish one yet. */ epoch: string; /** Exact Jetstream URL advertised by every selected manifest. */ url: string; } interface AlluviumTransportOptions { maxAttempts?: number; requestTimeoutMs?: number; maxCompressedBytes?: number; maxLineCharacters?: number; /** Maximum archived mutations retained for the protocol-v1 global ordering * pass. Default: 100,000. */ maxArchiveMutations?: number; batchSize?: number; } interface AlluviumBootstrapSourceOptions { endpoint: string | URL; source: AlluviumSourceIdentity; /** Direct Jetstream options used only to obtain the preliminary capture mark. */ jetstream: Omit; transport?: AlluviumTransportOptions; fetch?: typeof fetch; /** Permit HTTP only for controlled local development. Default: false. */ allowInsecureHttp?: boolean; } interface AlluviumBootstrapSources { snapshotSource: AlluviumSnapshotSource; changeSource: AlluviumChangeSource; } /** Build the numeric-cursor mapping used by `DatabaseBootstrapTarget` so the * final archived Alluvium checkpoint becomes the starting cursor for ordinary * bounded cron ingestion. */ declare function createAlluviumLiveCursor(source: AlluviumSourceIdentity): (position: SourcePosition) => number; interface AlluviumBasePart { part: number; url: string; checksum: string; records: number; compressedBytes: number; } interface AlluviumHistoricalCoverage { scope: "configured-relays"; status: "complete" | "incomplete" | "unknown"; accountsDiscovered: number; accountsIncluded: number; accountsOmitted: number; report: null | { url: string; checksum: string; compressedBytes: number; mediaType: "application/gzip"; }; } interface AlluviumTailObject { run: number; firstRun?: number; lastRun?: number; level?: "raw" | "hour" | "six-hour" | "day"; part: number; firstTimeUs: number; lastTimeUs: number; url: string; checksum: string; events: number; compressedBytes: number; } interface AlluviumCollectionManifest { format: "alluvium.collection"; version: 1; collection: string; state: "pending_capture" | "capturing" | "backfilling" | "active" | "gap" | "paused" | "error"; source: { id: string; protocol: "jetstream-v1"; url: string; archivedThroughTimeUs: number; }; semantics: { operations: ["put", "delete"]; accountDeletion: false; repositorySync: false; physicalPayloadDeletion: false; }; coverage: { captureFromRun: number | null; captureFromTimeUs: number | null; capturedThroughRun: number; capturedThroughTimeUs: number; knownGaps: number; historicalBootstrap: "current-records-from-pds"; }; base: { generation: number; throughRun: number; throughTimeUs: number; url: string; checksum: string; records: number; compressedBytes: number; seedKind: "backfill" | "fold" | "rebuild"; historicalCoverage: AlluviumHistoricalCoverage; parts: AlluviumBasePart[]; }; tail: AlluviumTailObject[]; } interface TransportPolicy { maxAttempts: number; requestTimeoutMs: number; maxCompressedBytes: number; maxLineCharacters: number; maxArchiveMutations: number; batchSize: number; } declare class AlluviumAdapterBase { protected readonly options: AlluviumBootstrapSourceOptions; protected readonly endpoint: URL; protected readonly source: AlluviumSourceIdentity; protected readonly policy: TransportPolicy; protected readonly fetcher: typeof fetch; constructor(options: AlluviumBootstrapSourceOptions); } /** Experimental snapshot adapter for existing Alluvium collection manifests. * Protocol v1 lacks an atomic bundle, so all selected manifests must expose the * same source, base boundary, and captured-through boundary. */ declare class AlluviumSnapshotSource extends AlluviumAdapterBase implements SnapshotSource { readonly id = "alluvium"; prepare(options: { collections: string[]; signal?: AbortSignal; }): Promise; read(options: { snapshot: PreparedSnapshot; progress?: SnapshotProgress[]; signal?: AbortSignal; }): AsyncIterable; } /** Experimental Alluvium archive replay ending at the exact cron cursor. */ declare class AlluviumChangeSource extends AlluviumAdapterBase implements ChangeSource { readonly id = "alluvium"; readonly semantics: SourceSemantics; private readonly direct; constructor(config: ContrailConfig, options: AlluviumBootstrapSourceOptions); mark(options: { collections: string[]; snapshot?: PreparedSnapshot; signal?: AbortSignal; }): Promise; read(options: { collections: string[]; snapshot?: PreparedSnapshot; after: SourcePosition; through: SourcePosition; signal?: AbortSignal; }): AsyncIterable; } /** Create a paired experimental Alluvium snapshot/archive source. */ declare function createAlluviumBootstrapSources(config: ContrailConfig, options: AlluviumBootstrapSourceOptions): AlluviumBootstrapSources; export { type AlluviumBasePart, type AlluviumBootstrapSourceOptions, type AlluviumBootstrapSources, AlluviumChangeSource, type AlluviumCollectionManifest, type AlluviumHistoricalCoverage, AlluviumSnapshotSource, type AlluviumSourceIdentity, type AlluviumTailObject, type AlluviumTransportOptions, createAlluviumBootstrapSources, createAlluviumLiveCursor };