/** * `summarize_console_errors` (batch-14 composite, fka `fix_console_errors` in * cross-review v2.0.1 — renamed because the tool surfaces signals; "fixing" is * LLM-side work). * * Reads `PageSession.consoleBuffer` directly (already populated by the * `Console.messageAdded` + `Runtime.exceptionThrown` subscribers in * `PageSession.init`), filters to warning/error level, groups by message * similarity (first 80 chars of `text` + url:line), returns top-N groups by * frequency with one stack trace each. * * Useful when the AI agent asks "what's broken here?" — saves it from paging * through `list_console_messages` + N × `get_console_message`. */ import { z } from 'zod'; import { type ConsoleEntry } from '../page-session.js'; export declare const summarizeConsoleErrorsTool: { name: string; description: string; inputSchema: { minLevel: z.ZodOptional>; topN: z.ZodOptional; includeStackTrace: z.ZodOptional; }; handler: ({ minLevel, topN, includeStackTrace }: { minLevel?: "log" | "info" | "warning" | "error"; topN?: number; includeStackTrace?: boolean; }) => Promise<{ content: { type: "text"; text: string; }[]; }>; }; export declare const LEVEL_RANK: Record; export declare function _normalizeLevel(level: string): 'log' | 'info' | 'warning' | 'error'; export declare function _groupKey(e: ConsoleEntry): string; export declare function _extractFrames(stackTrace: unknown): string[]; export declare function _truncate(s: string, n: number): string;