Skip to main content
Version: Current

Registry

@rotorsoft/act-root


@rotorsoft/act-root / act/src / Registry

Type Alias: Registry<TSchemaReg, TEvents, TActions, TStateNames>

Registry<TSchemaReg, TEvents, TActions, TStateNames> = object

Defined in: libs/act/src/types/registry.ts:96

Registry of all actions and events for a domain.

Type Parameters​

TSchemaReg​

TSchemaReg extends SchemaRegister<TActions>

State schemas.

TEvents​

TEvents extends Schemas

Event schemas.

TActions​

TActions extends Schemas

Action schemas.

TStateNames​

TStateNames extends string = string

Union of registered state name literals. Threaded by Act from the builder's TStateMap so the per-state lookup methods narrow state_name to the actual set of registered states instead of accepting any string. Defaults to string so loose references like Registry<any, any, any> keep working.

Properties​

actions​

readonly actions: { [TKey in keyof TActions]: State<TSchemaReg[TKey], TEvents, TActions> }

Defined in: libs/act/src/types/registry.ts:102

Map of action names to state definitions.


autoclose_archiver​

readonly autoclose_archiver: (state_name) => ((stream, head) => Promise<void>) | null

Defined in: libs/act/src/types/registry.ts:143

Lookup of the .archives(fn) declaration per state name. Returns null when the state didn't declare an archiver — the cycle truncates without an archive step, matching the default behavior of explicit app.close({ stream }) calls. Threaded into CloseTarget.archive only when present.

Parameters​

state_name​

TStateNames

Returns​

((stream, head) => Promise<void>) | null


autoclose_policy​

readonly autoclose_policy: (state_name) => ((stream, head, count) => boolean) | null

Defined in: libs/act/src/types/registry.ts:127

Lookup of the .autocloses(predicate) declaration per state name. Returns null when the state opted out of online close — the orchestrator's autoclose cycle skips states with a null policy so the per-cycle cost is paid only by opt-in states.

Parameters​

state_name​

TStateNames

Returns​

((stream, head, count) => boolean) | null


deprecated_events​

readonly deprecated_events: (state_name) => ReadonlySet<string>

Defined in: libs/act/src/types/registry.ts:120

Lookup of deprecated event names per state name. Derived from the _v<digits> versioning convention at build time: for each state, every event whose base name has a higher-numbered sibling is "deprecated." Returns an empty set for states with no deprecation in scope. The framework surfaces deprecations once at build time (static .emit("X") targeting a deprecated name throws; a single startup advisory enumerates every legacy event in scope) — there is intentionally no runtime warn on dynamic emits, so the build-time advisory is the only channel. Exposed here for callers that want to layer their own warning policy on top.

Parameters​

state_name​

TStateNames

Returns​

ReadonlySet<string>


disclosure_predicate​

readonly disclosure_predicate: (state_name) => ((event, actor) => boolean) | null

Defined in: libs/act/src/types/registry.ts:112

Lookup of the .discloses(predicate) declaration per state name. Returns null when no predicate was set (framework default-deny).

Parameters​

state_name​

TStateNames

Returns​

((event, actor) => boolean) | null


events​

readonly events: EventRegister<TEvents>

Defined in: libs/act/src/types/registry.ts:105

Map of event names to event registration info.


query_gate​

readonly query_gate: (event_name) => (event) => Committed<TEvents, keyof TEvents>

Defined in: libs/act/src/types/registry.ts:107

Prebuilt per-event reader for the actor-less read surfaces (query / query_array). Types the payload from its declared schema (a z.date() comes back a Date from the string JSON forced it into) and applies the disclosure gate, in one call. Every event resolves to a gate: a non-sensitive event returns the shared identity gate (the event is handed back untouched, zero allocation); a sensitive event returns a redactor built once at build time that closes over the field list and applies default-deny ([REDACTED], or [SHREDDED] once the pii column is forgotten) while dropping the isolated pii sidecar. The gate is prebuilt so the read path never recomputes the sensitive-field lookup per event — only the sensitive events pay any cost.

Parameters​

event_name​

string

Returns​

(event) => Committed<TEvents, keyof TEvents>


sensitive_fields​

readonly sensitive_fields: (event_name) => readonly string[]

Defined in: libs/act/src/types/registry.ts:106

Lookup of sensitive(...)-marked fields per event name. Derived once at build time. Returns the empty array for unknown events.

Parameters​

event_name​

string

Returns​

readonly string[]