/** * Execution Graph - Observability for agent orchestration * * Tracks handoffs between agents and generates visualization diagrams * for debugging complex workflows and understanding execution flow. * * @module agents/execution-graph */ /** * Record of a single handoff between agents */ export interface HandoffRecord { /** Unique identifier for this handoff */ id: string; /** Name of the agent initiating the handoff (undefined for user) */ sourceAgent?: string; /** Name of the target agent receiving the handoff */ targetAgent: string; /** Timestamp when the handoff occurred */ timestamp: Date; /** Time in milliseconds to execute the handoff */ executionTime: number; /** Whether the handoff completed successfully */ success: boolean; /** Error message if the handoff failed */ error?: string; } /** * Configuration options for ExecutionGraph */ export interface ExecutionGraphOptions { /** Maximum number of records to keep in memory (default: 100) */ maxRecords?: number; } /** * ExecutionGraph tracks agent handoffs and generates visualization diagrams. * * Maintains a rolling buffer of handoff records and can generate Mermaid * diagrams for visualizing execution flow. */ export declare class ExecutionGraph { private records; private readonly maxRecords; /** * Creates a new ExecutionGraph instance. * * @param options - Configuration options */ constructor(options?: ExecutionGraphOptions); /** * Records a handoff between agents. * * Automatically assigns an ID and timestamp. Maintains a rolling buffer * of records up to maxRecords. * * @param record - Handoff data without id and timestamp */ recordHandoff(record: Omit): void; /** * Returns a copy of all recorded handoffs. * * @returns Array of handoff records */ getRecords(): HandoffRecord[]; /** * Generates a Mermaid flowchart diagram of the execution graph. * * Shows agent handoffs with execution time and error states. * * @returns Mermaid diagram syntax */ toMermaid(): string; /** * Generates a Mermaid sequence diagram of the execution graph. * * Shows chronological handoffs between agents with execution time. * * @returns Mermaid sequence diagram syntax */ toSequenceDiagram(): string; /** * Clears all recorded handoffs. */ clear(): void; /** * Generates a unique ID for a handoff record. * * @returns Unique identifier string */ private generateId; } /** * Singleton instance of ExecutionGraph. * Use this export for global execution graph tracking. */ export declare const executionGraph: ExecutionGraph; //# sourceMappingURL=execution-graph.d.ts.map