/** * Supervisor-mode resource admission client (T12001 ยท Epic T11992). * * The `supervisor`-mode counterpart of the {@link ResourceGovernor}'s local slot * engine. Where local mode arbitrates heavy-op concurrency through cross-process * lockfiles, supervisor mode routes the `resource_admit` / `resource_release` * lease-ipc verbs to the Rust `cleo-supervisor` so a single in-memory counter is * the machine-wide source of truth. * * A dead/absent supervisor must NEVER deadlock work: every send degrades to * `{ unavailable }` on any transport error, and the governor falls back to the * local slot engine. Mirrors the `llm-queue-admit.ts` transport (core cannot * import `@cleocode/runtime` โ€” a cycle โ€” so it speaks the NDJSON codec directly * through the shared `@cleocode/contracts` lease-ipc Zod schemas). * * @task T12001 * @epic T11992 */ import { type ResourceAdmitResultResponse, type ResourceReleaseResultResponse } from '@cleocode/contracts'; /** A transport-unavailable sentinel โ€” the caller degrades to the local engine. */ export interface SupervisorUnavailable { readonly unavailable: true; readonly reason: string; } /** * Resolve the supervisor socket path: `$CLEO_SUPERVISOR_SOCKET` overrides, * otherwise `/cleo-supervisor.sock`. */ export declare function resolveSupervisorSocketPath(): string; /** * Admit (or defer) a heavy op of `cls` for `holderId` against `budget` through * the supervisor's central arbiter. Resolves the `resource_admit_result` reply, * or `{ unavailable }` when the supervisor cannot arbitrate (degrade to local). */ export declare function sendResourceAdmit(socketPath: string, cls: string, holderId: string, budget: number): Promise; /** * Release a previously-admitted slot of `cls` for `holderId`. Resolves the * `resource_release_result` reply, or `{ unavailable }` on transport failure * (the slot self-heals via the arbiter's process-death reclaim / stale recovery). */ export declare function sendResourceRelease(socketPath: string, cls: string, holderId: string): Promise; //# sourceMappingURL=supervisor-admit.d.ts.map