import type { ImportCollisionPolicy, ImportPlan, ImportProduct, ImportResult, ImportSourceScope } from "./types"; export interface BuildImportPreviewOptions { product: ImportProduct; sourceScope: ImportSourceScope; destinationScope: "project" | "global"; surfaces?: readonly ("skills" | "hooks" | "mcps")[]; collisionPolicy: ImportCollisionPolicy; cwd: string; homeDir: string; } /** * Read the selected source product/scope, normalize every candidate through * the sibling contracts, and produce a redacted preview plus an opaque apply * plan. Pure reads only — nothing is written until `applyImport`. */ export declare function buildImportPreview(options: BuildImportPreviewOptions): Promise; /** * Apply a confirmed plan. The transaction contract: * * 1. Pre-validation — every destination path is derived from validated plan * identities (never raw payload names), containment-checked beneath the * canonical scope directories, and walked for symlinked ancestors; the * destination MCP config shape is validated; add/rename destinations are * revalidated against the preview decision (stale previews fail closed). * Any problem aborts the whole apply before a single write. * 2. Publication — each skill/hook file is written to a same-directory temp * file (0600) and atomically renamed into place; MCP entries merge into one * in-memory config written once via the canonical atomic writer. Only * files this transaction actually publishes enter the rollback journal. * 3. Verification — persisted state is re-read inside the transaction; a * verification mismatch rolls back exactly like a write failure. * 4. Rollback — restores journal snapshots (or removes created files) and * reports every restore failure honestly instead of claiming success. */ export declare function applyImport(plan: ImportPlan, options: { cwd: string; }): Promise;