/** * Shared building blocks for `DeployTarget` implementations. * * These lift the byte-for-byte duplication that had accumulated across the * provider packages (the `buildStrategy` enum, an abort-aware `sleep`, the * poll-until-ready loop, and the `DeployHandle` wrapper) into one authoritative * place — the package that already owns the `DeployHandle` contract. */ import * as z from "zod"; import type { DeployContext } from "./context.js"; import type { DeployHandle } from "./deploy-handle.js"; /** * The authoritative build-strategy enum shared by every deploy target. * `local`/`managed` need an operator-supplied image; `remote` builds one. */ export declare const buildStrategySchema: z.ZodEnum<{ local: "local"; remote: "remote"; managed: "managed"; }>; export type BuildStrategy = z.infer; /** * Abort-aware sleep. Resolves after `ms`, or rejects immediately if `signal` * aborts first (so a cancelled deploy stops polling promptly). */ export declare function sleep(ms: number, signal: AbortSignal): Promise; /** Options for {@link pollUntil}. */ export interface PollUntilOptions { /** Predicate polled until it returns true. */ check: () => Promise; /** Deadline relative to `Date.now()` at the first failing check. */ timeoutMs: number; /** Delay between attempts, via the abort-aware {@link sleep}. */ intervalMs: number; signal: AbortSignal; /** Descriptive message for the timeout error; defaults to "timed out". */ timeoutMessage?: string; } /** * Poll `check()` until it returns true. Sleeps `intervalMs` between attempts * and throws once `Date.now()` passes the deadline. Generalizes the readiness * loops the deploy providers each re-implemented. */ export declare function pollUntil(opts: PollUntilOptions): Promise; /** Options for {@link makeDeployHandle}. */ export interface MakeDeployHandleOptions { wsUrl: string; /** Source of `wsAuth` redaction and the abort `signal` for the ready routine. */ ctx: DeployContext; payload: S; initialState: DeployHandle["state"]; /** Timeout passed to `ready` when `waitReady` is called without one. */ defaultReadyTimeoutMs: number; /** Readiness routine; receives the EFFECTIVE timeout (caller's or the default). */ ready: (timeoutMs: number, signal: AbortSignal) => Promise; health: () => Promise<{ healthy: boolean; detail?: string; }>; stop: () => Promise; logs?: DeployHandle["logs"]; } /** * Build a `DeployHandle` from per-target seams, replacing the wrapper each * provider had copy-pasted. Unlike those wrappers, `waitReady(timeoutMs)` * forwards the caller's timeout to `ready` instead of discarding it. */ export declare function makeDeployHandle(opts: MakeDeployHandleOptions): DeployHandle; //# sourceMappingURL=deploy-helpers.d.ts.map