"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.InvokeAgentRequestBody$outboundSchema = exports.InvokeAgentRequestBody$inboundSchema = exports.InvokeAgentMemory$outboundSchema = exports.InvokeAgentMemory$inboundSchema = exports.InvokeAgentThread$outboundSchema = exports.InvokeAgentThread$inboundSchema = exports.InvokeAgentContact$outboundSchema = exports.InvokeAgentContact$inboundSchema = exports.InvokeAgentA2AMessage$outboundSchema = exports.InvokeAgentA2AMessage$inboundSchema = exports.InvokeAgentPublicMessagePart$outboundSchema = exports.InvokeAgentPublicMessagePart$inboundSchema = exports.PublicMessagePartTextPart$outboundSchema = exports.PublicMessagePartTextPart$inboundSchema = exports.InvokeAgentPublicMessagePartKind$outboundSchema = exports.InvokeAgentPublicMessagePartKind$inboundSchema = exports.PublicMessagePartFilePart$outboundSchema = exports.PublicMessagePartFilePart$inboundSchema = exports.InvokeAgentPublicMessagePartFile$outboundSchema = exports.InvokeAgentPublicMessagePartFile$inboundSchema = exports.FileBinaryFormat$outboundSchema = exports.FileBinaryFormat$inboundSchema = exports.FileFileInURIFormat$outboundSchema = exports.FileFileInURIFormat$inboundSchema = exports.InvokeAgentPublicMessagePartAgentsKind$outboundSchema = exports.InvokeAgentPublicMessagePartAgentsKind$inboundSchema = exports.PublicMessagePartToolResultPart$outboundSchema = exports.PublicMessagePartToolResultPart$inboundSchema = exports.InvokeAgentPublicMessagePartAgentsRequestKind$outboundSchema = exports.InvokeAgentPublicMessagePartAgentsRequestKind$inboundSchema = exports.InvokeAgentRole$outboundSchema = exports.InvokeAgentRole$inboundSchema = exports.InvokeAgentRoleUserMessage$outboundSchema = exports.InvokeAgentRoleUserMessage$inboundSchema = exports.InvokeAgentRoleToolMessage$outboundSchema = exports.InvokeAgentRoleToolMessage$inboundSchema = exports.PartsKind = exports.InvokeAgentPartsKind = exports.InvokeAgentPartsAgentsKind = exports.InvokeAgentPartsAgentsResponseKind = exports.InvokeAgentPartsAgentsResponse200Kind = exports.ExtendedMessageRole = exports.InvokeAgentAgentsKind = exports.TaskState = exports.InvokeAgentKind = exports.InvokeAgentPublicMessagePartKind = exports.InvokeAgentPublicMessagePartAgentsKind = exports.InvokeAgentPublicMessagePartAgentsRequestKind = exports.InvokeAgentRoleUserMessage = exports.InvokeAgentRoleToolMessage = void 0;
exports.InvokeAgentA2ATaskResponse$outboundSchema = exports.InvokeAgentA2ATaskResponse$inboundSchema = exports.TaskStatus$outboundSchema = exports.TaskStatus$inboundSchema = exports.TaskStatusMessage$outboundSchema = exports.TaskStatusMessage$inboundSchema = exports.Parts$outboundSchema = exports.Parts$inboundSchema = exports.PartsTextPart$outboundSchema = exports.PartsTextPart$inboundSchema = exports.PartsKind$outboundSchema = exports.PartsKind$inboundSchema = exports.DataPart$outboundSchema = exports.DataPart$inboundSchema = exports.InvokeAgentPartsKind$outboundSchema = exports.InvokeAgentPartsKind$inboundSchema = exports.PartsFilePart$outboundSchema = exports.PartsFilePart$inboundSchema = exports.PartsFile$outboundSchema = exports.PartsFile$inboundSchema = exports.InvokeAgentFileBinaryFormat$outboundSchema = exports.InvokeAgentFileBinaryFormat$inboundSchema = exports.InvokeAgentFileFileInURIFormat$outboundSchema = exports.InvokeAgentFileFileInURIFormat$inboundSchema = exports.InvokeAgentPartsAgentsKind$outboundSchema = exports.InvokeAgentPartsAgentsKind$inboundSchema = exports.ToolCallPart$outboundSchema = exports.ToolCallPart$inboundSchema = exports.InvokeAgentPartsAgentsResponseKind$outboundSchema = exports.InvokeAgentPartsAgentsResponseKind$inboundSchema = exports.PartsToolResultPart$outboundSchema = exports.PartsToolResultPart$inboundSchema = exports.InvokeAgentPartsAgentsResponse200Kind$outboundSchema = exports.InvokeAgentPartsAgentsResponse200Kind$inboundSchema = exports.ExtendedMessageRole$outboundSchema = exports.ExtendedMessageRole$inboundSchema = exports.InvokeAgentAgentsKind$outboundSchema = exports.InvokeAgentAgentsKind$inboundSchema = exports.TaskState$outboundSchema = exports.TaskState$inboundSchema = exports.InvokeAgentKind$outboundSchema = exports.InvokeAgentKind$inboundSchema = exports.InvokeAgentRequest$outboundSchema = exports.InvokeAgentRequest$inboundSchema = void 0;
exports.invokeAgentRoleToJSON = invokeAgentRoleToJSON;
exports.invokeAgentRoleFromJSON = invokeAgentRoleFromJSON;
exports.publicMessagePartToolResultPartToJSON = publicMessagePartToolResultPartToJSON;
exports.publicMessagePartToolResultPartFromJSON = publicMessagePartToolResultPartFromJSON;
exports.fileFileInURIFormatToJSON = fileFileInURIFormatToJSON;
exports.fileFileInURIFormatFromJSON = fileFileInURIFormatFromJSON;
exports.fileBinaryFormatToJSON = fileBinaryFormatToJSON;
exports.fileBinaryFormatFromJSON = fileBinaryFormatFromJSON;
exports.invokeAgentPublicMessagePartFileToJSON = invokeAgentPublicMessagePartFileToJSON;
exports.invokeAgentPublicMessagePartFileFromJSON = invokeAgentPublicMessagePartFileFromJSON;
exports.publicMessagePartFilePartToJSON = publicMessagePartFilePartToJSON;
exports.publicMessagePartFilePartFromJSON = publicMessagePartFilePartFromJSON;
exports.publicMessagePartTextPartToJSON = publicMessagePartTextPartToJSON;
exports.publicMessagePartTextPartFromJSON = publicMessagePartTextPartFromJSON;
exports.invokeAgentPublicMessagePartToJSON = invokeAgentPublicMessagePartToJSON;
exports.invokeAgentPublicMessagePartFromJSON = invokeAgentPublicMessagePartFromJSON;
exports.invokeAgentA2AMessageToJSON = invokeAgentA2AMessageToJSON;
exports.invokeAgentA2AMessageFromJSON = invokeAgentA2AMessageFromJSON;
exports.invokeAgentContactToJSON = invokeAgentContactToJSON;
exports.invokeAgentContactFromJSON = invokeAgentContactFromJSON;
exports.invokeAgentThreadToJSON = invokeAgentThreadToJSON;
exports.invokeAgentThreadFromJSON = invokeAgentThreadFromJSON;
exports.invokeAgentMemoryToJSON = invokeAgentMemoryToJSON;
exports.invokeAgentMemoryFromJSON = invokeAgentMemoryFromJSON;
exports.invokeAgentRequestBodyToJSON = invokeAgentRequestBodyToJSON;
exports.invokeAgentRequestBodyFromJSON = invokeAgentRequestBodyFromJSON;
exports.invokeAgentRequestToJSON = invokeAgentRequestToJSON;
exports.invokeAgentRequestFromJSON = invokeAgentRequestFromJSON;
exports.partsToolResultPartToJSON = partsToolResultPartToJSON;
exports.partsToolResultPartFromJSON = partsToolResultPartFromJSON;
exports.toolCallPartToJSON = toolCallPartToJSON;
exports.toolCallPartFromJSON = toolCallPartFromJSON;
exports.invokeAgentFileFileInURIFormatToJSON = invokeAgentFileFileInURIFormatToJSON;
exports.invokeAgentFileFileInURIFormatFromJSON = invokeAgentFileFileInURIFormatFromJSON;
exports.invokeAgentFileBinaryFormatToJSON = invokeAgentFileBinaryFormatToJSON;
exports.invokeAgentFileBinaryFormatFromJSON = invokeAgentFileBinaryFormatFromJSON;
exports.partsFileToJSON = partsFileToJSON;
exports.partsFileFromJSON = partsFileFromJSON;
exports.partsFilePartToJSON = partsFilePartToJSON;
exports.partsFilePartFromJSON = partsFilePartFromJSON;
exports.dataPartToJSON = dataPartToJSON;
exports.dataPartFromJSON = dataPartFromJSON;
exports.partsTextPartToJSON = partsTextPartToJSON;
exports.partsTextPartFromJSON = partsTextPartFromJSON;
exports.partsToJSON = partsToJSON;
exports.partsFromJSON = partsFromJSON;
exports.taskStatusMessageToJSON = taskStatusMessageToJSON;
exports.taskStatusMessageFromJSON = taskStatusMessageFromJSON;
exports.taskStatusToJSON = taskStatusToJSON;
exports.taskStatusFromJSON = taskStatusFromJSON;
exports.invokeAgentA2ATaskResponseToJSON = invokeAgentA2ATaskResponseToJSON;
exports.invokeAgentA2ATaskResponseFromJSON = invokeAgentA2ATaskResponseFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * Message containing tool execution results
 */
