/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 36834e0e0bfa */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The agent metadata. Currently not implemented. */ export type AgentMetadata = {}; /** * Describes features that the agent supports. example: { * * @remarks * "ap.io.messages": true, * "ap.io.streaming": true * } */ export type AgentCapabilities = { /** * Whether the agent supports messages as an input. If true, you'll pass `messages` as an input when running the agent. */ apIoMessages?: boolean | undefined; /** * Whether the agent supports streaming output. If true, you you can stream agent ouput. All agents currently support streaming. */ apIoStreaming?: boolean | undefined; additionalProperties?: { [k: string]: any } | undefined; }; export type Agent = { /** * The ID of the agent. */ agentId: string; /** * The name of the agent */ name: string; /** * The description of the agent. */ description?: string | undefined; /** * The agent metadata. Currently not implemented. */ metadata?: AgentMetadata | undefined; /** * Describes features that the agent supports. example: { * * @remarks * "ap.io.messages": true, * "ap.io.streaming": true * } */ capabilities: AgentCapabilities; }; /** @internal */ export const AgentMetadata$inboundSchema: z.ZodType< AgentMetadata, z.ZodTypeDef, unknown > = z.object({}); export function agentMetadataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentMetadata' from JSON`, ); } /** @internal */ export const AgentCapabilities$inboundSchema: z.ZodType< AgentCapabilities, z.ZodTypeDef, unknown > = collectExtraKeys$( z.object({ "ap.io.messages": z.boolean().optional(), "ap.io.streaming": z.boolean().optional(), }).catchall(z.any()), "additionalProperties", true, ).transform((v) => { return remap$(v, { "ap.io.messages": "apIoMessages", "ap.io.streaming": "apIoStreaming", }); }); export function agentCapabilitiesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentCapabilities$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentCapabilities' from JSON`, ); } /** @internal */ export const Agent$inboundSchema: z.ZodType = z .object({ agent_id: z.string(), name: z.string(), description: z.string().optional(), metadata: z.lazy(() => AgentMetadata$inboundSchema).optional(), capabilities: z.lazy(() => AgentCapabilities$inboundSchema), }).transform((v) => { return remap$(v, { "agent_id": "agentId", }); }); export function agentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Agent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Agent' from JSON`, ); }