/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 1dad3849e6f3
 */

import * as z from "zod/v4";
import { smartUnion } from "../../types/smartUnion.js";
import {
  AgentHandoffEntry,
  AgentHandoffEntry$Outbound,
  AgentHandoffEntry$outboundSchema,
} from "./agenthandoffentry.js";
import {
  FunctionCallEntry,
  FunctionCallEntry$Outbound,
  FunctionCallEntry$outboundSchema,
} from "./functioncallentry.js";
import {
  FunctionResultEntry,
  FunctionResultEntry$Outbound,
  FunctionResultEntry$outboundSchema,
} from "./functionresultentry.js";
import {
  MessageInputEntry,
  MessageInputEntry$Outbound,
  MessageInputEntry$outboundSchema,
} from "./messageinputentry.js";
import {
  MessageOutputEntry,
  MessageOutputEntry$Outbound,
  MessageOutputEntry$outboundSchema,
} from "./messageoutputentry.js";
import {
  ToolExecutionEntry,
  ToolExecutionEntry$Outbound,
  ToolExecutionEntry$outboundSchema,
} from "./toolexecutionentry.js";

export type InputEntries =
  | AgentHandoffEntry
  | FunctionCallEntry
  | MessageInputEntry
  | FunctionResultEntry
  | ToolExecutionEntry
  | MessageOutputEntry;

/** @internal */
export type InputEntries$Outbound =
  | AgentHandoffEntry$Outbound
  | FunctionCallEntry$Outbound
  | MessageInputEntry$Outbound
  | FunctionResultEntry$Outbound
  | ToolExecutionEntry$Outbound
  | MessageOutputEntry$Outbound;

/** @internal */
export const InputEntries$outboundSchema: z.ZodType<
  InputEntries$Outbound,
  InputEntries
> = smartUnion([
  AgentHandoffEntry$outboundSchema,
  FunctionCallEntry$outboundSchema,
  MessageInputEntry$outboundSchema,
  FunctionResultEntry$outboundSchema,
  ToolExecutionEntry$outboundSchema,
  MessageOutputEntry$outboundSchema,
]);

export function inputEntriesToJSON(inputEntries: InputEntries): string {
  return JSON.stringify(InputEntries$outboundSchema.parse(inputEntries));
}
