import { Effect } from "effect"; import type { ValidationError } from "../errors/crud-errors.js"; import type { MigrationError } from "../errors/migration-errors.js"; import { DocumentGraphSourceError } from "../errors/source-errors.js"; import type { SerializationError, StorageError, UnsupportedFormatError } from "../errors/storage-errors.js"; import { SerializerRegistry } from "../serializers/serializer-service.js"; import { type HasId } from "./derived-id.js"; import { type NormalizedSourceConfig } from "./source-config.js"; import { StorageAdapter } from "./storage-service.js"; /** * Result of loading every `documentGraph` source in a config: the merged, * validated effective records per graph-owned collection plus internal * record-level provenance (which file paths contributed each record), used only * to enrich error messages. */ export type DocumentGraphDiagnosticAction = "skipped-fragment" | "skipped-root" | "ignored-collection"; export interface DocumentGraphDiagnostic { readonly sourceId: string; readonly rootId: string; readonly path?: string; readonly action: DocumentGraphDiagnosticAction; readonly collection?: string; readonly recordId?: string; readonly message: string; readonly error?: DocumentGraphSourceError; } export interface DocumentGraphRecordContribution { readonly sourceId: string; readonly rootId: string; readonly path: string; readonly collection: string; readonly id: string; } export interface DocumentGraphRecordProvenance { readonly sourceId: string; readonly collection: string; readonly id: string; readonly contributors: ReadonlyArray; readonly effectiveContributor: DocumentGraphRecordContribution; } export interface LoadedDocumentGraph { readonly collections: Record>; readonly contributingPaths: ReadonlyMap>; readonly provenance: ReadonlyMap; readonly diagnostics: ReadonlyArray; } type GraphLoadError = DocumentGraphSourceError | StorageError | SerializationError | UnsupportedFormatError | ValidationError | MigrationError; /** * Load and merge all `documentGraph` sources from a normalized config. Each * source assembles one effective graph from ordered roots: discover by glob, * decode by extension, apply a pure transform, migrate each fragment to current * schema, deep-merge in order, then validate the effective records. * * Read-only: this returns data only; the factory is responsible for exposing the * graph-owned collections as non-writable. */ export declare const loadDocumentGraphSources: (config: NormalizedSourceConfig) => Effect.Effect; export {}; //# sourceMappingURL=document-graph-source.d.ts.map