/* * 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 { LocalShellAction, LocalShellAction$inboundSchema, LocalShellAction$Outbound, LocalShellAction$outboundSchema, } from "./localshellaction.js"; /** * Local shell call item: A local-shell execution request with command details and execution status. */ export type LocalShellCallWithId = { type: "local_shell_call"; /** * The unique ID of the message. */ id: string; callId: string; action: LocalShellAction; status: string; /** * 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 LocalShellCallWithId$inboundSchema: z.ZodType< LocalShellCallWithId, z.ZodTypeDef, unknown > = z.object({ type: z.literal("local_shell_call"), id: z.string(), call_id: z.string(), action: LocalShellAction$inboundSchema, status: z.string(), response_id: z.nullable(z.string()).optional(), metadata: z.nullable(z.record(z.string())).optional(), }).transform((v) => { return remap$(v, { "call_id": "callId", "response_id": "responseId", }); }); /** @internal */ export type LocalShellCallWithId$Outbound = { type: "local_shell_call"; id: string; call_id: string; action: LocalShellAction$Outbound; status: string; response_id?: string | null | undefined; metadata?: { [k: string]: string } | null | undefined; }; /** @internal */ export const LocalShellCallWithId$outboundSchema: z.ZodType< LocalShellCallWithId$Outbound, z.ZodTypeDef, LocalShellCallWithId > = z.object({ type: z.literal("local_shell_call"), id: z.string(), callId: z.string(), action: LocalShellAction$outboundSchema, status: z.string(), responseId: z.nullable(z.string()).optional(), metadata: z.nullable(z.record(z.string())).optional(), }).transform((v) => { return remap$(v, { callId: "call_id", responseId: "response_id", }); }); export function localShellCallWithIdToJSON( localShellCallWithId: LocalShellCallWithId, ): string { return JSON.stringify( LocalShellCallWithId$outboundSchema.parse(localShellCallWithId), ); } export function localShellCallWithIdFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LocalShellCallWithId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LocalShellCallWithId' from JSON`, ); }