exports.InvokeAgentRoleToolMessage = {
    Tool: "tool",
};
/**
 * Message from the end user
 */
exports.InvokeAgentRoleUserMessage = {
    User: "user",
};
exports.InvokeAgentPublicMessagePartAgentsRequestKind = {
    ToolResult: "tool_result",
};
exports.InvokeAgentPublicMessagePartAgentsKind = {
    File: "file",
};
exports.InvokeAgentPublicMessagePartKind = {
    Text: "text",
};
/**
 * A2A entity type identifier
 */
exports.InvokeAgentKind = {
    Task: "task",
};
/**
 * Current state of the agent task execution. Values: submitted (queued), working (executing), input-required (awaiting user input), completed (finished successfully), failed (error occurred). Note: auth-required, canceled, and rejected statuses are defined for A2A protocol compatibility but are not currently supported in task execution.
 */
exports.TaskState = {
    Submitted: "submitted",
    Working: "working",
    InputRequired: "input-required",
    AuthRequired: "auth-required",
    Completed: "completed",
    Failed: "failed",
    Canceled: "canceled",
    Rejected: "rejected",
};
exports.InvokeAgentAgentsKind = {
    Message: "message",
};
/**
 * Role of the message sender in the A2A protocol. Values: user (end user), agent (AI agent), tool (tool execution result), system (system instructions/prompts).
 */
