import { z } from 'zod'; /** * March Agent SDK - Shared Types * Port of Python march_agent types */ interface KafkaMessage { topic: string; partition: number; offset: number; key: string; headers: Record; body: Record; timestamp: number; } interface KafkaHeaders { conversationId?: string; userId?: string; from_?: string; to_?: string; messageMetadata?: string; messageSchema?: string; attachment?: string; [key: string]: string | undefined; } interface AgentRegistrationData { id: string; name: string; about: string; document: string; representationName?: string; baseUrl?: string; metadata?: Record; relatedPages?: RelatedPage[]; } interface RelatedPage { name: string; endpoint: string; } interface RegisterOptions { name: string; about: string; document: string; representationName?: string; baseUrl?: string; metadata?: Record; relatedPages?: RelatedPage[]; } interface MessageHandler { (message: any, sender: string): void | Promise; } interface SenderFilterOptions { senders?: string[]; } interface StreamOptions { persist?: boolean; eventType?: string; } interface StreamerOptions { awaiting?: boolean; sendTo?: string; } declare const AttachmentInfoSchema: z.ZodObject<{ url: z.ZodString; filename: z.ZodString; contentType: z.ZodString; size: z.ZodOptional; fileType: z.ZodOptional; }, "strip", z.ZodTypeAny, { url: string; filename: string; contentType: string; size?: number | undefined; fileType?: string | undefined; }, { url: string; filename: string; contentType: string; size?: number | undefined; fileType?: string | undefined; }>; type AttachmentInfo = z.infer; interface ConversationMessageData { id: string; conversationId: string; role: 'user' | 'assistant' | 'system'; content: string; from?: string; to?: string; createdAt: string; metadata?: Record; } interface ProduceAck { topic: string; partition: number; offset: number; correlationId?: string; } /** * Configuration options for automatic reconnection behavior. */ interface ReconnectionOptions { /** Maximum number of reconnection attempts before giving up. Default: 10 */ maxRetries?: number; /** Initial delay in milliseconds before first retry. Default: 1000 */ initialDelayMs?: number; /** Maximum delay in milliseconds between retries. Default: 30000 */ maxDelayMs?: number; /** Multiplier for exponential backoff. Default: 2 */ backoffMultiplier?: number; /** Whether to automatically reconnect on disconnect. Default: true */ autoReconnect?: boolean; } /** * Connection state for the gateway client. */ type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** * Listener callback for connection state changes. */ interface ConnectionStateListener { (state: ConnectionState, error?: Error): void; } /** * Default reconnection options. */ declare const DEFAULT_RECONNECTION_OPTIONS: Required; interface AppOptions { gatewayUrl: string; apiKey: string; heartbeatInterval?: number; maxConcurrentTasks?: number; errorMessageTemplate?: string; secure?: boolean; /** Reconnection options for the gateway connection */ reconnection?: ReconnectionOptions; } interface ConversationData { id: string; userId: string; agentId?: string; awaitingRoute?: string; pendingResponseSchema?: Record; createdAt: string; updatedAt: string; metadata?: Record; } interface GetMessagesOptions { role?: string; from?: string; to?: string; limit?: number; offset?: number; } /** * A message for memory ingestion (simplified format). */ interface MemoryMessage { role: 'user' | 'assistant'; content: string; timestamp?: string; } /** * A stored message from ai-memory (full format). */ interface StoredMemoryMessage { id: string; role: 'user' | 'assistant'; content: string; tenantId?: string; userId?: string; conversationId?: string; metadata?: Record; timestamp?: string; sequenceNumber?: number; } /** * A memory search result with similarity score and optional context. */ interface MemorySearchResult { message: StoredMemoryMessage; score: number; context?: StoredMemoryMessage[]; } /** * User conversation summary. */ interface UserSummary { userId: string; text: string; lastUpdated: string; messageCount: number; version: number; } /** * March Agent SDK - Conversation Client * Port of Python march_agent/conversation_client.py */ /** * HTTP client for interacting with conversation-store API. */ declare class ConversationClient { private readonly baseUrl; constructor(baseUrl: string); /** * Get conversation metadata. */ getConversation(conversationId: string): Promise; /** * Get messages from a conversation. */ getMessages(conversationId: string, options?: GetMessagesOptions): Promise; /** * Update conversation fields (PATCH). */ updateConversation(conversationId: string, data: Partial): Promise; } /** * March Agent SDK - Conversation Message * Port of Python march_agent/conversation_message.py */ /** * Represents a message from conversation history. */ declare class ConversationMessage { readonly id: string; readonly conversationId: string; readonly role: 'user' | 'assistant' | 'system'; readonly content: string; readonly from?: string; readonly to?: string; readonly createdAt: Date; readonly metadata?: Record; constructor(data: ConversationMessageData); /** * Create from API response */ static fromApiResponse(data: Record): ConversationMessage; /** * Check if this is a user message */ isUser(): boolean; /** * Check if this is an assistant message */ isAssistant(): boolean; } /** * March Agent SDK - Conversation Helper * Port of Python march_agent/conversation.py */ interface GetHistoryOptions { limit?: number; offset?: number; } interface GetAgentHistoryOptions extends GetHistoryOptions { agentName?: string; } /** * Helper class for accessing conversation history. * Provides convenient methods for fetching messages. */ declare class Conversation { readonly conversationId: string; private readonly client; private readonly agentName?; constructor(conversationId: string, client: ConversationClient, agentName?: string); /** * Get all messages in the conversation. */ getHistory(options?: GetHistoryOptions): Promise; /** * Get messages to/from the current agent. * Useful for getting conversation history for a specific agent. */ getAgentHistory(options?: GetAgentHistoryOptions): Promise; /** * Get the last N messages. */ getLastMessages(count: number): Promise; /** * Get user messages only. */ getUserMessages(options?: GetHistoryOptions): Promise; /** * Get assistant messages only. */ getAssistantMessages(options?: GetHistoryOptions): Promise; } /** * March Agent SDK - Memory Client * Port of Python march_agent/memory_client.py * * HTTP client for AI Memory service. * Uses /conversation/* endpoints matching the actual ai-memory API. */ /** * Options for memory search. */ interface MemorySearchOptions { /** User ID to filter by */ userId?: string; /** Conversation ID to filter by */ conversationId?: string; /** Tenant ID (agent scope/namespace) to filter by */ tenantId?: string; /** Maximum number of results to return. Default: 10 */ limit?: number; /** Minimum similarity score (0-100). Default: 70 */ minSimilarity?: number; /** Number of context messages before/after each match. Default: 0 */ contextMessages?: number; } /** * Options for memory ingestion. */ interface MemoryIngestOptions { /** Tenant ID (agent scope/namespace) */ tenantId?: string; /** User ID */ userId?: string; /** Conversation ID */ conversationId?: string; /** Additional metadata */ metadata?: Record; } /** * Response from memory ingestion. */ interface IngestResponse { status: 'queued' | 'error'; messageId: string; message: string; } /** * Async HTTP client for AI memory API. * Provides long-term memory storage and semantic search. */ declare class MemoryClient { private readonly baseUrl; constructor(baseUrl: string); /** * Ingest a single message into memory. * The message is queued for async processing (embedding + storage). */ ingestMessage(role: 'user' | 'assistant' | 'system', content: string, options?: MemoryIngestOptions): Promise; /** * Ingest multiple messages into memory (batch). * All messages are queued for async processing. */ ingestMessages(messages: Array<{ role: 'user' | 'assistant' | 'system'; content: string; options?: MemoryIngestOptions; }>): Promise; /** * Search long-term memory with semantic search. * * @param query - Search query text * @param options - Search options (filters, limits, etc.) * @returns Array of search results with messages and scores */ search(query: string, options?: MemorySearchOptions): Promise; /** * Get user summary. * * @param userId - User ID to get summary for * @returns User summary or null if not found */ getUserSummary(userId: string): Promise; /** * Delete memory matching the provided filters. * At least one filter is required. * * @param options - Filter options (tenantId, userId, conversationId) * @returns Deletion result */ deleteMemory(options: { tenantId?: string; userId?: string; conversationId?: string; }): Promise<{ shortTermDeleted: number; longTermStatus: string; }>; /** * @deprecated Use deleteMemory() instead * Clear user's memory (shortcut for deleteMemory with userId). */ clearMemory(userId: string): Promise<{ shortTermDeleted: number; longTermStatus: string; }>; /** * @deprecated Use ingestMessage() or ingestMessages() instead * Legacy method for backward compatibility. */ addMessages(userId: string, conversationId: string, messages: MemoryMessage[]): Promise<{ added: number; }>; } /** * March Agent SDK - Memory Helper * Port of Python march_agent/memory.py */ /** * Helper class for accessing long-term memory. * Provides convenient methods for storing and searching memories. */ declare class Memory { readonly userId: string; readonly conversationId: string; private readonly client; constructor(userId: string, conversationId: string, client: MemoryClient); /** * Add messages to memory. */ addMessages(messages: MemoryMessage[]): Promise; /** * Add a single message to memory. */ addMessage(role: 'user' | 'assistant', content: string): Promise; /** * Search memory for relevant content. */ search(query: string, limit?: number): Promise; /** * Get user summary. */ getSummary(): Promise; /** * Clear all memories for this user. */ clear(): Promise; } /** * March Agent SDK - Attachment Client * Port of Python march_agent/attachment_client.py */ /** * Create AttachmentInfo from API data */ declare function createAttachmentInfo(data: Record): AttachmentInfo; /** * HTTP client for downloading attachments. */ declare class AttachmentClient { private readonly baseUrl; constructor(baseUrl: string); /** * Build full URL for an attachment. */ private buildUrl; /** * Download attachment as bytes (Buffer). */ download(url: string): Promise; /** * Download attachment as base64 string. * Useful for LLM vision APIs. */ downloadAsBase64(url: string): Promise; } /** * March Agent SDK - Message * Port of Python march_agent/message.py */ /** * Represents an incoming message to the agent. */ declare class Message { readonly content: string; readonly conversationId: string; readonly userId: string; readonly headers: Record; readonly rawBody: Record; readonly conversation?: Conversation; readonly memory?: Memory; readonly metadata?: Record; readonly schema?: Record; readonly attachment?: AttachmentInfo; private readonly attachmentClient?; constructor(options: { content: string; conversationId: string; userId: string; headers: Record; rawBody: Record; conversation?: Conversation; memory?: Memory; metadata?: Record; schema?: Record; attachment?: AttachmentInfo; attachmentClient?: AttachmentClient; }); /** * Create Message from Kafka message data. */ static fromKafkaMessage(body: Record, headers: KafkaHeaders, options?: { conversationClient?: ConversationClient; memoryClient?: MemoryClient; attachmentClient?: AttachmentClient; agentName?: string; }): Message; /** * Check if message has an attachment. */ hasAttachment(): boolean; /** * Download attachment as bytes (Buffer). * * @throws Error if no attachment is available */ getAttachmentBytes(): Promise; /** * Get attachment as base64 string (for LLM vision APIs). * * @throws Error if no attachment is available */ getAttachmentBase64(): Promise; } /** * March Agent SDK - Gateway Client * Port of Python march_agent/gateway_client.py * * gRPC client for communicating with the Agent Gateway. * Includes automatic reconnection with exponential backoff. */ /** * Client for communicating with the Agent Gateway. * Provides gRPC bidirectional streaming for Kafka consume/produce. * Includes automatic reconnection with exponential backoff. */ declare class GatewayClient { private readonly gatewayUrl; private readonly apiKey; private readonly secure; private readonly reconnectionOptions; private client?; private channel?; private stream?; private _connectionId?; private messageQueue; private pendingProduceAcks; private pendingSubscribeAcks; private messageHandlers; private correlationCounter; private connected; private connectionState; private stateListeners; private agentNames; private reconnectAttempts; private reconnectTimer?; private isReconnecting; private manualClose; private lastError?; constructor(gatewayUrl: string, apiKey: string, secure?: boolean, reconnectionOptions?: ReconnectionOptions); /** * Get current connection state. */ getConnectionState(): ConnectionState; /** * Register a listener for connection state changes. * Returns an unsubscribe function. */ onConnectionStateChange(listener: ConnectionStateListener): () => void; /** * Update connection state and notify listeners. */ private setConnectionState; /** * Calculate backoff delay using exponential backoff with jitter. */ private calculateBackoff; /** * HTTP URL for AI Inventory service via proxy. */ get aiInventoryUrl(): string; /** * HTTP URL for Conversation Store service via proxy. */ get conversationStoreUrl(): string; /** * HTTP URL for AI Memory service via proxy. */ get aiMemoryUrl(): string; /** * HTTP URL for Attachment service via proxy. */ get attachmentUrl(): string; /** * Register a handler for a topic. */ registerHandler(topic: string, handler: (msg: KafkaMessage) => void): void; /** * Connect to the gateway and authenticate. */ connect(agentNames: string[]): Promise; /** * Handle disconnection - triggers reconnection if enabled. */ private handleDisconnect; /** * Schedule a reconnection attempt with exponential backoff. */ private scheduleReconnect; /** * Attempt to reconnect to the gateway. */ reconnect(): Promise; /** * Force a reconnection attempt, resetting the attempt counter. * Useful when you want to manually trigger reconnection. */ forceReconnect(): Promise; /** * Cancel any pending reconnection attempt. */ cancelReconnect(): void; /** * Clean up the current connection without triggering reconnection. */ private cleanupConnection; /** * Handle incoming server messages. */ private handleServerMessage; /** * Subscribe to an additional agent's topic. */ subscribe(agentName: string): Promise; /** * Unsubscribe from an agent's topic. */ unsubscribe(agentName: string): void; /** * Produce a message to Kafka via the gateway. */ produce(topic: string, key: string, headers: Record, body: Record, correlationId?: string): void; /** * Produce a message and wait for acknowledgment. */ produceAndWait(topic: string, key: string, headers: Record, body: Record): Promise; /** * Consume a single message (polling from queue). */ consumeOne(_timeout?: number): KafkaMessage | null; /** * Send a ping to the gateway. */ ping(): void; /** * Make a sync POST request (used for registration). */ httpPost(service: string, path: string, body: unknown): Promise; /** * Check if connected. */ isConnected(): boolean; /** * Get the last error that occurred. */ getLastError(): Error | undefined; /** * Get the current reconnection attempt count. */ getReconnectAttempts(): number; /** * Check if currently attempting to reconnect. */ isReconnectingNow(): boolean; /** * Close the gateway connection. * This will prevent automatic reconnection. */ close(): void; } /** * March Agent SDK - Structural Streaming Base * Port of Python march_agent/structural/base.py * * Base class for structural streaming objects. */ /** * Abstract base class for structural streaming objects. * * Structural streamers generate events but don't hold streaming state. * The Streamer binds to them via streamBy() to enable streaming. */ declare abstract class StructuralStreamer { readonly id: string; protected _streamer?: Streamer; constructor(id?: string); /** * Generate a unique ID for this streamer type. */ protected abstract _generateId(): string; /** * Get the event type prefix (e.g., 'artifact', 'text_block'). */ abstract getEventTypePrefix(): string; /** * Bind this structural streamer to a Streamer instance. * Called by Streamer.streamBy(). Returns self for chaining. */ _bindStreamer(streamer: Streamer): this; /** * Send an event through the bound streamer. * * Creates event payload and sends via streamer._send(). * Returns self for method chaining. */ protected _sendEvent(action: string, data?: Record): this; } /** * March Agent SDK - Streamer * Port of Python march_agent/streamer.py */ /** * Handles streaming responses back to the conversation via the gateway. */ declare class Streamer { private readonly agentName; private readonly originalMessage; private readonly gatewayClient; private readonly conversationClient?; private readonly sendTo; private awaiting; private responseSchema?; private messageMetadata?; private streamedContent; private finished; constructor(options: { agentName: string; originalMessage: Message; gatewayClient: GatewayClient; conversationClient?: ConversationClient; awaiting?: boolean; sendTo?: string; }); /** * Set response schema for form rendering (fluent API). */ setResponseSchema(schema: Record): this; /** * Set message metadata (fluent API). */ setMessageMetadata(metadata: Record): this; /** * Bind a structural streamer to this streamer for event sending. * * Returns the structural object itself with streaming capability enabled. * * @param structural - StructuralStreamer instance (Artifact, Surface, etc.) * @returns The same structural object, now bound to this streamer * * @example * ```typescript * const artifact = new Artifact() * s.streamBy(artifact).generating("Creating...") * s.streamBy(artifact).done({ url: "...", type: "image" }) * ``` */ streamBy(structural: T): T; /** * Stream a content chunk. */ stream(content: string, options?: StreamOptions): void; /** * Alias for stream() - write a content chunk. */ write(content: string, persist?: boolean): void; /** * Finish streaming with done=true signal. */ finish(awaitingOverride?: boolean): Promise; /** * Send message to router via gateway. * This method is used internally and by structural streamers. */ _send(content: string, done: boolean, persist?: boolean, eventType?: string): void; /** * Store response schema on conversation for form validation. */ private setPendingResponseSchema; /** * Set awaiting_route to this agent's name. */ private setAwaitingRoute; /** * Get the accumulated streamed content. */ getStreamedContent(): string; /** * Support for async disposal (TypeScript 5.2+ "using" syntax). */ [Symbol.asyncDispose](): Promise; } /** * March Agent SDK - Heartbeat Manager * Port of Python march_agent/heartbeat.py * * Enhanced with failure tracking to detect stale connections. */ /** * Callback type for when consecutive heartbeat failures exceed threshold. */ type HeartbeatFailureCallback = (consecutiveFailures: number, lastError?: Error) => void; /** * Options for HeartbeatManager. */ interface HeartbeatOptions { /** Number of consecutive failures before triggering callback. Default: 3 */ failureThreshold?: number; /** Callback when failures exceed threshold */ onFailureThresholdExceeded?: HeartbeatFailureCallback; } /** * Manages periodic heartbeats to keep the agent status active. * Sends heartbeats via HTTP to the AI Inventory service. * Tracks consecutive failures to detect connection issues. */ declare class HeartbeatManager { private readonly gatewayClient; private readonly agentName; private readonly intervalMs; private readonly failureThreshold; private readonly onFailureThresholdExceeded?; private timer?; private running; private paused; private consecutiveFailures; private lastError?; private thresholdExceededNotified; constructor(gatewayClient: GatewayClient, agentName: string, intervalSeconds?: number, options?: HeartbeatOptions); /** * Start sending heartbeats. */ start(): void; /** * Stop sending heartbeats. */ stop(): void; /** * Pause heartbeat sending (e.g., during reconnection). * Heartbeats will not be sent while paused but the timer keeps running. */ pause(): void; /** * Resume heartbeat sending. * Resets failure counter on resume. */ resume(): void; /** * Send a single heartbeat via HTTP to AI Inventory. */ private sendHeartbeat; /** * Record a heartbeat failure and check threshold. */ private recordFailure; /** * Check if heartbeat is running. */ isRunning(): boolean; /** * Check if heartbeat is paused. */ isPaused(): boolean; /** * Get the current consecutive failure count. */ getConsecutiveFailures(): number; /** * Get the last error that occurred. */ getLastError(): Error | undefined; } /** * March Agent SDK - Agent * Port of Python march_agent/agent.py */ /** * Filter for matching message senders. */ declare class SenderFilter { private readonly _include; private readonly _exclude; readonly matchAll: boolean; constructor(senders?: string[]); /** * Get included senders as an array (for compatibility with Python tests). */ get include(): string[]; /** * Get excluded senders as an array (for compatibility with Python tests). */ get exclude(): string[]; /** * Check if sender matches this filter. */ matches(sender: string): boolean; } /** * Core agent class that handles messaging via the Agent Gateway. */ declare class Agent { readonly name: string; readonly agentData: AgentRegistrationData; sendErrorResponses: boolean; errorMessageTemplate: string; private readonly gatewayClient; private readonly conversationClient?; private readonly memoryClient?; private readonly attachmentClient?; private readonly heartbeatInterval; private readonly heartbeatFailureThreshold; private readonly onHeartbeatFailure?; private messageHandlers; private heartbeatManager?; private initialized; private running; constructor(options: { name: string; gatewayClient: GatewayClient; agentData: AgentRegistrationData; heartbeatInterval?: number; heartbeatFailureThreshold?: number; onHeartbeatFailure?: HeartbeatFailureCallback; conversationClient?: ConversationClient; memoryClient?: MemoryClient; attachmentClient?: AttachmentClient; errorMessageTemplate?: string; }); /** * Register a message handler. * * Usage: * agent.onMessage(async (message, sender) => { ... }) * agent.onMessage(handler, { senders: ['user'] }) */ onMessage(handler: MessageHandler): void; onMessage(handler: MessageHandler, options: SenderFilterOptions): void; /** * Initialize agent after gateway connection is established. * Can be called multiple times (e.g., after reconnection) to re-register handlers. */ initializeWithGateway(): void; /** * Handle heartbeat failure threshold exceeded. * This can indicate a stale connection that needs reconnection. */ private handleHeartbeatFailure; /** * Pause heartbeat sending (e.g., during reconnection). */ pauseHeartbeat(): void; /** * Resume heartbeat sending. */ resumeHeartbeat(): void; /** * Get sender from message headers. */ private getSender; /** * Find first handler that matches the sender. */ private findMatchingHandler; /** * Handle incoming Kafka message. */ private handleKafkaMessage; /** * Async message handling with error recovery. */ private handleMessageAsync; /** * Send error response to user when handler fails. */ private sendErrorResponse; /** * Create a new Streamer for streaming responses. */ streamer(message: Message, options?: StreamerOptions): Streamer; /** * Mark agent as ready to consume messages. */ startConsuming(): void; /** * Shutdown agent gracefully. */ shutdown(): void; /** * Check if agent is running. */ isRunning(): boolean; } /** * March Agent SDK - Main Application * Port of Python march_agent/app.py */ /** * Main application class for March AI Agent framework. * * @example * ```typescript * import { MarchAgentApp } from 'march-ai-sdk' * * const app = new MarchAgentApp({ * gatewayUrl: 'agent-gateway:8080', * apiKey: 'your-api-key', * reconnection: { * maxRetries: 10, * initialDelayMs: 1000, * }, * }) * * const agent = app.registerMe({ * name: 'my-agent', * about: 'A helpful assistant', * document: 'Detailed description...', * }) * * agent.onMessage(async (message, sender) => { * const streamer = agent.streamer(message) * streamer.stream('Hello!') * await streamer.finish() * }) * * // Listen for connection state changes * app.onConnectionStateChange((state, error) => { * console.log(`Connection state: ${state}`, error?.message) * }) * * app.run() * ``` */ declare class MarchAgentApp { readonly gatewayClient: GatewayClient; readonly conversationClient: ConversationClient; readonly memoryClient: MemoryClient; readonly attachmentClient: AttachmentClient; private readonly heartbeatInterval; private readonly _maxConcurrentTasks; private readonly errorMessageTemplate; private agents; private running; private shutdownRequested; private appStateListeners; constructor(options: AppOptions); /** * Register a listener for connection state changes at the app level. * Returns an unsubscribe function. */ onConnectionStateChange(listener: ConnectionStateListener): () => void; /** * Get the current connection state. */ getConnectionState(): ConnectionState; /** * Handle connection state changes from the gateway client. */ private handleConnectionStateChange; /** * Re-initialize agents after reconnection. */ private reinitializeAgents; /** * Register an agent with the backend. */ registerMe(options: RegisterOptions): Promise; /** * Register agent with AI Inventory service. */ private registerWithInventory; /** * Start all registered agents and block until shutdown. */ run(): Promise; /** * Main consume loop. * Monitors connection state and keeps the event loop alive. */ private consumeLoop; /** * Force a reconnection attempt. * Useful when you detect a stale connection (e.g., from heartbeat failures). */ forceReconnect(): Promise; /** * Check if the gateway is currently connected. */ isConnected(): boolean; /** * Shutdown all agents gracefully. */ shutdown(): void; } export { Agent as A, type ReconnectionOptions as B, Conversation as C, type ConnectionState as D, type ConnectionStateListener as E, DEFAULT_RECONNECTION_OPTIONS as F, GatewayClient as G, HeartbeatManager as H, type IngestResponse as I, type KafkaMessage as K, MarchAgentApp as M, type ProduceAck as P, type RegisterOptions as R, StructuralStreamer as S, type UserSummary as U, SenderFilter as a, Message as b, Streamer as c, Memory as d, ConversationMessage as e, ConversationClient as f, MemoryClient as g, type MemorySearchOptions as h, type MemoryIngestOptions as i, AttachmentClient as j, createAttachmentInfo as k, type AttachmentInfo as l, type HeartbeatFailureCallback as m, type HeartbeatOptions as n, type KafkaHeaders as o, type AgentRegistrationData as p, type MessageHandler as q, type SenderFilterOptions as r, type StreamOptions as s, type StreamerOptions as t, type AppOptions as u, type ConversationData as v, type GetMessagesOptions as w, type MemoryMessage as x, type StoredMemoryMessage as y, type MemorySearchResult as z };