import { S as StructuralStreamer } from './app-BKXFecV9.js'; export { A as Agent, p as AgentRegistrationData, u as AppOptions, j as AttachmentClient, l as AttachmentInfo, D as ConnectionState, E as ConnectionStateListener, C as Conversation, f as ConversationClient, v as ConversationData, e as ConversationMessage, F as DEFAULT_RECONNECTION_OPTIONS, G as GatewayClient, w as GetMessagesOptions, m as HeartbeatFailureCallback, H as HeartbeatManager, n as HeartbeatOptions, I as IngestResponse, o as KafkaHeaders, K as KafkaMessage, M as MarchAgentApp, d as Memory, g as MemoryClient, i as MemoryIngestOptions, x as MemoryMessage, h as MemorySearchOptions, z as MemorySearchResult, b as Message, q as MessageHandler, P as ProduceAck, B as ReconnectionOptions, R as RegisterOptions, a as SenderFilter, r as SenderFilterOptions, y as StoredMemoryMessage, s as StreamOptions, c as Streamer, t as StreamerOptions, U as UserSummary, k as createAttachmentInfo } from './app-BKXFecV9.js'; import 'zod'; /** * March Agent SDK - Artifact Structural Streamer * Port of Python march_agent/structural/artifact.py * * Artifact structural streamer for file/image/iframe artifacts. */ /** * Manages artifact lifecycle: generating -> done. * * Artifacts are files, images, iframes that are generated and displayed. * Artifact data is persisted to database on done(). * * @example * ```typescript * const artifact = new Artifact() // ID auto-generated * s.streamBy(artifact).generating("Creating chart...", 0.5) * s.streamBy(artifact).done({ * url: "https://example.com/chart.png", * type: "image", * title: "Sales Chart" * }) * ``` */ declare class Artifact extends StructuralStreamer { protected _generateId(): string; getEventTypePrefix(): string; /** * Signal artifact is being generated. * * @param message - Status message (e.g., "Creating chart...") * @param progress - Progress value 0.0-1.0 * @returns this for method chaining */ generating(message?: string, progress?: number): this; /** * Signal artifact is complete and persist to database. * * @param options - Artifact completion options * @param options.url - URL to artifact * @param options.type - Artifact type (image, iframe, document, video, audio, code, link, file) * @param options.title - Display title * @param options.description - Optional description * @param options.metadata - Additional metadata (size, mimeType, dimensions, etc.) * @returns this for method chaining */ done(options: { url: string; type: string; title?: string; description?: string; metadata?: Record; }): this; /** * Signal artifact generation failed. * * @param message - Error message * @returns this for method chaining */ error(message: string): this; } /** * March Agent SDK - Surface Structural Streamer * Port of Python march_agent/structural/surface.py * * Surface structural streamer for embedded interactive components. */ /** * Manages embedded surface lifecycle (similar to Artifact). * * Surfaces are embedded interactive components (iframes, embeds). * Surface data is persisted to database as artifacts with surface type. * * @example * ```typescript * const surface = new Surface() * s.streamBy(surface).generating("Loading calendar...") * s.streamBy(surface).done({ url: "https://cal.com/embed", type: "iframe" }) * ``` */ declare class Surface extends StructuralStreamer { protected _generateId(): string; getEventTypePrefix(): string; /** * Signal surface is loading. * * @param message - Status message (e.g., "Loading calendar...") * @param progress - Progress value 0.0-1.0 * @returns this for method chaining */ generating(message?: string, progress?: number): this; /** * Signal surface is ready and persist to database. * * @param options - Surface completion options * @param options.url - URL to surface * @param options.type - Surface type (default: iframe) * @param options.title - Display title * @param options.description - Optional description * @param options.metadata - Additional metadata * @returns this for method chaining */ done(options: { url: string; type?: string; title?: string; description?: string; metadata?: Record; }): this; /** * Signal surface loading failed. * * @param message - Error message * @returns this for method chaining */ error(message: string): this; } /** * March Agent SDK - TextBlock Structural Streamer * Port of Python march_agent/structural/text_block.py * * TextBlock structural streamer for collapsible text content. */ /** * Manages collapsible text block with title and body. * * Both title and body support streaming (append) and update (replace). * TextBlock events are NOT persisted to database. * * @example * ```typescript * const block = new TextBlock() // ID auto-generated * s.streamBy(block).setVariant("thinking") * s.streamBy(block).streamTitle("Deep ") * s.streamBy(block).streamTitle("Analysis...") * s.streamBy(block).streamBody("Step 1: Check patterns\n") * s.streamBy(block).streamBody("Step 2: Validate\n") * s.streamBy(block).updateTitle("Analysis Complete") * s.streamBy(block).done() * ``` */ declare class TextBlock extends StructuralStreamer { readonly initialTitle?: string; constructor(options?: { id?: string; title?: string; }); protected _generateId(): string; getEventTypePrefix(): string; /** * Stream title content (appends to existing). * * @param content - Content to append to title * @returns this for method chaining */ streamTitle(content: string): this; /** * Stream body content (appends to existing). * * @param content - Content to append to body * @returns this for method chaining */ streamBody(content: string): this; /** * Replace entire title. * * @param title - New title (replaces existing) * @returns this for method chaining */ updateTitle(title: string): this; /** * Replace entire body. * * @param body - New body (replaces existing) * @returns this for method chaining */ updateBody(body: string): this; /** * Set visual variant. * * @param variant - Visual style (thinking, note, warning, error, success) * @returns this for method chaining */ setVariant(variant: 'thinking' | 'note' | 'warning' | 'error' | 'success' | string): this; /** * Mark text block as complete. * * @returns this for method chaining */ done(): this; } /** * March Agent SDK - Stepper Structural Streamer * Port of Python march_agent/structural/stepper.py * * Stepper structural streamer for multi-step progress indicators. */ /** * Manages multi-step progress indicator. * * Stepper events are NOT persisted to database. * IDs are auto-generated - no need to provide them manually. * * @example * ```typescript * const stepper = new Stepper({ steps: ["Fetch", "Process", "Report"] }) // ID auto-generated * s.streamBy(stepper).startStep(0) * s.streamBy(stepper).completeStep(0) * s.streamBy(stepper).startStep(1) * s.streamBy(stepper).addStep("Verify") // Dynamic step * s.streamBy(stepper).completeStep(1) * s.streamBy(stepper).done() * ``` */ declare class Stepper extends StructuralStreamer { readonly steps: string[]; private _initialized; constructor(options?: { id?: string; steps?: string[]; }); protected _generateId(): string; getEventTypePrefix(): string; /** * Send initialization event with steps if not already sent. * This is automatically called before any other stepper event. */ private _ensureInitialized; /** * Mark step as in progress. * * @param index - Step index to start * @returns this for method chaining */ startStep(index: number): this; /** * Mark step as complete. * * @param index - Step index to complete * @returns this for method chaining */ completeStep(index: number): this; /** * Mark step as failed. * * @param index - Step index that failed * @param error - Optional error message * @returns this for method chaining */ failStep(index: number, error?: string): this; /** * Add a new step dynamically. * * @param label - Step label * @param index - Optional position to insert at * @returns this for method chaining */ addStep(label: string, index?: number): this; /** * Update step label. * * @param index - Step index to update * @param label - New label * @returns this for method chaining */ updateStepLabel(index: number, label: string): this; /** * Mark stepper as complete (all steps finished). * * @returns this for method chaining */ done(): this; } /** * March Agent SDK - Checkpoint Client * Port of Python march_agent/checkpoint_client.py */ interface CheckpointConfig { configurable: { thread_id: string; checkpoint_ns?: string; checkpoint_id?: string; }; } interface CheckpointData { v: number; id: string; ts: string; channel_values: Record; channel_versions: Record; versions_seen: Record>; pending_sends?: unknown[]; } interface CheckpointMetadata { source: string; step: number; writes?: unknown; parents?: Record; } interface CheckpointTuple { config: CheckpointConfig; checkpoint: CheckpointData; metadata: CheckpointMetadata; parent_config?: CheckpointConfig; pending_writes?: unknown[]; } interface CheckpointListOptions { threadId?: string; checkpointNs?: string; before?: string; limit?: number; } /** * Async HTTP client for checkpoint-store API. * Used by LangGraph integration for persisting graph state. */ declare class CheckpointClient { private readonly baseUrl; constructor(baseUrl: string); /** * Store a checkpoint. */ put(config: CheckpointConfig, checkpoint: CheckpointData, metadata: CheckpointMetadata, newVersions?: Record): Promise<{ config: CheckpointConfig; }>; /** * Get a checkpoint tuple. */ getTuple(threadId: string, checkpointNs?: string, checkpointId?: string): Promise; /** * List checkpoints. */ list(options?: CheckpointListOptions): Promise; /** * Delete all checkpoints for a thread. */ deleteThread(threadId: string): Promise<{ thread_id: string; deleted: number; }>; } /** * March Agent SDK - Agent State Client * Port of Python march_agent/agent_state_client.py */ interface AgentStateResponse { conversationId: string; namespace: string; state: Record; createdAt?: string; updatedAt?: string; } /** * Async HTTP client for agent-state API. * Used for storing framework-specific state (e.g., Pydantic AI messages). */ declare class AgentStateClient { private readonly baseUrl; constructor(baseUrl: string); /** * Store or update agent state. */ put(conversationId: string, namespace: string, state: Record): Promise<{ conversationId: string; namespace: string; created: boolean; }>; /** * Get agent state. */ get(conversationId: string, namespace: string): Promise; /** * Delete agent state. */ delete(conversationId: string, namespace?: string): Promise<{ conversationId: string; namespace?: string; deleted: number; }>; } /** * March Agent SDK - API Paths Configuration * * Centralized configuration for all API endpoint paths. * This allows easy configuration if API versions or paths change. */ /** * API paths for AI Inventory service. */ declare const AI_INVENTORY_PATHS: { /** Register a new agent */ readonly AGENT_REGISTER: "/api/v1/agents/register"; /** Send heartbeat */ readonly HEALTH_HEARTBEAT: "/api/v1/health/heartbeat"; }; /** * API paths for Conversation Store service. * Note: These paths don't have /api/v1/ prefix. */ declare const CONVERSATION_STORE_PATHS: { /** Get/update conversation by ID */ readonly CONVERSATION: (conversationId: string) => string; /** Get messages for a conversation */ readonly CONVERSATION_MESSAGES: (conversationId: string) => string; /** Checkpoints base path */ readonly CHECKPOINTS: "/checkpoints/"; /** Checkpoint by thread ID */ readonly CHECKPOINT_THREAD: (threadId: string) => string; /** Agent state by conversation ID */ readonly AGENT_STATE: (conversationId: string) => string; }; /** * API paths for AI Memory service. * Note: These paths don't have /api/v1/ prefix. */ declare const MEMORY_PATHS: { /** User memory base */ readonly USER_MEMORY: (userId: string) => string; /** Add messages to memory */ readonly USER_MESSAGES: (userId: string) => string; /** Search user memory */ readonly USER_SEARCH: (userId: string) => string; /** Get user summary */ readonly USER_SUMMARY: (userId: string) => string; }; /** * Service names for gateway proxy routing. */ declare const SERVICES: { readonly AI_INVENTORY: "ai-inventory"; readonly CONVERSATION_STORE: "conversation-store"; readonly AI_MEMORY: "ai-memory"; readonly ATTACHMENT: "attachment"; }; type ServiceName = typeof SERVICES[keyof typeof SERVICES]; /** * March Agent SDK - Custom Errors * Port of Python march_agent/exceptions.py */ /** * Base error class for March Agent SDK */ declare class MarchAgentError extends Error { constructor(message: string); } /** * Error during agent registration with AI Inventory */ declare class RegistrationError extends MarchAgentError { constructor(message: string); } /** * Error during Kafka operations (produce/consume) */ declare class KafkaError extends MarchAgentError { constructor(message: string); } /** * Error in SDK configuration */ declare class ConfigurationError extends MarchAgentError { constructor(message: string); } /** * Error from API calls to backend services */ declare class APIException extends MarchAgentError { statusCode?: number; constructor(message: string, statusCode?: number); } /** * Error during heartbeat operations */ declare class HeartbeatError extends MarchAgentError { constructor(message: string); } /** * Error during gRPC connection/communication */ declare class GatewayError extends MarchAgentError { constructor(message: string); } /** * Error during reconnection attempts */ declare class ReconnectionError extends MarchAgentError { /** Number of attempts made before giving up */ attempts: number; /** The last error that occurred during reconnection */ lastError?: Error; constructor(message: string, attempts: number, lastError?: Error); } /** * March Agent SDK - TypeScript framework for building AI agents * * @packageDocumentation */ declare const VERSION = "0.5.1"; export { AI_INVENTORY_PATHS, APIException, AgentStateClient, type AgentStateResponse, Artifact, CONVERSATION_STORE_PATHS, CheckpointClient, type CheckpointConfig, type CheckpointData, type CheckpointMetadata, type CheckpointTuple, ConfigurationError, GatewayError, HeartbeatError, KafkaError, MEMORY_PATHS, MarchAgentError, ReconnectionError, RegistrationError, SERVICES, type ServiceName, Stepper, StructuralStreamer, Surface, TextBlock, VERSION };