/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import * as openEnums from "../types/enums.js"; import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export const SessionMemoryScope = { Global: "global", Local: "local", } as const; export type SessionMemoryScope = OpenEnum; export type WorkingMemory = { context: Array; entities: { [k: string]: any }; state: { [k: string]: any }; }; export type SessionMemory = { sessionId: string; agentWallet: string; userAddress?: string | undefined; threadId?: string | undefined; scope?: SessionMemoryScope | undefined; haiId?: string | undefined; workingMemory: WorkingMemory; metadata?: { [k: string]: any } | undefined; compressed: boolean; createdAt: number; expiresAt: number; lastAccessedAt: number; }; /** @internal */ export const SessionMemoryScope$inboundSchema: z.ZodMiniType< SessionMemoryScope, unknown > = openEnums.inboundSchema(SessionMemoryScope); /** @internal */ export const WorkingMemory$inboundSchema: z.ZodMiniType< WorkingMemory, unknown > = z.object({ context: z.array(types.string()), entities: z.record(z.string(), z.any()), state: z.record(z.string(), z.any()), }); export function workingMemoryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WorkingMemory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkingMemory' from JSON`, ); } /** @internal */ export const SessionMemory$inboundSchema: z.ZodMiniType< SessionMemory, unknown > = z.object({ sessionId: types.string(), agentWallet: types.string(), userAddress: types.optional(types.string()), threadId: types.optional(types.string()), scope: types.optional(SessionMemoryScope$inboundSchema), haiId: types.optional(types.string()), workingMemory: z.lazy(() => WorkingMemory$inboundSchema), metadata: types.optional(z.record(z.string(), z.any())), compressed: types.boolean(), createdAt: types.number(), expiresAt: types.number(), lastAccessedAt: types.number(), }); export function sessionMemoryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SessionMemory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SessionMemory' from JSON`, ); }