"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractDescriptorSchema = exports.extractTypeEnum = void 0;
const zod_1 = require("zod");
exports.extractTypeEnum = zod_1.z.enum([
    'extract_attribute',
    'extract_css_properties',
    'extract_email_attribute',
    'extract_inner_text',
    'extract_prompt',
]);
const extractAttributeSchema = zod_1.z.object({
    extractType: zod_1.z.literal('extract_attribute'),
    attributeName: zod_1.z
        .string()
        .describe("HTML attribute name to extract (e.g., 'href', 'src')"),
});
const extractCssPropertiesSchema = zod_1.z.object({
    extractType: zod_1.z.literal('extract_css_properties'),
    attributeName: zod_1.z
        .string()
        .describe("CSS property name to extract (e.g., 'color', 'font-size')"),
});
const extractEmailAttributeSchema = zod_1.z.object({
    extractType: zod_1.z.literal('extract_email_attribute'),
    attributeName: zod_1.z
        .string()
        .describe("Email attribute to extract (e.g., 'subject', 'from')"),
});
const extractInnerTextSchema = zod_1.z.object({
    extractType: zod_1.z.literal('extract_inner_text'),
});
const extractPromptSchema = zod_1.z.object({
    extractType: zod_1.z.literal('extract_prompt'),
});
exports.extractDescriptorSchema = zod_1.z
    .discriminatedUnion('extractType', [
    extractAttributeSchema,
    extractCssPropertiesSchema,
    extractEmailAttributeSchema,
    extractInnerTextSchema,
    extractPromptSchema,
])
    .describe('What value to extract from the target element');
