/** * Agent Profiler - Analyze agent behavior patterns from traces. * * Goes beyond performance profiling to analyze decision style, * tool preferences, error handling, cost patterns, and latency distribution. */ import type { AgentTrace } from './types'; export interface BehaviorProfile { decisionStyle: { label: string; avgThinkingSteps: number; thinkBeforeActRatio: number; }; toolPreference: { ranked: Array<{ tool: string; usagePercent: number; count: number; }>; diversity: number; }; errorHandling: { retryRate: number; giveUpRate: number; recoveryRate: number; totalErrors: number; }; costPattern: { label: string; firstHalfPercent: number; totalCost: number; }; latencyPattern: { label: string; clusters: Array<{ label: string; rangeMs: [number, number]; count: number; }>; avgMs: number; medianMs: number; }; conversationDepth: { avgSteps: number; maxSteps: number; minSteps: number; }; } /** * Profile agent behavior across multiple traces. */ export declare function profileBehavior(traces: AgentTrace[]): BehaviorProfile; /** * Format behavior profile for terminal display. */ export declare function formatBehaviorProfile(profile: BehaviorProfile): string; export interface PerformanceProfile { phases: Array<{ name: string; avg: number; p50: number; p95: number; p99: number; count: number; }>; total: { avg: number; p50: number; p95: number; p99: number; }; bottleneck: { tool: string; pctOfTotal: number; } | null; suggestions: string[]; } /** * Build detailed performance profile from traces. */ export declare function profilePerformance(traces: AgentTrace[]): PerformanceProfile; /** * Format performance profile for console. */ export declare function formatPerformanceProfile(profile: PerformanceProfile): string; //# sourceMappingURL=behavior-profiler.d.ts.map