AutoclosePolicy
@rotorsoft/act-root / act/src / AutoclosePolicy
Type Alias: AutoclosePolicy
AutoclosePolicy =
object
Defined in: libs/act/src/types/action.ts:723
Declarative close-policy options consumed by .autocloses({...}).
Top-level fields are AND-combined; the optional or block opens an
alternative OR-path. Omitted fields contribute nothing — they do
not mean "match everything."
Properties
after?
optionalafter?:object
Defined in: libs/act/src/types/action.ts:724
Close when head.created is at least the resolved
window in the past. Days are the close surface's only unit;
fractional days cover sub-day cooldowns ({ days: 1/24 } is one
hour) without introducing another denomination.
days
days:
number
is?
optionalis?:string| readonlystring[]
Defined in: libs/act/src/types/action.ts:725
Close when head.name matches. String for the
single-terminal-event case (the most common); readonly string[]
for multi-terminal states (Order: Shipped | Delivered | Cancelled).
keep?
optionalkeep?:object
Defined in: libs/act/src/types/action.ts:732
Rolling-window retention, independent of
the terminate fields: while the stream stays open, prune events
older than now − keep behind the closest safe snapshot via a
windowed close. Does not participate in the AND group or the or
block — a policy may terminate, prune, or both. Requires
.snap(...) earlier in the builder chain (type-gated) and a
window of at least one day — the close cycle is low-cadence
housekeeping, never sub-day realtime.
days
days:
number
or?
optionalor?:object
Defined in: libs/act/src/types/action.ts:727
Alternative OR-path. When present, the policy fires
if EITHER the top-level AND group matches OR any field inside
or matches. Used for safety-net backstops layered onto a
primary cooldown policy (e.g. "(Resolved AND 90 days) OR reaches
10k"). Nested or inside or rejects at build time.
after?
optionalafter?:object
after.days
days:
number
is?
optionalis?:string| readonlystring[]
reaches?
optionalreaches?:number
reaches?
optionalreaches?:number
Defined in: libs/act/src/types/action.ts:726
Close when the stream's event count is >= N
(inclusive — fires the moment the threshold is reached).