import { renderZellijSlotColumnAnchorFromArtifacts } from '../core/zellij/zellij-slot-column-anchor.js';
export async function run(_command = 'zellij-slot-column-anchor', args = []) {
    const missionId = readOption(args, '--mission', 'latest') || 'latest';
    const artifactRoot = readOption(args, '--artifact-root', process.cwd()) || process.cwd();
    const mode = readOption(args, '--mode', 'compact-slots') || 'compact-slots';
    const watch = hasFlag(args, '--watch');
    const intervalMs = Math.max(250, Number(readOption(args, '--interval-ms', '1000') || 1000));
    for (;;) {
        const text = await renderZellijSlotColumnAnchorFromArtifacts({ artifactRoot, missionId, mode });
        process.stdout.write('\x1Bc' + text + '\n');
        if (!watch)
            break;
        await new Promise((resolve) => setTimeout(resolve, intervalMs));
    }
}
function readOption(args, name, fallback) {
    const index = args.indexOf(name);
    return index >= 0 && args[index + 1] ? String(args[index + 1]) : fallback;
}
function hasFlag(args, flag) {
    return args.includes(flag);
}
//# sourceMappingURL=zellij-slot-column-anchor.js.map