"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.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 = 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.PublicMessagePartFilePart$outboundSchema = exports.PublicMessagePartFilePart$inboundSchema = exports.InvokeAgentPublicMessagePartFile$outboundSchema = exports.InvokeAgentPublicMessagePartFile$inboundSchema = exports.FileBinaryFormat$outboundSchema = exports.FileBinaryFormat$inboundSchema = exports.FileFileInURIFormat$outboundSchema = exports.FileFileInURIFormat$inboundSchema = exports.InvokeAgentPublicMessagePartKind$outboundSchema = exports.InvokeAgentPublicMessagePartKind$inboundSchema = exports.PublicMessagePartToolResultPart$outboundSchema = exports.PublicMessagePartToolResultPart$inboundSchema = exports.InvokeAgentPublicMessagePartAgentsKind$outboundSchema = exports.InvokeAgentPublicMessagePartAgentsKind$inboundSchema = exports.InvokeAgentRole$outboundSchema = exports.InvokeAgentRole$inboundSchema = exports.InvokeAgentRoleUserMessage$outboundSchema = exports.InvokeAgentRoleUserMessage$inboundSchema = exports.InvokeAgentRoleToolMessage$outboundSchema = exports.InvokeAgentRoleToolMessage$inboundSchema = exports.ExtendedMessageRole = exports.InvokeAgentAgentsKind = exports.TaskState = exports.InvokeAgentKind = exports.InvokeAgentPublicMessagePartKind = exports.InvokeAgentPublicMessagePartAgentsKind = 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.InvokeAgentParts$outboundSchema = exports.InvokeAgentParts$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.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.invokeAgentPartsToJSON = invokeAgentPartsToJSON;
exports.invokeAgentPartsFromJSON = invokeAgentPartsFromJSON;
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");
const components = __importStar(require("../components/index.js"));
/**
 * Message containing tool execution results
 */
exports.InvokeAgentRoleToolMessage = {
    Tool: "tool",
};
/**
 * Message from the end user
 */
exports.InvokeAgentRoleUserMessage = {
    User: "user",
};
exports.InvokeAgentPublicMessagePartAgentsKind = {
    ToolResult: "tool_result",
};
exports.InvokeAgentPublicMessagePartKind = {
    File: "file",
};
/**
 * 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",
};
/** @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.InvokeAgentPublicMessagePartAgentsKind$inboundSchema = z.nativeEnum(exports.InvokeAgentPublicMessagePartAgentsKind);
/** @internal */
exports.InvokeAgentPublicMessagePartAgentsKind$outboundSchema = exports.InvokeAgentPublicMessagePartAgentsKind$inboundSchema;
/** @internal */
exports.PublicMessagePartToolResultPart$inboundSchema = z.object({
    kind: exports.InvokeAgentPublicMessagePartAgentsKind$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.InvokeAgentPublicMessagePartAgentsKind$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.InvokeAgentPublicMessagePartKind$inboundSchema = z.nativeEnum(exports.InvokeAgentPublicMessagePartKind);
/** @internal */
exports.InvokeAgentPublicMessagePartKind$outboundSchema = exports.InvokeAgentPublicMessagePartKind$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.InvokeAgentPublicMessagePartKind$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.InvokeAgentPublicMessagePartKind$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.InvokeAgentPublicMessagePart$inboundSchema = z.union([
    components.TextPart$inboundSchema,
    z.lazy(() => exports.PublicMessagePartFilePart$inboundSchema),
    z.lazy(() => exports.PublicMessagePartToolResultPart$inboundSchema),
]);
/** @internal */
exports.InvokeAgentPublicMessagePart$outboundSchema = z.union([
    components.TextPart$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([
        components.TextPart$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([
        components.TextPart$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.InvokeAgentParts$inboundSchema = z.union([
    components.ToolCallPart$inboundSchema.and(z.object({ kind: z.literal("tool_call") }).transform((v) => ({
        kind: v.kind,
    }))),
    components.TextPart$inboundSchema.and(z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind }))),
    components.DataPart$inboundSchema.and(z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind }))),
    components.FilePart$inboundSchema.and(z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind }))),
    components.ToolResultPart$inboundSchema.and(z.object({ kind: z.literal("tool_result") }).transform((v) => ({
        kind: v.kind,
    }))),
]);
/** @internal */
exports.InvokeAgentParts$outboundSchema = z.union([
    components.ToolCallPart$outboundSchema.and(z.object({ kind: z.literal("tool_call") }).transform((v) => ({
        kind: v.kind,
    }))),
    components.TextPart$outboundSchema.and(z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind }))),
    components.DataPart$outboundSchema.and(z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind }))),
    components.FilePart$outboundSchema.and(z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind }))),
    components.ToolResultPart$outboundSchema.and(z.object({ kind: z.literal("tool_result") }).transform((v) => ({
        kind: v.kind,
    }))),
]);
function invokeAgentPartsToJSON(invokeAgentParts) {
    return JSON.stringify(exports.InvokeAgentParts$outboundSchema.parse(invokeAgentParts));
}
function invokeAgentPartsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InvokeAgentParts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvokeAgentParts' from JSON`);
}
/** @internal */
exports.TaskStatusMessage$inboundSchema = z.object({
    kind: exports.InvokeAgentAgentsKind$inboundSchema,
    messageId: z.string(),
    role: exports.ExtendedMessageRole$inboundSchema,
    parts: z.array(z.union([
        components.ToolCallPart$inboundSchema.and(z.object({ kind: z.literal("tool_call") }).transform((v) => ({
            kind: v.kind,
        }))),
        components.TextPart$inboundSchema.and(z.object({ kind: z.literal("text") }).transform((v) => ({
            kind: v.kind,
        }))),
        components.DataPart$inboundSchema.and(z.object({ kind: z.literal("data") }).transform((v) => ({
            kind: v.kind,
        }))),
        components.FilePart$inboundSchema.and(z.object({ kind: z.literal("file") }).transform((v) => ({
            kind: v.kind,
        }))),
        components.ToolResultPart$inboundSchema.and(z.object({ kind: z.literal("tool_result") }).transform((v) => ({
            kind: v.kind,
        }))),
    ])),
});
/** @internal */
exports.TaskStatusMessage$outboundSchema = z.object({
    kind: exports.InvokeAgentAgentsKind$outboundSchema,
    messageId: z.string(),
    role: exports.ExtendedMessageRole$outboundSchema,
    parts: z.array(z.union([
        components.ToolCallPart$outboundSchema.and(z.object({ kind: z.literal("tool_call") }).transform((v) => ({
            kind: v.kind,
        }))),
        components.TextPart$outboundSchema.and(z.object({ kind: z.literal("text") }).transform((v) => ({
            kind: v.kind,
        }))),
        components.DataPart$outboundSchema.and(z.object({ kind: z.literal("data") }).transform((v) => ({
            kind: v.kind,
        }))),
        components.FilePart$outboundSchema.and(z.object({ kind: z.literal("file") }).transform((v) => ({
            kind: v.kind,
        }))),
        components.ToolResultPart$outboundSchema.and(z.object({ kind: z.literal("tool_result") }).transform((v) => ({
            kind: v.kind,
        }))),
    ])),
});
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