"use strict";
/**
 * @fileoverview Polygon generator script parser.
 * Parses Polygon-format test generation scripts and converts them to structured commands.
 *
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateGeneratorCommands = validateGeneratorCommands;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
function validateGeneratorCommands(commands, availableGenerators) {
    for (const command of commands) {
        if (command.type === 'generator-single' ||
            command.type === 'generator-range') {
            if (!command.generator) {
                throw new Error('Generator command missing generator name');
            }
            if (!availableGenerators.includes(command.generator)) {
                throw new Error(`Generator "${command.generator}" not found in configuration. ` +
                    `Available generators: ${availableGenerators.join(', ')}`);
            }
        }
        else if (command.type === 'manual') {
            if (!command.manualFile) {
                throw new Error('Manual command missing file path');
            }
            const filePath = path_1.default.resolve(process.cwd(), command.manualFile);
            if (!fs_1.default.existsSync(filePath)) {
                throw new Error(`Manual test file not found: ${command.manualFile}`);
            }
        }
    }
}
//# sourceMappingURL=script-parser.js.map