export declare const DOCS_MANIFEST_FILE = ".funnelsgrove-docs.json"; export type FunnelDocsManifest = { schemaVersion: 1; bundleVersion: string; stepContractVersion: number; contractHash: string; managedFiles: Array<{ path: string; sha256: string; }>; }; export type LegacyDocsCatalogEntry = { version: string; path: string; sha256: string; }; export type DocsFileState = 'current' | 'missing' | 'changed' | 'known-legacy-current-path' | 'known-legacy-obsolete' | 'owned-obsolete' | 'conflict'; export type DocsAction = 'none' | 'install' | 'adopt' | 'replace-known' | 'retire-known' | 'retire-owned' | 'conflict'; export type DocsDiagnostic = { code: string; message: string; path?: string; }; export type Diagnostic = DocsDiagnostic; export type DocsFileStatus = { path: string; state: DocsFileState; action: DocsAction; currentHash?: string; bundledHash?: string; priorHash?: string; }; export type DocsStatus = { bundleVersion: string; contractVersion: number; clean: boolean; files: DocsFileStatus[]; diagnostics: DocsDiagnostic[]; }; type BundledFile = { bytes: Buffer; mode: number; path: string; sha256: string; }; export type BundledDocs = { root: string; manifest: FunnelDocsManifest; manifestBytes: Buffer; files: Map; }; type InspectedFile = Omit; export type DocsInspection = { bundle: BundledDocs; targetRoot: string; priorManifest: FunnelDocsManifest | null; files: InspectedFile[]; }; export type DocsFaultPoint = { operation: 'stage' | 'backup' | 'apply' | 'manifest' | 'residue'; timing: 'before' | 'after'; path: string; }; export type DocsTransactionOptions = { transactionId?: string; faultInjector?: (point: DocsFaultPoint) => void | Promise; legacyCatalog?: readonly LegacyDocsCatalogEntry[]; }; export declare class DocsTransactionError extends Error { readonly code: string; constructor(code: string, message: string); } export declare const loadBundledDocs: (sourceDir: string) => Promise; export declare const inspectTemplateDocs: (bundle: BundledDocs, targetDir: string, options?: { legacyCatalog?: readonly LegacyDocsCatalogEntry[]; }) => Promise; export declare const planTemplateDocsUpdate: (inspection: DocsInspection) => DocsStatus; export declare const applyTemplateDocsUpdate: (bundle: BundledDocs, targetDir: string, status: DocsStatus, options?: DocsTransactionOptions) => Promise; export declare const recoverTemplateDocs: (targetDir: string, options?: Pick) => Promise<"none" | "completed" | "restored">; export declare const resolveTemplateDocsConflict: (bundle: BundledDocs, targetDir: string, relativePath: string, options?: DocsTransactionOptions) => Promise; export {};