"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.orchestrateTestScenario = orchestrateTestScenario;
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
const __typia_transform__llmApplicationFinalize = __importStar(require("typia/lib/internal/_llmApplicationFinalize.js"));
const utils_1 = require("@autobe/utils");
const tstl_1 = require("tstl");
const typia_1 = __importDefault(require("typia"));
const NamingConvention_1 = require("typia/lib/utils/NamingConvention");
const uuid_1 = require("uuid");
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
const divideArray_1 = require("../../utils/divideArray");
const executeCachedBatch_1 = require("../../utils/executeCachedBatch");
const transformTestScenarioHistories_1 = require("./histories/transformTestScenarioHistories");
const orchestrateTestScenarioReview_1 = require("./orchestrateTestScenarioReview");
function orchestrateTestScenario(ctx, instruction) {
    return __awaiter(this, void 0, void 0, function* () {
        var _a;
        const document = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.document;
        if (document === undefined) {
            throw new Error("Cannot write test scenarios because these are no operations.");
        }
        const dict = new tstl_1.HashMap(document.operations.map((op) => new tstl_1.Pair({
            path: op.path,
            method: op.method,
        }, op)), utils_1.AutoBeEndpointComparator.hashCode, utils_1.AutoBeEndpointComparator.equals);
        const endpointNotFound = [
            `You have to select one of the endpoints below`,
            "",
            " method | path ",
            "--------|------",
            ...document.operations
                .map((op) => `\`${op.method}\` | \`${op.path}\``)
                .join("\n"),
        ].join("\n");
        const progress = {
            total: document.operations.length,
            completed: 0,
        };
        const reviewProgress = {
            total: document.operations.length,
            completed: 0,
        };
        const exclude = [];
        let include = [...document.operations];
        let trial = 0;
        do {
            const matrix = (0, divideArray_1.divideArray)({
                array: include,
                capacity: 4,
            });
            yield (0, executeCachedBatch_1.executeCachedBatch)(matrix.map((include) => (promptCacheKey) => __awaiter(this, void 0, void 0, function* () {
                exclude.push(...(yield divideAndConquer(ctx, {
                    dict,
                    endpointNotFound,
                    document,
                    include,
                    exclude: exclude.map((x) => x.endpoint),
                    progress,
                    reviewProgress,
                    promptCacheKey,
                    instruction,
                })));
            })));
            include = include.filter((op) => {
                if (exclude.some((pg) => pg.endpoint.method === op.method && pg.endpoint.path === op.path)) {
                    return false;
                }
                return true;
            });
            progress.total = include.length + exclude.length;
            reviewProgress.total = include.length + exclude.length;
        } while (include.length > 0 && ++trial < ctx.retry);
        return exclude.flatMap((pg) => {
            return pg.scenarios.map((plan) => {
                return {
                    endpoint: pg.endpoint,
                    draft: plan.draft,
                    functionName: plan.functionName,
                    dependencies: plan.dependencies,
                };
            });
        });
    });
}
const divideAndConquer = (ctx, props) => __awaiter(void 0, void 0, void 0, function* () {
    var _a, _b, _c, _d;
    const pointer = {
        value: [],
    };
    const authorizations = (_b = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.authorizations) !== null && _b !== void 0 ? _b : [];
    try {
        const { tokenUsage } = yield ctx.conversate({
            source: "testScenarios",
            histories: (0, transformTestScenarioHistories_1.transformTestScenarioHistories)({
                state: ctx.state(),
                document: props.document,
                include: props.include,
                exclude: props.exclude,
                instruction: props.instruction,
            }),
            controller: createController({
                model: ctx.model,
                endpointNotFound: props.endpointNotFound,
                dict: props.dict,
                authorizations,
                build: (next) => {
                    var _a;
                    next.scenarioGroups.forEach((sg) => sg.scenarios.forEach((s) => {
                        s.functionName = NamingConvention_1.NamingConvention.snake(s.functionName);
                    }));
                    (_a = pointer.value) !== null && _a !== void 0 ? _a : (pointer.value = []);
                    pointer.value.push(...next.scenarioGroups);
                },
            }),
            enforceFunctionCall: true,
            promptCacheKey: props.promptCacheKey,
            message: `Create e2e test scenarios.`,
        });
        if (pointer.value.length === 0)
            return [];
        props.progress.total = Math.max(props.progress.total, (props.progress.completed += pointer.value.length));
        ctx.dispatch({
            type: "testScenarios",
            id: (0, uuid_1.v7)(),
            tokenUsage,
            scenarios: pointer.value
                .map((v) => v.scenarios.map((s) => ({
                endpoint: v.endpoint,
                draft: s.draft,
                functionName: s.functionName,
                dependencies: s.dependencies,
            })))
                .flat(),
            completed: props.progress.completed,
            total: props.progress.total,
            step: (_d = (_c = ctx.state().interface) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
            created_at: new Date().toISOString(),
        });
        return yield (0, orchestrateTestScenarioReview_1.orchestrateTestScenarioReview)(ctx, {
            instruction: props.instruction,
            groups: pointer.value,
            progress: props.reviewProgress,
        });
    }
    catch (_e) {
        return [];
    }
});
function createController(props) {
    (0, assertSchemaModel_1.assertSchemaModel)(props.model);
    const validate = (next) => {
        const result = (() => { const _io0 = input => Array.isArray(input.scenarioGroups) && input.scenarioGroups.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io2(input.endpoint) && (Array.isArray(input.scenarios) && (1 <= input.scenarios.length && input.scenarios.every(elem => "object" === typeof elem && null !== elem && _io3(elem)))); const _io2 = input => "string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io3 = input => "string" === typeof input.draft && "string" === typeof input.functionName && (Array.isArray(input.dependencies) && input.dependencies.every(elem => "object" === typeof elem && null !== elem && _io4(elem))); const _io4 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io2(input.endpoint) && "string" === typeof input.purpose; const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.scenarioGroups) || _report(_exceptionable, {
                path: _path + ".scenarioGroups",
                expected: "Array<IAutoBeTestScenarioApplication.IScenarioGroup>",
                value: input.scenarioGroups
            })) && input.scenarioGroups.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
                path: _path + ".scenarioGroups[" + _index4 + "]",
                expected: "IAutoBeTestScenarioApplication.IScenarioGroup",
                value: elem
            })) && _vo1(elem, _path + ".scenarioGroups[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
                path: _path + ".scenarioGroups[" + _index4 + "]",
                expected: "IAutoBeTestScenarioApplication.IScenarioGroup",
                value: elem
            })).every(flag => flag) || _report(_exceptionable, {
                path: _path + ".scenarioGroups",
                expected: "Array<IAutoBeTestScenarioApplication.IScenarioGroup>",
                value: input.scenarioGroups
            })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
                path: _path + ".endpoint",
                expected: "AutoBeOpenApi.IEndpoint",
                value: input.endpoint
            })) && _vo2(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
                path: _path + ".endpoint",
                expected: "AutoBeOpenApi.IEndpoint",
                value: input.endpoint
            }), (Array.isArray(input.scenarios) || _report(_exceptionable, {
                path: _path + ".scenarios",
                expected: "(Array<IAutoBeTestScenarioApplication.IScenario> & MinItems<1>)",
                value: input.scenarios
            })) && ((1 <= input.scenarios.length || _report(_exceptionable, {
                path: _path + ".scenarios",
                expected: "Array<> & MinItems<1>",
                value: input.scenarios
            })) && input.scenarios.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
                path: _path + ".scenarios[" + _index5 + "]",
                expected: "IAutoBeTestScenarioApplication.IScenario",
                value: elem
            })) && _vo3(elem, _path + ".scenarios[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
                path: _path + ".scenarios[" + _index5 + "]",
                expected: "IAutoBeTestScenarioApplication.IScenario",
                value: elem
            })).every(flag => flag)) || _report(_exceptionable, {
                path: _path + ".scenarios",
                expected: "(Array<IAutoBeTestScenarioApplication.IScenario> & MinItems<1>)",
                value: input.scenarios
            })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
                path: _path + ".path",
                expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
                value: input.path
            })) || _report(_exceptionable, {
                path: _path + ".path",
                expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
                value: input.path
            }), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
                path: _path + ".method",
                expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
                value: input.method
            })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.draft || _report(_exceptionable, {
                path: _path + ".draft",
                expected: "string",
                value: input.draft
            }), "string" === typeof input.functionName || _report(_exceptionable, {
                path: _path + ".functionName",
                expected: "string",
                value: input.functionName
            }), (Array.isArray(input.dependencies) || _report(_exceptionable, {
                path: _path + ".dependencies",
                expected: "Array<IAutoBeTestScenarioApplication.IDependencies>",
                value: input.dependencies
            })) && input.dependencies.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
                path: _path + ".dependencies[" + _index6 + "]",
                expected: "IAutoBeTestScenarioApplication.IDependencies",
                value: elem
            })) && _vo4(elem, _path + ".dependencies[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
                path: _path + ".dependencies[" + _index6 + "]",
                expected: "IAutoBeTestScenarioApplication.IDependencies",
                value: elem
            })).every(flag => flag) || _report(_exceptionable, {
                path: _path + ".dependencies",
                expected: "Array<IAutoBeTestScenarioApplication.IDependencies>",
                value: input.dependencies
            })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
                path: _path + ".endpoint",
                expected: "AutoBeOpenApi.IEndpoint",
                value: input.endpoint
            })) && _vo2(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
                path: _path + ".endpoint",
                expected: "AutoBeOpenApi.IEndpoint",
                value: input.endpoint
            }), "string" === typeof input.purpose || _report(_exceptionable, {
                path: _path + ".purpose",
                expected: "string",
                value: input.purpose
            })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
            if (false === __is(input)) {
                errors = [];
                _report = __typia_transform__validateReport._validateReport(errors);
                ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
                    path: _path + "",
                    expected: "IAutoBeTestScenarioApplication.IProps",
                    value: input
                })) && _vo0(input, _path + "", true) || _report(true, {
                    path: _path + "",
                    expected: "IAutoBeTestScenarioApplication.IProps",
                    value: input
                }))(input, "$input", true);
                const success = 0 === errors.length;
                return success ? {
                    success,
                    data: input
                } : {
                    success,
                    errors,
                    data: input
                };
            }
            return {
                success: true,
                data: input
            };
        }; })()(next);
        if (result.success === false)
            return result;
        // merge to unique scenario groups
        const scenarioGroups = uniqueScenarioGroups(result.data.scenarioGroups);
        // validate endpoints
        const errors = [];
        scenarioGroups.forEach((group, i) => {
            if (props.dict.has(group.endpoint) === false)
                errors.push({
                    value: group.endpoint,
                    path: `$input.scenarioGroups[${i}].endpoint`,
                    expected: "AutoBeOpenApi.IEndpoint",
                    description: props.endpointNotFound,
                });
            group.scenarios.forEach((s, j) => {
                s.dependencies.forEach((dep, k) => {
                    if (props.dict.has(dep.endpoint) === false)
                        errors.push({
                            value: dep.endpoint,
                            path: `$input.scenarioGroups[${i}].scenarios[${j}].dependencies[${k}].endpoint`,
                            expected: "AutoBeOpenApi.IEndpoint",
                            description: props.endpointNotFound,
                        });
                });
            });
        });
        // Authentication Correction
        const entireRoles = new Map();
        for (const authorization of props.authorizations) {
            for (const op of authorization.operations) {
                if (op.authorizationType === null)
                    continue;
                const value = utils_1.MapUtil.take(entireRoles, authorization.role, () => ({
                    name: authorization.role,
                    join: null,
                    login: null,
                }));
                if (op.authorizationType === "join")
                    value.join = op;
                else if (op.authorizationType === "login")
                    value.login = op;
            }
        }
        scenarioGroups.forEach((group) => {
            if (props.dict.has(group.endpoint) === false)
                return;
            const operation = props.dict.get(group.endpoint);
            group.scenarios.forEach((scenario) => {
                var _a, _b, _c, _d, _e, _f;
                // gathere authorization roles
                const localRoles = new Map();
                const add = (operation) => {
                    const role = operation.authorizationRole;
                    if (role === null)
                        return;
                    utils_1.MapUtil.take(localRoles, role, () => ({
                        name: role,
                        join: null,
                        login: null,
                    }));
                };
                add(operation);
                scenario.dependencies.forEach((d) => {
                    if (props.dict.has(d.endpoint) === false)
                        return;
                    const depOperation = props.dict.get(d.endpoint);
                    add(depOperation);
                });
                // Single role case - add join operation
                if (localRoles.size === 1) {
                    const role = localRoles
                        .values()
                        .next().value;
                    if (role.join === null) {
                        const joinOperation = (_b = (_a = entireRoles.get(role.name)) === null || _a === void 0 ? void 0 : _a.join) !== null && _b !== void 0 ? _b : null;
                        if (joinOperation === null)
                            throw new Error("Unreachable code");
                        scenario.dependencies.push({
                            endpoint: {
                                method: joinOperation.method,
                                path: joinOperation.path,
                            },
                            purpose: utils_1.StringUtil.trim `
                Essential authentication prerequisite: 
                This join operation (${joinOperation.method} ${joinOperation.path}) must be executed before any operations requiring '${role.name}' role authorization. 
                It establishes the necessary user account and authentication context for the '${role.name}' role, enabling subsequent API calls that depend on this specific authorization level. 
                Without this join operation, the main scenario endpoint and its dependencies will fail due to insufficient authentication credentials.
              `,
                        });
                    }
                }
                // Multiple roles case - add both join and login operations
                if (localRoles.size > 1) {
                    for (const role of localRoles.values()) {
                        if (role.join === null) {
                            const joinOperation = (_d = (_c = entireRoles.get(role.name)) === null || _c === void 0 ? void 0 : _c.join) !== null && _d !== void 0 ? _d : null;
                            if (joinOperation === null)
                                throw new Error("Unreachable code");
                            scenario.dependencies.push({
                                endpoint: {
                                    path: joinOperation.path,
                                    method: joinOperation.method,
                                },
                                purpose: utils_1.StringUtil.trim `
                  Multi-actor authentication setup: 
                  This join operation (${joinOperation.method} ${joinOperation.path}) is required to establish a '${role.name}' role user account in the system. 
                  This scenario involves multiple authorization roles, requiring separate user accounts for each role to properly test cross-role interactions and authorization boundaries. 
                  The join operation creates the foundational user identity that will be used throughout the test scenario for '${role.name}' specific operations.
                  This join operation is required for the '${role.name}' role authentication.
                `,
                            });
                        }
                        if (role.login === null) {
                            const loginOperation = (_f = (_e = entireRoles.get(role.name)) === null || _e === void 0 ? void 0 : _e.login) !== null && _f !== void 0 ? _f : null;
                            if (loginOperation === null)
                                throw new Error("Unreachable code");
                            scenario.dependencies.push({
                                endpoint: {
                                    path: loginOperation.path,
                                    method: loginOperation.method,
                                },
                                purpose: utils_1.StringUtil.trim `
                  Role switching authentication: 
                  This login operation (${loginOperation.method} ${loginOperation.path}) enables dynamic user role switching during test execution for the '${role.name}' role. 
                  In scenarios with multiple actors, the test agent needs to authenticate as different users to simulate real-world multi-user interactions. 
                  This login operation ensures proper session management and authorization context switching, allowing the test to validate permissions, access controls, and business logic that span across different user roles within a single test scenario.
                  This login operation may be required for user role swapping between multiple actors.
                `,
                            });
                        }
                    }
                }
            });
        });
        return errors.length === 0
            ? {
                success: true,
                data: {
                    scenarioGroups,
                },
            }
            : {
                success: false,
                data: {
                    scenarioGroups,
                },
                errors,
            };
    };
    const application = collection[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
    return {
        protocol: "class",
        name: "Make test plans",
        application,
        execute: {
            makeScenario: (next) => {
                props.build(next);
            },
        },
    };
}
const uniqueScenarioGroups = (groups) => new tstl_1.HashMap(groups.map((g) => new tstl_1.Pair(g.endpoint, g)), utils_1.AutoBeEndpointComparator.hashCode, utils_1.AutoBeEndpointComparator.equals)
    .toJSON()
    .map((it) => it.second);
