/** * Project lifecycle engine — move, rename, and re-register CLEO projects. * * Provides the core operations for relocating a CLEO project on disk, * renaming it, and reconciling the nexus registry after manual moves. * * All functions accept explicit absolute paths — no CWD-walk-up (AC7). * * @task T11010 — T10298-1 */ import { type EngineResult } from './engine-result.js'; /** Result of a successful project move. */ export interface MoveProjectResult { /** Stable project UUID — preserved across moves. */ projectId: string; /** The old absolute project root path. */ oldPath: string; /** The new absolute project root path. */ newPath: string; /** Updated project hash (based on new path). */ newProjectHash: string; /** Nexus reconcile status. */ reconcileStatus: 'ok' | 'path_updated' | 'auto_registered'; } /** Result of a successful project rename. */ export interface RenameProjectResult { /** Stable project UUID — preserved across renames. */ projectId: string; /** The project root path. */ projectRoot: string; /** The old project name. */ oldName: string; /** The new project name. */ newName: string; /** Updated project hash (name influences hash). */ newProjectHash: string; } /** Result of a successful project re-registration. */ export interface ReregisterProjectResult { /** Stable project UUID. */ projectId: string; /** The project root path. */ projectRoot: string; /** Current project hash. */ projectHash: string; /** Whether the project had drifted (path changed since last register). */ drifted: boolean; /** Nexus reconcile status. */ reconcileStatus: 'ok' | 'path_updated' | 'auto_registered'; /** Previous path if drift was detected. */ oldPath?: string; } /** * Move a CLEO project to a new filesystem location. * * Copies the entire project directory tree to `newPath`, updates * `project-info.json` with the new project root and hash, reconciles * the nexus registry, and returns the result. * * The original directory is NOT removed — callers should verify the * move succeeded before cleaning up the old location. * * @param newPath - Absolute path to the new project root location. * @param projectRoot - Absolute path to the current project root. * @returns EngineResult with {@link MoveProjectResult} on success. * * @remarks AC3: Uses fs.cp for the filesystem move. The projectId is * preserved across moves; projectHash is recomputed from the new path. * * @example * ```typescript * const result = await moveProject('/new/location/project', '/old/project'); * if (result.success) { * console.log(`Moved to ${result.data.newPath}, hash=${result.data.newProjectHash}`); * } * ``` */ export declare function moveProject(newPath: string, projectRoot: string): Promise>; /** * Rename a CLEO project (updates project-info.json name and hash). * * This is a lightweight metadata operation — no files are moved. * The projectHash is recomputed because the project name influences * the canonical project ID (T9149 algorithm). * * @param newName - The new project name. * @param projectRoot - Absolute path to the project root. * @returns EngineResult with {@link RenameProjectResult} on success. * * @remarks AC4: Updates project-info.json name field and recomputes * projectHash based on the new basename. * * @example * ```typescript * const result = await renameProject('my-new-name', '/path/to/project'); * if (result.success) { * console.log(`Renamed to ${result.data.newName}`); * } * ``` */ export declare function renameProject(newName: string, projectRoot: string): Promise>; /** * Re-register a CLEO project with the nexus registry. * * Detects when a project has been moved on the filesystem without using * `moveProject`, and reconciles the nexus registry accordingly. * * @param projectRoot - Absolute path to the project root. * @returns EngineResult with {@link ReregisterProjectResult} on success. * * @remarks AC5: Reads project-info.json, calls nexusReconcile, and * returns drift status when the filesystem location has changed. * * @example * ```typescript * const result = await reregisterProject('/path/to/moved-project'); * if (result.success) { * console.log(`Drifted: ${result.data.drifted}, status: ${result.data.reconcileStatus}`); * } * ``` */ export declare function reregisterProject(projectRoot: string): Promise>; //# sourceMappingURL=project-lifecycle.d.ts.map