exports.ExtendedMessageRole = {
    User: "user",
    Agent: "agent",
    Tool: "tool",
    System: "system",
};
exports.InvokeAgentPartsAgentsResponse200Kind = {
    ToolResult: "tool_result",
};
exports.InvokeAgentPartsAgentsResponseKind = {
    ToolCall: "tool_call",
};
exports.InvokeAgentPartsAgentsKind = {
    File: "file",
};
exports.InvokeAgentPartsKind = {
    Data: "data",
};
exports.PartsKind = {
    Text: "text",
};
/** @internal */
exports.InvokeAgentRoleToolMessage$inboundSchema = z.nativeEnum(exports.InvokeAgentRoleToolMessage);
/** @internal */
exports.InvokeAgentRoleToolMessage$outboundSchema = exports.InvokeAgentRoleToolMessage$inboundSchema;
/** @internal */
exports.InvokeAgentRoleUserMessage$inboundSchema = z.nativeEnum(exports.InvokeAgentRoleUserMessage);
/** @internal */
exports.InvokeAgentRoleUserMessage$outboundSchema = exports.InvokeAgentRoleUserMessage$inboundSchema;
/** @internal */
exports.InvokeAgentRole$inboundSchema = z.union([
    exports.InvokeAgentRoleUserMessage$inboundSchema,
    exports.InvokeAgentRoleToolMessage$inboundSchema,
]);
/** @internal */
exports.InvokeAgentRole$outboundSchema = z.union([
    exports.InvokeAgentRoleUserMessage$outboundSchema,
    exports.InvokeAgentRoleToolMessage$outboundSchema,
]);
function invokeAgentRoleToJSON(invokeAgentRole) {
    return JSON.stringify(exports.InvokeAgentRole$outboundSchema.parse(invokeAgentRole));
}
function invokeAgentRoleFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentRole$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentRole' from JSON`);
}
/** @internal */
exports.InvokeAgentPublicMessagePartAgentsRequestKind$inboundSchema = z
    .nativeEnum(exports.InvokeAgentPublicMessagePartAgentsRequestKind);
