import type { OutputFormat } from '../types.js'; export interface EmitErrorOpts { /** Output format for routing — only json/jsonl emit through here today. */ format: OutputFormat; /** Forward --timing so meta.timing_ms surfaces on error envelopes too. */ timing?: boolean; /** Code to use when the thrown value is NOT a SessionReaderError. */ fallbackCode: string; } /** * Emit a v2 failure envelope for `err` and set process.exitCode. * * Behaves identically to the legacy in-command catch blocks the codebase * shipped before this helper landed — promoting the shape into one place * means every command surfaces the same `class`/`code`/`retryable`/ * `detail`/`suggestion` fields without per-file drift. * * Callers that still need a TTY error string can keep their own * formatter.error() write before/after calling this; we don't lock that * out, but if you can, prefer routing the human path through * createFormatter().error() and letting this helper own the structured * channel. */ export declare function emitError(err: unknown, opts: EmitErrorOpts): void; //# sourceMappingURL=error-emit.d.ts.map