/** * @module autoclose-reaction * @category Internal * * Synthesis of the online close-the-books reaction. `.autocloses(policy)` * is not a sweep: it is a reaction on every event the declaring state owns * that evaluates the policy against the LIVE head (so a reopened stream * re-evaluates correctly), defers to the cooldown's earliest opening * (`head.created + the policy's min after`), and closes via `CloseSignal` * once the policy holds. * * Runs at build time — after the registry is fully merged and before the * orchestrator classifies it — so the synthesized dynamic resolver is * discovered by `classify_registry` and its target stream subscribed. The * registry is complete once the builder finishes; the orchestrator never * mutates it. * * @internal */ import type { Registry, SchemaRegister, Schemas, State } from "../types/index.js"; import type { AutocloseConfig } from "./config.js"; /** * Prefix for the synthetic per-aggregate stream the autoclose reaction * runs on. `target = \`${AUTOCLOSE_TARGET_PREFIX}${aggregate}\``, `source = * aggregate` — a watermark distinct from the aggregate's own reactions, so * an autoclose defer never short-circuits them. Internal; not a public * surface. */ export declare const AUTOCLOSE_TARGET_PREFIX = "__autoclose__:"; /** * Inject one synthesized autoclose reaction per `.autocloses(...)` state * into the registry's event registers. The handler resolves ports at call * time (`store()`), so the reaction is orchestrator-agnostic; the resolved * The reactions are synthesized once into the shared registry, so nothing * per-Act is captured here — the off-hours window is read from the running * Act at resolution time via the injected `read_window` (#1615). * * @internal */ export declare function synthesize_autoclose_reactions, TEvents extends Schemas, TActions extends Schemas>(registry: Registry, states: ReadonlyMap>, /** * Reads the *running* Act's off-hours window. Injected rather than * imported: these reactions are synthesized once into the shared * registry and run by every Act built from that builder, so the window * has to be resolved per call, and `internal/` never reaches for * ambient state itself (#1615). */ read_window: () => AutocloseConfig["autocloseWindow"]): void; //# sourceMappingURL=autoclose-reaction.d.ts.map