"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.InvokeAgentA2ATaskResponse$inboundSchema = exports.TaskStatus$inboundSchema = exports.TaskStatusMessage$inboundSchema = exports.Parts$inboundSchema = exports.ExtendedMessageRole$inboundSchema = exports.InvokeAgentKind$inboundSchema = exports.TaskState$inboundSchema = exports.Kind$inboundSchema = exports.InvokeAgentRequest$outboundSchema = exports.InvokeAgentRequestBody$outboundSchema = exports.InvokeAgentMemory$outboundSchema = exports.InvokeAgentThread$outboundSchema = exports.InvokeAgentContact$outboundSchema = exports.InvokeAgentIdentity$outboundSchema = exports.InvokeAgentA2AMessage$outboundSchema = exports.InvokeAgentPublicMessagePart$outboundSchema = exports.InvokeAgentRole$outboundSchema = exports.InvokeAgentRoleUserMessage$outboundSchema = exports.InvokeAgentRoleToolMessage$outboundSchema = exports.ExtendedMessageRole = exports.InvokeAgentKind = exports.TaskState = exports.Kind = exports.InvokeAgentRoleUserMessage = exports.InvokeAgentRoleToolMessage = void 0;
exports.invokeAgentRoleToJSON = invokeAgentRoleToJSON;
exports.invokeAgentPublicMessagePartToJSON = invokeAgentPublicMessagePartToJSON;
exports.invokeAgentA2AMessageToJSON = invokeAgentA2AMessageToJSON;
exports.invokeAgentIdentityToJSON = invokeAgentIdentityToJSON;
exports.invokeAgentContactToJSON = invokeAgentContactToJSON;
exports.invokeAgentThreadToJSON = invokeAgentThreadToJSON;
exports.invokeAgentMemoryToJSON = invokeAgentMemoryToJSON;
exports.invokeAgentRequestBodyToJSON = invokeAgentRequestBodyToJSON;
exports.invokeAgentRequestToJSON = invokeAgentRequestToJSON;
exports.partsFromJSON = partsFromJSON;
exports.taskStatusMessageFromJSON = taskStatusMessageFromJSON;
exports.taskStatusFromJSON = taskStatusFromJSON;
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",
};
/**
 * A2A entity type identifier
 */
exports.Kind = {
    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.InvokeAgentKind = {
    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$outboundSchema = z.nativeEnum(exports.InvokeAgentRoleToolMessage);
/** @internal */
exports.InvokeAgentRoleUserMessage$outboundSchema = z.nativeEnum(exports.InvokeAgentRoleUserMessage);
/** @internal */
exports.InvokeAgentRole$outboundSchema = z.union([
    exports.InvokeAgentRoleUserMessage$outboundSchema,
    exports.InvokeAgentRoleToolMessage$outboundSchema,
]);
function invokeAgentRoleToJSON(invokeAgentRole) {
    return JSON.stringify(exports.InvokeAgentRole$outboundSchema.parse(invokeAgentRole));
}
/** @internal */
exports.InvokeAgentPublicMessagePart$outboundSchema = z.union([
    components.TextPart$outboundSchema,
    components.FilePart$outboundSchema,
    components.ToolResultPart$outboundSchema,
    components.ErrorPart$outboundSchema,
]);
function invokeAgentPublicMessagePartToJSON(invokeAgentPublicMessagePart) {
    return JSON.stringify(exports.InvokeAgentPublicMessagePart$outboundSchema.parse(invokeAgentPublicMessagePart));
}
/** @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,
        components.FilePart$outboundSchema,
        components.ToolResultPart$outboundSchema,
        components.ErrorPart$outboundSchema,
    ])),
});
function invokeAgentA2AMessageToJSON(invokeAgentA2AMessage) {
    return JSON.stringify(exports.InvokeAgentA2AMessage$outboundSchema.parse(invokeAgentA2AMessage));
}
/** @internal */
exports.InvokeAgentIdentity$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 invokeAgentIdentityToJSON(invokeAgentIdentity) {
    return JSON.stringify(exports.InvokeAgentIdentity$outboundSchema.parse(invokeAgentIdentity));
}
/** @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));
}
/** @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));
}
/** @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));
}
/** @internal */
exports.InvokeAgentRequestBody$outboundSchema = z.object({
    taskId: z.string().optional(),
    message: z.lazy(() => exports.InvokeAgentA2AMessage$outboundSchema),
    variables: z.record(z.any()).optional(),
    identity: z.lazy(() => exports.InvokeAgentIdentity$outboundSchema).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));
}
/** @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));
}
/** @internal */
exports.Kind$inboundSchema = z.nativeEnum(exports.Kind);
/** @internal */
exports.TaskState$inboundSchema = z
    .nativeEnum(exports.TaskState);
/** @internal */
exports.InvokeAgentKind$inboundSchema = z.nativeEnum(exports.InvokeAgentKind);
/** @internal */
exports.ExtendedMessageRole$inboundSchema = z.nativeEnum(exports.ExtendedMessageRole);
/** @internal */
exports.Parts$inboundSchema = z
    .union([
    components.TextPart$inboundSchema,
    components.ErrorPart$inboundSchema,
    components.DataPart$inboundSchema,
    components.FilePart$inboundSchema,
    components.ToolCallPart$inboundSchema,
    components.ToolResultPart$inboundSchema,
]);
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.InvokeAgentKind$inboundSchema,
    messageId: z.string(),
    role: exports.ExtendedMessageRole$inboundSchema,
    parts: z.array(z.union([
        components.TextPart$inboundSchema,
        components.ErrorPart$inboundSchema,
        components.DataPart$inboundSchema,
        components.FilePart$inboundSchema,
        components.ToolCallPart$inboundSchema,
        components.ToolResultPart$inboundSchema,
    ])),
});
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(),
});
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.Kind$inboundSchema,
    status: z.lazy(() => exports.TaskStatus$inboundSchema),
    metadata: z.record(z.any()).optional(),
});
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