import { type PlaceVersionSource, type WatchStream } from '@quenty/nevermore-deploy'; import { type LocalWatchEntry } from './local-watch-loop.js'; /** A locally-watched place, paired with the watch name it was registered under. */ export interface StreamWatchEntry extends LocalWatchEntry { /** `Watch.name` in the registered monitor; how the service refers to it. */ watchName: string; } export interface StreamWatchLoopOptions { entries: StreamWatchEntry[]; stream: WatchStream; /** * Where the version to build from comes from. * * The service and this CLI do not share a version vocabulary — see the note * on `_settleAsync` — so the stream says *that* a place moved and this says * *what* it moved to. */ source: PlaceVersionSource; monitorId: string; /** Bearer token; the same one registration used. */ credential: string; /** Rebuild and redeploy. Errors are reported and the stream stays up. */ redeployAsync: (entry: StreamWatchEntry, version: number) => Promise; /** Lets a caller stop the loop; SIGINT is wired to one by default. */ signal?: AbortSignal; } export interface StreamWatchLoopResult { redeploys: number; failures: number; reconnects: number; /** True when the monitor went away rather than the user stopping. */ monitorGone: boolean; /** True when the service refused the handshake for good. */ rejected: boolean; /** * True when the service cannot observe any of these places, so holding the * stream would wait forever. The caller should fall back to polling. */ unobservable: boolean; } /** * Watch by being told, and rebuild here. * * The service polls the base place and pushes a `notify` when it moves, so this * side holds a socket instead of a poll timer — no Open Cloud quota spent per * developer, and the rebuild starts when the change happens rather than up to * an interval later. * * There is no session length. A held connection renews the monitor's lease, so * the lease passed to `--watch` is a floor for how long the monitor outlives a * dropped link, not a clock on the terminal: this runs until Ctrl-C. */ export declare function runStreamWatchLoopAsync(options: StreamWatchLoopOptions): Promise; //# sourceMappingURL=stream-watch-loop.d.ts.map