@spine-event-engine/server 2.0.0-snapshot.2 → 2.0.0-snapshot.21

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.
Files changed (227) hide show
  1. package/README.md +225 -518
  2. package/REFERENCE.md +498 -49
  3. package/dist/browser/browser-server.d.ts +95 -0
  4. package/dist/browser/browser-server.d.ts.map +1 -0
  5. package/dist/{server → browser}/browser-server.js +93 -7
  6. package/dist/browser/browser-server.js.map +1 -0
  7. package/dist/browser/durable-subscription-bindings.d.ts.map +1 -0
  8. package/dist/browser/durable-subscription-bindings.js.map +1 -0
  9. package/dist/browser/index.d.ts +12 -0
  10. package/dist/browser/index.d.ts.map +1 -0
  11. package/dist/browser/index.js +24 -0
  12. package/dist/browser/index.js.map +1 -0
  13. package/dist/browser/options.d.ts +183 -0
  14. package/dist/browser/options.d.ts.map +1 -0
  15. package/dist/browser/options.js +15 -0
  16. package/dist/browser/options.js.map +1 -0
  17. package/dist/bus/command-bus.d.ts +2 -0
  18. package/dist/bus/command-bus.d.ts.map +1 -1
  19. package/dist/bus/command-bus.js +36 -1
  20. package/dist/bus/command-bus.js.map +1 -1
  21. package/dist/bus/event-dispatcher-registry.d.ts +2 -2
  22. package/dist/bus/event-dispatcher-registry.js +3 -3
  23. package/dist/bus/event-dispatcher-registry.js.map +1 -1
  24. package/dist/context/bounded-context.d.ts +238 -83
  25. package/dist/context/bounded-context.d.ts.map +1 -1
  26. package/dist/context/bounded-context.js +1083 -286
  27. package/dist/context/bounded-context.js.map +1 -1
  28. package/dist/context/effective-tenant.d.ts +9 -0
  29. package/dist/context/effective-tenant.d.ts.map +1 -0
  30. package/dist/context/effective-tenant.js +58 -0
  31. package/dist/context/effective-tenant.js.map +1 -0
  32. package/dist/context/entity-inbox.d.ts.map +1 -1
  33. package/dist/context/entity-inbox.js +24 -17
  34. package/dist/context/entity-inbox.js.map +1 -1
  35. package/dist/context/local-inbox-handoff.d.ts +7 -3
  36. package/dist/context/local-inbox-handoff.d.ts.map +1 -1
  37. package/dist/context/local-inbox-handoff.js +32 -26
  38. package/dist/context/local-inbox-handoff.js.map +1 -1
  39. package/dist/context/projection-handoff.d.ts.map +1 -1
  40. package/dist/context/projection-handoff.js +36 -31
  41. package/dist/context/projection-handoff.js.map +1 -1
  42. package/dist/context/tenant-index.d.ts.map +1 -1
  43. package/dist/context/tenant-index.js +72 -2
  44. package/dist/context/tenant-index.js.map +1 -1
  45. package/dist/delivery/delivery-ports.d.ts +14 -4
  46. package/dist/delivery/delivery-ports.d.ts.map +1 -1
  47. package/dist/delivery/delivery.d.ts +19 -21
  48. package/dist/delivery/delivery.d.ts.map +1 -1
  49. package/dist/delivery/delivery.js +541 -158
  50. package/dist/delivery/delivery.js.map +1 -1
  51. package/dist/delivery/inbox-storage.d.ts +12 -3
  52. package/dist/delivery/inbox-storage.d.ts.map +1 -1
  53. package/dist/delivery/inbox-storage.js +160 -67
  54. package/dist/delivery/inbox-storage.js.map +1 -1
  55. package/dist/delivery/inbox.d.ts +9 -0
  56. package/dist/delivery/inbox.d.ts.map +1 -1
  57. package/dist/delivery/inbox.js +11 -0
  58. package/dist/delivery/inbox.js.map +1 -1
  59. package/dist/delivery/sharded-work-registry.d.ts.map +1 -1
  60. package/dist/delivery/sharded-work-registry.js +2 -1
  61. package/dist/delivery/sharded-work-registry.js.map +1 -1
  62. package/dist/entity/entity-metadata.d.ts +14 -5
  63. package/dist/entity/entity-metadata.d.ts.map +1 -1
  64. package/dist/entity/entity-metadata.js +38 -2
  65. package/dist/entity/entity-metadata.js.map +1 -1
  66. package/dist/entity/entity-storage-descriptor.d.ts +25 -5
  67. package/dist/entity/entity-storage-descriptor.d.ts.map +1 -1
  68. package/dist/entity/entity-storage-descriptor.js +69 -23
  69. package/dist/entity/entity-storage-descriptor.js.map +1 -1
  70. package/dist/entity/entity-transaction.d.ts +46 -42
  71. package/dist/entity/entity-transaction.d.ts.map +1 -1
  72. package/dist/entity/entity-transaction.js +130 -35
  73. package/dist/entity/entity-transaction.js.map +1 -1
  74. package/dist/entity/entity.d.ts +243 -98
  75. package/dist/entity/entity.d.ts.map +1 -1
  76. package/dist/entity/entity.js +405 -226
  77. package/dist/entity/entity.js.map +1 -1
  78. package/dist/entity/spec-scanner.d.ts +13 -1
  79. package/dist/entity/spec-scanner.d.ts.map +1 -1
  80. package/dist/entity/spec-scanner.js +20 -3
  81. package/dist/entity/spec-scanner.js.map +1 -1
  82. package/dist/handler/command-registration-readiness.d.ts +6 -6
  83. package/dist/handler/command-registration-readiness.d.ts.map +1 -1
  84. package/dist/handler/command-registration-readiness.js +4 -2
  85. package/dist/handler/command-registration-readiness.js.map +1 -1
  86. package/dist/handler/declared-rejections.d.ts +11 -0
  87. package/dist/handler/declared-rejections.d.ts.map +1 -0
  88. package/dist/handler/declared-rejections.js +34 -0
  89. package/dist/handler/declared-rejections.js.map +1 -0
  90. package/dist/handler/event-registration-readiness.d.ts +13 -56
  91. package/dist/handler/event-registration-readiness.d.ts.map +1 -1
  92. package/dist/handler/event-registration-readiness.js +23 -43
  93. package/dist/handler/event-registration-readiness.js.map +1 -1
  94. package/dist/handler/generated-handler-registry.d.ts +72 -33
  95. package/dist/handler/generated-handler-registry.d.ts.map +1 -1
  96. package/dist/handler/generated-handler-registry.js +421 -43
  97. package/dist/handler/generated-handler-registry.js.map +1 -1
  98. package/dist/handler/generated-registry-discovery.d.ts.map +1 -1
  99. package/dist/handler/generated-registry-discovery.js +2 -4
  100. package/dist/handler/generated-registry-discovery.js.map +1 -1
  101. package/dist/handler/handler-decorators.d.ts +91 -37
  102. package/dist/handler/handler-decorators.d.ts.map +1 -1
  103. package/dist/handler/handler-decorators.js +124 -31
  104. package/dist/handler/handler-decorators.js.map +1 -1
  105. package/dist/handler/handler-metadata.d.ts +105 -60
  106. package/dist/handler/handler-metadata.d.ts.map +1 -1
  107. package/dist/handler/handler-metadata.js +275 -57
  108. package/dist/handler/handler-metadata.js.map +1 -1
  109. package/dist/handler/registration-readiness-metadata.d.ts +4 -0
  110. package/dist/handler/registration-readiness-metadata.d.ts.map +1 -1
  111. package/dist/handler/registration-readiness-metadata.js +84 -2
  112. package/dist/handler/registration-readiness-metadata.js.map +1 -1
  113. package/dist/handler/standalone.d.ts +25 -0
  114. package/dist/handler/standalone.d.ts.map +1 -0
  115. package/dist/handler/standalone.js +38 -0
  116. package/dist/handler/standalone.js.map +1 -0
  117. package/dist/index.d.ts +9 -9
  118. package/dist/index.d.ts.map +1 -1
  119. package/dist/index.js +3 -3
  120. package/dist/index.js.map +1 -1
  121. package/dist/repository/command-routing.d.ts +63 -10
  122. package/dist/repository/command-routing.d.ts.map +1 -1
  123. package/dist/repository/command-routing.js +41 -8
  124. package/dist/repository/command-routing.js.map +1 -1
  125. package/dist/repository/event-routing.d.ts +64 -9
  126. package/dist/repository/event-routing.d.ts.map +1 -1
  127. package/dist/repository/event-routing.js +42 -7
  128. package/dist/repository/event-routing.js.map +1 -1
  129. package/dist/repository/primitive-id.d.ts +12 -23
  130. package/dist/repository/primitive-id.d.ts.map +1 -1
  131. package/dist/repository/primitive-id.js +2 -27
  132. package/dist/repository/primitive-id.js.map +1 -1
  133. package/dist/repository/repository.d.ts +317 -87
  134. package/dist/repository/repository.d.ts.map +1 -1
  135. package/dist/repository/repository.js +3746 -856
  136. package/dist/repository/repository.js.map +1 -1
  137. package/dist/repository/state-update-routing.d.ts +67 -8
  138. package/dist/repository/state-update-routing.d.ts.map +1 -1
  139. package/dist/repository/state-update-routing.js +45 -6
  140. package/dist/repository/state-update-routing.js.map +1 -1
  141. package/dist/runtime/runtime.js +1 -1
  142. package/dist/runtime/runtime.js.map +1 -1
  143. package/dist/runtime/signal-metadata.d.ts +22 -47
  144. package/dist/runtime/signal-metadata.d.ts.map +1 -1
  145. package/dist/runtime/signal-metadata.js +34 -69
  146. package/dist/runtime/signal-metadata.js.map +1 -1
  147. package/dist/runtime/signal-publisher.d.ts +144 -0
  148. package/dist/runtime/signal-publisher.d.ts.map +1 -0
  149. package/dist/runtime/signal-publisher.js +248 -0
  150. package/dist/runtime/signal-publisher.js.map +1 -0
  151. package/dist/runtime/standalone-handler-runtime.d.ts +130 -0
  152. package/dist/runtime/standalone-handler-runtime.d.ts.map +1 -0
  153. package/dist/runtime/standalone-handler-runtime.js +382 -0
  154. package/dist/runtime/standalone-handler-runtime.js.map +1 -0
  155. package/dist/server/environment-attachment.d.ts.map +1 -1
  156. package/dist/server/environment-attachment.js +2 -1
  157. package/dist/server/environment-attachment.js.map +1 -1
  158. package/dist/server/environment-delivery-worker.d.ts.map +1 -1
  159. package/dist/server/environment-delivery-worker.js +21 -12
  160. package/dist/server/environment-delivery-worker.js.map +1 -1
  161. package/dist/server/managed-server-application.d.ts +4 -1
  162. package/dist/server/managed-server-application.d.ts.map +1 -1
  163. package/dist/server/managed-server-application.js +2 -2
  164. package/dist/server/managed-server-application.js.map +1 -1
  165. package/dist/server/node-coordinator.js +2 -2
  166. package/dist/server/node-coordinator.js.map +1 -1
  167. package/dist/server/server-log.d.ts.map +1 -1
  168. package/dist/server/server-log.js +4 -0
  169. package/dist/server/server-log.js.map +1 -1
  170. package/dist/server/server.d.ts +9 -177
  171. package/dist/server/server.d.ts.map +1 -1
  172. package/dist/server/server.js +428 -178
  173. package/dist/server/server.js.map +1 -1
  174. package/dist/services/query-reader.d.ts +19 -0
  175. package/dist/services/query-reader.d.ts.map +1 -0
  176. package/dist/services/query-reader.js +43 -0
  177. package/dist/services/query-reader.js.map +1 -0
  178. package/dist/services/registered-targets.d.ts +73 -0
  179. package/dist/services/registered-targets.d.ts.map +1 -0
  180. package/dist/services/registered-targets.js +127 -0
  181. package/dist/services/registered-targets.js.map +1 -0
  182. package/dist/services/spine-services.d.ts +26 -12
  183. package/dist/services/spine-services.d.ts.map +1 -1
  184. package/dist/services/spine-services.js +1047 -969
  185. package/dist/services/spine-services.js.map +1 -1
  186. package/dist/spi/delivery.d.ts +5 -0
  187. package/dist/spi/delivery.d.ts.map +1 -0
  188. package/dist/spi/delivery.js +18 -0
  189. package/dist/spi/delivery.js.map +1 -0
  190. package/dist/spi/handler-registry.d.ts +8 -0
  191. package/dist/spi/handler-registry.d.ts.map +1 -0
  192. package/dist/spi/handler-registry.js +15 -0
  193. package/dist/spi/handler-registry.js.map +1 -0
  194. package/dist/stand/stand.d.ts +73 -1
  195. package/dist/stand/stand.d.ts.map +1 -1
  196. package/dist/stand/stand.js +221 -48
  197. package/dist/stand/stand.js.map +1 -1
  198. package/dist/stand/subscription-observer.d.ts.map +1 -1
  199. package/dist/stand/subscription-observer.js +5 -12
  200. package/dist/stand/subscription-observer.js.map +1 -1
  201. package/dist/stand/subscription-registry.js +1 -1
  202. package/dist/stand/subscription-registry.js.map +1 -1
  203. package/dist/testing/index.d.ts +25 -3
  204. package/dist/testing/index.d.ts.map +1 -1
  205. package/dist/testing/index.js +23 -3
  206. package/dist/testing/index.js.map +1 -1
  207. package/dist/tsconfig.tsbuildinfo +1 -1
  208. package/package.json +33 -23
  209. package/dist/handler/build-time-handler-analyzer.d.ts +0 -150
  210. package/dist/handler/build-time-handler-analyzer.d.ts.map +0 -1
  211. package/dist/handler/build-time-handler-analyzer.js +0 -1101
  212. package/dist/handler/build-time-handler-analyzer.js.map +0 -1
  213. package/dist/handler/generated-registry-writer.d.ts +0 -58
  214. package/dist/handler/generated-registry-writer.d.ts.map +0 -1
  215. package/dist/handler/generated-registry-writer.js +0 -458
  216. package/dist/handler/generated-registry-writer.js.map +0 -1
  217. package/dist/handler/handler-codegen.d.ts +0 -48
  218. package/dist/handler/handler-codegen.d.ts.map +0 -1
  219. package/dist/handler/handler-codegen.js +0 -214
  220. package/dist/handler/handler-codegen.js.map +0 -1
  221. package/dist/server/browser-server.d.ts +0 -49
  222. package/dist/server/browser-server.d.ts.map +0 -1
  223. package/dist/server/browser-server.js.map +0 -1
  224. package/dist/server/durable-subscription-bindings.d.ts.map +0 -1
  225. package/dist/server/durable-subscription-bindings.js.map +0 -1
  226. /package/dist/{server → browser}/durable-subscription-bindings.d.ts +0 -0
  227. /package/dist/{server → browser}/durable-subscription-bindings.js +0 -0
