import { M as MarchAgentApp } from '../app-BKXFecV9.js'; import 'zod'; /** * March Agent SDK - LangGraph Extension * * HTTPCheckpointSaver for LangGraph that stores state via HTTP API. * * @packageDocumentation */ interface RunnableConfig { configurable?: { thread_id?: string; checkpoint_ns?: string; checkpoint_id?: string; }; } interface Checkpoint { 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: RunnableConfig; checkpoint: Checkpoint; metadata: CheckpointMetadata; parent_config?: RunnableConfig; pending_writes?: unknown[]; } interface PendingWrite { [key: string]: unknown; } /** * HTTP-based checkpoint saver for LangGraph. * * Stores graph state via HTTP calls to the conversation-store checkpoint API, * enabling distributed checkpoint storage without direct database access. * * @example * ```typescript * import { MarchAgentApp } from 'march-ai-sdk' * import { HTTPCheckpointSaver } from 'march-ai-sdk/extensions/langgraph' * import { StateGraph } from '@langchain/langgraph' * * const app = new MarchAgentApp({ * gatewayUrl: 'agent-gateway:8080', * apiKey: 'your-key', * }) * * const checkpointer = new HTTPCheckpointSaver(app) * * const graph = new StateGraph(MyState) * // ... define graph ... * const compiled = graph.compile({ checkpointer }) * * const config = { configurable: { thread_id: 'my-thread' } } * const result = await compiled.invoke({ messages: [...] }, config) * ``` */ declare class HTTPCheckpointSaver { private readonly client; constructor(app: MarchAgentApp); /** * Get thread_id from config. */ private getThreadId; /** * Get checkpoint_ns from config. */ private getCheckpointNs; /** * Get checkpoint_id from config. */ private getCheckpointId; /** * Generate a unique checkpoint ID. */ private generateCheckpointId; /** * Fetch a checkpoint tuple asynchronously. */ getTuple(config: RunnableConfig): Promise; /** * List checkpoints asynchronously. */ list(config: RunnableConfig | undefined, options?: { filter?: Record; before?: RunnableConfig; limit?: number; }): AsyncGenerator; /** * Store a checkpoint asynchronously. */ put(config: RunnableConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata, newVersions?: Record): Promise; /** * Store intermediate writes asynchronously. */ putWrites(_config: RunnableConfig, _writes: PendingWrite[], _taskId: string): Promise; /** * Delete all checkpoints for a thread. */ deleteThread(threadId: string): Promise; /** * Convert checkpoint to API format. */ private checkpointToApi; /** * Convert metadata to API format. */ private metadataToApi; /** * Convert API response to CheckpointTuple. */ private responseToTuple; /** * Serialize channel values for transmission. */ private serializeChannelValues; /** * Serialize a value for JSON transmission. */ private serializeValue; /** * Deserialize checkpoint data. */ private deserializeCheckpoint; /** * Deserialize a value. */ private deserializeValue; } export { type Checkpoint, type CheckpointMetadata, type CheckpointTuple, HTTPCheckpointSaver, type PendingWrite, type RunnableConfig };