/**
 * CLI wrapper for convert-openai-chat.
 *
 * Usage: visionclaw convert-openai-chat <output-dir> [-o chat-output-dir]
 */
import { convertOpenaiChat } from "./convert-openai-chat.js";
export async function runConvertOpenaiChat(args) {
    let outputDir = "";
    let chatOutputDir;
    for (let i = 0; i < args.length; i++) {
        const arg = args[i];
        if ((arg === "-o" || arg === "--output-dir") && i + 1 < args.length) {
            chatOutputDir = args[++i];
        }
        else if (!arg.startsWith("-") && !outputDir) {
            outputDir = arg;
        }
    }
    if (!outputDir) {
        console.error("Usage: visionclaw convert-openai-chat <output-dir> [-o chat-output-dir]\n" +
            "\n" +
            "  <output-dir>   Path to pipeline output (contains restructured-*.jsonl + workspace/)\n" +
            "  -o <dir>       Where to write openai-chat-*.jsonl (defaults to output-dir)");
        process.exit(1);
    }
    console.log(`Converting to OpenAI chat format: ${outputDir}`);
    await convertOpenaiChat({ outputDir, chatOutputDir });
    console.log("Done.");
}
//# sourceMappingURL=convert-openai-chat-cli.js.map