import { type BasePlaceVersionKeyword, type PlaceVersionSource } from '@quenty/nevermore-deploy'; /** One base place being watched, and what to rebuild when it moves. */ export interface LocalWatchEntry { /** Human label for output, e.g. `integration.places.hub`. */ label: string; universeId: number; placeId: number; versionType: BasePlaceVersionKeyword; /** * Version this entry was last built from. Undefined means "adopt whatever * the first poll sees", which avoids a rebuild on startup for a place that * has never been locked. */ baseline?: number; } export interface LocalWatchLoopOptions { entries: LocalWatchEntry[]; source: PlaceVersionSource; /** Stop watching after this long. */ durationMs: number; pollIntervalMs?: number; /** Rebuild and redeploy. Errors are reported and the loop continues. */ redeployAsync: (entry: LocalWatchEntry, version: number) => Promise; /** Lets a caller stop the loop; SIGINT is wired to one by default. */ signal?: AbortSignal; /** Injected in tests. */ now?: () => number; sleepAsync?: (ms: number, signal: AbortSignal) => Promise; } export interface LocalWatchLoopResult { /** Rebuilds that completed. */ redeploys: number; /** Rebuilds that were attempted and threw. */ failures: number; /** True when the duration ran out rather than the user interrupting. */ expired: boolean; } /** * Poll base places and redeploy in-process when one moves. * * This is what `--watch` does outside CI. Registering with the watch service * would be pointless on a laptop: the service's only action is dispatching a * GitHub workflow, which would rebuild on a runner rather than here — so a * local run keeps the loop in the terminal, where the developer can see it. * * Poll failures never end the loop. A watch is meant to be left running for * hours, and a dropped connection is not a reason to stop watching. */ export declare function runLocalWatchLoopAsync(options: LocalWatchLoopOptions): Promise; //# sourceMappingURL=local-watch-loop.d.ts.map