/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 7b423155b914 */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { AgentSessionApprovalGrantedEvent, AgentSessionApprovalGrantedEvent$inboundSchema, } from "./agentsessionapprovalgrantedevent.js"; import { AgentSessionApprovalRequestedEvent, AgentSessionApprovalRequestedEvent$inboundSchema, } from "./agentsessionapprovalrequestedevent.js"; import { AgentSessionEventsTruncatedEvent, AgentSessionEventsTruncatedEvent$inboundSchema, } from "./agentsessioneventstruncatedevent.js"; import { AgentSessionMarkdownEvent, AgentSessionMarkdownEvent$inboundSchema, } from "./agentsessionmarkdownevent.js"; import { AgentSessionRestartedEvent, AgentSessionRestartedEvent$inboundSchema, } from "./agentsessionrestartedevent.js"; import { AgentSessionStatusEvent, AgentSessionStatusEvent$inboundSchema, } from "./agentsessionstatusevent.js"; import { AgentSessionStepEvent, AgentSessionStepEvent$inboundSchema, } from "./agentsessionstepevent.js"; import { AgentSessionToolCallEvent, AgentSessionToolCallEvent$inboundSchema, } from "./agentsessiontoolcallevent.js"; import { AgentSessionToolResultEvent, AgentSessionToolResultEvent$inboundSchema, } from "./agentsessiontoolresultevent.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type AgentSessionEvent = | AgentSessionStatusEvent | AgentSessionStepEvent | AgentSessionToolCallEvent | AgentSessionToolResultEvent | AgentSessionMarkdownEvent | AgentSessionApprovalRequestedEvent | AgentSessionApprovalGrantedEvent | AgentSessionRestartedEvent | AgentSessionEventsTruncatedEvent; /** @internal */ export const AgentSessionEvent$inboundSchema: z.ZodType< AgentSessionEvent, unknown > = z.union([ AgentSessionStatusEvent$inboundSchema, AgentSessionStepEvent$inboundSchema, AgentSessionToolCallEvent$inboundSchema, AgentSessionToolResultEvent$inboundSchema, AgentSessionMarkdownEvent$inboundSchema, AgentSessionApprovalRequestedEvent$inboundSchema, AgentSessionApprovalGrantedEvent$inboundSchema, AgentSessionRestartedEvent$inboundSchema, AgentSessionEventsTruncatedEvent$inboundSchema, ]); export function agentSessionEventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentSessionEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentSessionEvent' from JSON`, ); }