import type { World, CreateWorldParams, UpdateWorldParams, Agent, CreateAgentParams, UpdateAgentParams, AgentMessage, Chat, UpdateChatParams } from './types.js'; type CreateAgentOptions = { allowWhileWorldProcessing?: boolean; /** Set to true when the creation slot was already claimed via claimAgentCreationSlot(). */ slotAlreadyClaimed?: boolean; }; export type ChatActivationSnapshot = { world: World; chatId: string; memory: AgentMessage[]; hitlPrompts: Array<{ chatId: string | null; prompt: Record; }>; }; export type RestoreChatOptions = { suppressAutoResume?: boolean; }; export type ClaimAgentCreationSlotResult = { claimed: true; release: () => void; } | { claimed: false; reason: 'already_pending' | 'already_exists'; name: string; }; /** * Pre-claim an agent creation slot before showing an approval dialog. * Prevents race conditions where two concurrent create_agent tool calls both * pass approval before either calls createAgent. * Returns a release() function that MUST be called if createAgent is not called. * createAgent({ slotAlreadyClaimed: true }) also cleans up the slot itself, * so calling release() after createAgent is safe (idempotent). */ export declare function claimAgentCreationSlot(worldId: string, agentName: string): Promise; /** * Create new world with configuration and automatically create a new chat */ export declare function createWorld(params: CreateWorldParams): Promise; /** * Update world configuration */ export declare function updateWorld(worldId: string, updates: UpdateWorldParams): Promise; /** * Set the raw .env-style variables text for a world */ export declare function setWorldVariablesText(worldId: string, variablesText: string): Promise; /** * Get the raw .env-style variables text for a world */ export declare function getWorldVariablesText(worldId: string): Promise; /** * Get parsed environment map from world variables text */ export declare function getWorldEnvMap(worldId: string): Promise>; /** * Get a single env value from world variables text */ export declare function getWorldEnvValue(worldId: string, key: string): Promise; /** * Delete world and all associated data */ export declare function deleteWorld(worldId: string): Promise; /** * Get all world IDs and basic information */ export declare function listWorlds(): Promise; /** * Get world configuration and create runtime instance, creating a new chat if none exist */ export declare function getWorld(worldId: string): Promise; /** * Create new agent with configuration and system prompt */ export declare function createAgent(worldId: string, params: CreateAgentParams, options?: CreateAgentOptions): Promise; /** * Load agent by ID with full configuration and memory */ export declare function getAgent(worldId: string, agentId: string): Promise; /** * Update agent configuration and/or memory */ export declare function updateAgent(worldId: string, agentId: string, updates: UpdateAgentParams): Promise; /** * Delete agent and all associated data */ export declare function deleteAgent(worldId: string, agentId: string): Promise; /** * Get all agent IDs and basic information */ export declare function listAgents(worldId: string): Promise; /** * Add messages to agent memory */ export declare function updateAgentMemory(worldId: string, agentId: string, messages: AgentMessage[]): Promise; /** * Clear agent memory and reset LLM call count */ export declare function clearAgentMemory(worldId: string, agentId: string): Promise; /** * Create a new chat and optionally set it as current for a world */ export declare function newChat(worldId: string): Promise; /** * Create a branched chat from a source chat up to (and including) the provided message. */ export declare function branchChatFromMessage(worldId: string, sourceChatId: string, messageId: string): Promise<{ world: World; newChatId: string; copiedMessageCount: number; }>; export declare function listChats(worldId: string): Promise; export declare function updateChat(worldId: string, chatId: string, updates: UpdateChatParams): Promise; export declare function deleteChat(worldId: string, chatId: string): Promise; export declare function restoreChat(worldId: string, chatId: string, options?: RestoreChatOptions): Promise; export declare function activateChatWithSnapshot(worldId: string, chatId: string): Promise; export declare function getMemory(worldId: string, chatId: string): Promise; export { migrateMessageIds, removeMessagesFrom, editUserMessage, logEditError, getEditErrors } from './message-edit-manager.js'; export { addToQueue, recoverQueueSendingMessages, enqueueAndProcessUserTurn, dispatchImmediateChatMessage, getQueueMessages, removeFromQueue, pauseChatQueue, resumeChatQueue, stopChatQueue, clearChatQueue, retryQueueMessage } from './queue-manager.js';