/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { FileSearchComparisonFilter, FileSearchComparisonFilter$inboundSchema, FileSearchComparisonFilter$Outbound, FileSearchComparisonFilter$outboundSchema, } from "./filesearchcomparisonfilter.js"; import { FileSearchCompoundFilter, FileSearchCompoundFilter$inboundSchema, FileSearchCompoundFilter$Outbound, FileSearchCompoundFilter$outboundSchema, } from "./filesearchcompoundfilter.js"; import { MCPToolFilter, MCPToolFilter$inboundSchema, MCPToolFilter$Outbound, MCPToolFilter$outboundSchema, } from "./mcptoolfilter.js"; export const ToolDefinition7Type = { Shell: "shell", } as const; export type ToolDefinition7Type = ClosedEnum; export const ToolDefinitionEnvironmentAccess = { ReadOnly: "read_only", ReadWrite: "read_write", } as const; export type ToolDefinitionEnvironmentAccess = ClosedEnum< typeof ToolDefinitionEnvironmentAccess >; export type EnvironmentMemoryStores = { storeId: string; label: string; access?: ToolDefinitionEnvironmentAccess | undefined; description?: string | undefined; instructions?: string | undefined; }; export type Environment2 = { type: "container_reference"; containerId: string; /** * Arbitrary JSON value. */ networkPolicy?: any | undefined; skills?: Array | undefined; memoryStores?: Array | undefined; }; export const EnvironmentAccess = { ReadOnly: "read_only", ReadWrite: "read_write", } as const; export type EnvironmentAccess = ClosedEnum; export type MemoryStores = { storeId: string; label: string; access?: EnvironmentAccess | undefined; description?: string | undefined; instructions?: string | undefined; }; export type Environment1 = { type: "container_auto"; /** * Arbitrary JSON value. */ networkPolicy?: any | undefined; skills?: Array | undefined; memoryStores?: Array | undefined; }; export type Environment = Environment1 | Environment2; export type Seven = { type: ToolDefinition7Type; environment?: Environment1 | Environment2 | undefined; }; export const ToolDefinition6Type = { Sleep: "sleep", } as const; export type ToolDefinition6Type = ClosedEnum; export type ToolDefinition6 = { type: ToolDefinition6Type; }; export const ToolDefinition5Type = { FileSearch: "file_search", CodeInterpreter: "code_interpreter", ImageGeneration: "image_generation", ComputerUsePreview: "computer_use_preview", } as const; export type ToolDefinition5Type = ClosedEnum; export type ToolDefinition5 = { type: ToolDefinition5Type; }; export const ToolDefinition4Type = { FileSearch: "file_search", } as const; export type ToolDefinition4Type = ClosedEnum; export type ToolDefinition4Filters = | (FileSearchComparisonFilter & { type: "eq" }) | (FileSearchComparisonFilter & { type: "ne" }) | (FileSearchComparisonFilter & { type: "gt" }) | (FileSearchComparisonFilter & { type: "gte" }) | (FileSearchComparisonFilter & { type: "lt" }) | (FileSearchComparisonFilter & { type: "lte" }) | (FileSearchCompoundFilter & { type: "and" }) | (FileSearchCompoundFilter & { type: "or" }); export type ToolDefinitionRankingOptions = { ranker?: string | undefined; scoreThreshold?: number | undefined; }; export type ToolDefinition4 = { type: ToolDefinition4Type; vectorStoreIds: Array; filters?: | (FileSearchComparisonFilter & { type: "eq" }) | (FileSearchComparisonFilter & { type: "ne" }) | (FileSearchComparisonFilter & { type: "gt" }) | (FileSearchComparisonFilter & { type: "gte" }) | (FileSearchComparisonFilter & { type: "lt" }) | (FileSearchComparisonFilter & { type: "lte" }) | (FileSearchCompoundFilter & { type: "and" }) | (FileSearchCompoundFilter & { type: "or" }) | undefined; maxNumResults?: number | undefined; rankingOptions?: ToolDefinitionRankingOptions | undefined; }; export const ToolDefinition3Type = { Mcp: "mcp", } as const; export type ToolDefinition3Type = ClosedEnum; export type ToolDefinitionRequireApproval2 = { always?: MCPToolFilter | undefined; never?: MCPToolFilter | undefined; }; export const ToolDefinitionRequireApproval1 = { Always: "always", Never: "never", } as const; export type ToolDefinitionRequireApproval1 = ClosedEnum< typeof ToolDefinitionRequireApproval1 >; export type ThreeRequireApproval = | ToolDefinitionRequireApproval1 | ToolDefinitionRequireApproval2; export type ToolDefinition3AllowedTools = Array | MCPToolFilter; export type Three2 = { type: ToolDefinition3Type; serverLabel?: string | undefined; mcpServerId: string; mcpCredentialId?: string | undefined; serverUrl?: string | undefined; serverDescription?: string | undefined; authorization?: string | undefined; requireApproval?: | ToolDefinitionRequireApproval1 | ToolDefinitionRequireApproval2 | undefined; allowedTools?: Array | MCPToolFilter | undefined; headers?: { [k: string]: string } | undefined; }; export const ThreeType = { Mcp: "mcp", } as const; export type ThreeType = ClosedEnum; export type RequireApproval2 = { always?: MCPToolFilter | undefined; never?: MCPToolFilter | undefined; }; export const RequireApproval1 = { Always: "always", Never: "never", } as const; export type RequireApproval1 = ClosedEnum; export type RequireApproval = RequireApproval1 | RequireApproval2; export type ThreeAllowedTools = Array | MCPToolFilter; export type Three1 = { type: ThreeType; serverLabel: string; mcpServerId?: string | undefined; mcpCredentialId?: string | undefined; serverUrl?: string | undefined; serverDescription?: string | undefined; authorization?: string | undefined; requireApproval?: RequireApproval1 | RequireApproval2 | undefined; allowedTools?: Array | MCPToolFilter | undefined; headers?: { [k: string]: string } | undefined; }; export type ToolDefinition3 = Three1 | Three2; export const ToolDefinition2Type = { Function: "function", } as const; export type ToolDefinition2Type = ClosedEnum; export type ToolDefinition2 = { type: ToolDefinition2Type; name: string; description?: string | undefined; strict?: boolean | undefined; deferLoading?: boolean | undefined; parameters: { [k: string]: any }; }; export const ToolDefinitionType = { WebSearch: "web_search", WebSearch20250826: "web_search_2025_08_26", WebSearchPreview: "web_search_preview", WebSearchPreview20250311: "web_search_preview_2025_03_11", } as const; export type ToolDefinitionType = ClosedEnum; export const ToolDefinitionSearchContextSize = { Low: "low", Medium: "medium", High: "high", } as const; export type ToolDefinitionSearchContextSize = ClosedEnum< typeof ToolDefinitionSearchContextSize >; export const ToolDefinition1Type = { Approximate: "approximate", } as const; export type ToolDefinition1Type = ClosedEnum; export type ToolDefinitionUserLocation = { type?: ToolDefinition1Type | undefined; city?: string | undefined; country?: string | undefined; region?: string | undefined; timezone?: string | undefined; }; export type ToolDefinitionFilters = { allowedDomains?: Array | undefined; }; export type ToolDefinition1 = { type: ToolDefinitionType; searchContextSize?: ToolDefinitionSearchContextSize | undefined; userLocation?: ToolDefinitionUserLocation | undefined; filters?: ToolDefinitionFilters | undefined; }; export type ToolDefinition = | ToolDefinition2 | ToolDefinition4 | ToolDefinition1 | ToolDefinition5 | ToolDefinition6 | Seven | Three1 | Three2; /** @internal */ export const ToolDefinition7Type$inboundSchema: z.ZodNativeEnum< typeof ToolDefinition7Type > = z.nativeEnum(ToolDefinition7Type); /** @internal */ export const ToolDefinition7Type$outboundSchema: z.ZodNativeEnum< typeof ToolDefinition7Type > = ToolDefinition7Type$inboundSchema; /** @internal */ export const ToolDefinitionEnvironmentAccess$inboundSchema: z.ZodNativeEnum< typeof ToolDefinitionEnvironmentAccess > = z.nativeEnum(ToolDefinitionEnvironmentAccess); /** @internal */ export const ToolDefinitionEnvironmentAccess$outboundSchema: z.ZodNativeEnum< typeof ToolDefinitionEnvironmentAccess > = ToolDefinitionEnvironmentAccess$inboundSchema; /** @internal */ export const EnvironmentMemoryStores$inboundSchema: z.ZodType< EnvironmentMemoryStores, z.ZodTypeDef, unknown > = z.object({ store_id: z.string(), label: z.string(), access: ToolDefinitionEnvironmentAccess$inboundSchema.default("read_only"), description: z.string().optional(), instructions: z.string().optional(), }).transform((v) => { return remap$(v, { "store_id": "storeId", }); }); /** @internal */ export type EnvironmentMemoryStores$Outbound = { store_id: string; label: string; access: string; description?: string | undefined; instructions?: string | undefined; }; /** @internal */ export const EnvironmentMemoryStores$outboundSchema: z.ZodType< EnvironmentMemoryStores$Outbound, z.ZodTypeDef, EnvironmentMemoryStores > = z.object({ storeId: z.string(), label: z.string(), access: ToolDefinitionEnvironmentAccess$outboundSchema.default("read_only"), description: z.string().optional(), instructions: z.string().optional(), }).transform((v) => { return remap$(v, { storeId: "store_id", }); }); export function environmentMemoryStoresToJSON( environmentMemoryStores: EnvironmentMemoryStores, ): string { return JSON.stringify( EnvironmentMemoryStores$outboundSchema.parse(environmentMemoryStores), ); } export function environmentMemoryStoresFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EnvironmentMemoryStores$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentMemoryStores' from JSON`, ); } /** @internal */ export const Environment2$inboundSchema: z.ZodType< Environment2, z.ZodTypeDef, unknown > = z.object({ type: z.literal("container_reference"), container_id: z.string(), network_policy: z.any().optional(), skills: z.array(z.any()).optional(), memory_stores: z.array(z.lazy(() => EnvironmentMemoryStores$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "container_id": "containerId", "network_policy": "networkPolicy", "memory_stores": "memoryStores", }); }); /** @internal */ export type Environment2$Outbound = { type: "container_reference"; container_id: string; network_policy?: any | undefined; skills?: Array | undefined; memory_stores?: Array | undefined; }; /** @internal */ export const Environment2$outboundSchema: z.ZodType< Environment2$Outbound, z.ZodTypeDef, Environment2 > = z.object({ type: z.literal("container_reference"), containerId: z.string(), networkPolicy: z.any().optional(), skills: z.array(z.any()).optional(), memoryStores: z.array(z.lazy(() => EnvironmentMemoryStores$outboundSchema)) .optional(), }).transform((v) => { return remap$(v, { containerId: "container_id", networkPolicy: "network_policy", memoryStores: "memory_stores", }); }); export function environment2ToJSON(environment2: Environment2): string { return JSON.stringify(Environment2$outboundSchema.parse(environment2)); } export function environment2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Environment2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Environment2' from JSON`, ); } /** @internal */ export const EnvironmentAccess$inboundSchema: z.ZodNativeEnum< typeof EnvironmentAccess > = z.nativeEnum(EnvironmentAccess); /** @internal */ export const EnvironmentAccess$outboundSchema: z.ZodNativeEnum< typeof EnvironmentAccess > = EnvironmentAccess$inboundSchema; /** @internal */ export const MemoryStores$inboundSchema: z.ZodType< MemoryStores, z.ZodTypeDef, unknown > = z.object({ store_id: z.string(), label: z.string(), access: EnvironmentAccess$inboundSchema.default("read_only"), description: z.string().optional(), instructions: z.string().optional(), }).transform((v) => { return remap$(v, { "store_id": "storeId", }); }); /** @internal */ export type MemoryStores$Outbound = { store_id: string; label: string; access: string; description?: string | undefined; instructions?: string | undefined; }; /** @internal */ export const MemoryStores$outboundSchema: z.ZodType< MemoryStores$Outbound, z.ZodTypeDef, MemoryStores > = z.object({ storeId: z.string(), label: z.string(), access: EnvironmentAccess$outboundSchema.default("read_only"), description: z.string().optional(), instructions: z.string().optional(), }).transform((v) => { return remap$(v, { storeId: "store_id", }); }); export function memoryStoresToJSON(memoryStores: MemoryStores): string { return JSON.stringify(MemoryStores$outboundSchema.parse(memoryStores)); } export function memoryStoresFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MemoryStores$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MemoryStores' from JSON`, ); } /** @internal */ export const Environment1$inboundSchema: z.ZodType< Environment1, z.ZodTypeDef, unknown > = z.object({ type: z.literal("container_auto"), network_policy: z.any().optional(), skills: z.array(z.any()).optional(), memory_stores: z.array(z.lazy(() => MemoryStores$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "network_policy": "networkPolicy", "memory_stores": "memoryStores", }); }); /** @internal */ export type Environment1$Outbound = { type: "container_auto"; network_policy?: any | undefined; skills?: Array | undefined; memory_stores?: Array | undefined; }; /** @internal */ export const Environment1$outboundSchema: z.ZodType< Environment1$Outbound, z.ZodTypeDef, Environment1 > = z.object({ type: z.literal("container_auto"), networkPolicy: z.any().optional(), skills: z.array(z.any()).optional(), memoryStores: z.array(z.lazy(() => MemoryStores$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { networkPolicy: "network_policy", memoryStores: "memory_stores", }); }); export function environment1ToJSON(environment1: Environment1): string { return JSON.stringify(Environment1$outboundSchema.parse(environment1)); } export function environment1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Environment1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Environment1' from JSON`, ); } /** @internal */ export const Environment$inboundSchema: z.ZodType< Environment, z.ZodTypeDef, unknown > = z.union([ z.lazy(() => Environment1$inboundSchema), z.lazy(() => Environment2$inboundSchema), ]); /** @internal */ export type Environment$Outbound = | Environment1$Outbound | Environment2$Outbound; /** @internal */ export const Environment$outboundSchema: z.ZodType< Environment$Outbound, z.ZodTypeDef, Environment > = z.union([ z.lazy(() => Environment1$outboundSchema), z.lazy(() => Environment2$outboundSchema), ]); export function environmentToJSON(environment: Environment): string { return JSON.stringify(Environment$outboundSchema.parse(environment)); } export function environmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Environment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Environment' from JSON`, ); } /** @internal */ export const Seven$inboundSchema: z.ZodType = z .object({ type: ToolDefinition7Type$inboundSchema, environment: z.union([ z.lazy(() => Environment1$inboundSchema), z.lazy(() => Environment2$inboundSchema), ]).optional(), }); /** @internal */ export type Seven$Outbound = { type: string; environment?: Environment1$Outbound | Environment2$Outbound | undefined; }; /** @internal */ export const Seven$outboundSchema: z.ZodType< Seven$Outbound, z.ZodTypeDef, Seven > = z.object({ type: ToolDefinition7Type$outboundSchema, environment: z.union([ z.lazy(() => Environment1$outboundSchema), z.lazy(() => Environment2$outboundSchema), ]).optional(), }); export function sevenToJSON(seven: Seven): string { return JSON.stringify(Seven$outboundSchema.parse(seven)); } export function sevenFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Seven$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Seven' from JSON`, ); } /** @internal */ export const ToolDefinition6Type$inboundSchema: z.ZodNativeEnum< typeof ToolDefinition6Type > = z.nativeEnum(ToolDefinition6Type); /** @internal */ export const ToolDefinition6Type$outboundSchema: z.ZodNativeEnum< typeof ToolDefinition6Type > = ToolDefinition6Type$inboundSchema; /** @internal */ export const ToolDefinition6$inboundSchema: z.ZodType< ToolDefinition6, z.ZodTypeDef, unknown > = z.object({ type: ToolDefinition6Type$inboundSchema, }); /** @internal */ export type ToolDefinition6$Outbound = { type: string; }; /** @internal */ export const ToolDefinition6$outboundSchema: z.ZodType< ToolDefinition6$Outbound, z.ZodTypeDef, ToolDefinition6 > = z.object({ type: ToolDefinition6Type$outboundSchema, }); export function toolDefinition6ToJSON( toolDefinition6: ToolDefinition6, ): string { return JSON.stringify(ToolDefinition6$outboundSchema.parse(toolDefinition6)); } export function toolDefinition6FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinition6$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinition6' from JSON`, ); } /** @internal */ export const ToolDefinition5Type$inboundSchema: z.ZodNativeEnum< typeof ToolDefinition5Type > = z.nativeEnum(ToolDefinition5Type); /** @internal */ export const ToolDefinition5Type$outboundSchema: z.ZodNativeEnum< typeof ToolDefinition5Type > = ToolDefinition5Type$inboundSchema; /** @internal */ export const ToolDefinition5$inboundSchema: z.ZodType< ToolDefinition5, z.ZodTypeDef, unknown > = z.object({ type: ToolDefinition5Type$inboundSchema, }); /** @internal */ export type ToolDefinition5$Outbound = { type: string; }; /** @internal */ export const ToolDefinition5$outboundSchema: z.ZodType< ToolDefinition5$Outbound, z.ZodTypeDef, ToolDefinition5 > = z.object({ type: ToolDefinition5Type$outboundSchema, }); export function toolDefinition5ToJSON( toolDefinition5: ToolDefinition5, ): string { return JSON.stringify(ToolDefinition5$outboundSchema.parse(toolDefinition5)); } export function toolDefinition5FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinition5$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinition5' from JSON`, ); } /** @internal */ export const ToolDefinition4Type$inboundSchema: z.ZodNativeEnum< typeof ToolDefinition4Type > = z.nativeEnum(ToolDefinition4Type); /** @internal */ export const ToolDefinition4Type$outboundSchema: z.ZodNativeEnum< typeof ToolDefinition4Type > = ToolDefinition4Type$inboundSchema; /** @internal */ export const ToolDefinition4Filters$inboundSchema: z.ZodType< ToolDefinition4Filters, z.ZodTypeDef, unknown > = z.union([ FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("eq") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("ne") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("gt") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("gte") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("lt") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("lte") }), ), FileSearchCompoundFilter$inboundSchema.and( z.object({ type: z.literal("and") }), ), FileSearchCompoundFilter$inboundSchema.and( z.object({ type: z.literal("or") }), ), ]); /** @internal */ export type ToolDefinition4Filters$Outbound = | (FileSearchComparisonFilter$Outbound & { type: "eq" }) | (FileSearchComparisonFilter$Outbound & { type: "ne" }) | (FileSearchComparisonFilter$Outbound & { type: "gt" }) | (FileSearchComparisonFilter$Outbound & { type: "gte" }) | (FileSearchComparisonFilter$Outbound & { type: "lt" }) | (FileSearchComparisonFilter$Outbound & { type: "lte" }) | (FileSearchCompoundFilter$Outbound & { type: "and" }) | (FileSearchCompoundFilter$Outbound & { type: "or" }); /** @internal */ export const ToolDefinition4Filters$outboundSchema: z.ZodType< ToolDefinition4Filters$Outbound, z.ZodTypeDef, ToolDefinition4Filters > = z.union([ FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("eq") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("ne") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("gt") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("gte") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("lt") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("lte") }), ), FileSearchCompoundFilter$outboundSchema.and( z.object({ type: z.literal("and") }), ), FileSearchCompoundFilter$outboundSchema.and( z.object({ type: z.literal("or") }), ), ]); export function toolDefinition4FiltersToJSON( toolDefinition4Filters: ToolDefinition4Filters, ): string { return JSON.stringify( ToolDefinition4Filters$outboundSchema.parse(toolDefinition4Filters), ); } export function toolDefinition4FiltersFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinition4Filters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinition4Filters' from JSON`, ); } /** @internal */ export const ToolDefinitionRankingOptions$inboundSchema: z.ZodType< ToolDefinitionRankingOptions, z.ZodTypeDef, unknown > = z.object({ ranker: z.string().optional(), score_threshold: z.number().optional(), }).transform((v) => { return remap$(v, { "score_threshold": "scoreThreshold", }); }); /** @internal */ export type ToolDefinitionRankingOptions$Outbound = { ranker?: string | undefined; score_threshold?: number | undefined; }; /** @internal */ export const ToolDefinitionRankingOptions$outboundSchema: z.ZodType< ToolDefinitionRankingOptions$Outbound, z.ZodTypeDef, ToolDefinitionRankingOptions > = z.object({ ranker: z.string().optional(), scoreThreshold: z.number().optional(), }).transform((v) => { return remap$(v, { scoreThreshold: "score_threshold", }); }); export function toolDefinitionRankingOptionsToJSON( toolDefinitionRankingOptions: ToolDefinitionRankingOptions, ): string { return JSON.stringify( ToolDefinitionRankingOptions$outboundSchema.parse( toolDefinitionRankingOptions, ), ); } export function toolDefinitionRankingOptionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinitionRankingOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinitionRankingOptions' from JSON`, ); } /** @internal */ export const ToolDefinition4$inboundSchema: z.ZodType< ToolDefinition4, z.ZodTypeDef, unknown > = z.object({ type: ToolDefinition4Type$inboundSchema, vector_store_ids: z.array(z.string()), filters: z.union([ FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("eq") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("ne") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("gt") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("gte") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("lt") }), ), FileSearchComparisonFilter$inboundSchema.and( z.object({ type: z.literal("lte") }), ), FileSearchCompoundFilter$inboundSchema.and( z.object({ type: z.literal("and") }), ), FileSearchCompoundFilter$inboundSchema.and( z.object({ type: z.literal("or") }), ), ]).optional(), max_num_results: z.number().int().optional(), ranking_options: z.lazy(() => ToolDefinitionRankingOptions$inboundSchema) .optional(), }).transform((v) => { return remap$(v, { "vector_store_ids": "vectorStoreIds", "max_num_results": "maxNumResults", "ranking_options": "rankingOptions", }); }); /** @internal */ export type ToolDefinition4$Outbound = { type: string; vector_store_ids: Array; filters?: | (FileSearchComparisonFilter$Outbound & { type: "eq" }) | (FileSearchComparisonFilter$Outbound & { type: "ne" }) | (FileSearchComparisonFilter$Outbound & { type: "gt" }) | (FileSearchComparisonFilter$Outbound & { type: "gte" }) | (FileSearchComparisonFilter$Outbound & { type: "lt" }) | (FileSearchComparisonFilter$Outbound & { type: "lte" }) | (FileSearchCompoundFilter$Outbound & { type: "and" }) | (FileSearchCompoundFilter$Outbound & { type: "or" }) | undefined; max_num_results?: number | undefined; ranking_options?: ToolDefinitionRankingOptions$Outbound | undefined; }; /** @internal */ export const ToolDefinition4$outboundSchema: z.ZodType< ToolDefinition4$Outbound, z.ZodTypeDef, ToolDefinition4 > = z.object({ type: ToolDefinition4Type$outboundSchema, vectorStoreIds: z.array(z.string()), filters: z.union([ FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("eq") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("ne") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("gt") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("gte") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("lt") }), ), FileSearchComparisonFilter$outboundSchema.and( z.object({ type: z.literal("lte") }), ), FileSearchCompoundFilter$outboundSchema.and( z.object({ type: z.literal("and") }), ), FileSearchCompoundFilter$outboundSchema.and( z.object({ type: z.literal("or") }), ), ]).optional(), maxNumResults: z.number().int().optional(), rankingOptions: z.lazy(() => ToolDefinitionRankingOptions$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { vectorStoreIds: "vector_store_ids", maxNumResults: "max_num_results", rankingOptions: "ranking_options", }); }); export function toolDefinition4ToJSON( toolDefinition4: ToolDefinition4, ): string { return JSON.stringify(ToolDefinition4$outboundSchema.parse(toolDefinition4)); } export function toolDefinition4FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinition4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinition4' from JSON`, ); } /** @internal */ export const ToolDefinition3Type$inboundSchema: z.ZodNativeEnum< typeof ToolDefinition3Type > = z.nativeEnum(ToolDefinition3Type); /** @internal */ export const ToolDefinition3Type$outboundSchema: z.ZodNativeEnum< typeof ToolDefinition3Type > = ToolDefinition3Type$inboundSchema; /** @internal */ export const ToolDefinitionRequireApproval2$inboundSchema: z.ZodType< ToolDefinitionRequireApproval2, z.ZodTypeDef, unknown > = z.object({ always: MCPToolFilter$inboundSchema.optional(), never: MCPToolFilter$inboundSchema.optional(), }); /** @internal */ export type ToolDefinitionRequireApproval2$Outbound = { always?: MCPToolFilter$Outbound | undefined; never?: MCPToolFilter$Outbound | undefined; }; /** @internal */ export const ToolDefinitionRequireApproval2$outboundSchema: z.ZodType< ToolDefinitionRequireApproval2$Outbound, z.ZodTypeDef, ToolDefinitionRequireApproval2 > = z.object({ always: MCPToolFilter$outboundSchema.optional(), never: MCPToolFilter$outboundSchema.optional(), }); export function toolDefinitionRequireApproval2ToJSON( toolDefinitionRequireApproval2: ToolDefinitionRequireApproval2, ): string { return JSON.stringify( ToolDefinitionRequireApproval2$outboundSchema.parse( toolDefinitionRequireApproval2, ), ); } export function toolDefinitionRequireApproval2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinitionRequireApproval2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinitionRequireApproval2' from JSON`, ); } /** @internal */ export const ToolDefinitionRequireApproval1$inboundSchema: z.ZodNativeEnum< typeof ToolDefinitionRequireApproval1 > = z.nativeEnum(ToolDefinitionRequireApproval1); /** @internal */ export const ToolDefinitionRequireApproval1$outboundSchema: z.ZodNativeEnum< typeof ToolDefinitionRequireApproval1 > = ToolDefinitionRequireApproval1$inboundSchema; /** @internal */ export const ThreeRequireApproval$inboundSchema: z.ZodType< ThreeRequireApproval, z.ZodTypeDef, unknown > = z.union([ ToolDefinitionRequireApproval1$inboundSchema, z.lazy(() => ToolDefinitionRequireApproval2$inboundSchema), ]); /** @internal */ export type ThreeRequireApproval$Outbound = | string | ToolDefinitionRequireApproval2$Outbound; /** @internal */ export const ThreeRequireApproval$outboundSchema: z.ZodType< ThreeRequireApproval$Outbound, z.ZodTypeDef, ThreeRequireApproval > = z.union([ ToolDefinitionRequireApproval1$outboundSchema, z.lazy(() => ToolDefinitionRequireApproval2$outboundSchema), ]); export function threeRequireApprovalToJSON( threeRequireApproval: ThreeRequireApproval, ): string { return JSON.stringify( ThreeRequireApproval$outboundSchema.parse(threeRequireApproval), ); } export function threeRequireApprovalFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ThreeRequireApproval$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ThreeRequireApproval' from JSON`, ); } /** @internal */ export const ToolDefinition3AllowedTools$inboundSchema: z.ZodType< ToolDefinition3AllowedTools, z.ZodTypeDef, unknown > = z.union([z.array(z.string()), MCPToolFilter$inboundSchema]); /** @internal */ export type ToolDefinition3AllowedTools$Outbound = | Array | MCPToolFilter$Outbound; /** @internal */ export const ToolDefinition3AllowedTools$outboundSchema: z.ZodType< ToolDefinition3AllowedTools$Outbound, z.ZodTypeDef, ToolDefinition3AllowedTools > = z.union([z.array(z.string()), MCPToolFilter$outboundSchema]); export function toolDefinition3AllowedToolsToJSON( toolDefinition3AllowedTools: ToolDefinition3AllowedTools, ): string { return JSON.stringify( ToolDefinition3AllowedTools$outboundSchema.parse( toolDefinition3AllowedTools, ), ); } export function toolDefinition3AllowedToolsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinition3AllowedTools$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinition3AllowedTools' from JSON`, ); } /** @internal */ export const Three2$inboundSchema: z.ZodType = z .object({ type: ToolDefinition3Type$inboundSchema, server_label: z.string().optional(), mcp_server_id: z.string(), mcp_credential_id: z.string().optional(), server_url: z.string().optional(), server_description: z.string().optional(), authorization: z.string().optional(), require_approval: z.union([ ToolDefinitionRequireApproval1$inboundSchema, z.lazy(() => ToolDefinitionRequireApproval2$inboundSchema), ]).optional(), allowed_tools: z.union([z.array(z.string()), MCPToolFilter$inboundSchema]) .optional(), headers: z.record(z.string()).optional(), }).transform((v) => { return remap$(v, { "server_label": "serverLabel", "mcp_server_id": "mcpServerId", "mcp_credential_id": "mcpCredentialId", "server_url": "serverUrl", "server_description": "serverDescription", "require_approval": "requireApproval", "allowed_tools": "allowedTools", }); }); /** @internal */ export type Three2$Outbound = { type: string; server_label?: string | undefined; mcp_server_id: string; mcp_credential_id?: string | undefined; server_url?: string | undefined; server_description?: string | undefined; authorization?: string | undefined; require_approval?: | string | ToolDefinitionRequireApproval2$Outbound | undefined; allowed_tools?: Array | MCPToolFilter$Outbound | undefined; headers?: { [k: string]: string } | undefined; }; /** @internal */ export const Three2$outboundSchema: z.ZodType< Three2$Outbound, z.ZodTypeDef, Three2 > = z.object({ type: ToolDefinition3Type$outboundSchema, serverLabel: z.string().optional(), mcpServerId: z.string(), mcpCredentialId: z.string().optional(), serverUrl: z.string().optional(), serverDescription: z.string().optional(), authorization: z.string().optional(), requireApproval: z.union([ ToolDefinitionRequireApproval1$outboundSchema, z.lazy(() => ToolDefinitionRequireApproval2$outboundSchema), ]).optional(), allowedTools: z.union([z.array(z.string()), MCPToolFilter$outboundSchema]) .optional(), headers: z.record(z.string()).optional(), }).transform((v) => { return remap$(v, { serverLabel: "server_label", mcpServerId: "mcp_server_id", mcpCredentialId: "mcp_credential_id", serverUrl: "server_url", serverDescription: "server_description", requireApproval: "require_approval", allowedTools: "allowed_tools", }); }); export function three2ToJSON(three2: Three2): string { return JSON.stringify(Three2$outboundSchema.parse(three2)); } export function three2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Three2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Three2' from JSON`, ); } /** @internal */ export const ThreeType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(ThreeType); /** @internal */ export const ThreeType$outboundSchema: z.ZodNativeEnum = ThreeType$inboundSchema; /** @internal */ export const RequireApproval2$inboundSchema: z.ZodType< RequireApproval2, z.ZodTypeDef, unknown > = z.object({ always: MCPToolFilter$inboundSchema.optional(), never: MCPToolFilter$inboundSchema.optional(), }); /** @internal */ export type RequireApproval2$Outbound = { always?: MCPToolFilter$Outbound | undefined; never?: MCPToolFilter$Outbound | undefined; }; /** @internal */ export const RequireApproval2$outboundSchema: z.ZodType< RequireApproval2$Outbound, z.ZodTypeDef, RequireApproval2 > = z.object({ always: MCPToolFilter$outboundSchema.optional(), never: MCPToolFilter$outboundSchema.optional(), }); export function requireApproval2ToJSON( requireApproval2: RequireApproval2, ): string { return JSON.stringify( RequireApproval2$outboundSchema.parse(requireApproval2), ); } export function requireApproval2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RequireApproval2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequireApproval2' from JSON`, ); } /** @internal */ export const RequireApproval1$inboundSchema: z.ZodNativeEnum< typeof RequireApproval1 > = z.nativeEnum(RequireApproval1); /** @internal */ export const RequireApproval1$outboundSchema: z.ZodNativeEnum< typeof RequireApproval1 > = RequireApproval1$inboundSchema; /** @internal */ export const RequireApproval$inboundSchema: z.ZodType< RequireApproval, z.ZodTypeDef, unknown > = z.union([ RequireApproval1$inboundSchema, z.lazy(() => RequireApproval2$inboundSchema), ]); /** @internal */ export type RequireApproval$Outbound = string | RequireApproval2$Outbound; /** @internal */ export const RequireApproval$outboundSchema: z.ZodType< RequireApproval$Outbound, z.ZodTypeDef, RequireApproval > = z.union([ RequireApproval1$outboundSchema, z.lazy(() => RequireApproval2$outboundSchema), ]); export function requireApprovalToJSON( requireApproval: RequireApproval, ): string { return JSON.stringify(RequireApproval$outboundSchema.parse(requireApproval)); } export function requireApprovalFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RequireApproval$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequireApproval' from JSON`, ); } /** @internal */ export const ThreeAllowedTools$inboundSchema: z.ZodType< ThreeAllowedTools, z.ZodTypeDef, unknown > = z.union([z.array(z.string()), MCPToolFilter$inboundSchema]); /** @internal */ export type ThreeAllowedTools$Outbound = Array | MCPToolFilter$Outbound; /** @internal */ export const ThreeAllowedTools$outboundSchema: z.ZodType< ThreeAllowedTools$Outbound, z.ZodTypeDef, ThreeAllowedTools > = z.union([z.array(z.string()), MCPToolFilter$outboundSchema]); export function threeAllowedToolsToJSON( threeAllowedTools: ThreeAllowedTools, ): string { return JSON.stringify( ThreeAllowedTools$outboundSchema.parse(threeAllowedTools), ); } export function threeAllowedToolsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ThreeAllowedTools$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ThreeAllowedTools' from JSON`, ); } /** @internal */ export const Three1$inboundSchema: z.ZodType = z .object({ type: ThreeType$inboundSchema, server_label: z.string(), mcp_server_id: z.string().optional(), mcp_credential_id: z.string().optional(), server_url: z.string().optional(), server_description: z.string().optional(), authorization: z.string().optional(), require_approval: z.union([ RequireApproval1$inboundSchema, z.lazy(() => RequireApproval2$inboundSchema), ]).optional(), allowed_tools: z.union([z.array(z.string()), MCPToolFilter$inboundSchema]) .optional(), headers: z.record(z.string()).optional(), }).transform((v) => { return remap$(v, { "server_label": "serverLabel", "mcp_server_id": "mcpServerId", "mcp_credential_id": "mcpCredentialId", "server_url": "serverUrl", "server_description": "serverDescription", "require_approval": "requireApproval", "allowed_tools": "allowedTools", }); }); /** @internal */ export type Three1$Outbound = { type: string; server_label: string; mcp_server_id?: string | undefined; mcp_credential_id?: string | undefined; server_url?: string | undefined; server_description?: string | undefined; authorization?: string | undefined; require_approval?: string | RequireApproval2$Outbound | undefined; allowed_tools?: Array | MCPToolFilter$Outbound | undefined; headers?: { [k: string]: string } | undefined; }; /** @internal */ export const Three1$outboundSchema: z.ZodType< Three1$Outbound, z.ZodTypeDef, Three1 > = z.object({ type: ThreeType$outboundSchema, serverLabel: z.string(), mcpServerId: z.string().optional(), mcpCredentialId: z.string().optional(), serverUrl: z.string().optional(), serverDescription: z.string().optional(), authorization: z.string().optional(), requireApproval: z.union([ RequireApproval1$outboundSchema, z.lazy(() => RequireApproval2$outboundSchema), ]).optional(), allowedTools: z.union([z.array(z.string()), MCPToolFilter$outboundSchema]) .optional(), headers: z.record(z.string()).optional(), }).transform((v) => { return remap$(v, { serverLabel: "server_label", mcpServerId: "mcp_server_id", mcpCredentialId: "mcp_credential_id", serverUrl: "server_url", serverDescription: "server_description", requireApproval: "require_approval", allowedTools: "allowed_tools", }); }); export function three1ToJSON(three1: Three1): string { return JSON.stringify(Three1$outboundSchema.parse(three1)); } export function three1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Three1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Three1' from JSON`, ); } /** @internal */ export const ToolDefinition3$inboundSchema: z.ZodType< ToolDefinition3, z.ZodTypeDef, unknown > = z.union([ z.lazy(() => Three1$inboundSchema), z.lazy(() => Three2$inboundSchema), ]); /** @internal */ export type ToolDefinition3$Outbound = Three1$Outbound | Three2$Outbound; /** @internal */ export const ToolDefinition3$outboundSchema: z.ZodType< ToolDefinition3$Outbound, z.ZodTypeDef, ToolDefinition3 > = z.union([ z.lazy(() => Three1$outboundSchema), z.lazy(() => Three2$outboundSchema), ]); export function toolDefinition3ToJSON( toolDefinition3: ToolDefinition3, ): string { return JSON.stringify(ToolDefinition3$outboundSchema.parse(toolDefinition3)); } export function toolDefinition3FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinition3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinition3' from JSON`, ); } /** @internal */ export const ToolDefinition2Type$inboundSchema: z.ZodNativeEnum< typeof ToolDefinition2Type > = z.nativeEnum(ToolDefinition2Type); /** @internal */ export const ToolDefinition2Type$outboundSchema: z.ZodNativeEnum< typeof ToolDefinition2Type > = ToolDefinition2Type$inboundSchema; /** @internal */ export const ToolDefinition2$inboundSchema: z.ZodType< ToolDefinition2, z.ZodTypeDef, unknown > = z.object({ type: ToolDefinition2Type$inboundSchema, name: z.string(), description: z.string().optional(), strict: z.boolean().optional(), defer_loading: z.boolean().optional(), parameters: z.record(z.any()), }).transform((v) => { return remap$(v, { "defer_loading": "deferLoading", }); }); /** @internal */ export type ToolDefinition2$Outbound = { type: string; name: string; description?: string | undefined; strict?: boolean | undefined; defer_loading?: boolean | undefined; parameters: { [k: string]: any }; }; /** @internal */ export const ToolDefinition2$outboundSchema: z.ZodType< ToolDefinition2$Outbound, z.ZodTypeDef, ToolDefinition2 > = z.object({ type: ToolDefinition2Type$outboundSchema, name: z.string(), description: z.string().optional(), strict: z.boolean().optional(), deferLoading: z.boolean().optional(), parameters: z.record(z.any()), }).transform((v) => { return remap$(v, { deferLoading: "defer_loading", }); }); export function toolDefinition2ToJSON( toolDefinition2: ToolDefinition2, ): string { return JSON.stringify(ToolDefinition2$outboundSchema.parse(toolDefinition2)); } export function toolDefinition2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinition2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinition2' from JSON`, ); } /** @internal */ export const ToolDefinitionType$inboundSchema: z.ZodNativeEnum< typeof ToolDefinitionType > = z.nativeEnum(ToolDefinitionType); /** @internal */ export const ToolDefinitionType$outboundSchema: z.ZodNativeEnum< typeof ToolDefinitionType > = ToolDefinitionType$inboundSchema; /** @internal */ export const ToolDefinitionSearchContextSize$inboundSchema: z.ZodNativeEnum< typeof ToolDefinitionSearchContextSize > = z.nativeEnum(ToolDefinitionSearchContextSize); /** @internal */ export const ToolDefinitionSearchContextSize$outboundSchema: z.ZodNativeEnum< typeof ToolDefinitionSearchContextSize > = ToolDefinitionSearchContextSize$inboundSchema; /** @internal */ export const ToolDefinition1Type$inboundSchema: z.ZodNativeEnum< typeof ToolDefinition1Type > = z.nativeEnum(ToolDefinition1Type); /** @internal */ export const ToolDefinition1Type$outboundSchema: z.ZodNativeEnum< typeof ToolDefinition1Type > = ToolDefinition1Type$inboundSchema; /** @internal */ export const ToolDefinitionUserLocation$inboundSchema: z.ZodType< ToolDefinitionUserLocation, z.ZodTypeDef, unknown > = z.object({ type: ToolDefinition1Type$inboundSchema.optional(), city: z.string().optional(), country: z.string().optional(), region: z.string().optional(), timezone: z.string().optional(), }); /** @internal */ export type ToolDefinitionUserLocation$Outbound = { type?: string | undefined; city?: string | undefined; country?: string | undefined; region?: string | undefined; timezone?: string | undefined; }; /** @internal */ export const ToolDefinitionUserLocation$outboundSchema: z.ZodType< ToolDefinitionUserLocation$Outbound, z.ZodTypeDef, ToolDefinitionUserLocation > = z.object({ type: ToolDefinition1Type$outboundSchema.optional(), city: z.string().optional(), country: z.string().optional(), region: z.string().optional(), timezone: z.string().optional(), }); export function toolDefinitionUserLocationToJSON( toolDefinitionUserLocation: ToolDefinitionUserLocation, ): string { return JSON.stringify( ToolDefinitionUserLocation$outboundSchema.parse(toolDefinitionUserLocation), ); } export function toolDefinitionUserLocationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinitionUserLocation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinitionUserLocation' from JSON`, ); } /** @internal */ export const ToolDefinitionFilters$inboundSchema: z.ZodType< ToolDefinitionFilters, z.ZodTypeDef, unknown > = z.object({ allowed_domains: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "allowed_domains": "allowedDomains", }); }); /** @internal */ export type ToolDefinitionFilters$Outbound = { allowed_domains?: Array | undefined; }; /** @internal */ export const ToolDefinitionFilters$outboundSchema: z.ZodType< ToolDefinitionFilters$Outbound, z.ZodTypeDef, ToolDefinitionFilters > = z.object({ allowedDomains: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { allowedDomains: "allowed_domains", }); }); export function toolDefinitionFiltersToJSON( toolDefinitionFilters: ToolDefinitionFilters, ): string { return JSON.stringify( ToolDefinitionFilters$outboundSchema.parse(toolDefinitionFilters), ); } export function toolDefinitionFiltersFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinitionFilters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinitionFilters' from JSON`, ); } /** @internal */ export const ToolDefinition1$inboundSchema: z.ZodType< ToolDefinition1, z.ZodTypeDef, unknown > = z.object({ type: ToolDefinitionType$inboundSchema, search_context_size: ToolDefinitionSearchContextSize$inboundSchema.optional(), user_location: z.lazy(() => ToolDefinitionUserLocation$inboundSchema) .optional(), filters: z.lazy(() => ToolDefinitionFilters$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "search_context_size": "searchContextSize", "user_location": "userLocation", }); }); /** @internal */ export type ToolDefinition1$Outbound = { type: string; search_context_size?: string | undefined; user_location?: ToolDefinitionUserLocation$Outbound | undefined; filters?: ToolDefinitionFilters$Outbound | undefined; }; /** @internal */ export const ToolDefinition1$outboundSchema: z.ZodType< ToolDefinition1$Outbound, z.ZodTypeDef, ToolDefinition1 > = z.object({ type: ToolDefinitionType$outboundSchema, searchContextSize: ToolDefinitionSearchContextSize$outboundSchema.optional(), userLocation: z.lazy(() => ToolDefinitionUserLocation$outboundSchema) .optional(), filters: z.lazy(() => ToolDefinitionFilters$outboundSchema).optional(), }).transform((v) => { return remap$(v, { searchContextSize: "search_context_size", userLocation: "user_location", }); }); export function toolDefinition1ToJSON( toolDefinition1: ToolDefinition1, ): string { return JSON.stringify(ToolDefinition1$outboundSchema.parse(toolDefinition1)); } export function toolDefinition1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinition1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinition1' from JSON`, ); } /** @internal */ export const ToolDefinition$inboundSchema: z.ZodType< ToolDefinition, z.ZodTypeDef, unknown > = z.union([ z.lazy(() => ToolDefinition2$inboundSchema), z.lazy(() => ToolDefinition4$inboundSchema), z.lazy(() => ToolDefinition1$inboundSchema), z.lazy(() => ToolDefinition5$inboundSchema), z.lazy(() => ToolDefinition6$inboundSchema), z.lazy(() => Seven$inboundSchema), z.union([ z.lazy(() => Three1$inboundSchema), z.lazy(() => Three2$inboundSchema), ]), ]); /** @internal */ export type ToolDefinition$Outbound = | ToolDefinition2$Outbound | ToolDefinition4$Outbound | ToolDefinition1$Outbound | ToolDefinition5$Outbound | ToolDefinition6$Outbound | Seven$Outbound | Three1$Outbound | Three2$Outbound; /** @internal */ export const ToolDefinition$outboundSchema: z.ZodType< ToolDefinition$Outbound, z.ZodTypeDef, ToolDefinition > = z.union([ z.lazy(() => ToolDefinition2$outboundSchema), z.lazy(() => ToolDefinition4$outboundSchema), z.lazy(() => ToolDefinition1$outboundSchema), z.lazy(() => ToolDefinition5$outboundSchema), z.lazy(() => ToolDefinition6$outboundSchema), z.lazy(() => Seven$outboundSchema), z.union([ z.lazy(() => Three1$outboundSchema), z.lazy(() => Three2$outboundSchema), ]), ]); export function toolDefinitionToJSON(toolDefinition: ToolDefinition): string { return JSON.stringify(ToolDefinition$outboundSchema.parse(toolDefinition)); } export function toolDefinitionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolDefinition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolDefinition' from JSON`, ); }