#!/usr/bin/env node
import { migrateArtifactsToProjects } from '../lib/artifact-migration.js';
import { resetDbHandle } from '../lib/db.js';

const force = process.argv.includes('--force');
const result = migrateArtifactsToProjects({ force, log: (msg) => console.error(msg) });
console.log(JSON.stringify(result, null, 2));
try { resetDbHandle(); } catch {}
process.exit(result.ok ? 0 : 1);
