"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.baseStepDescriptorSchema = exports.stringOrSymbolSchema = exports.mablSymbolObjectSchema = exports.mablSymbolStringSchema = exports.MABL_SYMBOL_REGEX = exports.stepAnnotationSchema = void 0;
const zod_1 = require("zod");
exports.stepAnnotationSchema = zod_1.z
    .object({
    description: zod_1.z
        .string()
        .describe('Human-readable description of what the step does'),
    note: zod_1.z.string().optional().describe('User-added note or comment'),
    aiGeneratedDescription: zod_1.z.string().optional(),
    descriptionPromptId: zod_1.z.string().optional(),
    descriptionSource: zod_1.z
        .enum(['ai', 'default', 'user'])
        .optional()
        .describe('Who authored the description'),
})
    .passthrough()
    .describe('User or AI-provided metadata attached to a step');
exports.MABL_SYMBOL_REGEX = /^{{@[_.a-zA-Z0-9\[\]]+}}$/;
exports.mablSymbolStringSchema = zod_1.z.string().regex(exports.MABL_SYMBOL_REGEX, {
    message: 'Must be a mabl variable reference: {{@variableName}}',
});
exports.mablSymbolObjectSchema = zod_1.z.object({
    name: zod_1.z.string(),
    tokens: zod_1.z.array(zod_1.z.string()),
});
exports.stringOrSymbolSchema = zod_1.z.string();
exports.baseStepDescriptorSchema = zod_1.z
    .object({
    id: zod_1.z.string().optional(),
    description: zod_1.z.string().optional(),
    disabled: zod_1.z
        .boolean()
        .optional()
        .describe('When true, step is skipped during execution'),
    actionCode: zod_1.z
        .string()
        .optional()
        .describe('Internal identifier linking step to its training action'),
    annotation: exports.stepAnnotationSchema.optional(),
})
    .describe('Properties shared by all step types');
