import type { ResultEnvelope } from 'peaks-loop-shared/result'; import type { ProbeResult } from '../../services/workflow/workflow-inflight-probe.js'; /** One probe diagnostic, reduced to the two fields a consumer needs. */ export interface DeferralCode { readonly code: string; readonly message: string; } /** What the deferral was, in the shape the envelope carries it. */ export interface DeferralDetail { /** The probe's own reason: `fresh-dispatch` or `unknown-ledger-state`. */ readonly reason: string; /** True when the deferral rests on something the probe could not establish. */ readonly unknown: boolean; readonly warnings: readonly DeferralCode[]; readonly errors: readonly DeferralCode[]; } /** The probe's answer, in the shape the envelope carries it. */ export declare function describeDeferral(probe: ProbeResult): DeferralDetail; /** * The one sentence that tells the two deferrals apart. * * The codes are named because they are the machine-readable half of the same * fact, and an operator who wants the detail can grep the code. */ export declare function deferralSentence(detail: DeferralDetail): string; /** * The envelope, with the deferral's reason attached. * * The detail lands in three places, because three readers exist: `data.deferral` * for a machine, `warnings` for the codes the probe collected, and the message * itself for whoever reads the printed output. An envelope that did not defer * comes back unchanged. */ export declare function withDeferralDetail(envelope: ResultEnvelope, detail: DeferralDetail | null): ResultEnvelope;