// spec-migrator/version-detection.ts — Detect legacy config versions
import { access, readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { isLegacyLocation } from '../planu-config-writer.js';
/**
 * Check if a project path has a planu.json with legacy specLocation.
 */
export async function hasLegacyConfig(projectPath) {
    try {
        await access(join(projectPath, 'planu.json'));
        const content = await readFile(join(projectPath, 'planu.json'), 'utf-8');
        const config = JSON.parse(content);
        return config.specLocation ? isLegacyLocation(config.specLocation) : false;
    }
    catch {
        return false;
    }
}
//# sourceMappingURL=version-detection.js.map