@@ -0,0 +1,144 @@
1
+ import { type Command, type Event } from "@spine-event-engine/proto";
2
+ import type { ILogLayer } from "loglayer";
3
+ import { CommandBus } from "../bus/command-bus.js";
4
+ import { EventBus } from "../bus/event-bus.js";
5
+ type PublicationKind = "command" | "event" | "rejection-event" | "system-event" | "stored-event";
6
+ interface ProducedSignalObserver {
7
+ readonly onCommand?: (command: Readonly<Command>) => void;
8
+ readonly onEvent?: (event: Readonly<Event>) => void;
9
+ }
10
+ /**
11
+ * Publishes produced signals and contains their detached dispatch failures for one context.
12
+ *
13
+ * @internal
14
+ */
15
+ export declare class SignalPublisher {
16
+ #private;
17
+ /**
18
+ * Creates a publisher for the context buses.
19
+ *
20
+ * @param commandBus Accepts produced Commands.
21
+ * @param eventBus Accepts produced Events.
22
+ * @param systemEventBus Accepts produced System Events.
23
+ * @param contextName Names the context in failure logs.
24
+ */
25
+ constructor(commandBus: CommandBus, eventBus: EventBus, systemEventBus: EventBus, contextName: string);
26
+ /**
27
+ * Publishes a produced Command for detached handling.
28
+ *
29
+ * @param command The produced Command envelope.
30
+ * @returns A promise that settles after the Command is handled or its failure is contained.
31
+ */
32
+ publishCommand(command: Command): Promise<void>;
33
+ /**
34
+ * Publishes a produced Event for detached handling.
35
+ *
36
+ * @param event The produced Event envelope.
37
+ * @returns A promise that settles after the Event is handled or its failure is contained.
38
+ */
39
+ publishEvent(event: Event): Promise<void>;
40
+ /**
41
+ * Dispatches a rejection Event without recording it as committed produced output.
42
+ *
43
+ * @internal
44
+ * @param event The rejection Event envelope.
45
+ * @returns A promise that settles after detached rejection handling is contained.
46
+ */
47
+ publishRejectionEvent(event: Event): Promise<void>;
48
+ /**
49
+ * Publishes one committed Aggregate Event and records its admission.
50
+ *
51
+ * Publishes the committed Event through stored-event handling without treating stored replay as
52
+ * newly produced output.
53
+ *
54
+ * @internal
55
+ * @param event The committed Aggregate Event envelope.
56
+ * @returns A promise that settles after stored dispatch handling is contained.
57
+ */
58
+ publishCommittedEvent(event: Event): Promise<void>;
59
+ /**
60
+ * Publishes a committed Aggregate reactor Event as stored follow-up work and records it.
61
+ *
62
+ * @internal
63
+ * @param event The committed follow-up Event envelope.
64
+ * @returns A promise that settles after stored follow-up dispatch is contained.
65
+ */
66
+ publishReactorEvent(event: Event): Promise<void>;
67
+ /**
68
+ * Publishes a produced System Event for detached handling.
69
+ *
70
+ * @param event The produced System Event envelope.
71
+ * @returns A promise that settles after the Event is handled or its failure is contained.
72
+ */
73
+ publishSystemEvent(event: Event): Promise<void>;
74
+ /**
75
+ * Publishes a stored Event for detached handling.
76
+ *
77
+ * @param event The stored Event envelope.
78
+ * @returns A promise that settles after the Event is handled or its failure is contained.
79
+ */
80
+ redispatchStored(event: Event): Promise<void>;
81
+ /**
82
+ * Publishes a stored Event after current bus work for detached handling.
83
+ *
84
+ * @param event The stored Event envelope.
85
+ * @returns A promise that settles after the Event is handled or its failure is contained.
86
+ */
87
+ redispatchStoredFollowUp(event: Event): Promise<void>;
88
+ /**
89
+ * Records a failure that was contained during produced-signal handling.
90
+ *
91
+ * @param kind Identifies the handled signal category.
92
+ * @param signal Identifies the signal when it is available.
93
+ * @param error Contains the handled failure.
94
+ */
95
+ reportFailure(kind: PublicationKind, signal: Command | Event | undefined, error: unknown): void;
96
+ /**
97
+ * Sets the logger used for contained publication failures.
98
+ *
99
+ * @param logger Receives contained publication failure records.
100
+ */
101
+ installLogger(logger: ILogLayer): void;
102
+ /**
103
+ * Clears the installed failure logger.
104
+ */
105
+ clearLogger(): void;
106
+ /**
107
+ * Starts closing while trusted produced work admitted during context shutdown drains.
108
+ * New trusted work remains admissible until `finishClose()` rejects it.
109
+ */
110
+ beginClose(): void;
111
+ /**
112
+ * Waits until all admitted produced signals have settled.
113
+ *
114
+ * @returns A promise that settles when admitted signal handling is complete.
115
+ */
116
+ drain(): Promise<void>;
117
+ /**
118
+ * Completes closure after admitted signal handling settles.
119
+ */
120
+ finishClose(): void;
121
+ /**
122
+ * Stops publication while context assembly is being abandoned.
123
+ */
124
+ abortAssembly(): void;
125
+ /**
126
+ * Observes admitted produced Commands and Events for package testing.
127
+ *
128
+ * @internal
129
+ * @param observer Receives cloned admitted signal envelopes.
130
+ * @returns A handle that stops this observation.
131
+ */
132
+ observe(observer: ProducedSignalObserver): {
133
+ readonly close: () => void;
134
+ };
135
+ /**
136
+ * Returns a printable identifier for a signal.
137
+ *
138
+ * @param signal The signal to identify.
139
+ * @returns The signal identifier, or `"unknown"` when unavailable.
140
+ */
141
+ static signalId(signal: Command | Event | undefined): string;
142
+ }
143
+ export {};
144
+ //# sourceMappingURL=signal-publisher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal-publisher.d.ts","sourceRoot":"","sources":["../../src/runtime/signal-publisher.ts"],"names":[],"mappings":"AAeA,OAAO,EAA8B,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAoB,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAkB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/D,KAAK,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,iBAAiB,GAAG,cAAc,GAAG,cAAc,CAAC;AAEjG,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;CACrD;AAED;;;;GAIG;AACH,qBAAa,eAAe;;IAU1B;;;;;;;OAOG;gBAED,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,QAAQ,EACxB,WAAW,EAAE,MAAM;IAQr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AM,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM;CAK7D"}
@@ -0,0 +1,248 @@
1
+ /*
2
+ * Copyright 2026, CodeMatters. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
+ * in compliance with the License. You may obtain a copy of the License at
6
+ *
7
+ * https://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
10
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
+ * or implied. See the License for the specific language governing permissions and limitations under
12
+ * the License.
13
+ */
14
+ import { clone } from "@bufbuild/protobuf";
15
+ import { CommandSchema, EventSchema } from "@spine-event-engine/proto";
16
+ import { commandBusAccess, CommandBus } from "../bus/command-bus.js";
17
+ import { eventBusAccess, EventBus } from "../bus/event-bus.js";
18
+ import { emitServerError } from "../server/server-log.js";
19
+ /**
20
+ * Publishes produced signals and contains their detached dispatch failures for one context.
21
+ *
22
+ * @internal
23
+ */
24
+ export class SignalPublisher {
25
+ #commandBus;
26
+ #eventBus;
27
+ #systemEventBus;
28
+ #contextName;
29
+ #inFlight = new Set();
30
+ #observers = new Set();
31
+ #logger;
32
+ #state = "open";
33
+ /**
34
+ * Creates a publisher for the context buses.
35
+ *
36
+ * @param commandBus Accepts produced Commands.
37
+ * @param eventBus Accepts produced Events.
38
+ * @param systemEventBus Accepts produced System Events.
39
+ * @param contextName Names the context in failure logs.
40
+ */
41
+ constructor(commandBus, eventBus, systemEventBus, contextName) {
42
+ this.#commandBus = commandBus;
43
+ this.#eventBus = eventBus;
44
+ this.#systemEventBus = systemEventBus;
45
+ this.#contextName = contextName;
46
+ }
47
+ /**
48
+ * Publishes a produced Command for detached handling.
49
+ *
50
+ * @param command The produced Command envelope.
51
+ * @returns A promise that settles after the Command is handled or its failure is contained.
52
+ */
53
+ publishCommand(command) {
54
+ return this.#publish("command", command, () => commandBusAccess.postInternalFollowUp(this.#commandBus, command));
55
+ }
56
+ /**
57
+ * Publishes a produced Event for detached handling.
58
+ *
59
+ * @param event The produced Event envelope.
60
+ * @returns A promise that settles after the Event is handled or its failure is contained.
61
+ */
62
+ publishEvent(event) {
63
+ return this.#publish("event", event, () => eventBusAccess.postFollowUp(this.#eventBus, event));
64
+ }
65
+ /**
66
+ * Dispatches a rejection Event without recording it as committed produced output.
67
+ *
68
+ * @internal
69
+ * @param event The rejection Event envelope.
70
+ * @returns A promise that settles after detached rejection handling is contained.
71
+ */
72
+ publishRejectionEvent(event) {
73
+ return this.#publish("rejection-event", event, () => eventBusAccess.postFollowUp(this.#eventBus, event));
74
+ }
75
+ /**
76
+ * Publishes one committed Aggregate Event and records its admission.
77
+ *
78
+ * Publishes the committed Event through stored-event handling without treating stored replay as
79
+ * newly produced output.
80
+ *
81
+ * @internal
82
+ * @param event The committed Aggregate Event envelope.
83
+ * @returns A promise that settles after stored dispatch handling is contained.
84
+ */
85
+ publishCommittedEvent(event) {
86
+ return this.#publish("event", event, () => eventBusAccess.postStored(this.#eventBus, event));
87
+ }
88
+ /**
89
+ * Publishes a committed Aggregate reactor Event as stored follow-up work and records it.
90
+ *
91
+ * @internal
92
+ * @param event The committed follow-up Event envelope.
93
+ * @returns A promise that settles after stored follow-up dispatch is contained.
94
+ */
95
+ publishReactorEvent(event) {
96
+ return this.#publish("event", event, () => eventBusAccess.postStoredFollowUp(this.#eventBus, event));
97
+ }
98
+ /**
99
+ * Publishes a produced System Event for detached handling.
100
+ *
101
+ * @param event The produced System Event envelope.
102
+ * @returns A promise that settles after the Event is handled or its failure is contained.
103
+ */
104
+ publishSystemEvent(event) {
105
+ return this.#publish("system-event", event, () => eventBusAccess.postFollowUp(this.#systemEventBus, event));
106
+ }
107
+ /**
108
+ * Publishes a stored Event for detached handling.
109
+ *
110
+ * @param event The stored Event envelope.
111
+ * @returns A promise that settles after the Event is handled or its failure is contained.
112
+ */
113
+ redispatchStored(event) {
114
+ return this.#publish("stored-event", event, () => eventBusAccess.postStored(this.#eventBus, event));
115
+ }
116
+ /**
117
+ * Publishes a stored Event after current bus work for detached handling.
118
+ *
119
+ * @param event The stored Event envelope.
120
+ * @returns A promise that settles after the Event is handled or its failure is contained.
121
+ */
122
+ redispatchStoredFollowUp(event) {
123
+ return this.#publish("stored-event", event, () => eventBusAccess.postStoredFollowUp(this.#eventBus, event));
124
+ }
125
+ /**
126
+ * Records a failure that was contained during produced-signal handling.
127
+ *
128
+ * @param kind Identifies the handled signal category.
129
+ * @param signal Identifies the signal when it is available.
130
+ * @param error Contains the handled failure.
131
+ */
132
+ reportFailure(kind, signal, error) {
133
+ const logger = this.#logger;
134
+ if (logger === undefined)
135
+ return;
136
+ emitServerError(logger, "Produced signal handling failed.", {
137
+ context: this.#contextName,
138
+ kind,
139
+ signalId: SignalPublisher.signalId(signal),
140
+ signalType: signal?.message?.typeUrl ?? "unknown",
141
+ operation: "signal_publisher.handle",
142
+ reasonCode: "handled_failure",
143
+ });
144
+ void error;
145
+ }
146
+ /**
147
+ * Sets the logger used for contained publication failures.
148
+ *
149
+ * @param logger Receives contained publication failure records.
150
+ */
151
+ installLogger(logger) {
152
+ this.#logger = logger;
153
+ }
154
+ /**
155
+ * Clears the installed failure logger.
156
+ */
157
+ clearLogger() {
158
+ this.#logger = undefined;
159
+ }
160
+ /**
161
+ * Starts closing while trusted produced work admitted during context shutdown drains.
162
+ * New trusted work remains admissible until `finishClose()` rejects it.
163
+ */
164
+ beginClose() {
165
+ if (this.#state === "open")
166
+ this.#state = "closing";
167
+ }
168
+ /**
169
+ * Waits until all admitted produced signals have settled.
170
+ *
171
+ * @returns A promise that settles when admitted signal handling is complete.
172
+ */
173
+ async drain() {
174
+ while (this.#inFlight.size > 0) {
175
+ await Promise.all([...this.#inFlight]);
176
+ }
177
+ }
178
+ /**
179
+ * Completes closure after admitted signal handling settles.
180
+ */
181
+ finishClose() {
182
+ this.#state = "closed";
183
+ }
184
+ /**
185
+ * Stops publication while context assembly is being abandoned.
186
+ */
187
+ abortAssembly() {
188
+ this.#state = "closed";
189
+ this.#inFlight.clear();
190
+ }
191
+ /**
192
+ * Observes admitted produced Commands and Events for package testing.
193
+ *
194
+ * @internal
195
+ * @param observer Receives cloned admitted signal envelopes.
196
+ * @returns A handle that stops this observation.
197
+ */
198
+ observe(observer) {
199
+ this.#observers.add(observer);
200
+ return Object.freeze({ close: () => this.#observers.delete(observer) });
201
+ }
202
+ #publish(kind, signal, publish) {
203
+ if (this.#state === "closed") {
204
+ const rejected = Promise.reject(new Error("SignalPublisher is closed."));
205
+ void rejected.catch((error) => {
206
+ this.reportFailure(kind, signal, error);
207
+ });
208
+ return rejected;
209
+ }
210
+ this.#observe(kind, signal);
211
+ const handled = Promise.resolve()
212
+ .then(publish)
213
+ .catch((error) => {
214
+ this.reportFailure(kind, signal, error);
215
+ });
216
+ this.#inFlight.add(handled);
217
+ void handled.then(() => {
218
+ this.#inFlight.delete(handled);
219
+ });
220
+ return handled;
221
+ }
222
+ #observe(kind, signal) {
223
+ for (const observer of this.#observers) {
224
+ try {
225
+ if (kind === "command")
226
+ observer.onCommand?.(clone(CommandSchema, signal));
227
+ if (kind === "event")
228
+ observer.onEvent?.(clone(EventSchema, signal));
229
+ }
230
+ catch {
231
+ // Testing observation cannot change produced-signal publication.
232
+ }
233
+ }
234
+ }
235
+ /**
236
+ * Returns a printable identifier for a signal.
237
+ *
238
+ * @param signal The signal to identify.
239
+ * @returns The signal identifier, or `"unknown"` when unavailable.
240
+ */
241
+ static signalId(signal) {
242
+ const id = signal?.id;
243
+ if (id === undefined)
244
+ return "unknown";
245
+ return "uuid" in id ? id.uuid : id.value;
246
+ }
247
+ }
248
+ //# sourceMappingURL=signal-publisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal-publisher.js","sourceRoot":"","sources":["../../src/runtime/signal-publisher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,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I,KAAK,SAAS;oBAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,MAAiB,CAAC,CAAC,CAAC;gBACtF,IAAI,IAAI,KAAK,OAAO;oBAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,MAAe,CAAC,CAAC,CAAC;YAChF,CAAC;YAAC,MAAM,CAAC;gBACP,iEAAiE;YACnE,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAmC;QACjD,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC;QACtB,IAAI,EAAE,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QACvC,OAAO,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;IAC3C,CAAC;CACF"}
@@ -0,0 +1,130 @@
1
+ import { type MessageSchema } from "@spine-event-engine/core";
2
+ import { type CommandContext, type EventContext, type Command, type Event } from "@spine-event-engine/proto";
3
+ import type { CommandDispatcher } from "../bus/command-dispatcher.js";
4
+ import type { EventDispatcher } from "../bus/event-dispatcher.js";
5
+ import type { GeneratedHandlerRecordInput, GeneratedStandaloneHandlerGroup } from "../handler/generated-handler-registry.js";
6
+ import { type EventHandlerFilterPlan } from "../handler/event-handler-filter.js";
7
+ import { SignalPublisher } from "./signal-publisher.js";
8
+ /**
9
+ * Materializes generated standalone receivers without treating them as Entities.
10
+ *
11
+ * @internal
12
+ */
13
+ export declare class StandaloneHandlerRuntime {
14
+ #private;
15
+ /**
16
+ * Creates runtime bindings for registered standalone receivers.
17
+ *
18
+ * @param receivers Generated receiver groups with their application instances and publisher.
19
+ */
20
+ constructor(receivers: readonly StandaloneBinding[]);
21
+ /**
22
+ * Creates a dispatcher for standalone Command receptors.
23
+ *
24
+ * @returns The dispatcher, or `undefined` when no Command receptor is bound.
25
+ */
26
+ commandDispatcher(): CommandDispatcher | undefined;
27
+ /**
28
+ * Creates a dispatcher for standalone Event receptors.
29
+ *
30
+ * @returns The dispatcher, or `undefined` when no Event receptor is bound.
31
+ */
32
+ eventDispatcher(): EventDispatcher | undefined;
33
+ /**
34
+ * Creates a System Event Bus dispatcher for standalone state subscribers.
35
+ *
36
+ * @returns The dispatcher, or `undefined` when no state subscriber is bound.
37
+ */
38
+ stateDispatcher(): EventDispatcher | undefined;
39
+ /**
40
+ * Binds one generated handler declaration to its standalone application instance.
41
+ *
42
+ * @param group The generated receiver group.
43
+ * @param instance The registered application instance.
44
+ * @param handler The generated handler declaration.
45
+ * @returns The immutable runtime binding.
46
+ */
47
+ static bind(group: GeneratedStandaloneHandlerGroup, instance: object, handler: GeneratedHandlerRecordInput): Binding;
48
+ /**
49
+ * Lists distinct signal schemas used by bindings.
50
+ *
51
+ * @param bindings The bindings to inspect.
52
+ * @returns Distinct signal schemas in binding order.
53
+ */
54
+ static schemas(bindings: readonly Binding[]): readonly MessageSchema[];
55
+ /**
56
+ * Builds Event filters for standalone Event receptors.
57
+ *
58
+ * @param bindings The bindings to organize.
59
+ * @returns Filter plans keyed by signal schema and origin.
60
+ */
61
+ static eventFilters(bindings: readonly Binding[]): ReadonlyMap<string, EventHandlerFilterPlan<Binding>>;
62
+ /**
63
+ * Copies a Command context or creates its generated default.
64
+ *
65
+ * @param command The Command that provides the context.
66
+ * @returns An independent Command context.
67
+ */
68
+ static commandContext(command: Command): CommandContext;
69
+ /**
70
+ * Copies an Event context or creates its generated default.
71
+ *
72
+ * @param event The Event that provides the context.
73
+ * @returns An independent Event context.
74
+ */
75
+ static eventContext(event: Event): EventContext;
76
+ /**
77
+ * Creates a key for one Event schema and origin.
78
+ *
79
+ * @param typeName The Event schema type name.
80
+ * @param origin The required Event origin.
81
+ * @returns The filter-map key.
82
+ */
83
+ static eventFilterKey(typeName: string, origin: "domestic" | "external"): string;
84
+ /**
85
+ * Throws for a missing publisher during invalid runtime construction.
86
+ *
87
+ * @returns This method never returns because it throws.
88
+ */
89
+ static missingPublisher(): SignalPublisher;
90
+ }
91
+ /**
92
+ * Connects generated standalone metadata with its registered application instance.
93
+ */
94
+ export interface StandaloneBinding {
95
+ /**
96
+ * The generated group for the standalone receiver.
97
+ */
98
+ readonly group: GeneratedStandaloneHandlerGroup;
99
+ /**
100
+ * The registered standalone application instance.
101
+ */
102
+ readonly instance: object;
103
+ /**
104
+ * Publishes signals produced by the bound receiver.
105
+ */
106
+ readonly publisher: SignalPublisher;
107
+ }
108
+ /**
109
+ * Generated handler declaration paired with its bound application method.
110
+ */
111
+ interface Binding {
112
+ /**
113
+ * Generated group containing the standalone receiver's declarations.
114
+ */
115
+ readonly group: GeneratedStandaloneHandlerGroup;
116
+ /**
117
+ * Generated declaration for the bound method.
118
+ */
119
+ readonly handler: GeneratedHandlerRecordInput;
120
+ /**
121
+ * Invokes the application method with the argument count declared in metadata.
122
+ *
123
+ * @param message Unpacked input signal or Entity state.
124
+ * @param context Invocation context, passed only to a two-parameter method.
125
+ * @returns The application's synchronous result or Promise.
126
+ */
127
+ readonly invoke: (message: unknown, context: unknown) => unknown;
128
+ }
129
+ export {};
130
+ //# sourceMappingURL=standalone-handler-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standalone-handler-runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/standalone-handler-runtime.ts"],"names":[],"mappings":"AAeA,OAAO,EAAmC,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACX,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EACV,2BAA2B,EAC3B,+BAA+B,EAChC,MAAM,0CAA0C,CAAC;A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