/** Algorithm version recorded beside every emitted fingerprint. */ export declare const CRASH_FINGERPRINT_VERSION = 1; /** Hex length of a published fingerprint (128 bits). */ export declare const CRASH_FINGERPRINT_HEX_LENGTH = 32; /** Matches exactly a published fingerprint. */ export declare const CRASH_FINGERPRINT_PATTERN: RegExp; /** Marker used for the machine-readable identity line of each crash record. */ export declare const CRASH_RECORD_MARKER = "gjc-crash-record.v1"; /** Marker embedded in an external issue body, outside crash-derived blocks. */ export declare const CRASH_ISSUE_MARKER_PREFIX = "gjc-crash-fp.v1:"; /** Literal frame used when a stack carries no in-app frame at all. */ export declare const NO_APP_FRAME = ""; export interface CrashFingerprintInput { readonly name: string; readonly message: string; readonly stack: string; } export interface CrashFingerprint { /** 32 lowercase hex characters. */ readonly fingerprint: string; /** Algorithm version (`fpv`). */ readonly version: number; readonly errorName: string; /** Normalized, placeholder-substituted message class (safe to display). */ readonly messageClass: string; /** Normalized in-app frames that participated in the digest. */ readonly frames: readonly string[]; } export interface CrashFingerprintOptions { /** Install root used to relativize in-app frames. Defaults to the GJC install root. */ readonly installRoot?: string; /** Home directory used for `` substitution. Defaults to `os.homedir()`. */ readonly homeDir?: string; } /** * Replace absolute path-like tokens with `` / ``. * * Semantically meaningful codes are untouched: this rule only fires on tokens * that are recognizably absolute filesystem paths. */ export declare function replaceAbsolutePaths(text: string, homeDir?: string): string; /** * Typed message normalization. * * Deliberately *not* "strip all digits": HTTP statuses, exit codes and errno * names are the difference between distinct crash classes, so runs of three or * fewer digits and alphabetic error codes survive verbatim (`404` stays * distinct from `500`). Only high-entropy identifiers are collapsed. */ export declare function normalizeCrashMessage(message: string, options?: CrashFingerprintOptions): string; /** * Normalized in-app frames, newest first, capped at three. * * A frame is `#` with no line or column * numbers. Stacks with no in-app frame yield the single literal * ``; distinct roots can merge under that literal, which is an * accepted and documented v1 property. */ export declare function normalizeCrashFrames(stack: string, options?: CrashFingerprintOptions): string[]; /** Compute the v1 fingerprint of an already-captured fatal diagnostic. */ export declare function computeCrashFingerprint(input: CrashFingerprintInput, options?: CrashFingerprintOptions): CrashFingerprint; /** * Compute the stable identity used for a handled tool error. * * Tool failures often carry command output or other per-occurrence detail in * their message. That text is useful in the record body but is not the failure * identity: handled errors group by error class and the first in-app frame * where the failure originated, rather than the full wrapper stack. */ export declare function computeHandledErrorFingerprint(input: CrashFingerprintInput, options?: CrashFingerprintOptions): CrashFingerprint; /** The machine-readable identity line appended to every new crash record. */ export declare function formatCrashRecordMarker(fingerprint: string, version: number, recordId: string): string; export interface CrashRecordMarker { readonly fingerprint: string; readonly version: number; readonly recordId: string; } /** * Parse an identity line. Records written before this feature carry no marker * and are therefore `unmatchable`: this parser never guesses at them. */ export declare function parseCrashRecordMarker(line: string): CrashRecordMarker | undefined;