/* * 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 { AcknowledgedSafetyCheck, AcknowledgedSafetyCheck$inboundSchema, AcknowledgedSafetyCheck$Outbound, AcknowledgedSafetyCheck$outboundSchema, } from "./acknowledgedsafetycheck.js"; import { ComputerScreenshot, ComputerScreenshot$inboundSchema, ComputerScreenshot$Outbound, ComputerScreenshot$outboundSchema, } from "./computerscreenshot.js"; import { Status, Status$inboundSchema, Status$outboundSchema, } from "./status.js"; /** * Computer call output item: Output emitted by a computer-use tool call, typically including screenshot data. */ export type ComputerToolCallOutput = { type: "computer_call_output"; callId: string; output: ComputerScreenshot; acknowledgedSafetyChecks?: Array | undefined; id?: string | undefined; /** * 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; }; /** @internal */ export const ComputerToolCallOutput$inboundSchema: z.ZodType< ComputerToolCallOutput, z.ZodTypeDef, unknown > = z.object({ type: z.literal("computer_call_output"), call_id: z.string(), output: ComputerScreenshot$inboundSchema, acknowledged_safety_checks: z.array(AcknowledgedSafetyCheck$inboundSchema) .optional(), id: z.string().optional(), status: Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "call_id": "callId", "acknowledged_safety_checks": "acknowledgedSafetyChecks", }); }); /** @internal */ export type ComputerToolCallOutput$Outbound = { type: "computer_call_output"; call_id: string; output: ComputerScreenshot$Outbound; acknowledged_safety_checks?: | Array | undefined; id?: string | undefined; status?: string | undefined; }; /** @internal */ export const ComputerToolCallOutput$outboundSchema: z.ZodType< ComputerToolCallOutput$Outbound, z.ZodTypeDef, ComputerToolCallOutput > = z.object({ type: z.literal("computer_call_output"), callId: z.string(), output: ComputerScreenshot$outboundSchema, acknowledgedSafetyChecks: z.array(AcknowledgedSafetyCheck$outboundSchema) .optional(), id: z.string().optional(), status: Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { callId: "call_id", acknowledgedSafetyChecks: "acknowledged_safety_checks", }); }); export function computerToolCallOutputToJSON( computerToolCallOutput: ComputerToolCallOutput, ): string { return JSON.stringify( ComputerToolCallOutput$outboundSchema.parse(computerToolCallOutput), ); } export function computerToolCallOutputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputerToolCallOutput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputerToolCallOutput' from JSON`, ); }