/** * The `ReleaseExecutor` seam of `runDue` (RFC-0008 §6.3, §8): `SiteGraphStore.publishRelease`, * then the purge, re-planned after the batch from the pointer it moved (RFC-0045 §2, * `references/release-purge.ts`; the stored plan only fills the batch's outcome), then the * release-published hook * (`release-after.ts`; the Node server rebuilds its static site, #150). `runScheduledTick` and * "Publish now" (`ReleaseService.publishNow`) build one; both live in `releases.ts`. */ import type { ReleaseExecutor } from "@cloudhal/schedules"; import type { SqlScheduleStore } from "@cloudhal/schedules/sql"; import type { SqlDriver } from "@cloudhal/storage"; import * as after from "./release-after.js"; import type { ReleasePurge } from "./release-apply.js"; import type { ReleasePurger } from "./releases.js"; import type { SiteGraphStore } from "./store.js"; /** * Statements one release execution takes, for `runDue`'s budget check. On the tick's refusing * driver: the stored purge plan (1), the site, the live snapshot and the parent (3), the batch * (up to 8, with asset blobs to root), and the search index brought to the new snapshot (7: its * reads and one guarded batch, RFC-0019 §3). On its counting driver, never refused: for sites * with references, the run-time re-plan's two `getSnapshot` reads (RFC-0045 §2); the purge's * bookkeeping (up to 4); and `recordPurge`, correcting the outcome after a deferred or differing * purge (1). 1 + 3 + 8 + 7 + 2 + 4 + 1 = 26. A site that moved between the reads and the batch * repeats the reads and the batch once (11 more); that rare path may end the tick early * (`more`), never mid-batch, and the purge after it runs on the counting driver regardless. * * Blob calls (R2 subrequests) are bounded apart, per invocation: every release run of every tick * in it charges its re-plan's actual blob calls to one allowance (350 on Workers Free, 3,000 on * Paid; the arithmetic is in `references/release-purge.ts`), and past it the run purges * everything. */ export declare const RELEASE_EXECUTOR_COST = 26; export interface ReleaseExecutorOptions { readonly graph: SiteGraphStore; readonly schedules: SqlScheduleStore; /** Absent where nothing is cached (Node): the outcome records `purge: "none"`. */ readonly purge?: ReleasePurger | undefined; /** * Corrects the outcome's `purge` after a deferred or failed purge. Default: through `schedules`. * The tick passes one over a counting (never refusing) driver, so a committed release always * gets its purge. */ readonly recordPurge?: ((releaseId: string, purge: ReleasePurge) => Promise) | undefined; /** * The tick's counting (never refusing) driver: the run-time purge plan reads over it, and, when * `recordPurge` is absent, the outcome's correction is written over it. */ readonly counted?: SqlDriver | undefined; /** * Blob calls left for this invocation's release runs, shared by its ticks and charged by actual * calls (default: Free's `releaseBlobAllowance`). */ readonly releaseBlobs?: { left: number; } | undefined; /** After a committed release's purge (`release-after.ts`; the Node server rebuilds, #150). */ readonly onPublished?: after.ReleasePublishedHook | undefined; readonly log?: ((line: string) => void) | undefined; } /** The `ReleaseExecutor` of `runDue`: `publishRelease`, then the stored purge plan. */ export declare function releaseExecutor(o: ReleaseExecutorOptions): ReleaseExecutor;