"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.ToolExecutionFinishedStreamingEvent$inboundSchema = exports.ToolExecutionFinishedStreamingEventData$inboundSchema = exports.ToolExecutionFinishedStreamingEventToolExecutionContext$inboundSchema = exports.ToolExecutionFinishedStreamingEventMemory$inboundSchema = exports.ToolExecutionFinishedStreamingEventProduct$inboundSchema = exports.ToolExecutionFinishedStreamingEventProduct = void 0;
exports.toolExecutionFinishedStreamingEventMemoryFromJSON = toolExecutionFinishedStreamingEventMemoryFromJSON;
exports.toolExecutionFinishedStreamingEventToolExecutionContextFromJSON = toolExecutionFinishedStreamingEventToolExecutionContextFromJSON;
exports.toolExecutionFinishedStreamingEventDataFromJSON = toolExecutionFinishedStreamingEventDataFromJSON;
exports.toolExecutionFinishedStreamingEventFromJSON = toolExecutionFinishedStreamingEventFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * Orquesta product
 */
exports.ToolExecutionFinishedStreamingEventProduct = {
    Remoteconfigs: "remoteconfigs",
    Deployments: "deployments",
    Experiments: "experiments",
    Playgrounds: "playgrounds",
    Spreadsheets: "spreadsheets",
    SpreadsheetRun: "spreadsheet_run",
    LlmEvaluator: "llm_evaluator",
    Knowledge: "knowledge",
    Router: "router",
    Workflows: "workflows",
    ExternalEvents: "external_events",
    Agents: "agents",
    MemoryStores: "memory-stores",
    Generic: "generic",
    Evaluators: "evaluators",
    Otel: "otel",
    AiChat: "ai-chat",
};
/** @internal */
exports.ToolExecutionFinishedStreamingEventProduct$inboundSchema = z
    .nativeEnum(exports.ToolExecutionFinishedStreamingEventProduct);
/** @internal */
exports.ToolExecutionFinishedStreamingEventMemory$inboundSchema = z.object({
    entity_id: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "entity_id": "entityId",
    });
});
function toolExecutionFinishedStreamingEventMemoryFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ToolExecutionFinishedStreamingEventMemory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionFinishedStreamingEventMemory' from JSON`);
}
/** @internal */
exports.ToolExecutionFinishedStreamingEventToolExecutionContext$inboundSchema = z.object({
    action_id: z.string(),
    agent_tool_call_id: z.string(),
    workspace_id: z.string(),
    agent_manifest_id: z.string(),
    agent_execution_id: z.string(),
    product: exports.ToolExecutionFinishedStreamingEventProduct$inboundSchema,
    memory: z.lazy(() => exports.ToolExecutionFinishedStreamingEventMemory$inboundSchema).optional(),
    parent_id: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "action_id": "actionId",
        "agent_tool_call_id": "agentToolCallId",
        "workspace_id": "workspaceId",
        "agent_manifest_id": "agentManifestId",
        "agent_execution_id": "agentExecutionId",
        "parent_id": "parentId",
    });
});
function toolExecutionFinishedStreamingEventToolExecutionContextFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ToolExecutionFinishedStreamingEventToolExecutionContext$inboundSchema
        .parse(JSON.parse(x)), `Failed to parse 'ToolExecutionFinishedStreamingEventToolExecutionContext' from JSON`);
}
/** @internal */
exports.ToolExecutionFinishedStreamingEventData$inboundSchema = z.object({
    result: z.any().optional(),
    action_type: z.string(),
    tool_execution_context: z.lazy(() => exports.ToolExecutionFinishedStreamingEventToolExecutionContext$inboundSchema),
    responseId: z.string().optional(),
    workflowRunId: z.string(),
    stream: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "action_type": "actionType",
        "tool_execution_context": "toolExecutionContext",
    });
});
function toolExecutionFinishedStreamingEventDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ToolExecutionFinishedStreamingEventData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionFinishedStreamingEventData' from JSON`);
}
/** @internal */
exports.ToolExecutionFinishedStreamingEvent$inboundSchema = z.object({
    type: z.literal("event.workflow_events.tool_execution_finished"),
    timestamp: z.string(),
    data: z.lazy(() => exports.ToolExecutionFinishedStreamingEventData$inboundSchema),
});
function toolExecutionFinishedStreamingEventFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ToolExecutionFinishedStreamingEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionFinishedStreamingEvent' from JSON`);
}
//# sourceMappingURL=toolexecutionfinishedstreamingevent.js.map