/** * Manifest module for tracking installed files * * Agent-agnostic module that provides functionality to: * - Hash files for change detection * - Create manifests of installed directories * - Compare current state against stored manifests */ /** * Manifest file structure storing hashes of all installed files */ export type FileManifest = { version: 1; createdAt: string; skillsetName: string; installDir?: string | null; files: Record; }; /** * Result of comparing a manifest against current directory state */ export type ManifestDiff = { modified: Array; added: Array; deleted: Array; }; /** * Files to exclude from manifest tracking regardless of location. * These are metadata files that should not trigger "local changes detected" warnings. */ export declare const EXCLUDED_FILES: ReadonlyArray; /** * Get the path to the manifest file for one (agent, install directory) pair. * The install directory is folded into the file name so activity in one * directory never touches the manifest of another. * * @param args - Configuration arguments * @param args.agentName - Name of the agent * @param args.installDir - Install directory the manifest describes * * @returns Absolute path to the manifest file */ export declare const getManifestPath: (args: { agentName: string; installDir: string; }) => string; /** * Get the old per-agent manifest path (for backwards-compatible read fallback * and uninstall cleanup of manifests written before per-directory keying) * * @param args - Configuration arguments * @param args.agentName - Name of the agent * * @returns Absolute path to the old per-agent manifest file */ export declare const getLegacyAgentManifestPath: (args: { agentName: string; }) => string; /** * Get the path to the legacy manifest file (for backwards-compatible fallback) * * @returns Absolute path to the legacy manifest file */ export declare const getLegacyManifestPath: () => string; /** * Compute SHA-256 hash of a file * * @param args - Configuration arguments * @param args.filePath - Absolute path to the file * * @returns SHA-256 hash as hex string */ export declare const computeFileHash: (args: { filePath: string; }) => Promise; /** * Compute a manifest for a directory * * Creates a manifest containing SHA-256 hashes of all files in the directory. * * @param args - Configuration arguments * @param args.dir - Directory to create manifest for * @param args.skillsetName - Name of the profile being installed * @param args.installDir - Install directory the manifest describes * @param args.managedFiles - Optional list of managed root-level filenames (falls back to defaults) * @param args.managedDirs - Optional list of managed directory names (falls back to defaults) * * @returns Manifest object with file hashes */ export declare const computeDirectoryManifest: (args: { dir: string; skillsetName: string; installDir?: string | null; managedFiles?: ReadonlyArray | null; managedDirs?: ReadonlyArray | null; }) => Promise; /** * Write a manifest to disk * * @param args - Configuration arguments * @param args.manifestPath - Absolute path to write the manifest * @param args.manifest - Manifest to write */ export declare const writeManifest: (args: { manifestPath: string; manifest: FileManifest; }) => Promise; /** * Read a manifest from disk * * @param args - Configuration arguments * @param args.manifestPath - Absolute path to read the manifest from * @param args.fallbackPaths - Legacy manifest locations to try in order when the primary is missing * * @returns Manifest object, or null if no candidate file exists */ export declare const readManifest: (args: { manifestPath: string; fallbackPaths?: ReadonlyArray | null; }) => Promise; /** * Compare a manifest against the current state of a directory * * @param args - Configuration arguments * @param args.manifest - Previously stored manifest * @param args.currentDir - Directory to compare against * @param args.managedFiles - Optional list of managed root-level filenames (falls back to defaults) * @param args.managedDirs - Optional list of managed directory names (falls back to defaults) * * @returns Diff showing modified, added, and deleted files */ export declare const compareManifest: (args: { manifest: FileManifest; currentDir: string; managedFiles?: ReadonlyArray | null; managedDirs?: ReadonlyArray | null; }) => Promise; /** * Remove all Nori-managed files from a directory using the manifest as a guide * * Reads the manifest to determine which files were installed, removes them, * cleans up empty managed directories, and removes the .nori-managed marker. * Files not in the manifest are preserved. Files listed in `excludePaths` * (relative to `agentDir`) are skipped — useful for files cleared in-place * via managed-block clearing rather than full deletion. * * @param args - Configuration arguments * @param args.agentDir - The agent's config directory to clean up * @param args.manifestPath - Path to the manifest file * @param args.managedDirs - Optional list of managed directory names (falls back to defaults) * @param args.excludePaths - Optional list of relative paths to skip when deleting */ export declare const removeManagedFiles: (args: { agentDir: string; manifestPath: string; managedDirs?: ReadonlyArray | null; excludePaths?: ReadonlyArray | null; }) => Promise; /** * Check if a manifest diff indicates any changes * * @param diff - Manifest diff to check * * @returns True if there are any changes */ export declare const hasChanges: (diff: ManifestDiff) => boolean; //# sourceMappingURL=manifest.d.ts.map