export type ErrorNoiseSurface = "browser" | "server"; export interface ErrorNoiseFrame { function?: string; filename?: string; lineno?: number; in_app?: boolean; } export interface ErrorNoiseSignal { surface: ErrorNoiseSurface; type?: string; /** The exception message. */ value?: string; /** Raw stack text. Parsed into frames when `frames` is not supplied. */ stack?: string; /** Innermost frame first, the order V8 prints them. */ frames?: ErrorNoiseFrame[]; /** * Hosts that serve this app's own scripts (the page host, and the host the * bundle itself was loaded from). When present, a frame on any other host is * foreign. Absent, only positively identified third parties count: guessing * "foreign" without knowing where our assets live would drop every error from * a deployment that serves its bundle from a CDN. */ firstPartyHosts?: string[]; pageUrl?: string; /** Extra text mined for network destinations (request URL, breadcrumbs). */ contextText?: string; tags?: Record; mechanismType?: string; statusCode?: number; metadataValue?: string; metadataFilename?: string; hasExceptionValues?: boolean; } export type ErrorNoiseReason = "validation" | "access-control" | "lambda-socket-hang-up" | "sdk-error-event" | "expected-http" | "test-harness" | "resize-observer" | "stale-chunk" | "view-transition-abort" | "extension-bootstrap" | "opaque-script-error" | "opaque-zero-line-stack" | "extension-network" | "extension-origin" | "third-party-origin" | "amplitude-network" | "unattributable-network" | "benign-abort" | "run-timeout-reconnect" | "agent-auto-continue" | "session-replay-autoplay" | "sourceless-emptyranges" | "docs-webkit-bridge" | "docs-sourceless-stack-overflow"; export type ErrorNoiseVerdict = { drop: false; } | { drop: true; reason: ErrorNoiseReason; }; export type ErrorFrameOrigin = "first-party" | "wrapper" | "third-party" | "extension" | "unknown"; /** * Parse a V8 or Gecko/Safari stack into frames, innermost first. Message * header lines — including the continuation lines of a multi-line message — are * skipped, so text inside an error message can never become a frame. */ export declare function parseErrorStackFrames(stack: string | null | undefined): ErrorNoiseFrame[]; export declare function isWrapperFrame(frame: ErrorNoiseFrame): boolean; /** Whether a stack-frame file is provably not ours (vendor script, extension). */ export declare function isThirdPartyFrameFile(file: string | null | undefined): boolean; export declare function classifyFrameOrigin(frame: ErrorNoiseFrame, firstPartyHosts?: readonly string[]): ErrorFrameOrigin; export interface ErrorOriginAnalysis { firstParty: number; wrapper: number; thirdParty: number; extension: number; zeroLine: number; withFile: number; } export declare function analyzeErrorOrigin(frames: readonly ErrorNoiseFrame[], firstPartyHosts?: readonly string[]): ErrorOriginAnalysis; export declare function isNetworkFailureMessage(message: string): boolean; export declare function isBenignAbort(type: string, message: string): boolean; /** * A fuzz/test harness replaces `process.exit` with a function that throws this * label; running the CLI under one must not reach production telemetry. */ export declare function isTestHarnessError(parts: { value?: string; stack?: string; }): boolean; /** * Tag a capture with this (`"true"`) when the caller raises an access-control * or 4xx failure as a real failure rather than answering a rejected request — * an automation runner whose grant was lost. The rules that drop those as * expected skip it, at every boundary that classifies (server capture, ingest). */ export declare const REPORT_EXPECTED_FAILURE_TAG = "reportExpected"; export declare function classifyErrorNoise(signal: ErrorNoiseSignal): ErrorNoiseVerdict; /** * Drizzle's `Failed query: \nparams: a,b,c` carries the bound values — * emails, ids, tokens — on a second line. Left in, that line is stored in the * issue title and parsed as the culprit frame, so every user gets their own * issue and their address is readable in the list. */ export declare function stripSqlParams(text: string): string; /** Replace the user's home directory so a path never names the person. */ export declare function scrubUserPaths(text: string): string; export declare function stripAnsi(text: string): string;