@blue-labs/document-processor 2.0.0-rc.5 → 2.0.0-rc.7
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/dist/constants/processor-contract-constants.d.ts +2 -2
- package/dist/constants/processor-contract-constants.d.ts.map +1 -1
- package/dist/engine/channel-runner.d.ts +3 -0
- package/dist/engine/channel-runner.d.ts.map +1 -1
- package/dist/engine/contract-loader.d.ts.map +1 -1
- package/dist/engine/processor-engine.d.ts.map +1 -1
- package/dist/index.js +751 -678
- package/dist/model/channels/document-update-channel.d.ts +4 -0
- package/dist/model/channels/document-update-channel.d.ts.map +1 -1
- package/dist/model/channels/embedded-node-channel.d.ts +4 -0
- package/dist/model/channels/embedded-node-channel.d.ts.map +1 -1
- package/dist/model/channels/lifecycle-channel.d.ts +4 -0
- package/dist/model/channels/lifecycle-channel.d.ts.map +1 -1
- package/dist/model/channels/myos-timeline-channel.d.ts +4 -0
- package/dist/model/channels/myos-timeline-channel.d.ts.map +1 -1
- package/dist/model/channels/timeline-channel.d.ts +4 -0
- package/dist/model/channels/timeline-channel.d.ts.map +1 -1
- package/dist/model/channels/triggered-event-channel.d.ts +4 -0
- package/dist/model/channels/triggered-event-channel.d.ts.map +1 -1
- package/dist/model/handlers/sequential-workflow-operation.d.ts +2 -2
- package/dist/model/handlers/sequential-workflow.d.ts +2 -2
- package/dist/model/markers/document-anchors.d.ts +26 -0
- package/dist/model/markers/document-anchors.d.ts.map +1 -0
- package/dist/model/markers/document-links.d.ts +26 -0
- package/dist/model/markers/document-links.d.ts.map +1 -0
- package/dist/model/markers/index.d.ts +5 -0
- package/dist/model/markers/index.d.ts.map +1 -1
- package/dist/model/markers/myos-participants-orchestration.d.ts +25 -0
- package/dist/model/markers/myos-participants-orchestration.d.ts.map +1 -0
- package/dist/model/markers/myos-session-interaction.d.ts +25 -0
- package/dist/model/markers/myos-session-interaction.d.ts.map +1 -0
- package/dist/model/markers/myos-worker-agency.d.ts +25 -0
- package/dist/model/markers/myos-worker-agency.d.ts.map +1 -0
- package/dist/model/shared/channel-contract-base.d.ts +3 -0
- package/dist/model/shared/channel-contract-base.d.ts.map +1 -1
- package/dist/model/shared/handler-contract-base.d.ts +2 -2
- package/dist/model/types.d.ts +2 -2
- package/dist/model/types.d.ts.map +1 -1
- package/dist/registry/processors/myos-timeline-channel-processor.d.ts +6 -1
- package/dist/registry/processors/myos-timeline-channel-processor.d.ts.map +1 -1
- package/dist/registry/processors/sequential-workflow-operation-processor.d.ts +2 -2
- package/dist/registry/processors/sequential-workflow-processor.d.ts +2 -2
- package/dist/registry/processors/shared/timeline-recency.d.ts +3 -0
- package/dist/registry/processors/shared/timeline-recency.d.ts.map +1 -0
- package/dist/registry/processors/steps/javascript-code-step-executor.d.ts +1 -1
- package/dist/registry/processors/timeline-channel-processor.d.ts +6 -1
- package/dist/registry/processors/timeline-channel-processor.d.ts.map +1 -1
- package/dist/registry/types.d.ts +5 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/test-support/blue.d.ts +5 -5
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { blueIds as m, ContractSchema as
|
|
2
|
-
import { getQuickJS as
|
|
3
|
-
import { BlueNode as d, blueNodeField as
|
|
4
|
-
import
|
|
5
|
-
import { z as
|
|
6
|
-
import { TimelineChannelSchema as
|
|
7
|
-
import { MyOSTimelineChannelSchema as
|
|
8
|
-
import { isNullable as
|
|
9
|
-
function
|
|
1
|
+
import { blueIds as m, ContractSchema as nt, ChannelSchema as rt, HandlerSchema as it, MarkerSchema as st, DocumentUpdateChannelSchema as ot, EmbeddedNodeChannelSchema as at, LifecycleEventChannelSchema as ct, TriggeredEventChannelSchema as lt, ChannelEventCheckpointSchema as ut, ProcessingInitializedMarkerSchema as dt, ProcessEmbeddedSchema as ht, ProcessingTerminatedMarkerSchema as ft, repository as pt } from "@blue-repository/core";
|
|
2
|
+
import { getQuickJS as mt } from "quickjs-emscripten";
|
|
3
|
+
import { BlueNode as d, blueNodeField as V, withTypeBlueId as gt, BlueIdCalculator as Et, Blue as yt, MergingProcessors as P } from "@blue-labs/language";
|
|
4
|
+
import fe from "picomatch";
|
|
5
|
+
import { z as b, ZodError as Me } from "zod";
|
|
6
|
+
import { TimelineChannelSchema as wt, OperationSchema as z, SequentialWorkflowSchema as St, SequentialWorkflowOperationSchema as bt, TimelineEntrySchema as v, blueIds as R, TriggerEventSchema as pe, JavaScriptCodeSchema as me, UpdateDocumentSchema as ge, OperationRequestSchema as ne, repository as Ct } from "@blue-repository/conversation";
|
|
7
|
+
import { MyOSTimelineChannelSchema as It, DocumentAnchorsSchema as vt, DocumentLinksSchema as kt, MyOSParticipantsOrchestrationSchema as Tt, MyOSSessionInteractionSchema as Rt, MyOSWorkerAgencySchema as Pt, blueIds as D, MyOSTimelineEntrySchema as Ee, repository as Nt } from "@blue-repository/myos";
|
|
8
|
+
import { isNullable as re } from "@blue-labs/shared-utils";
|
|
9
|
+
function Mt(i) {
|
|
10
10
|
return { ok: !0, value: i };
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Ot(i) {
|
|
13
13
|
return { ok: !1, error: i };
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function gi(i) {
|
|
16
16
|
return i.ok;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Ei(i) {
|
|
19
19
|
return !i.ok;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return i.ok ?
|
|
21
|
+
function yi(i, e) {
|
|
22
|
+
return i.ok ? Mt(e(i.value)) : i;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return i.ok ? i :
|
|
24
|
+
function wi(i, e) {
|
|
25
|
+
return i.ok ? i : Ot(e(i.error));
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Si(i, e) {
|
|
28
28
|
return i.ok ? e(i.value) : i;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function bi(i, e) {
|
|
31
31
|
return i.ok ? i.value : e;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Ci(i, e) {
|
|
34
34
|
return i.ok ? i.value : e(i.error);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Ii(i, e) {
|
|
37
37
|
return i.ok ? e.ok(i.value) : e.err(i.error);
|
|
38
38
|
}
|
|
39
39
|
const E = {
|
|
@@ -56,14 +56,14 @@ const E = {
|
|
|
56
56
|
return { kind: "UnsupportedOp", operation: i, reason: e };
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
function
|
|
59
|
+
function At(i) {
|
|
60
60
|
return Object.freeze([...i]);
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const Dt = {
|
|
63
63
|
of(i, e, t) {
|
|
64
64
|
return {
|
|
65
65
|
document: i,
|
|
66
|
-
triggeredEvents:
|
|
66
|
+
triggeredEvents: At(e),
|
|
67
67
|
totalGas: t,
|
|
68
68
|
capabilityFailure: !1,
|
|
69
69
|
failureReason: null
|
|
@@ -78,68 +78,68 @@ const Tt = {
|
|
|
78
78
|
failureReason: e ?? null
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, Oe = Dt, Bt = [
|
|
82
82
|
"embedded",
|
|
83
83
|
"initialized",
|
|
84
84
|
"terminated",
|
|
85
85
|
"checkpoint"
|
|
86
|
-
],
|
|
86
|
+
], _t = [
|
|
87
87
|
m["Document Update Channel"],
|
|
88
88
|
m["Triggered Event Channel"],
|
|
89
89
|
m["Lifecycle Event Channel"],
|
|
90
90
|
m["Embedded Node Channel"]
|
|
91
|
-
], Ae = "embedded",
|
|
92
|
-
|
|
93
|
-
),
|
|
94
|
-
function
|
|
95
|
-
return i != null &&
|
|
96
|
-
}
|
|
97
|
-
function
|
|
98
|
-
return i != null &&
|
|
91
|
+
], Ae = "embedded", De = "initialized", Be = "terminated", T = "checkpoint", oe = new Set(
|
|
92
|
+
Bt
|
|
93
|
+
), _e = new Set(_t);
|
|
94
|
+
function Lt(i) {
|
|
95
|
+
return i != null && oe.has(i);
|
|
96
|
+
}
|
|
97
|
+
function ae(i) {
|
|
98
|
+
return i != null && _e.has(
|
|
99
99
|
i
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const vi = {
|
|
103
103
|
KEY_EMBEDDED: Ae,
|
|
104
|
-
KEY_INITIALIZED:
|
|
105
|
-
KEY_TERMINATED:
|
|
106
|
-
KEY_CHECKPOINT:
|
|
107
|
-
RESERVED_CONTRACT_KEYS:
|
|
108
|
-
PROCESSOR_MANAGED_CHANNEL_BLUE_IDS:
|
|
109
|
-
isReservedContractKey:
|
|
110
|
-
isProcessorManagedChannelBlueId:
|
|
111
|
-
},
|
|
112
|
-
function
|
|
113
|
-
return `${
|
|
114
|
-
}
|
|
115
|
-
function
|
|
116
|
-
return `${
|
|
117
|
-
}
|
|
118
|
-
function
|
|
119
|
-
return `${
|
|
120
|
-
}
|
|
121
|
-
const
|
|
122
|
-
RELATIVE_CONTRACTS:
|
|
123
|
-
RELATIVE_INITIALIZED:
|
|
124
|
-
RELATIVE_TERMINATED:
|
|
125
|
-
RELATIVE_EMBEDDED:
|
|
126
|
-
RELATIVE_CHECKPOINT:
|
|
127
|
-
LAST_EVENTS_SUFFIX:
|
|
128
|
-
LAST_SIGNATURES_SUFFIX:
|
|
129
|
-
relativeContractsEntry:
|
|
130
|
-
relativeCheckpointLastEvent:
|
|
131
|
-
relativeCheckpointLastSignature:
|
|
104
|
+
KEY_INITIALIZED: De,
|
|
105
|
+
KEY_TERMINATED: Be,
|
|
106
|
+
KEY_CHECKPOINT: T,
|
|
107
|
+
RESERVED_CONTRACT_KEYS: oe,
|
|
108
|
+
PROCESSOR_MANAGED_CHANNEL_BLUE_IDS: _e,
|
|
109
|
+
isReservedContractKey: Lt,
|
|
110
|
+
isProcessorManagedChannelBlueId: ae
|
|
111
|
+
}, B = "/contracts", ie = `${B}/${De}`, Le = `${B}/${Be}`, $t = `${B}/${Ae}`, $e = `${B}/${T}`, xe = "/lastEvents", Fe = "/lastSignatures";
|
|
112
|
+
function Q(i) {
|
|
113
|
+
return `${B}/${i}`;
|
|
114
|
+
}
|
|
115
|
+
function ze(i, e) {
|
|
116
|
+
return `${Q(i)}${xe}/${e}`;
|
|
117
|
+
}
|
|
118
|
+
function Ue(i, e) {
|
|
119
|
+
return `${Q(i)}${Fe}/${e}`;
|
|
120
|
+
}
|
|
121
|
+
const ki = {
|
|
122
|
+
RELATIVE_CONTRACTS: B,
|
|
123
|
+
RELATIVE_INITIALIZED: ie,
|
|
124
|
+
RELATIVE_TERMINATED: Le,
|
|
125
|
+
RELATIVE_EMBEDDED: $t,
|
|
126
|
+
RELATIVE_CHECKPOINT: $e,
|
|
127
|
+
LAST_EVENTS_SUFFIX: xe,
|
|
128
|
+
LAST_SIGNATURES_SUFFIX: Fe,
|
|
129
|
+
relativeContractsEntry: Q,
|
|
130
|
+
relativeCheckpointLastEvent: ze,
|
|
131
|
+
relativeCheckpointLastSignature: Ue
|
|
132
132
|
};
|
|
133
|
-
function
|
|
133
|
+
function Ve(i) {
|
|
134
134
|
return i == null || i.length === 0;
|
|
135
135
|
}
|
|
136
136
|
function y(i) {
|
|
137
|
-
return
|
|
137
|
+
return Ve(i) ? "/" : i.startsWith("/") ? i : `/${i}`;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return
|
|
139
|
+
function S(i) {
|
|
140
|
+
return Ve(i) ? "/" : i.startsWith("/") ? i : `/${i}`;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function ye(i) {
|
|
143
143
|
if (i == null)
|
|
144
144
|
return "";
|
|
145
145
|
let e = i.trim();
|
|
@@ -151,16 +151,16 @@ function Ee(i) {
|
|
|
151
151
|
e = e.substring(0, e.length - 1);
|
|
152
152
|
return e;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
const t =
|
|
154
|
+
function Ti(i, e) {
|
|
155
|
+
const t = ye(i), n = ye(e);
|
|
156
156
|
return t.length === 0 && n.length === 0 ? "/" : t.length === 0 ? `/${n}` : n.length === 0 ? `/${t}` : `/${t}/${n}`;
|
|
157
157
|
}
|
|
158
158
|
function w(i, e) {
|
|
159
|
-
const t = y(i), n =
|
|
159
|
+
const t = y(i), n = S(e);
|
|
160
160
|
return t === "/" ? n : n === "/" || n.length === 1 ? t : `${t}${n}`;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const t = y(i), n =
|
|
162
|
+
function xt(i, e) {
|
|
163
|
+
const t = y(i), n = S(e);
|
|
164
164
|
if (t === "/" || !n.startsWith(t))
|
|
165
165
|
return n;
|
|
166
166
|
if (n.length === t.length)
|
|
@@ -168,12 +168,12 @@ function Mt(i, e) {
|
|
|
168
168
|
const r = n.substring(t.length);
|
|
169
169
|
return r.length === 0 ? "/" : r.startsWith("/") ? r : `/${r}`;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Ft(i) {
|
|
172
172
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
173
173
|
}
|
|
174
|
-
var
|
|
175
|
-
function
|
|
176
|
-
return
|
|
174
|
+
var X, we;
|
|
175
|
+
function zt() {
|
|
176
|
+
return we || (we = 1, X = function i(e) {
|
|
177
177
|
if (typeof e == "number" && isNaN(e))
|
|
178
178
|
throw new Error("NaN is not allowed");
|
|
179
179
|
if (typeof e == "number" && !isFinite(e))
|
|
@@ -184,71 +184,71 @@ function Ot() {
|
|
|
184
184
|
const s = n.length === 0 ? "" : ",";
|
|
185
185
|
return `${n}${s}${i(r)}:${i(e[r])}`;
|
|
186
186
|
}, "")}}`;
|
|
187
|
-
}),
|
|
187
|
+
}), X;
|
|
188
188
|
}
|
|
189
|
-
var
|
|
190
|
-
const
|
|
191
|
-
function
|
|
189
|
+
var Ut = zt();
|
|
190
|
+
const Vt = /* @__PURE__ */ Ft(Ut);
|
|
191
|
+
function Ht(i, e) {
|
|
192
192
|
return i.nodeToJson(e, "official");
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
const t =
|
|
196
|
-
return
|
|
194
|
+
function Kt(i, e) {
|
|
195
|
+
const t = Ht(i, e);
|
|
196
|
+
return Vt(t);
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return e ?
|
|
198
|
+
function He(i, e) {
|
|
199
|
+
return e ? Kt(i, e) : null;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
const t =
|
|
201
|
+
function Se(i, e) {
|
|
202
|
+
const t = He(i, e);
|
|
203
203
|
return t == null ? 0 : new TextEncoder().encode(t).length;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function Ke(i) {
|
|
206
206
|
return typeof i == "object" && i !== null && !Array.isArray(i);
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function Wt(i) {
|
|
209
209
|
return i.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Gt(i) {
|
|
212
212
|
if (i.length === 0 || !/^\d+$/.test(i))
|
|
213
213
|
return !1;
|
|
214
214
|
const e = Number(i);
|
|
215
215
|
return Number.isSafeInteger(e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function x(i, e = !0) {
|
|
218
218
|
if (Array.isArray(i))
|
|
219
|
-
return e ? i.map((r) =>
|
|
220
|
-
if (!
|
|
219
|
+
return e ? i.map((r) => x(r, !0)) : i.slice();
|
|
220
|
+
if (!Ke(i))
|
|
221
221
|
return i;
|
|
222
222
|
if (Object.prototype.hasOwnProperty.call(i, "value")) {
|
|
223
223
|
const r = i.value;
|
|
224
|
-
return e ?
|
|
224
|
+
return e ? x(r, !0) : r;
|
|
225
225
|
}
|
|
226
226
|
const t = i.items;
|
|
227
227
|
if (Array.isArray(t))
|
|
228
|
-
return e ? t.map((r) =>
|
|
228
|
+
return e ? t.map((r) => x(r, !0)) : t.slice();
|
|
229
229
|
const n = {};
|
|
230
230
|
for (const [r, s] of Object.entries(i))
|
|
231
|
-
n[r] = e ?
|
|
231
|
+
n[r] = e ? x(s, !0) : s;
|
|
232
232
|
return n;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function qt(i, e) {
|
|
235
235
|
if (e === "")
|
|
236
236
|
return i;
|
|
237
237
|
if (!e.startsWith("/"))
|
|
238
238
|
throw new TypeError('JSON pointer must start with "/"');
|
|
239
|
-
const t = e.split("/").slice(1).map((r) =>
|
|
239
|
+
const t = e.split("/").slice(1).map((r) => Wt(r));
|
|
240
240
|
let n = i;
|
|
241
241
|
for (const r of t) {
|
|
242
242
|
if (n == null)
|
|
243
243
|
return;
|
|
244
244
|
if (Array.isArray(n)) {
|
|
245
|
-
if (!
|
|
245
|
+
if (!Gt(r))
|
|
246
246
|
return;
|
|
247
247
|
const s = Number(r);
|
|
248
248
|
n = n[s];
|
|
249
249
|
continue;
|
|
250
250
|
}
|
|
251
|
-
if (
|
|
251
|
+
if (Ke(n)) {
|
|
252
252
|
n = n[r];
|
|
253
253
|
continue;
|
|
254
254
|
}
|
|
@@ -256,15 +256,15 @@ function zt(i, e) {
|
|
|
256
256
|
}
|
|
257
257
|
return n;
|
|
258
258
|
}
|
|
259
|
-
const
|
|
260
|
-
class
|
|
259
|
+
const Jt = 500, jt = 32 * 1024 * 1024;
|
|
260
|
+
class ce {
|
|
261
261
|
modulePromise;
|
|
262
262
|
moduleInstance;
|
|
263
263
|
async evaluate({
|
|
264
264
|
code: e,
|
|
265
265
|
bindings: t,
|
|
266
|
-
timeout: n =
|
|
267
|
-
memoryLimit: r =
|
|
266
|
+
timeout: n = Jt,
|
|
267
|
+
memoryLimit: r = jt
|
|
268
268
|
}) {
|
|
269
269
|
const o = (await this.ensureModule()).newRuntime();
|
|
270
270
|
o.setMemoryLimit(r);
|
|
@@ -273,24 +273,24 @@ class ae {
|
|
|
273
273
|
const c = o.newContext();
|
|
274
274
|
try {
|
|
275
275
|
this.installConsole(c), this.installDeterministicGlobals(c), this.installCanonNamespace(c), this.installBindings(c, t);
|
|
276
|
-
const l = this.wrapCode(e), u = c.evalCode(l),
|
|
277
|
-
let
|
|
276
|
+
const l = this.wrapCode(e), u = c.evalCode(l), f = c.unwrapResult(u);
|
|
277
|
+
let h = null;
|
|
278
278
|
try {
|
|
279
|
-
return
|
|
279
|
+
return h = await this.resolveHandle(
|
|
280
280
|
c,
|
|
281
281
|
o,
|
|
282
|
-
|
|
282
|
+
f,
|
|
283
283
|
a
|
|
284
|
-
), c.dump(
|
|
284
|
+
), c.dump(h);
|
|
285
285
|
} finally {
|
|
286
|
-
|
|
286
|
+
h ? h.dispose() : f.dispose();
|
|
287
287
|
}
|
|
288
288
|
} finally {
|
|
289
289
|
c.dispose(), o.removeInterruptHandler?.(), o.dispose();
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
async ensureModule() {
|
|
293
|
-
return this.moduleInstance ? this.moduleInstance : (this.modulePromise || (this.modulePromise =
|
|
293
|
+
return this.moduleInstance ? this.moduleInstance : (this.modulePromise || (this.modulePromise = mt().then((e) => (this.moduleInstance = e, e))), this.modulePromise);
|
|
294
294
|
}
|
|
295
295
|
wrapCode(e) {
|
|
296
296
|
return `(async () => {
|
|
@@ -317,7 +317,7 @@ ${e}
|
|
|
317
317
|
e.newObject().consume((t) => {
|
|
318
318
|
e.newFunction("unwrap", (...n) => {
|
|
319
319
|
try {
|
|
320
|
-
const [r, s] = n, o = r !== void 0 ? e.dump(r) : void 0, a = s === void 0 ? !0 : !!e.dump(s), c =
|
|
320
|
+
const [r, s] = n, o = r !== void 0 ? e.dump(r) : void 0, a = s === void 0 ? !0 : !!e.dump(s), c = x(o, a);
|
|
321
321
|
return this.createReturnHandle(e, c);
|
|
322
322
|
} catch (r) {
|
|
323
323
|
const s = r instanceof Error ? r.message : String(r);
|
|
@@ -333,7 +333,7 @@ ${e}
|
|
|
333
333
|
const a = e.dump(s);
|
|
334
334
|
if (typeof a != "string")
|
|
335
335
|
throw new TypeError("canon.at pointer must be a string");
|
|
336
|
-
const c =
|
|
336
|
+
const c = qt(o, a);
|
|
337
337
|
return this.createReturnHandle(e, c);
|
|
338
338
|
} catch (r) {
|
|
339
339
|
const s = r instanceof Error ? r.message : String(r);
|
|
@@ -492,43 +492,43 @@ ${e}
|
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
const be = 120;
|
|
495
|
-
function
|
|
495
|
+
function Qt(i) {
|
|
496
496
|
return i.length <= be ? i : `${i.slice(0, be - 3)}...`;
|
|
497
497
|
}
|
|
498
|
-
class
|
|
498
|
+
class We extends Error {
|
|
499
499
|
constructor(e, t) {
|
|
500
|
-
super(`Failed to evaluate code block: ${
|
|
500
|
+
super(`Failed to evaluate code block: ${Qt(e)}`, { cause: t }), this.code = e, this.cause = t, this.name = "CodeBlockEvaluationError";
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
const
|
|
504
|
-
function
|
|
505
|
-
if (typeof i != "string" || !
|
|
503
|
+
const Ge = /^\$\{([\s\S]*)\}$/, Yt = /\$\{([\s\S]+?)\}/, qe = /\$\{([\s\S]+?)\}/g;
|
|
504
|
+
function G(i) {
|
|
505
|
+
if (typeof i != "string" || !Ge.test(i))
|
|
506
506
|
return !1;
|
|
507
507
|
const e = i.indexOf("${"), t = i.lastIndexOf("${");
|
|
508
508
|
return e === t;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
return typeof i != "string" ? !1 :
|
|
510
|
+
function Zt(i) {
|
|
511
|
+
return typeof i != "string" ? !1 : Ge.test(i) ? !0 : Yt.test(i);
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
if (!
|
|
513
|
+
function Xt(i) {
|
|
514
|
+
if (!G(i))
|
|
515
515
|
throw new Error(`Invalid expression: ${i}`);
|
|
516
516
|
return i.slice(2, -1);
|
|
517
517
|
}
|
|
518
|
-
async function
|
|
518
|
+
async function Je(i, e, t) {
|
|
519
519
|
const n = `return await (${e});`;
|
|
520
520
|
try {
|
|
521
521
|
return await i.evaluate({ code: n, bindings: t });
|
|
522
522
|
} catch (r) {
|
|
523
|
-
throw new
|
|
523
|
+
throw new We(e, r);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
async function
|
|
526
|
+
async function en(i, e, t) {
|
|
527
527
|
let n = "", r = 0;
|
|
528
|
-
for (const s of e.matchAll(
|
|
528
|
+
for (const s of e.matchAll(qe)) {
|
|
529
529
|
const o = s[0], a = s[1], c = s.index ?? 0;
|
|
530
530
|
n += e.slice(r, c);
|
|
531
|
-
const l = await
|
|
531
|
+
const l = await Je(
|
|
532
532
|
i,
|
|
533
533
|
a,
|
|
534
534
|
t
|
|
@@ -537,19 +537,19 @@ async function qt(i, e, t) {
|
|
|
537
537
|
}
|
|
538
538
|
return n += e.slice(r), n;
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function je({
|
|
541
541
|
include: i,
|
|
542
542
|
exclude: e = [],
|
|
543
543
|
options: t
|
|
544
544
|
}) {
|
|
545
545
|
const n = { dot: !0, ...t ?? {} }, r = i.map(
|
|
546
|
-
(o) =>
|
|
546
|
+
(o) => fe(o, n)
|
|
547
547
|
), s = e.map(
|
|
548
|
-
(o) =>
|
|
548
|
+
(o) => fe(o, n)
|
|
549
549
|
);
|
|
550
550
|
return (o) => r.some((a) => a(o)) && !s.some((a) => a(o));
|
|
551
551
|
}
|
|
552
|
-
async function
|
|
552
|
+
async function q(i) {
|
|
553
553
|
const {
|
|
554
554
|
evaluator: e,
|
|
555
555
|
node: t,
|
|
@@ -564,126 +564,130 @@ async function G(i) {
|
|
|
564
564
|
const l = c.getValue();
|
|
565
565
|
if (l !== void 0) {
|
|
566
566
|
if (typeof l == "string" && r(a)) {
|
|
567
|
-
if (
|
|
568
|
-
const
|
|
569
|
-
o.gasMeter().chargeExpression(
|
|
570
|
-
const p = await
|
|
567
|
+
if (G(l)) {
|
|
568
|
+
const h = Xt(l);
|
|
569
|
+
o.gasMeter().chargeExpression(h);
|
|
570
|
+
const p = await Je(
|
|
571
571
|
e,
|
|
572
|
-
|
|
572
|
+
h,
|
|
573
573
|
n
|
|
574
574
|
);
|
|
575
575
|
return o.blue.jsonValueToNode(p ?? null);
|
|
576
|
-
} else if (
|
|
577
|
-
const
|
|
576
|
+
} else if (Zt(l)) {
|
|
577
|
+
const h = new RegExp(qe);
|
|
578
578
|
let p = 0;
|
|
579
|
-
for (
|
|
579
|
+
for (h.lastIndex = 0; h.exec(l); )
|
|
580
580
|
p += 1;
|
|
581
581
|
o.gasMeter().chargeTemplate(p, l);
|
|
582
|
-
const
|
|
582
|
+
const I = await en(
|
|
583
583
|
e,
|
|
584
584
|
l,
|
|
585
585
|
n
|
|
586
586
|
);
|
|
587
|
-
return new d().setValue(
|
|
587
|
+
return new d().setValue(I);
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
return c;
|
|
591
591
|
}
|
|
592
592
|
const u = c.getItems?.();
|
|
593
593
|
if (Array.isArray(u)) {
|
|
594
|
-
const
|
|
594
|
+
const h = await Promise.all(
|
|
595
595
|
u.map(
|
|
596
|
-
(p,
|
|
596
|
+
(p, I) => q({
|
|
597
597
|
...i,
|
|
598
598
|
node: p,
|
|
599
|
-
pointer: `${a}/${
|
|
599
|
+
pointer: `${a}/${I}`
|
|
600
600
|
})
|
|
601
601
|
)
|
|
602
602
|
);
|
|
603
|
-
return c.setItems(
|
|
604
|
-
}
|
|
605
|
-
const
|
|
606
|
-
if (
|
|
607
|
-
const
|
|
608
|
-
for (const [p,
|
|
609
|
-
const
|
|
610
|
-
|
|
603
|
+
return c.setItems(h), c;
|
|
604
|
+
}
|
|
605
|
+
const f = c.getProperties?.();
|
|
606
|
+
if (f) {
|
|
607
|
+
const h = {};
|
|
608
|
+
for (const [p, I] of Object.entries(f)) {
|
|
609
|
+
const Z = a === "/" ? `/${p}` : `${a}/${p}`;
|
|
610
|
+
h[p] = await q({
|
|
611
611
|
...i,
|
|
612
|
-
node:
|
|
613
|
-
pointer:
|
|
612
|
+
node: I,
|
|
613
|
+
pointer: Z
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
|
-
c.setProperties(
|
|
616
|
+
c.setProperties(h);
|
|
617
617
|
}
|
|
618
618
|
return c;
|
|
619
619
|
}
|
|
620
|
-
const
|
|
621
|
-
|
|
620
|
+
const le = nt, _ = rt.merge(
|
|
621
|
+
le
|
|
622
622
|
).extend({
|
|
623
|
-
path:
|
|
624
|
-
definition:
|
|
625
|
-
}),
|
|
626
|
-
op:
|
|
627
|
-
path:
|
|
628
|
-
val:
|
|
629
|
-
}),
|
|
630
|
-
|
|
623
|
+
path: b.string().optional(),
|
|
624
|
+
definition: V().optional()
|
|
625
|
+
}), Qe = it.merge(le), C = st.merge(le), tn = b.object({
|
|
626
|
+
op: b.enum(["ADD", "REPLACE", "REMOVE"]),
|
|
627
|
+
path: b.string(),
|
|
628
|
+
val: V().optional()
|
|
629
|
+
}), Ri = gt("JsonPatch")(
|
|
630
|
+
tn
|
|
631
631
|
).superRefine((i, e) => {
|
|
632
632
|
i.op === "REMOVE" && i.val !== void 0 && e.addIssue({
|
|
633
|
-
code:
|
|
633
|
+
code: b.ZodIssueCode.custom,
|
|
634
634
|
message: "REMOVE operations cannot include a value",
|
|
635
635
|
path: ["val"]
|
|
636
636
|
}), i.op !== "REMOVE" && i.val === void 0 && e.addIssue({
|
|
637
|
-
code:
|
|
637
|
+
code: b.ZodIssueCode.custom,
|
|
638
638
|
message: `${i.op} operations must include a value`,
|
|
639
639
|
path: ["val"]
|
|
640
640
|
});
|
|
641
|
-
}),
|
|
642
|
-
|
|
643
|
-
),
|
|
644
|
-
|
|
645
|
-
),
|
|
646
|
-
|
|
647
|
-
),
|
|
648
|
-
|
|
649
|
-
),
|
|
650
|
-
lastSignatures:
|
|
651
|
-
}),
|
|
652
|
-
|
|
653
|
-
),
|
|
654
|
-
|
|
655
|
-
),
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
641
|
+
}), nn = ot.merge(
|
|
642
|
+
_
|
|
643
|
+
), rn = at.merge(
|
|
644
|
+
_
|
|
645
|
+
), sn = ct.merge(
|
|
646
|
+
_
|
|
647
|
+
), on = lt.merge(_), an = wt.merge(
|
|
648
|
+
_
|
|
649
|
+
), cn = It.merge(_), ln = ut.merge(C).extend({
|
|
650
|
+
lastSignatures: b.record(b.string()).optional()
|
|
651
|
+
}), un = dt.merge(C), dn = ht.merge(
|
|
652
|
+
C
|
|
653
|
+
), hn = ft.merge(C), fn = z.merge(
|
|
654
|
+
C
|
|
655
|
+
), pn = vt.merge(C), mn = kt.merge(
|
|
656
|
+
C
|
|
657
|
+
), gn = Tt.merge(C), En = Rt.merge(C), yn = Pt.merge(
|
|
658
|
+
C
|
|
659
|
+
), Pi = V(), wn = St.merge(Qe).extend({
|
|
660
|
+
steps: b.array(V()).optional()
|
|
661
|
+
}), Sn = bt.merge(
|
|
662
|
+
Qe
|
|
659
663
|
).extend({
|
|
660
|
-
steps:
|
|
664
|
+
steps: b.array(V()).optional()
|
|
661
665
|
});
|
|
662
|
-
function
|
|
666
|
+
function bn(i) {
|
|
663
667
|
if (!Array.isArray(i.blueIds) || i.blueIds.length === 0)
|
|
664
668
|
throw new Error("Contract processors must declare at least one BlueId");
|
|
665
669
|
for (const e of i.blueIds)
|
|
666
670
|
if (typeof e != "string" || e.trim().length === 0)
|
|
667
671
|
throw new Error("Contract processor BlueIds must be non-empty strings");
|
|
668
672
|
}
|
|
669
|
-
function
|
|
670
|
-
|
|
673
|
+
function K(i, e) {
|
|
674
|
+
bn(i);
|
|
671
675
|
for (const t of i.blueIds)
|
|
672
676
|
e.set(t, i);
|
|
673
677
|
}
|
|
674
|
-
class
|
|
678
|
+
class Cn {
|
|
675
679
|
processorsByBlueId = /* @__PURE__ */ new Map();
|
|
676
680
|
handlerProcessors = /* @__PURE__ */ new Map();
|
|
677
681
|
channelProcessors = /* @__PURE__ */ new Map();
|
|
678
682
|
markerProcessors = /* @__PURE__ */ new Map();
|
|
679
683
|
registerHandler(e) {
|
|
680
|
-
|
|
684
|
+
K(e, this.handlerProcessors), this.registerProcessorMap(e);
|
|
681
685
|
}
|
|
682
686
|
registerChannel(e) {
|
|
683
|
-
|
|
687
|
+
K(e, this.channelProcessors), this.registerProcessorMap(e);
|
|
684
688
|
}
|
|
685
689
|
registerMarker(e) {
|
|
686
|
-
|
|
690
|
+
K(e, this.markerProcessors), this.registerProcessorMap(e);
|
|
687
691
|
}
|
|
688
692
|
register(e) {
|
|
689
693
|
switch (e.kind) {
|
|
@@ -717,21 +721,31 @@ class un {
|
|
|
717
721
|
return new Map(this.processorsByBlueId);
|
|
718
722
|
}
|
|
719
723
|
registerProcessorMap(e) {
|
|
720
|
-
|
|
724
|
+
K(e, this.processorsByBlueId);
|
|
721
725
|
}
|
|
722
726
|
}
|
|
723
|
-
function
|
|
724
|
-
return
|
|
727
|
+
function Ce(i, e) {
|
|
728
|
+
return e && i.isTypeOf(e, v, { checkSchemaExtensions: !0 }) ? i.nodeToSchemaOutput(e, v) : null;
|
|
729
|
+
}
|
|
730
|
+
function Ye(i, e, t) {
|
|
731
|
+
const n = Ce(i, e), r = Ce(i, t);
|
|
732
|
+
if (!n || !r)
|
|
733
|
+
return !0;
|
|
734
|
+
const s = n.timestamp, o = r.timestamp;
|
|
735
|
+
return typeof s != "number" || typeof o != "number" ? !0 : s >= o;
|
|
725
736
|
}
|
|
726
|
-
|
|
737
|
+
function Ie(i, e) {
|
|
738
|
+
return i.isTypeOf(e, Ee) ? i.nodeToSchemaOutput(e, Ee) : i.isTypeOf(e, v) ? i.nodeToSchemaOutput(e, v) : null;
|
|
739
|
+
}
|
|
740
|
+
class In {
|
|
727
741
|
kind = "channel";
|
|
728
|
-
blueIds = [
|
|
729
|
-
schema =
|
|
742
|
+
blueIds = [D["MyOS Timeline Channel"]];
|
|
743
|
+
schema = cn;
|
|
730
744
|
matches(e, t) {
|
|
731
745
|
const { event: n, blue: r } = t;
|
|
732
746
|
if (!n)
|
|
733
747
|
return !1;
|
|
734
|
-
const s =
|
|
748
|
+
const s = Ie(r, n);
|
|
735
749
|
if (!s)
|
|
736
750
|
return !1;
|
|
737
751
|
const o = s.timeline?.timelineId;
|
|
@@ -739,13 +753,17 @@ class dn {
|
|
|
739
753
|
}
|
|
740
754
|
channelize(e, t) {
|
|
741
755
|
const { event: n, blue: r } = t;
|
|
742
|
-
return !n || !
|
|
756
|
+
return !n || !Ie(r, n) ? null : n.clone();
|
|
757
|
+
}
|
|
758
|
+
isNewerEvent(e, t, n) {
|
|
759
|
+
const { event: r, blue: s } = t;
|
|
760
|
+
return r ? Ye(s, r, n) : !0;
|
|
743
761
|
}
|
|
744
762
|
}
|
|
745
|
-
class
|
|
763
|
+
class vn {
|
|
746
764
|
kind = "channel";
|
|
747
|
-
blueIds = [
|
|
748
|
-
schema =
|
|
765
|
+
blueIds = [R["Timeline Channel"]];
|
|
766
|
+
schema = an;
|
|
749
767
|
matches(e, t) {
|
|
750
768
|
const { event: n, blue: r } = t;
|
|
751
769
|
if (!n || !r.isTypeOf(n, v))
|
|
@@ -757,9 +775,13 @@ class hn {
|
|
|
757
775
|
const { event: n, blue: r } = t;
|
|
758
776
|
return !n || !r.isTypeOf(n, v) ? null : n.clone();
|
|
759
777
|
}
|
|
778
|
+
isNewerEvent(e, t, n) {
|
|
779
|
+
const { event: r, blue: s } = t;
|
|
780
|
+
return r ? Ye(s, r, n) : !0;
|
|
781
|
+
}
|
|
760
782
|
}
|
|
761
|
-
function
|
|
762
|
-
const { context: e, eventNode: t, stepResults: n } = i, r =
|
|
783
|
+
function ue(i) {
|
|
784
|
+
const { context: e, eventNode: t, stepResults: n } = i, r = Tn(e);
|
|
763
785
|
return {
|
|
764
786
|
event: e.blue.nodeToJson(t, "simple"),
|
|
765
787
|
eventCanonical: e.blue.nodeToJson(t, "official"),
|
|
@@ -767,17 +789,17 @@ function le(i) {
|
|
|
767
789
|
document: r
|
|
768
790
|
};
|
|
769
791
|
}
|
|
770
|
-
const
|
|
771
|
-
function
|
|
792
|
+
const kn = /* @__PURE__ */ new Set(["blueId", "name", "description", "value"]);
|
|
793
|
+
function Tn(i) {
|
|
772
794
|
const e = (s) => {
|
|
773
795
|
if (s === "/")
|
|
774
796
|
return !1;
|
|
775
797
|
const o = s.lastIndexOf("/"), a = s.substring(o + 1);
|
|
776
|
-
return
|
|
798
|
+
return kn.has(a);
|
|
777
799
|
}, t = (s) => {
|
|
778
800
|
const o = s == null ? "/" : typeof s == "string" ? s : (() => {
|
|
779
801
|
throw new TypeError("document() expects a string pointer");
|
|
780
|
-
})(), a = o.startsWith("/") ? o : i.resolvePointer(o), c =
|
|
802
|
+
})(), a = o.startsWith("/") ? o : i.resolvePointer(o), c = S(a), l = i.documentAt(c);
|
|
781
803
|
return i.gasMeter().chargeDocumentSnapshot(c, l), { snapshot: l, normalizedPointer: c };
|
|
782
804
|
}, n = (s, o) => {
|
|
783
805
|
const { snapshot: a, normalizedPointer: c } = t(s);
|
|
@@ -786,58 +808,58 @@ function pn(i) {
|
|
|
786
808
|
}, r = (s) => n(s, "simple");
|
|
787
809
|
return r.canonical = (s) => n(s, "official"), r;
|
|
788
810
|
}
|
|
789
|
-
class
|
|
790
|
-
supportedBlueIds = [
|
|
791
|
-
evaluator = new
|
|
811
|
+
class Rn {
|
|
812
|
+
supportedBlueIds = [R["Trigger Event"]];
|
|
813
|
+
evaluator = new ce();
|
|
792
814
|
async execute(e) {
|
|
793
815
|
const { stepNode: t, context: n } = e;
|
|
794
|
-
if (!n.blue.isTypeOf(t,
|
|
816
|
+
if (!n.blue.isTypeOf(t, pe))
|
|
795
817
|
return n.throwFatal("Trigger Event step payload is invalid");
|
|
796
818
|
n.gasMeter().chargeTriggerEventBase();
|
|
797
|
-
const r = await
|
|
819
|
+
const r = await q({
|
|
798
820
|
evaluator: this.evaluator,
|
|
799
821
|
node: t,
|
|
800
|
-
bindings:
|
|
801
|
-
shouldResolve:
|
|
822
|
+
bindings: ue(e),
|
|
823
|
+
shouldResolve: je({
|
|
802
824
|
include: ["/event", "/event/**"]
|
|
803
825
|
}),
|
|
804
|
-
shouldDescend:
|
|
826
|
+
shouldDescend: Pn(),
|
|
805
827
|
context: n
|
|
806
828
|
}), o = n.blue.nodeToSchemaOutput(
|
|
807
829
|
r,
|
|
808
|
-
|
|
830
|
+
pe
|
|
809
831
|
).event;
|
|
810
|
-
if (
|
|
832
|
+
if (re(o))
|
|
811
833
|
return n.throwFatal(
|
|
812
834
|
"Trigger Event step must declare event payload"
|
|
813
835
|
);
|
|
814
836
|
n.emitEvent(o.clone());
|
|
815
837
|
}
|
|
816
838
|
}
|
|
817
|
-
function
|
|
818
|
-
return (i, e) => i === "/event" || !i.startsWith("/event/") ? !0 : !
|
|
839
|
+
function Pn() {
|
|
840
|
+
return (i, e) => i === "/event" || !i.startsWith("/event/") ? !0 : !Nn(e);
|
|
819
841
|
}
|
|
820
|
-
function
|
|
842
|
+
function Nn(i) {
|
|
821
843
|
const e = i.getProperties?.();
|
|
822
844
|
return e ? !!e.contracts : !1;
|
|
823
845
|
}
|
|
824
|
-
class
|
|
825
|
-
supportedBlueIds = [
|
|
826
|
-
evaluator = new
|
|
846
|
+
class Mn {
|
|
847
|
+
supportedBlueIds = [R["JavaScript Code"]];
|
|
848
|
+
evaluator = new ce();
|
|
827
849
|
async execute(e) {
|
|
828
850
|
const { context: t, stepNode: n } = e, { blue: r } = t;
|
|
829
|
-
if (!r.isTypeOf(n,
|
|
851
|
+
if (!r.isTypeOf(n, me))
|
|
830
852
|
return t.throwFatal("JavaScript Code step payload is invalid");
|
|
831
853
|
const o = r.nodeToSchemaOutput(
|
|
832
854
|
n,
|
|
833
|
-
|
|
855
|
+
me
|
|
834
856
|
).code;
|
|
835
857
|
if (!o)
|
|
836
858
|
return t.throwFatal(
|
|
837
859
|
"JavaScript Code step must include code to execute"
|
|
838
860
|
);
|
|
839
861
|
t.gasMeter().chargeJavaScriptCodeBase(o);
|
|
840
|
-
const a =
|
|
862
|
+
const a = ue(e);
|
|
841
863
|
try {
|
|
842
864
|
const c = await this.evaluator.evaluate({
|
|
843
865
|
code: o,
|
|
@@ -845,7 +867,7 @@ class yn {
|
|
|
845
867
|
});
|
|
846
868
|
return this.handleEvents(c, t), c;
|
|
847
869
|
} catch (c) {
|
|
848
|
-
throw new
|
|
870
|
+
throw new We(o, c);
|
|
849
871
|
}
|
|
850
872
|
}
|
|
851
873
|
handleEvents(e, t) {
|
|
@@ -859,18 +881,18 @@ class yn {
|
|
|
859
881
|
}
|
|
860
882
|
}
|
|
861
883
|
}
|
|
862
|
-
class
|
|
863
|
-
supportedBlueIds = [
|
|
864
|
-
evaluator = new
|
|
884
|
+
class On {
|
|
885
|
+
supportedBlueIds = [R["Update Document"]];
|
|
886
|
+
evaluator = new ce();
|
|
865
887
|
async execute(e) {
|
|
866
888
|
const { context: t, stepNode: n } = e, { blue: r } = t;
|
|
867
|
-
if (!r.isTypeOf(n,
|
|
889
|
+
if (!r.isTypeOf(n, ge))
|
|
868
890
|
return t.throwFatal("Update Document step payload is invalid");
|
|
869
|
-
const s = await
|
|
891
|
+
const s = await q({
|
|
870
892
|
evaluator: this.evaluator,
|
|
871
893
|
node: n,
|
|
872
|
-
bindings:
|
|
873
|
-
shouldResolve:
|
|
894
|
+
bindings: ue(e),
|
|
895
|
+
shouldResolve: je({
|
|
874
896
|
include: ["/changeset", "/changeset/**"]
|
|
875
897
|
}),
|
|
876
898
|
context: t
|
|
@@ -884,7 +906,7 @@ class wn {
|
|
|
884
906
|
extractChanges(e, t) {
|
|
885
907
|
return t.blue.nodeToSchemaOutput(
|
|
886
908
|
e,
|
|
887
|
-
|
|
909
|
+
ge
|
|
888
910
|
).changeset ?? [];
|
|
889
911
|
}
|
|
890
912
|
createPatch(e, t) {
|
|
@@ -904,14 +926,14 @@ class wn {
|
|
|
904
926
|
return n.length === 0 ? t.throwFatal("Update Document path cannot be empty") : n;
|
|
905
927
|
}
|
|
906
928
|
}
|
|
907
|
-
const
|
|
908
|
-
new
|
|
909
|
-
new
|
|
910
|
-
new
|
|
929
|
+
const de = [
|
|
930
|
+
new Rn(),
|
|
931
|
+
new Mn(),
|
|
932
|
+
new On()
|
|
911
933
|
];
|
|
912
|
-
class
|
|
934
|
+
class Ze {
|
|
913
935
|
executorIndex;
|
|
914
|
-
constructor(e =
|
|
936
|
+
constructor(e = de) {
|
|
915
937
|
const t = /* @__PURE__ */ new Map();
|
|
916
938
|
for (const n of e)
|
|
917
939
|
for (const r of n.supportedBlueIds)
|
|
@@ -925,28 +947,28 @@ class je {
|
|
|
925
947
|
const o = {};
|
|
926
948
|
for (const [a, c] of s.entries()) {
|
|
927
949
|
const l = c.getType?.()?.getBlueId();
|
|
928
|
-
if (
|
|
950
|
+
if (re(l))
|
|
929
951
|
return r.throwFatal(
|
|
930
952
|
"Sequential workflow step is missing type metadata"
|
|
931
953
|
);
|
|
932
954
|
const u = this.executorIndex.get(l);
|
|
933
|
-
if (
|
|
955
|
+
if (re(u)) {
|
|
934
956
|
const p = c.getType?.()?.getName?.() ?? l;
|
|
935
957
|
return r.throwFatal(
|
|
936
958
|
`Unsupported workflow step type "${p}"`
|
|
937
959
|
);
|
|
938
960
|
}
|
|
939
|
-
const
|
|
961
|
+
const f = {
|
|
940
962
|
workflow: t,
|
|
941
963
|
stepNode: c,
|
|
942
964
|
eventNode: n,
|
|
943
965
|
context: r,
|
|
944
966
|
stepResults: o,
|
|
945
967
|
stepIndex: a
|
|
946
|
-
},
|
|
947
|
-
if (
|
|
968
|
+
}, h = await u.execute(f);
|
|
969
|
+
if (h !== void 0) {
|
|
948
970
|
const p = this.stepResultKey(c, a);
|
|
949
|
-
o[p] =
|
|
971
|
+
o[p] = h;
|
|
950
972
|
}
|
|
951
973
|
}
|
|
952
974
|
return o;
|
|
@@ -956,13 +978,13 @@ class je {
|
|
|
956
978
|
return n && typeof n == "string" && n.length > 0 ? n : `Step${t + 1}`;
|
|
957
979
|
}
|
|
958
980
|
}
|
|
959
|
-
class
|
|
981
|
+
class An {
|
|
960
982
|
kind = "handler";
|
|
961
|
-
blueIds = [
|
|
962
|
-
schema =
|
|
983
|
+
blueIds = [R["Sequential Workflow"]];
|
|
984
|
+
schema = wn;
|
|
963
985
|
runner;
|
|
964
|
-
constructor(e =
|
|
965
|
-
this.runner = new
|
|
986
|
+
constructor(e = de) {
|
|
987
|
+
this.runner = new Ze(e);
|
|
966
988
|
}
|
|
967
989
|
async matches(e, t) {
|
|
968
990
|
const n = t.event();
|
|
@@ -973,12 +995,12 @@ class bn {
|
|
|
973
995
|
n && await this.runner.run({ workflow: e, eventNode: n, context: t });
|
|
974
996
|
}
|
|
975
997
|
}
|
|
976
|
-
class
|
|
998
|
+
class Dn {
|
|
977
999
|
kind = "marker";
|
|
978
|
-
blueIds = [
|
|
979
|
-
schema =
|
|
1000
|
+
blueIds = [R.Operation];
|
|
1001
|
+
schema = fn;
|
|
980
1002
|
}
|
|
981
|
-
function
|
|
1003
|
+
function Xe(i) {
|
|
982
1004
|
const e = i.channel;
|
|
983
1005
|
if (typeof e == "string") {
|
|
984
1006
|
const t = e.trim();
|
|
@@ -987,12 +1009,12 @@ function Qe(i) {
|
|
|
987
1009
|
}
|
|
988
1010
|
return null;
|
|
989
1011
|
}
|
|
990
|
-
function
|
|
1012
|
+
function Bn(i, e) {
|
|
991
1013
|
const t = i.getProperties()?.document;
|
|
992
1014
|
return t instanceof d ? e.blue.calculateBlueIdSync(t) : null;
|
|
993
1015
|
}
|
|
994
|
-
function
|
|
995
|
-
if (e.isTypeOf(i,
|
|
1016
|
+
function _n(i, e) {
|
|
1017
|
+
if (e.isTypeOf(i, ne, {
|
|
996
1018
|
checkSchemaExtensions: !0
|
|
997
1019
|
}))
|
|
998
1020
|
return i;
|
|
@@ -1000,34 +1022,34 @@ function In(i, e) {
|
|
|
1000
1022
|
checkSchemaExtensions: !0
|
|
1001
1023
|
})) {
|
|
1002
1024
|
const n = e.nodeToSchemaOutput(i, v).message;
|
|
1003
|
-
if (n && e.isTypeOf(n,
|
|
1025
|
+
if (n && e.isTypeOf(n, ne, {
|
|
1004
1026
|
checkSchemaExtensions: !0
|
|
1005
1027
|
}))
|
|
1006
1028
|
return n;
|
|
1007
1029
|
}
|
|
1008
1030
|
return null;
|
|
1009
1031
|
}
|
|
1010
|
-
function
|
|
1032
|
+
function Ln(i, e, t, n) {
|
|
1011
1033
|
const { blue: r } = n, s = i.operation;
|
|
1012
1034
|
return !(!s || t.operation !== s || i.event && !r.isTypeOfNode(e, i.event));
|
|
1013
1035
|
}
|
|
1014
|
-
function
|
|
1036
|
+
function $n(i, e) {
|
|
1015
1037
|
const t = i.operation;
|
|
1016
1038
|
if (!t)
|
|
1017
1039
|
return null;
|
|
1018
1040
|
const n = e.resolvePointer(`/contracts/${t}`), r = e.documentAt(n);
|
|
1019
|
-
if (!r || !e.blue.isTypeOf(r,
|
|
1041
|
+
if (!r || !e.blue.isTypeOf(r, z))
|
|
1020
1042
|
return null;
|
|
1021
1043
|
const s = e.blue.nodeToSchemaOutput(
|
|
1022
1044
|
r,
|
|
1023
|
-
|
|
1024
|
-
), o =
|
|
1045
|
+
z
|
|
1046
|
+
), o = Xe(s);
|
|
1025
1047
|
return { operationNode: r, operation: s, channelKey: o };
|
|
1026
1048
|
}
|
|
1027
|
-
function
|
|
1049
|
+
function xn(i, e) {
|
|
1028
1050
|
return !(i && e && i !== e);
|
|
1029
1051
|
}
|
|
1030
|
-
function
|
|
1052
|
+
function Fn(i, e, t) {
|
|
1031
1053
|
const n = i.getProperties()?.request, r = e.getProperties()?.request;
|
|
1032
1054
|
if (!(n instanceof d) || !(r instanceof d))
|
|
1033
1055
|
return !1;
|
|
@@ -1039,10 +1061,10 @@ function Rn(i, e, t) {
|
|
|
1039
1061
|
}
|
|
1040
1062
|
return !0;
|
|
1041
1063
|
}
|
|
1042
|
-
function
|
|
1064
|
+
function zn(i, e, t) {
|
|
1043
1065
|
if (!i || i.allowNewerVersion !== !1)
|
|
1044
1066
|
return !0;
|
|
1045
|
-
const n =
|
|
1067
|
+
const n = Bn(e, t);
|
|
1046
1068
|
if (!n)
|
|
1047
1069
|
return !0;
|
|
1048
1070
|
const r = t.resolvePointer("/"), s = t.documentAt(r);
|
|
@@ -1051,33 +1073,33 @@ function Pn(i, e, t) {
|
|
|
1051
1073
|
const c = (s.getContracts()?.initialized ?? null)?.get("/documentId") ?? null, l = typeof c == "string" && c.length > 0 ? c : t.blue.calculateBlueIdSync(s);
|
|
1052
1074
|
return n === l;
|
|
1053
1075
|
}
|
|
1054
|
-
class
|
|
1076
|
+
class Un {
|
|
1055
1077
|
kind = "handler";
|
|
1056
1078
|
blueIds = [
|
|
1057
|
-
|
|
1079
|
+
R["Sequential Workflow Operation"]
|
|
1058
1080
|
];
|
|
1059
|
-
schema =
|
|
1081
|
+
schema = Sn;
|
|
1060
1082
|
runner;
|
|
1061
|
-
constructor(e =
|
|
1062
|
-
this.runner = new
|
|
1083
|
+
constructor(e = de) {
|
|
1084
|
+
this.runner = new Ze(e);
|
|
1063
1085
|
}
|
|
1064
1086
|
deriveChannel(e, t) {
|
|
1065
1087
|
const n = e.operation;
|
|
1066
1088
|
if (!n)
|
|
1067
1089
|
return null;
|
|
1068
1090
|
const r = t.scopeContracts.get(n);
|
|
1069
|
-
if (!r || !t.blue.isTypeOf(r.node,
|
|
1091
|
+
if (!r || !t.blue.isTypeOf(r.node, z, {
|
|
1070
1092
|
checkSchemaExtensions: !0
|
|
1071
1093
|
}))
|
|
1072
1094
|
return null;
|
|
1073
|
-
const s = t.blue.nodeToSchemaOutput(r.node,
|
|
1074
|
-
return s ?
|
|
1095
|
+
const s = t.blue.nodeToSchemaOutput(r.node, z);
|
|
1096
|
+
return s ? Xe(s) : null;
|
|
1075
1097
|
}
|
|
1076
1098
|
async matches(e, t) {
|
|
1077
1099
|
const n = t.event();
|
|
1078
1100
|
if (!n)
|
|
1079
1101
|
return !1;
|
|
1080
|
-
const r =
|
|
1102
|
+
const r = _n(
|
|
1081
1103
|
n,
|
|
1082
1104
|
t.blue
|
|
1083
1105
|
);
|
|
@@ -1085,19 +1107,19 @@ class Nn {
|
|
|
1085
1107
|
return !1;
|
|
1086
1108
|
const s = t.blue.nodeToSchemaOutput(
|
|
1087
1109
|
r,
|
|
1088
|
-
|
|
1110
|
+
ne
|
|
1089
1111
|
);
|
|
1090
|
-
if (!s || !
|
|
1112
|
+
if (!s || !Ln(e, n, s, t))
|
|
1091
1113
|
return !1;
|
|
1092
|
-
const o =
|
|
1114
|
+
const o = $n(e, t);
|
|
1093
1115
|
if (!o)
|
|
1094
1116
|
return !1;
|
|
1095
1117
|
const a = typeof e.channel == "string" ? e.channel.trim() : "", c = a.length > 0 ? a : null;
|
|
1096
|
-
return !(!
|
|
1118
|
+
return !(!xn(o.channelKey, c) || !Fn(
|
|
1097
1119
|
r,
|
|
1098
1120
|
o.operationNode,
|
|
1099
1121
|
t.blue
|
|
1100
|
-
) || s?.allowNewerVersion === !1 && !
|
|
1122
|
+
) || s?.allowNewerVersion === !1 && !zn(s, r, t));
|
|
1101
1123
|
}
|
|
1102
1124
|
async execute(e, t) {
|
|
1103
1125
|
const n = t.event();
|
|
@@ -1108,17 +1130,17 @@ class Nn {
|
|
|
1108
1130
|
});
|
|
1109
1131
|
}
|
|
1110
1132
|
}
|
|
1111
|
-
class
|
|
1133
|
+
class Y {
|
|
1112
1134
|
constructor(e) {
|
|
1113
1135
|
this.registry = e;
|
|
1114
1136
|
}
|
|
1115
1137
|
static create() {
|
|
1116
|
-
return new
|
|
1117
|
-
new
|
|
1138
|
+
return new Y(
|
|
1139
|
+
new Cn()
|
|
1118
1140
|
);
|
|
1119
1141
|
}
|
|
1120
1142
|
registerDefaults() {
|
|
1121
|
-
return this.registry.register(new
|
|
1143
|
+
return this.registry.register(new In()), this.registry.register(new vn()), this.registry.register(new An()), this.registry.register(new Dn()), this.registry.register(new Un()), this;
|
|
1122
1144
|
}
|
|
1123
1145
|
register(e) {
|
|
1124
1146
|
return this.registry.register(e), this;
|
|
@@ -1127,11 +1149,11 @@ class Q {
|
|
|
1127
1149
|
return this.registry;
|
|
1128
1150
|
}
|
|
1129
1151
|
}
|
|
1130
|
-
const
|
|
1131
|
-
function
|
|
1152
|
+
const se = m["Channel Event Checkpoint"];
|
|
1153
|
+
function et(i) {
|
|
1132
1154
|
return typeof i.order == "number" ? i.order : 0;
|
|
1133
1155
|
}
|
|
1134
|
-
class
|
|
1156
|
+
class Vn {
|
|
1135
1157
|
constructor(e, t, n) {
|
|
1136
1158
|
this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n;
|
|
1137
1159
|
}
|
|
@@ -1145,10 +1167,10 @@ class An {
|
|
|
1145
1167
|
return this.bindingBlueId;
|
|
1146
1168
|
}
|
|
1147
1169
|
order() {
|
|
1148
|
-
return
|
|
1170
|
+
return et(this.bindingContract);
|
|
1149
1171
|
}
|
|
1150
1172
|
}
|
|
1151
|
-
class
|
|
1173
|
+
class Hn {
|
|
1152
1174
|
constructor(e, t, n) {
|
|
1153
1175
|
this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n;
|
|
1154
1176
|
}
|
|
@@ -1162,16 +1184,16 @@ class Mn {
|
|
|
1162
1184
|
return this.bindingBlueId;
|
|
1163
1185
|
}
|
|
1164
1186
|
order() {
|
|
1165
|
-
return
|
|
1187
|
+
return et(this.bindingContract);
|
|
1166
1188
|
}
|
|
1167
1189
|
}
|
|
1168
|
-
class
|
|
1190
|
+
class A {
|
|
1169
1191
|
constructor(e, t, n, r, s) {
|
|
1170
1192
|
this.channels = e, this.handlersByChannel = t, this.markerStore = n, this.embeddedPathsInternal = r, this.checkpointDeclared = s;
|
|
1171
1193
|
}
|
|
1172
1194
|
checkpointDeclared;
|
|
1173
1195
|
static fromComponents(e, t, n, r, s) {
|
|
1174
|
-
return new
|
|
1196
|
+
return new A(
|
|
1175
1197
|
e,
|
|
1176
1198
|
t,
|
|
1177
1199
|
n,
|
|
@@ -1180,10 +1202,10 @@ class M {
|
|
|
1180
1202
|
);
|
|
1181
1203
|
}
|
|
1182
1204
|
static builder() {
|
|
1183
|
-
return new
|
|
1205
|
+
return new Kn();
|
|
1184
1206
|
}
|
|
1185
1207
|
static empty() {
|
|
1186
|
-
return
|
|
1208
|
+
return A.builder().build();
|
|
1187
1209
|
}
|
|
1188
1210
|
markers() {
|
|
1189
1211
|
return new Map(
|
|
@@ -1213,16 +1235,16 @@ class M {
|
|
|
1213
1235
|
throw new Error(
|
|
1214
1236
|
"Duplicate Channel Event Checkpoint markers detected in same contracts map"
|
|
1215
1237
|
);
|
|
1216
|
-
this.markerStore.set(
|
|
1217
|
-
key:
|
|
1238
|
+
this.markerStore.set(T, {
|
|
1239
|
+
key: T,
|
|
1218
1240
|
contract: e,
|
|
1219
|
-
blueId:
|
|
1241
|
+
blueId: se
|
|
1220
1242
|
}), this.checkpointDeclared = !0;
|
|
1221
1243
|
}
|
|
1222
1244
|
handlersFor(e) {
|
|
1223
1245
|
const t = this.handlersByChannel.get(e);
|
|
1224
1246
|
return !t || t.length === 0 ? [] : [...t].map(
|
|
1225
|
-
(n) => new
|
|
1247
|
+
(n) => new Hn(n.key, n.contract, n.blueId)
|
|
1226
1248
|
).sort((n, r) => {
|
|
1227
1249
|
const s = n.order() - r.order();
|
|
1228
1250
|
return s !== 0 ? s : n.key().localeCompare(r.key());
|
|
@@ -1230,7 +1252,7 @@ class M {
|
|
|
1230
1252
|
}
|
|
1231
1253
|
channelsOfType(...e) {
|
|
1232
1254
|
const t = e.length > 0 ? new Set(e) : null, n = Array.from(this.channels.values()).filter((r) => !t || t.has(r.blueId)).map(
|
|
1233
|
-
(r) => new
|
|
1255
|
+
(r) => new Vn(r.key, r.contract, r.blueId)
|
|
1234
1256
|
);
|
|
1235
1257
|
return n.sort((r, s) => {
|
|
1236
1258
|
const o = r.order() - s.order();
|
|
@@ -1238,7 +1260,7 @@ class M {
|
|
|
1238
1260
|
}), n;
|
|
1239
1261
|
}
|
|
1240
1262
|
}
|
|
1241
|
-
class
|
|
1263
|
+
class Kn {
|
|
1242
1264
|
channels = /* @__PURE__ */ new Map();
|
|
1243
1265
|
handlersByChannel = /* @__PURE__ */ new Map();
|
|
1244
1266
|
markerStore = /* @__PURE__ */ new Map();
|
|
@@ -1263,12 +1285,12 @@ class Dn {
|
|
|
1263
1285
|
return this.embeddedDeclared = !0, this.embeddedPaths = e.paths ? [...e.paths] : [], this;
|
|
1264
1286
|
}
|
|
1265
1287
|
addMarker(e, t, n) {
|
|
1266
|
-
if (e ===
|
|
1288
|
+
if (e === T && n !== se)
|
|
1267
1289
|
throw new Error(
|
|
1268
1290
|
"Reserved key 'checkpoint' must contain a Channel Event Checkpoint"
|
|
1269
1291
|
);
|
|
1270
|
-
if (n ===
|
|
1271
|
-
if (e !==
|
|
1292
|
+
if (n === se) {
|
|
1293
|
+
if (e !== T)
|
|
1272
1294
|
throw new Error(
|
|
1273
1295
|
`Channel Event Checkpoint must use reserved key 'checkpoint' at key '${e}'`
|
|
1274
1296
|
);
|
|
@@ -1281,7 +1303,7 @@ class Dn {
|
|
|
1281
1303
|
return this.markerStore.set(e, { key: e, contract: t, blueId: n }), this;
|
|
1282
1304
|
}
|
|
1283
1305
|
build() {
|
|
1284
|
-
return
|
|
1306
|
+
return A.fromComponents(
|
|
1285
1307
|
new Map(this.channels),
|
|
1286
1308
|
new Map(
|
|
1287
1309
|
Array.from(this.handlersByChannel.entries(), ([e, t]) => [
|
|
@@ -1300,7 +1322,7 @@ class g extends Error {
|
|
|
1300
1322
|
super(e || "Processor fatal error"), this.processorError = t, this.name = "ProcessorFatalError";
|
|
1301
1323
|
}
|
|
1302
1324
|
}
|
|
1303
|
-
class
|
|
1325
|
+
class Wn {
|
|
1304
1326
|
constructor(e, t, n) {
|
|
1305
1327
|
this.blue = e, this.registry = t, this.builtinChannelSchemas = n;
|
|
1306
1328
|
}
|
|
@@ -1389,57 +1411,77 @@ class On {
|
|
|
1389
1411
|
return this.builtinChannelSchemas.has(e) ? !0 : this.registry.lookupChannel(e) != null;
|
|
1390
1412
|
}
|
|
1391
1413
|
isZodError(e) {
|
|
1392
|
-
return e instanceof
|
|
1414
|
+
return e instanceof Me;
|
|
1393
1415
|
}
|
|
1394
1416
|
}
|
|
1395
|
-
class
|
|
1417
|
+
class U extends Error {
|
|
1396
1418
|
constructor(e) {
|
|
1397
1419
|
super(e ?? "MustUnderstand failure"), this.name = "MustUnderstandFailure";
|
|
1398
1420
|
}
|
|
1399
1421
|
}
|
|
1400
|
-
const
|
|
1422
|
+
const Gn = m["Document Update Channel"], qn = m["Embedded Node Channel"], Jn = m["Lifecycle Event Channel"], jn = m["Triggered Event Channel"], ve = m["Process Embedded"], Qn = m["Processing Initialized Marker"], Yn = m["Processing Terminated Marker"], Zn = m["Channel Event Checkpoint"], Xn = D["Document Anchors"], er = D["Document Links"], tr = D["MyOS Participants Orchestration"], nr = D["MyOS Session Interaction"], rr = D["MyOS Worker Agency"], ke = /* @__PURE__ */ new Map([
|
|
1401
1423
|
[
|
|
1402
|
-
|
|
1403
|
-
|
|
1424
|
+
Gn,
|
|
1425
|
+
nn
|
|
1404
1426
|
],
|
|
1405
1427
|
[
|
|
1406
|
-
|
|
1407
|
-
|
|
1428
|
+
qn,
|
|
1429
|
+
rn
|
|
1408
1430
|
],
|
|
1409
1431
|
[
|
|
1410
|
-
|
|
1411
|
-
|
|
1432
|
+
Jn,
|
|
1433
|
+
sn
|
|
1412
1434
|
],
|
|
1413
1435
|
[
|
|
1414
|
-
|
|
1415
|
-
|
|
1436
|
+
jn,
|
|
1437
|
+
on
|
|
1416
1438
|
]
|
|
1417
|
-
]),
|
|
1439
|
+
]), ir = /* @__PURE__ */ new Map([
|
|
1418
1440
|
[
|
|
1419
|
-
|
|
1420
|
-
|
|
1441
|
+
Qn,
|
|
1442
|
+
un
|
|
1421
1443
|
],
|
|
1422
1444
|
[
|
|
1423
|
-
|
|
1424
|
-
|
|
1445
|
+
Yn,
|
|
1446
|
+
hn
|
|
1447
|
+
],
|
|
1448
|
+
[
|
|
1449
|
+
Zn,
|
|
1450
|
+
ln
|
|
1425
1451
|
],
|
|
1426
1452
|
[
|
|
1427
|
-
|
|
1428
|
-
|
|
1453
|
+
Xn,
|
|
1454
|
+
pn
|
|
1455
|
+
],
|
|
1456
|
+
[
|
|
1457
|
+
er,
|
|
1458
|
+
mn
|
|
1459
|
+
],
|
|
1460
|
+
[
|
|
1461
|
+
tr,
|
|
1462
|
+
gn
|
|
1463
|
+
],
|
|
1464
|
+
[
|
|
1465
|
+
nr,
|
|
1466
|
+
En
|
|
1467
|
+
],
|
|
1468
|
+
[
|
|
1469
|
+
rr,
|
|
1470
|
+
yn
|
|
1429
1471
|
]
|
|
1430
1472
|
]);
|
|
1431
|
-
class
|
|
1473
|
+
class sr {
|
|
1432
1474
|
constructor(e, t) {
|
|
1433
|
-
this.registry = e, this.blue = t, this.handlerRegistration = new
|
|
1475
|
+
this.registry = e, this.blue = t, this.handlerRegistration = new Wn(
|
|
1434
1476
|
this.blue,
|
|
1435
1477
|
this.registry,
|
|
1436
|
-
|
|
1478
|
+
ke
|
|
1437
1479
|
);
|
|
1438
1480
|
}
|
|
1439
1481
|
handlerRegistration;
|
|
1440
1482
|
load(e, t) {
|
|
1441
1483
|
try {
|
|
1442
|
-
const n =
|
|
1484
|
+
const n = A.builder(), r = e.getContracts();
|
|
1443
1485
|
if (!r)
|
|
1444
1486
|
return n.build();
|
|
1445
1487
|
const s = this.buildScopeContractsIndex(r);
|
|
@@ -1447,7 +1489,7 @@ class Hn {
|
|
|
1447
1489
|
a && this.processContract(n, o, a, s);
|
|
1448
1490
|
return n.build();
|
|
1449
1491
|
} catch (n) {
|
|
1450
|
-
if (n instanceof
|
|
1492
|
+
if (n instanceof U || n instanceof g)
|
|
1451
1493
|
throw n;
|
|
1452
1494
|
const r = n?.message ?? "Failed to load contracts";
|
|
1453
1495
|
throw new g(
|
|
@@ -1463,16 +1505,16 @@ class Hn {
|
|
|
1463
1505
|
const s = n.getType()?.getBlueId();
|
|
1464
1506
|
if (!s)
|
|
1465
1507
|
return;
|
|
1466
|
-
if (s ===
|
|
1508
|
+
if (s === ve) {
|
|
1467
1509
|
this.handleProcessEmbedded(e, t, n);
|
|
1468
1510
|
return;
|
|
1469
1511
|
}
|
|
1470
|
-
const o =
|
|
1512
|
+
const o = ir.get(s);
|
|
1471
1513
|
if (o) {
|
|
1472
1514
|
this.handleMarker(e, t, n, o, s);
|
|
1473
1515
|
return;
|
|
1474
1516
|
}
|
|
1475
|
-
const a =
|
|
1517
|
+
const a = ke.get(s);
|
|
1476
1518
|
if (a) {
|
|
1477
1519
|
this.handleChannel(e, t, n, a, s);
|
|
1478
1520
|
return;
|
|
@@ -1511,27 +1553,27 @@ class Hn {
|
|
|
1511
1553
|
);
|
|
1512
1554
|
return;
|
|
1513
1555
|
}
|
|
1514
|
-
throw
|
|
1556
|
+
throw ae(s) ? new g(
|
|
1515
1557
|
"Built-in processor-managed channel is missing schema registration",
|
|
1516
1558
|
E.invalidContract(
|
|
1517
1559
|
s,
|
|
1518
1560
|
"Built-in processor-managed channel is missing schema registration",
|
|
1519
1561
|
t
|
|
1520
1562
|
)
|
|
1521
|
-
) : new
|
|
1563
|
+
) : new U(`Unsupported contract type: ${s}`);
|
|
1522
1564
|
}
|
|
1523
1565
|
handleProcessEmbedded(e, t, n) {
|
|
1524
1566
|
try {
|
|
1525
1567
|
const r = this.convert(
|
|
1526
1568
|
n,
|
|
1527
|
-
|
|
1569
|
+
dn
|
|
1528
1570
|
);
|
|
1529
1571
|
e.setEmbedded(r);
|
|
1530
1572
|
} catch (r) {
|
|
1531
|
-
throw
|
|
1573
|
+
throw ee(r) ? new g(
|
|
1532
1574
|
"Failed to parse ProcessEmbedded marker",
|
|
1533
1575
|
E.invalidContract(
|
|
1534
|
-
|
|
1576
|
+
ve,
|
|
1535
1577
|
"Failed to parse ProcessEmbedded marker",
|
|
1536
1578
|
t,
|
|
1537
1579
|
r
|
|
@@ -1549,7 +1591,7 @@ class Hn {
|
|
|
1549
1591
|
const o = this.convert(n, r);
|
|
1550
1592
|
e.addChannel(t, o, s);
|
|
1551
1593
|
} catch (o) {
|
|
1552
|
-
if (
|
|
1594
|
+
if (ee(o))
|
|
1553
1595
|
throw new g(
|
|
1554
1596
|
"Failed to parse channel contract",
|
|
1555
1597
|
E.invalidContract(
|
|
@@ -1571,7 +1613,7 @@ class Hn {
|
|
|
1571
1613
|
const o = this.convert(n, r);
|
|
1572
1614
|
e.addMarker(t, o, s);
|
|
1573
1615
|
} catch (o) {
|
|
1574
|
-
if (
|
|
1616
|
+
if (ee(o))
|
|
1575
1617
|
throw new g(
|
|
1576
1618
|
"Failed to parse marker contract",
|
|
1577
1619
|
E.invalidContract(
|
|
@@ -1602,27 +1644,27 @@ class Hn {
|
|
|
1602
1644
|
return this.blue.nodeToSchemaOutput(e, t);
|
|
1603
1645
|
}
|
|
1604
1646
|
}
|
|
1605
|
-
function
|
|
1606
|
-
return i instanceof
|
|
1647
|
+
function ee(i) {
|
|
1648
|
+
return i instanceof Me;
|
|
1607
1649
|
}
|
|
1608
|
-
const
|
|
1609
|
-
function
|
|
1650
|
+
const or = m["Channel Event Checkpoint"];
|
|
1651
|
+
function ar(i) {
|
|
1610
1652
|
return i.jsonValueToNode({
|
|
1611
|
-
type: { blueId:
|
|
1653
|
+
type: { blueId: or },
|
|
1612
1654
|
lastEvents: {},
|
|
1613
1655
|
lastSignatures: {}
|
|
1614
1656
|
});
|
|
1615
1657
|
}
|
|
1616
|
-
function
|
|
1658
|
+
function cr() {
|
|
1617
1659
|
return {
|
|
1618
1660
|
lastEvents: {},
|
|
1619
1661
|
lastSignatures: {}
|
|
1620
1662
|
};
|
|
1621
1663
|
}
|
|
1622
|
-
function
|
|
1664
|
+
function Te(i) {
|
|
1623
1665
|
return i != null && Object.prototype.hasOwnProperty.call(i, "lastEvents") && Object.prototype.hasOwnProperty.call(i, "lastSignatures");
|
|
1624
1666
|
}
|
|
1625
|
-
class
|
|
1667
|
+
class lr {
|
|
1626
1668
|
constructor(e, t, n, r, s) {
|
|
1627
1669
|
this.markerKey = e, this.checkpoint = t, this.channelKey = n, this.lastEventNode = r, this.lastEventSignature = s;
|
|
1628
1670
|
}
|
|
@@ -1632,28 +1674,28 @@ class Gn {
|
|
|
1632
1674
|
return e != null && e === this.lastEventSignature;
|
|
1633
1675
|
}
|
|
1634
1676
|
}
|
|
1635
|
-
class
|
|
1677
|
+
class ur {
|
|
1636
1678
|
constructor(e, t) {
|
|
1637
1679
|
this.runtime = e, this.signatureFn = t;
|
|
1638
1680
|
}
|
|
1639
1681
|
ensureCheckpointMarker(e, t) {
|
|
1640
|
-
const n = t.marker(
|
|
1682
|
+
const n = t.marker(T), r = w(e, $e);
|
|
1641
1683
|
if (!n) {
|
|
1642
|
-
const s =
|
|
1643
|
-
this.runtime.directWrite(r, s), t.registerCheckpointMarker(
|
|
1684
|
+
const s = ar(this.runtime.blue());
|
|
1685
|
+
this.runtime.directWrite(r, s), t.registerCheckpointMarker(cr());
|
|
1644
1686
|
return;
|
|
1645
1687
|
}
|
|
1646
|
-
if (!
|
|
1688
|
+
if (!Te(n))
|
|
1647
1689
|
throw new Error(
|
|
1648
1690
|
`Reserved key 'checkpoint' must contain a Channel Event Checkpoint at ${r}`
|
|
1649
1691
|
);
|
|
1650
1692
|
}
|
|
1651
1693
|
findCheckpoint(e, t) {
|
|
1652
1694
|
for (const [n, r] of e.markerEntries()) {
|
|
1653
|
-
if (!
|
|
1695
|
+
if (!Te(r))
|
|
1654
1696
|
continue;
|
|
1655
1697
|
const o = (r.lastEvents?.[t] ?? null)?.clone() ?? null, c = r.lastSignatures?.[t] ?? null ?? this.signatureFn(o);
|
|
1656
|
-
return new
|
|
1698
|
+
return new lr(
|
|
1657
1699
|
n,
|
|
1658
1700
|
r,
|
|
1659
1701
|
t,
|
|
@@ -1671,17 +1713,17 @@ class qn {
|
|
|
1671
1713
|
return;
|
|
1672
1714
|
const o = w(
|
|
1673
1715
|
e,
|
|
1674
|
-
|
|
1716
|
+
ze(n.markerKey, n.channelKey)
|
|
1675
1717
|
), a = s?.clone() ?? null;
|
|
1676
1718
|
this.runtime.gasMeter().chargeCheckpointUpdate(), this.runtime.directWrite(o, a), n.checkpoint.lastEvents || (n.checkpoint.lastEvents = {}), a ? n.checkpoint.lastEvents[n.channelKey] = a.clone() ?? null : delete n.checkpoint.lastEvents[n.channelKey], n.lastEventNode = a?.clone() ?? null;
|
|
1677
1719
|
const c = w(
|
|
1678
1720
|
e,
|
|
1679
|
-
|
|
1721
|
+
Ue(n.markerKey, n.channelKey)
|
|
1680
1722
|
), l = r == null ? null : new d().setValue(r);
|
|
1681
1723
|
this.runtime.directWrite(c, l), n.checkpoint.lastSignatures || (n.checkpoint.lastSignatures = {}), r == null ? delete n.checkpoint.lastSignatures[n.channelKey] : n.checkpoint.lastSignatures[n.channelKey] = r, n.lastEventSignature = r ?? null;
|
|
1682
1724
|
}
|
|
1683
1725
|
}
|
|
1684
|
-
class
|
|
1726
|
+
class dr {
|
|
1685
1727
|
constructor(e, t, n) {
|
|
1686
1728
|
this.runtime = e, this.checkpointManager = t, this.deps = n;
|
|
1687
1729
|
}
|
|
@@ -1703,7 +1745,13 @@ class Jn {
|
|
|
1703
1745
|
t,
|
|
1704
1746
|
n.key()
|
|
1705
1747
|
), l = o.eventId ?? this.deps.canonicalSignature(s);
|
|
1706
|
-
this.checkpointManager.isDuplicate(c, l) ||
|
|
1748
|
+
this.checkpointManager.isDuplicate(c, l) || !await this.shouldProcessRelativeToCheckpoint(
|
|
1749
|
+
e,
|
|
1750
|
+
t,
|
|
1751
|
+
n,
|
|
1752
|
+
s,
|
|
1753
|
+
c
|
|
1754
|
+
) || (await this.runHandlers(
|
|
1707
1755
|
e,
|
|
1708
1756
|
t,
|
|
1709
1757
|
n.key(),
|
|
@@ -1740,22 +1788,41 @@ class Jn {
|
|
|
1740
1788
|
}
|
|
1741
1789
|
}
|
|
1742
1790
|
}
|
|
1791
|
+
async shouldProcessRelativeToCheckpoint(e, t, n, r, s) {
|
|
1792
|
+
if (!s?.lastEventNode)
|
|
1793
|
+
return !0;
|
|
1794
|
+
const o = this.deps.channelProcessorFor(n.blueId());
|
|
1795
|
+
if (!o || typeof o.isNewerEvent != "function")
|
|
1796
|
+
return !0;
|
|
1797
|
+
const a = {
|
|
1798
|
+
scopePath: e,
|
|
1799
|
+
blue: this.runtime.blue(),
|
|
1800
|
+
event: r.clone(),
|
|
1801
|
+
markers: t.markers(),
|
|
1802
|
+
bindingKey: n.key()
|
|
1803
|
+
};
|
|
1804
|
+
return await o.isNewerEvent(
|
|
1805
|
+
n.contract(),
|
|
1806
|
+
a,
|
|
1807
|
+
s.lastEventNode.clone()
|
|
1808
|
+
);
|
|
1809
|
+
}
|
|
1743
1810
|
}
|
|
1744
|
-
function
|
|
1811
|
+
function hr(i, e) {
|
|
1745
1812
|
return e.isResolved() ? i.createResolvedNode(e) : i.resolve(e);
|
|
1746
1813
|
}
|
|
1747
|
-
class
|
|
1814
|
+
class O extends g {
|
|
1748
1815
|
constructor(e) {
|
|
1749
1816
|
super(e, E.illegalState(e)), this.name = "IllegalStateException";
|
|
1750
1817
|
}
|
|
1751
1818
|
}
|
|
1752
|
-
class
|
|
1819
|
+
class N extends Error {
|
|
1753
1820
|
constructor(e) {
|
|
1754
1821
|
super(e), this.name = "BoundaryViolationException";
|
|
1755
1822
|
}
|
|
1756
1823
|
}
|
|
1757
|
-
const
|
|
1758
|
-
class
|
|
1824
|
+
const fr = m["Document Update Channel"], pr = m["Embedded Node Channel"], mr = m["Triggered Event Channel"], gr = m["Lifecycle Event Channel"], Re = m["Processing Initialized Marker"], Er = m["Document Processing Initiated"];
|
|
1825
|
+
class yr {
|
|
1759
1826
|
runtime;
|
|
1760
1827
|
contractLoader;
|
|
1761
1828
|
channelRunner;
|
|
@@ -1772,22 +1839,22 @@ class tr {
|
|
|
1772
1839
|
const n = y(e), r = /* @__PURE__ */ new Set();
|
|
1773
1840
|
let s = null, o = null;
|
|
1774
1841
|
for (t && this.runtime.gasMeter().chargeScopeEntry(n); ; ) {
|
|
1775
|
-
const
|
|
1776
|
-
if (!h)
|
|
1777
|
-
return;
|
|
1778
|
-
o || (o = h.clone()), s = this.loadBundle(h, n), this.bundles.set(n, s);
|
|
1779
|
-
const f = s.embeddedPaths().find((Y) => !r.has(Y)) ?? null;
|
|
1842
|
+
const f = this.nodeAt(n);
|
|
1780
1843
|
if (!f)
|
|
1844
|
+
return;
|
|
1845
|
+
o || (o = f.clone()), s = this.loadBundle(f, n), this.bundles.set(n, s);
|
|
1846
|
+
const h = s.embeddedPaths().find((Z) => !r.has(Z)) ?? null;
|
|
1847
|
+
if (!h)
|
|
1781
1848
|
break;
|
|
1782
|
-
r.add(
|
|
1783
|
-
const p = w(n,
|
|
1849
|
+
r.add(h);
|
|
1850
|
+
const p = w(n, h);
|
|
1784
1851
|
this.nodeAt(p) && await this.initializeScope(p, !0);
|
|
1785
1852
|
}
|
|
1786
1853
|
if (!s)
|
|
1787
1854
|
return;
|
|
1788
1855
|
const a = this.hasInitializationMarker(n);
|
|
1789
1856
|
if (!a && s.hasCheckpoint())
|
|
1790
|
-
throw new
|
|
1857
|
+
throw new O(
|
|
1791
1858
|
`Reserved key 'checkpoint' must not appear before initialization at scope ${n}`
|
|
1792
1859
|
);
|
|
1793
1860
|
if (a)
|
|
@@ -1806,7 +1873,7 @@ class tr {
|
|
|
1806
1873
|
const t = y(e);
|
|
1807
1874
|
if (this.bundles.has(t))
|
|
1808
1875
|
return;
|
|
1809
|
-
const n = this.nodeAt(t), r = n ? this.loadBundle(n, t) :
|
|
1876
|
+
const n = this.nodeAt(t), r = n ? this.loadBundle(n, t) : A.empty();
|
|
1810
1877
|
this.bundles.set(t, r);
|
|
1811
1878
|
for (const s of r.embeddedPaths()) {
|
|
1812
1879
|
const o = w(t, s);
|
|
@@ -1814,7 +1881,7 @@ class tr {
|
|
|
1814
1881
|
}
|
|
1815
1882
|
}
|
|
1816
1883
|
async processExternalEvent(e, t) {
|
|
1817
|
-
const n =
|
|
1884
|
+
const n = hr(this.runtime.blue(), t);
|
|
1818
1885
|
await this.processPreparedExternalEvent(e, n);
|
|
1819
1886
|
}
|
|
1820
1887
|
async processPreparedExternalEvent(e, t) {
|
|
@@ -1833,7 +1900,7 @@ class tr {
|
|
|
1833
1900
|
for (const o of s) {
|
|
1834
1901
|
if (this.hooks.isScopeInactive(n))
|
|
1835
1902
|
break;
|
|
1836
|
-
|
|
1903
|
+
ae(o.blueId()) || await this.channelRunner.runExternalChannel(
|
|
1837
1904
|
n,
|
|
1838
1905
|
r,
|
|
1839
1906
|
o,
|
|
@@ -1852,7 +1919,7 @@ class tr {
|
|
|
1852
1919
|
r
|
|
1853
1920
|
);
|
|
1854
1921
|
} catch (s) {
|
|
1855
|
-
if (s instanceof
|
|
1922
|
+
if (s instanceof N) {
|
|
1856
1923
|
const o = this.hooks.fatalReason(s, "Boundary violation");
|
|
1857
1924
|
await this.hooks.enterFatalTermination(e, t, o);
|
|
1858
1925
|
return;
|
|
@@ -1880,13 +1947,13 @@ class tr {
|
|
|
1880
1947
|
if (!a || this.hooks.isScopeInactive(o))
|
|
1881
1948
|
continue;
|
|
1882
1949
|
const c = this.createDocumentUpdateEvent(s, o), l = a.channelsOfType(
|
|
1883
|
-
|
|
1950
|
+
fr
|
|
1884
1951
|
);
|
|
1885
1952
|
for (const u of l) {
|
|
1886
|
-
const
|
|
1953
|
+
const f = u.contract();
|
|
1887
1954
|
if (this.matchesDocumentUpdate(
|
|
1888
1955
|
o,
|
|
1889
|
-
|
|
1956
|
+
f.path ?? null,
|
|
1890
1957
|
s.path
|
|
1891
1958
|
) && (await this.channelRunner.runHandlers(
|
|
1892
1959
|
o,
|
|
@@ -1899,12 +1966,12 @@ class tr {
|
|
|
1899
1966
|
}
|
|
1900
1967
|
}
|
|
1901
1968
|
} catch (s) {
|
|
1902
|
-
if (s instanceof
|
|
1969
|
+
if (s instanceof N) {
|
|
1903
1970
|
const o = this.hooks.fatalReason(s, "Boundary violation");
|
|
1904
1971
|
await this.hooks.enterFatalTermination(e, t, o);
|
|
1905
1972
|
return;
|
|
1906
1973
|
}
|
|
1907
|
-
if (s instanceof
|
|
1974
|
+
if (s instanceof O || s instanceof Error && !(s instanceof g)) {
|
|
1908
1975
|
const o = this.hooks.fatalReason(s, "Runtime fatal");
|
|
1909
1976
|
await this.hooks.enterFatalTermination(e, t, o);
|
|
1910
1977
|
return;
|
|
@@ -1917,7 +1984,7 @@ class tr {
|
|
|
1917
1984
|
if (this.runtime.gasMeter().chargeLifecycleDelivery(), await this.hooks.recordLifecycleForBridging(e, n), !t)
|
|
1918
1985
|
return;
|
|
1919
1986
|
const s = t.channelsOfType(
|
|
1920
|
-
|
|
1987
|
+
gr
|
|
1921
1988
|
);
|
|
1922
1989
|
for (const o of s)
|
|
1923
1990
|
if (await this.channelRunner.runHandlers(
|
|
@@ -1966,7 +2033,7 @@ class tr {
|
|
|
1966
2033
|
try {
|
|
1967
2034
|
return this.contractLoader.load(e, t);
|
|
1968
2035
|
} catch (n) {
|
|
1969
|
-
if (n instanceof g || n instanceof
|
|
2036
|
+
if (n instanceof g || n instanceof U)
|
|
1970
2037
|
throw n;
|
|
1971
2038
|
const r = n?.message ?? "Failed to load contracts";
|
|
1972
2039
|
throw new g(
|
|
@@ -1979,7 +2046,7 @@ class tr {
|
|
|
1979
2046
|
}
|
|
1980
2047
|
}
|
|
1981
2048
|
async addInitializationMarker(e, t) {
|
|
1982
|
-
const n = new d().setType(new d().setBlueId(
|
|
2049
|
+
const n = new d().setType(new d().setBlueId(Re)).addProperty("documentId", new d().setValue(t)), r = e.resolvePointer(ie);
|
|
1983
2050
|
await e.applyPatch({
|
|
1984
2051
|
op: "ADD",
|
|
1985
2052
|
path: r,
|
|
@@ -1993,7 +2060,7 @@ class tr {
|
|
|
1993
2060
|
if (this.hooks.isScopeInactive(e) || t.embeddedPaths().length === 0)
|
|
1994
2061
|
return;
|
|
1995
2062
|
const n = t.channelsOfType(
|
|
1996
|
-
|
|
2063
|
+
pr
|
|
1997
2064
|
);
|
|
1998
2065
|
if (n.length !== 0)
|
|
1999
2066
|
for (const r of t.embeddedPaths()) {
|
|
@@ -2002,8 +2069,8 @@ class tr {
|
|
|
2002
2069
|
for (const c of a) {
|
|
2003
2070
|
let l = !1;
|
|
2004
2071
|
for (const u of n) {
|
|
2005
|
-
const
|
|
2006
|
-
w(e,
|
|
2072
|
+
const h = u.contract().childPath ?? "/";
|
|
2073
|
+
w(e, h) === s && (l || (this.runtime.gasMeter().chargeBridge(), l = !0), await this.channelRunner.runHandlers(
|
|
2007
2074
|
e,
|
|
2008
2075
|
t,
|
|
2009
2076
|
u.key(),
|
|
@@ -2018,7 +2085,7 @@ class tr {
|
|
|
2018
2085
|
if (this.hooks.isScopeInactive(e))
|
|
2019
2086
|
return;
|
|
2020
2087
|
const n = this.runtime.scope(e), r = t.channelsOfType(
|
|
2021
|
-
|
|
2088
|
+
mr
|
|
2022
2089
|
);
|
|
2023
2090
|
if (r.length === 0) {
|
|
2024
2091
|
n.clearTriggered();
|
|
@@ -2048,19 +2115,19 @@ class tr {
|
|
|
2048
2115
|
}
|
|
2049
2116
|
}
|
|
2050
2117
|
validatePatchBoundary(e, t, n) {
|
|
2051
|
-
const r = y(e), s =
|
|
2118
|
+
const r = y(e), s = S(n.path);
|
|
2052
2119
|
if (s === r)
|
|
2053
|
-
throw new
|
|
2120
|
+
throw new N(
|
|
2054
2121
|
`Self-root mutation is forbidden at scope ${r}`
|
|
2055
2122
|
);
|
|
2056
2123
|
if (r !== "/" && !s.startsWith(`${r}/`))
|
|
2057
|
-
throw new
|
|
2124
|
+
throw new N(
|
|
2058
2125
|
`Patch path ${s} is outside scope ${r}`
|
|
2059
2126
|
);
|
|
2060
2127
|
for (const o of t.embeddedPaths()) {
|
|
2061
2128
|
const a = w(r, o);
|
|
2062
2129
|
if (s.startsWith(`${a}/`))
|
|
2063
|
-
throw new
|
|
2130
|
+
throw new N(
|
|
2064
2131
|
`Boundary violation: patch ${s} enters embedded scope ${a}`
|
|
2065
2132
|
);
|
|
2066
2133
|
}
|
|
@@ -2068,14 +2135,14 @@ class tr {
|
|
|
2068
2135
|
enforceReservedKeyWriteProtection(e, t, n) {
|
|
2069
2136
|
if (n)
|
|
2070
2137
|
return;
|
|
2071
|
-
const r = y(e), s =
|
|
2072
|
-
for (const o of
|
|
2138
|
+
const r = y(e), s = S(t.path);
|
|
2139
|
+
for (const o of oe) {
|
|
2073
2140
|
const a = w(
|
|
2074
2141
|
r,
|
|
2075
|
-
|
|
2142
|
+
Q(o)
|
|
2076
2143
|
);
|
|
2077
2144
|
if (s === a || s.startsWith(`${a}/`))
|
|
2078
|
-
throw new
|
|
2145
|
+
throw new N(
|
|
2079
2146
|
`Reserved key '${o}' is write-protected at ${a}`
|
|
2080
2147
|
);
|
|
2081
2148
|
}
|
|
@@ -2083,90 +2150,90 @@ class tr {
|
|
|
2083
2150
|
async markCutOffChildrenIfNeeded(e, t, n) {
|
|
2084
2151
|
if (t.embeddedPaths().length === 0)
|
|
2085
2152
|
return;
|
|
2086
|
-
const r =
|
|
2153
|
+
const r = S(n.path);
|
|
2087
2154
|
for (const s of t.embeddedPaths()) {
|
|
2088
2155
|
const o = w(e, s);
|
|
2089
2156
|
r === o && (n.op === "remove" || n.op === "replace") && await this.hooks.markCutOff(o);
|
|
2090
2157
|
}
|
|
2091
2158
|
}
|
|
2092
2159
|
hasInitializationMarker(e) {
|
|
2093
|
-
const t = w(e,
|
|
2160
|
+
const t = w(e, ie), n = this.nodeAt(t);
|
|
2094
2161
|
if (!n)
|
|
2095
2162
|
return !1;
|
|
2096
2163
|
if (!(n instanceof d)) {
|
|
2097
2164
|
const s = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
|
|
2098
|
-
throw new
|
|
2165
|
+
throw new O(s);
|
|
2099
2166
|
}
|
|
2100
|
-
if (n.getType()?.getBlueId() !==
|
|
2167
|
+
if (n.getType()?.getBlueId() !== Re) {
|
|
2101
2168
|
const s = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
|
|
2102
|
-
throw new
|
|
2169
|
+
throw new O(s);
|
|
2103
2170
|
}
|
|
2104
2171
|
return !0;
|
|
2105
2172
|
}
|
|
2106
2173
|
createLifecycleEvent(e) {
|
|
2107
|
-
return new d().setType(new d().setBlueId(
|
|
2174
|
+
return new d().setType(new d().setBlueId(Er)).setProperties({
|
|
2108
2175
|
type: new d().setValue("Document Processing Initiated"),
|
|
2109
2176
|
documentId: new d().setValue(e)
|
|
2110
2177
|
});
|
|
2111
2178
|
}
|
|
2112
2179
|
}
|
|
2113
|
-
class
|
|
2180
|
+
class J extends Error {
|
|
2114
2181
|
constructor(e) {
|
|
2115
2182
|
super(
|
|
2116
2183
|
e ? "Processing terminated due to fatal error" : "Processing terminated"
|
|
2117
2184
|
), this.fatal = e, this.name = "RunTerminationError";
|
|
2118
2185
|
}
|
|
2119
2186
|
}
|
|
2120
|
-
const
|
|
2121
|
-
class
|
|
2187
|
+
const wr = m["Processing Terminated Marker"], Sr = m["Document Processing Terminated"];
|
|
2188
|
+
class br {
|
|
2122
2189
|
constructor(e) {
|
|
2123
2190
|
this.runtime = e;
|
|
2124
2191
|
}
|
|
2125
2192
|
async terminateScope(e, t, n, r, s) {
|
|
2126
2193
|
e.recordPendingTermination(t, r, s ?? null);
|
|
2127
|
-
const o = e.normalizeScope(t), a = w(o,
|
|
2194
|
+
const o = e.normalizeScope(t), a = w(o, Le);
|
|
2128
2195
|
this.runtime.directWrite(
|
|
2129
2196
|
a,
|
|
2130
|
-
|
|
2197
|
+
Cr(this.runtime.blue(), r, s)
|
|
2131
2198
|
), this.runtime.gasMeter().chargeTerminationMarker();
|
|
2132
|
-
const c = n ?? e.bundleForScope(o) ?? null, l =
|
|
2199
|
+
const c = n ?? e.bundleForScope(o) ?? null, l = Ir(r, s);
|
|
2133
2200
|
if (await e.deliverLifecycle(
|
|
2134
2201
|
o,
|
|
2135
2202
|
c,
|
|
2136
2203
|
l,
|
|
2137
2204
|
!1
|
|
2138
2205
|
), this.runtime.scope(o).finalizeTermination(r, s ?? null), e.clearPendingTermination(t), r === "FATAL" && this.runtime.gasMeter().chargeFatalTerminationOverhead(), r === "FATAL" && o === "/")
|
|
2139
|
-
throw this.runtime.markRunTerminated(), new
|
|
2206
|
+
throw this.runtime.markRunTerminated(), new J(!0);
|
|
2140
2207
|
if (r === "GRACEFUL" && o === "/")
|
|
2141
|
-
throw this.runtime.markRunTerminated(), new
|
|
2208
|
+
throw this.runtime.markRunTerminated(), new J(!1);
|
|
2142
2209
|
}
|
|
2143
2210
|
}
|
|
2144
|
-
function
|
|
2145
|
-
return
|
|
2146
|
-
type: { blueId:
|
|
2211
|
+
function Cr(i, e, t) {
|
|
2212
|
+
return vr(i, {
|
|
2213
|
+
type: { blueId: wr },
|
|
2147
2214
|
cause: e === "GRACEFUL" ? "graceful" : "fatal",
|
|
2148
2215
|
...t ? { reason: t } : {}
|
|
2149
2216
|
});
|
|
2150
2217
|
}
|
|
2151
|
-
function
|
|
2218
|
+
function Ir(i, e) {
|
|
2152
2219
|
const t = new d().setType(
|
|
2153
|
-
new d().setBlueId(
|
|
2220
|
+
new d().setBlueId(Sr)
|
|
2154
2221
|
);
|
|
2155
2222
|
return t.addProperty(
|
|
2156
2223
|
"cause",
|
|
2157
2224
|
new d().setValue(i === "GRACEFUL" ? "graceful" : "fatal")
|
|
2158
2225
|
), e && t.addProperty("reason", new d().setValue(e)), t;
|
|
2159
2226
|
}
|
|
2160
|
-
function
|
|
2227
|
+
function vr(i, e) {
|
|
2161
2228
|
return i.jsonValueToNode(e);
|
|
2162
2229
|
}
|
|
2163
|
-
const
|
|
2164
|
-
class
|
|
2230
|
+
const F = "-";
|
|
2231
|
+
class kr {
|
|
2165
2232
|
constructor(e) {
|
|
2166
2233
|
this.document = e;
|
|
2167
2234
|
}
|
|
2168
2235
|
applyPatch(e, t) {
|
|
2169
|
-
const n = y(e), r =
|
|
2236
|
+
const n = y(e), r = S(t.path), s = Ne(r), o = Pe(this.document, s, "before", r);
|
|
2170
2237
|
switch (t.op) {
|
|
2171
2238
|
case "ADD":
|
|
2172
2239
|
this.applyAdd(s, r, t.val ?? null);
|
|
@@ -2178,34 +2245,34 @@ class cr {
|
|
|
2178
2245
|
this.applyRemove(s, r);
|
|
2179
2246
|
break;
|
|
2180
2247
|
}
|
|
2181
|
-
const a = t.op === "REMOVE" ? null :
|
|
2248
|
+
const a = t.op === "REMOVE" ? null : Pe(this.document, s, "after", r);
|
|
2182
2249
|
return {
|
|
2183
2250
|
path: r,
|
|
2184
2251
|
before: o,
|
|
2185
2252
|
after: a,
|
|
2186
2253
|
op: t.op.toLowerCase(),
|
|
2187
2254
|
originScope: n,
|
|
2188
|
-
cascadeScopes:
|
|
2255
|
+
cascadeScopes: Tr(n)
|
|
2189
2256
|
};
|
|
2190
2257
|
}
|
|
2191
2258
|
directWrite(e, t) {
|
|
2192
|
-
const n =
|
|
2259
|
+
const n = S(e);
|
|
2193
2260
|
if (n === "/")
|
|
2194
2261
|
throw new Error("Direct write cannot target root document");
|
|
2195
|
-
const r =
|
|
2196
|
-
if (o ===
|
|
2262
|
+
const r = Ne(n), { parent: s, leaf: o } = this.resolveParent(r);
|
|
2263
|
+
if (o === F)
|
|
2197
2264
|
throw new Error(
|
|
2198
2265
|
`Direct write does not support append token '-' for path ${n}`
|
|
2199
2266
|
);
|
|
2200
2267
|
const a = s.getItems();
|
|
2201
|
-
if (a &&
|
|
2268
|
+
if (a && M(o)) {
|
|
2202
2269
|
this.directWriteArray(s, a, o, t, n);
|
|
2203
2270
|
return;
|
|
2204
2271
|
}
|
|
2205
2272
|
this.directWriteObject(s, o, t);
|
|
2206
2273
|
}
|
|
2207
2274
|
directWriteArray(e, t, n, r, s) {
|
|
2208
|
-
const o =
|
|
2275
|
+
const o = te(e, t), a = k(n, s);
|
|
2209
2276
|
if (r == null) {
|
|
2210
2277
|
if (a < 0 || a >= o.length)
|
|
2211
2278
|
return;
|
|
@@ -2226,7 +2293,7 @@ class cr {
|
|
|
2226
2293
|
);
|
|
2227
2294
|
}
|
|
2228
2295
|
directWriteObject(e, t, n) {
|
|
2229
|
-
const r =
|
|
2296
|
+
const r = W(e);
|
|
2230
2297
|
if (n == null) {
|
|
2231
2298
|
delete r[t], e.setProperties(
|
|
2232
2299
|
Object.keys(r).length > 0 ? r : void 0
|
|
@@ -2246,25 +2313,25 @@ class cr {
|
|
|
2246
2313
|
return { parent: t, leaf: e[e.length - 1] };
|
|
2247
2314
|
}
|
|
2248
2315
|
getOrCreateChild(e, t, n, r) {
|
|
2249
|
-
if (t ===
|
|
2316
|
+
if (t === F)
|
|
2250
2317
|
throw new Error(
|
|
2251
|
-
`Append token '-' must be final segment: ${
|
|
2318
|
+
`Append token '-' must be final segment: ${L(n, r)}`
|
|
2252
2319
|
);
|
|
2253
2320
|
const s = e.getItems();
|
|
2254
|
-
if (s &&
|
|
2255
|
-
const c =
|
|
2321
|
+
if (s && M(t)) {
|
|
2322
|
+
const c = k(t, L(n, r));
|
|
2256
2323
|
if (c < 0 || c >= s.length)
|
|
2257
2324
|
throw new Error(
|
|
2258
|
-
`Array index out of bounds: ${
|
|
2325
|
+
`Array index out of bounds: ${L(n, r)}`
|
|
2259
2326
|
);
|
|
2260
2327
|
const l = s[c];
|
|
2261
2328
|
if (!l)
|
|
2262
2329
|
throw new Error(
|
|
2263
|
-
`Path does not exist: ${
|
|
2330
|
+
`Path does not exist: ${L(n, r)}`
|
|
2264
2331
|
);
|
|
2265
2332
|
return l;
|
|
2266
2333
|
}
|
|
2267
|
-
const o =
|
|
2334
|
+
const o = W(e);
|
|
2268
2335
|
let a = o[t];
|
|
2269
2336
|
return a || (a = new d(), o[t] = a, e.setProperties(o)), a;
|
|
2270
2337
|
}
|
|
@@ -2277,24 +2344,24 @@ class cr {
|
|
|
2277
2344
|
"ADD"
|
|
2278
2345
|
);
|
|
2279
2346
|
try {
|
|
2280
|
-
if (
|
|
2281
|
-
const l = r.getItems(), u = s ===
|
|
2347
|
+
if (M(s)) {
|
|
2348
|
+
const l = r.getItems(), u = s === F;
|
|
2282
2349
|
if (!l)
|
|
2283
2350
|
throw new Error(
|
|
2284
2351
|
u ? `Append token '-' requires array at ${o}` : `Array index segment requires array at ${o}`
|
|
2285
2352
|
);
|
|
2286
2353
|
if (u) {
|
|
2287
|
-
|
|
2354
|
+
te(r, l).push($(n));
|
|
2288
2355
|
return;
|
|
2289
2356
|
}
|
|
2290
|
-
const
|
|
2291
|
-
if (
|
|
2357
|
+
const f = k(s, t);
|
|
2358
|
+
if (f < 0 || f > l.length)
|
|
2292
2359
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2293
|
-
|
|
2360
|
+
te(r, l).splice(f, 0, $(n));
|
|
2294
2361
|
return;
|
|
2295
2362
|
}
|
|
2296
|
-
const c =
|
|
2297
|
-
c[s] =
|
|
2363
|
+
const c = W(r);
|
|
2364
|
+
c[s] = $(n), r.setProperties(c);
|
|
2298
2365
|
} catch (c) {
|
|
2299
2366
|
throw this.rollbackCreated(a), c;
|
|
2300
2367
|
}
|
|
@@ -2308,18 +2375,18 @@ class cr {
|
|
|
2308
2375
|
"REPLACE"
|
|
2309
2376
|
);
|
|
2310
2377
|
try {
|
|
2311
|
-
if (
|
|
2378
|
+
if (M(s)) {
|
|
2312
2379
|
const c = r.getItems();
|
|
2313
2380
|
if (!c)
|
|
2314
2381
|
throw new Error(`Array index segment requires array at ${t}`);
|
|
2315
|
-
const l =
|
|
2382
|
+
const l = k(s, t);
|
|
2316
2383
|
if (l < 0 || l >= c.length)
|
|
2317
2384
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2318
|
-
c[l] =
|
|
2385
|
+
c[l] = $(n), r.setItems(c);
|
|
2319
2386
|
return;
|
|
2320
2387
|
}
|
|
2321
|
-
const a =
|
|
2322
|
-
a[s] =
|
|
2388
|
+
const a = W(r);
|
|
2389
|
+
a[s] = $(n), r.setProperties(a);
|
|
2323
2390
|
} catch (a) {
|
|
2324
2391
|
throw this.rollbackCreated(o), a;
|
|
2325
2392
|
}
|
|
@@ -2332,11 +2399,11 @@ class cr {
|
|
|
2332
2399
|
t,
|
|
2333
2400
|
"REMOVE"
|
|
2334
2401
|
);
|
|
2335
|
-
if (
|
|
2402
|
+
if (M(r)) {
|
|
2336
2403
|
const a = n.getItems();
|
|
2337
2404
|
if (!a)
|
|
2338
2405
|
throw new Error(`Array index segment requires array at ${t}`);
|
|
2339
|
-
const c =
|
|
2406
|
+
const c = k(r, t);
|
|
2340
2407
|
if (c < 0 || c >= a.length)
|
|
2341
2408
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2342
2409
|
a.splice(c, 1), n.setItems(a);
|
|
@@ -2354,27 +2421,27 @@ class cr {
|
|
|
2354
2421
|
let r = this.document;
|
|
2355
2422
|
const s = [];
|
|
2356
2423
|
for (let a = 0; a < e.length - 1; a += 1) {
|
|
2357
|
-
const c = e[a], l =
|
|
2358
|
-
if (
|
|
2359
|
-
const
|
|
2360
|
-
if (!
|
|
2424
|
+
const c = e[a], l = L(e, a + 1);
|
|
2425
|
+
if (M(c)) {
|
|
2426
|
+
const h = r.getItems();
|
|
2427
|
+
if (!h)
|
|
2361
2428
|
throw new Error(`Array index segment requires array at ${l}`);
|
|
2362
|
-
const p =
|
|
2363
|
-
if (p < 0 || p >=
|
|
2429
|
+
const p = k(c, l);
|
|
2430
|
+
if (p < 0 || p >= h.length)
|
|
2364
2431
|
throw new Error(`Array index out of bounds in path: ${l}`);
|
|
2365
|
-
const
|
|
2366
|
-
if (!(
|
|
2432
|
+
const I = h[p];
|
|
2433
|
+
if (!(I instanceof d))
|
|
2367
2434
|
throw new Error(`Array index out of bounds in path: ${l}`);
|
|
2368
|
-
r =
|
|
2435
|
+
r = I;
|
|
2369
2436
|
continue;
|
|
2370
2437
|
}
|
|
2371
|
-
let u = r.getProperties(),
|
|
2372
|
-
if (!(
|
|
2438
|
+
let u = r.getProperties(), f = u?.[c] ?? null;
|
|
2439
|
+
if (!(f instanceof d)) {
|
|
2373
2440
|
if (n === "REMOVE")
|
|
2374
2441
|
throw new Error(`Path does not exist: ${l}`);
|
|
2375
|
-
|
|
2442
|
+
f = new d(), u || (u = {}), u[c] = f, r.setProperties(u), s.push({ owner: r, key: c });
|
|
2376
2443
|
}
|
|
2377
|
-
r =
|
|
2444
|
+
r = f;
|
|
2378
2445
|
}
|
|
2379
2446
|
const o = e[e.length - 1];
|
|
2380
2447
|
return { parent: r, key: o, pointer: t, created: s };
|
|
@@ -2386,7 +2453,7 @@ class cr {
|
|
|
2386
2453
|
}
|
|
2387
2454
|
}
|
|
2388
2455
|
}
|
|
2389
|
-
function
|
|
2456
|
+
function Tr(i) {
|
|
2390
2457
|
const e = [];
|
|
2391
2458
|
let t = i;
|
|
2392
2459
|
for (; e.push(t), t !== "/"; ) {
|
|
@@ -2395,36 +2462,36 @@ function lr(i) {
|
|
|
2395
2462
|
}
|
|
2396
2463
|
return e;
|
|
2397
2464
|
}
|
|
2398
|
-
function
|
|
2465
|
+
function Pe(i, e, t, n) {
|
|
2399
2466
|
try {
|
|
2400
2467
|
if (e.length === 0)
|
|
2401
2468
|
return i.clone();
|
|
2402
|
-
const r =
|
|
2469
|
+
const r = Rr(i, e, t, n);
|
|
2403
2470
|
return r ? r.clone() : null;
|
|
2404
2471
|
} catch {
|
|
2405
2472
|
return null;
|
|
2406
2473
|
}
|
|
2407
2474
|
}
|
|
2408
|
-
function
|
|
2475
|
+
function Rr(i, e, t, n) {
|
|
2409
2476
|
let r = i;
|
|
2410
2477
|
for (let s = 0; s < e.length; s += 1) {
|
|
2411
2478
|
const o = e[s] ?? "", a = s === e.length - 1;
|
|
2412
|
-
if (r =
|
|
2479
|
+
if (r = Pr(r, o, a, t, n), !r)
|
|
2413
2480
|
return null;
|
|
2414
2481
|
}
|
|
2415
2482
|
return r;
|
|
2416
2483
|
}
|
|
2417
|
-
function
|
|
2484
|
+
function Pr(i, e, t, n, r) {
|
|
2418
2485
|
if (!i)
|
|
2419
2486
|
return null;
|
|
2420
2487
|
const s = i.getItems();
|
|
2421
2488
|
if (s) {
|
|
2422
|
-
if (e ===
|
|
2489
|
+
if (e === F) {
|
|
2423
2490
|
if (!t)
|
|
2424
2491
|
throw new Error(`Append token '-' must be final segment: ${r}`);
|
|
2425
2492
|
return n === "before" || s.length === 0 ? null : s[s.length - 1] ?? null;
|
|
2426
2493
|
}
|
|
2427
|
-
const c =
|
|
2494
|
+
const c = k(e, r);
|
|
2428
2495
|
return c < 0 || c >= s.length ? null : s[c] ?? null;
|
|
2429
2496
|
}
|
|
2430
2497
|
const o = i.getProperties();
|
|
@@ -2433,13 +2500,13 @@ function dr(i, e, t, n, r) {
|
|
|
2433
2500
|
const a = o[e];
|
|
2434
2501
|
return a instanceof d ? a : null;
|
|
2435
2502
|
}
|
|
2436
|
-
function
|
|
2503
|
+
function Ne(i) {
|
|
2437
2504
|
if (i === "/" || i === "")
|
|
2438
2505
|
return [];
|
|
2439
2506
|
const e = i.startsWith("/") ? i.slice(1) : i;
|
|
2440
2507
|
return e.length === 0 ? [] : e.split("/");
|
|
2441
2508
|
}
|
|
2442
|
-
function
|
|
2509
|
+
function k(i, e) {
|
|
2443
2510
|
const t = Number.parseInt(i, 10);
|
|
2444
2511
|
if (Number.isNaN(t))
|
|
2445
2512
|
throw new Error(`Expected numeric array index in path: ${e}`);
|
|
@@ -2447,7 +2514,7 @@ function I(i, e) {
|
|
|
2447
2514
|
throw new Error(`Negative array index in path: ${e}`);
|
|
2448
2515
|
return t;
|
|
2449
2516
|
}
|
|
2450
|
-
function
|
|
2517
|
+
function L(i, e) {
|
|
2451
2518
|
if (e <= 0)
|
|
2452
2519
|
return "/";
|
|
2453
2520
|
const t = Math.min(e, i.length);
|
|
@@ -2456,11 +2523,11 @@ function B(i, e) {
|
|
|
2456
2523
|
n += `/${i[r] ?? ""}`;
|
|
2457
2524
|
return n === "" ? "/" : n;
|
|
2458
2525
|
}
|
|
2459
|
-
function
|
|
2526
|
+
function te(i, e) {
|
|
2460
2527
|
const t = [...e];
|
|
2461
2528
|
return i.setItems(t), t;
|
|
2462
2529
|
}
|
|
2463
|
-
function
|
|
2530
|
+
function W(i) {
|
|
2464
2531
|
const e = i.getProperties();
|
|
2465
2532
|
if (!e) {
|
|
2466
2533
|
const n = {};
|
|
@@ -2469,13 +2536,13 @@ function K(i) {
|
|
|
2469
2536
|
const t = { ...e };
|
|
2470
2537
|
return i.setProperties(t), t;
|
|
2471
2538
|
}
|
|
2472
|
-
function
|
|
2473
|
-
return i ===
|
|
2539
|
+
function M(i) {
|
|
2540
|
+
return i === F || /^\d+$/.test(i);
|
|
2474
2541
|
}
|
|
2475
|
-
function
|
|
2542
|
+
function $(i) {
|
|
2476
2543
|
return i == null ? new d().setValue(null) : i.clone();
|
|
2477
2544
|
}
|
|
2478
|
-
class
|
|
2545
|
+
class Nr {
|
|
2479
2546
|
constructor(e) {
|
|
2480
2547
|
this.path = e;
|
|
2481
2548
|
}
|
|
@@ -2537,7 +2604,7 @@ class hr {
|
|
|
2537
2604
|
return this.cutOff;
|
|
2538
2605
|
}
|
|
2539
2606
|
}
|
|
2540
|
-
class
|
|
2607
|
+
class Mr {
|
|
2541
2608
|
scopesMap = /* @__PURE__ */ new Map();
|
|
2542
2609
|
rootEmissionList = [];
|
|
2543
2610
|
scopes() {
|
|
@@ -2545,7 +2612,7 @@ class fr {
|
|
|
2545
2612
|
}
|
|
2546
2613
|
scope(e) {
|
|
2547
2614
|
let t = this.scopesMap.get(e);
|
|
2548
|
-
return t || (t = new
|
|
2615
|
+
return t || (t = new Nr(e), this.scopesMap.set(e, t)), t;
|
|
2549
2616
|
}
|
|
2550
2617
|
existingScope(e) {
|
|
2551
2618
|
return this.scopesMap.get(e);
|
|
@@ -2566,42 +2633,42 @@ class fr {
|
|
|
2566
2633
|
function H(i) {
|
|
2567
2634
|
return Math.floor((i + 99) / 100);
|
|
2568
2635
|
}
|
|
2569
|
-
function
|
|
2636
|
+
function he(i) {
|
|
2570
2637
|
return new TextEncoder().encode(i).length;
|
|
2571
2638
|
}
|
|
2572
|
-
function
|
|
2573
|
-
const e =
|
|
2639
|
+
function Or(i) {
|
|
2640
|
+
const e = S(i);
|
|
2574
2641
|
return e === "/" ? 0 : e.split("/").length - 1;
|
|
2575
2642
|
}
|
|
2576
|
-
function
|
|
2577
|
-
return 100 + H(
|
|
2643
|
+
function Ar(i) {
|
|
2644
|
+
return 100 + H(he(i));
|
|
2578
2645
|
}
|
|
2579
|
-
function
|
|
2646
|
+
function Dr(i) {
|
|
2580
2647
|
return 40 + 5 * Math.max(0, i);
|
|
2581
2648
|
}
|
|
2582
|
-
function
|
|
2583
|
-
return 5 + H(
|
|
2649
|
+
function Br(i) {
|
|
2650
|
+
return 5 + H(he(i));
|
|
2584
2651
|
}
|
|
2585
|
-
function
|
|
2586
|
-
return 3 * Math.max(0, i) + H(
|
|
2652
|
+
function _r(i, e) {
|
|
2653
|
+
return 3 * Math.max(0, i) + H(he(e));
|
|
2587
2654
|
}
|
|
2588
|
-
function
|
|
2589
|
-
return 8 +
|
|
2655
|
+
function Lr(i, e) {
|
|
2656
|
+
return 8 + Or(i) + H(e);
|
|
2590
2657
|
}
|
|
2591
|
-
const
|
|
2592
|
-
function
|
|
2658
|
+
const $r = 1e3, xr = 5, Fr = 50, zr = 2, Ur = 10, Vr = 10, Hr = 10, Kr = 20, Wr = 20, Gr = 30, qr = 30, Jr = 100;
|
|
2659
|
+
function jr(i) {
|
|
2593
2660
|
return 50 + 10 * i;
|
|
2594
2661
|
}
|
|
2595
|
-
function
|
|
2662
|
+
function Qr(i) {
|
|
2596
2663
|
return 20 + i;
|
|
2597
2664
|
}
|
|
2598
|
-
function
|
|
2665
|
+
function Yr(i) {
|
|
2599
2666
|
return 10 * i;
|
|
2600
2667
|
}
|
|
2601
|
-
function
|
|
2668
|
+
function Zr(i) {
|
|
2602
2669
|
return 20 + i;
|
|
2603
2670
|
}
|
|
2604
|
-
class
|
|
2671
|
+
class Xr {
|
|
2605
2672
|
constructor(e) {
|
|
2606
2673
|
this.blue = e;
|
|
2607
2674
|
}
|
|
@@ -2613,73 +2680,73 @@ class _r {
|
|
|
2613
2680
|
this.total += e;
|
|
2614
2681
|
}
|
|
2615
2682
|
chargeScopeEntry(e) {
|
|
2616
|
-
this.add(
|
|
2683
|
+
this.add(jr(this.scopeDepth(e)));
|
|
2617
2684
|
}
|
|
2618
2685
|
chargeInitialization() {
|
|
2619
|
-
this.add(
|
|
2686
|
+
this.add($r);
|
|
2620
2687
|
}
|
|
2621
2688
|
chargeChannelMatchAttempt() {
|
|
2622
|
-
this.add(
|
|
2689
|
+
this.add(xr);
|
|
2623
2690
|
}
|
|
2624
2691
|
chargeHandlerOverhead() {
|
|
2625
|
-
this.add(
|
|
2692
|
+
this.add(Fr);
|
|
2626
2693
|
}
|
|
2627
2694
|
chargeBoundaryCheck() {
|
|
2628
|
-
this.add(
|
|
2695
|
+
this.add(zr);
|
|
2629
2696
|
}
|
|
2630
2697
|
chargePatchAddOrReplace(e) {
|
|
2631
|
-
this.add(
|
|
2698
|
+
this.add(Qr(this.payloadSizeCharge(e)));
|
|
2632
2699
|
}
|
|
2633
2700
|
chargePatchRemove() {
|
|
2634
|
-
this.add(
|
|
2701
|
+
this.add(Ur);
|
|
2635
2702
|
}
|
|
2636
2703
|
chargeCascadeRouting(e) {
|
|
2637
|
-
e > 0 && this.add(
|
|
2704
|
+
e > 0 && this.add(Yr(e));
|
|
2638
2705
|
}
|
|
2639
2706
|
chargeEmitEvent(e) {
|
|
2640
|
-
this.add(
|
|
2707
|
+
this.add(Zr(this.payloadSizeCharge(e)));
|
|
2641
2708
|
}
|
|
2642
2709
|
chargeBridge() {
|
|
2643
|
-
this.add(
|
|
2710
|
+
this.add(Vr);
|
|
2644
2711
|
}
|
|
2645
2712
|
chargeDrainEvent() {
|
|
2646
|
-
this.add(
|
|
2713
|
+
this.add(Hr);
|
|
2647
2714
|
}
|
|
2648
2715
|
chargeCheckpointUpdate() {
|
|
2649
|
-
this.add(
|
|
2716
|
+
this.add(Kr);
|
|
2650
2717
|
}
|
|
2651
2718
|
chargeTerminationMarker() {
|
|
2652
|
-
this.add(
|
|
2719
|
+
this.add(Wr);
|
|
2653
2720
|
}
|
|
2654
2721
|
chargeLifecycleDelivery() {
|
|
2655
|
-
this.add(
|
|
2722
|
+
this.add(Gr);
|
|
2656
2723
|
}
|
|
2657
2724
|
chargeFatalTerminationOverhead() {
|
|
2658
|
-
this.add(
|
|
2725
|
+
this.add(Jr);
|
|
2659
2726
|
}
|
|
2660
2727
|
chargeJavaScriptCodeBase(e) {
|
|
2661
|
-
this.add(
|
|
2728
|
+
this.add(Ar(e));
|
|
2662
2729
|
}
|
|
2663
2730
|
chargeTriggerEventBase() {
|
|
2664
|
-
this.add(
|
|
2731
|
+
this.add(qr);
|
|
2665
2732
|
}
|
|
2666
2733
|
chargeUpdateDocumentBase(e) {
|
|
2667
|
-
this.add(
|
|
2734
|
+
this.add(Dr(e));
|
|
2668
2735
|
}
|
|
2669
2736
|
chargeExpression(e) {
|
|
2670
|
-
this.add(
|
|
2737
|
+
this.add(Br(e));
|
|
2671
2738
|
}
|
|
2672
2739
|
chargeTemplate(e, t) {
|
|
2673
|
-
this.add(
|
|
2740
|
+
this.add(_r(e, t));
|
|
2674
2741
|
}
|
|
2675
2742
|
chargeDocumentSnapshot(e, t) {
|
|
2676
|
-
const n = t ?
|
|
2677
|
-
this.add(
|
|
2743
|
+
const n = t ? Se(this.blue, t) : 0;
|
|
2744
|
+
this.add(Lr(e, n));
|
|
2678
2745
|
}
|
|
2679
2746
|
payloadSizeCharge(e) {
|
|
2680
2747
|
if (!e)
|
|
2681
2748
|
return 0;
|
|
2682
|
-
const t =
|
|
2749
|
+
const t = Se(this.blue, e);
|
|
2683
2750
|
return H(t);
|
|
2684
2751
|
}
|
|
2685
2752
|
scopeDepth(e) {
|
|
@@ -2692,12 +2759,12 @@ class _r {
|
|
|
2692
2759
|
return n;
|
|
2693
2760
|
}
|
|
2694
2761
|
}
|
|
2695
|
-
class
|
|
2762
|
+
class ei {
|
|
2696
2763
|
constructor(e, t) {
|
|
2697
|
-
this.documentRef = e, this.blueRef = t, this.patchEngine = new
|
|
2764
|
+
this.documentRef = e, this.blueRef = t, this.patchEngine = new kr(this.documentRef), this.meter = new Xr(this.blueRef);
|
|
2698
2765
|
}
|
|
2699
2766
|
patchEngine;
|
|
2700
|
-
emissionRegistry = new
|
|
2767
|
+
emissionRegistry = new Mr();
|
|
2701
2768
|
meter;
|
|
2702
2769
|
runTerminated = !1;
|
|
2703
2770
|
document() {
|
|
@@ -2746,15 +2813,15 @@ class $r {
|
|
|
2746
2813
|
return this.patchEngine.applyPatch(e, t);
|
|
2747
2814
|
}
|
|
2748
2815
|
}
|
|
2749
|
-
const
|
|
2750
|
-
class
|
|
2816
|
+
const ti = m["Processing Initialized Marker"], ni = m["Document Update"];
|
|
2817
|
+
class ri {
|
|
2751
2818
|
constructor(e, t, n, r) {
|
|
2752
|
-
this.contractLoader = e, this.registry = t, this.runtimeRef = new
|
|
2753
|
-
const s = (o) =>
|
|
2754
|
-
this.checkpointManager = new
|
|
2819
|
+
this.contractLoader = e, this.registry = t, this.runtimeRef = new ei(r, n);
|
|
2820
|
+
const s = (o) => He(this.runtimeRef.blue(), o);
|
|
2821
|
+
this.checkpointManager = new ur(
|
|
2755
2822
|
this.runtimeRef,
|
|
2756
2823
|
s
|
|
2757
|
-
), this.terminationService = new
|
|
2824
|
+
), this.terminationService = new br(this.runtimeRef), this.channelRunner = new dr(
|
|
2758
2825
|
this.runtimeRef,
|
|
2759
2826
|
this.checkpointManager,
|
|
2760
2827
|
{
|
|
@@ -2781,9 +2848,10 @@ class zr {
|
|
|
2781
2848
|
},
|
|
2782
2849
|
executeHandler: async (o, a) => this.executeHandler(o, a),
|
|
2783
2850
|
handleHandlerError: async (o, a, c) => this.handleHandlerError(o, a, c),
|
|
2784
|
-
canonicalSignature: s
|
|
2851
|
+
canonicalSignature: s,
|
|
2852
|
+
channelProcessorFor: (o) => this.registry.lookupChannel(o) ?? null
|
|
2785
2853
|
}
|
|
2786
|
-
), this.scopeExecutor = new
|
|
2854
|
+
), this.scopeExecutor = new yr({
|
|
2787
2855
|
runtime: this.runtimeRef,
|
|
2788
2856
|
contractLoader: this.contractLoader,
|
|
2789
2857
|
channelRunner: this.channelRunner,
|
|
@@ -2834,7 +2902,7 @@ class zr {
|
|
|
2834
2902
|
);
|
|
2835
2903
|
}
|
|
2836
2904
|
createContext(e, t, n, r = !1, s = !1) {
|
|
2837
|
-
return new
|
|
2905
|
+
return new ii(
|
|
2838
2906
|
this,
|
|
2839
2907
|
t,
|
|
2840
2908
|
e,
|
|
@@ -2845,7 +2913,7 @@ class zr {
|
|
|
2845
2913
|
}
|
|
2846
2914
|
result() {
|
|
2847
2915
|
const e = this.runtimeRef.document().clone(), t = this.runtimeRef.rootEmissions().map((n) => n.clone());
|
|
2848
|
-
return
|
|
2916
|
+
return Oe.of(
|
|
2849
2917
|
e,
|
|
2850
2918
|
t,
|
|
2851
2919
|
this.runtimeRef.totalGas()
|
|
@@ -2906,7 +2974,7 @@ class zr {
|
|
|
2906
2974
|
}
|
|
2907
2975
|
nodeAt(e) {
|
|
2908
2976
|
const t = y(e);
|
|
2909
|
-
return
|
|
2977
|
+
return j.nodeAt(this.runtimeRef.document(), t, {
|
|
2910
2978
|
calculateBlueId: (n) => this.runtimeRef.blue().calculateBlueIdSync(n)
|
|
2911
2979
|
});
|
|
2912
2980
|
}
|
|
@@ -2914,23 +2982,23 @@ class zr {
|
|
|
2914
2982
|
const s = this.registry.lookupChannel(e.blueId());
|
|
2915
2983
|
if (!s)
|
|
2916
2984
|
return { matches: !1 };
|
|
2917
|
-
const o = this.runtimeRef.blue().calculateBlueIdSync(r), a = r.clone(), c =
|
|
2985
|
+
const o = this.runtimeRef.blue().calculateBlueIdSync(r), a = r.clone(), c = e.contract(), l = c.event;
|
|
2986
|
+
if (l && !this.runtimeRef.blue().isTypeOfNode(a, l))
|
|
2987
|
+
return { matches: !1 };
|
|
2988
|
+
const u = {
|
|
2918
2989
|
scopePath: n,
|
|
2919
2990
|
blue: this.runtimeRef.blue(),
|
|
2920
2991
|
event: a,
|
|
2921
2992
|
markers: t.markers(),
|
|
2922
2993
|
bindingKey: e.key()
|
|
2923
2994
|
};
|
|
2924
|
-
if (!await s.matches(
|
|
2925
|
-
e.contract(),
|
|
2926
|
-
c
|
|
2927
|
-
))
|
|
2995
|
+
if (!await s.matches(c, u))
|
|
2928
2996
|
return { matches: !1 };
|
|
2929
|
-
const
|
|
2997
|
+
const h = s.channelize, p = h ? h.call(s, c, u) : void 0;
|
|
2930
2998
|
return {
|
|
2931
2999
|
matches: !0,
|
|
2932
3000
|
eventId: o,
|
|
2933
|
-
eventNode:
|
|
3001
|
+
eventNode: p ?? a.clone()
|
|
2934
3002
|
};
|
|
2935
3003
|
}
|
|
2936
3004
|
async executeHandler(e, t) {
|
|
@@ -2950,7 +3018,7 @@ class zr {
|
|
|
2950
3018
|
* the outer run logic can react according to spec (§22).
|
|
2951
3019
|
*/
|
|
2952
3020
|
async handleHandlerError(e, t, n) {
|
|
2953
|
-
if (n instanceof
|
|
3021
|
+
if (n instanceof J || n instanceof U)
|
|
2954
3022
|
throw n;
|
|
2955
3023
|
const r = this.fatalReason(n, "Runtime fatal");
|
|
2956
3024
|
await this.enterFatalTermination(e, t, r);
|
|
@@ -2959,8 +3027,8 @@ class zr {
|
|
|
2959
3027
|
return e instanceof Error && typeof e.message == "string" ? e.message : t;
|
|
2960
3028
|
}
|
|
2961
3029
|
createDocumentUpdateEvent(e, t) {
|
|
2962
|
-
const n =
|
|
2963
|
-
new d().setBlueId(
|
|
3030
|
+
const n = xt(t, e.path), r = e.before != null ? e.before.clone() : new d().setValue(null), s = e.after != null ? e.after.clone() : new d().setValue(null), o = new d().setType(
|
|
3031
|
+
new d().setBlueId(ni)
|
|
2964
3032
|
);
|
|
2965
3033
|
return o.setProperties({
|
|
2966
3034
|
op: new d().setValue(e.op),
|
|
@@ -2972,17 +3040,17 @@ class zr {
|
|
|
2972
3040
|
matchesDocumentUpdate(e, t, n) {
|
|
2973
3041
|
if (!t || t.length === 0)
|
|
2974
3042
|
return !1;
|
|
2975
|
-
const r =
|
|
3043
|
+
const r = S(w(e, t)), s = S(n);
|
|
2976
3044
|
return r === "/" || s === r ? !0 : s.startsWith(`${r}/`);
|
|
2977
3045
|
}
|
|
2978
3046
|
}
|
|
2979
|
-
class
|
|
3047
|
+
class j {
|
|
2980
3048
|
constructor(e, t, n) {
|
|
2981
3049
|
this.contractLoader = e, this.registry = t, this.blue = n;
|
|
2982
3050
|
}
|
|
2983
3051
|
async initializeDocument(e) {
|
|
2984
3052
|
if (this.isInitialized(e))
|
|
2985
|
-
throw new
|
|
3053
|
+
throw new O("Document already initialized");
|
|
2986
3054
|
const t = this.createExecution(e.clone());
|
|
2987
3055
|
return this.run(e, t, async () => {
|
|
2988
3056
|
await t.initializeScope("/", !0);
|
|
@@ -2990,7 +3058,7 @@ class J {
|
|
|
2990
3058
|
}
|
|
2991
3059
|
async processDocument(e, t) {
|
|
2992
3060
|
if (!this.isInitialized(e))
|
|
2993
|
-
throw new
|
|
3061
|
+
throw new O("Document not initialized");
|
|
2994
3062
|
const n = this.createExecution(e.clone()), r = t.clone();
|
|
2995
3063
|
return this.run(e, n, async () => {
|
|
2996
3064
|
n.loadBundles("/"), await n.processExternalEvent("/", r);
|
|
@@ -3000,7 +3068,7 @@ class J {
|
|
|
3000
3068
|
return this.initializationMarker(e) != null;
|
|
3001
3069
|
}
|
|
3002
3070
|
createExecution(e) {
|
|
3003
|
-
return new
|
|
3071
|
+
return new ri(
|
|
3004
3072
|
this.contractLoader,
|
|
3005
3073
|
this.registry,
|
|
3006
3074
|
this.blue,
|
|
@@ -3011,11 +3079,11 @@ class J {
|
|
|
3011
3079
|
try {
|
|
3012
3080
|
await n();
|
|
3013
3081
|
} catch (r) {
|
|
3014
|
-
if (r instanceof
|
|
3082
|
+
if (r instanceof J)
|
|
3015
3083
|
return t.result();
|
|
3016
|
-
if (r instanceof
|
|
3084
|
+
if (r instanceof U) {
|
|
3017
3085
|
const s = e.clone();
|
|
3018
|
-
return
|
|
3086
|
+
return Oe.capabilityFailure(
|
|
3019
3087
|
s,
|
|
3020
3088
|
r.message ?? null
|
|
3021
3089
|
);
|
|
@@ -3035,7 +3103,7 @@ class J {
|
|
|
3035
3103
|
"Initialization Marker must be a BlueNode"
|
|
3036
3104
|
)
|
|
3037
3105
|
);
|
|
3038
|
-
if (n.getType()?.getBlueId() !==
|
|
3106
|
+
if (n.getType()?.getBlueId() !== ti)
|
|
3039
3107
|
throw new g(
|
|
3040
3108
|
"Initialization Marker must declare type 'Processing Initialized Marker'",
|
|
3041
3109
|
E.illegalState(
|
|
@@ -3047,7 +3115,7 @@ class J {
|
|
|
3047
3115
|
static nodeAt(e, t, n) {
|
|
3048
3116
|
if (!(e instanceof d))
|
|
3049
3117
|
return null;
|
|
3050
|
-
const r =
|
|
3118
|
+
const r = S(t);
|
|
3051
3119
|
if (r === "/")
|
|
3052
3120
|
return e;
|
|
3053
3121
|
const s = r.slice(1).split("/");
|
|
@@ -3059,16 +3127,16 @@ class J {
|
|
|
3059
3127
|
continue;
|
|
3060
3128
|
const c = o.getItems();
|
|
3061
3129
|
if (c && /^\d+$/.test(a)) {
|
|
3062
|
-
const
|
|
3063
|
-
o = c[
|
|
3130
|
+
const f = Number.parseInt(a, 10);
|
|
3131
|
+
o = c[f] ?? null;
|
|
3064
3132
|
continue;
|
|
3065
3133
|
}
|
|
3066
3134
|
const l = o.getProperties();
|
|
3067
3135
|
if (l && a in l) {
|
|
3068
|
-
const
|
|
3069
|
-
if (!(
|
|
3136
|
+
const f = l[a];
|
|
3137
|
+
if (!(f instanceof d))
|
|
3070
3138
|
return null;
|
|
3071
|
-
o =
|
|
3139
|
+
o = f;
|
|
3072
3140
|
continue;
|
|
3073
3141
|
}
|
|
3074
3142
|
const u = this.specialSegmentNode(o, a, n);
|
|
@@ -3101,7 +3169,7 @@ class J {
|
|
|
3101
3169
|
case "contracts":
|
|
3102
3170
|
return new d().setContracts(e.getContracts());
|
|
3103
3171
|
case "blueId": {
|
|
3104
|
-
const r = e.getBlueId() ?? n?.calculateBlueId?.(e) ??
|
|
3172
|
+
const r = e.getBlueId() ?? n?.calculateBlueId?.(e) ?? Et.calculateBlueIdSync(e);
|
|
3105
3173
|
return new d().setValue(r ?? null);
|
|
3106
3174
|
}
|
|
3107
3175
|
default:
|
|
@@ -3109,7 +3177,7 @@ class J {
|
|
|
3109
3177
|
}
|
|
3110
3178
|
}
|
|
3111
3179
|
}
|
|
3112
|
-
class
|
|
3180
|
+
class ii {
|
|
3113
3181
|
constructor(e, t, n, r, s, o) {
|
|
3114
3182
|
this.execution = e, this.bundle = t, this.scopePathValue = n, this.eventNode = r, this.allowTerminatedWork = s, this.allowReservedMutation = o;
|
|
3115
3183
|
}
|
|
@@ -3164,7 +3232,7 @@ class Vr {
|
|
|
3164
3232
|
if (!e)
|
|
3165
3233
|
return !1;
|
|
3166
3234
|
try {
|
|
3167
|
-
return
|
|
3235
|
+
return j.nodeAt(
|
|
3168
3236
|
this.execution.runtime().document(),
|
|
3169
3237
|
e,
|
|
3170
3238
|
{
|
|
@@ -3176,7 +3244,7 @@ class Vr {
|
|
|
3176
3244
|
}
|
|
3177
3245
|
}
|
|
3178
3246
|
documentNodeAt(e) {
|
|
3179
|
-
const t =
|
|
3247
|
+
const t = j.nodeAt(
|
|
3180
3248
|
this.execution.runtime().document(),
|
|
3181
3249
|
e,
|
|
3182
3250
|
{
|
|
@@ -3203,16 +3271,16 @@ class Vr {
|
|
|
3203
3271
|
return !this.allowTerminatedWork && this.execution.isScopeInactive(this.scopePathValue);
|
|
3204
3272
|
}
|
|
3205
3273
|
}
|
|
3206
|
-
const
|
|
3207
|
-
repositories: [
|
|
3274
|
+
const si = new yt({
|
|
3275
|
+
repositories: [pt, Ct, Nt]
|
|
3208
3276
|
});
|
|
3209
|
-
class
|
|
3277
|
+
class oi {
|
|
3210
3278
|
blue;
|
|
3211
3279
|
registryRef;
|
|
3212
3280
|
contractLoaderRef;
|
|
3213
3281
|
engine;
|
|
3214
3282
|
constructor(e) {
|
|
3215
|
-
this.registryRef = e?.registry ??
|
|
3283
|
+
this.registryRef = e?.registry ?? Y.create().registerDefaults().build(), this.blue = e?.blue ?? si, this.contractLoaderRef = new sr(this.registryRef, this.blue), this.engine = new j(
|
|
3216
3284
|
this.contractLoaderRef,
|
|
3217
3285
|
this.registryRef,
|
|
3218
3286
|
this.blue
|
|
@@ -3245,14 +3313,14 @@ class Ur {
|
|
|
3245
3313
|
return this.contractLoaderRef;
|
|
3246
3314
|
}
|
|
3247
3315
|
static builder() {
|
|
3248
|
-
return new
|
|
3316
|
+
return new ai();
|
|
3249
3317
|
}
|
|
3250
3318
|
}
|
|
3251
|
-
class
|
|
3319
|
+
class ai {
|
|
3252
3320
|
contractRegistry;
|
|
3253
3321
|
blueInstance;
|
|
3254
3322
|
constructor() {
|
|
3255
|
-
this.contractRegistry =
|
|
3323
|
+
this.contractRegistry = Y.create().registerDefaults().build();
|
|
3256
3324
|
}
|
|
3257
3325
|
withRegistry(e) {
|
|
3258
3326
|
return this.contractRegistry = e, this;
|
|
@@ -3264,16 +3332,16 @@ class Kr {
|
|
|
3264
3332
|
return this.blueInstance = e, this;
|
|
3265
3333
|
}
|
|
3266
3334
|
build() {
|
|
3267
|
-
return new
|
|
3335
|
+
return new oi({
|
|
3268
3336
|
registry: this.contractRegistry,
|
|
3269
3337
|
blue: this.blueInstance
|
|
3270
3338
|
});
|
|
3271
3339
|
}
|
|
3272
3340
|
}
|
|
3273
|
-
class
|
|
3341
|
+
class tt {
|
|
3274
3342
|
process(e, t) {
|
|
3275
3343
|
const n = t.getValue();
|
|
3276
|
-
if (
|
|
3344
|
+
if (G(n)) {
|
|
3277
3345
|
const r = t.clone();
|
|
3278
3346
|
return r.setValue(n), r.setProperties(void 0), r.setItems(void 0), r.setType(void 0), r;
|
|
3279
3347
|
}
|
|
@@ -3284,118 +3352,123 @@ class Ze {
|
|
|
3284
3352
|
*/
|
|
3285
3353
|
postProcess(e, t) {
|
|
3286
3354
|
const n = t.getValue();
|
|
3287
|
-
if (
|
|
3355
|
+
if (G(n) && e.getValue() !== n && n !== void 0) {
|
|
3288
3356
|
const r = e.clone();
|
|
3289
3357
|
return r.setValue(n), r;
|
|
3290
3358
|
}
|
|
3291
3359
|
return e;
|
|
3292
3360
|
}
|
|
3293
3361
|
}
|
|
3294
|
-
const
|
|
3362
|
+
const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3295
3363
|
__proto__: null,
|
|
3296
|
-
ExpressionPreserver:
|
|
3364
|
+
ExpressionPreserver: tt
|
|
3297
3365
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3298
|
-
function
|
|
3299
|
-
return new
|
|
3300
|
-
new
|
|
3301
|
-
new
|
|
3302
|
-
new
|
|
3303
|
-
new
|
|
3304
|
-
new
|
|
3305
|
-
new
|
|
3366
|
+
function Mi() {
|
|
3367
|
+
return new P.SequentialMergingProcessor([
|
|
3368
|
+
new P.ValuePropagator(),
|
|
3369
|
+
new tt(),
|
|
3370
|
+
new P.TypeAssigner(),
|
|
3371
|
+
new P.ListProcessor(),
|
|
3372
|
+
new P.DictionaryProcessor(),
|
|
3373
|
+
new P.BasicTypesVerifier()
|
|
3306
3374
|
]);
|
|
3307
3375
|
}
|
|
3308
3376
|
export {
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3377
|
+
Vn as ChannelBinding,
|
|
3378
|
+
dr as ChannelRunner,
|
|
3379
|
+
ur as CheckpointManager,
|
|
3380
|
+
lr as CheckpointRecord,
|
|
3381
|
+
We as CodeBlockEvaluationError,
|
|
3382
|
+
A as ContractBundle,
|
|
3383
|
+
Kn as ContractBundleBuilder,
|
|
3384
|
+
sr as ContractLoader,
|
|
3385
|
+
Cn as ContractProcessorRegistry,
|
|
3386
|
+
Y as ContractProcessorRegistryBuilder,
|
|
3387
|
+
Oe as DocumentProcessingResult,
|
|
3388
|
+
ei as DocumentProcessingRuntime,
|
|
3389
|
+
oi as DocumentProcessor,
|
|
3390
|
+
ai as DocumentProcessorBuilder,
|
|
3391
|
+
Mr as EmissionRegistry,
|
|
3392
|
+
Xr as GasMeter,
|
|
3393
|
+
Hn as HandlerBinding,
|
|
3394
|
+
T as KEY_CHECKPOINT,
|
|
3327
3395
|
Ae as KEY_EMBEDDED,
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3396
|
+
De as KEY_INITIALIZED,
|
|
3397
|
+
Be as KEY_TERMINATED,
|
|
3398
|
+
Ni as MergingProcessors,
|
|
3399
|
+
_e as PROCESSOR_MANAGED_CHANNEL_BLUE_IDS,
|
|
3400
|
+
kr as PatchEngine,
|
|
3401
|
+
vi as ProcessorContractConstants,
|
|
3402
|
+
j as ProcessorEngine,
|
|
3335
3403
|
E as ProcessorErrors,
|
|
3336
|
-
|
|
3337
|
-
|
|
3404
|
+
ri as ProcessorExecution,
|
|
3405
|
+
ii as ProcessorExecutionContext,
|
|
3338
3406
|
g as ProcessorFatalError,
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
Je as
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3407
|
+
ki as ProcessorPointerConstants,
|
|
3408
|
+
ce as QuickJSEvaluator,
|
|
3409
|
+
$e as RELATIVE_CHECKPOINT,
|
|
3410
|
+
B as RELATIVE_CONTRACTS,
|
|
3411
|
+
$t as RELATIVE_EMBEDDED,
|
|
3412
|
+
ie as RELATIVE_INITIALIZED,
|
|
3413
|
+
Le as RELATIVE_TERMINATED,
|
|
3414
|
+
oe as RESERVED_CONTRACT_KEYS,
|
|
3415
|
+
J as RunTerminationError,
|
|
3416
|
+
yr as ScopeExecutor,
|
|
3417
|
+
Nr as ScopeRuntimeContext,
|
|
3418
|
+
br as TerminationService,
|
|
3419
|
+
Si as andThen,
|
|
3420
|
+
He as canonicalSignature,
|
|
3421
|
+
Se as canonicalSize,
|
|
3422
|
+
_ as channelContractBaseSchema,
|
|
3423
|
+
ln as channelEventCheckpointSchema,
|
|
3424
|
+
Zt as containsExpression,
|
|
3425
|
+
le as contractBaseSchema,
|
|
3426
|
+
Mi as createDefaultMergingProcessor,
|
|
3427
|
+
je as createPicomatchShouldResolve,
|
|
3428
|
+
pn as documentAnchorsMarkerSchema,
|
|
3429
|
+
mn as documentLinksMarkerSchema,
|
|
3430
|
+
nn as documentUpdateChannelSchema,
|
|
3431
|
+
rn as embeddedNodeChannelSchema,
|
|
3432
|
+
Ot as err,
|
|
3433
|
+
Je as evaluateQuickJSExpression,
|
|
3434
|
+
Xt as extractExpressionContent,
|
|
3435
|
+
Qe as handlerContractBaseSchema,
|
|
3436
|
+
un as initializationMarkerSchema,
|
|
3437
|
+
Ei as isErr,
|
|
3438
|
+
G as isExpression,
|
|
3439
|
+
gi as isOk,
|
|
3440
|
+
ae as isProcessorManagedChannelBlueId,
|
|
3441
|
+
Lt as isReservedContractKey,
|
|
3442
|
+
Ti as joinRelativePointers,
|
|
3443
|
+
Ri as jsonPatchSchema,
|
|
3444
|
+
sn as lifecycleChannelSchema,
|
|
3445
|
+
yi as map,
|
|
3446
|
+
wi as mapErr,
|
|
3447
|
+
C as markerContractBaseSchema,
|
|
3448
|
+
Ii as match,
|
|
3449
|
+
gn as myosParticipantsOrchestrationMarkerSchema,
|
|
3450
|
+
En as myosSessionInteractionMarkerSchema,
|
|
3451
|
+
cn as myosTimelineChannelSchema,
|
|
3452
|
+
yn as myosWorkerAgencyMarkerSchema,
|
|
3453
|
+
S as normalizePointer,
|
|
3381
3454
|
y as normalizeScope,
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3455
|
+
Mt as ok,
|
|
3456
|
+
fn as operationMarkerSchema,
|
|
3457
|
+
dn as processEmbeddedMarkerSchema,
|
|
3458
|
+
hn as processingTerminatedMarkerSchema,
|
|
3459
|
+
ze as relativeCheckpointLastEvent,
|
|
3460
|
+
Ue as relativeCheckpointLastSignature,
|
|
3461
|
+
Q as relativeContractsEntry,
|
|
3462
|
+
xt as relativizePointer,
|
|
3463
|
+
q as resolveNodeExpressions,
|
|
3391
3464
|
w as resolvePointer,
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3465
|
+
en as resolveTemplateString,
|
|
3466
|
+
Sn as sequentialWorkflowOperationSchema,
|
|
3467
|
+
wn as sequentialWorkflowSchema,
|
|
3468
|
+
Pi as sequentialWorkflowStepSchema,
|
|
3469
|
+
ye as stripSlashes,
|
|
3470
|
+
an as timelineChannelSchema,
|
|
3471
|
+
on as triggeredEventChannelSchema,
|
|
3472
|
+
bi as unwrapOr,
|
|
3473
|
+
Ci as unwrapOrElse
|
|
3401
3474
|
};
|