import { type GateCompareResult, type ToolCliContext } from '@opensip-cli/core'; import type { SignalEnvelope } from './signal-envelope.js'; /** Delivery options for the host-owned signal sink. */ export interface HostGateDeliveryOptions { readonly cwd: string; readonly reportTo?: string | undefined; readonly apiKey?: string | undefined; } /** Inputs for rendering the human `gate-done` lines after a baseline save. */ export interface HostGateSaveRenderInput { readonly envelope: SignalEnvelope; /** * Effective findings-policy verdict for presentation. This is not always sent * as a `deliverSignals` override; when omitted, the host derives the same * value from the envelope verdict. */ readonly runFailed: boolean; } /** Inputs for rendering the human `gate-done` lines after a baseline compare. */ export interface HostGateCompareRenderInput { readonly envelope: SignalEnvelope; readonly result: GateCompareResult; readonly runFailed: boolean; } /** Outcome of a gate dispatch: the mode run plus the derived gate verdict. */ export type HostGateDispatchResult = { readonly mode: 'save'; readonly runFailed?: boolean; } | { readonly mode: 'compare'; readonly result: GateCompareResult; readonly runFailed: boolean; }; /** Inputs to {@link runHostGateDispatch} — the shared `--gate-save`/`--gate-compare` tail. */ export interface RunHostGateDispatchInput { /** Tool CLI context exposing the documented host seams. */ readonly cli: ToolCliContext; /** Tool namespace used by the baseline plane and failOnDegraded policy. */ readonly tool: string; /** Fingerprint-stamped signal envelope produced by the tool run. */ readonly envelope: SignalEnvelope; /** Gate operation selected by the command flags. */ readonly mode: 'save' | 'compare'; /** Standard signal-delivery options. */ readonly deliver: HostGateDeliveryOptions; /** Optional SARIF side-output path to write after rendering. */ readonly sarifPath?: string; /** Render lines for a successful baseline save. */ readonly renderSaveLines: (input: HostGateSaveRenderInput) => readonly string[]; /** Render lines for a baseline compare result. */ readonly renderCompareLines: (input: HostGateCompareRenderInput) => readonly string[]; /** * Optional gate-save override. Omit this to let `deliverSignals` derive the * findings exit from the envelope verdict, matching the normal run path. */ readonly saveRunFailed?: (input: { readonly envelope: SignalEnvelope; }) => boolean; /** * Optional gate-compare override. Defaults to `degraded && failOnDegraded`. */ readonly compareRunFailed?: (input: { readonly envelope: SignalEnvelope; readonly result: GateCompareResult; }) => boolean; } /** * Shared host-owned gate tail for `--gate-save` / `--gate-compare`. * * Tools still own their domain run and presentation line wording. This helper * owns the repeated host seam choreography: save/compare the already-stamped * envelope, render the `gate-done` result, deliver signals with the correct * gate verdict override, and optionally write SARIF. */ export declare function runHostGateDispatch(input: RunHostGateDispatchInput): Promise; //# sourceMappingURL=gate-dispatch.d.ts.map