@graphrefly/ts 0.0.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/dist/adapters/index.cjs +9015 -0
- package/dist/adapters/index.cjs.map +1 -0
- package/dist/adapters/index.d.cts +678 -0
- package/dist/adapters/index.d.ts +678 -0
- package/dist/adapters/index.js +2894 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/observe-storage.cjs +260 -0
- package/dist/adapters/observe-storage.cjs.map +1 -0
- package/dist/adapters/observe-storage.d.cts +77 -0
- package/dist/adapters/observe-storage.d.ts +77 -0
- package/dist/adapters/observe-storage.js +161 -0
- package/dist/adapters/observe-storage.js.map +1 -0
- package/dist/append-log-DisvEReb.d.cts +189 -0
- package/dist/append-log-DzKMmjxx.d.ts +189 -0
- package/dist/chunk-2ILL7HQI.js +1189 -0
- package/dist/chunk-2ILL7HQI.js.map +1 -0
- package/dist/chunk-4VLAQHZI.js +330 -0
- package/dist/chunk-4VLAQHZI.js.map +1 -0
- package/dist/chunk-6PHB5CJS.js +229 -0
- package/dist/chunk-6PHB5CJS.js.map +1 -0
- package/dist/chunk-COHO25CZ.js +2449 -0
- package/dist/chunk-COHO25CZ.js.map +1 -0
- package/dist/chunk-D6BG7U6A.js +161 -0
- package/dist/chunk-D6BG7U6A.js.map +1 -0
- package/dist/chunk-DJC4CHLQ.js +818 -0
- package/dist/chunk-DJC4CHLQ.js.map +1 -0
- package/dist/chunk-DK554R7P.js +67 -0
- package/dist/chunk-DK554R7P.js.map +1 -0
- package/dist/chunk-DKP56CSW.js +322 -0
- package/dist/chunk-DKP56CSW.js.map +1 -0
- package/dist/chunk-G4M3NHRJ.js +688 -0
- package/dist/chunk-G4M3NHRJ.js.map +1 -0
- package/dist/chunk-GAJW5I5P.js +1 -0
- package/dist/chunk-GAJW5I5P.js.map +1 -0
- package/dist/chunk-GDL26N2T.js +282 -0
- package/dist/chunk-GDL26N2T.js.map +1 -0
- package/dist/chunk-GTPCOEOZ.js +741 -0
- package/dist/chunk-GTPCOEOZ.js.map +1 -0
- package/dist/chunk-H2HTHFVN.js +1 -0
- package/dist/chunk-H2HTHFVN.js.map +1 -0
- package/dist/chunk-HDRL4VQQ.js +218 -0
- package/dist/chunk-HDRL4VQQ.js.map +1 -0
- package/dist/chunk-I3IHOHCJ.js +2267 -0
- package/dist/chunk-I3IHOHCJ.js.map +1 -0
- package/dist/chunk-JIMUDQN3.js +965 -0
- package/dist/chunk-JIMUDQN3.js.map +1 -0
- package/dist/chunk-JR4IKCR2.js +462 -0
- package/dist/chunk-JR4IKCR2.js.map +1 -0
- package/dist/chunk-K3FXTC3I.js +165 -0
- package/dist/chunk-K3FXTC3I.js.map +1 -0
- package/dist/chunk-OOEN33FB.js +65 -0
- package/dist/chunk-OOEN33FB.js.map +1 -0
- package/dist/chunk-PKVBHGBM.js +554 -0
- package/dist/chunk-PKVBHGBM.js.map +1 -0
- package/dist/chunk-RIIOUTGM.js +1857 -0
- package/dist/chunk-RIIOUTGM.js.map +1 -0
- package/dist/chunk-SCRFRCGR.js +33 -0
- package/dist/chunk-SCRFRCGR.js.map +1 -0
- package/dist/chunk-SWTLEQL6.js +53 -0
- package/dist/chunk-SWTLEQL6.js.map +1 -0
- package/dist/chunk-SZAETNNA.js +1 -0
- package/dist/chunk-SZAETNNA.js.map +1 -0
- package/dist/chunk-TEW47IVR.js +49 -0
- package/dist/chunk-TEW47IVR.js.map +1 -0
- package/dist/chunk-Y3ZLRGHC.js +1482 -0
- package/dist/chunk-Y3ZLRGHC.js.map +1 -0
- package/dist/chunk-Z2ANQ6JW.js +149 -0
- package/dist/chunk-Z2ANQ6JW.js.map +1 -0
- package/dist/codec-BB7p8fJc.d.cts +38 -0
- package/dist/codec-BB7p8fJc.d.ts +38 -0
- package/dist/composition/index.cjs +2505 -0
- package/dist/composition/index.cjs.map +1 -0
- package/dist/composition/index.d.cts +95 -0
- package/dist/composition/index.d.ts +95 -0
- package/dist/composition/index.js +19 -0
- package/dist/composition/index.js.map +1 -0
- package/dist/core/index.cjs +2475 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +25 -0
- package/dist/core/index.d.ts +25 -0
- package/dist/core/index.js +74 -0
- package/dist/core/index.js.map +1 -0
- package/dist/cqrs/index.cjs +595 -0
- package/dist/cqrs/index.cjs.map +1 -0
- package/dist/cqrs/index.d.cts +200 -0
- package/dist/cqrs/index.d.ts +200 -0
- package/dist/cqrs/index.js +557 -0
- package/dist/cqrs/index.js.map +1 -0
- package/dist/data-structures/index.cjs +4277 -0
- package/dist/data-structures/index.cjs.map +1 -0
- package/dist/data-structures/index.d.cts +22 -0
- package/dist/data-structures/index.d.ts +22 -0
- package/dist/data-structures/index.js +31 -0
- package/dist/data-structures/index.js.map +1 -0
- package/dist/describe-BZb7AS2y.d.ts +57 -0
- package/dist/describe-Ciu8SUnN.d.cts +57 -0
- package/dist/graph/index.cjs +7832 -0
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +251 -0
- package/dist/graph/index.d.ts +251 -0
- package/dist/graph/index.js +131 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph-DfdF9zy4.d.ts +666 -0
- package/dist/graph-s23RbbFO.d.cts +666 -0
- package/dist/index-CAEmLCYF.d.cts +166 -0
- package/dist/index-SnzZu3x7.d.ts +166 -0
- package/dist/index.cjs +15409 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +582 -0
- package/dist/index.js.map +1 -0
- package/dist/messages-BZqrGGm1.d.cts +55 -0
- package/dist/messages-BZqrGGm1.d.ts +55 -0
- package/dist/messaging/index.cjs +818 -0
- package/dist/messaging/index.cjs.map +1 -0
- package/dist/messaging/index.d.cts +235 -0
- package/dist/messaging/index.d.ts +235 -0
- package/dist/messaging/index.js +767 -0
- package/dist/messaging/index.js.map +1 -0
- package/dist/observe-event-log-0SVsx7JG.d.cts +88 -0
- package/dist/observe-event-log-Dnm76owp.d.ts +88 -0
- package/dist/operators/index.cjs +3774 -0
- package/dist/operators/index.cjs.map +1 -0
- package/dist/operators/index.d.cts +308 -0
- package/dist/operators/index.d.ts +308 -0
- package/dist/operators/index.js +112 -0
- package/dist/operators/index.js.map +1 -0
- package/dist/orchestration/index.cjs +3541 -0
- package/dist/orchestration/index.cjs.map +1 -0
- package/dist/orchestration/index.d.cts +302 -0
- package/dist/orchestration/index.d.ts +302 -0
- package/dist/orchestration/index.js +1004 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/patterns/index.cjs +1045 -0
- package/dist/patterns/index.cjs.map +1 -0
- package/dist/patterns/index.d.cts +39 -0
- package/dist/patterns/index.d.ts +39 -0
- package/dist/patterns/index.js +33 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/reactive-collection-BxBqtIOE.d.cts +344 -0
- package/dist/reactive-collection-Cb1II1Fi.d.ts +344 -0
- package/dist/reactive-collection-storage-BNiEc-Gd.d.ts +217 -0
- package/dist/reactive-collection-storage-D-KmjE0J.d.cts +217 -0
- package/dist/reactive-map-BcB4KsQR.d.ts +256 -0
- package/dist/reactive-map-D-g3dv8I.d.cts +256 -0
- package/dist/read-through-B1CYPfq_.d.cts +82 -0
- package/dist/read-through-DwyJhGs1.d.ts +82 -0
- package/dist/render/index.cjs +250 -0
- package/dist/render/index.cjs.map +1 -0
- package/dist/render/index.d.cts +58 -0
- package/dist/render/index.d.ts +58 -0
- package/dist/render/index.js +20 -0
- package/dist/render/index.js.map +1 -0
- package/dist/resilience-Dig3Q7n0.d.cts +45 -0
- package/dist/resilience-Dig3Q7n0.d.ts +45 -0
- package/dist/semantic-memory-graph-BYoIlP35.d.cts +356 -0
- package/dist/semantic-memory-graph-CxyXLms3.d.ts +356 -0
- package/dist/solutions/index.cjs +3249 -0
- package/dist/solutions/index.cjs.map +1 -0
- package/dist/solutions/index.d.cts +520 -0
- package/dist/solutions/index.d.ts +520 -0
- package/dist/solutions/index.js +31 -0
- package/dist/solutions/index.js.map +1 -0
- package/dist/sources/browser.cjs +3095 -0
- package/dist/sources/browser.cjs.map +1 -0
- package/dist/sources/browser.d.cts +39 -0
- package/dist/sources/browser.d.ts +39 -0
- package/dist/sources/browser.js +137 -0
- package/dist/sources/browser.js.map +1 -0
- package/dist/sources/index.cjs +3021 -0
- package/dist/sources/index.cjs.map +1 -0
- package/dist/sources/index.d.cts +7 -0
- package/dist/sources/index.d.ts +7 -0
- package/dist/sources/index.js +63 -0
- package/dist/sources/index.js.map +1 -0
- package/dist/sources/node.cjs +675 -0
- package/dist/sources/node.cjs.map +1 -0
- package/dist/sources/node.d.cts +109 -0
- package/dist/sources/node.d.ts +109 -0
- package/dist/sources/node.js +639 -0
- package/dist/sources/node.js.map +1 -0
- package/dist/storage/browser.cjs +777 -0
- package/dist/storage/browser.cjs.map +1 -0
- package/dist/storage/browser.d.cts +40 -0
- package/dist/storage/browser.d.ts +40 -0
- package/dist/storage/browser.js +275 -0
- package/dist/storage/browser.js.map +1 -0
- package/dist/storage/index.cjs +1989 -0
- package/dist/storage/index.cjs.map +1 -0
- package/dist/storage/index.d.cts +92 -0
- package/dist/storage/index.d.ts +92 -0
- package/dist/storage/index.js +161 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/node.cjs +898 -0
- package/dist/storage/node.cjs.map +1 -0
- package/dist/storage/node.d.cts +66 -0
- package/dist/storage/node.d.ts +66 -0
- package/dist/storage/node.js +402 -0
- package/dist/storage/node.js.map +1 -0
- package/dist/testing/index.cjs +95 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +20 -0
- package/dist/testing/index.d.ts +20 -0
- package/dist/testing/index.js +8 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/types-bNMSWKqF.d.cts +732 -0
- package/dist/types-h12mNYbq.d.ts +732 -0
- package/package.json +250 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { d as Graph } from '../graph-s23RbbFO.cjs';
|
|
2
|
+
import { b as RetryStatus, B as BackoffPolicy, R as RetryPolicy } from '../resilience-Dig3Q7n0.cjs';
|
|
3
|
+
export { c as backoffDelayMs, n as nextRetryDelayMs, d as noBackoff, r as retryPolicy, s as shouldRetry } from '../resilience-Dig3Q7n0.cjs';
|
|
4
|
+
import { N as Node } from '../types-bNMSWKqF.cjs';
|
|
5
|
+
import '../core/index.cjs';
|
|
6
|
+
import '../messages-BZqrGGm1.cjs';
|
|
7
|
+
import '../codec-BB7p8fJc.cjs';
|
|
8
|
+
import '../describe-Ciu8SUnN.cjs';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Reusable application-infrastructure orchestration namespace.
|
|
12
|
+
*
|
|
13
|
+
* Retained root orchestration helpers land here only after B63 re-derives them
|
|
14
|
+
* onto clean-slate graph surfaces.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
type ResilienceEvent = {
|
|
18
|
+
readonly kind: "attempt";
|
|
19
|
+
readonly attempt: number;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: "retry";
|
|
22
|
+
readonly attempt: number;
|
|
23
|
+
readonly delayMs: number;
|
|
24
|
+
readonly error: unknown;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: "success";
|
|
27
|
+
readonly attempt?: number;
|
|
28
|
+
} | {
|
|
29
|
+
readonly kind: "failure";
|
|
30
|
+
readonly attempt?: number;
|
|
31
|
+
readonly error: unknown;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: "exhausted";
|
|
34
|
+
readonly attempt: number;
|
|
35
|
+
readonly error: unknown;
|
|
36
|
+
};
|
|
37
|
+
interface RetryStatusBundle {
|
|
38
|
+
readonly status: Node<RetryStatus>;
|
|
39
|
+
readonly errors: Node<unknown>;
|
|
40
|
+
}
|
|
41
|
+
interface BreakerOptions {
|
|
42
|
+
readonly failureThreshold: number;
|
|
43
|
+
readonly resetAfterMs?: number;
|
|
44
|
+
readonly now?: () => number;
|
|
45
|
+
readonly name?: string;
|
|
46
|
+
}
|
|
47
|
+
interface BreakerStatus {
|
|
48
|
+
readonly state: "closed" | "open" | "half-open";
|
|
49
|
+
readonly failures: number;
|
|
50
|
+
readonly openedAtMs?: number;
|
|
51
|
+
}
|
|
52
|
+
interface BreakerBundle {
|
|
53
|
+
readonly status: Node<BreakerStatus>;
|
|
54
|
+
readonly allowed: Node<boolean>;
|
|
55
|
+
}
|
|
56
|
+
interface RateLimitOptions {
|
|
57
|
+
readonly max: number;
|
|
58
|
+
readonly windowMs: number;
|
|
59
|
+
readonly now?: () => number;
|
|
60
|
+
readonly name?: string;
|
|
61
|
+
}
|
|
62
|
+
interface RateLimitStatus {
|
|
63
|
+
readonly allowed: number;
|
|
64
|
+
readonly dropped: number;
|
|
65
|
+
readonly remaining: number;
|
|
66
|
+
readonly resetAtMs: number;
|
|
67
|
+
}
|
|
68
|
+
interface RateLimitBundle<T> {
|
|
69
|
+
readonly allowed: Node<T>;
|
|
70
|
+
readonly dropped: Node<T>;
|
|
71
|
+
readonly status: Node<RateLimitStatus>;
|
|
72
|
+
}
|
|
73
|
+
interface TimeoutBundle<T> {
|
|
74
|
+
readonly node: Node<T>;
|
|
75
|
+
readonly status: Node<"running" | "completed" | "errored">;
|
|
76
|
+
readonly errors: Node<unknown>;
|
|
77
|
+
}
|
|
78
|
+
/** D136 graph-visible process command fact. */
|
|
79
|
+
interface ProcessCommand<T = unknown> {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly type: string;
|
|
82
|
+
readonly payload: T;
|
|
83
|
+
readonly processId?: string;
|
|
84
|
+
readonly correlationId?: string;
|
|
85
|
+
readonly causationId?: string;
|
|
86
|
+
readonly metadata?: Record<string, unknown>;
|
|
87
|
+
}
|
|
88
|
+
/** Event draft returned by a ProcessBundle reducer before runtime ordering. */
|
|
89
|
+
interface ProcessEventDraft<T = unknown> {
|
|
90
|
+
readonly id?: string;
|
|
91
|
+
readonly type: string;
|
|
92
|
+
readonly payload: T;
|
|
93
|
+
readonly processId?: string;
|
|
94
|
+
readonly correlationId?: string;
|
|
95
|
+
readonly causationId?: string;
|
|
96
|
+
readonly metadata?: Record<string, unknown>;
|
|
97
|
+
}
|
|
98
|
+
/** Ordered process event fact. These are DATA facts, not protocol messages. */
|
|
99
|
+
interface ProcessEvent<T = unknown> {
|
|
100
|
+
readonly id: string;
|
|
101
|
+
readonly type: string;
|
|
102
|
+
readonly seq: number;
|
|
103
|
+
readonly cursor: number;
|
|
104
|
+
readonly commandId: string;
|
|
105
|
+
readonly commandType: string;
|
|
106
|
+
readonly payload: T;
|
|
107
|
+
readonly timestampMs: number;
|
|
108
|
+
readonly processId?: string;
|
|
109
|
+
readonly correlationId?: string;
|
|
110
|
+
readonly causationId?: string;
|
|
111
|
+
readonly metadata?: Record<string, unknown>;
|
|
112
|
+
}
|
|
113
|
+
/** Effect-request draft emitted by a ProcessBundle reducer for visible effect runners. */
|
|
114
|
+
interface ProcessEffectRequestDraft<T = unknown> {
|
|
115
|
+
readonly id?: string;
|
|
116
|
+
readonly type: string;
|
|
117
|
+
readonly payload: T;
|
|
118
|
+
readonly processId?: string;
|
|
119
|
+
readonly correlationId?: string;
|
|
120
|
+
readonly causationId?: string;
|
|
121
|
+
readonly metadata?: Record<string, unknown>;
|
|
122
|
+
}
|
|
123
|
+
/** Ordered effect-request fact. Effect runners consume this node in later slices. */
|
|
124
|
+
interface ProcessEffectRequest<T = unknown> {
|
|
125
|
+
readonly id: string;
|
|
126
|
+
readonly type: string;
|
|
127
|
+
readonly seq: number;
|
|
128
|
+
readonly cursor: number;
|
|
129
|
+
readonly commandId: string;
|
|
130
|
+
readonly commandType: string;
|
|
131
|
+
readonly payload: T;
|
|
132
|
+
readonly timestampMs: number;
|
|
133
|
+
readonly processId?: string;
|
|
134
|
+
readonly correlationId?: string;
|
|
135
|
+
readonly causationId?: string;
|
|
136
|
+
readonly metadata?: Record<string, unknown>;
|
|
137
|
+
}
|
|
138
|
+
type ProcessEffectCommandType = "effect.result" | "effect.failure" | "effect.cancel" | "effect.timeout";
|
|
139
|
+
interface ProcessEffectOutcomeBase {
|
|
140
|
+
readonly effectId: string;
|
|
141
|
+
readonly effectType: string;
|
|
142
|
+
readonly processId?: string;
|
|
143
|
+
readonly correlationId?: string;
|
|
144
|
+
readonly causationId?: string;
|
|
145
|
+
readonly commandId?: string;
|
|
146
|
+
readonly metadata?: Record<string, unknown>;
|
|
147
|
+
}
|
|
148
|
+
type ProcessEffectOutcome<TResult = unknown> = (ProcessEffectOutcomeBase & {
|
|
149
|
+
readonly kind: "result";
|
|
150
|
+
readonly value: TResult;
|
|
151
|
+
}) | (ProcessEffectOutcomeBase & {
|
|
152
|
+
readonly kind: "failure";
|
|
153
|
+
readonly error: unknown;
|
|
154
|
+
}) | (ProcessEffectOutcomeBase & {
|
|
155
|
+
readonly kind: "cancel";
|
|
156
|
+
readonly reason?: string;
|
|
157
|
+
}) | (ProcessEffectOutcomeBase & {
|
|
158
|
+
readonly kind: "timeout";
|
|
159
|
+
readonly error: unknown;
|
|
160
|
+
});
|
|
161
|
+
type ProcessEffectCommandPayload<TResult = unknown> = (Omit<ProcessEffectOutcomeBase, "commandId"> & {
|
|
162
|
+
readonly kind: "result";
|
|
163
|
+
readonly value: TResult;
|
|
164
|
+
}) | (Omit<ProcessEffectOutcomeBase, "commandId"> & {
|
|
165
|
+
readonly kind: "failure";
|
|
166
|
+
readonly error: unknown;
|
|
167
|
+
}) | (Omit<ProcessEffectOutcomeBase, "commandId"> & {
|
|
168
|
+
readonly kind: "cancel";
|
|
169
|
+
readonly reason?: string;
|
|
170
|
+
}) | (Omit<ProcessEffectOutcomeBase, "commandId"> & {
|
|
171
|
+
readonly kind: "timeout";
|
|
172
|
+
readonly error: unknown;
|
|
173
|
+
});
|
|
174
|
+
type ProcessErrorCode = "malformed-command" | "reducer-threw" | "clock-threw" | "malformed-state" | "malformed-event" | "malformed-effect";
|
|
175
|
+
/** Graph-visible ProcessBundle error fact. These are DATA facts, not protocol ERROR. */
|
|
176
|
+
interface ProcessError {
|
|
177
|
+
readonly code: ProcessErrorCode;
|
|
178
|
+
readonly message: string;
|
|
179
|
+
readonly command?: unknown;
|
|
180
|
+
readonly commandId?: string;
|
|
181
|
+
readonly commandType?: string;
|
|
182
|
+
readonly cursor: ProcessCursor;
|
|
183
|
+
}
|
|
184
|
+
/** Accepted/rejected command outcome projected from the ProcessBundle runtime. */
|
|
185
|
+
interface ProcessStatus {
|
|
186
|
+
readonly state: "accepted" | "rejected";
|
|
187
|
+
readonly commandId?: string;
|
|
188
|
+
readonly commandType?: string;
|
|
189
|
+
readonly eventCount: number;
|
|
190
|
+
readonly effectCount: number;
|
|
191
|
+
readonly errorCode?: ProcessErrorCode;
|
|
192
|
+
readonly cursor: ProcessCursor;
|
|
193
|
+
}
|
|
194
|
+
interface ProcessEffectRunnerStatus {
|
|
195
|
+
readonly state: "requested" | "commanded" | "rejected";
|
|
196
|
+
readonly effectId?: string;
|
|
197
|
+
readonly effectType?: string;
|
|
198
|
+
readonly commandId?: string;
|
|
199
|
+
readonly commandType?: ProcessEffectCommandType;
|
|
200
|
+
readonly requested: number;
|
|
201
|
+
readonly commanded: number;
|
|
202
|
+
readonly rejected: number;
|
|
203
|
+
}
|
|
204
|
+
interface ProcessEffectRunnerError {
|
|
205
|
+
readonly code: "malformed-outcome";
|
|
206
|
+
readonly message: string;
|
|
207
|
+
readonly outcome?: unknown;
|
|
208
|
+
readonly effectId?: string;
|
|
209
|
+
readonly effectType?: string;
|
|
210
|
+
}
|
|
211
|
+
/** Ordered audit fact for one attempted command reduction. */
|
|
212
|
+
interface ProcessAuditRecord {
|
|
213
|
+
readonly seq: number;
|
|
214
|
+
readonly commandId?: string;
|
|
215
|
+
readonly commandType?: string;
|
|
216
|
+
readonly outcome: "success" | "failure";
|
|
217
|
+
readonly eventIds: readonly string[];
|
|
218
|
+
readonly eventTypes: readonly string[];
|
|
219
|
+
readonly effectIds: readonly string[];
|
|
220
|
+
readonly effectTypes: readonly string[];
|
|
221
|
+
readonly errorCode?: ProcessErrorCode;
|
|
222
|
+
readonly errorMessage?: string;
|
|
223
|
+
readonly cursor: ProcessCursor;
|
|
224
|
+
}
|
|
225
|
+
/** Monotonic graph-visible ProcessBundle cursor counters. */
|
|
226
|
+
interface ProcessCursor {
|
|
227
|
+
readonly eventSeq: number;
|
|
228
|
+
readonly effectSeq: number;
|
|
229
|
+
readonly commandCount: number;
|
|
230
|
+
readonly errorCount: number;
|
|
231
|
+
readonly auditSeq: number;
|
|
232
|
+
}
|
|
233
|
+
/** Reducer result: next process state plus optional event/effect-request drafts. */
|
|
234
|
+
interface ProcessReduction<TState = unknown, TEvent = unknown, TEffect = unknown> {
|
|
235
|
+
readonly state: TState;
|
|
236
|
+
readonly events?: readonly ProcessEventDraft<TEvent>[];
|
|
237
|
+
readonly effects?: readonly ProcessEffectRequestDraft<TEffect>[];
|
|
238
|
+
}
|
|
239
|
+
/** Sync ProcessBundle reducer. Async effects belong in graph-visible adapters, not here. */
|
|
240
|
+
type ProcessReducer<TCommand = unknown, TState = unknown, TEvent = unknown, TEffect = unknown> = (command: ProcessCommand<TCommand>, state: TState) => ProcessReduction<TState, TEvent, TEffect>;
|
|
241
|
+
/** Options for a D136 facts-plus-reducer ProcessBundle. */
|
|
242
|
+
interface ProcessBundleOptions<TCommand = unknown, TState = unknown, TEvent = unknown, TEffect = unknown> {
|
|
243
|
+
readonly name?: string;
|
|
244
|
+
readonly initialState: TState;
|
|
245
|
+
readonly reduce: ProcessReducer<TCommand, TState, TEvent, TEffect>;
|
|
246
|
+
readonly now?: () => number;
|
|
247
|
+
}
|
|
248
|
+
/** D136 facts-plus-reducer process bundle. It is not a workflow engine or hidden runtime owner. */
|
|
249
|
+
interface ProcessBundle<TCommand = unknown, TState = unknown, TEvent = unknown, TEffect = unknown> {
|
|
250
|
+
readonly command: Node<ProcessCommand<TCommand>>;
|
|
251
|
+
readonly events: Node<ProcessEvent<TEvent>>;
|
|
252
|
+
readonly state: Node<TState>;
|
|
253
|
+
readonly audit: Node<ProcessAuditRecord>;
|
|
254
|
+
readonly effectRequests: Node<ProcessEffectRequest<TEffect>>;
|
|
255
|
+
readonly status: Node<ProcessStatus>;
|
|
256
|
+
readonly errors: Node<ProcessError>;
|
|
257
|
+
readonly cursor: Node<ProcessCursor>;
|
|
258
|
+
dispatch(command: ProcessCommand<TCommand>): ProcessCommand<TCommand>;
|
|
259
|
+
/** Release only graph-owned retain roots; process facts/topology/cache/state remain ordinary graph data. */
|
|
260
|
+
release(): void;
|
|
261
|
+
}
|
|
262
|
+
interface ProcessEffectRunnerOptions<TResult = unknown> {
|
|
263
|
+
readonly name?: string;
|
|
264
|
+
readonly outcomes: readonly Node<ProcessEffectOutcome<TResult>>[];
|
|
265
|
+
}
|
|
266
|
+
interface ProcessEffectRunnerBundle<TEffect = unknown, TResult = unknown> {
|
|
267
|
+
readonly requests: Node<ProcessEffectRequest<TEffect>>;
|
|
268
|
+
readonly outcomes: Node<ProcessEffectOutcome<TResult>>;
|
|
269
|
+
readonly commands: Node<ProcessCommand<ProcessEffectCommandPayload<TResult>>>;
|
|
270
|
+
readonly status: Node<ProcessEffectRunnerStatus>;
|
|
271
|
+
readonly errors: Node<ProcessEffectRunnerError>;
|
|
272
|
+
release(): void;
|
|
273
|
+
}
|
|
274
|
+
declare function retryStatusBundle(graph: Graph, events: Node<ResilienceEvent>, opts?: {
|
|
275
|
+
name?: string;
|
|
276
|
+
policy?: RetryPolicy;
|
|
277
|
+
}): RetryStatusBundle;
|
|
278
|
+
declare function breakerBundle(graph: Graph, events: Node<ResilienceEvent>, opts: BreakerOptions): BreakerBundle;
|
|
279
|
+
declare function rateLimitBundle<T>(graph: Graph, source: Node<T>, opts: RateLimitOptions): RateLimitBundle<T>;
|
|
280
|
+
declare function timeoutBundle<T>(graph: Graph, source: Node<T>, ms: number, opts?: {
|
|
281
|
+
name?: string;
|
|
282
|
+
}): TimeoutBundle<T>;
|
|
283
|
+
/**
|
|
284
|
+
* Build a D136 ProcessBundle from graph-visible command facts and a reducer.
|
|
285
|
+
*
|
|
286
|
+
* The bundle retains its runtime/projection nodes until `release()` is called.
|
|
287
|
+
* Reducer and validation failures are emitted as DATA error/status/audit facts;
|
|
288
|
+
* they do not mint protocol ERROR messages or own restore/hydration behavior.
|
|
289
|
+
*/
|
|
290
|
+
declare function processBundle<TCommand = unknown, TState = unknown, TEvent = unknown, TEffect = unknown>(graph: Graph, opts: ProcessBundleOptions<TCommand, TState, TEvent, TEffect>): ProcessBundle<TCommand, TState, TEvent, TEffect>;
|
|
291
|
+
/**
|
|
292
|
+
* Build a D156 graph-visible effect runner adapter over a ProcessBundle.
|
|
293
|
+
*
|
|
294
|
+
* The runner consumes visible effect-request and outcome facts, then publishes
|
|
295
|
+
* ordinary ProcessCommand DATA facts back through process.command via a declared
|
|
296
|
+
* graph edge. Async handlers, timers, and process state ownership stay outside
|
|
297
|
+
* this helper.
|
|
298
|
+
*/
|
|
299
|
+
declare function processEffectRunner<TEffect = unknown, TResult = unknown>(graph: Graph, process: ProcessBundle<unknown, unknown, unknown, TEffect>, opts: ProcessEffectRunnerOptions<TResult>): ProcessEffectRunnerBundle<TEffect, TResult>;
|
|
300
|
+
declare function constantBackoff(delayMs: number): BackoffPolicy;
|
|
301
|
+
|
|
302
|
+
export { BackoffPolicy, type BreakerBundle, type BreakerOptions, type BreakerStatus, type ProcessAuditRecord, type ProcessBundle, type ProcessBundleOptions, type ProcessCommand, type ProcessCursor, type ProcessEffectCommandPayload, type ProcessEffectCommandType, type ProcessEffectOutcome, type ProcessEffectRequest, type ProcessEffectRequestDraft, type ProcessEffectRunnerBundle, type ProcessEffectRunnerError, type ProcessEffectRunnerOptions, type ProcessEffectRunnerStatus, type ProcessError, type ProcessErrorCode, type ProcessEvent, type ProcessEventDraft, type ProcessReducer, type ProcessReduction, type ProcessStatus, type RateLimitBundle, type RateLimitOptions, type RateLimitStatus, type ResilienceEvent, RetryPolicy, RetryStatus, type RetryStatusBundle, type TimeoutBundle, breakerBundle, constantBackoff, processBundle, processEffectRunner, rateLimitBundle, retryStatusBundle, timeoutBundle };
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { d as Graph } from '../graph-DfdF9zy4.js';
|
|
2
|
+
import { b as RetryStatus, B as BackoffPolicy, R as RetryPolicy } from '../resilience-Dig3Q7n0.js';
|
|
3
|
+
export { c as backoffDelayMs, n as nextRetryDelayMs, d as noBackoff, r as retryPolicy, s as shouldRetry } from '../resilience-Dig3Q7n0.js';
|
|
4
|
+
import { N as Node } from '../types-h12mNYbq.js';
|
|
5
|
+
import '../core/index.js';
|
|
6
|
+
import '../messages-BZqrGGm1.js';
|
|
7
|
+
import '../codec-BB7p8fJc.js';
|
|
8
|
+
import '../describe-BZb7AS2y.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Reusable application-infrastructure orchestration namespace.
|
|
12
|
+
*
|
|
13
|
+
* Retained root orchestration helpers land here only after B63 re-derives them
|
|
14
|
+
* onto clean-slate graph surfaces.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
type ResilienceEvent = {
|
|
18
|
+
readonly kind: "attempt";
|
|
19
|
+
readonly attempt: number;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: "retry";
|
|
22
|
+
readonly attempt: number;
|
|
23
|
+
readonly delayMs: number;
|
|
24
|
+
readonly error: unknown;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: "success";
|
|
27
|
+
readonly attempt?: number;
|
|
28
|
+
} | {
|
|
29
|
+
readonly kind: "failure";
|
|
30
|
+
readonly attempt?: number;
|
|
31
|
+
readonly error: unknown;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: "exhausted";
|
|
34
|
+
readonly attempt: number;
|
|
35
|
+
readonly error: unknown;
|
|
36
|
+
};
|
|
37
|
+
interface RetryStatusBundle {
|
|
38
|
+
readonly status: Node<RetryStatus>;
|
|
39
|
+
readonly errors: Node<unknown>;
|
|
40
|
+
}
|
|
41
|
+
interface BreakerOptions {
|
|
42
|
+
readonly failureThreshold: number;
|
|
43
|
+
readonly resetAfterMs?: number;
|
|
44
|
+
readonly now?: () => number;
|
|
45
|
+
readonly name?: string;
|
|
46
|
+
}
|
|
47
|
+
interface BreakerStatus {
|
|
48
|
+
readonly state: "closed" | "open" | "half-open";
|
|
49
|
+
readonly failures: number;
|
|
50
|
+
readonly openedAtMs?: number;
|
|
51
|
+
}
|
|
52
|
+
interface BreakerBundle {
|
|
53
|
+
readonly status: Node<BreakerStatus>;
|
|
54
|
+
readonly allowed: Node<boolean>;
|
|
55
|
+
}
|
|
56
|
+
interface RateLimitOptions {
|
|
57
|
+
readonly max: number;
|
|
58
|
+
readonly windowMs: number;
|
|
59
|
+
readonly now?: () => number;
|
|
60
|
+
readonly name?: string;
|
|
61
|
+
}
|
|
62
|
+
interface RateLimitStatus {
|
|
63
|
+
readonly allowed: number;
|
|
64
|
+
readonly dropped: number;
|
|
65
|
+
readonly remaining: number;
|
|
66
|
+
readonly resetAtMs: number;
|
|
67
|
+
}
|
|
68
|
+
interface RateLimitBundle<T> {
|
|
69
|
+
readonly allowed: Node<T>;
|
|
70
|
+
readonly dropped: Node<T>;
|
|
71
|
+
readonly status: Node<RateLimitStatus>;
|
|
72
|
+
}
|
|
73
|
+
interface TimeoutBundle<T> {
|
|
74
|
+
readonly node: Node<T>;
|
|
75
|
+
readonly status: Node<"running" | "completed" | "errored">;
|
|
76
|
+
readonly errors: Node<unknown>;
|
|
77
|
+
}
|
|
78
|
+
/** D136 graph-visible process command fact. */
|
|
79
|
+
interface ProcessCommand<T = unknown> {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly type: string;
|
|
82
|
+
readonly payload: T;
|
|
83
|
+
readonly processId?: string;
|
|
84
|
+
readonly correlationId?: string;
|
|
85
|
+
readonly causationId?: string;
|
|
86
|
+
readonly metadata?: Record<string, unknown>;
|
|
87
|
+
}
|
|
88
|
+
/** Event draft returned by a ProcessBundle reducer before runtime ordering. */
|
|
89
|
+
interface ProcessEventDraft<T = unknown> {
|
|
90
|
+
readonly id?: string;
|
|
91
|
+
readonly type: string;
|
|
92
|
+
readonly payload: T;
|
|
93
|
+
readonly processId?: string;
|
|
94
|
+
readonly correlationId?: string;
|
|
95
|
+
readonly causationId?: string;
|
|
96
|
+
readonly metadata?: Record<string, unknown>;
|
|
97
|
+
}
|
|
98
|
+
/** Ordered process event fact. These are DATA facts, not protocol messages. */
|
|
99
|
+
interface ProcessEvent<T = unknown> {
|
|
100
|
+
readonly id: string;
|
|
101
|
+
readonly type: string;
|
|
102
|
+
readonly seq: number;
|
|
103
|
+
readonly cursor: number;
|
|
104
|
+
readonly commandId: string;
|
|
105
|
+
readonly commandType: string;
|
|
106
|
+
readonly payload: T;
|
|
107
|
+
readonly timestampMs: number;
|
|
108
|
+
readonly processId?: string;
|
|
109
|
+
readonly correlationId?: string;
|
|
110
|
+
readonly causationId?: string;
|
|
111
|
+
readonly metadata?: Record<string, unknown>;
|
|
112
|
+
}
|
|
113
|
+
/** Effect-request draft emitted by a ProcessBundle reducer for visible effect runners. */
|
|
114
|
+
interface ProcessEffectRequestDraft<T = unknown> {
|
|
115
|
+
readonly id?: string;
|
|
116
|
+
readonly type: string;
|
|
117
|
+
readonly payload: T;
|
|
118
|
+
readonly processId?: string;
|
|
119
|
+
readonly correlationId?: string;
|
|
120
|
+
readonly causationId?: string;
|
|
121
|
+
readonly metadata?: Record<string, unknown>;
|
|
122
|
+
}
|
|
123
|
+
/** Ordered effect-request fact. Effect runners consume this node in later slices. */
|
|
124
|
+
interface ProcessEffectRequest<T = unknown> {
|
|
125
|
+
readonly id: string;
|
|
126
|
+
readonly type: string;
|
|
127
|
+
readonly seq: number;
|
|
128
|
+
readonly cursor: number;
|
|
129
|
+
readonly commandId: string;
|
|
130
|
+
readonly commandType: string;
|
|
131
|
+
readonly payload: T;
|
|
132
|
+
readonly timestampMs: number;
|
|
133
|
+
readonly processId?: string;
|
|
134
|
+
readonly correlationId?: string;
|
|
135
|
+
readonly causationId?: string;
|
|
136
|
+
readonly metadata?: Record<string, unknown>;
|
|
137
|
+
}
|
|
138
|
+
type ProcessEffectCommandType = "effect.result" | "effect.failure" | "effect.cancel" | "effect.timeout";
|
|
139
|
+
interface ProcessEffectOutcomeBase {
|
|
140
|
+
readonly effectId: string;
|
|
141
|
+
readonly effectType: string;
|
|
142
|
+
readonly processId?: string;
|
|
143
|
+
readonly correlationId?: string;
|
|
144
|
+
readonly causationId?: string;
|
|
145
|
+
readonly commandId?: string;
|
|
146
|
+
readonly metadata?: Record<string, unknown>;
|
|
147
|
+
}
|
|
148
|
+
type ProcessEffectOutcome<TResult = unknown> = (ProcessEffectOutcomeBase & {
|
|
149
|
+
readonly kind: "result";
|
|
150
|
+
readonly value: TResult;
|
|
151
|
+
}) | (ProcessEffectOutcomeBase & {
|
|
152
|
+
readonly kind: "failure";
|
|
153
|
+
readonly error: unknown;
|
|
154
|
+
}) | (ProcessEffectOutcomeBase & {
|
|
155
|
+
readonly kind: "cancel";
|
|
156
|
+
readonly reason?: string;
|
|
157
|
+
}) | (ProcessEffectOutcomeBase & {
|
|
158
|
+
readonly kind: "timeout";
|
|
159
|
+
readonly error: unknown;
|
|
160
|
+
});
|
|
161
|
+
type ProcessEffectCommandPayload<TResult = unknown> = (Omit<ProcessEffectOutcomeBase, "commandId"> & {
|
|
162
|
+
readonly kind: "result";
|
|
163
|
+
readonly value: TResult;
|
|
164
|
+
}) | (Omit<ProcessEffectOutcomeBase, "commandId"> & {
|
|
165
|
+
readonly kind: "failure";
|
|
166
|
+
readonly error: unknown;
|
|
167
|
+
}) | (Omit<ProcessEffectOutcomeBase, "commandId"> & {
|
|
168
|
+
readonly kind: "cancel";
|
|
169
|
+
readonly reason?: string;
|
|
170
|
+
}) | (Omit<ProcessEffectOutcomeBase, "commandId"> & {
|
|
171
|
+
readonly kind: "timeout";
|
|
172
|
+
readonly error: unknown;
|
|
173
|
+
});
|
|
174
|
+
type ProcessErrorCode = "malformed-command" | "reducer-threw" | "clock-threw" | "malformed-state" | "malformed-event" | "malformed-effect";
|
|
175
|
+
/** Graph-visible ProcessBundle error fact. These are DATA facts, not protocol ERROR. */
|
|
176
|
+
interface ProcessError {
|
|
177
|
+
readonly code: ProcessErrorCode;
|
|
178
|
+
readonly message: string;
|
|
179
|
+
readonly command?: unknown;
|
|
180
|
+
readonly commandId?: string;
|
|
181
|
+
readonly commandType?: string;
|
|
182
|
+
readonly cursor: ProcessCursor;
|
|
183
|
+
}
|
|
184
|
+
/** Accepted/rejected command outcome projected from the ProcessBundle runtime. */
|
|
185
|
+
interface ProcessStatus {
|
|
186
|
+
readonly state: "accepted" | "rejected";
|
|
187
|
+
readonly commandId?: string;
|
|
188
|
+
readonly commandType?: string;
|
|
189
|
+
readonly eventCount: number;
|
|
190
|
+
readonly effectCount: number;
|
|
191
|
+
readonly errorCode?: ProcessErrorCode;
|
|
192
|
+
readonly cursor: ProcessCursor;
|
|
193
|
+
}
|
|
194
|
+
interface ProcessEffectRunnerStatus {
|
|
195
|
+
readonly state: "requested" | "commanded" | "rejected";
|
|
196
|
+
readonly effectId?: string;
|
|
197
|
+
readonly effectType?: string;
|
|
198
|
+
readonly commandId?: string;
|
|
199
|
+
readonly commandType?: ProcessEffectCommandType;
|
|
200
|
+
readonly requested: number;
|
|
201
|
+
readonly commanded: number;
|
|
202
|
+
readonly rejected: number;
|
|
203
|
+
}
|
|
204
|
+
interface ProcessEffectRunnerError {
|
|
205
|
+
readonly code: "malformed-outcome";
|
|
206
|
+
readonly message: string;
|
|
207
|
+
readonly outcome?: unknown;
|
|
208
|
+
readonly effectId?: string;
|
|
209
|
+
readonly effectType?: string;
|
|
210
|
+
}
|
|
211
|
+
/** Ordered audit fact for one attempted command reduction. */
|
|
212
|
+
interface ProcessAuditRecord {
|
|
213
|
+
readonly seq: number;
|
|
214
|
+
readonly commandId?: string;
|
|
215
|
+
readonly commandType?: string;
|
|
216
|
+
readonly outcome: "success" | "failure";
|
|
217
|
+
readonly eventIds: readonly string[];
|
|
218
|
+
readonly eventTypes: readonly string[];
|
|
219
|
+
readonly effectIds: readonly string[];
|
|
220
|
+
readonly effectTypes: readonly string[];
|
|
221
|
+
readonly errorCode?: ProcessErrorCode;
|
|
222
|
+
readonly errorMessage?: string;
|
|
223
|
+
readonly cursor: ProcessCursor;
|
|
224
|
+
}
|
|
225
|
+
/** Monotonic graph-visible ProcessBundle cursor counters. */
|
|
226
|
+
interface ProcessCursor {
|
|
227
|
+
readonly eventSeq: number;
|
|
228
|
+
readonly effectSeq: number;
|
|
229
|
+
readonly commandCount: number;
|
|
230
|
+
readonly errorCount: number;
|
|
231
|
+
readonly auditSeq: number;
|
|
232
|
+
}
|
|
233
|
+
/** Reducer result: next process state plus optional event/effect-request drafts. */
|
|
234
|
+
interface ProcessReduction<TState = unknown, TEvent = unknown, TEffect = unknown> {
|
|
235
|
+
readonly state: TState;
|
|
236
|
+
readonly events?: readonly ProcessEventDraft<TEvent>[];
|
|
237
|
+
readonly effects?: readonly ProcessEffectRequestDraft<TEffect>[];
|
|
238
|
+
}
|
|
239
|
+
/** Sync ProcessBundle reducer. Async effects belong in graph-visible adapters, not here. */
|
|
240
|
+
type ProcessReducer<TCommand = unknown, TState = unknown, TEvent = unknown, TEffect = unknown> = (command: ProcessCommand<TCommand>, state: TState) => ProcessReduction<TState, TEvent, TEffect>;
|
|
241
|
+
/** Options for a D136 facts-plus-reducer ProcessBundle. */
|
|
242
|
+
interface ProcessBundleOptions<TCommand = unknown, TState = unknown, TEvent = unknown, TEffect = unknown> {
|
|
243
|
+
readonly name?: string;
|
|
244
|
+
readonly initialState: TState;
|
|
245
|
+
readonly reduce: ProcessReducer<TCommand, TState, TEvent, TEffect>;
|
|
246
|
+
readonly now?: () => number;
|
|
247
|
+
}
|
|
248
|
+
/** D136 facts-plus-reducer process bundle. It is not a workflow engine or hidden runtime owner. */
|
|
249
|
+
interface ProcessBundle<TCommand = unknown, TState = unknown, TEvent = unknown, TEffect = unknown> {
|
|
250
|
+
readonly command: Node<ProcessCommand<TCommand>>;
|
|
251
|
+
readonly events: Node<ProcessEvent<TEvent>>;
|
|
252
|
+
readonly state: Node<TState>;
|
|
253
|
+
readonly audit: Node<ProcessAuditRecord>;
|
|
254
|
+
readonly effectRequests: Node<ProcessEffectRequest<TEffect>>;
|
|
255
|
+
readonly status: Node<ProcessStatus>;
|
|
256
|
+
readonly errors: Node<ProcessError>;
|
|
257
|
+
readonly cursor: Node<ProcessCursor>;
|
|
258
|
+
dispatch(command: ProcessCommand<TCommand>): ProcessCommand<TCommand>;
|
|
259
|
+
/** Release only graph-owned retain roots; process facts/topology/cache/state remain ordinary graph data. */
|
|
260
|
+
release(): void;
|
|
261
|
+
}
|
|
262
|
+
interface ProcessEffectRunnerOptions<TResult = unknown> {
|
|
263
|
+
readonly name?: string;
|
|
264
|
+
readonly outcomes: readonly Node<ProcessEffectOutcome<TResult>>[];
|
|
265
|
+
}
|
|
266
|
+
interface ProcessEffectRunnerBundle<TEffect = unknown, TResult = unknown> {
|
|
267
|
+
readonly requests: Node<ProcessEffectRequest<TEffect>>;
|
|
268
|
+
readonly outcomes: Node<ProcessEffectOutcome<TResult>>;
|
|
269
|
+
readonly commands: Node<ProcessCommand<ProcessEffectCommandPayload<TResult>>>;
|
|
270
|
+
readonly status: Node<ProcessEffectRunnerStatus>;
|
|
271
|
+
readonly errors: Node<ProcessEffectRunnerError>;
|
|
272
|
+
release(): void;
|
|
273
|
+
}
|
|
274
|
+
declare function retryStatusBundle(graph: Graph, events: Node<ResilienceEvent>, opts?: {
|
|
275
|
+
name?: string;
|
|
276
|
+
policy?: RetryPolicy;
|
|
277
|
+
}): RetryStatusBundle;
|
|
278
|
+
declare function breakerBundle(graph: Graph, events: Node<ResilienceEvent>, opts: BreakerOptions): BreakerBundle;
|
|
279
|
+
declare function rateLimitBundle<T>(graph: Graph, source: Node<T>, opts: RateLimitOptions): RateLimitBundle<T>;
|
|
280
|
+
declare function timeoutBundle<T>(graph: Graph, source: Node<T>, ms: number, opts?: {
|
|
281
|
+
name?: string;
|
|
282
|
+
}): TimeoutBundle<T>;
|
|
283
|
+
/**
|
|
284
|
+
* Build a D136 ProcessBundle from graph-visible command facts and a reducer.
|
|
285
|
+
*
|
|
286
|
+
* The bundle retains its runtime/projection nodes until `release()` is called.
|
|
287
|
+
* Reducer and validation failures are emitted as DATA error/status/audit facts;
|
|
288
|
+
* they do not mint protocol ERROR messages or own restore/hydration behavior.
|
|
289
|
+
*/
|
|
290
|
+
declare function processBundle<TCommand = unknown, TState = unknown, TEvent = unknown, TEffect = unknown>(graph: Graph, opts: ProcessBundleOptions<TCommand, TState, TEvent, TEffect>): ProcessBundle<TCommand, TState, TEvent, TEffect>;
|
|
291
|
+
/**
|
|
292
|
+
* Build a D156 graph-visible effect runner adapter over a ProcessBundle.
|
|
293
|
+
*
|
|
294
|
+
* The runner consumes visible effect-request and outcome facts, then publishes
|
|
295
|
+
* ordinary ProcessCommand DATA facts back through process.command via a declared
|
|
296
|
+
* graph edge. Async handlers, timers, and process state ownership stay outside
|
|
297
|
+
* this helper.
|
|
298
|
+
*/
|
|
299
|
+
declare function processEffectRunner<TEffect = unknown, TResult = unknown>(graph: Graph, process: ProcessBundle<unknown, unknown, unknown, TEffect>, opts: ProcessEffectRunnerOptions<TResult>): ProcessEffectRunnerBundle<TEffect, TResult>;
|
|
300
|
+
declare function constantBackoff(delayMs: number): BackoffPolicy;
|
|
301
|
+
|
|
302
|
+
export { BackoffPolicy, type BreakerBundle, type BreakerOptions, type BreakerStatus, type ProcessAuditRecord, type ProcessBundle, type ProcessBundleOptions, type ProcessCommand, type ProcessCursor, type ProcessEffectCommandPayload, type ProcessEffectCommandType, type ProcessEffectOutcome, type ProcessEffectRequest, type ProcessEffectRequestDraft, type ProcessEffectRunnerBundle, type ProcessEffectRunnerError, type ProcessEffectRunnerOptions, type ProcessEffectRunnerStatus, type ProcessError, type ProcessErrorCode, type ProcessEvent, type ProcessEventDraft, type ProcessReducer, type ProcessReduction, type ProcessStatus, type RateLimitBundle, type RateLimitOptions, type RateLimitStatus, type ResilienceEvent, RetryPolicy, RetryStatus, type RetryStatusBundle, type TimeoutBundle, breakerBundle, constantBackoff, processBundle, processEffectRunner, rateLimitBundle, retryStatusBundle, timeoutBundle };
|