/** * ADR-406 P1 — classify the inventory into `CommandDefinition`s, validate * them, and emit a deterministic catalog. * * Determinism: entries sorted by id, object keys sorted recursively, no * generation timestamp, and `source.commit` is the last commit that touched * the source file (not the generator's HEAD), so regenerating an unchanged * tree yields the same bytes. */ import { type CatalogEntry, type CommandCatalog } from './schema.js'; import { type RawCommand } from './inventory.js'; export declare const REPOSITORY = "ruvnet/ruflo"; export interface CatalogOptions { /** Repository-relative path -> last commit sha touching it. Missing = `uncommitted`. */ readonly commits?: Readonly>; /** True when `packedFiles` was supplied to the inventory, so `shippedIn` is meaningful. */ readonly packageContentsInspected: boolean; /** Last commit touching any command source (stable across unrelated commits). */ readonly sourceCommit?: string; } /** JSON with object keys sorted at every depth and no whitespace. */ export declare function canonicalJson(value: unknown): string; export declare function catalogDigest(entries: readonly CatalogEntry[]): string; /** Merge the occurrences of one invocation spelling into one catalog entry. */ export declare function classify(key: string, occurrences: readonly RawCommand[], options: CatalogOptions): CatalogEntry; export interface ValidationResult { readonly valid: boolean; readonly errors: readonly string[]; } /** §14 P1 gate: schema-valid definitions, no duplicate ids, no duplicate names. */ export declare function validateEntries(entries: readonly unknown[]): ValidationResult; export declare function buildCatalog(inventory: readonly RawCommand[], options: CatalogOptions): CommandCatalog; /** Parse and re-verify a catalog read from disk (the parity check a consumer runs). */ export declare function verifyCatalog(raw: unknown): ValidationResult; export declare function serializeCatalog(catalog: CommandCatalog): string; /** * Write the catalog atomically. `expectedSha256` is the digest of the file the * caller last read (or `null` for "must not exist"); a mismatch means someone * else changed it and the write is refused (§6 concurrent-edit detection). */ export declare function writeCatalog(path: string, catalog: CommandCatalog, expectedSha256?: string | null): { written: boolean; sha256: string; }; //# sourceMappingURL=catalog.d.ts.map