"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateAgentSchema = validateAgentSchema;
exports.validateProjectSchema = validateProjectSchema;
const schema_1 = require("../../schema");
/**
 * Pass agent spec through zod validator
 * @param spec Agent spec to validate
 * @returns Validated AgentEnvSpec
 */
function validateAgentSchema(spec) {
    const validationResult = schema_1.AgentEnvSpecSchema.safeParse(spec);
    if (!validationResult.success) {
        const errors = validationResult.error.issues.map(e => `${String(e.path.join('.'))}: ${e.message}`).join('; ');
        throw new Error(`Invalid AgentEnvSpec: ${errors}`);
    }
    return validationResult.data;
}
/**
 * Pass project spec through zod validator
 * @param spec Project spec to validate
 * @returns Validated AgentCoreProjectSpec
 */
function validateProjectSchema(spec) {
    const validationResult = schema_1.AgentCoreProjectSpecSchema.safeParse(spec);
    if (!validationResult.success) {
        const errors = validationResult.error.issues.map(e => `${String(e.path.join('.'))}: ${e.message}`).join('; ');
        throw new Error(`Invalid AgentCoreProjectSpec: ${errors}`);
    }
    return validationResult.data;
}
//# sourceMappingURL=zod.js.map