/** Default cancel-poll cadence. Snappier than the 60s credit poll so a user's cancel lands within a few * seconds; each poll is a cheap brokered run-status read. */ export declare const DEFAULT_CANCEL_CHECK_INTERVAL_MS = 5000; export interface CancelWatcherDeps { /** The run being watched (for correlation/logging). */ runId: string; /** Resolves true once the run has been asked to cancel. Brokered * (`RunnerControlClient.checkCancelled` → `GET /cancel`), so the runner never reads the DB. */ isCancelled: () => Promise; /** Fired exactly once the first time the run is seen to be cancelled. */ onCancelled: () => void; intervalMs?: number; } export declare class CancelWatcher { private readonly deps; private timer; private firing; private cancelled; private stopped; constructor(deps: CancelWatcherDeps); /** Begin periodic cancel checks. */ start(): void; /** Stop checking and drain any in-flight check. Idempotent. */ stop(): Promise; /** Whether a cancel was detected (the orchestrator may read this to shape the terminal result). */ wasCancelled(): boolean; /** True once the watcher should no longer act. A method (not an inline field read) so it's * re-evaluated after an `await` — `stop()` can flip `stopped` mid-check. */ private done; private check; }