/** @internal */
exports.InvokeAgentPublicMessagePartAgentsRequestKind$outboundSchema = exports.InvokeAgentPublicMessagePartAgentsRequestKind$inboundSchema;
/** @internal */
exports.PublicMessagePartToolResultPart$inboundSchema = z.object({
    kind: exports.InvokeAgentPublicMessagePartAgentsRequestKind$inboundSchema,
    tool_call_id: z.string(),
    result: z.any().optional(),
    metadata: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "tool_call_id": "toolCallId",
    });
});
/** @internal */
exports.PublicMessagePartToolResultPart$outboundSchema = z.object({
    kind: exports.InvokeAgentPublicMessagePartAgentsRequestKind$outboundSchema,
    toolCallId: z.string(),
    result: z.any().optional(),
    metadata: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolCallId: "tool_call_id",
    });
});
function publicMessagePartToolResultPartToJSON(publicMessagePartToolResultPart) {
    return JSON.stringify(exports.PublicMessagePartToolResultPart$outboundSchema.parse(publicMessagePartToolResultPart));
}
function publicMessagePartToolResultPartFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PublicMessagePartToolResultPart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PublicMessagePartToolResultPart' from JSON`);
}
/** @internal */
exports.InvokeAgentPublicMessagePartAgentsKind$inboundSchema = z.nativeEnum(exports.InvokeAgentPublicMessagePartAgentsKind);
/** @internal */
exports.InvokeAgentPublicMessagePartAgentsKind$outboundSchema = exports.InvokeAgentPublicMessagePartAgentsKind$inboundSchema;
/** @internal */
exports.FileFileInURIFormat$inboundSchema = z.object({
    uri: z.string(),
    mimeType: z.string().optional(),
    name: z.string().optional(),
});
/** @internal */
exports.FileFileInURIFormat$outboundSchema = z.object({
    uri: z.string(),
    mimeType: z.string().optional(),
    name: z.string().optional(),
});
function fileFileInURIFormatToJSON(fileFileInURIFormat) {
    return JSON.stringify(exports.FileFileInURIFormat$outboundSchema.parse(fileFileInURIFormat));
}
function fileFileInURIFormatFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.FileFileInURIFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileFileInURIFormat' from JSON`);
}
/** @internal */
exports.FileBinaryFormat$inboundSchema = z.object({
    bytes: z.string(),
    mimeType: z.string().optional(),
    name: z.string().optional(),
});
/** @internal */
exports.FileBinaryFormat$outboundSchema = z.object({
    bytes: z.string(),
    mimeType: z.string().optional(),
    name: z.string().optional(),
});
function fileBinaryFormatToJSON(fileBinaryFormat) {
    return JSON.stringify(exports.FileBinaryFormat$outboundSchema.parse(fileBinaryFormat));
}
function fileBinaryFormatFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.FileBinaryFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileBinaryFormat' from JSON`);
}
/** @internal */
exports.InvokeAgentPublicMessagePartFile$inboundSchema = z.union([
    z.lazy(() => exports.FileBinaryFormat$inboundSchema),
    z.lazy(() => exports.FileFileInURIFormat$inboundSchema),
]);
/** @internal */
exports.InvokeAgentPublicMessagePartFile$outboundSchema = z.union([
    z.lazy(() => exports.FileBinaryFormat$outboundSchema),
    z.lazy(() => exports.FileFileInURIFormat$outboundSchema),
]);
function invokeAgentPublicMessagePartFileToJSON(invokeAgentPublicMessagePartFile) {
    return JSON.stringify(exports.InvokeAgentPublicMessagePartFile$outboundSchema.parse(invokeAgentPublicMessagePartFile));
}
function invokeAgentPublicMessagePartFileFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentPublicMessagePartFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentPublicMessagePartFile' from JSON`);
}
/** @internal */
exports.PublicMessagePartFilePart$inboundSchema = z.object({
    kind: exports.InvokeAgentPublicMessagePartAgentsKind$inboundSchema,
    file: z.union([
        z.lazy(() => exports.FileBinaryFormat$inboundSchema),
        z.lazy(() => exports.FileFileInURIFormat$inboundSchema),
    ]),
    metadata: z.record(z.any()).optional(),
});
/** @internal */
exports.PublicMessagePartFilePart$outboundSchema = z.object({
    kind: exports.InvokeAgentPublicMessagePartAgentsKind$outboundSchema,
    file: z.union([
        z.lazy(() => exports.FileBinaryFormat$outboundSchema),
        z.lazy(() => exports.FileFileInURIFormat$outboundSchema),
    ]),
    metadata: z.record(z.any()).optional(),
});
function publicMessagePartFilePartToJSON(publicMessagePartFilePart) {
    return JSON.stringify(exports.PublicMessagePartFilePart$outboundSchema.parse(publicMessagePartFilePart));
}
function publicMessagePartFilePartFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PublicMessagePartFilePart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PublicMessagePartFilePart' from JSON`);
}
/** @internal */
exports.InvokeAgentPublicMessagePartKind$inboundSchema = z.nativeEnum(exports.InvokeAgentPublicMessagePartKind);
/** @internal */
exports.InvokeAgentPublicMessagePartKind$outboundSchema = exports.InvokeAgentPublicMessagePartKind$inboundSchema;
/** @internal */
exports.PublicMessagePartTextPart$inboundSchema = z.object({
    kind: exports.InvokeAgentPublicMessagePartKind$inboundSchema,
    text: z.string(),
});
/** @internal */
exports.PublicMessagePartTextPart$outboundSchema = z.object({
    kind: exports.InvokeAgentPublicMessagePartKind$outboundSchema,
    text: z.string(),
});
function publicMessagePartTextPartToJSON(publicMessagePartTextPart) {
    return JSON.stringify(exports.PublicMessagePartTextPart$outboundSchema.parse(publicMessagePartTextPart));
}
function publicMessagePartTextPartFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PublicMessagePartTextPart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PublicMessagePartTextPart' from JSON`);
}
/** @internal */
exports.InvokeAgentPublicMessagePart$inboundSchema = z.union([
    z.lazy(() => exports.PublicMessagePartTextPart$inboundSchema),
    z.lazy(() => exports.PublicMessagePartFilePart$inboundSchema),
    z.lazy(() => exports.PublicMessagePartToolResultPart$inboundSchema),
]);
/** @internal */
exports.InvokeAgentPublicMessagePart$outboundSchema = z.union([
    z.lazy(() => exports.PublicMessagePartTextPart$outboundSchema),
    z.lazy(() => exports.PublicMessagePartFilePart$outboundSchema),
    z.lazy(() => exports.PublicMessagePartToolResultPart$outboundSchema),
]);
function invokeAgentPublicMessagePartToJSON(invokeAgentPublicMessagePart) {
    return JSON.stringify(exports.InvokeAgentPublicMessagePart$outboundSchema.parse(invokeAgentPublicMessagePart));
}
function invokeAgentPublicMessagePartFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentPublicMessagePart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentPublicMessagePart' from JSON`);
}
/** @internal */
exports.InvokeAgentA2AMessage$inboundSchema = z.object({
    messageId: z.string().optional(),
    role: z.union([
        exports.InvokeAgentRoleUserMessage$inboundSchema,
        exports.InvokeAgentRoleToolMessage$inboundSchema,
    ]),
    parts: z.array(z.union([
        z.lazy(() => exports.PublicMessagePartTextPart$inboundSchema),
        z.lazy(() => exports.PublicMessagePartFilePart$inboundSchema),
        z.lazy(() => exports.PublicMessagePartToolResultPart$inboundSchema),
    ])),
});
/** @internal */
exports.InvokeAgentA2AMessage$outboundSchema = z.object({
    messageId: z.string().optional(),
    role: z.union([
        exports.InvokeAgentRoleUserMessage$outboundSchema,
        exports.InvokeAgentRoleToolMessage$outboundSchema,
    ]),
    parts: z.array(z.union([
        z.lazy(() => exports.PublicMessagePartTextPart$outboundSchema),
        z.lazy(() => exports.PublicMessagePartFilePart$outboundSchema),
        z.lazy(() => exports.PublicMessagePartToolResultPart$outboundSchema),
    ])),
});
function invokeAgentA2AMessageToJSON(invokeAgentA2AMessage) {
    return JSON.stringify(exports.InvokeAgentA2AMessage$outboundSchema.parse(invokeAgentA2AMessage));
}
function invokeAgentA2AMessageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentA2AMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentA2AMessage' from JSON`);
}
/** @internal */
exports.InvokeAgentContact$inboundSchema = z.object({
    id: z.string(),
    display_name: z.string().optional(),
    email: z.string().optional(),
    metadata: z.array(z.record(z.any())).optional(),
    logo_url: z.string().optional(),
    tags: z.array(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "display_name": "displayName",
        "logo_url": "logoUrl",
    });
});
/** @internal */
exports.InvokeAgentContact$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 invokeAgentContactToJSON(invokeAgentContact) {
    return JSON.stringify(exports.InvokeAgentContact$outboundSchema.parse(invokeAgentContact));
}
function invokeAgentContactFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentContact$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentContact' from JSON`);
}
/** @internal */
exports.InvokeAgentThread$inboundSchema = z.object({
    id: z.string(),
    tags: z.array(z.string()).optional(),
});
/** @internal */
exports.InvokeAgentThread$outboundSchema = z.object({
    id: z.string(),
    tags: z.array(z.string()).optional(),
});
function invokeAgentThreadToJSON(invokeAgentThread) {
    return JSON.stringify(exports.InvokeAgentThread$outboundSchema.parse(invokeAgentThread));
}
function invokeAgentThreadFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentThread$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentThread' from JSON`);
}
/** @internal */
exports.InvokeAgentMemory$inboundSchema = z.object({
    entity_id: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "entity_id": "entityId",
    });
});
/** @internal */
exports.InvokeAgentMemory$outboundSchema = z.object({
    entityId: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        entityId: "entity_id",
    });
});
function invokeAgentMemoryToJSON(invokeAgentMemory) {
    return JSON.stringify(exports.InvokeAgentMemory$outboundSchema.parse(invokeAgentMemory));
}
function invokeAgentMemoryFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentMemory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentMemory' from JSON`);
}
/** @internal */
exports.InvokeAgentRequestBody$inboundSchema = z.object({
    task_id: z.string().optional(),
    message: z.lazy(() => exports.InvokeAgentA2AMessage$inboundSchema),
    variables: z.record(z.any()).optional(),
    contact: z.lazy(() => exports.InvokeAgentContact$inboundSchema).optional(),
    thread: z.lazy(() => exports.InvokeAgentThread$inboundSchema).optional(),
    memory: z.lazy(() => exports.InvokeAgentMemory$inboundSchema).optional(),
    metadata: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "task_id": "taskId",
    });
});
/** @internal */
exports.InvokeAgentRequestBody$outboundSchema = z.object({
    taskId: z.string().optional(),
    message: z.lazy(() => exports.InvokeAgentA2AMessage$outboundSchema),
    variables: z.record(z.any()).optional(),
    contact: z.lazy(() => exports.InvokeAgentContact$outboundSchema).optional(),
    thread: z.lazy(() => exports.InvokeAgentThread$outboundSchema).optional(),
    memory: z.lazy(() => exports.InvokeAgentMemory$outboundSchema).optional(),
    metadata: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        taskId: "task_id",
    });
});
function invokeAgentRequestBodyToJSON(invokeAgentRequestBody) {
    return JSON.stringify(exports.InvokeAgentRequestBody$outboundSchema.parse(invokeAgentRequestBody));
}
function invokeAgentRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentRequestBody' from JSON`);
}
/** @internal */
exports.InvokeAgentRequest$inboundSchema = z.object({
    key: z.string(),
    RequestBody: z.lazy(() => exports.InvokeAgentRequestBody$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "RequestBody": "requestBody",
    });
});
/** @internal */
exports.InvokeAgentRequest$outboundSchema = z.object({
    key: z.string(),
    requestBody: z.lazy(() => exports.InvokeAgentRequestBody$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requestBody: "RequestBody",
    });
});
function invokeAgentRequestToJSON(invokeAgentRequest) {
    return JSON.stringify(exports.InvokeAgentRequest$outboundSchema.parse(invokeAgentRequest));
}
function invokeAgentRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentRequest' from JSON`);
}
/** @internal */
exports.InvokeAgentKind$inboundSchema = z.nativeEnum(exports.InvokeAgentKind);
/** @internal */
exports.InvokeAgentKind$outboundSchema = exports.InvokeAgentKind$inboundSchema;
/** @internal */
exports.TaskState$inboundSchema = z
    .nativeEnum(exports.TaskState);
