/** * Agent State Utilities * * Helper functions for serializing and restoring agent state. */ import type { Message } from '../providers/types.js'; import type { TodoItem } from '../tools/builtin/todo.js'; import type { AgentState } from './types.js'; /** * Generate a new session ID */ export declare function generateSessionId(): string; /** * Create an empty agent state */ export declare function createEmptyState(sessionId: string, systemPrompt: string): AgentState; /** * Create agent state from current agent state */ export declare function createAgentState(options: { sessionId: string; systemPrompt: string; model?: string; messages: Message[]; todos: TodoItem[]; currentIteration: number; turnCount: number; totalTokensUsed: number; createdAt?: string; }): AgentState; /** * Serialize todos (convert Date to ISO string) */ export declare function serializeTodos(todos: TodoItem[]): TodoItem[]; /** * Deserialize todos (convert ISO string back to Date) */ export declare function deserializeTodos(todos: TodoItem[]): TodoItem[]; /** * Update state's updatedAt timestamp */ export declare function touchState(state: AgentState): AgentState;