import { Agent, DAGNode, FrameworkParser, LinearStep, Model, Span, Tool } from "../types";
/** Same message_id + agent_type with multiple attempts (retries). */
interface RetryGroup {
    messageId: string;
    agentType: string;
    spans: Span[];
    totalTokens: number;
    totalCost: number;
    retryCount: number;
    timestamps: string[];
}
/**
 */
export declare class AutogenParser implements FrameworkParser {
    name: string;
    private deduplicator;
    private toolAnalyzer;
    private localContentHashes;
    constructor();
    /**
     * Local deduplication logic for AutoGen to avoid affecting other frameworks
     */
    private isLocalDuplicate;
    canParse(spans: Span[]): boolean;
    getTools(spans: Span[]): Tool[];
    getAgents(spans: Span[]): Agent[];
    getModels(spans: Span[]): Model[];
    generateDag(spans: Span[]): DAGNode[];
    generateLinearFlow(spans: Span[]): LinearStep[];
    /**
     * Check if a span represents AutoGen infrastructure (not user-defined logic)
     */
    private isInfrastructureSpan;
    private isHttpInfrastructure;
    private isMessagingInfrastructure;
    private isUserProxy;
    private isGroupChatManager;
    private isInactiveAgent;
    /**
     * CANONICAL RULES for agent detection (AutoGen-specific):
     * ALL of the following must be true:
     * 1. messaging.operation === "process"
     * 2. duration > 0 OR has child work spans (model/tool/invoke_agent)
     * 3. recipient_agent_type exists
     * 4. recipient_agent_class exists
     * 5. NOT infrastructure (UserProxy, GroupChatManager)
     */
    private isAgentSpan;
    /**
     * Extract agent using stable identifiers with enhanced metadata
     * CANONICAL RULE: Use recipient_agent_type ONLY as primary identity (strip UUID suffix)
     */
    private extractAgent;
    private inferRoleFromAgentName;
    /**
     * Check for explicit tool spans
     * Patterns:
     * - genai.tool.name attribute
     * - gen_ai.operation.name: execute_tool
     * - Span name starts with "tool "
     * - FunctionTool pattern (snake_case function name)
     */
    private isExplicitToolSpan;
    private isToolSpan;
    private buildToolCallDetailsMap;
    private collectToolCallRequestData;
    private collectToolCallExecutionData;
    private collectToolCallSummaryData;
    private safeParseJson;
    /**
     * Extract tool with enhanced agent ownership metadata
     */
    private extractTool;
    /**
     * Extract tool calls from agent message attribute
     * Parses message JSON for tool_calls array
     */
    private extractToolCallsFromMessage;
    private enrichToolsMetadata;
    private isModelSpan;
    private extractModel;
    private getNodeType;
    private getLinearDisplayName;
    private normalizeLinearName;
    private getLinearAgentPriority;
    /**
     * Detect retries based on message_id
     *
     * Retry criteria:
     * - Same message_id
     * - Same agent type (after UUID stripping)
     * - Within 5-second window
     */
    detectRetries(spans: Span[]): RetryGroup[];
    /**
     * Extract agent identity (strip UUID)
     */
    private extractAgentIdentity;
    /**
     * Get child model spans for an agent span
     */
    private getChildModelSpans;
    /**
     * Extract token usage from model span
     */
    private extractTokenUsage;
    /**
     * Aggregate retry metrics
     */
    private aggregateRetryMetrics;
    /**
     * 1️⃣ CREATE ROOT ORCHESTRATOR AGENT
     * AutoGen equivalent of LangGraph's root workflow node
     */
    private createRootOrchestratorAgent;
    /**
     * 2️⃣ DETECT FAN-OUT GROUPS
     * Same message_id processed by different agents
     */
    private detectFanOutGroups;
    /**
     * 3️⃣ CANONICAL AGENT IDENTITY
     * For cross-trace aggregation
     */
    private createCanonicalIdentity;
    /**
     * 4️⃣ PROOF-OF-WORK PARITY
     * Check if agent has child work spans (model/tool/invoke_agent)
     */
    private hasChildWorkSpans;
}
export {};
//# sourceMappingURL=autogen.d.ts.map