/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: b9ee0c990dd6
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { smartUnion } from "../../types/smartUnion.js";
import { ClientCapabilities$inboundSchema, } from "./clientcapabilities.js";
import { MCPPrompt$inboundSchema } from "./mcpprompt.js";
import { MCPResource$inboundSchema } from "./mcpresource.js";
import { MCPServerCardMeta$inboundSchema, } from "./mcpservercardmeta.js";
import { MCPServerIcon$inboundSchema } from "./mcpservericon.js";
import { MCPServerRemote$inboundSchema, } from "./mcpserverremote.js";
import { MCPServerRepository$inboundSchema, } from "./mcpserverrepository.js";
import { MCPToolMeta$inboundSchema } from "./mcptoolmeta.js";
import { ServerCapabilities$inboundSchema, } from "./servercapabilities.js";
/** @internal */
export const Resources$inboundSchema = smartUnion([z.string(), z.array(MCPResource$inboundSchema)]);
export function resourcesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Resources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Resources' from JSON`);
}
/** @internal */
export const Tools$inboundSchema = smartUnion([
    z.string(),
    z.array(MCPToolMeta$inboundSchema),
]);
export function toolsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Tools$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Tools' from JSON`);
}
/** @internal */
export const Prompts$inboundSchema = smartUnion([
    z.string(),
    z.array(MCPPrompt$inboundSchema),
]);
export function promptsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Prompts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Prompts' from JSON`);
}
/** @internal */
export const MCPServerCard$inboundSchema = z
    .object({
    $schema: z.nullable(z.string()).optional(),
    name: z.string(),
    version: z.string(),
    capabilities: ServerCapabilities$inboundSchema.optional(),
    title: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    websiteUrl: z.nullable(z.string()).optional(),
    repository: z.nullable(MCPServerRepository$inboundSchema).optional(),
    icons: z.nullable(z.array(MCPServerIcon$inboundSchema)).optional(),
    remotes: z.nullable(z.array(MCPServerRemote$inboundSchema)).optional(),
    requires: z.nullable(ClientCapabilities$inboundSchema).optional(),
    resources: z.nullable(smartUnion([z.string(), z.array(MCPResource$inboundSchema)])).optional(),
    tools: z.nullable(smartUnion([z.string(), z.array(MCPToolMeta$inboundSchema)])).optional(),
    prompts: z.nullable(smartUnion([z.string(), z.array(MCPPrompt$inboundSchema)])).optional(),
    _meta: z.nullable(MCPServerCardMeta$inboundSchema).optional(),
}).catchall(z.any()).transform((v) => {
    return remap$(v, {
        "$schema": "dollarSchema",
        "_meta": "meta",
    });
});
export function mcpServerCardFromJSON(jsonString) {
    return safeParse(jsonString, (x) => MCPServerCard$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MCPServerCard' from JSON`);
}
//# sourceMappingURL=mcpservercard.js.map