// Types for module-gate-registry.js β€” written rather than `@ts-expect-error`'d, on the same // criterion as retry.d.ts and build-phases.d.ts: this is OUR module and getting it wrong is // customer-facing. // // πŸ”΄ And here the mistake `any` would hide FAILS OPEN. Under `any`, // `assertModuleGate({ env, action, module: s.modules })` β€” one letter β€” compiles, hands the gate no // modules at all, and every gated action falls through the γ€Œwe were never in a position to check」 // branch that exists for callers with no billing relationship. The gate would then refuse nobody, // on every site, silently, and the tests that call this function directly would stay green because // the defect is at the door's call site, not in the decision. /** * action β†’ the module key that action requires. Frozen, and declared THROUGH assertGatedModules, so * an action absent from it requires no module at all. */ export const MODULE_REQUIREMENTS: Readonly>; /** * Refuse a gate table naming a module this server cannot grant (MODULES) or has no refusal copy for * (REFUSAL_COPY_MODULES), and hand back a frozen snapshot of the rows just checked. Throws where the * table is declared, so a bad table never answers a lookup at all. */ export function assertGatedModules( table: Readonly>, ): Readonly>; /** The module `action` requires, or null when the table does not list it. */ export function moduleForAction(action: string): string | null; /** * Refuse an action whose paid module this site does not carry. Returns silently for an action the * table does not list, for a gate not named in MODULE_GATES_ENABLED, and for a grant we were never * in a position to check (`modules` absent) β€” only an explicit absence from a present list refuses. * * The thrown Error carries `.remediation` as well as a message that already contains the way out, * because the hosted door can pass nothing but `error.message`. Neither is built here: both come * from `moduleRefusal` / `moduleRefusalError` in src/modules.js, which every gate goes through. */ export function assertModuleGate(o: { env?: { MODULE_GATES_ENABLED?: string }; action: string; modules?: string[]; }): void;