/** * Governance D3 — Conductor-spawn request store (append-only). * * Records each time h2a emits a conductor-launch-request envelope to a remote * agent, so the cap/cooldown guard can suppress duplicate requests within the * 30-minute window. * * File: `/.h2a/governance/conductor-spawns.jsonl` * Event shape: `{ workspaceId: string, at: string, to?: string }` * * API mirrors claims.ts — append-only, no deletion, no enforcement. */ export interface SpawnRequestEvent { readonly workspaceId: string; /** ISO 8601 timestamp when the request was emitted. */ readonly at: string; /** The remote instance that received the request, if known. */ readonly to?: string; } /** * Append a conductor-spawn request event to the JSONL store. * Creates the governance directory if it does not exist. */ export declare function recordSpawnRequest(root: string, event: SpawnRequestEvent): void; /** * Return the `at` timestamp of the most recent spawn request for a workspace, * or `undefined` if none has been recorded. * * Uses canonical comparison so the workspace id is case-fold and slug-stable. */ export declare function lastSpawnRequestAt(root: string, workspaceId: string): string | undefined; export interface SpawnAllowedOpts { /** ISO 8601 timestamp of the last recorded spawn request, or undefined. */ readonly lastSpawnAt?: string; /** Reference instant in ms (Date.now()). */ readonly now: number; /** Cooldown window in ms (default 1 800 000 = 30 min). */ readonly cooldownMs?: number; } /** * Pure helper: return true iff emitting a new spawn request is allowed. * * Rules: * - No previous request → always allowed. * - Previous request exists → allowed only if `now - Date.parse(lastSpawnAt) >= cooldownMs`. * * Default cooldown is 30 minutes (1 800 000 ms). */ export declare function spawnAllowed(opts: SpawnAllowedOpts): boolean; //# sourceMappingURL=spawns.d.ts.map