/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { ClosedEnum } from "../types/enums.js"; import { AgentMemoryBudget, AgentMemoryBudget$Outbound, AgentMemoryBudget$outboundSchema, } from "./agent-memory-budget.js"; import { AgentMemoryLayer, AgentMemoryLayer$outboundSchema, } from "./agent-memory-layer.js"; import { AgentMemoryToolEvent, AgentMemoryToolEvent$Outbound, AgentMemoryToolEvent$outboundSchema, } from "./agent-memory-tool-event.js"; import { AgentMemoryTurnMessage, AgentMemoryTurnMessage$Outbound, AgentMemoryTurnMessage$outboundSchema, } from "./agent-memory-turn-message.js"; export const AgentMemoryLoopRequestScope3 = { Global: "global", Local: "local", } as const; export type AgentMemoryLoopRequestScope3 = ClosedEnum< typeof AgentMemoryLoopRequestScope3 >; export type AgentMemoryLoopRequestRemember = { agentWallet: string; userAddress?: string | undefined; threadId?: string | undefined; scope?: AgentMemoryLoopRequestScope3 | undefined; haiId?: string | undefined; filters?: { [k: string]: any } | undefined; metadata?: { [k: string]: any } | undefined; content: string; type?: string | undefined; retention?: string | undefined; conflictPolicy?: string | undefined; confidence?: number | undefined; enableGraph?: boolean | undefined; step: "remember"; }; export const AgentMemoryLoopRequestScope2 = { Global: "global", Local: "local", } as const; export type AgentMemoryLoopRequestScope2 = ClosedEnum< typeof AgentMemoryLoopRequestScope2 >; export type AgentMemoryLoopRequestPostTurn = { agentWallet: string; userAddress?: string | undefined; threadId?: string | undefined; scope?: AgentMemoryLoopRequestScope2 | undefined; haiId?: string | undefined; filters?: { [k: string]: any } | undefined; metadata?: { [k: string]: any } | undefined; contextId?: string | undefined; turnId?: string | undefined; sessionId?: string | undefined; messages?: Array | undefined; toolEvents?: Array | undefined; userMessage?: string | undefined; assistantMessage?: string | undefined; modelUsed?: string | undefined; model?: string | undefined; totalTokens?: number | undefined; tokenCount?: number | undefined; contextWindow?: number | undefined; summary?: string | undefined; step: "post_turn"; }; export const AgentMemoryLoopRequestScope1 = { Global: "global", Local: "local", } as const; export type AgentMemoryLoopRequestScope1 = ClosedEnum< typeof AgentMemoryLoopRequestScope1 >; export type AgentMemoryLoopRequestPreTurn = { agentWallet: string; userAddress?: string | undefined; threadId?: string | undefined; scope?: AgentMemoryLoopRequestScope1 | undefined; haiId?: string | undefined; filters?: { [k: string]: any } | undefined; metadata?: { [k: string]: any } | undefined; query: string; layers?: Array | undefined; limit?: number | undefined; maxItems?: number | undefined; maxItemChars?: number | undefined; budget?: AgentMemoryBudget | undefined; includeRaw?: boolean | undefined; step: "pre_turn"; }; export type AgentMemoryLoopRequest = | AgentMemoryLoopRequestPreTurn | AgentMemoryLoopRequestPostTurn | AgentMemoryLoopRequestRemember; /** @internal */ export const AgentMemoryLoopRequestScope3$outboundSchema: z.ZodMiniEnum< typeof AgentMemoryLoopRequestScope3 > = z.enum(AgentMemoryLoopRequestScope3); /** @internal */ export type AgentMemoryLoopRequestRemember$Outbound = { agentWallet: string; userAddress?: string | undefined; threadId?: string | undefined; scope?: string | undefined; haiId?: string | undefined; filters?: { [k: string]: any } | undefined; metadata?: { [k: string]: any } | undefined; content: string; type?: string | undefined; retention?: string | undefined; conflictPolicy?: string | undefined; confidence?: number | undefined; enableGraph?: boolean | undefined; step: "remember"; }; /** @internal */ export const AgentMemoryLoopRequestRemember$outboundSchema: z.ZodMiniType< AgentMemoryLoopRequestRemember$Outbound, AgentMemoryLoopRequestRemember > = z.object({ agentWallet: z.string(), userAddress: z.optional(z.string()), threadId: z.optional(z.string()), scope: z.optional(AgentMemoryLoopRequestScope3$outboundSchema), haiId: z.optional(z.string()), filters: z.optional(z.record(z.string(), z.any())), metadata: z.optional(z.record(z.string(), z.any())), content: z.string(), type: z.optional(z.string()), retention: z.optional(z.string()), conflictPolicy: z.optional(z.string()), confidence: z.optional(z.number()), enableGraph: z.optional(z.boolean()), step: z.literal("remember"), }); export function agentMemoryLoopRequestRememberToJSON( agentMemoryLoopRequestRemember: AgentMemoryLoopRequestRemember, ): string { return JSON.stringify( AgentMemoryLoopRequestRemember$outboundSchema.parse( agentMemoryLoopRequestRemember, ), ); } /** @internal */ export const AgentMemoryLoopRequestScope2$outboundSchema: z.ZodMiniEnum< typeof AgentMemoryLoopRequestScope2 > = z.enum(AgentMemoryLoopRequestScope2); /** @internal */ export type AgentMemoryLoopRequestPostTurn$Outbound = { agentWallet: string; userAddress?: string | undefined; threadId?: string | undefined; scope?: string | undefined; haiId?: string | undefined; filters?: { [k: string]: any } | undefined; metadata?: { [k: string]: any } | undefined; contextId?: string | undefined; turnId?: string | undefined; sessionId?: string | undefined; messages?: Array | undefined; toolEvents?: Array | undefined; userMessage?: string | undefined; assistantMessage?: string | undefined; modelUsed?: string | undefined; model?: string | undefined; totalTokens?: number | undefined; tokenCount?: number | undefined; contextWindow?: number | undefined; summary?: string | undefined; step: "post_turn"; }; /** @internal */ export const AgentMemoryLoopRequestPostTurn$outboundSchema: z.ZodMiniType< AgentMemoryLoopRequestPostTurn$Outbound, AgentMemoryLoopRequestPostTurn > = z.object({ agentWallet: z.string(), userAddress: z.optional(z.string()), threadId: z.optional(z.string()), scope: z.optional(AgentMemoryLoopRequestScope2$outboundSchema), haiId: z.optional(z.string()), filters: z.optional(z.record(z.string(), z.any())), metadata: z.optional(z.record(z.string(), z.any())), contextId: z.optional(z.string()), turnId: z.optional(z.string()), sessionId: z.optional(z.string()), messages: z.optional(z.array(AgentMemoryTurnMessage$outboundSchema)), toolEvents: z.optional(z.array(AgentMemoryToolEvent$outboundSchema)), userMessage: z.optional(z.string()), assistantMessage: z.optional(z.string()), modelUsed: z.optional(z.string()), model: z.optional(z.string()), totalTokens: z.optional(z.int()), tokenCount: z.optional(z.int()), contextWindow: z.optional(z.int()), summary: z.optional(z.string()), step: z.literal("post_turn"), }); export function agentMemoryLoopRequestPostTurnToJSON( agentMemoryLoopRequestPostTurn: AgentMemoryLoopRequestPostTurn, ): string { return JSON.stringify( AgentMemoryLoopRequestPostTurn$outboundSchema.parse( agentMemoryLoopRequestPostTurn, ), ); } /** @internal */ export const AgentMemoryLoopRequestScope1$outboundSchema: z.ZodMiniEnum< typeof AgentMemoryLoopRequestScope1 > = z.enum(AgentMemoryLoopRequestScope1); /** @internal */ export type AgentMemoryLoopRequestPreTurn$Outbound = { agentWallet: string; userAddress?: string | undefined; threadId?: string | undefined; scope?: string | undefined; haiId?: string | undefined; filters?: { [k: string]: any } | undefined; metadata?: { [k: string]: any } | undefined; query: string; layers?: Array | undefined; limit?: number | undefined; maxItems?: number | undefined; maxItemChars?: number | undefined; budget?: AgentMemoryBudget$Outbound | undefined; includeRaw?: boolean | undefined; step: "pre_turn"; }; /** @internal */ export const AgentMemoryLoopRequestPreTurn$outboundSchema: z.ZodMiniType< AgentMemoryLoopRequestPreTurn$Outbound, AgentMemoryLoopRequestPreTurn > = z.object({ agentWallet: z.string(), userAddress: z.optional(z.string()), threadId: z.optional(z.string()), scope: z.optional(AgentMemoryLoopRequestScope1$outboundSchema), haiId: z.optional(z.string()), filters: z.optional(z.record(z.string(), z.any())), metadata: z.optional(z.record(z.string(), z.any())), query: z.string(), layers: z.optional(z.array(AgentMemoryLayer$outboundSchema)), limit: z.optional(z.int()), maxItems: z.optional(z.int()), maxItemChars: z.optional(z.int()), budget: z.optional(AgentMemoryBudget$outboundSchema), includeRaw: z.optional(z.boolean()), step: z.literal("pre_turn"), }); export function agentMemoryLoopRequestPreTurnToJSON( agentMemoryLoopRequestPreTurn: AgentMemoryLoopRequestPreTurn, ): string { return JSON.stringify( AgentMemoryLoopRequestPreTurn$outboundSchema.parse( agentMemoryLoopRequestPreTurn, ), ); } /** @internal */ export type AgentMemoryLoopRequest$Outbound = | AgentMemoryLoopRequestPreTurn$Outbound | AgentMemoryLoopRequestPostTurn$Outbound | AgentMemoryLoopRequestRemember$Outbound; /** @internal */ export const AgentMemoryLoopRequest$outboundSchema: z.ZodMiniType< AgentMemoryLoopRequest$Outbound, AgentMemoryLoopRequest > = z.union([ z.lazy(() => AgentMemoryLoopRequestPreTurn$outboundSchema), z.lazy(() => AgentMemoryLoopRequestPostTurn$outboundSchema), z.lazy(() => AgentMemoryLoopRequestRemember$outboundSchema), ]); export function agentMemoryLoopRequestToJSON( agentMemoryLoopRequest: AgentMemoryLoopRequest, ): string { return JSON.stringify( AgentMemoryLoopRequest$outboundSchema.parse(agentMemoryLoopRequest), ); }