import type { Mode } from '../canvas/index.js'; /** Kill switch. `CRTR_WARM_POOL=0` makes every create cold again: claims stop, * refills stop, and daemon-start pre-warm no-ops. Read live (not cached at * module load) so flipping it takes effect on the next `crtr sys daemon * restart` without a rebuild. Env rather than config because the operators who * need it are guest containers — a Blaxel sandbox spec and the local-docker * compose both already carry per-home env, and neither has a config file the * host controls. * * Turn it off when a spare's ~150-300 MB resident broker is the scarce * resource (a memory-capped guest), or to isolate the pool while debugging a * node that came back wearing the wrong persona. */ export declare function warmPoolEnabled(): boolean; /** What a `prefer_warm` create is asking for. Only a subset of this is frozen * into the pool key (see `warmRecipeKey`); the rest is applied at claim time. */ export interface WarmRequest { kind: string; mode: Mode; cwd: string; /** The RAW `--profile` operand: a string to pin, `null` for explicitly no * profile, `undefined` to let the daemon resolve one for the cwd. */ profile: string | null | undefined; model: string | null; situationalContext: string | null; name: string | null; } /** Claim a spare for `request`, reshaped onto its persona — or null when the * pool cannot serve it. The caller falls back to a cold spawn; a claim never * fails the create. */ export declare function claimWarmNode(request: WarmRequest): Promise; /** Return every spare that is no longer worth its broker: one whose engine is * confirmed GONE (the common case — a daemon handover tears down every broker * of its epoch and nothing resumes a spare), one whose row left `active`/`idle`, * and one nobody claimed inside `SPARE_TTL_MS`. * * Order matters: the marker is deleted FIRST, atomically, which is the same * move a claim makes — so a spare handed out a microsecond earlier is left * alone (`unregisterWarmSpare` returns false) and never torn down under its * new owner. Only after winning the marker is the broker killed and the row + * dir deleted. Never throws: a failed reap is retried on the next sweep. */ export declare function reapStaleSpares(): string[]; /** Bring the pool for `request` back to depth 1, in the background. Never * throws and never blocks a caller: a failed mint just means the next create * for this key is cold again. */ export declare function refillWarmPool(request: WarmRequest): void; /** Mint a spare for the most recently used project recipes so the FIRST create * after crtrd boots is warm too, not only the second. The recipe is sourced * from real recent roots — (cwd, profile) is the whole of it, since everything * else a claim reshapes live. Fire-and-forget: returns as soon as the mints * are scheduled, never blocking the daemon's work lane. */ export declare function prewarmRecentRecipes(): void;