/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Status, Status$inboundSchema, Status$outboundSchema, } from "./status.js"; /** * Local shell call output item: The captured output payload returned by a local-shell tool call. */ export type LocalShellCallOutputWithId = { type: "local_shell_call_output"; /** * The unique ID of the message. */ id: string; output: string; /** * The processing status of an individual item. 'in_progress' means currently processing, 'completed' means finished successfully, 'incomplete' means processing stopped before completion. */ status?: Status | undefined; /** * The ID of the response that created this item, if any. */ responseId?: string | null | undefined; /** * Metadata from the response that created this item, if any. */ metadata?: { [k: string]: string } | null | undefined; }; /** @internal */ export const LocalShellCallOutputWithId$inboundSchema: z.ZodType< LocalShellCallOutputWithId, z.ZodTypeDef, unknown > = z.object({ type: z.literal("local_shell_call_output"), id: z.string(), output: z.string(), status: Status$inboundSchema.optional(), response_id: z.nullable(z.string()).optional(), metadata: z.nullable(z.record(z.string())).optional(), }).transform((v) => { return remap$(v, { "response_id": "responseId", }); }); /** @internal */ export type LocalShellCallOutputWithId$Outbound = { type: "local_shell_call_output"; id: string; output: string; status?: string | undefined; response_id?: string | null | undefined; metadata?: { [k: string]: string } | null | undefined; }; /** @internal */ export const LocalShellCallOutputWithId$outboundSchema: z.ZodType< LocalShellCallOutputWithId$Outbound, z.ZodTypeDef, LocalShellCallOutputWithId > = z.object({ type: z.literal("local_shell_call_output"), id: z.string(), output: z.string(), status: Status$outboundSchema.optional(), responseId: z.nullable(z.string()).optional(), metadata: z.nullable(z.record(z.string())).optional(), }).transform((v) => { return remap$(v, { responseId: "response_id", }); }); export function localShellCallOutputWithIdToJSON( localShellCallOutputWithId: LocalShellCallOutputWithId, ): string { return JSON.stringify( LocalShellCallOutputWithId$outboundSchema.parse(localShellCallOutputWithId), ); } export function localShellCallOutputWithIdFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LocalShellCallOutputWithId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LocalShellCallOutputWithId' from JSON`, ); }