/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ShellEnvironment, ShellEnvironment$inboundSchema, ShellEnvironment$Outbound, ShellEnvironment$outboundSchema, } from "./shellenvironment.js"; /** * Shell tool definition: Enables shell command execution in a managed container environment. */ export type ShellToolDefinition = { type: "shell"; environment?: ShellEnvironment | undefined; }; /** @internal */ export const ShellToolDefinition$inboundSchema: z.ZodType< ShellToolDefinition, z.ZodTypeDef, unknown > = z.object({ type: z.literal("shell"), environment: ShellEnvironment$inboundSchema.optional(), }); /** @internal */ export type ShellToolDefinition$Outbound = { type: "shell"; environment?: ShellEnvironment$Outbound | undefined; }; /** @internal */ export const ShellToolDefinition$outboundSchema: z.ZodType< ShellToolDefinition$Outbound, z.ZodTypeDef, ShellToolDefinition > = z.object({ type: z.literal("shell"), environment: ShellEnvironment$outboundSchema.optional(), }); export function shellToolDefinitionToJSON( shellToolDefinition: ShellToolDefinition, ): string { return JSON.stringify( ShellToolDefinition$outboundSchema.parse(shellToolDefinition), ); } export function shellToolDefinitionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ShellToolDefinition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ShellToolDefinition' from JSON`, ); }