/** @internal */
exports.TaskState$outboundSchema = exports.TaskState$inboundSchema;
/** @internal */
exports.InvokeAgentAgentsKind$inboundSchema = z.nativeEnum(exports.InvokeAgentAgentsKind);
/** @internal */
exports.InvokeAgentAgentsKind$outboundSchema = exports.InvokeAgentAgentsKind$inboundSchema;
/** @internal */
exports.ExtendedMessageRole$inboundSchema = z.nativeEnum(exports.ExtendedMessageRole);
/** @internal */
exports.ExtendedMessageRole$outboundSchema = exports.ExtendedMessageRole$inboundSchema;
/** @internal */
exports.InvokeAgentPartsAgentsResponse200Kind$inboundSchema = z.nativeEnum(exports.InvokeAgentPartsAgentsResponse200Kind);
/** @internal */
exports.InvokeAgentPartsAgentsResponse200Kind$outboundSchema = exports.InvokeAgentPartsAgentsResponse200Kind$inboundSchema;
/** @internal */
exports.PartsToolResultPart$inboundSchema = z.object({
    kind: exports.InvokeAgentPartsAgentsResponse200Kind$inboundSchema,
    tool_call_id: z.string(),
    result: z.any().optional(),
    metadata: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "tool_call_id": "toolCallId",
    });
});
/** @internal */
exports.PartsToolResultPart$outboundSchema = z.object({
    kind: exports.InvokeAgentPartsAgentsResponse200Kind$outboundSchema,
    toolCallId: z.string(),
    result: z.any().optional(),
    metadata: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolCallId: "tool_call_id",
    });
});
function partsToolResultPartToJSON(partsToolResultPart) {
    return JSON.stringify(exports.PartsToolResultPart$outboundSchema.parse(partsToolResultPart));
}
function partsToolResultPartFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PartsToolResultPart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartsToolResultPart' from JSON`);
}
/** @internal */
exports.InvokeAgentPartsAgentsResponseKind$inboundSchema = z.nativeEnum(exports.InvokeAgentPartsAgentsResponseKind);
/** @internal */
exports.InvokeAgentPartsAgentsResponseKind$outboundSchema = exports.InvokeAgentPartsAgentsResponseKind$inboundSchema;
/** @internal */
exports.ToolCallPart$inboundSchema = z.object({
    kind: exports.InvokeAgentPartsAgentsResponseKind$inboundSchema,
    tool_name: z.string(),
    tool_call_id: z.string(),
    arguments: z.record(z.any()),
    metadata: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "tool_name": "toolName",
        "tool_call_id": "toolCallId",
    });
});
/** @internal */
exports.ToolCallPart$outboundSchema = z.object({
    kind: exports.InvokeAgentPartsAgentsResponseKind$outboundSchema,
    toolName: z.string(),
    toolCallId: z.string(),
    arguments: z.record(z.any()),
    metadata: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolName: "tool_name",
        toolCallId: "tool_call_id",
    });
});
function toolCallPartToJSON(toolCallPart) {
    return JSON.stringify(exports.ToolCallPart$outboundSchema.parse(toolCallPart));
}
function toolCallPartFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ToolCallPart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolCallPart' from JSON`);
}
/** @internal */
exports.InvokeAgentPartsAgentsKind$inboundSchema = z.nativeEnum(exports.InvokeAgentPartsAgentsKind);
/** @internal */
exports.InvokeAgentPartsAgentsKind$outboundSchema = exports.InvokeAgentPartsAgentsKind$inboundSchema;
/** @internal */
exports.InvokeAgentFileFileInURIFormat$inboundSchema = z.object({
    uri: z.string(),
    mimeType: z.string().optional(),
    name: z.string().optional(),
});
/** @internal */
exports.InvokeAgentFileFileInURIFormat$outboundSchema = z.object({
    uri: z.string(),
    mimeType: z.string().optional(),
    name: z.string().optional(),
});
function invokeAgentFileFileInURIFormatToJSON(invokeAgentFileFileInURIFormat) {
    return JSON.stringify(exports.InvokeAgentFileFileInURIFormat$outboundSchema.parse(invokeAgentFileFileInURIFormat));
}
function invokeAgentFileFileInURIFormatFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentFileFileInURIFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentFileFileInURIFormat' from JSON`);
}
/** @internal */
exports.InvokeAgentFileBinaryFormat$inboundSchema = z.object({
    bytes: z.string(),
    mimeType: z.string().optional(),
    name: z.string().optional(),
});
/** @internal */
exports.InvokeAgentFileBinaryFormat$outboundSchema = z.object({
    bytes: z.string(),
    mimeType: z.string().optional(),
    name: z.string().optional(),
});
function invokeAgentFileBinaryFormatToJSON(invokeAgentFileBinaryFormat) {
    return JSON.stringify(exports.InvokeAgentFileBinaryFormat$outboundSchema.parse(invokeAgentFileBinaryFormat));
}
function invokeAgentFileBinaryFormatFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentFileBinaryFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentFileBinaryFormat' from JSON`);
}
/** @internal */
exports.PartsFile$inboundSchema = z.union([
    z.lazy(() => exports.InvokeAgentFileBinaryFormat$inboundSchema),
    z.lazy(() => exports.InvokeAgentFileFileInURIFormat$inboundSchema),
]);
/** @internal */
exports.PartsFile$outboundSchema = z.union([
    z.lazy(() => exports.InvokeAgentFileBinaryFormat$outboundSchema),
    z.lazy(() => exports.InvokeAgentFileFileInURIFormat$outboundSchema),
]);
function partsFileToJSON(partsFile) {
    return JSON.stringify(exports.PartsFile$outboundSchema.parse(partsFile));
}
function partsFileFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PartsFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartsFile' from JSON`);
}
/** @internal */
exports.PartsFilePart$inboundSchema = z.object({
    kind: exports.InvokeAgentPartsAgentsKind$inboundSchema,
    file: z.union([
        z.lazy(() => exports.InvokeAgentFileBinaryFormat$inboundSchema),
        z.lazy(() => exports.InvokeAgentFileFileInURIFormat$inboundSchema),
    ]),
    metadata: z.record(z.any()).optional(),
});
/** @internal */
exports.PartsFilePart$outboundSchema = z.object({
    kind: exports.InvokeAgentPartsAgentsKind$outboundSchema,
    file: z.union([
        z.lazy(() => exports.InvokeAgentFileBinaryFormat$outboundSchema),
        z.lazy(() => exports.InvokeAgentFileFileInURIFormat$outboundSchema),
    ]),
    metadata: z.record(z.any()).optional(),
});
function partsFilePartToJSON(partsFilePart) {
    return JSON.stringify(exports.PartsFilePart$outboundSchema.parse(partsFilePart));
}
function partsFilePartFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PartsFilePart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartsFilePart' from JSON`);
}
/** @internal */
exports.InvokeAgentPartsKind$inboundSchema = z.nativeEnum(exports.InvokeAgentPartsKind);
/** @internal */
exports.InvokeAgentPartsKind$outboundSchema = exports.InvokeAgentPartsKind$inboundSchema;
/** @internal */
exports.DataPart$inboundSchema = z.object({
    kind: exports.InvokeAgentPartsKind$inboundSchema,
    data: z.record(z.any()),
    metadata: z.record(z.any()).optional(),
});
/** @internal */
exports.DataPart$outboundSchema = z.object({
    kind: exports.InvokeAgentPartsKind$outboundSchema,
    data: z.record(z.any()),
    metadata: z.record(z.any()).optional(),
});
function dataPartToJSON(dataPart) {
    return JSON.stringify(exports.DataPart$outboundSchema.parse(dataPart));
}
function dataPartFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DataPart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DataPart' from JSON`);
}
/** @internal */
exports.PartsKind$inboundSchema = z
    .nativeEnum(exports.PartsKind);
