import type { World, RemovalResult, EditErrorLog } from './types.js'; /** * Re-hydrate in-memory agent.memory from storage for every agent in a world. * Called after removeMessagesFrom to ensure the runtime view is consistent. */ export declare function syncRuntimeAgentMemoryFromStorage(world: World, worldId: string): Promise; /** * Migrate messages to include messageId for user message edit feature. * Automatically detects storage type and handles both file and SQL storage. * Idempotent — safe to run multiple times. * * @param worldId - World ID to migrate messages for * @returns Number of messages migrated */ export declare function migrateMessageIds(worldId: string): Promise; /** * Remove a message and all subsequent messages from all agents in a world. * Used for user message editing feature. * * @param worldId - World ID * @param messageId - ID of the message to remove (and all after it) * @param chatId - Chat ID to filter messages * @returns RemovalResult with per-agent removal details */ export declare function removeMessagesFrom(worldId: string, messageId: string, chatId: string): Promise; /** * Edit a user message by removing it and all subsequent messages, then resubmitting * with new content. Combines removal and resubmission in a single operation with * comprehensive error tracking. * * @param worldId - World ID * @param messageId - ID of the message to edit * @param newContent - New message content * @param chatId - Chat ID for the message * @param targetWorld - Optional pre-resolved world (avoids extra lookup) * @returns RemovalResult with removal and resubmission details */ export declare function editUserMessage(worldId: string, messageId: string, newContent: string, chatId: string, targetWorld?: World): Promise; /** * Log an error from a message edit operation for troubleshooting and retry. * Stores errors via StorageAPI optional saveEditErrors method. Keeps only the * last 100 errors. Falls back silently when storage method is unavailable. * * @param worldId - World ID * @param errorLog - EditErrorLog to persist */ export declare function logEditError(worldId: string, errorLog: EditErrorLog): Promise; /** * Get edit error logs for a world. * * @param worldId - World ID * @returns Array of EditErrorLog entries */ export declare function getEditErrors(worldId: string): Promise;