@nwire/forge 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/__tests__/actor-methods.test.d.ts +9 -0
- package/dist/__tests__/actor-methods.test.d.ts.map +1 -0
- package/dist/__tests__/actor-methods.test.js +210 -0
- package/dist/__tests__/actor-methods.test.js.map +1 -0
- package/dist/__tests__/actor-schema-bound.test.d.ts +6 -0
- package/dist/__tests__/actor-schema-bound.test.d.ts.map +1 -0
- package/dist/__tests__/actor-schema-bound.test.js +112 -0
- package/dist/__tests__/actor-schema-bound.test.js.map +1 -0
- package/dist/__tests__/app-capabilities.test.d.ts +19 -0
- package/dist/__tests__/app-capabilities.test.d.ts.map +1 -0
- package/dist/__tests__/app-capabilities.test.js +57 -0
- package/dist/__tests__/app-capabilities.test.js.map +1 -0
- package/dist/__tests__/cli-runner.test.d.ts +6 -0
- package/dist/__tests__/cli-runner.test.d.ts.map +1 -0
- package/dist/__tests__/cli-runner.test.js +158 -0
- package/dist/__tests__/cli-runner.test.js.map +1 -0
- package/dist/__tests__/create-app.test.d.ts +18 -0
- package/dist/__tests__/create-app.test.d.ts.map +1 -0
- package/dist/__tests__/create-app.test.js +189 -0
- package/dist/__tests__/create-app.test.js.map +1 -0
- package/dist/__tests__/cross-service-bus.test.d.ts +8 -0
- package/dist/__tests__/cross-service-bus.test.d.ts.map +1 -0
- package/dist/__tests__/cross-service-bus.test.js +139 -0
- package/dist/__tests__/cross-service-bus.test.js.map +1 -0
- package/dist/__tests__/define-schema.test.d.ts +5 -0
- package/dist/__tests__/define-schema.test.d.ts.map +1 -0
- package/dist/__tests__/define-schema.test.js +83 -0
- package/dist/__tests__/define-schema.test.js.map +1 -0
- package/dist/__tests__/dev-logger.test.d.ts +9 -0
- package/dist/__tests__/dev-logger.test.d.ts.map +1 -0
- package/dist/__tests__/dev-logger.test.js +126 -0
- package/dist/__tests__/dev-logger.test.js.map +1 -0
- package/dist/__tests__/external-call.test.d.ts +14 -0
- package/dist/__tests__/external-call.test.d.ts.map +1 -0
- package/dist/__tests__/external-call.test.js +99 -0
- package/dist/__tests__/external-call.test.js.map +1 -0
- package/dist/__tests__/framework-events.test.d.ts +13 -0
- package/dist/__tests__/framework-events.test.d.ts.map +1 -0
- package/dist/__tests__/framework-events.test.js +204 -0
- package/dist/__tests__/framework-events.test.js.map +1 -0
- package/dist/__tests__/inline-handler.test.d.ts +8 -0
- package/dist/__tests__/inline-handler.test.d.ts.map +1 -0
- package/dist/__tests__/inline-handler.test.js +101 -0
- package/dist/__tests__/inline-handler.test.js.map +1 -0
- package/dist/__tests__/lifecycle-logging.test.d.ts +12 -0
- package/dist/__tests__/lifecycle-logging.test.d.ts.map +1 -0
- package/dist/__tests__/lifecycle-logging.test.js +112 -0
- package/dist/__tests__/lifecycle-logging.test.js.map +1 -0
- package/dist/__tests__/middleware.test.d.ts +7 -0
- package/dist/__tests__/middleware.test.d.ts.map +1 -0
- package/dist/__tests__/middleware.test.js +109 -0
- package/dist/__tests__/middleware.test.js.map +1 -0
- package/dist/__tests__/module-needs.test.d.ts +10 -0
- package/dist/__tests__/module-needs.test.d.ts.map +1 -0
- package/dist/__tests__/module-needs.test.js +77 -0
- package/dist/__tests__/module-needs.test.js.map +1 -0
- package/dist/__tests__/module-topo-sort.test.d.ts +15 -0
- package/dist/__tests__/module-topo-sort.test.d.ts.map +1 -0
- package/dist/__tests__/module-topo-sort.test.js +105 -0
- package/dist/__tests__/module-topo-sort.test.js.map +1 -0
- package/dist/__tests__/multi-tenancy.test.d.ts +10 -0
- package/dist/__tests__/multi-tenancy.test.d.ts.map +1 -0
- package/dist/__tests__/multi-tenancy.test.js +122 -0
- package/dist/__tests__/multi-tenancy.test.js.map +1 -0
- package/dist/__tests__/needs-topology.test.d.ts +11 -0
- package/dist/__tests__/needs-topology.test.d.ts.map +1 -0
- package/dist/__tests__/needs-topology.test.js +82 -0
- package/dist/__tests__/needs-topology.test.js.map +1 -0
- package/dist/__tests__/plugin-closure.test.d.ts +15 -0
- package/dist/__tests__/plugin-closure.test.d.ts.map +1 -0
- package/dist/__tests__/plugin-closure.test.js +140 -0
- package/dist/__tests__/plugin-closure.test.js.map +1 -0
- package/dist/__tests__/plugin.test.d.ts +10 -0
- package/dist/__tests__/plugin.test.d.ts.map +1 -0
- package/dist/__tests__/plugin.test.js +225 -0
- package/dist/__tests__/plugin.test.js.map +1 -0
- package/dist/__tests__/primitives.test.d.ts +9 -0
- package/dist/__tests__/primitives.test.d.ts.map +1 -0
- package/dist/__tests__/primitives.test.js +434 -0
- package/dist/__tests__/primitives.test.js.map +1 -0
- package/dist/__tests__/production-readiness.test.d.ts +22 -0
- package/dist/__tests__/production-readiness.test.d.ts.map +1 -0
- package/dist/__tests__/production-readiness.test.js +196 -0
- package/dist/__tests__/production-readiness.test.js.map +1 -0
- package/dist/__tests__/provider.test.d.ts +6 -0
- package/dist/__tests__/provider.test.d.ts.map +1 -0
- package/dist/__tests__/provider.test.js +122 -0
- package/dist/__tests__/provider.test.js.map +1 -0
- package/dist/__tests__/public-marker.test.d.ts +7 -0
- package/dist/__tests__/public-marker.test.d.ts.map +1 -0
- package/dist/__tests__/public-marker.test.js +54 -0
- package/dist/__tests__/public-marker.test.js.map +1 -0
- package/dist/__tests__/retry-dlq.test.d.ts +6 -0
- package/dist/__tests__/retry-dlq.test.d.ts.map +1 -0
- package/dist/__tests__/retry-dlq.test.js +68 -0
- package/dist/__tests__/retry-dlq.test.js.map +1 -0
- package/dist/__tests__/validate.test.d.ts +5 -0
- package/dist/__tests__/validate.test.d.ts.map +1 -0
- package/dist/__tests__/validate.test.js +53 -0
- package/dist/__tests__/validate.test.js.map +1 -0
- package/dist/__tests__/workflow-saga.test.d.ts +7 -0
- package/dist/__tests__/workflow-saga.test.d.ts.map +1 -0
- package/dist/__tests__/workflow-saga.test.js +239 -0
- package/dist/__tests__/workflow-saga.test.js.map +1 -0
- package/dist/actor-store.d.ts +83 -0
- package/dist/actor-store.d.ts.map +1 -0
- package/dist/actor-store.js +85 -0
- package/dist/actor-store.js.map +1 -0
- package/dist/cli-runner.d.ts +46 -0
- package/dist/cli-runner.d.ts.map +1 -0
- package/dist/cli-runner.js +164 -0
- package/dist/cli-runner.js.map +1 -0
- package/dist/create-app.d.ts +131 -0
- package/dist/create-app.d.ts.map +1 -0
- package/dist/create-app.js +593 -0
- package/dist/create-app.js.map +1 -0
- package/dist/define-action.d.ts +148 -0
- package/dist/define-action.d.ts.map +1 -0
- package/dist/define-action.js +52 -0
- package/dist/define-action.js.map +1 -0
- package/dist/define-actor.d.ts +302 -0
- package/dist/define-actor.d.ts.map +1 -0
- package/dist/define-actor.js +294 -0
- package/dist/define-actor.js.map +1 -0
- package/dist/define-app.d.ts +104 -0
- package/dist/define-app.d.ts.map +1 -0
- package/dist/define-app.js +49 -0
- package/dist/define-app.js.map +1 -0
- package/dist/define-cron.d.ts +50 -0
- package/dist/define-cron.d.ts.map +1 -0
- package/dist/define-cron.js +34 -0
- package/dist/define-cron.js.map +1 -0
- package/dist/define-error.d.ts +10 -0
- package/dist/define-error.d.ts.map +1 -0
- package/dist/define-error.js +10 -0
- package/dist/define-error.js.map +1 -0
- package/dist/define-external-call.d.ts +85 -0
- package/dist/define-external-call.d.ts.map +1 -0
- package/dist/define-external-call.js +38 -0
- package/dist/define-external-call.js.map +1 -0
- package/dist/define-handler.d.ts +98 -0
- package/dist/define-handler.d.ts.map +1 -0
- package/dist/define-handler.js +29 -0
- package/dist/define-handler.js.map +1 -0
- package/dist/define-inbound-webhook.d.ts +82 -0
- package/dist/define-inbound-webhook.d.ts.map +1 -0
- package/dist/define-inbound-webhook.js +42 -0
- package/dist/define-inbound-webhook.js.map +1 -0
- package/dist/define-inbox.d.ts +40 -0
- package/dist/define-inbox.d.ts.map +1 -0
- package/dist/define-inbox.js +31 -0
- package/dist/define-inbox.js.map +1 -0
- package/dist/define-initializer.d.ts +54 -0
- package/dist/define-initializer.d.ts.map +1 -0
- package/dist/define-initializer.js +38 -0
- package/dist/define-initializer.js.map +1 -0
- package/dist/define-middleware.d.ts +8 -0
- package/dist/define-middleware.d.ts.map +1 -0
- package/dist/define-middleware.js +8 -0
- package/dist/define-middleware.js.map +1 -0
- package/dist/define-model.d.ts +10 -0
- package/dist/define-model.d.ts.map +1 -0
- package/dist/define-model.js +13 -0
- package/dist/define-model.js.map +1 -0
- package/dist/define-module.d.ts +157 -0
- package/dist/define-module.d.ts.map +1 -0
- package/dist/define-module.js +60 -0
- package/dist/define-module.js.map +1 -0
- package/dist/define-outbox.d.ts +47 -0
- package/dist/define-outbox.d.ts.map +1 -0
- package/dist/define-outbox.js +36 -0
- package/dist/define-outbox.js.map +1 -0
- package/dist/define-plugin.d.ts +171 -0
- package/dist/define-plugin.d.ts.map +1 -0
- package/dist/define-plugin.js +134 -0
- package/dist/define-plugin.js.map +1 -0
- package/dist/define-projection.d.ts +56 -0
- package/dist/define-projection.d.ts.map +1 -0
- package/dist/define-projection.js +44 -0
- package/dist/define-projection.js.map +1 -0
- package/dist/define-provider.d.ts +49 -0
- package/dist/define-provider.d.ts.map +1 -0
- package/dist/define-provider.js +45 -0
- package/dist/define-provider.js.map +1 -0
- package/dist/define-query.d.ts +50 -0
- package/dist/define-query.d.ts.map +1 -0
- package/dist/define-query.js +33 -0
- package/dist/define-query.js.map +1 -0
- package/dist/define-resolver.d.ts +111 -0
- package/dist/define-resolver.d.ts.map +1 -0
- package/dist/define-resolver.js +146 -0
- package/dist/define-resolver.js.map +1 -0
- package/dist/define-schema.d.ts +88 -0
- package/dist/define-schema.d.ts.map +1 -0
- package/dist/define-schema.js +72 -0
- package/dist/define-schema.js.map +1 -0
- package/dist/define-workflow.d.ts +193 -0
- package/dist/define-workflow.d.ts.map +1 -0
- package/dist/define-workflow.js +345 -0
- package/dist/define-workflow.js.map +1 -0
- package/dist/dev-logger.d.ts +41 -0
- package/dist/dev-logger.d.ts.map +1 -0
- package/dist/dev-logger.js +135 -0
- package/dist/dev-logger.js.map +1 -0
- package/dist/event-message.d.ts +37 -0
- package/dist/event-message.d.ts.map +1 -0
- package/dist/event-message.js +51 -0
- package/dist/event-message.js.map +1 -0
- package/dist/foundation.d.ts +14 -0
- package/dist/foundation.d.ts.map +1 -0
- package/dist/foundation.js +14 -0
- package/dist/foundation.js.map +1 -0
- package/dist/framework-event-bus.d.ts +13 -0
- package/dist/framework-event-bus.d.ts.map +1 -0
- package/dist/framework-event-bus.js +13 -0
- package/dist/framework-event-bus.js.map +1 -0
- package/dist/framework-events.d.ts +121 -0
- package/dist/framework-events.d.ts.map +1 -0
- package/dist/framework-events.js +67 -0
- package/dist/framework-events.js.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/module-surface.d.ts +47 -0
- package/dist/module-surface.d.ts.map +1 -0
- package/dist/module-surface.js +65 -0
- package/dist/module-surface.js.map +1 -0
- package/dist/projection-store.d.ts +26 -0
- package/dist/projection-store.d.ts.map +1 -0
- package/dist/projection-store.js +28 -0
- package/dist/projection-store.js.map +1 -0
- package/dist/public-marker.d.ts +35 -0
- package/dist/public-marker.d.ts.map +1 -0
- package/dist/public-marker.js +45 -0
- package/dist/public-marker.js.map +1 -0
- package/dist/response.d.ts +8 -0
- package/dist/response.d.ts.map +1 -0
- package/dist/response.js +8 -0
- package/dist/response.js.map +1 -0
- package/dist/runtime.d.ts +497 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1083 -0
- package/dist/runtime.js.map +1 -0
- package/dist/validate.d.ts +33 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +48 -0
- package/dist/validate.js.map +1 -0
- package/dist/when.d.ts +101 -0
- package/dist/when.d.ts.map +1 -0
- package/dist/when.js +57 -0
- package/dist/when.js.map +1 -0
- package/dist/workflow-timer-store.d.ts +78 -0
- package/dist/workflow-timer-store.d.ts.map +1 -0
- package/dist/workflow-timer-store.js +56 -0
- package/dist/workflow-timer-store.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-marker.d.ts","sourceRoot":"","sources":["../src/public-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IACxB,8DAA8D;IAC9D,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAErE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,YAAY,CAgBnE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.public()` — the marker every cross-module-eligible primitive carries.
|
|
3
|
+
*
|
|
4
|
+
* Visibility is a module-level decision: a definition declares *behavior*,
|
|
5
|
+
* the module manifest declares *exposure*. Code calls `def.public()` only
|
|
6
|
+
* inside the manifest array (or inline at the call site if it's convenient),
|
|
7
|
+
* and `defineModule` reads the `$public` flag to partition each array into
|
|
8
|
+
* the module's public surface vs its internals.
|
|
9
|
+
*
|
|
10
|
+
* actions: [
|
|
11
|
+
* createStation.public(), // public — other modules may dispatch
|
|
12
|
+
* normalizeTraffic, // internal — only this module sees it
|
|
13
|
+
* ]
|
|
14
|
+
*
|
|
15
|
+
* The marker is non-enumerable so it doesn't pollute logs / OpenAPI dumps;
|
|
16
|
+
* the `public()` method is non-enumerable for the same reason. Calling
|
|
17
|
+
* `.public()` returns a SHALLOW clone — the original stays unmarked, so
|
|
18
|
+
* the definition file remains visibility-agnostic.
|
|
19
|
+
*/
|
|
20
|
+
export function isPublic(def) {
|
|
21
|
+
return def.$public === true;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Attach the `.public()` method + the `$public` slot in place. Each call
|
|
25
|
+
* to `.public()` produces a fresh clone with `$public: true` and the method
|
|
26
|
+
* re-installed so the clone remains markable (idempotent).
|
|
27
|
+
*/
|
|
28
|
+
export function markable(def) {
|
|
29
|
+
const enriched = def;
|
|
30
|
+
Object.defineProperty(enriched, "public", {
|
|
31
|
+
value: function publicMethod() {
|
|
32
|
+
const clone = { ...this };
|
|
33
|
+
Object.defineProperty(clone, "$public", {
|
|
34
|
+
value: true,
|
|
35
|
+
enumerable: false,
|
|
36
|
+
configurable: true,
|
|
37
|
+
});
|
|
38
|
+
return markable(clone);
|
|
39
|
+
},
|
|
40
|
+
enumerable: false,
|
|
41
|
+
configurable: true,
|
|
42
|
+
});
|
|
43
|
+
return enriched;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=public-marker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-marker.js","sourceRoot":"","sources":["../src/public-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,MAAM,UAAU,QAAQ,CAAC,GAAmC;IAC1D,OAAO,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAmB,GAAM;IAC/C,MAAM,QAAQ,GAAG,GAAuB,CAAC;IACzC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE;QACxC,KAAK,EAAE,SAAS,YAAY;YAC1B,MAAM,KAAK,GAA2B,EAAE,GAAG,IAAI,EAAE,CAAC;YAClD,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE;gBACtC,KAAK,EAAE,IAAI;gBACX,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,IAAI;aACnB,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response factories — re-exported from `@nwire/handler`.
|
|
3
|
+
*
|
|
4
|
+
* The canonical implementation moved to `@nwire/handler`. Forge keeps
|
|
5
|
+
* the same export names so existing call sites compile unchanged.
|
|
6
|
+
*/
|
|
7
|
+
export { response, isResponseSpec, isResponseInstance, ok, created, accepted, noContent, notModified, gone, type ResponseSpec, type ListResponseSpec, type ResponseInstance, type ResponseSpecBase, type ResponseKind, } from "@nwire/handler";
|
|
8
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,EAAE,EACF,OAAO,EACP,QAAQ,EACR,SAAS,EACT,WAAW,EACX,IAAI,EACJ,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC"}
|
package/dist/response.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response factories — re-exported from `@nwire/handler`.
|
|
3
|
+
*
|
|
4
|
+
* The canonical implementation moved to `@nwire/handler`. Forge keeps
|
|
5
|
+
* the same export names so existing call sites compile unchanged.
|
|
6
|
+
*/
|
|
7
|
+
export { response, isResponseSpec, isResponseInstance, ok, created, accepted, noContent, notModified, gone, } from "@nwire/handler";
|
|
8
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,EAAE,EACF,OAAO,EACP,QAAQ,EACR,SAAS,EACT,WAAW,EACX,IAAI,GAML,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime — the framework's dispatch + apply pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Responsibilities:
|
|
5
|
+
* 1. Register actions, actors, handlers, and `when` reactions.
|
|
6
|
+
* 2. `dispatch(action, input, envelope?)` — runs the action's handler,
|
|
7
|
+
* collects returned events, atomically: applies them to actors, runs
|
|
8
|
+
* reactions, schedules new timers, cancels old timers.
|
|
9
|
+
* 3. `publish(events, envelope)` — runs the apply-actors-and-reactions step
|
|
10
|
+
* for events produced outside a handler (rare; mostly internal).
|
|
11
|
+
* 4. `request(action, input)` — invoked from inside a handler to call
|
|
12
|
+
* another action with a derived child envelope. Returns the inner
|
|
13
|
+
* handler's result.
|
|
14
|
+
*
|
|
15
|
+
* The runtime owns commit atomicity:
|
|
16
|
+
* - All actor state changes from one event-publish either ALL persist or
|
|
17
|
+
* NONE persist (in-memory is naturally atomic; persistent stores rely
|
|
18
|
+
* on the adapter's transaction primitives).
|
|
19
|
+
* - Events fan out to actors first, then workflow reactions, then
|
|
20
|
+
* projections.
|
|
21
|
+
*/
|
|
22
|
+
import { type Container } from "@nwire/container";
|
|
23
|
+
import type { z } from "zod";
|
|
24
|
+
import type { ZodTypeAny } from "@nwire/messages";
|
|
25
|
+
import { type MessageEnvelope } from "@nwire/envelope";
|
|
26
|
+
import type { ActionDefinition } from "./define-action.js";
|
|
27
|
+
import type { HandlerContext, HandlerDefinition } from "./define-handler.js";
|
|
28
|
+
import type { ExternalCallDefinition, ExternalCallExecutor } from "./define-external-call.js";
|
|
29
|
+
import { type ActorDefinition } from "./define-actor.js";
|
|
30
|
+
import type { WorkflowDefinition } from "./define-workflow.js";
|
|
31
|
+
import { type WorkflowTimerStore } from "./workflow-timer-store.js";
|
|
32
|
+
import { type ActorStore } from "./actor-store.js";
|
|
33
|
+
import { type EventMessage } from "./event-message.js";
|
|
34
|
+
import type { ProjectionDefinition } from "./define-projection.js";
|
|
35
|
+
import { type ProjectionStore } from "./projection-store.js";
|
|
36
|
+
import type { QueryDefinition } from "./define-query.js";
|
|
37
|
+
import { type Logger } from "@nwire/logger";
|
|
38
|
+
import { type DeadLetterSink } from "@nwire/dead-letter";
|
|
39
|
+
import type { EventBus } from "@nwire/bus";
|
|
40
|
+
import { FrameworkEventBus, type FrameworkEventHandler } from "./framework-event-bus.js";
|
|
41
|
+
import { type FrameworkEventDefinition } from "./framework-events.js";
|
|
42
|
+
/**
|
|
43
|
+
* `Middleware` — onion-style extension point around action dispatch.
|
|
44
|
+
*
|
|
45
|
+
* runtime.use(async (next, action, input, ctx) => {
|
|
46
|
+
* const start = performance.now()
|
|
47
|
+
* try {
|
|
48
|
+
* return await next()
|
|
49
|
+
* } finally {
|
|
50
|
+
* ctx.logger.info('dispatched', {
|
|
51
|
+
* action: action.name,
|
|
52
|
+
* durationMs: performance.now() - start
|
|
53
|
+
* })
|
|
54
|
+
* }
|
|
55
|
+
* })
|
|
56
|
+
*
|
|
57
|
+
* Middlewares run OUTSIDE the retry loop — one pass per dispatch, regardless
|
|
58
|
+
* of how many retry attempts the handler takes internally. Registration
|
|
59
|
+
* order is execution order: the first `runtime.use(m)` is the outermost
|
|
60
|
+
* layer. This matches Koa/express middleware semantics.
|
|
61
|
+
*
|
|
62
|
+
* Common uses: tracing (OTEL span around `next()`), authz (validate
|
|
63
|
+
* `ctx.envelope.userId` against `action` policy before calling `next()`),
|
|
64
|
+
* idempotency (short-circuit on duplicate `envelope.messageId`), caching,
|
|
65
|
+
* rate-limiting, audit logging.
|
|
66
|
+
*
|
|
67
|
+
* Middleware MUST call `next()` exactly once (or never, if intentionally
|
|
68
|
+
* short-circuiting). Calling it twice is a programming error.
|
|
69
|
+
*/
|
|
70
|
+
export type DispatchMiddleware = (next: () => Promise<EventMessage | EventMessage[] | void>, action: ActionDefinition, input: any, ctx: HandlerContext) => Promise<EventMessage | EventMessage[] | void>;
|
|
71
|
+
/**
|
|
72
|
+
* `Telemetry` — the canonical tagged-union stream of every domain-significant
|
|
73
|
+
* thing the runtime does. One tap (`runtime.onTelemetry`) gets every kind,
|
|
74
|
+
* letting Studio (and any future observability adapter) reconstruct the full
|
|
75
|
+
* domain story without hooking individual lifecycle sites.
|
|
76
|
+
*
|
|
77
|
+
* Every record carries `appName` and a `ts` (ISO timestamp). Domain records
|
|
78
|
+
* additionally carry an `envelope` for correlation/causation; orchestrator
|
|
79
|
+
* records (external calls, queue jobs, cron) may or may not depending on
|
|
80
|
+
* whether they're inside an envelope-scoped context.
|
|
81
|
+
*
|
|
82
|
+
* Adding a new kind is additive — consumers ignore unknown kinds.
|
|
83
|
+
*/
|
|
84
|
+
export type SerializedError = {
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly message: string;
|
|
87
|
+
readonly stack?: string;
|
|
88
|
+
readonly [k: string]: unknown;
|
|
89
|
+
};
|
|
90
|
+
export type Telemetry = {
|
|
91
|
+
readonly kind: "action.dispatched";
|
|
92
|
+
readonly action: string;
|
|
93
|
+
readonly input: unknown;
|
|
94
|
+
readonly envelope: MessageEnvelope;
|
|
95
|
+
readonly appName: string;
|
|
96
|
+
readonly ts: string;
|
|
97
|
+
} | {
|
|
98
|
+
readonly kind: "action.completed";
|
|
99
|
+
readonly action: string;
|
|
100
|
+
readonly durationMs: number;
|
|
101
|
+
readonly emittedEvents: readonly string[];
|
|
102
|
+
readonly envelope: MessageEnvelope;
|
|
103
|
+
readonly appName: string;
|
|
104
|
+
readonly ts: string;
|
|
105
|
+
} | {
|
|
106
|
+
readonly kind: "action.failed";
|
|
107
|
+
readonly action: string;
|
|
108
|
+
readonly attempt: number;
|
|
109
|
+
readonly maxAttempts: number;
|
|
110
|
+
readonly willRetry: boolean;
|
|
111
|
+
readonly error: SerializedError;
|
|
112
|
+
readonly envelope: MessageEnvelope;
|
|
113
|
+
readonly appName: string;
|
|
114
|
+
readonly ts: string;
|
|
115
|
+
} | {
|
|
116
|
+
readonly kind: "event.published";
|
|
117
|
+
readonly event: EventMessage;
|
|
118
|
+
readonly envelope: MessageEnvelope;
|
|
119
|
+
/** 'in-process' = emitted by a handler here. 'external' = arrived from the bus. */
|
|
120
|
+
readonly source: "in-process" | "external";
|
|
121
|
+
readonly appName: string;
|
|
122
|
+
readonly ts: string;
|
|
123
|
+
} | {
|
|
124
|
+
readonly kind: "actor.transitioned";
|
|
125
|
+
readonly actor: string;
|
|
126
|
+
readonly key: string;
|
|
127
|
+
readonly tenant: string;
|
|
128
|
+
readonly from: string;
|
|
129
|
+
readonly to: string;
|
|
130
|
+
readonly triggeringEvent: string;
|
|
131
|
+
readonly envelope: MessageEnvelope;
|
|
132
|
+
readonly appName: string;
|
|
133
|
+
readonly ts: string;
|
|
134
|
+
} | {
|
|
135
|
+
readonly kind: "projection.folded";
|
|
136
|
+
readonly projection: string;
|
|
137
|
+
readonly event: string;
|
|
138
|
+
readonly tenant: string;
|
|
139
|
+
readonly durationMs: number;
|
|
140
|
+
readonly envelope: MessageEnvelope;
|
|
141
|
+
readonly appName: string;
|
|
142
|
+
readonly ts: string;
|
|
143
|
+
} | {
|
|
144
|
+
readonly kind: "reaction.fired";
|
|
145
|
+
readonly sourceEvent: string;
|
|
146
|
+
readonly durationMs: number;
|
|
147
|
+
readonly envelope: MessageEnvelope;
|
|
148
|
+
readonly appName: string;
|
|
149
|
+
readonly ts: string;
|
|
150
|
+
} | {
|
|
151
|
+
readonly kind: "reaction.failed";
|
|
152
|
+
readonly sourceEvent: string;
|
|
153
|
+
readonly error: SerializedError;
|
|
154
|
+
readonly envelope: MessageEnvelope;
|
|
155
|
+
readonly appName: string;
|
|
156
|
+
readonly ts: string;
|
|
157
|
+
} | {
|
|
158
|
+
readonly kind: "query.executed";
|
|
159
|
+
readonly query: string;
|
|
160
|
+
readonly input: unknown;
|
|
161
|
+
readonly durationMs: number;
|
|
162
|
+
readonly tenant: string;
|
|
163
|
+
readonly appName: string;
|
|
164
|
+
readonly ts: string;
|
|
165
|
+
} | {
|
|
166
|
+
readonly kind: "timer.scheduled";
|
|
167
|
+
readonly actor: string;
|
|
168
|
+
readonly key: string;
|
|
169
|
+
readonly timer: string;
|
|
170
|
+
readonly action: string;
|
|
171
|
+
readonly fireAt: number;
|
|
172
|
+
readonly tenant: string;
|
|
173
|
+
readonly appName: string;
|
|
174
|
+
readonly ts: string;
|
|
175
|
+
} | {
|
|
176
|
+
readonly kind: "timer.fired";
|
|
177
|
+
readonly actor: string;
|
|
178
|
+
readonly key: string;
|
|
179
|
+
readonly timer: string;
|
|
180
|
+
readonly action: string;
|
|
181
|
+
readonly lateByMs: number;
|
|
182
|
+
readonly tenant: string;
|
|
183
|
+
readonly appName: string;
|
|
184
|
+
readonly ts: string;
|
|
185
|
+
} | {
|
|
186
|
+
readonly kind: "dlq.recorded";
|
|
187
|
+
readonly action: string;
|
|
188
|
+
readonly attempts: number;
|
|
189
|
+
readonly error: SerializedError;
|
|
190
|
+
readonly envelope: MessageEnvelope;
|
|
191
|
+
readonly appName: string;
|
|
192
|
+
readonly ts: string;
|
|
193
|
+
} | {
|
|
194
|
+
readonly kind: "external.call.started";
|
|
195
|
+
readonly call: string;
|
|
196
|
+
readonly target: string;
|
|
197
|
+
readonly idempotencyKey?: string;
|
|
198
|
+
readonly envelope?: MessageEnvelope;
|
|
199
|
+
readonly appName: string;
|
|
200
|
+
readonly ts: string;
|
|
201
|
+
} | {
|
|
202
|
+
readonly kind: "external.call.completed";
|
|
203
|
+
readonly call: string;
|
|
204
|
+
readonly target: string;
|
|
205
|
+
readonly durationMs: number;
|
|
206
|
+
readonly status?: number;
|
|
207
|
+
readonly idempotencyKey?: string;
|
|
208
|
+
readonly envelope?: MessageEnvelope;
|
|
209
|
+
readonly appName: string;
|
|
210
|
+
readonly ts: string;
|
|
211
|
+
} | {
|
|
212
|
+
readonly kind: "external.call.failed";
|
|
213
|
+
readonly call: string;
|
|
214
|
+
readonly target: string;
|
|
215
|
+
readonly attempt: number;
|
|
216
|
+
readonly willRetry: boolean;
|
|
217
|
+
readonly error: SerializedError;
|
|
218
|
+
readonly envelope?: MessageEnvelope;
|
|
219
|
+
readonly appName: string;
|
|
220
|
+
readonly ts: string;
|
|
221
|
+
} | {
|
|
222
|
+
readonly kind: "inbound.webhook.received";
|
|
223
|
+
readonly webhook: string;
|
|
224
|
+
readonly source: string;
|
|
225
|
+
readonly signatureValid: boolean;
|
|
226
|
+
readonly dedupHit: boolean;
|
|
227
|
+
readonly routedTo?: string;
|
|
228
|
+
readonly appName: string;
|
|
229
|
+
readonly ts: string;
|
|
230
|
+
} | {
|
|
231
|
+
readonly kind: "outbox.flushed";
|
|
232
|
+
readonly outbox: string;
|
|
233
|
+
readonly events: number;
|
|
234
|
+
readonly durationMs: number;
|
|
235
|
+
readonly failed: number;
|
|
236
|
+
readonly appName: string;
|
|
237
|
+
readonly ts: string;
|
|
238
|
+
} | {
|
|
239
|
+
readonly kind: "inbox.dedup.hit";
|
|
240
|
+
readonly inbox: string;
|
|
241
|
+
readonly messageId: string;
|
|
242
|
+
readonly firstSeenAt: string;
|
|
243
|
+
readonly appName: string;
|
|
244
|
+
readonly ts: string;
|
|
245
|
+
} | {
|
|
246
|
+
readonly kind: "queue.job.enqueued";
|
|
247
|
+
readonly queue: string;
|
|
248
|
+
readonly jobId: string;
|
|
249
|
+
readonly delay?: number;
|
|
250
|
+
readonly appName: string;
|
|
251
|
+
readonly ts: string;
|
|
252
|
+
} | {
|
|
253
|
+
readonly kind: "queue.job.started";
|
|
254
|
+
readonly queue: string;
|
|
255
|
+
readonly jobId: string;
|
|
256
|
+
readonly waitedMs: number;
|
|
257
|
+
readonly appName: string;
|
|
258
|
+
readonly ts: string;
|
|
259
|
+
} | {
|
|
260
|
+
readonly kind: "queue.job.completed";
|
|
261
|
+
readonly queue: string;
|
|
262
|
+
readonly jobId: string;
|
|
263
|
+
readonly durationMs: number;
|
|
264
|
+
readonly ok: boolean;
|
|
265
|
+
readonly appName: string;
|
|
266
|
+
readonly ts: string;
|
|
267
|
+
} | {
|
|
268
|
+
readonly kind: "cron.fired";
|
|
269
|
+
readonly schedule: string;
|
|
270
|
+
readonly cronName: string;
|
|
271
|
+
readonly expected: string;
|
|
272
|
+
readonly actual: string;
|
|
273
|
+
readonly lateByMs: number;
|
|
274
|
+
readonly appName: string;
|
|
275
|
+
readonly ts: string;
|
|
276
|
+
} | {
|
|
277
|
+
readonly kind: "lifecycle";
|
|
278
|
+
readonly event: string;
|
|
279
|
+
readonly namespace: string;
|
|
280
|
+
readonly payload: unknown;
|
|
281
|
+
readonly phase: "fired" | "prevented";
|
|
282
|
+
readonly appName: string;
|
|
283
|
+
readonly ts: string;
|
|
284
|
+
};
|
|
285
|
+
/** Subscriber type for `runtime.onTelemetry`. */
|
|
286
|
+
export type TelemetryListener = (record: Telemetry) => void;
|
|
287
|
+
export interface RuntimeOptions {
|
|
288
|
+
readonly container?: Container;
|
|
289
|
+
readonly actorStore?: ActorStore;
|
|
290
|
+
readonly projectionStore?: ProjectionStore;
|
|
291
|
+
readonly logger?: Logger;
|
|
292
|
+
readonly deadLetterSink?: DeadLetterSink;
|
|
293
|
+
/**
|
|
294
|
+
* Cross-service event bus (`@nwire/bus`). When provided AND
|
|
295
|
+
* `publishToBus: true`, the runtime fans every published event to the
|
|
296
|
+
* bus in addition to the in-process apply. Bus-received events arrive
|
|
297
|
+
* via `applyExternalEvent` (no re-publish to bus).
|
|
298
|
+
*/
|
|
299
|
+
readonly bus?: EventBus;
|
|
300
|
+
/** Pass-through fan-out: publish in-process events to the bus too. */
|
|
301
|
+
readonly publishToBus?: boolean;
|
|
302
|
+
/**
|
|
303
|
+
* App / service name. Tagged on bus-published events as `origin` so
|
|
304
|
+
* subscribers can suppress echoes of their own publishes.
|
|
305
|
+
*/
|
|
306
|
+
readonly appName?: string;
|
|
307
|
+
/**
|
|
308
|
+
* Saga timer store. Defaults to `InMemoryWorkflowTimerStore`. Replace
|
|
309
|
+
* with a durable adapter (Mongo/Redis/Postgres) to make sagas survive
|
|
310
|
+
* process restarts.
|
|
311
|
+
*/
|
|
312
|
+
readonly workflowTimerStore?: WorkflowTimerStore;
|
|
313
|
+
}
|
|
314
|
+
export declare class Runtime {
|
|
315
|
+
private readonly handlers;
|
|
316
|
+
private readonly actors;
|
|
317
|
+
/**
|
|
318
|
+
* Workflows keyed by event name. Built from each registered workflow's
|
|
319
|
+
* `subscribedEvents`. On publish, every workflow listening to an event
|
|
320
|
+
* gets `_fire`d with runtime-bound effects.
|
|
321
|
+
*/
|
|
322
|
+
private readonly workflowsByEvent;
|
|
323
|
+
/**
|
|
324
|
+
* Per-workflow instance state — keyed first by workflow name, then by
|
|
325
|
+
* correlation key. In-memory for slice 1; future adapters (Mongo, Redis)
|
|
326
|
+
* plug in via a WorkflowStore contract analogous to ActorStore.
|
|
327
|
+
*/
|
|
328
|
+
private readonly workflowInstances;
|
|
329
|
+
private workflowInstanceStore;
|
|
330
|
+
private readonly projections;
|
|
331
|
+
private readonly projectionsByEvent;
|
|
332
|
+
private readonly queries;
|
|
333
|
+
private readonly externalCalls;
|
|
334
|
+
private readonly externalCallExecutors;
|
|
335
|
+
private readonly container;
|
|
336
|
+
private readonly actorStore;
|
|
337
|
+
private readonly projectionStore;
|
|
338
|
+
private readonly logger;
|
|
339
|
+
private readonly deadLetterSink;
|
|
340
|
+
private readonly middlewares;
|
|
341
|
+
private readonly actorTransitionHooks;
|
|
342
|
+
private readonly bus?;
|
|
343
|
+
private readonly publishToBus;
|
|
344
|
+
readonly appName: string;
|
|
345
|
+
private readonly telemetryListeners;
|
|
346
|
+
/** Known external events — set by createApp from modules' needs.externalEvents. */
|
|
347
|
+
private readonly externalEventNames;
|
|
348
|
+
/** Public-event names (visibility: 'public') — set by createApp from modules' events. */
|
|
349
|
+
private readonly publicEventNames;
|
|
350
|
+
/** Saga timer store (default in-memory; pluggable via RuntimeOptions). */
|
|
351
|
+
readonly workflowTimerStore: WorkflowTimerStore;
|
|
352
|
+
/**
|
|
353
|
+
* Framework event bus — lifecycle + dispatch hooks. Plugins and apps
|
|
354
|
+
* subscribe with `runtime.onFramework(Event, handler)`; the runtime
|
|
355
|
+
* fires events at the appropriate sites in `dispatch`, `start`, `stop`.
|
|
356
|
+
*/
|
|
357
|
+
readonly frameworkEvents: FrameworkEventBus;
|
|
358
|
+
constructor(options?: RuntimeOptions);
|
|
359
|
+
/**
|
|
360
|
+
* Subscribe to a framework event. Sugar over `runtime.frameworkEvents.on`
|
|
361
|
+
* so plugins can write `runtime.onFramework(ActionDispatching, ...)`.
|
|
362
|
+
* Returns an unsubscribe function.
|
|
363
|
+
*/
|
|
364
|
+
onFramework<TPayload>(event: FrameworkEventDefinition<TPayload>, handler: FrameworkEventHandler<TPayload>, priority?: number): () => void;
|
|
365
|
+
/** Internal — createApp registers known external event names. */
|
|
366
|
+
registerExternalEvent(eventName: string): void;
|
|
367
|
+
/** Internal — createApp registers public event names (visibility: 'public'). */
|
|
368
|
+
registerPublicEvent(eventName: string): void;
|
|
369
|
+
/** Internal — createApp registers actor-transition hooks from plugins. */
|
|
370
|
+
registerActorTransitionHook(hook: (actor: ActorDefinition, key: string, fromState: string, toState: string, event: EventMessage, envelope: MessageEnvelope) => Promise<void> | void): void;
|
|
371
|
+
/**
|
|
372
|
+
* Register a dispatch middleware. Outermost first — the order you call
|
|
373
|
+
* `use()` is the order layers wrap (first `use` is the outermost layer).
|
|
374
|
+
* Middlewares run once per dispatch, outside the retry loop.
|
|
375
|
+
*/
|
|
376
|
+
use(middleware: DispatchMiddleware): void;
|
|
377
|
+
registerHandler(handler: HandlerDefinition<any>): void;
|
|
378
|
+
registerActor(actor: ActorDefinition): void;
|
|
379
|
+
/** Internal — createApp registers each module's workflows. */
|
|
380
|
+
registerWorkflow(workflow: WorkflowDefinition): void;
|
|
381
|
+
registerProjection(projection: ProjectionDefinition<any>): void;
|
|
382
|
+
registerQuery(query: QueryDefinition<any, any, any>): void;
|
|
383
|
+
/**
|
|
384
|
+
* Register an external-call declaration. Modules announce their external
|
|
385
|
+
* calls so Studio + the static graph see them; wires (adapters) call
|
|
386
|
+
* `registerExternalCallExecutor` to provide the transport.
|
|
387
|
+
*/
|
|
388
|
+
registerExternalCall(def: ExternalCallDefinition<any, any>): void;
|
|
389
|
+
/**
|
|
390
|
+
* Bind an executor (HTTP client / SDK wrapper / test mock) to a declared
|
|
391
|
+
* external call. Lookup is by `def.name`. Called by wires/adapters at
|
|
392
|
+
* boot. Idempotent: re-registering replaces the executor (useful for
|
|
393
|
+
* swapping mocks in tests).
|
|
394
|
+
*/
|
|
395
|
+
registerExternalCallExecutor<TRequest extends ZodTypeAny, TResponse extends ZodTypeAny>(def: ExternalCallDefinition<TRequest, TResponse>, executor: ExternalCallExecutor<TRequest, TResponse>): void;
|
|
396
|
+
executeExternalCall<TRequest extends ZodTypeAny, TResponse extends ZodTypeAny>(def: ExternalCallDefinition<TRequest, TResponse>, request: z.output<TRequest>, envelope?: MessageEnvelope): Promise<z.output<TResponse>>;
|
|
397
|
+
query<TResult = unknown>(queryName: string, input: unknown, tenant?: string): Promise<TResult>;
|
|
398
|
+
getActorStore(): ActorStore;
|
|
399
|
+
getProjectionStore(): ProjectionStore;
|
|
400
|
+
getContainer(): Container;
|
|
401
|
+
listHandlers(): readonly string[];
|
|
402
|
+
listActors(): readonly string[];
|
|
403
|
+
listProjections(): readonly string[];
|
|
404
|
+
listQueries(): readonly string[];
|
|
405
|
+
listExternalCalls(): readonly string[];
|
|
406
|
+
getExternalCall(name: string): ExternalCallDefinition<any, any> | undefined;
|
|
407
|
+
/**
|
|
408
|
+
* Walk every registered actor's instances; for each `activeTimers[name]`
|
|
409
|
+
* with `fireAt <= now`, dispatch the timer's action. Removes fired timers
|
|
410
|
+
* from the instance's `activeTimers` map.
|
|
411
|
+
*
|
|
412
|
+
* Returns the count of timers that fired. Idempotent: a timer's `fireAt`
|
|
413
|
+
* is not bumped, so a second call after `now` advances will not re-fire
|
|
414
|
+
* the same timer (it was removed).
|
|
415
|
+
*
|
|
416
|
+
* For tests: pass `now` to fast-forward (`runtime.fireDueTimers(Date.now() + 3 * 86400_000)`).
|
|
417
|
+
* For production: a transport (BullMQ, polling worker) calls this on an
|
|
418
|
+
* interval; see `startTimerScheduler(app, intervalMs)` in `create-app.ts`.
|
|
419
|
+
*/
|
|
420
|
+
fireDueTimers(now?: number): Promise<number>;
|
|
421
|
+
private findActionByName;
|
|
422
|
+
/**
|
|
423
|
+
* Drain every due saga timer from the workflow timer store and route
|
|
424
|
+
* each as a synthetic event back into the originating workflow. The
|
|
425
|
+
* store removes drained timers atomically (see `WorkflowTimerStore`
|
|
426
|
+
* contract); calling `fireDueWorkflowTimers` twice with the same `now`
|
|
427
|
+
* MUST be a no-op the second time.
|
|
428
|
+
*
|
|
429
|
+
* Returns the count of timers fired.
|
|
430
|
+
*
|
|
431
|
+
* Tests: pass `now` to fast-forward
|
|
432
|
+
* (`runtime.fireDueWorkflowTimers(new Date(Date.now() + 8 * 86400_000))`).
|
|
433
|
+
* Production: the same polling loop that calls `fireDueTimers` calls
|
|
434
|
+
* this — they share the timer tick infrastructure.
|
|
435
|
+
*/
|
|
436
|
+
fireDueWorkflowTimers(now?: Date): Promise<number>;
|
|
437
|
+
/**
|
|
438
|
+
* Run an action through its handler, then atomically apply returned events.
|
|
439
|
+
* Returns the handler's raw return value (events) for callers that want it.
|
|
440
|
+
*/
|
|
441
|
+
dispatch<TInput, TResult extends EventMessage | EventMessage[] | void = EventMessage | EventMessage[] | void>(action: ActionDefinition, input: TInput, parentEnvelope?: MessageEnvelope): Promise<TResult>;
|
|
442
|
+
/**
|
|
443
|
+
* Apply a batch of events: route to actors (state transitions + assigns +
|
|
444
|
+
* timer scheduling), fold projections, then fire workflows. Used internally
|
|
445
|
+
* by `dispatch` and exposed for tests and rare external publishes.
|
|
446
|
+
*/
|
|
447
|
+
publish(events: readonly EventMessage[], parentEnvelope: MessageEnvelope): Promise<void>;
|
|
448
|
+
/**
|
|
449
|
+
* Tap into the canonical telemetry stream. One subscriber sees every kind:
|
|
450
|
+
* `action.dispatched` / `.completed` / `.failed`, `event.published`,
|
|
451
|
+
* `actor.transitioned`, `projection.folded`, `reaction.fired` / `.failed`,
|
|
452
|
+
* `query.executed`, `timer.scheduled` / `.fired`, `dlq.recorded`.
|
|
453
|
+
*
|
|
454
|
+
* Listeners run AFTER the corresponding lifecycle action commits — they
|
|
455
|
+
* observe what actually happened, not in-flight intent. Throwing in a
|
|
456
|
+
* listener is caught and logged; it never breaks domain dispatch.
|
|
457
|
+
*
|
|
458
|
+
* Returns an unsubscribe function.
|
|
459
|
+
*/
|
|
460
|
+
onTelemetry(listener: TelemetryListener): () => void;
|
|
461
|
+
offTelemetry(listener: TelemetryListener): void;
|
|
462
|
+
private emit;
|
|
463
|
+
/**
|
|
464
|
+
* Apply an event that arrived from the cross-service bus. Same pipeline
|
|
465
|
+
* as `publish` (actors → projections → workflows) but does NOT re-publish
|
|
466
|
+
* to the bus — avoids fan-out loops between services. The runtime tracks
|
|
467
|
+
* which event names it declared as external (via createApp's wiring of
|
|
468
|
+
* modules' `needs.externalEvents`); calls for other names throw to catch
|
|
469
|
+
* misconfigured subscriptions early.
|
|
470
|
+
*/
|
|
471
|
+
applyExternalEvent(eventName: string, payload: unknown, envelope: MessageEnvelope): Promise<void>;
|
|
472
|
+
private foldProjections;
|
|
473
|
+
private applyToActors;
|
|
474
|
+
private extractKey;
|
|
475
|
+
private applyEventToActor;
|
|
476
|
+
private computeTimersForState;
|
|
477
|
+
/**
|
|
478
|
+
* Fire every workflow subscribed to `event`. Each workflow receives a
|
|
479
|
+
* runtime-bound effects bag: `send`/`enqueue` go through `dispatch` for
|
|
480
|
+
* retry + telemetry parity with action handlers; `publish` goes back
|
|
481
|
+
* through `this.publish` so derived events flow through the full
|
|
482
|
+
* actors → projections → workflows pipeline (translator pattern).
|
|
483
|
+
*
|
|
484
|
+
* Telemetry emits as `workflow.fired` / `workflow.failed`.
|
|
485
|
+
*/
|
|
486
|
+
private runWorkflows;
|
|
487
|
+
private buildHandlerContext;
|
|
488
|
+
private loadActorView;
|
|
489
|
+
/** Test/inspection seam — read what's in the DLQ. */
|
|
490
|
+
getDeadLetterSink(): DeadLetterSink;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Parse a delay string like '3d', '90s', '4h' into milliseconds.
|
|
494
|
+
* Supports: ms, s, m, h, d. Numbers without units treated as milliseconds.
|
|
495
|
+
*/
|
|
496
|
+
export declare function parseDelay(value: string): number;
|
|
497
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAgC,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,gBAAgB,CAAC;AAC1E,OAAO,KAAK,EAAe,kBAAkB,EAAoB,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,KAAK,UAAU,EAKhB,MAAM,eAAe,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