import { Prompt } from '@effect/ai'; export type PromptMessage = Prompt.MessageEncoded; type LegacyToolCall = { toolCallId?: string; toolName?: string; args?: Record; }; type LegacyMessage = { role?: string; content?: unknown; toolCalls?: LegacyToolCall[]; toolCallId?: string; toolName?: string; options?: Record; }; export declare const normalizeMessage: (message: PromptMessage | LegacyMessage) => PromptMessage; export declare const normalizeMessages: (messages: ReadonlyArray) => PromptMessage[]; /** * Filter conversation history to only include tool calls available to the current agent. * * This prevents agents from seeing tool calls from other agents in the conversation history, * which can confuse the model into thinking it has access to tools it doesn't. * * For example, if brain-agent (only has handoff_to_agent) loads history containing * update_task calls from task-agent, Claude might try to call update_task directly, * causing a ParseError. * * @param messages - Conversation history to filter * @param availableToolNames - Set of tool names available to current agent * @returns Filtered messages with only relevant tool calls */ export declare const filterHistoryForAgent: (messages: PromptMessage[], availableToolNames: Set) => PromptMessage[]; export {}; //# sourceMappingURL=messages.d.ts.map