import { type TaskContext } from "@renderinc/sdk/workflows"; import { type RenderDeps } from "./client.js"; import { type EnsureServiceResult } from "./ensureService.js"; import { type ProvisionServiceInput, type ProvisionServiceResult } from "./types.js"; /** * Deps for `provisionService`: the port (for the Phase-2 `getDeploy` poll) plus * the Phase-1 `ensureService` collaborator. In production `ensureService` is the * **wrapped** `render.ensureService` task, so the find-or-create runs as a * durable subtask that the SDK replays from its checkpoint cache on re-dispatch * (ADR-0004/ADR-0012 injection seam). Tests inject a fake. */ export interface ProvisionServiceDeps extends RenderDeps { ensureService: (input: ProvisionServiceInput) => Promise; } /** * Raw implementation of render.provisionService — provision/reconcile a service * and observe its deploy, in two phases: * * - **Phase 1 (once):** `deps.ensureService` — the find-or-create-by-name that * lists/creates `/services`. In production this is the wrapped * `render.ensureService` subtask, so it runs *once* and replays from the SDK * checkpoint cache when PROVISION_RETRY re-dispatches this task. * - **Phase 2 (the durable re-poll):** read the deploy by id via `getDeploy` * ONLY — never re-listing `/services`. Re-listing on every 15s poll is exactly * what sustained the production 429 storm; polling by id keeps each re-dispatch * to a single cheap `/services/{id}/deploys/{id}` read (ADR-0025). * * Only *in-progress* deploys throw (to drive the re-poll). A **terminal deploy * failure is a RETURN with `live: false`, not a throw** — SDK 0.6.0's retry is * count-based and re-dispatches on any throw, so throwing on a doomed deploy * would re-poll it for the full ~20-minute window. Returning lets repair-on- * failure callers (they branch on `live`) act promptly. Transient HTTP errors * (429/5xx) from either phase still throw and are retried — and the shared client * now absorbs a 429 burst in-process first (RENDER_HTTP_BACKOFF). */ export declare function provisionServiceImpl(ctx: TaskContext, input: ProvisionServiceInput, deps?: ProvisionServiceDeps): Promise; /** Provision or reconcile a Render service and wait for its deploy. */ export declare const provisionService: import("@renderinc/sdk/workflows").TaskDefinition<[input: ProvisionServiceInput, deps?: ProvisionServiceDeps | undefined], ProvisionServiceResult>; //# sourceMappingURL=provisionService.d.ts.map