"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
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;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AgentResponseRequest$outboundSchema = exports.Conversation$outboundSchema = exports.Configuration$outboundSchema = exports.Engine$outboundSchema = exports.Memory$outboundSchema = exports.AgentResponseRequestThread$outboundSchema = exports.Contact$outboundSchema = exports.AgentResponseRequestIdentity$outboundSchema = exports.A2AMessage$outboundSchema = exports.PublicMessagePart$outboundSchema = exports.AgentResponseRequestRole$outboundSchema = exports.RoleUserMessage$outboundSchema = exports.RoleToolMessage$outboundSchema = exports.Engine = exports.RoleUserMessage = exports.RoleToolMessage = void 0;
exports.agentResponseRequestRoleToJSON = agentResponseRequestRoleToJSON;
exports.publicMessagePartToJSON = publicMessagePartToJSON;
exports.a2AMessageToJSON = a2AMessageToJSON;
exports.agentResponseRequestIdentityToJSON = agentResponseRequestIdentityToJSON;
exports.contactToJSON = contactToJSON;
exports.agentResponseRequestThreadToJSON = agentResponseRequestThreadToJSON;
exports.memoryToJSON = memoryToJSON;
exports.configurationToJSON = configurationToJSON;
exports.conversationToJSON = conversationToJSON;
exports.agentResponseRequestToJSON = agentResponseRequestToJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const errorpart_js_1 = require("./errorpart.js");
const filepart_js_1 = require("./filepart.js");
const textpart_js_1 = require("./textpart.js");
const toolresultpart_js_1 = require("./toolresultpart.js");
/**
 * Message containing tool execution results
 */
exports.RoleToolMessage = {
    Tool: "tool",
};
/**
 * Message from the end user
 */
exports.RoleUserMessage = {
    User: "user",
};
/**
 * Override template engine for this invocation. If not provided, uses the agent default.
 */
exports.Engine = {
    Text: "text",
    Jinja: "jinja",
    Mustache: "mustache",
};
/** @internal */
exports.RoleToolMessage$outboundSchema = z.nativeEnum(exports.RoleToolMessage);
/** @internal */
exports.RoleUserMessage$outboundSchema = z.nativeEnum(exports.RoleUserMessage);
/** @internal */
exports.AgentResponseRequestRole$outboundSchema = z.union([exports.RoleUserMessage$outboundSchema, exports.RoleToolMessage$outboundSchema]);
function agentResponseRequestRoleToJSON(agentResponseRequestRole) {
    return JSON.stringify(exports.AgentResponseRequestRole$outboundSchema.parse(agentResponseRequestRole));
}
/** @internal */
exports.PublicMessagePart$outboundSchema = z.union([
    textpart_js_1.TextPart$outboundSchema,
    filepart_js_1.FilePart$outboundSchema,
    toolresultpart_js_1.ToolResultPart$outboundSchema,
    errorpart_js_1.ErrorPart$outboundSchema,
]);
function publicMessagePartToJSON(publicMessagePart) {
    return JSON.stringify(exports.PublicMessagePart$outboundSchema.parse(publicMessagePart));
}
/** @internal */
exports.A2AMessage$outboundSchema = z.object({
    messageId: z.string().optional(),
    role: z.union([
        exports.RoleUserMessage$outboundSchema,
        exports.RoleToolMessage$outboundSchema,
    ]),
    parts: z.array(z.union([
        textpart_js_1.TextPart$outboundSchema,
        filepart_js_1.FilePart$outboundSchema,
        toolresultpart_js_1.ToolResultPart$outboundSchema,
        errorpart_js_1.ErrorPart$outboundSchema,
    ])),
});
function a2AMessageToJSON(a2AMessage) {
    return JSON.stringify(exports.A2AMessage$outboundSchema.parse(a2AMessage));
}
/** @internal */
exports.AgentResponseRequestIdentity$outboundSchema = z.object({
    id: z.string(),
    displayName: z.string().optional(),
    email: z.string().optional(),
    metadata: z.array(z.record(z.any())).optional(),
    logoUrl: z.string().optional(),
    tags: z.array(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        displayName: "display_name",
        logoUrl: "logo_url",
    });
});
function agentResponseRequestIdentityToJSON(agentResponseRequestIdentity) {
    return JSON.stringify(exports.AgentResponseRequestIdentity$outboundSchema.parse(agentResponseRequestIdentity));
}
/** @internal */
exports.Contact$outboundSchema = z.object({
    id: z.string(),
    displayName: z.string().optional(),
    email: z.string().optional(),
    metadata: z.array(z.record(z.any())).optional(),
    logoUrl: z.string().optional(),
    tags: z.array(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        displayName: "display_name",
        logoUrl: "logo_url",
    });
});
function contactToJSON(contact) {
    return JSON.stringify(exports.Contact$outboundSchema.parse(contact));
}
/** @internal */
exports.AgentResponseRequestThread$outboundSchema = z.object({
    id: z.string(),
    tags: z.array(z.string()).optional(),
});
function agentResponseRequestThreadToJSON(agentResponseRequestThread) {
    return JSON.stringify(exports.AgentResponseRequestThread$outboundSchema.parse(agentResponseRequestThread));
}
/** @internal */
exports.Memory$outboundSchema = z.object({
    entityId: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        entityId: "entity_id",
    });
});
function memoryToJSON(memory) {
    return JSON.stringify(exports.Memory$outboundSchema.parse(memory));
}
/** @internal */
exports.Engine$outboundSchema = z
    .nativeEnum(exports.Engine);
/** @internal */
exports.Configuration$outboundSchema = z.object({
    blocking: z.boolean().default(false),
});
function configurationToJSON(configuration) {
    return JSON.stringify(exports.Configuration$outboundSchema.parse(configuration));
}
/** @internal */
exports.Conversation$outboundSchema = z.object({
    id: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
    });
});
function conversationToJSON(conversation) {
    return JSON.stringify(exports.Conversation$outboundSchema.parse(conversation));
}
/** @internal */
exports.AgentResponseRequest$outboundSchema = z.object({
    taskId: z.string().optional(),
    message: z.lazy(() => exports.A2AMessage$outboundSchema),
    variables: z.record(z.any()).optional(),
    identity: z.lazy(() => exports.AgentResponseRequestIdentity$outboundSchema)
        .optional(),
    contact: z.lazy(() => exports.Contact$outboundSchema).optional(),
    thread: z.lazy(() => exports.AgentResponseRequestThread$outboundSchema).optional(),
    memory: z.lazy(() => exports.Memory$outboundSchema).optional(),
    metadata: z.record(z.any()).optional(),
    engine: exports.Engine$outboundSchema.optional(),
    configuration: z.lazy(() => exports.Configuration$outboundSchema).optional(),
    background: z.boolean().default(false),
    stream: z.boolean().default(false),
    conversation: z.lazy(() => exports.Conversation$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        taskId: "task_id",
    });
});
function agentResponseRequestToJSON(agentResponseRequest) {
    return JSON.stringify(exports.AgentResponseRequest$outboundSchema.parse(agentResponseRequest));
}
//# sourceMappingURL=agentresponserequest.js.map