/** * Action recursion guard extracted from runtime.ts. * * Wraps an `execute()` body in an AsyncLocalStorage frame keyed by an * action key, deduping nested re-entries (per-key) and capping nesting * depth (`RECURSION_DEPTH_CAP`) so a misconfigured hook chain that * triggers another event whose hook triggers another event (etc.) cannot * run unbounded. * * Behaviour preserved verbatim — see P3 #24 commentary in the original * implementation for the rationale behind storing the depth meta in a * WeakMap keyed by the ALS Set so the surrounding handler signatures stay * unchanged. */ import type { AsyncLocalStorage } from "node:async_hooks"; export declare const RECURSION_DEPTH_CAP = 32; export declare const recursionDepthByStore: WeakMap, { depth: number; loggedExceedance: boolean; }>; export declare function withActionRecursionGuard(actionRecursionGuards: AsyncLocalStorage>, actionKey: string, execute: () => Promise): Promise;