/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 4346fb1a3f7c
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { smartUnion } from "../../types/smartUnion.js";
import { BuiltInConnectors$inboundSchema, } from "./builtinconnectors.js";
/** @internal */
export const ToolExecutionStartedEventName$inboundSchema = smartUnion([BuiltInConnectors$inboundSchema, z.string()]);
export function toolExecutionStartedEventNameFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolExecutionStartedEventName$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionStartedEventName' from JSON`);
}
/** @internal */
export const ToolExecutionStartedEvent$inboundSchema = z.object({
    type: z.literal("tool.execution.started"),
    created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    output_index: z.int().default(0),
    id: z.string(),
    model: z.nullable(z.string()).optional(),
    agent_id: z.nullable(z.string()).optional(),
    name: smartUnion([BuiltInConnectors$inboundSchema, z.string()]),
    arguments: z.string(),
}).transform((v) => {
    return remap$(v, {
        "created_at": "createdAt",
        "output_index": "outputIndex",
        "agent_id": "agentId",
    });
});
export function toolExecutionStartedEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolExecutionStartedEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionStartedEvent' from JSON`);
}
//# sourceMappingURL=toolexecutionstartedevent.js.map