/** @internal */
exports.PartsKind$outboundSchema = exports.PartsKind$inboundSchema;
/** @internal */
exports.PartsTextPart$inboundSchema = z.object({
    kind: exports.PartsKind$inboundSchema,
    text: z.string(),
});
/** @internal */
exports.PartsTextPart$outboundSchema = z.object({
    kind: exports.PartsKind$outboundSchema,
    text: z.string(),
});
function partsTextPartToJSON(partsTextPart) {
    return JSON.stringify(exports.PartsTextPart$outboundSchema.parse(partsTextPart));
}
function partsTextPartFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PartsTextPart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartsTextPart' from JSON`);
}
/** @internal */
exports.Parts$inboundSchema = z
    .union([
    z.lazy(() => exports.ToolCallPart$inboundSchema),
    z.lazy(() => exports.PartsTextPart$inboundSchema),
    z.lazy(() => exports.DataPart$inboundSchema),
    z.lazy(() => exports.PartsFilePart$inboundSchema),
    z.lazy(() => exports.PartsToolResultPart$inboundSchema),
]);
/** @internal */
exports.Parts$outboundSchema = z.union([
    z.lazy(() => exports.ToolCallPart$outboundSchema),
    z.lazy(() => exports.PartsTextPart$outboundSchema),
    z.lazy(() => exports.DataPart$outboundSchema),
    z.lazy(() => exports.PartsFilePart$outboundSchema),
    z.lazy(() => exports.PartsToolResultPart$outboundSchema),
]);
function partsToJSON(parts) {
    return JSON.stringify(exports.Parts$outboundSchema.parse(parts));
}
function partsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Parts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Parts' from JSON`);
}
/** @internal */
exports.TaskStatusMessage$inboundSchema = z.object({
    kind: exports.InvokeAgentAgentsKind$inboundSchema,
    messageId: z.string(),
    role: exports.ExtendedMessageRole$inboundSchema,
    parts: z.array(z.union([
        z.lazy(() => exports.ToolCallPart$inboundSchema),
        z.lazy(() => exports.PartsTextPart$inboundSchema),
        z.lazy(() => exports.DataPart$inboundSchema),
        z.lazy(() => exports.PartsFilePart$inboundSchema),
        z.lazy(() => exports.PartsToolResultPart$inboundSchema),
    ])),
});
/** @internal */
exports.TaskStatusMessage$outboundSchema = z.object({
    kind: exports.InvokeAgentAgentsKind$outboundSchema,
    messageId: z.string(),
    role: exports.ExtendedMessageRole$outboundSchema,
    parts: z.array(z.union([
        z.lazy(() => exports.ToolCallPart$outboundSchema),
        z.lazy(() => exports.PartsTextPart$outboundSchema),
        z.lazy(() => exports.DataPart$outboundSchema),
        z.lazy(() => exports.PartsFilePart$outboundSchema),
        z.lazy(() => exports.PartsToolResultPart$outboundSchema),
    ])),
});
function taskStatusMessageToJSON(taskStatusMessage) {
    return JSON.stringify(exports.TaskStatusMessage$outboundSchema.parse(taskStatusMessage));
}
function taskStatusMessageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskStatusMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskStatusMessage' from JSON`);
}
/** @internal */
exports.TaskStatus$inboundSchema = z.object({
    state: exports.TaskState$inboundSchema,
    timestamp: z.string().optional(),
    message: z.lazy(() => exports.TaskStatusMessage$inboundSchema).optional(),
});
/** @internal */
exports.TaskStatus$outboundSchema = z.object({
    state: exports.TaskState$outboundSchema,
    timestamp: z.string().optional(),
    message: z.lazy(() => exports.TaskStatusMessage$outboundSchema).optional(),
});
function taskStatusToJSON(taskStatus) {
    return JSON.stringify(exports.TaskStatus$outboundSchema.parse(taskStatus));
}
function taskStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskStatus' from JSON`);
}
/** @internal */
exports.InvokeAgentA2ATaskResponse$inboundSchema = z.object({
    id: z.string(),
    contextId: z.string(),
    kind: exports.InvokeAgentKind$inboundSchema,
    status: z.lazy(() => exports.TaskStatus$inboundSchema),
    metadata: z.record(z.any()).optional(),
});
/** @internal */
exports.InvokeAgentA2ATaskResponse$outboundSchema = z.object({
    id: z.string(),
    contextId: z.string(),
    kind: exports.InvokeAgentKind$outboundSchema,
    status: z.lazy(() => exports.TaskStatus$outboundSchema),
    metadata: z.record(z.any()).optional(),
});
function invokeAgentA2ATaskResponseToJSON(invokeAgentA2ATaskResponse) {
    return JSON.stringify(exports.InvokeAgentA2ATaskResponse$outboundSchema.parse(invokeAgentA2ATaskResponse));
}
function invokeAgentA2ATaskResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentA2ATaskResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentA2ATaskResponse' from JSON`);
}
//# sourceMappingURL=invokeagent.js.map