import { type RFC9457Response, type VeryfrontErrorSnapshot } from "./types.js"; import { type RedactedValue } from "../utils/logger/redact.js"; export { isNativeErrorWithoutHooks, isProxyWithoutHooks, } from "../platform/compat/error-introspection.js"; export { buildErrorDocsUrl, ERROR_CONTEXT_MAX_LENGTH_CHARS, ERROR_DIAGNOSTIC_MAX_LENGTH_CHARS, ERROR_DOCS_BASE_URL, ERROR_DOCS_SLUG_MAX_LENGTH_CHARS, ERROR_OUTPUT_MAX_LENGTH_CHARS, ERROR_STACK_MAX_LENGTH_CHARS, limitRenderedErrorOutput, sanitizeBoundedErrorSlug, } from "./diagnostic-policy.js"; /** Mask credentials embedded in arbitrary diagnostic text. */ export declare function sanitizeDiagnosticText(value: unknown): string; /** * Prepare one untrusted diagnostic field for terminal or plain-text output. * Apply framework-owned ANSI styling only after this sanitizer returns. */ export declare function sanitizeTerminalDiagnosticText(value: unknown): string; /** Mask credentials and apply the larger shared stack bound. */ export declare function sanitizeStackDiagnosticText(value: unknown): string; export declare function sanitizeOptionalDiagnosticText(value: unknown): string | undefined; /** * Detach an untrusted throwable into framework-owned data properties. * * The returned Error can safely cross logging and HTTP boundaries: no field on * it retains a project accessor, proxy, or object-valued cause/context. */ export declare function detachThrowableForBoundary(error: unknown): Error; export declare function snapshotThrowableDiagnostic(error: unknown): string; export declare function isAbsoluteFilesystemPathForDiagnostic(path: string): boolean; /** Snapshot a bounded diagnostic after removing a trusted filesystem path. */ export declare function snapshotThrowableDiagnosticRedactingPath(error: unknown, path: string, replacement: string): string; /** * Snapshot a throwable once and return a stable Veryfront-shaped diagnostic. * * Invalid or unreadable VeryfrontError proxies degrade to the canonical * unknown-error identity. Plain errors contribute only safely-read own data. * Object-valued context is intentionally excluded so this generic snapshot * never retains project-owned accessors, proxies, or serializers. */ export declare function snapshotErrorForBoundary(error: unknown): VeryfrontErrorSnapshot; export interface ErrorLoggingBoundarySnapshot { readonly error: VeryfrontErrorSnapshot; readonly context?: RedactedValue; } /** * Capture the error identity plus a framework-owned context copy for logging. * * The generic boundary snapshot remains context-free. This narrower path * redacts and detaches the context before returning it, so callers can never * retain or serialize the project-owned source object. */ export declare function snapshotErrorForLoggingBoundary(error: unknown): ErrorLoggingBoundarySnapshot; export interface SafeProblemDetails extends RFC9457Response { stack?: string; } /** Build a credential-scrubbed RFC 9457 snapshot without calling error methods. */ export declare function createSafeProblemDetails(error: unknown, instance?: string): SafeProblemDetails; /** * Serialize a problem-details object without allowing optional diagnostics to * amplify one response beyond the shared output budget. */ export declare function stringifySafeProblemDetails(body: SafeProblemDetails, pretty?: boolean): string; //# sourceMappingURL=safe-diagnostics.d.ts.map