/** * Message Manager service for browser-use TypeScript * * Manages message history, sensitive data filtering, and state message creation * for the Agent system. */ import { BaseMessage, SystemMessage } from '../../llm/messages'; import { MessageManagerState, AgentOutput, ActionResult, AgentStepInfo } from '../views'; import { BrowserStateSummary } from '../../browser/views'; export type VisionDetailLevel = 'auto' | 'low' | 'high'; export type SensitiveData = Record>; /** * Message Manager handles message history and state for the Agent */ export declare class MessageManager { task: string; state: MessageManagerState; systemPrompt: SystemMessage; fileSystem: any; sensitiveDataDescription: string; useThinking: boolean; maxHistoryItems: number | null; visionDetailLevel: VisionDetailLevel; includeToolCallExamples: boolean; includeRecentEvents: boolean; includeAttributes: string[]; sensitiveData?: SensitiveData; lastInputMessages: BaseMessage[]; constructor(options: { task: string; systemMessage: SystemMessage; fileSystem: any; state?: MessageManagerState; useThinking?: boolean; includeAttributes?: string[] | null; sensitiveData?: SensitiveData | null; maxHistoryItems?: number | null; visionDetailLevel?: VisionDetailLevel; includeToolCallExamples?: boolean; includeRecentEvents?: boolean; }); /** * Build agent history description from list of items, respecting max_history_items limit */ get agentHistoryDescription(): string; /** * Add a new task to the message manager */ addNewTask(newTask: string): void; /** * Update the agent history description */ private _updateAgentHistoryDescription; /** * Get sensitive data description for the current page */ private _getSensitiveDataDescription; /** * Create state messages with all content */ createStateMessages(options: { browserStateSummary: BrowserStateSummary; modelOutput?: AgentOutput | null; result?: ActionResult[] | null; stepInfo?: AgentStepInfo | null; useVision?: boolean; pageFilteredActions?: string | null; sensitiveData?: SensitiveData | null; availableFilePaths?: string[] | null; }): Promise; /** * Get current message list */ getMessages(): BaseMessage[]; /** * Replace a specific state message slot with a new message */ private _setMessageWithType; /** * Add a contextual message specific to this step */ private _addContextMessage; /** * Filter out sensitive data from the message */ private _filterSensitiveData; } /** * Helper functions for conversation saving */ /** * Save conversation history to file asynchronously */ export declare function saveConversation(inputMessages: BaseMessage[], response: any, target: string, encoding?: string): Promise; //# sourceMappingURL=service.d.ts.map