/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { ClosedEnum } from "../types/enums.js"; import { AgentCard, AgentCard$Outbound, AgentCard$outboundSchema, } from "./agent-card.js"; import { AttachmentInput, AttachmentInput$Outbound, AttachmentInput$outboundSchema, } from "./attachment-input.js"; export const Mode = { Solo: "solo", Swarm: "swarm", } as const; export type Mode = ClosedEnum; export const Scope = { Local: "local", Global: "global", } as const; export type Scope = ClosedEnum; export type Action = { name: string; [additionalProperties: string]: unknown; }; export type AgentStreamRequest = { message: string; threadId?: string | undefined; runId?: string | undefined; workflowWallet?: string | undefined; userAddress?: string | undefined; attachment?: AttachmentInput | undefined; attachments?: Array | undefined; sessionGrants?: Array | undefined; cloudPermissions?: Array | undefined; backpackAccounts?: Array<{ [k: string]: any }> | undefined; mode?: Mode | undefined; scope?: Scope | undefined; action?: Action | undefined; plan?: boolean | undefined; sandbox?: boolean | undefined; proof?: boolean | undefined; constraints?: { [k: string]: any } | undefined; agentCard?: AgentCard | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const Mode$outboundSchema: z.ZodMiniEnum = z.enum(Mode); /** @internal */ export const Scope$outboundSchema: z.ZodMiniEnum = z.enum(Scope); /** @internal */ export type Action$Outbound = { name: string; [additionalProperties: string]: unknown; }; /** @internal */ export const Action$outboundSchema: z.ZodMiniType = z .catchall( z.object({ name: z.string(), }), z.any(), ); export function actionToJSON(action: Action): string { return JSON.stringify(Action$outboundSchema.parse(action)); } /** @internal */ export type AgentStreamRequest$Outbound = { message: string; threadId?: string | undefined; runId?: string | undefined; workflowWallet?: string | undefined; userAddress?: string | undefined; attachment?: AttachmentInput$Outbound | undefined; attachments?: Array | undefined; sessionGrants?: Array | undefined; cloudPermissions?: Array | undefined; backpackAccounts?: Array<{ [k: string]: any }> | undefined; mode?: string | undefined; scope?: string | undefined; action?: Action$Outbound | undefined; plan?: boolean | undefined; sandbox?: boolean | undefined; proof?: boolean | undefined; constraints?: { [k: string]: any } | undefined; agentCard?: AgentCard$Outbound | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const AgentStreamRequest$outboundSchema: z.ZodMiniType< AgentStreamRequest$Outbound, AgentStreamRequest > = z.catchall( z.object({ message: z.string(), threadId: z.optional(z.string()), runId: z.optional(z.string()), workflowWallet: z.optional(z.string()), userAddress: z.optional(z.string()), attachment: z.optional(AttachmentInput$outboundSchema), attachments: z.optional(z.array(AttachmentInput$outboundSchema)), sessionGrants: z.optional(z.array(z.string())), cloudPermissions: z.optional(z.array(z.string())), backpackAccounts: z.optional(z.array(z.record(z.string(), z.any()))), mode: z.optional(Mode$outboundSchema), scope: z.optional(Scope$outboundSchema), action: z.optional(z.lazy(() => Action$outboundSchema)), plan: z.optional(z.boolean()), sandbox: z.optional(z.boolean()), proof: z.optional(z.boolean()), constraints: z.optional(z.record(z.string(), z.any())), agentCard: z.optional(AgentCard$outboundSchema), }), z.any(), ); export function agentStreamRequestToJSON( agentStreamRequest: AgentStreamRequest, ): string { return JSON.stringify( AgentStreamRequest$outboundSchema.parse(agentStreamRequest), ); }