//#region src/domains/run/agents/services/ToolSessionManager.d.ts
interface ToolResultRecord {
  toolCallId: string;
  toolName: string;
  args?: any;
  result: any;
  timestamp: number;
}
interface ToolSession {
  sessionId: string;
  tenantId: string;
  projectId: string;
  contextId: string;
  taskId: string;
  toolResults: Map<string, ToolResultRecord>;
  createdAt: number;
}
/**
 * Manages tool execution state during agent generation sessions.
 * Allows tools to access previous tool call results within the same execution.
 */
declare class ToolSessionManager {
  private static instance;
  private sessions;
  private constructor();
  static getInstance(): ToolSessionManager;
  /**
   * Create a new tool session for an agent execution
   */
  createSession(tenantId: string, projectId: string, contextId: string, taskId: string): string;
  /**
   * Create a new tool session with a specific ID (for coordination with AgentSession)
   */
  createSessionWithId(sessionId: string, tenantId: string, projectId: string, contextId: string, taskId: string): string;
  /**
   * Ensure an agent-scoped session exists (idempotent)
   * All agents in the same agent execution share this session
   */
  ensureAgentSession(sessionId: string, tenantId: string, projectId: string, contextId: string, taskId: string): string;
  /**
   * Record a tool result in the session
   */
  recordToolResult(sessionId: string, toolResult: ToolResultRecord): void;
  /**
   * Get a tool result by toolCallId within a session
   */
  getToolResult(sessionId: string, toolCallId: string): ToolResultRecord | undefined;
  /**
   * Get session info
   */
  getSession(sessionId: string): ToolSession | undefined;
  /**
   * Clean up a session after agent execution completes
   */
  endSession(sessionId: string): void;
  /**
   * Remove expired sessions to prevent memory leaks
   */
  private cleanupExpiredSessions;
}
declare const toolSessionManager: ToolSessionManager;
//#endregion
export { ToolResultRecord, ToolSession, ToolSessionManager, toolSessionManager };