const collection = {
    chatgpt: (validate) => (() => {
        const application = {
            model: "chatgpt",
            options: {
                reference: true,
                strict: false,
                separate: null
            },
            functions: [
                {
                    name: "makeScenario",
                    parameters: {
                        description: " Properties containing the endpoints and test scenarios.\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestScenarioApplication.IProps}",
                        type: "object",
                        properties: {
                            scenarioGroups: {
                                description: "Array of test scenario groups.",
                                type: "array",
                                items: {
                                    $ref: "#/$defs/IAutoBeTestScenarioApplication.IScenarioGroup"
                                }
                            }
                        },
                        required: [
                            "scenarioGroups"
                        ],
                        additionalProperties: false,
                        $defs: {
                            "IAutoBeTestScenarioApplication.IScenarioGroup": {
                                description: "### Description of {@link endpoint} property:\n\n> Target API endpoint to test.\n> \n> This must be **unique** across all scenario groups. An endpoint is\n> identified by its `path` and `method` combination.\n> \n> Multiple test scenarios may exist for a single endpoint.",
                                type: "object",
                                properties: {
                                    endpoint: {
                                        $ref: "#/$defs/AutoBeOpenApi.IEndpoint"
                                    },
                                    scenarios: {
                                        description: "An array of test scenarios associated with the given endpoint.\n\nEach scenario represents a specific test case for the same `path` and\n`method`.\n\nIMPORTANT: Each scenario must be actually implementable. A scenario's\nimplementability is determined by the existence of ALL APIs (endpoints)\nrequired to test it. This includes not only the primary endpoint being\ntested, but also ALL dependency endpoints needed for setup,\nauthentication, and data preparation. If even one required dependency API\nis missing from the available operations, the scenario cannot be\nimplemented and should not be generated.\n\nExample: A \"test banned user login\" scenario requires both a login API\nAND a ban user API. If the ban API doesn't exist, this scenario is not\nimplementable regardless of database schema fields.\n\n\n@minItems 1",
                                        type: "array",
                                        items: {
                                            $ref: "#/$defs/IAutoBeTestScenarioApplication.IScenario"
                                        }
                                    }
                                },
                                required: [
                                    "endpoint",
                                    "scenarios"
                                ]
                            },
                            "AutoBeOpenApi.IEndpoint": {
                                description: "API endpoint information.",
                                type: "object",
                                properties: {
                                    path: {
                                        description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n  curly braces for parameters ({paramName}), hyphens (-), and underscores\n  (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)\n\n\n@pattern ^\\/[a-zA-Z0-9\\/_{}.-]*$",
                                        type: "string"
                                    },
                                    method: {
                                        description: "HTTP method of the API operation.\n\n**IMPORTANT**: Methods must be written in lowercase only (e.g., \"get\",\nnot \"GET\").\n\nNote that, if the API operation has {@link requestBody}, method must not\nbe `get`.\n\nAlso, even though the API operation has been designed to only get\ninformation, but it needs complicated request information, it must be\ndefined as `patch` method with {@link requestBody} data specification.\n\n- `get`: get information\n- `patch`: get information with complicated request data\n  ({@link requestBody})\n- `post`: create new record\n- `put`: update existing record\n- `delete`: remove record",
                                        type: "string",
                                        "enum": [
                                            "get",
                                            "post",
                                            "put",
                                            "delete",
                                            "patch"
                                        ]
                                    }
                                },
                                required: [
                                    "path",
                                    "method"
                                ]
                            },
                            "IAutoBeTestScenarioApplication.IScenario": {
                                description: "Represents a test scenario for a single API operation.\n\nThis interface defines a structured, user-centric test draft that includes\na descriptive function name, a detailed scenario draft, and logical\ndependencies on other endpoints required for context or setup.\n\nCRITICAL: All referenced endpoints MUST exist in the provided API\noperations. Do NOT create scenarios for non-existent APIs, even if database\nschema fields suggest their existence. Test scenarios must be implementable\nwith available APIs only.",
                                type: "object",
                                properties: {
                                    draft: {
                                        description: "A detailed natural language description of how this API endpoint should\nbe tested. This should include both successful and failure scenarios,\nbusiness rule validations, edge cases, and any sequence of steps\nnecessary to perform the test. A subsequent agent will use this draft to\ngenerate multiple concrete test cases.",
                                        type: "string"
                                    },
                                    functionName: {
                                        description: "Descriptive function name derived from the user scenario.\n\nThe function name serves as a concise, technical identifier that clearly\nrepresents the specific user scenario being described. It should be\nimmediately understandable and directly correspond to the user situation\nwithout requiring additional context.\n\n## Naming Convention\n\nDO: Use snake_case naming convention.\n\n- Must start with `test_api_` prefix (mandatory requirement)\n- ALWAYS start with business feature, NOT action verbs\n- Business feature comes first, followed by scenario context\n- Embed action verbs within the scenario description, not at the beginning\n\n## Content Structure\n\nFunction names should follow this pattern:\n`test_api_[core_feature]_[specific_scenario]`\n\nWhere:\n\n- `core_feature`: The main business feature or entity being tested\n  (customer, seller, cart, push_message, etc.)\n- `specific_scenario`: The specific operation or scenario context\n  (join_verification_not_found, login_success,\n  moderator_assignment_update, discountable_ticket_duplicated,\n  csv_export, etc.)\n\n## Business Feature-Based Examples\n\n- `test_api_customer_join_verification_not_found` - Customer join\n  verification when verification code not found\n- `test_api_seller_login` - Seller login operation\n- `test_api_cart_discountable_ticket_duplicated` - Cart discountable ticket\n  with duplication scenario\n- `test_api_push_message_csv` - Push message functionality with CSV format\n- `test_api_product_review_update` - Product review update operation\n\n## Clarity Guidelines\n\n- Prioritize clarity over brevity\n- Avoid technical jargon or implementation terms\n- Use terminology that reflects user perspective\n- Ensure the name alone conveys the user's intent\n- Make it understandable to non-technical stakeholders\n- Keep consistent with user scenario description\n\n## Single Endpoint Alignment\n\nFunction names must reflect scenarios that:\n\n- Accomplish user goals through this single endpoint only\n- Don't imply dependency on other API operations\n- Represent complete user interactions",
                                        type: "string"
                                    },
                                    dependencies: {
                                        description: "A list of other API endpoints that this scenario logically depends on.\n\nThese dependencies represent context or prerequisite conditions, such as\nauthentication, resource creation, or data setup, that are relevant to\nthe test. This list is not a strict execution order \u2014 if ordering is\nimportant, it must be described explicitly in the `purpose`.\n\nWARNING: Every endpoint referenced here MUST exist in the provided API\noperations. Do NOT reference endpoints that are not explicitly available,\neven if they seem logically necessary based on database schema or\nbusiness logic.",
                                        type: "array",
                                        items: {
                                            $ref: "#/$defs/IAutoBeTestScenarioApplication.IDependencies"
                                        }
                                    }
                                },
                                required: [
                                    "draft",
                                    "functionName",
                                    "dependencies"
                                ]
                            },
                            "IAutoBeTestScenarioApplication.IDependencies": {
                                description: "### Description of {@link endpoint} property:\n\n> Target API endpoint that this scenario depends on.\n> \n> This endpoint MUST exist in the available API operations list.\n> Non-existent endpoints will cause test implementation failures.",
                                type: "object",
                                properties: {
                                    endpoint: {
                                        $ref: "#/$defs/AutoBeOpenApi.IEndpoint"
                                    },
                                    purpose: {
                                        description: "A concise explanation of why this API call is relevant or required for\nthe main test scenario.\n\nThis should describe the contextual or setup role of the dependency, such\nas creating necessary data or establishing user authentication.\n\nExample: \"Creates a category so that a product can be linked to it during\ncreation.\"",
                                        type: "string"
                                    }
                                },
                                required: [
                                    "endpoint",
                                    "purpose"
                                ]
                            }
                        }
                    },
                    description: "Make test scenarios for the given endpoints.",
                    validate: (() => { const _io0 = input => Array.isArray(input.scenarioGroups) && input.scenarioGroups.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io2(input.endpoint) && (Array.isArray(input.scenarios) && (1 <= input.scenarios.length && input.scenarios.every(elem => "object" === typeof elem && null !== elem && _io3(elem)))); const _io2 = input => "string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io3 = input => "string" === typeof input.draft && "string" === typeof input.functionName && (Array.isArray(input.dependencies) && input.dependencies.every(elem => "object" === typeof elem && null !== elem && _io4(elem))); const _io4 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io2(input.endpoint) && "string" === typeof input.purpose; const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.scenarioGroups) || _report(_exceptionable, {
                            path: _path + ".scenarioGroups",
                            expected: "Array<IAutoBeTestScenarioApplication.IScenarioGroup>",
                            value: input.scenarioGroups
                        })) && input.scenarioGroups.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
                            path: _path + ".scenarioGroups[" + _index4 + "]",
                            expected: "IAutoBeTestScenarioApplication.IScenarioGroup",
                            value: elem
                        })) && _vo1(elem, _path + ".scenarioGroups[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".scenarioGroups[" + _index4 + "]",
                            expected: "IAutoBeTestScenarioApplication.IScenarioGroup",
                            value: elem
                        })).every(flag => flag) || _report(_exceptionable, {
                            path: _path + ".scenarioGroups",
                            expected: "Array<IAutoBeTestScenarioApplication.IScenarioGroup>",
                            value: input.scenarioGroups
                        })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
                            path: _path + ".endpoint",
                            expected: "AutoBeOpenApi.IEndpoint",
                            value: input.endpoint
                        })) && _vo2(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".endpoint",
                            expected: "AutoBeOpenApi.IEndpoint",
                            value: input.endpoint
                        }), (Array.isArray(input.scenarios) || _report(_exceptionable, {
                            path: _path + ".scenarios",
                            expected: "(Array<IAutoBeTestScenarioApplication.IScenario> & MinItems<1>)",
                            value: input.scenarios
                        })) && ((1 <= input.scenarios.length || _report(_exceptionable, {
                            path: _path + ".scenarios",
                            expected: "Array<> & MinItems<1>",
                            value: input.scenarios
                        })) && input.scenarios.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
                            path: _path + ".scenarios[" + _index5 + "]",
                            expected: "IAutoBeTestScenarioApplication.IScenario",
                            value: elem
                        })) && _vo3(elem, _path + ".scenarios[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".scenarios[" + _index5 + "]",
                            expected: "IAutoBeTestScenarioApplication.IScenario",
                            value: elem
                        })).every(flag => flag)) || _report(_exceptionable, {
                            path: _path + ".scenarios",
                            expected: "(Array<IAutoBeTestScenarioApplication.IScenario> & MinItems<1>)",
                            value: input.scenarios
                        })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
                            path: _path + ".path",
                            expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
                            value: input.path
                        })) || _report(_exceptionable, {
                            path: _path + ".path",
                            expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
                            value: input.path
                        }), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
                            path: _path + ".method",
                            expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
                            value: input.method
                        })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.draft || _report(_exceptionable, {
                            path: _path + ".draft",
                            expected: "string",
                            value: input.draft
                        }), "string" === typeof input.functionName || _report(_exceptionable, {
                            path: _path + ".functionName",
                            expected: "string",
                            value: input.functionName
                        }), (Array.isArray(input.dependencies) || _report(_exceptionable, {
                            path: _path + ".dependencies",
                            expected: "Array<IAutoBeTestScenarioApplication.IDependencies>",
                            value: input.dependencies
                        })) && input.dependencies.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
                            path: _path + ".dependencies[" + _index6 + "]",
                            expected: "IAutoBeTestScenarioApplication.IDependencies",
                            value: elem
                        })) && _vo4(elem, _path + ".dependencies[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".dependencies[" + _index6 + "]",
                            expected: "IAutoBeTestScenarioApplication.IDependencies",
                            value: elem
                        })).every(flag => flag) || _report(_exceptionable, {
                            path: _path + ".dependencies",
                            expected: "Array<IAutoBeTestScenarioApplication.IDependencies>",
                            value: input.dependencies
                        })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
                            path: _path + ".endpoint",
                            expected: "AutoBeOpenApi.IEndpoint",
                            value: input.endpoint
                        })) && _vo2(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".endpoint",
                            expected: "AutoBeOpenApi.IEndpoint",
                            value: input.endpoint
                        }), "string" === typeof input.purpose || _report(_exceptionable, {
                            path: _path + ".purpose",
                            expected: "string",
                            value: input.purpose
                        })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
                        if (false === __is(input)) {
                            errors = [];
                            _report = __typia_transform__validateReport._validateReport(errors);
                            ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
                                path: _path + "",
                                expected: "IAutoBeTestScenarioApplication.IProps",
                                value: input
                            })) && _vo0(input, _path + "", true) || _report(true, {
                                path: _path + "",
                                expected: "IAutoBeTestScenarioApplication.IProps",
                                value: input
                            }))(input, "$input", true);
                            const success = 0 === errors.length;
                            return success ? {
                                success,
                                data: input
                            } : {
                                success,
                                errors,
                                data: input
                            };
                        }
                        return {
                            success: true,
                            data: input
                        };
                    }; })()
                }
            ]
        };
        __typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
            validate: {
                makeScenario: validate,
            },
        }), { equals: false }));
        return application;
    })(),
    claude: (validate) => (() => {
        const application = {
            model: "claude",
            options: {
                reference: true,
                separate: null
            },
            functions: [
                {
                    name: "makeScenario",
                    parameters: {
                        description: " Properties containing the endpoints and test scenarios.\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestScenarioApplication.IProps}",
                        type: "object",
                        properties: {
                            scenarioGroups: {
                                description: "Array of test scenario groups.",
                                type: "array",
                                items: {
                                    $ref: "#/$defs/IAutoBeTestScenarioApplication.IScenarioGroup"
                                }
                            }
                        },
                        required: [
                            "scenarioGroups"
                        ],
                        additionalProperties: false,
                        $defs: {
                            "IAutoBeTestScenarioApplication.IScenarioGroup": {
                                type: "object",
                                properties: {
                                    endpoint: {
                                        description: "Target API endpoint to test.\n\nThis must be **unique** across all scenario groups. An endpoint is\nidentified by its `path` and `method` combination.\n\nMultiple test scenarios may exist for a single endpoint.",
                                        $ref: "#/$defs/AutoBeOpenApi.IEndpoint"
                                    },
                                    scenarios: {
                                        description: "An array of test scenarios associated with the given endpoint.\n\nEach scenario represents a specific test case for the same `path` and\n`method`.\n\nIMPORTANT: Each scenario must be actually implementable. A scenario's\nimplementability is determined by the existence of ALL APIs (endpoints)\nrequired to test it. This includes not only the primary endpoint being\ntested, but also ALL dependency endpoints needed for setup,\nauthentication, and data preparation. If even one required dependency API\nis missing from the available operations, the scenario cannot be\nimplemented and should not be generated.\n\nExample: A \"test banned user login\" scenario requires both a login API\nAND a ban user API. If the ban API doesn't exist, this scenario is not\nimplementable regardless of database schema fields.",
                                        type: "array",
                                        items: {
                                            $ref: "#/$defs/IAutoBeTestScenarioApplication.IScenario"
                                        },
                                        minItems: 1
                                    }
                                },
                                required: [
                                    "endpoint",
                                    "scenarios"
                                ]
                            },
                            "AutoBeOpenApi.IEndpoint": {
                                description: "API endpoint information.",
                                type: "object",
                                properties: {
                                    path: {
                                        description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n  curly braces for parameters ({paramName}), hyphens (-), and underscores\n  (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)",
                                        type: "string",
                                        pattern: "^\\/[a-zA-Z0-9\\/_{}.-]*$"
                                    },
                                    method: {
                                        description: "HTTP method of the API operation.\n\n**IMPORTANT**: Methods must be written in lowercase only (e.g., \"get\",\nnot \"GET\").\n\nNote that, if the API operation has {@link requestBody}, method must not\nbe `get`.\n\nAlso, even though the API operation has been designed to only get\ninformation, but it needs complicated request information, it must be\ndefined as `patch` method with {@link requestBody} data specification.\n\n- `get`: get information\n- `patch`: get information with complicated request data\n  ({@link requestBody})\n- `post`: create new record\n- `put`: update existing record\n- `delete`: remove record",
                                        oneOf: [
                                            {
                                                "const": "get"
                                            },
                                            {
                                                "const": "post"
                                            },
                                            {
                                                "const": "put"
                                            },
                                            {
                                                "const": "delete"
                                            },
                                            {
                                                "const": "patch"
                                            }
                                        ]
                                    }
                                },
                                required: [
                                    "path",
                                    "method"
                                ]
                            },
                            "IAutoBeTestScenarioApplication.IScenario": {
                                description: "Represents a test scenario for a single API operation.\n\nThis interface defines a structured, user-centric test draft that includes\na descriptive function name, a detailed scenario draft, and logical\ndependencies on other endpoints required for context or setup.\n\nCRITICAL: All referenced endpoints MUST exist in the provided API\noperations. Do NOT create scenarios for non-existent APIs, even if database\nschema fields suggest their existence. Test scenarios must be implementable\nwith available APIs only.",
                                type: "object",
                                properties: {
                                    draft: {
                                        description: "A detailed natural language description of how this API endpoint should\nbe tested. This should include both successful and failure scenarios,\nbusiness rule validations, edge cases, and any sequence of steps\nnecessary to perform the test. A subsequent agent will use this draft to\ngenerate multiple concrete test cases.",
                                        type: "string"
                                    },
                                    functionName: {
                                        description: "Descriptive function name derived from the user scenario.\n\nThe function name serves as a concise, technical identifier that clearly\nrepresents the specific user scenario being described. It should be\nimmediately understandable and directly correspond to the user situation\nwithout requiring additional context.\n\n## Naming Convention\n\nDO: Use snake_case naming convention.\n\n- Must start with `test_api_` prefix (mandatory requirement)\n- ALWAYS start with business feature, NOT action verbs\n- Business feature comes first, followed by scenario context\n- Embed action verbs within the scenario description, not at the beginning\n\n## Content Structure\n\nFunction names should follow this pattern:\n`test_api_[core_feature]_[specific_scenario]`\n\nWhere:\n\n- `core_feature`: The main business feature or entity being tested\n  (customer, seller, cart, push_message, etc.)\n- `specific_scenario`: The specific operation or scenario context\n  (join_verification_not_found, login_success,\n  moderator_assignment_update, discountable_ticket_duplicated,\n  csv_export, etc.)\n\n## Business Feature-Based Examples\n\n- `test_api_customer_join_verification_not_found` - Customer join\n  verification when verification code not found\n- `test_api_seller_login` - Seller login operation\n- `test_api_cart_discountable_ticket_duplicated` - Cart discountable ticket\n  with duplication scenario\n- `test_api_push_message_csv` - Push message functionality with CSV format\n- `test_api_product_review_update` - Product review update operation\n\n## Clarity Guidelines\n\n- Prioritize clarity over brevity\n- Avoid technical jargon or implementation terms\n- Use terminology that reflects user perspective\n- Ensure the name alone conveys the user's intent\n- Make it understandable to non-technical stakeholders\n- Keep consistent with user scenario description\n\n## Single Endpoint Alignment\n\nFunction names must reflect scenarios that:\n\n- Accomplish user goals through this single endpoint only\n- Don't imply dependency on other API operations\n- Represent complete user interactions",
                                        type: "string"
                                    },
                                    dependencies: {
                                        description: "A list of other API endpoints that this scenario logically depends on.\n\nThese dependencies represent context or prerequisite conditions, such as\nauthentication, resource creation, or data setup, that are relevant to\nthe test. This list is not a strict execution order \u2014 if ordering is\nimportant, it must be described explicitly in the `purpose`.\n\nWARNING: Every endpoint referenced here MUST exist in the provided API\noperations. Do NOT reference endpoints that are not explicitly available,\neven if they seem logically necessary based on database schema or\nbusiness logic.",
                                        type: "array",
                                        items: {
                                            $ref: "#/$defs/IAutoBeTestScenarioApplication.IDependencies"
                                        }
                                    }
                                },
                                required: [
                                    "draft",
                                    "functionName",
                                    "dependencies"
                                ]
                            },
                            "IAutoBeTestScenarioApplication.IDependencies": {
                                type: "object",
                                properties: {
                                    endpoint: {
                                        description: "Target API endpoint that this scenario depends on.\n\nThis endpoint MUST exist in the available API operations list.\nNon-existent endpoints will cause test implementation failures.",
                                        $ref: "#/$defs/AutoBeOpenApi.IEndpoint"
                                    },
                                    purpose: {
                                        description: "A concise explanation of why this API call is relevant or required for\nthe main test scenario.\n\nThis should describe the contextual or setup role of the dependency, such\nas creating necessary data or establishing user authentication.\n\nExample: \"Creates a category so that a product can be linked to it during\ncreation.\"",
                                        type: "string"
                                    }
                                },
                                required: [
                                    "endpoint",
                                    "purpose"
                                ]
                            }
                        }
                    },
                    description: "Make test scenarios for the given endpoints.",
                    validate: (() => { const _io0 = input => Array.isArray(input.scenarioGroups) && input.scenarioGroups.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io2(input.endpoint) && (Array.isArray(input.scenarios) && (1 <= input.scenarios.length && input.scenarios.every(elem => "object" === typeof elem && null !== elem && _io3(elem)))); const _io2 = input => "string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io3 = input => "string" === typeof input.draft && "string" === typeof input.functionName && (Array.isArray(input.dependencies) && input.dependencies.every(elem => "object" === typeof elem && null !== elem && _io4(elem))); const _io4 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io2(input.endpoint) && "string" === typeof input.purpose; const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.scenarioGroups) || _report(_exceptionable, {
                            path: _path + ".scenarioGroups",
                            expected: "Array<IAutoBeTestScenarioApplication.IScenarioGroup>",
                            value: input.scenarioGroups
                        })) && input.scenarioGroups.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
                            path: _path + ".scenarioGroups[" + _index4 + "]",
                            expected: "IAutoBeTestScenarioApplication.IScenarioGroup",
                            value: elem
                        })) && _vo1(elem, _path + ".scenarioGroups[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".scenarioGroups[" + _index4 + "]",
                            expected: "IAutoBeTestScenarioApplication.IScenarioGroup",
                            value: elem
                        })).every(flag => flag) || _report(_exceptionable, {
                            path: _path + ".scenarioGroups",
                            expected: "Array<IAutoBeTestScenarioApplication.IScenarioGroup>",
                            value: input.scenarioGroups
                        })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
                            path: _path + ".endpoint",
                            expected: "AutoBeOpenApi.IEndpoint",
                            value: input.endpoint
                        })) && _vo2(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".endpoint",
                            expected: "AutoBeOpenApi.IEndpoint",
                            value: input.endpoint
                        }), (Array.isArray(input.scenarios) || _report(_exceptionable, {
                            path: _path + ".scenarios",
                            expected: "(Array<IAutoBeTestScenarioApplication.IScenario> & MinItems<1>)",
                            value: input.scenarios
                        })) && ((1 <= input.scenarios.length || _report(_exceptionable, {
                            path: _path + ".scenarios",
                            expected: "Array<> & MinItems<1>",
                            value: input.scenarios
                        })) && input.scenarios.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
                            path: _path + ".scenarios[" + _index5 + "]",
                            expected: "IAutoBeTestScenarioApplication.IScenario",
                            value: elem
                        })) && _vo3(elem, _path + ".scenarios[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".scenarios[" + _index5 + "]",
                            expected: "IAutoBeTestScenarioApplication.IScenario",
                            value: elem
                        })).every(flag => flag)) || _report(_exceptionable, {
                            path: _path + ".scenarios",
                            expected: "(Array<IAutoBeTestScenarioApplication.IScenario> & MinItems<1>)",
                            value: input.scenarios
                        })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
                            path: _path + ".path",
                            expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
                            value: input.path
                        })) || _report(_exceptionable, {
                            path: _path + ".path",
                            expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
                            value: input.path
                        }), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
                            path: _path + ".method",
                            expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
                            value: input.method
                        })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.draft || _report(_exceptionable, {
                            path: _path + ".draft",
                            expected: "string",
                            value: input.draft
                        }), "string" === typeof input.functionName || _report(_exceptionable, {
                            path: _path + ".functionName",
                            expected: "string",
                            value: input.functionName
                        }), (Array.isArray(input.dependencies) || _report(_exceptionable, {
                            path: _path + ".dependencies",
                            expected: "Array<IAutoBeTestScenarioApplication.IDependencies>",
                            value: input.dependencies
                        })) && input.dependencies.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
                            path: _path + ".dependencies[" + _index6 + "]",
                            expected: "IAutoBeTestScenarioApplication.IDependencies",
                            value: elem
                        })) && _vo4(elem, _path + ".dependencies[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".dependencies[" + _index6 + "]",
                            expected: "IAutoBeTestScenarioApplication.IDependencies",
                            value: elem
                        })).every(flag => flag) || _report(_exceptionable, {
                            path: _path + ".dependencies",
                            expected: "Array<IAutoBeTestScenarioApplication.IDependencies>",
                            value: input.dependencies
                        })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
                            path: _path + ".endpoint",
                            expected: "AutoBeOpenApi.IEndpoint",
                            value: input.endpoint
                        })) && _vo2(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
                            path: _path + ".endpoint",
                            expected: "AutoBeOpenApi.IEndpoint",
                            value: input.endpoint
                        }), "string" === typeof input.purpose || _report(_exceptionable, {
                            path: _path + ".purpose",
                            expected: "string",
                            value: input.purpose
                        })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
                        if (false === __is(input)) {
                            errors = [];
                            _report = __typia_transform__validateReport._validateReport(errors);
                            ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
                                path: _path + "",
                                expected: "IAutoBeTestScenarioApplication.IProps",
                                value: input
                            })) && _vo0(input, _path + "", true) || _report(true, {
                                path: _path + "",
                                expected: "IAutoBeTestScenarioApplication.IProps",
                                value: input
                            }))(input, "$input", true);
                            const success = 0 === errors.length;
                            return success ? {
                                success,
                                data: input
                            } : {
                                success,
                                errors,
                                data: input
                            };
                        }
                        return {
                            success: true,
                            data: input
                        };
                    }; })()
                }
            ]
        };
        __typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
            validate: {
                makeScenario: validate,
            },
        }), { equals: false }));
        return application;
    })(),
};
//# sourceMappingURL=orchestrateTestScenario.js.map