import { ValidationError } from '../errors.js';
export function ensureProjectIsMutable(project, action) {
    if (!project.archivedAt)
        return;
    if (project.repoDeletedAt) {
        throw new ValidationError(`Project "${project.name}" is archived and its local repository files were deleted. Rebind repoPath and restore it before trying to ${action}.`);
    }
    throw new ValidationError(`Project "${project.name}" is archived. Restore it before trying to ${action}.`);
}
export function ensureProjectHasRepository(project, action) {
    if (!project.repoDeletedAt)
        return;
    throw new ValidationError(`Project "${project.name}" no longer has local repository files. Rebind repoPath and restore it before trying to ${action}.`);
}
//# sourceMappingURL=project-guards.js.map