/* * 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 LocalShellCall = { type: "local_shell_call"; id: string; callId: string; action: LocalShellAction; status: string; }; /** @internal */ export const LocalShellCall$inboundSchema: z.ZodType< LocalShellCall, z.ZodTypeDef, unknown > = z.object({ type: z.literal("local_shell_call"), id: z.string(), call_id: z.string(), action: LocalShellAction$inboundSchema, status: z.string(), }).transform((v) => { return remap$(v, { "call_id": "callId", }); }); /** @internal */ export type LocalShellCall$Outbound = { type: "local_shell_call"; id: string; call_id: string; action: LocalShellAction$Outbound; status: string; }; /** @internal */ export const LocalShellCall$outboundSchema: z.ZodType< LocalShellCall$Outbound, z.ZodTypeDef, LocalShellCall > = z.object({ type: z.literal("local_shell_call"), id: z.string(), callId: z.string(), action: LocalShellAction$outboundSchema, status: z.string(), }).transform((v) => { return remap$(v, { callId: "call_id", }); }); export function localShellCallToJSON(localShellCall: LocalShellCall): string { return JSON.stringify(LocalShellCall$outboundSchema.parse(localShellCall)); } export function localShellCallFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LocalShellCall$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LocalShellCall' from JSON`, ); }