export interface GateVerdict { readonly outcome: "pass" | "fail" | "blocked"; readonly reason: string; readonly runId: string; readonly value?: string; } export interface GateCall { readonly url: string; readonly waitS: number; readonly blockedExit: number; readonly request: string; } export type Parsed = { kind: "call"; call: GateCall; } | { kind: "help"; } | { kind: "error"; message: string; }; export declare const WAIT_DEFAULT_S = 1800; export declare const USAGE = "intentic-gate: run an intentic release gate and exit on its verdict\n\nusage: intentic-gate [options] [request...]\n\nThe request, what this pipeline knows: commit, branch, preview URL, is the arguments joined,\nor stdin when none are given (so `git log -1 | intentic-gate` works).\n\noptions:\n --url the gate's webhook URL, token and all (or env INTENTIC_GATE_URL)\n --wait how long the gate holds the connection (default 1800; the server caps at 3h)\n --blocked exit code for a blocked verdict (default 0: \"could not judge\" is not a failed build)\n -h, --help this text\n\nexit codes: 0 pass (and blocked, unless --blocked says otherwise) \u00B7 1 fail \u00B7 2 the exchange itself\nfailed, wrong token, no such gate, daily ceiling reached, network. 2 is never a verdict: it means\nthe pipeline's wiring needs a person, not that the product does."; export declare const parseArgs: (argv: readonly string[], envUrl: string | undefined) => Parsed; export interface Dial { readonly url: string; readonly headers: Record; } export declare const dialOf: (url: string, waitS?: number) => Dial; export declare const clientTimeoutMs: (waitS: number) => number; export declare const readVerdict: (body: unknown) => GateVerdict | undefined; export declare const exitOf: (verdict: GateVerdict, blockedExit: number) => number; export declare class GateExchangeError extends Error { } export interface GateDeps { readonly fetch: (url: string, init: { method: string; headers: Record; body: string; signal: AbortSignal; }) => Promise<{ ok: boolean; status: number; text: () => Promise; }>; } export declare const gateExchange: ({ url, waitS, request }: Pick, deps: GateDeps) => Promise; export * from "./run.js"; //# sourceMappingURL=gate.d.ts.map