/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: b7821f77423b */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export const AgentSessionStepEventStatus = { InProgress: "in_progress", Complete: "complete", Error: "error", } as const; export type AgentSessionStepEventStatus = ClosedEnum< typeof AgentSessionStepEventStatus >; export type AgentSessionStepEventPayload = { stepId: string; title: string; status: AgentSessionStepEventStatus; }; export type AgentSessionStepEvent = { seq: number; createdAt: string; type: "step"; payload: AgentSessionStepEventPayload; }; /** @internal */ export const AgentSessionStepEventStatus$inboundSchema: z.ZodEnum< typeof AgentSessionStepEventStatus > = z.enum(AgentSessionStepEventStatus); /** @internal */ export const AgentSessionStepEventPayload$inboundSchema: z.ZodType< AgentSessionStepEventPayload, unknown > = z.object({ stepId: z.string(), title: z.string(), status: AgentSessionStepEventStatus$inboundSchema, }); export function agentSessionStepEventPayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentSessionStepEventPayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentSessionStepEventPayload' from JSON`, ); } /** @internal */ export const AgentSessionStepEvent$inboundSchema: z.ZodType< AgentSessionStepEvent, unknown > = z.object({ seq: z.number(), createdAt: z.string(), type: z.literal("step"), payload: z.lazy(() => AgentSessionStepEventPayload$inboundSchema), }); export function agentSessionStepEventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentSessionStepEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentSessionStepEvent' from JSON`, ); }