@blue-labs/document-processor 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine/channel-runner.d.ts +1 -1
- package/dist/engine/channel-runner.d.ts.map +1 -1
- package/dist/engine/composite-channel-validation.d.ts +0 -1
- package/dist/engine/composite-channel-validation.d.ts.map +1 -1
- package/dist/engine/contract-bundle.d.ts +4 -2
- package/dist/engine/contract-bundle.d.ts.map +1 -1
- package/dist/engine/contract-loader.d.ts.map +1 -1
- package/dist/engine/handler-registration-service.d.ts.map +1 -1
- package/dist/engine/processor-engine.d.ts +2 -0
- package/dist/engine/processor-engine.d.ts.map +1 -1
- package/dist/engine/scope-executor.d.ts +2 -0
- package/dist/engine/scope-executor.d.ts.map +1 -1
- package/dist/index.js +654 -545
- package/dist/merge/utils/default.d.ts.map +1 -1
- package/dist/registry/contract-processor-registry.d.ts +7 -0
- package/dist/registry/contract-processor-registry.d.ts.map +1 -1
- package/dist/registry/processors/workflow/operation-matcher.d.ts.map +1 -1
- package/dist/registry/types.d.ts +2 -2
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/types/channel-contract-entry.d.ts +2 -0
- package/dist/types/channel-contract-entry.d.ts.map +1 -1
- package/dist/util/schema-match.d.ts +4 -0
- package/dist/util/schema-match.d.ts.map +1 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { evaluate as wt } from "@blue-quickjs/quickjs-runtime";
|
|
2
|
-
import { validateDv as
|
|
3
|
-
import { HOST_V1_MANIFEST as
|
|
4
|
-
import { BlueNode as p, withTypeBlueId as g, blueNodeField as
|
|
5
|
-
import
|
|
6
|
-
import { z as l, ZodError as
|
|
7
|
-
import { isNullable as
|
|
8
|
-
import { repository as
|
|
2
|
+
import { validateDv as bt, DV_LIMIT_DEFAULTS as kt } from "@blue-quickjs/dv";
|
|
3
|
+
import { HOST_V1_MANIFEST as It, HOST_V1_HASH as Tt } from "@blue-quickjs/abi-manifest";
|
|
4
|
+
import { BlueNode as p, withTypeBlueId as g, blueNodeField as k, Properties as Te, BlueIdCalculator as Pt, Blue as Mt, MergingProcessors as B } from "@blue-labs/language";
|
|
5
|
+
import Pe from "picomatch";
|
|
6
|
+
import { z as l, ZodError as Ee } from "zod";
|
|
7
|
+
import { isNullable as de } from "@blue-labs/shared-utils";
|
|
8
|
+
import { repository as Rt } from "@blue-repository/types";
|
|
9
9
|
function Nt(i) {
|
|
10
10
|
return { ok: !0, value: i };
|
|
11
11
|
}
|
|
12
12
|
function Ot(i) {
|
|
13
13
|
return { ok: !1, error: i };
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Qi(i) {
|
|
16
16
|
return i.ok;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Xi(i) {
|
|
19
19
|
return !i.ok;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Yi(i, e) {
|
|
22
22
|
return i.ok ? Nt(e(i.value)) : i;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Zi(i, e) {
|
|
25
25
|
return i.ok ? i : Ot(e(i.error));
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function eo(i, e) {
|
|
28
28
|
return i.ok ? e(i.value) : i;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function to(i, e) {
|
|
31
31
|
return i.ok ? i.value : e;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function no(i, e) {
|
|
34
34
|
return i.ok ? i.value : e(i.error);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function ro(i, e) {
|
|
37
37
|
return i.ok ? e.ok(i.value) : e.err(i.error);
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const v = {
|
|
40
40
|
capabilityFailure(i, e, t) {
|
|
41
41
|
return { kind: "CapabilityFailure", capability: i, reason: e, details: t };
|
|
42
42
|
},
|
|
@@ -105,58 +105,58 @@ const Dt = {
|
|
|
105
105
|
m["Core/Triggered Event Channel"],
|
|
106
106
|
m["Core/Lifecycle Event Channel"],
|
|
107
107
|
m["Core/Embedded Node Channel"]
|
|
108
|
-
], We = "embedded", Ge = "initialized", qe = "terminated", A = "checkpoint",
|
|
108
|
+
], We = "embedded", Ge = "initialized", qe = "terminated", A = "checkpoint", ye = new Set(
|
|
109
109
|
Bt
|
|
110
|
-
),
|
|
110
|
+
), Ce = new Set(xt);
|
|
111
111
|
function _t(i) {
|
|
112
|
-
return i != null &&
|
|
112
|
+
return i != null && ye.has(i);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return i != null &&
|
|
114
|
+
function je(i) {
|
|
115
|
+
return i != null && Ce.has(
|
|
116
116
|
i
|
|
117
117
|
);
|
|
118
118
|
}
|
|
119
|
-
const
|
|
119
|
+
const io = {
|
|
120
120
|
KEY_EMBEDDED: We,
|
|
121
121
|
KEY_INITIALIZED: Ge,
|
|
122
122
|
KEY_TERMINATED: qe,
|
|
123
123
|
KEY_CHECKPOINT: A,
|
|
124
|
-
RESERVED_CONTRACT_KEYS:
|
|
125
|
-
PROCESSOR_MANAGED_CHANNEL_BLUE_IDS:
|
|
124
|
+
RESERVED_CONTRACT_KEYS: ye,
|
|
125
|
+
PROCESSOR_MANAGED_CHANNEL_BLUE_IDS: Ce,
|
|
126
126
|
isReservedContractKey: _t,
|
|
127
|
-
isProcessorManagedChannelBlueId:
|
|
128
|
-
},
|
|
129
|
-
function
|
|
130
|
-
return `${
|
|
127
|
+
isProcessorManagedChannelBlueId: je
|
|
128
|
+
}, V = "/contracts", pe = `${V}/${Ge}`, Je = `${V}/${qe}`, Lt = `${V}/${We}`, Qe = `${V}/${A}`, Xe = "/lastEvents", Ye = "/lastSignatures";
|
|
129
|
+
function ie(i) {
|
|
130
|
+
return `${V}/${i}`;
|
|
131
131
|
}
|
|
132
132
|
function Ze(i, e) {
|
|
133
|
-
return `${
|
|
133
|
+
return `${ie(i)}${Xe}/${e}`;
|
|
134
134
|
}
|
|
135
135
|
function et(i, e) {
|
|
136
|
-
return `${
|
|
136
|
+
return `${ie(i)}${Ye}/${e}`;
|
|
137
137
|
}
|
|
138
|
-
const
|
|
139
|
-
RELATIVE_CONTRACTS:
|
|
140
|
-
RELATIVE_INITIALIZED:
|
|
138
|
+
const oo = {
|
|
139
|
+
RELATIVE_CONTRACTS: V,
|
|
140
|
+
RELATIVE_INITIALIZED: pe,
|
|
141
141
|
RELATIVE_TERMINATED: Je,
|
|
142
142
|
RELATIVE_EMBEDDED: Lt,
|
|
143
143
|
RELATIVE_CHECKPOINT: Qe,
|
|
144
144
|
LAST_EVENTS_SUFFIX: Xe,
|
|
145
145
|
LAST_SIGNATURES_SUFFIX: Ye,
|
|
146
|
-
relativeContractsEntry:
|
|
146
|
+
relativeContractsEntry: ie,
|
|
147
147
|
relativeCheckpointLastEvent: Ze,
|
|
148
148
|
relativeCheckpointLastSignature: et
|
|
149
149
|
};
|
|
150
150
|
function tt(i) {
|
|
151
151
|
return i == null || i.length === 0;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function b(i) {
|
|
154
154
|
return tt(i) ? "/" : i.startsWith("/") ? i : `/${i}`;
|
|
155
155
|
}
|
|
156
156
|
function P(i) {
|
|
157
157
|
return tt(i) ? "/" : i.startsWith("/") ? i : `/${i}`;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Me(i) {
|
|
160
160
|
if (i == null)
|
|
161
161
|
return "";
|
|
162
162
|
let e = i.trim();
|
|
@@ -168,16 +168,16 @@ function Pe(i) {
|
|
|
168
168
|
e = e.substring(0, e.length - 1);
|
|
169
169
|
return e;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
const t =
|
|
171
|
+
function so(i, e) {
|
|
172
|
+
const t = Me(i), n = Me(e);
|
|
173
173
|
return t.length === 0 && n.length === 0 ? "/" : t.length === 0 ? `/${n}` : n.length === 0 ? `/${t}` : `/${t}/${n}`;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
const t =
|
|
175
|
+
function T(i, e) {
|
|
176
|
+
const t = b(i), n = P(e);
|
|
177
177
|
return t === "/" ? n : n === "/" || n.length === 1 ? t : `${t}${n}`;
|
|
178
178
|
}
|
|
179
179
|
function Ft(i, e) {
|
|
180
|
-
const t =
|
|
180
|
+
const t = b(i), n = P(e);
|
|
181
181
|
if (t === "/" || !n.startsWith(t))
|
|
182
182
|
return n;
|
|
183
183
|
if (n.length === t.length)
|
|
@@ -188,9 +188,9 @@ function Ft(i, e) {
|
|
|
188
188
|
function Ut(i) {
|
|
189
189
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
190
190
|
}
|
|
191
|
-
var
|
|
191
|
+
var ce, Re;
|
|
192
192
|
function $t() {
|
|
193
|
-
return Re || (Re = 1,
|
|
193
|
+
return Re || (Re = 1, ce = function i(e) {
|
|
194
194
|
if (typeof e == "number" && isNaN(e))
|
|
195
195
|
throw new Error("NaN is not allowed");
|
|
196
196
|
if (typeof e == "number" && !isFinite(e))
|
|
@@ -201,25 +201,25 @@ function $t() {
|
|
|
201
201
|
const o = n.length === 0 ? "" : ",";
|
|
202
202
|
return `${n}${o}${i(r)}:${i(e[r])}`;
|
|
203
203
|
}, "")}}`;
|
|
204
|
-
}),
|
|
204
|
+
}), ce;
|
|
205
205
|
}
|
|
206
206
|
var zt = $t();
|
|
207
|
-
const
|
|
208
|
-
function
|
|
207
|
+
const Ht = /* @__PURE__ */ Ut(zt);
|
|
208
|
+
function Vt(i, e) {
|
|
209
209
|
return i.nodeToJson(e, "official");
|
|
210
210
|
}
|
|
211
211
|
function Kt(i, e) {
|
|
212
|
-
const t =
|
|
213
|
-
return
|
|
212
|
+
const t = Vt(i, e);
|
|
213
|
+
return Ht(t);
|
|
214
214
|
}
|
|
215
215
|
function nt(i, e) {
|
|
216
216
|
return e ? Kt(i, e) : null;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Ne(i, e) {
|
|
219
219
|
const t = nt(i, e);
|
|
220
220
|
return t == null ? 0 : new TextEncoder().encode(t).length;
|
|
221
221
|
}
|
|
222
|
-
const Wt = 1700,
|
|
222
|
+
const Wt = 1700, fe = BigInt(
|
|
223
223
|
Wt
|
|
224
224
|
), Gt = BigInt(Number.MAX_SAFE_INTEGER), qt = 4e4, jt = 4e4;
|
|
225
225
|
function Jt(i) {
|
|
@@ -233,12 +233,12 @@ function Jt(i) {
|
|
|
233
233
|
}
|
|
234
234
|
if (e <= 0n)
|
|
235
235
|
return 0;
|
|
236
|
-
const t = (e +
|
|
236
|
+
const t = (e + fe - 1n) / fe;
|
|
237
237
|
return t > Gt ? Number.MAX_SAFE_INTEGER : Number(t);
|
|
238
238
|
}
|
|
239
239
|
function rt(i) {
|
|
240
240
|
const e = BigInt(Math.max(0, Math.trunc(i)));
|
|
241
|
-
return e <= 0n ? 0n : e *
|
|
241
|
+
return e <= 0n ? 0n : e * fe;
|
|
242
242
|
}
|
|
243
243
|
const it = rt(
|
|
244
244
|
qt
|
|
@@ -253,7 +253,7 @@ const it = rt(
|
|
|
253
253
|
"currentContract",
|
|
254
254
|
"currentContractCanonical"
|
|
255
255
|
]);
|
|
256
|
-
class
|
|
256
|
+
class ve {
|
|
257
257
|
// Serialize evaluations to avoid races when updating host handler bindings.
|
|
258
258
|
evaluationQueue = Promise.resolve();
|
|
259
259
|
handlerState = {
|
|
@@ -287,14 +287,14 @@ class Ce {
|
|
|
287
287
|
code: this.wrapCode(e),
|
|
288
288
|
abiId: "Host.v1",
|
|
289
289
|
abiVersion: 1,
|
|
290
|
-
abiManifestHash:
|
|
290
|
+
abiManifestHash: Tt
|
|
291
291
|
};
|
|
292
292
|
try {
|
|
293
293
|
const c = await wt({
|
|
294
294
|
program: a,
|
|
295
295
|
input: o,
|
|
296
296
|
gasLimit: s,
|
|
297
|
-
manifest:
|
|
297
|
+
manifest: It,
|
|
298
298
|
handlers: this.handlers
|
|
299
299
|
});
|
|
300
300
|
if (n !== void 0 && r && r({
|
|
@@ -302,7 +302,7 @@ class Ce {
|
|
|
302
302
|
remaining: c.gasRemaining
|
|
303
303
|
}), !c.ok)
|
|
304
304
|
throw en(c);
|
|
305
|
-
return
|
|
305
|
+
return Z(c.value);
|
|
306
306
|
} catch (c) {
|
|
307
307
|
throw tn(c);
|
|
308
308
|
}
|
|
@@ -329,7 +329,7 @@ class Ce {
|
|
|
329
329
|
currentContract: s,
|
|
330
330
|
currentContractCanonical: a
|
|
331
331
|
}, u = this.extractDocumentBinding(t), h = typeof u?.canonical == "function" ? u.canonical : void 0;
|
|
332
|
-
this.handlerState.documentGet =
|
|
332
|
+
this.handlerState.documentGet = Oe(u), this.handlerState.documentGetCanonical = Oe(
|
|
333
333
|
h ?? u
|
|
334
334
|
);
|
|
335
335
|
const d = this.extractEmitBinding(t);
|
|
@@ -371,7 +371,7 @@ function Yt(i) {
|
|
|
371
371
|
function W(i, e, t) {
|
|
372
372
|
const n = i === void 0 ? e : i;
|
|
373
373
|
try {
|
|
374
|
-
|
|
374
|
+
bt(n, { limits: kt });
|
|
375
375
|
} catch (r) {
|
|
376
376
|
const o = r instanceof Error ? r.message : String(r);
|
|
377
377
|
throw new TypeError(
|
|
@@ -380,7 +380,7 @@ function W(i, e, t) {
|
|
|
380
380
|
}
|
|
381
381
|
return n;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Oe(i) {
|
|
384
384
|
return i ? (e) => {
|
|
385
385
|
try {
|
|
386
386
|
const t = i(e);
|
|
@@ -399,7 +399,7 @@ function Ne(i) {
|
|
|
399
399
|
function Zt(i) {
|
|
400
400
|
return i ? (e) => {
|
|
401
401
|
try {
|
|
402
|
-
if (i(
|
|
402
|
+
if (i(Z(e)) instanceof Promise)
|
|
403
403
|
throw new Error("Async emit handlers are not supported");
|
|
404
404
|
return { ok: null, units: O };
|
|
405
405
|
} catch {
|
|
@@ -410,18 +410,18 @@ function Zt(i) {
|
|
|
410
410
|
}
|
|
411
411
|
} : () => ({ ok: null, units: O });
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function Z(i) {
|
|
414
414
|
if (i == null)
|
|
415
415
|
return i;
|
|
416
416
|
if (Array.isArray(i))
|
|
417
|
-
return i.map((e) =>
|
|
417
|
+
return i.map((e) => Z(e));
|
|
418
418
|
if (typeof i == "object") {
|
|
419
419
|
const e = Object.getPrototypeOf(i);
|
|
420
420
|
if (e !== Object.prototype && e !== null)
|
|
421
421
|
return i;
|
|
422
422
|
const t = {};
|
|
423
423
|
for (const [n, r] of Object.entries(i))
|
|
424
|
-
t[n] =
|
|
424
|
+
t[n] = Z(r);
|
|
425
425
|
return t;
|
|
426
426
|
}
|
|
427
427
|
return i;
|
|
@@ -446,9 +446,9 @@ function en(i) {
|
|
|
446
446
|
function tn(i) {
|
|
447
447
|
return i instanceof Error ? i : new Error(String(i ?? "Unknown error"));
|
|
448
448
|
}
|
|
449
|
-
const
|
|
449
|
+
const Ae = 120;
|
|
450
450
|
function nn(i) {
|
|
451
|
-
return i.length <=
|
|
451
|
+
return i.length <= Ae ? i : `${i.slice(0, Ae - 3)}...`;
|
|
452
452
|
}
|
|
453
453
|
class ot extends Error {
|
|
454
454
|
constructor(e, t) {
|
|
@@ -456,7 +456,7 @@ class ot extends Error {
|
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
const st = /^\$\{([\s\S]*)\}$/, rn = /\$\{([\s\S]+?)\}/, on = /\$\{([\s\S]+?)\}/g;
|
|
459
|
-
function
|
|
459
|
+
function ee(i) {
|
|
460
460
|
if (typeof i != "string" || !st.test(i))
|
|
461
461
|
return !1;
|
|
462
462
|
const e = i.indexOf("${"), t = i.lastIndexOf("${");
|
|
@@ -466,7 +466,7 @@ function sn(i) {
|
|
|
466
466
|
return typeof i != "string" ? !1 : st.test(i) ? !0 : rn.test(i);
|
|
467
467
|
}
|
|
468
468
|
function an(i) {
|
|
469
|
-
if (!
|
|
469
|
+
if (!ee(i))
|
|
470
470
|
throw new Error(`Invalid expression: ${i}`);
|
|
471
471
|
return i.slice(2, -1);
|
|
472
472
|
}
|
|
@@ -505,13 +505,13 @@ function ct({
|
|
|
505
505
|
options: t
|
|
506
506
|
}) {
|
|
507
507
|
const n = { dot: !0, ...t ?? {} }, r = i.map(
|
|
508
|
-
(s) =>
|
|
508
|
+
(s) => Pe(s, n)
|
|
509
509
|
), o = e.map(
|
|
510
|
-
(s) =>
|
|
510
|
+
(s) => Pe(s, n)
|
|
511
511
|
);
|
|
512
512
|
return (s) => r.some((a) => a(s)) && !o.some((a) => a(s));
|
|
513
513
|
}
|
|
514
|
-
async function
|
|
514
|
+
async function te(i) {
|
|
515
515
|
const {
|
|
516
516
|
evaluator: e,
|
|
517
517
|
node: t,
|
|
@@ -530,7 +530,7 @@ async function ee(i) {
|
|
|
530
530
|
const d = h.getValue();
|
|
531
531
|
if (d !== void 0) {
|
|
532
532
|
if (typeof d == "string" && r(a)) {
|
|
533
|
-
if (
|
|
533
|
+
if (ee(d)) {
|
|
534
534
|
const E = an(d), C = await at(
|
|
535
535
|
e,
|
|
536
536
|
E,
|
|
@@ -552,14 +552,14 @@ async function ee(i) {
|
|
|
552
552
|
}
|
|
553
553
|
return h;
|
|
554
554
|
}
|
|
555
|
-
const
|
|
556
|
-
if (Array.isArray(
|
|
555
|
+
const S = h.getItems?.();
|
|
556
|
+
if (Array.isArray(S)) {
|
|
557
557
|
const E = await Promise.all(
|
|
558
|
-
|
|
559
|
-
(C,
|
|
558
|
+
S.map(
|
|
559
|
+
(C, M) => te({
|
|
560
560
|
...i,
|
|
561
561
|
node: C,
|
|
562
|
-
pointer: `${a}/${
|
|
562
|
+
pointer: `${a}/${M}`
|
|
563
563
|
})
|
|
564
564
|
)
|
|
565
565
|
);
|
|
@@ -568,11 +568,11 @@ async function ee(i) {
|
|
|
568
568
|
const f = h.getProperties?.();
|
|
569
569
|
if (f) {
|
|
570
570
|
const E = {};
|
|
571
|
-
for (const [C,
|
|
571
|
+
for (const [C, M] of Object.entries(f)) {
|
|
572
572
|
const D = a === "/" ? `/${C}` : `${a}/${C}`;
|
|
573
|
-
E[C] = await
|
|
573
|
+
E[C] = await te({
|
|
574
574
|
...i,
|
|
575
|
-
node:
|
|
575
|
+
node: M,
|
|
576
576
|
pointer: D
|
|
577
577
|
});
|
|
578
578
|
}
|
|
@@ -580,32 +580,32 @@ async function ee(i) {
|
|
|
580
580
|
}
|
|
581
581
|
return h;
|
|
582
582
|
}
|
|
583
|
-
const
|
|
583
|
+
const oe = g(m["Core/Contract"])(l.object({
|
|
584
584
|
description: l.string().optional(),
|
|
585
585
|
name: l.string().optional(),
|
|
586
586
|
order: l.number().optional()
|
|
587
|
-
})), Se =
|
|
587
|
+
})), Se = oe, _ = g(m["Core/Channel"])(oe.extend({
|
|
588
588
|
description: l.string().optional(),
|
|
589
|
-
event:
|
|
589
|
+
event: k().optional(),
|
|
590
590
|
name: l.string().optional()
|
|
591
|
-
})),
|
|
591
|
+
})), L = _.merge(
|
|
592
592
|
Se
|
|
593
593
|
).extend({
|
|
594
594
|
path: l.string().optional(),
|
|
595
|
-
definition:
|
|
596
|
-
}), lt = g(m["Core/Handler"])(
|
|
595
|
+
definition: k().optional()
|
|
596
|
+
}), lt = g(m["Core/Handler"])(oe.extend({
|
|
597
597
|
channel: l.string().optional(),
|
|
598
598
|
description: l.string().optional(),
|
|
599
|
-
event:
|
|
599
|
+
event: k().optional(),
|
|
600
600
|
name: l.string().optional()
|
|
601
|
-
})), ut = lt.merge(Se), K = g(m["Core/Marker"])(
|
|
601
|
+
})), ut = lt.merge(Se), K = g(m["Core/Marker"])(oe.extend({
|
|
602
602
|
description: l.string().optional(),
|
|
603
603
|
name: l.string().optional()
|
|
604
604
|
})), N = K.merge(Se), ln = l.object({
|
|
605
605
|
op: l.enum(["ADD", "REPLACE", "REMOVE"]),
|
|
606
606
|
path: l.string(),
|
|
607
|
-
val:
|
|
608
|
-
}),
|
|
607
|
+
val: k().optional()
|
|
608
|
+
}), ao = g("JsonPatch")(
|
|
609
609
|
ln
|
|
610
610
|
).superRefine((i, e) => {
|
|
611
611
|
i.op === "REMOVE" && i.val !== void 0 && e.addIssue({
|
|
@@ -617,27 +617,27 @@ const ie = g(m["Core/Contract"])(l.object({
|
|
|
617
617
|
message: `${i.op} operations must include a value`,
|
|
618
618
|
path: ["val"]
|
|
619
619
|
});
|
|
620
|
-
}), un = g(m["Core/Document Update Channel"])(
|
|
620
|
+
}), un = g(m["Core/Document Update Channel"])(_.extend({
|
|
621
621
|
description: l.string().optional(),
|
|
622
622
|
name: l.string().optional(),
|
|
623
623
|
path: l.string().optional()
|
|
624
624
|
})), hn = un.merge(
|
|
625
|
-
|
|
626
|
-
), dn = g(m["Core/Embedded Node Channel"])(
|
|
625
|
+
L
|
|
626
|
+
), dn = g(m["Core/Embedded Node Channel"])(_.extend({
|
|
627
627
|
childPath: l.string().optional(),
|
|
628
628
|
description: l.string().optional(),
|
|
629
629
|
name: l.string().optional()
|
|
630
630
|
})), pn = dn.merge(
|
|
631
|
-
|
|
632
|
-
), fn = g(m["Core/Lifecycle Event Channel"])(
|
|
631
|
+
L
|
|
632
|
+
), fn = g(m["Core/Lifecycle Event Channel"])(_.extend({
|
|
633
633
|
description: l.string().optional(),
|
|
634
634
|
name: l.string().optional()
|
|
635
635
|
})), mn = fn.merge(
|
|
636
|
-
|
|
637
|
-
), gn = g(m["Core/Triggered Event Channel"])(
|
|
636
|
+
L
|
|
637
|
+
), gn = g(m["Core/Triggered Event Channel"])(_.extend({
|
|
638
638
|
description: l.string().optional(),
|
|
639
639
|
name: l.string().optional()
|
|
640
|
-
})), En = gn.merge(
|
|
640
|
+
})), En = gn.merge(L), w = {
|
|
641
641
|
"Conversation/Actor": "CN5efWVizJbRsMCw8YWRfT2q9vM9XfeGDN9wFvYcvMnQ",
|
|
642
642
|
"Conversation/Composite Timeline Channel": "HsNatiPt2YvmkWQoqtfrFCbdp75ZUBLBUkWeq84WTfnr",
|
|
643
643
|
"Conversation/JavaScript Code": "3hYcmWMtMUPAzXBLFLb7BpuG9537tuTJPCr7pxWXvTZK",
|
|
@@ -651,13 +651,13 @@ const ie = g(m["Core/Contract"])(l.object({
|
|
|
651
651
|
"Conversation/Timeline Entry": "EzDiC9Frs8V5yQBMtDYh1DobVnWtWpFemXDX5fGUULBn",
|
|
652
652
|
"Conversation/Trigger Event": "GxUtWr3eH9a6YQeioQkujEnsPjD5s9RU8ZhEfmsV1vuU",
|
|
653
653
|
"Conversation/Update Document": "BnnNLCnKF49TUJ1bRfZ5rSMaFw8SVfUNfnE4kJFG7HtM"
|
|
654
|
-
}, ht = g(w["Conversation/Timeline Channel"])(
|
|
654
|
+
}, ht = g(w["Conversation/Timeline Channel"])(_.extend({
|
|
655
655
|
description: l.string().optional(),
|
|
656
656
|
name: l.string().optional(),
|
|
657
657
|
timelineId: l.string().optional()
|
|
658
658
|
})), yn = ht.merge(
|
|
659
|
-
|
|
660
|
-
),
|
|
659
|
+
L
|
|
660
|
+
), I = {
|
|
661
661
|
"MyOS/Document Anchor": "HS9yo34TGEAM2LGcNbLh7XPN4goPRhqdGZQkiyh473Wb",
|
|
662
662
|
"MyOS/Document Anchors": "7Usvk6dZMVqas3yqs23ZEXn1zu1YDPjgYiZFNYaw3puH",
|
|
663
663
|
"MyOS/Document Links": "4cmrbevB6K23ZenjqwmNxpnaw6RF4VB3wkP7XB59V7W5",
|
|
@@ -668,70 +668,70 @@ const ie = g(m["Core/Contract"])(l.object({
|
|
|
668
668
|
"MyOS/MyOS Timeline Channel": "HCF8mXnX3dFjQ8osjxb4Wzm2Nm1DoXnTYuA5sPnV7NTs",
|
|
669
669
|
"MyOS/MyOS Timeline Entry": "Furgmg5xcJVMDmaQXZRfZ1XehSf7PWctrioo8etRYJHQ",
|
|
670
670
|
"MyOS/MyOS Worker Agency": "4Lix4AKXvBDvrwxw2htSdYFKxL4wugEQzqoSEYet5Dh1"
|
|
671
|
-
}, Cn = g(
|
|
671
|
+
}, Cn = g(I["MyOS/MyOS Timeline Channel"])(ht.extend({
|
|
672
672
|
accountId: l.string().optional(),
|
|
673
673
|
description: l.string().optional(),
|
|
674
674
|
email: l.string().optional(),
|
|
675
675
|
name: l.string().optional()
|
|
676
|
-
})),
|
|
676
|
+
})), vn = Cn.merge(L), Sn = g(w["Conversation/Composite Timeline Channel"])(_.extend({
|
|
677
677
|
channels: l.array(l.string()).optional(),
|
|
678
678
|
description: l.string().optional(),
|
|
679
679
|
name: l.string().optional()
|
|
680
|
-
})), dt =
|
|
680
|
+
})), dt = Sn.merge(L), wn = g(m["Core/Channel Event Checkpoint"])(K.extend({
|
|
681
681
|
description: l.string().optional(),
|
|
682
|
-
lastEvents: l.record(l.string(),
|
|
682
|
+
lastEvents: l.record(l.string(), k()).optional(),
|
|
683
683
|
name: l.string().optional()
|
|
684
|
-
})),
|
|
684
|
+
})), bn = wn.merge(N).extend({
|
|
685
685
|
lastSignatures: l.record(l.string()).optional()
|
|
686
|
-
}),
|
|
686
|
+
}), kn = g(m["Core/Processing Initialized Marker"])(K.extend({
|
|
687
687
|
description: l.string().optional(),
|
|
688
688
|
documentId: l.string().optional(),
|
|
689
689
|
name: l.string().optional()
|
|
690
|
-
})),
|
|
690
|
+
})), In = kn.merge(N), Tn = g(m["Core/Process Embedded"])(K.extend({
|
|
691
691
|
description: l.string().optional(),
|
|
692
692
|
name: l.string().optional(),
|
|
693
693
|
paths: l.array(l.string()).optional()
|
|
694
|
-
})), Pn =
|
|
694
|
+
})), Pn = Tn.merge(
|
|
695
695
|
N
|
|
696
|
-
),
|
|
696
|
+
), Mn = g(m["Core/Processing Terminated Marker"])(K.extend({
|
|
697
697
|
cause: l.string().optional(),
|
|
698
698
|
description: l.string().optional(),
|
|
699
699
|
name: l.string().optional(),
|
|
700
700
|
reason: l.string().optional()
|
|
701
|
-
})),
|
|
701
|
+
})), Rn = Mn.merge(N), J = g(w["Conversation/Operation"])(K.extend({
|
|
702
702
|
channel: l.string().optional(),
|
|
703
703
|
description: l.string().optional(),
|
|
704
704
|
name: l.string().optional(),
|
|
705
|
-
request:
|
|
705
|
+
request: k().optional()
|
|
706
706
|
})), Nn = J.merge(
|
|
707
707
|
N
|
|
708
|
-
), On = g(
|
|
708
|
+
), On = g(I["MyOS/Document Anchor"])(l.object({
|
|
709
709
|
description: l.string().optional(),
|
|
710
710
|
name: l.string().optional(),
|
|
711
|
-
template:
|
|
712
|
-
})), An = g(
|
|
711
|
+
template: k().optional()
|
|
712
|
+
})), An = g(I["MyOS/Document Anchors"])(l.object({}).catchall(On)), Dn = An.merge(N), Bn = g(I["MyOS/Link"])(l.object({
|
|
713
713
|
anchor: l.string().optional(),
|
|
714
714
|
description: l.string().optional(),
|
|
715
715
|
name: l.string().optional()
|
|
716
|
-
})), xn = g(
|
|
716
|
+
})), xn = g(I["MyOS/Document Links"])(l.object({}).catchall(Bn)), _n = xn.merge(
|
|
717
717
|
N
|
|
718
|
-
), Ln = g(
|
|
718
|
+
), Ln = g(I["MyOS/MyOS Participants Orchestration"])(l.object({
|
|
719
719
|
name: l.string().optional()
|
|
720
|
-
})), Fn = Ln.merge(N), Un = g(
|
|
720
|
+
})), Fn = Ln.merge(N), Un = g(I["MyOS/MyOS Session Interaction"])(l.object({
|
|
721
721
|
name: l.string().optional()
|
|
722
|
-
})), $n = Un.merge(N), zn = g(
|
|
722
|
+
})), $n = Un.merge(N), zn = g(I["MyOS/MyOS Worker Agency"])(l.object({
|
|
723
723
|
name: l.string().optional()
|
|
724
|
-
})),
|
|
724
|
+
})), Hn = zn.merge(
|
|
725
725
|
N
|
|
726
|
-
),
|
|
726
|
+
), se = g(w["Conversation/Sequential Workflow Step"])(l.object({
|
|
727
727
|
description: l.string().optional(),
|
|
728
728
|
name: l.string().optional()
|
|
729
729
|
})), pt = g(w["Conversation/Sequential Workflow"])(lt.extend({
|
|
730
730
|
description: l.string().optional(),
|
|
731
731
|
name: l.string().optional(),
|
|
732
|
-
steps: l.array(
|
|
733
|
-
})),
|
|
734
|
-
steps: l.array(
|
|
732
|
+
steps: l.array(se).optional()
|
|
733
|
+
})), co = k(), Vn = pt.merge(ut).extend({
|
|
734
|
+
steps: l.array(k()).optional()
|
|
735
735
|
}), Kn = g(w["Conversation/Sequential Workflow Operation"])(pt.extend({
|
|
736
736
|
description: l.string().optional(),
|
|
737
737
|
name: l.string().optional(),
|
|
@@ -739,7 +739,7 @@ const ie = g(m["Core/Contract"])(l.object({
|
|
|
739
739
|
})), Wn = Kn.merge(
|
|
740
740
|
ut
|
|
741
741
|
).extend({
|
|
742
|
-
steps: l.array(
|
|
742
|
+
steps: l.array(k()).optional()
|
|
743
743
|
});
|
|
744
744
|
function Gn(i) {
|
|
745
745
|
if (!Array.isArray(i.blueIds) || i.blueIds.length === 0)
|
|
@@ -789,18 +789,69 @@ class qn {
|
|
|
789
789
|
lookupHandler(e) {
|
|
790
790
|
return this.handlerProcessors.get(e);
|
|
791
791
|
}
|
|
792
|
+
lookupHandlerForNode(e, t) {
|
|
793
|
+
return this.lookupProcessorForNode(e, t, this.handlerProcessors);
|
|
794
|
+
}
|
|
792
795
|
lookupChannel(e) {
|
|
793
796
|
return this.channelProcessors.get(e);
|
|
794
797
|
}
|
|
798
|
+
lookupChannelForNode(e, t) {
|
|
799
|
+
return this.lookupProcessorForNode(e, t, this.channelProcessors);
|
|
800
|
+
}
|
|
795
801
|
lookupMarker(e) {
|
|
796
802
|
return this.markerProcessors.get(e);
|
|
797
803
|
}
|
|
804
|
+
lookupMarkerForNode(e, t) {
|
|
805
|
+
return this.lookupProcessorForNode(e, t, this.markerProcessors);
|
|
806
|
+
}
|
|
798
807
|
processors() {
|
|
799
808
|
return new Map(this.processorsByBlueId);
|
|
800
809
|
}
|
|
801
810
|
registerProcessorMap(e) {
|
|
802
811
|
Q(e, this.processorsByBlueId);
|
|
803
812
|
}
|
|
813
|
+
lookupProcessorForNode(e, t, n) {
|
|
814
|
+
const r = t.getType();
|
|
815
|
+
if (!r)
|
|
816
|
+
return;
|
|
817
|
+
const o = r.getBlueId();
|
|
818
|
+
if (o) {
|
|
819
|
+
const c = n.get(o);
|
|
820
|
+
if (c)
|
|
821
|
+
return c;
|
|
822
|
+
}
|
|
823
|
+
const s = [];
|
|
824
|
+
for (const c of this.uniqueProcessors(n))
|
|
825
|
+
for (const u of c.blueIds)
|
|
826
|
+
s.push([u, c]);
|
|
827
|
+
return this.matchByTypeChain(e, t, s)?.value;
|
|
828
|
+
}
|
|
829
|
+
*uniqueProcessors(e) {
|
|
830
|
+
const t = /* @__PURE__ */ new Set();
|
|
831
|
+
for (const n of e.values())
|
|
832
|
+
t.has(n) || (t.add(n), yield n);
|
|
833
|
+
}
|
|
834
|
+
matchByTypeChain(e, t, n) {
|
|
835
|
+
const r = [];
|
|
836
|
+
for (const [a, c] of n)
|
|
837
|
+
e.isTypeOfBlueId(t, a) && r.push({
|
|
838
|
+
blueId: a,
|
|
839
|
+
value: c,
|
|
840
|
+
baseNode: new p().setType(new p().setBlueId(a))
|
|
841
|
+
});
|
|
842
|
+
if (r.length === 0)
|
|
843
|
+
return null;
|
|
844
|
+
if (r.length === 1) {
|
|
845
|
+
const a = r[0];
|
|
846
|
+
return { blueId: a.blueId, value: a.value };
|
|
847
|
+
}
|
|
848
|
+
const s = r.find(
|
|
849
|
+
(a) => r.every(
|
|
850
|
+
(c) => a === c || e.isTypeOfBlueId(a.baseNode, c.blueId)
|
|
851
|
+
)
|
|
852
|
+
) ?? r[0];
|
|
853
|
+
return { blueId: s.blueId, value: s.value };
|
|
854
|
+
}
|
|
804
855
|
}
|
|
805
856
|
const jn = "compositeSourceChannelKey";
|
|
806
857
|
function Jn(i, e) {
|
|
@@ -844,38 +895,38 @@ class Xn {
|
|
|
844
895
|
throw new Error(
|
|
845
896
|
`Composite timeline channel '${t.bindingKey}' references missing channel '${u}'`
|
|
846
897
|
);
|
|
847
|
-
const d = s(h.
|
|
898
|
+
const d = s(h.node);
|
|
848
899
|
if (!d)
|
|
849
900
|
throw new Error(
|
|
850
901
|
`No processor registered for child channel '${u}' (${h.blueId})`
|
|
851
902
|
);
|
|
852
|
-
const
|
|
903
|
+
const S = n.clone(), f = {
|
|
853
904
|
...t,
|
|
854
|
-
event:
|
|
905
|
+
event: S,
|
|
855
906
|
bindingKey: u
|
|
856
907
|
}, E = h.contract, C = E.event;
|
|
857
|
-
if (C && !t.blue.isTypeOfNode(
|
|
908
|
+
if (C && !t.blue.isTypeOfNode(S, C) || !await d.matches(E, f))
|
|
858
909
|
continue;
|
|
859
|
-
const D = d.channelize, ke = (D ? D.call(d, E, f) : void 0) ??
|
|
910
|
+
const D = d.channelize, ke = (D ? D.call(d, E, f) : void 0) ?? S.clone();
|
|
860
911
|
this.enrichEvent(ke, u);
|
|
861
|
-
const
|
|
912
|
+
const Ie = Jn(
|
|
862
913
|
t.bindingKey,
|
|
863
914
|
u
|
|
864
|
-
),
|
|
915
|
+
), St = await this.shouldProcessChild({
|
|
865
916
|
childProcessor: d,
|
|
866
917
|
childContract: E,
|
|
867
918
|
context: {
|
|
868
919
|
...f,
|
|
869
920
|
event: n.clone()
|
|
870
921
|
},
|
|
871
|
-
checkpointKey:
|
|
922
|
+
checkpointKey: Ie,
|
|
872
923
|
markers: t.markers
|
|
873
924
|
});
|
|
874
925
|
c.push({
|
|
875
926
|
eventNode: ke,
|
|
876
927
|
eventId: a,
|
|
877
|
-
checkpointKey:
|
|
878
|
-
shouldProcess:
|
|
928
|
+
checkpointKey: Ie,
|
|
929
|
+
shouldProcess: St
|
|
879
930
|
});
|
|
880
931
|
}
|
|
881
932
|
return {
|
|
@@ -930,45 +981,45 @@ const Yn = g(w["Conversation/Actor"])(l.object({
|
|
|
930
981
|
description: l.string().optional(),
|
|
931
982
|
name: l.string().optional(),
|
|
932
983
|
timelineId: l.string().optional()
|
|
933
|
-
})),
|
|
984
|
+
})), R = g(w["Conversation/Timeline Entry"])(l.object({
|
|
934
985
|
actor: Yn.optional(),
|
|
935
986
|
description: l.string().optional(),
|
|
936
|
-
message:
|
|
987
|
+
message: k().optional(),
|
|
937
988
|
name: l.string().optional(),
|
|
938
|
-
prevEntry:
|
|
989
|
+
prevEntry: k().optional(),
|
|
939
990
|
timeline: ft.optional(),
|
|
940
991
|
timestamp: l.number().optional()
|
|
941
|
-
})), Zn = g(
|
|
992
|
+
})), Zn = g(I["MyOS/MyOS Timeline"])(ft.extend({
|
|
942
993
|
accountId: l.string().optional(),
|
|
943
994
|
description: l.string().optional(),
|
|
944
995
|
name: l.string().optional()
|
|
945
|
-
})),
|
|
996
|
+
})), De = g(I["MyOS/MyOS Timeline Entry"])(R.extend({
|
|
946
997
|
description: l.string().optional(),
|
|
947
998
|
name: l.string().optional(),
|
|
948
999
|
timeline: Zn.optional()
|
|
949
1000
|
}));
|
|
950
|
-
function
|
|
951
|
-
return e && i.isTypeOf(e,
|
|
1001
|
+
function Be(i, e) {
|
|
1002
|
+
return e && i.isTypeOf(e, R, { checkSchemaExtensions: !0 }) ? i.nodeToSchemaOutput(e, R) : null;
|
|
952
1003
|
}
|
|
953
1004
|
function mt(i, e, t) {
|
|
954
|
-
const n =
|
|
1005
|
+
const n = Be(i, e), r = Be(i, t);
|
|
955
1006
|
if (!n || !r)
|
|
956
1007
|
return !0;
|
|
957
1008
|
const o = n.timestamp, s = r.timestamp;
|
|
958
1009
|
return typeof o != "number" || typeof s != "number" ? !0 : o >= s;
|
|
959
1010
|
}
|
|
960
|
-
function
|
|
961
|
-
return i.isTypeOf(e,
|
|
1011
|
+
function xe(i, e) {
|
|
1012
|
+
return i.isTypeOf(e, De) ? i.nodeToSchemaOutput(e, De) : i.isTypeOf(e, R) ? i.nodeToSchemaOutput(e, R) : null;
|
|
962
1013
|
}
|
|
963
1014
|
class er {
|
|
964
1015
|
kind = "channel";
|
|
965
|
-
blueIds = [
|
|
966
|
-
schema =
|
|
1016
|
+
blueIds = [I["MyOS/MyOS Timeline Channel"]];
|
|
1017
|
+
schema = vn;
|
|
967
1018
|
matches(e, t) {
|
|
968
1019
|
const { event: n, blue: r } = t;
|
|
969
1020
|
if (!n)
|
|
970
1021
|
return !1;
|
|
971
|
-
const o =
|
|
1022
|
+
const o = xe(r, n);
|
|
972
1023
|
if (!o)
|
|
973
1024
|
return !1;
|
|
974
1025
|
const s = o.timeline?.timelineId;
|
|
@@ -976,7 +1027,7 @@ class er {
|
|
|
976
1027
|
}
|
|
977
1028
|
channelize(e, t) {
|
|
978
1029
|
const { event: n, blue: r } = t;
|
|
979
|
-
return !n || !
|
|
1030
|
+
return !n || !xe(r, n) ? null : n.clone();
|
|
980
1031
|
}
|
|
981
1032
|
isNewerEvent(e, t, n) {
|
|
982
1033
|
const { event: r, blue: o } = t;
|
|
@@ -989,26 +1040,26 @@ class tr {
|
|
|
989
1040
|
schema = yn;
|
|
990
1041
|
matches(e, t) {
|
|
991
1042
|
const { event: n, blue: r } = t;
|
|
992
|
-
if (!n || !r.isTypeOf(n,
|
|
1043
|
+
if (!n || !r.isTypeOf(n, R))
|
|
993
1044
|
return !1;
|
|
994
|
-
const s = r.nodeToSchemaOutput(n,
|
|
1045
|
+
const s = r.nodeToSchemaOutput(n, R).timeline?.timelineId;
|
|
995
1046
|
return !(!s || !e.timelineId || s !== e.timelineId);
|
|
996
1047
|
}
|
|
997
1048
|
channelize(e, t) {
|
|
998
1049
|
const { event: n, blue: r } = t;
|
|
999
|
-
return !n || !r.isTypeOf(n,
|
|
1050
|
+
return !n || !r.isTypeOf(n, R) ? null : n.clone();
|
|
1000
1051
|
}
|
|
1001
1052
|
isNewerEvent(e, t, n) {
|
|
1002
1053
|
const { event: r, blue: o } = t;
|
|
1003
1054
|
return r ? mt(o, r, n) : !0;
|
|
1004
1055
|
}
|
|
1005
1056
|
}
|
|
1006
|
-
const
|
|
1057
|
+
const _e = g(w["Conversation/Trigger Event"])(se.extend({
|
|
1007
1058
|
description: l.string().optional(),
|
|
1008
|
-
event:
|
|
1059
|
+
event: k().optional(),
|
|
1009
1060
|
name: l.string().optional()
|
|
1010
1061
|
}));
|
|
1011
|
-
function
|
|
1062
|
+
function we(i) {
|
|
1012
1063
|
const { context: e, eventNode: t, stepResults: n, contractNode: r } = i, o = rr(e), s = r != null ? e.blue.nodeToJson(r, "simple") : null, a = r != null ? e.blue.nodeToJson(r, "official") : s;
|
|
1013
1064
|
return {
|
|
1014
1065
|
event: e.blue.nodeToJson(t, "simple"),
|
|
@@ -1042,16 +1093,16 @@ class ir {
|
|
|
1042
1093
|
supportedBlueIds = [
|
|
1043
1094
|
w["Conversation/Trigger Event"]
|
|
1044
1095
|
];
|
|
1045
|
-
evaluator = new
|
|
1096
|
+
evaluator = new ve();
|
|
1046
1097
|
async execute(e) {
|
|
1047
1098
|
const { stepNode: t, context: n } = e;
|
|
1048
|
-
if (!n.blue.isTypeOf(t,
|
|
1099
|
+
if (!n.blue.isTypeOf(t, _e))
|
|
1049
1100
|
return n.throwFatal("Trigger Event step payload is invalid");
|
|
1050
1101
|
n.gasMeter().chargeTriggerEventBase();
|
|
1051
|
-
const r = await
|
|
1102
|
+
const r = await te({
|
|
1052
1103
|
evaluator: this.evaluator,
|
|
1053
1104
|
node: t,
|
|
1054
|
-
bindings:
|
|
1105
|
+
bindings: we(e),
|
|
1055
1106
|
shouldResolve: ct({
|
|
1056
1107
|
include: ["/event", "/event/**"]
|
|
1057
1108
|
}),
|
|
@@ -1059,9 +1110,9 @@ class ir {
|
|
|
1059
1110
|
context: n
|
|
1060
1111
|
}), s = n.blue.nodeToSchemaOutput(
|
|
1061
1112
|
r,
|
|
1062
|
-
|
|
1113
|
+
_e
|
|
1063
1114
|
).event;
|
|
1064
|
-
if (
|
|
1115
|
+
if (de(s))
|
|
1065
1116
|
return n.throwFatal(
|
|
1066
1117
|
"Trigger Event step must declare event payload"
|
|
1067
1118
|
);
|
|
@@ -1075,7 +1126,7 @@ function sr(i) {
|
|
|
1075
1126
|
const e = i.getProperties?.();
|
|
1076
1127
|
return e ? !!e.contracts : !1;
|
|
1077
1128
|
}
|
|
1078
|
-
const
|
|
1129
|
+
const Le = g(w["Conversation/JavaScript Code"])(se.extend({
|
|
1079
1130
|
code: l.string().optional(),
|
|
1080
1131
|
description: l.string().optional(),
|
|
1081
1132
|
name: l.string().optional()
|
|
@@ -1084,24 +1135,24 @@ class ar {
|
|
|
1084
1135
|
supportedBlueIds = [
|
|
1085
1136
|
w["Conversation/JavaScript Code"]
|
|
1086
1137
|
];
|
|
1087
|
-
evaluator = new
|
|
1138
|
+
evaluator = new ve();
|
|
1088
1139
|
wasmGasLimit;
|
|
1089
1140
|
constructor(e = {}) {
|
|
1090
1141
|
this.wasmGasLimit = e.wasmGasLimit ?? it;
|
|
1091
1142
|
}
|
|
1092
1143
|
async execute(e) {
|
|
1093
1144
|
const { context: t, stepNode: n } = e, { blue: r } = t;
|
|
1094
|
-
if (!r.isTypeOf(n,
|
|
1145
|
+
if (!r.isTypeOf(n, Le))
|
|
1095
1146
|
return t.throwFatal("JavaScript Code step payload is invalid");
|
|
1096
1147
|
const s = r.nodeToSchemaOutput(
|
|
1097
1148
|
n,
|
|
1098
|
-
|
|
1149
|
+
Le
|
|
1099
1150
|
).code;
|
|
1100
1151
|
if (!s)
|
|
1101
1152
|
return t.throwFatal(
|
|
1102
1153
|
"JavaScript Code step must include code to execute"
|
|
1103
1154
|
);
|
|
1104
|
-
const a =
|
|
1155
|
+
const a = we(e);
|
|
1105
1156
|
try {
|
|
1106
1157
|
const c = await this.evaluator.evaluate({
|
|
1107
1158
|
code: s,
|
|
@@ -1130,8 +1181,8 @@ const cr = g(m["Core/Json Patch Entry"])(l.object({
|
|
|
1130
1181
|
name: l.string().optional(),
|
|
1131
1182
|
op: l.string().optional(),
|
|
1132
1183
|
path: l.string().optional(),
|
|
1133
|
-
val:
|
|
1134
|
-
})),
|
|
1184
|
+
val: k().optional()
|
|
1185
|
+
})), Fe = g(w["Conversation/Update Document"])(se.extend({
|
|
1135
1186
|
changeset: l.array(cr).optional(),
|
|
1136
1187
|
description: l.string().optional(),
|
|
1137
1188
|
name: l.string().optional()
|
|
@@ -1140,15 +1191,15 @@ class lr {
|
|
|
1140
1191
|
supportedBlueIds = [
|
|
1141
1192
|
w["Conversation/Update Document"]
|
|
1142
1193
|
];
|
|
1143
|
-
evaluator = new
|
|
1194
|
+
evaluator = new ve();
|
|
1144
1195
|
async execute(e) {
|
|
1145
1196
|
const { context: t, stepNode: n } = e, { blue: r } = t;
|
|
1146
|
-
if (!r.isTypeOf(n,
|
|
1197
|
+
if (!r.isTypeOf(n, Fe))
|
|
1147
1198
|
return t.throwFatal("Update Document step payload is invalid");
|
|
1148
|
-
const o = await
|
|
1199
|
+
const o = await te({
|
|
1149
1200
|
evaluator: this.evaluator,
|
|
1150
1201
|
node: n,
|
|
1151
|
-
bindings:
|
|
1202
|
+
bindings: we(e),
|
|
1152
1203
|
shouldResolve: ct({
|
|
1153
1204
|
include: ["/changeset", "/changeset/**"]
|
|
1154
1205
|
}),
|
|
@@ -1163,7 +1214,7 @@ class lr {
|
|
|
1163
1214
|
extractChanges(e, t) {
|
|
1164
1215
|
return t.blue.nodeToSchemaOutput(
|
|
1165
1216
|
e,
|
|
1166
|
-
|
|
1217
|
+
Fe
|
|
1167
1218
|
).changeset ?? [];
|
|
1168
1219
|
}
|
|
1169
1220
|
createPatch(e, t) {
|
|
@@ -1183,14 +1234,14 @@ class lr {
|
|
|
1183
1234
|
return n.length === 0 ? t.throwFatal("Update Document path cannot be empty") : n;
|
|
1184
1235
|
}
|
|
1185
1236
|
}
|
|
1186
|
-
const
|
|
1237
|
+
const be = [
|
|
1187
1238
|
new ir(),
|
|
1188
1239
|
new ar(),
|
|
1189
1240
|
new lr()
|
|
1190
1241
|
];
|
|
1191
1242
|
class gt {
|
|
1192
1243
|
executorIndex;
|
|
1193
|
-
constructor(e =
|
|
1244
|
+
constructor(e = be) {
|
|
1194
1245
|
const t = /* @__PURE__ */ new Map();
|
|
1195
1246
|
for (const n of e)
|
|
1196
1247
|
for (const r of n.supportedBlueIds)
|
|
@@ -1204,18 +1255,18 @@ class gt {
|
|
|
1204
1255
|
const a = {};
|
|
1205
1256
|
for (const [c, u] of s.entries()) {
|
|
1206
1257
|
const h = u.getType?.()?.getBlueId();
|
|
1207
|
-
if (
|
|
1258
|
+
if (de(h))
|
|
1208
1259
|
return r.throwFatal(
|
|
1209
1260
|
"Sequential workflow step is missing type metadata"
|
|
1210
1261
|
);
|
|
1211
1262
|
const d = this.executorIndex.get(h);
|
|
1212
|
-
if (
|
|
1263
|
+
if (de(d)) {
|
|
1213
1264
|
const E = u.getType?.()?.getName?.() ?? h;
|
|
1214
1265
|
return r.throwFatal(
|
|
1215
1266
|
`Unsupported workflow step type "${E}"`
|
|
1216
1267
|
);
|
|
1217
1268
|
}
|
|
1218
|
-
const
|
|
1269
|
+
const S = {
|
|
1219
1270
|
workflow: t,
|
|
1220
1271
|
stepNode: u,
|
|
1221
1272
|
eventNode: n,
|
|
@@ -1223,7 +1274,7 @@ class gt {
|
|
|
1223
1274
|
stepResults: a,
|
|
1224
1275
|
stepIndex: c,
|
|
1225
1276
|
contractNode: o
|
|
1226
|
-
}, f = await d.execute(
|
|
1277
|
+
}, f = await d.execute(S);
|
|
1227
1278
|
if (f !== void 0) {
|
|
1228
1279
|
const E = this.stepResultKey(u, c);
|
|
1229
1280
|
a[E] = f;
|
|
@@ -1241,9 +1292,9 @@ class ur {
|
|
|
1241
1292
|
blueIds = [
|
|
1242
1293
|
w["Conversation/Sequential Workflow"]
|
|
1243
1294
|
];
|
|
1244
|
-
schema =
|
|
1295
|
+
schema = Vn;
|
|
1245
1296
|
runner;
|
|
1246
|
-
constructor(e =
|
|
1297
|
+
constructor(e = be) {
|
|
1247
1298
|
this.runner = new gt(e);
|
|
1248
1299
|
}
|
|
1249
1300
|
async matches(e, t) {
|
|
@@ -1265,13 +1316,13 @@ class hr {
|
|
|
1265
1316
|
blueIds = [w["Conversation/Operation"]];
|
|
1266
1317
|
schema = Nn;
|
|
1267
1318
|
}
|
|
1268
|
-
const
|
|
1319
|
+
const me = g(w["Conversation/Operation Request"])(l.object({
|
|
1269
1320
|
allowNewerVersion: l.boolean().optional(),
|
|
1270
1321
|
description: l.string().optional(),
|
|
1271
|
-
document:
|
|
1322
|
+
document: k().optional(),
|
|
1272
1323
|
name: l.string().optional(),
|
|
1273
1324
|
operation: l.string().optional(),
|
|
1274
|
-
request:
|
|
1325
|
+
request: k().optional()
|
|
1275
1326
|
}));
|
|
1276
1327
|
function Et(i) {
|
|
1277
1328
|
const e = i.channel;
|
|
@@ -1287,15 +1338,15 @@ function dr(i, e) {
|
|
|
1287
1338
|
return t instanceof p ? e.blue.calculateBlueIdSync(t) : null;
|
|
1288
1339
|
}
|
|
1289
1340
|
function pr(i, e) {
|
|
1290
|
-
if (e.isTypeOf(i,
|
|
1341
|
+
if (e.isTypeOf(i, me, {
|
|
1291
1342
|
checkSchemaExtensions: !0
|
|
1292
1343
|
}))
|
|
1293
1344
|
return i;
|
|
1294
|
-
if (e.isTypeOf(i,
|
|
1345
|
+
if (e.isTypeOf(i, R, {
|
|
1295
1346
|
checkSchemaExtensions: !0
|
|
1296
1347
|
})) {
|
|
1297
|
-
const n = e.nodeToSchemaOutput(i,
|
|
1298
|
-
if (n && e.isTypeOf(n,
|
|
1348
|
+
const n = e.nodeToSchemaOutput(i, R).message;
|
|
1349
|
+
if (n && e.isTypeOf(n, me, {
|
|
1299
1350
|
checkSchemaExtensions: !0
|
|
1300
1351
|
}))
|
|
1301
1352
|
return n;
|
|
@@ -1311,7 +1362,9 @@ function mr(i, e) {
|
|
|
1311
1362
|
if (!t)
|
|
1312
1363
|
return null;
|
|
1313
1364
|
const n = e.resolvePointer(`/contracts/${t}`), r = e.documentAt(n);
|
|
1314
|
-
if (!r || !e.blue.isTypeOf(r, J
|
|
1365
|
+
if (!r || !e.blue.isTypeOf(r, J, {
|
|
1366
|
+
checkSchemaExtensions: !0
|
|
1367
|
+
}))
|
|
1315
1368
|
return null;
|
|
1316
1369
|
const o = e.blue.nodeToSchemaOutput(
|
|
1317
1370
|
r,
|
|
@@ -1353,7 +1406,7 @@ class Cr {
|
|
|
1353
1406
|
];
|
|
1354
1407
|
schema = Wn;
|
|
1355
1408
|
runner;
|
|
1356
|
-
constructor(e =
|
|
1409
|
+
constructor(e = be) {
|
|
1357
1410
|
this.runner = new gt(e);
|
|
1358
1411
|
}
|
|
1359
1412
|
deriveChannel(e, t) {
|
|
@@ -1380,7 +1433,7 @@ class Cr {
|
|
|
1380
1433
|
return !1;
|
|
1381
1434
|
const o = t.blue.nodeToSchemaOutput(
|
|
1382
1435
|
r,
|
|
1383
|
-
|
|
1436
|
+
me
|
|
1384
1437
|
);
|
|
1385
1438
|
if (!o || !fr(e, n, o, t))
|
|
1386
1439
|
return !1;
|
|
@@ -1404,12 +1457,12 @@ class Cr {
|
|
|
1404
1457
|
});
|
|
1405
1458
|
}
|
|
1406
1459
|
}
|
|
1407
|
-
class
|
|
1460
|
+
class ae {
|
|
1408
1461
|
constructor(e) {
|
|
1409
1462
|
this.registry = e;
|
|
1410
1463
|
}
|
|
1411
1464
|
static create() {
|
|
1412
|
-
return new
|
|
1465
|
+
return new ae(
|
|
1413
1466
|
new qn()
|
|
1414
1467
|
);
|
|
1415
1468
|
}
|
|
@@ -1423,13 +1476,13 @@ class se {
|
|
|
1423
1476
|
return this.registry;
|
|
1424
1477
|
}
|
|
1425
1478
|
}
|
|
1426
|
-
const
|
|
1479
|
+
const ge = m["Core/Channel Event Checkpoint"];
|
|
1427
1480
|
function yt(i) {
|
|
1428
1481
|
return typeof i.order == "number" ? i.order : 0;
|
|
1429
1482
|
}
|
|
1430
|
-
class
|
|
1431
|
-
constructor(e, t, n) {
|
|
1432
|
-
this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n;
|
|
1483
|
+
class vr {
|
|
1484
|
+
constructor(e, t, n, r) {
|
|
1485
|
+
this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n, this.bindingNode = r;
|
|
1433
1486
|
}
|
|
1434
1487
|
key() {
|
|
1435
1488
|
return this.bindingKey;
|
|
@@ -1440,11 +1493,14 @@ class Sr {
|
|
|
1440
1493
|
blueId() {
|
|
1441
1494
|
return this.bindingBlueId;
|
|
1442
1495
|
}
|
|
1496
|
+
node() {
|
|
1497
|
+
return this.bindingNode.clone();
|
|
1498
|
+
}
|
|
1443
1499
|
order() {
|
|
1444
1500
|
return yt(this.bindingContract);
|
|
1445
1501
|
}
|
|
1446
1502
|
}
|
|
1447
|
-
class
|
|
1503
|
+
class Sr {
|
|
1448
1504
|
constructor(e, t, n, r) {
|
|
1449
1505
|
this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n, this.bindingNode = r;
|
|
1450
1506
|
}
|
|
@@ -1464,13 +1520,13 @@ class vr {
|
|
|
1464
1520
|
return yt(this.bindingContract);
|
|
1465
1521
|
}
|
|
1466
1522
|
}
|
|
1467
|
-
class
|
|
1523
|
+
class H {
|
|
1468
1524
|
constructor(e, t, n, r, o) {
|
|
1469
1525
|
this.channels = e, this.handlersByChannel = t, this.markerStore = n, this.embeddedPathsInternal = r, this.checkpointDeclared = o;
|
|
1470
1526
|
}
|
|
1471
1527
|
checkpointDeclared;
|
|
1472
1528
|
static fromComponents(e, t, n, r, o) {
|
|
1473
|
-
return new
|
|
1529
|
+
return new H(
|
|
1474
1530
|
e,
|
|
1475
1531
|
t,
|
|
1476
1532
|
n,
|
|
@@ -1482,7 +1538,7 @@ class V {
|
|
|
1482
1538
|
return new wr();
|
|
1483
1539
|
}
|
|
1484
1540
|
static empty() {
|
|
1485
|
-
return
|
|
1541
|
+
return H.builder().build();
|
|
1486
1542
|
}
|
|
1487
1543
|
markers() {
|
|
1488
1544
|
return new Map(
|
|
@@ -1515,13 +1571,13 @@ class V {
|
|
|
1515
1571
|
this.markerStore.set(A, {
|
|
1516
1572
|
key: A,
|
|
1517
1573
|
contract: e,
|
|
1518
|
-
blueId:
|
|
1574
|
+
blueId: ge
|
|
1519
1575
|
}), this.checkpointDeclared = !0;
|
|
1520
1576
|
}
|
|
1521
1577
|
handlersFor(e) {
|
|
1522
1578
|
const t = this.handlersByChannel.get(e);
|
|
1523
1579
|
return !t || t.length === 0 ? [] : [...t].map(
|
|
1524
|
-
(n) => new
|
|
1580
|
+
(n) => new Sr(
|
|
1525
1581
|
n.key,
|
|
1526
1582
|
n.contract,
|
|
1527
1583
|
n.blueId,
|
|
@@ -1534,11 +1590,21 @@ class V {
|
|
|
1534
1590
|
}
|
|
1535
1591
|
channelEntry(e) {
|
|
1536
1592
|
const t = this.channels.get(e);
|
|
1537
|
-
return t ? {
|
|
1593
|
+
return t ? {
|
|
1594
|
+
key: t.key,
|
|
1595
|
+
contract: t.contract,
|
|
1596
|
+
blueId: t.blueId,
|
|
1597
|
+
node: t.node.clone()
|
|
1598
|
+
} : null;
|
|
1538
1599
|
}
|
|
1539
1600
|
channelsOfType(...e) {
|
|
1540
1601
|
const t = e.length > 0 ? new Set(e) : null, n = Array.from(this.channels.values()).filter((r) => !t || t.has(r.blueId)).map(
|
|
1541
|
-
(r) => new
|
|
1602
|
+
(r) => new vr(
|
|
1603
|
+
r.key,
|
|
1604
|
+
r.contract,
|
|
1605
|
+
r.blueId,
|
|
1606
|
+
r.node
|
|
1607
|
+
)
|
|
1542
1608
|
);
|
|
1543
1609
|
return n.sort((r, o) => {
|
|
1544
1610
|
const s = r.order() - o.order();
|
|
@@ -1553,8 +1619,8 @@ class wr {
|
|
|
1553
1619
|
embeddedPaths = [];
|
|
1554
1620
|
embeddedDeclared = !1;
|
|
1555
1621
|
checkpointDeclared = !1;
|
|
1556
|
-
addChannel(e, t, n) {
|
|
1557
|
-
return this.channels.set(e, { key: e, contract: t, blueId: n }), this;
|
|
1622
|
+
addChannel(e, t, n, r) {
|
|
1623
|
+
return this.channels.set(e, { key: e, contract: t, blueId: n, node: r }), this;
|
|
1558
1624
|
}
|
|
1559
1625
|
addHandler(e, t, n, r) {
|
|
1560
1626
|
const o = t.channel;
|
|
@@ -1571,11 +1637,11 @@ class wr {
|
|
|
1571
1637
|
return this.embeddedDeclared = !0, this.embeddedPaths = e.paths ? [...e.paths] : [], this;
|
|
1572
1638
|
}
|
|
1573
1639
|
addMarker(e, t, n) {
|
|
1574
|
-
if (e === A && n !==
|
|
1640
|
+
if (e === A && n !== ge)
|
|
1575
1641
|
throw new Error(
|
|
1576
1642
|
"Reserved key 'checkpoint' must contain a Channel Event Checkpoint"
|
|
1577
1643
|
);
|
|
1578
|
-
if (n ===
|
|
1644
|
+
if (n === ge) {
|
|
1579
1645
|
if (e !== A)
|
|
1580
1646
|
throw new Error(
|
|
1581
1647
|
`Channel Event Checkpoint must use reserved key 'checkpoint' at key '${e}'`
|
|
@@ -1589,7 +1655,7 @@ class wr {
|
|
|
1589
1655
|
return this.markerStore.set(e, { key: e, contract: t, blueId: n }), this;
|
|
1590
1656
|
}
|
|
1591
1657
|
build() {
|
|
1592
|
-
return
|
|
1658
|
+
return H.fromComponents(
|
|
1593
1659
|
new Map(this.channels),
|
|
1594
1660
|
new Map(
|
|
1595
1661
|
Array.from(this.handlersByChannel.entries(), ([e, t]) => [
|
|
@@ -1608,7 +1674,13 @@ class y extends Error {
|
|
|
1608
1674
|
super(e || "Processor fatal error"), this.processorError = t, this.name = "ProcessorFatalError";
|
|
1609
1675
|
}
|
|
1610
1676
|
}
|
|
1611
|
-
|
|
1677
|
+
function Y(i, e, t) {
|
|
1678
|
+
for (const [n, r] of t.entries())
|
|
1679
|
+
if (i.isTypeOfBlueId(e, n))
|
|
1680
|
+
return r;
|
|
1681
|
+
return null;
|
|
1682
|
+
}
|
|
1683
|
+
class br {
|
|
1612
1684
|
constructor(e, t, n) {
|
|
1613
1685
|
this.blue = e, this.registry = t, this.builtinChannelSchemas = n;
|
|
1614
1686
|
}
|
|
@@ -1633,16 +1705,16 @@ class kr {
|
|
|
1633
1705
|
if (!h)
|
|
1634
1706
|
throw new y(
|
|
1635
1707
|
`Handler ${t} references unknown channel '${u}'`,
|
|
1636
|
-
|
|
1708
|
+
v.invalidContract(
|
|
1637
1709
|
o,
|
|
1638
1710
|
`Channel '${u}' is not declared in this scope`,
|
|
1639
1711
|
`/contracts/${u}`
|
|
1640
1712
|
)
|
|
1641
1713
|
);
|
|
1642
|
-
if (!this.isRegisteredChannel(h
|
|
1714
|
+
if (!this.isRegisteredChannel(h))
|
|
1643
1715
|
throw new y(
|
|
1644
1716
|
`Contract '${u}' is not a channel`,
|
|
1645
|
-
|
|
1717
|
+
v.invalidContract(
|
|
1646
1718
|
h.nodeTypeBlueId,
|
|
1647
1719
|
`Contract '${u}' is not a channel`,
|
|
1648
1720
|
`/contracts/${u}`
|
|
@@ -1659,7 +1731,7 @@ class kr {
|
|
|
1659
1731
|
if (this.isZodError(a))
|
|
1660
1732
|
throw new y(
|
|
1661
1733
|
"Failed to parse handler contract",
|
|
1662
|
-
|
|
1734
|
+
v.invalidContract(
|
|
1663
1735
|
o,
|
|
1664
1736
|
"Failed to parse handler contract",
|
|
1665
1737
|
t,
|
|
@@ -1669,7 +1741,7 @@ class kr {
|
|
|
1669
1741
|
const c = a?.message ?? "Failed to register handler contract";
|
|
1670
1742
|
throw new y(
|
|
1671
1743
|
c,
|
|
1672
|
-
|
|
1744
|
+
v.illegalState(c)
|
|
1673
1745
|
);
|
|
1674
1746
|
}
|
|
1675
1747
|
}
|
|
@@ -1693,14 +1765,14 @@ class kr {
|
|
|
1693
1765
|
if (!o)
|
|
1694
1766
|
throw new y(
|
|
1695
1767
|
`Handler ${r} must declare channel (missing explicit channel and derivation failed)`,
|
|
1696
|
-
|
|
1768
|
+
v.illegalState(
|
|
1697
1769
|
`Handler ${r} must declare channel (missing explicit channel and derivation failed)`
|
|
1698
1770
|
)
|
|
1699
1771
|
);
|
|
1700
1772
|
return o;
|
|
1701
1773
|
}
|
|
1702
1774
|
isRegisteredChannel(e) {
|
|
1703
|
-
return this.builtinChannelSchemas
|
|
1775
|
+
return Y(this.blue, e.node, this.builtinChannelSchemas) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
|
|
1704
1776
|
}
|
|
1705
1777
|
setContractChannel(e, t) {
|
|
1706
1778
|
const r = e.getProperties()?.channel;
|
|
@@ -1711,7 +1783,7 @@ class kr {
|
|
|
1711
1783
|
e.addProperty("channel", new p().setValue(t));
|
|
1712
1784
|
}
|
|
1713
1785
|
isZodError(e) {
|
|
1714
|
-
return e instanceof
|
|
1786
|
+
return e instanceof Ee;
|
|
1715
1787
|
}
|
|
1716
1788
|
}
|
|
1717
1789
|
class z extends Error {
|
|
@@ -1719,80 +1791,74 @@ class z extends Error {
|
|
|
1719
1791
|
super(e ?? "MustUnderstand failure"), this.name = "MustUnderstandFailure";
|
|
1720
1792
|
}
|
|
1721
1793
|
}
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
contract: t,
|
|
1726
|
-
scopeContracts: n,
|
|
1727
|
-
blueId: r,
|
|
1728
|
-
blue: o,
|
|
1729
|
-
compositeChannelBlueId: s
|
|
1730
|
-
} = i, a = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), u = [], h = /* @__PURE__ */ new Map([
|
|
1794
|
+
const kr = w["Conversation/Composite Timeline Channel"];
|
|
1795
|
+
function Ir(i) {
|
|
1796
|
+
const { compositeKey: e, contract: t, scopeContracts: n, blueId: r, blue: o } = i, s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), c = [], u = /* @__PURE__ */ new Map([
|
|
1731
1797
|
[e, t]
|
|
1732
|
-
]), d = (f) => {
|
|
1733
|
-
if (
|
|
1734
|
-
return
|
|
1798
|
+
]), h = (f) => o.isTypeOfBlueId(f.node, kr), d = (f) => {
|
|
1799
|
+
if (u.has(f))
|
|
1800
|
+
return u.get(f) ?? null;
|
|
1735
1801
|
const E = n.get(f);
|
|
1736
|
-
if (!E || E
|
|
1737
|
-
return
|
|
1802
|
+
if (!E || !h(E))
|
|
1803
|
+
return u.set(f, null), null;
|
|
1738
1804
|
try {
|
|
1739
1805
|
const C = o.nodeToSchemaOutput(
|
|
1740
1806
|
E.node,
|
|
1741
1807
|
dt
|
|
1742
1808
|
);
|
|
1743
|
-
return
|
|
1809
|
+
return u.set(f, C), C;
|
|
1744
1810
|
} catch (C) {
|
|
1745
1811
|
if (Tr(C))
|
|
1746
1812
|
throw new y(
|
|
1747
1813
|
"Failed to parse channel contract",
|
|
1748
|
-
|
|
1814
|
+
v.invalidContract(
|
|
1749
1815
|
E.nodeTypeBlueId,
|
|
1750
1816
|
"Failed to parse channel contract",
|
|
1751
1817
|
`/contracts/${f}`,
|
|
1752
1818
|
C
|
|
1753
1819
|
)
|
|
1754
1820
|
);
|
|
1755
|
-
const
|
|
1821
|
+
const M = C?.message ?? "Failed to parse channel contract";
|
|
1756
1822
|
throw new y(
|
|
1757
|
-
|
|
1758
|
-
|
|
1823
|
+
M,
|
|
1824
|
+
v.illegalState(M)
|
|
1759
1825
|
);
|
|
1760
1826
|
}
|
|
1761
|
-
},
|
|
1762
|
-
if (
|
|
1763
|
-
const C =
|
|
1827
|
+
}, S = (f) => {
|
|
1828
|
+
if (a.has(f)) {
|
|
1829
|
+
const C = c.indexOf(f), D = [...c.slice(C), f].join(" -> ");
|
|
1764
1830
|
throw new y(
|
|
1765
1831
|
`Composite channel ${e} has a cyclic reference: ${D}`,
|
|
1766
|
-
|
|
1832
|
+
v.invalidContract(
|
|
1767
1833
|
r,
|
|
1768
1834
|
`Composite channel '${e}' has a cyclic reference: ${D}`,
|
|
1769
1835
|
`/contracts/${e}`
|
|
1770
1836
|
)
|
|
1771
1837
|
);
|
|
1772
1838
|
}
|
|
1773
|
-
if (
|
|
1839
|
+
if (s.has(f))
|
|
1774
1840
|
return;
|
|
1775
|
-
|
|
1841
|
+
a.add(f), c.push(f);
|
|
1776
1842
|
const E = d(f);
|
|
1777
1843
|
if (E)
|
|
1778
1844
|
for (const C of E.channels ?? []) {
|
|
1779
|
-
const
|
|
1780
|
-
|
|
1845
|
+
const M = n.get(C);
|
|
1846
|
+
M && h(M) && S(C);
|
|
1781
1847
|
}
|
|
1782
|
-
|
|
1848
|
+
c.pop(), a.delete(f), s.add(f);
|
|
1783
1849
|
};
|
|
1784
|
-
|
|
1850
|
+
S(e);
|
|
1785
1851
|
}
|
|
1786
1852
|
function Tr(i) {
|
|
1787
|
-
return i instanceof
|
|
1853
|
+
return i instanceof Ee;
|
|
1788
1854
|
}
|
|
1789
|
-
const
|
|
1855
|
+
const Pr = m["Core/Document Update Channel"], Mr = m["Core/Embedded Node Channel"], Rr = m["Core/Lifecycle Event Channel"], Nr = m["Core/Triggered Event Channel"], Ue = m["Core/Process Embedded"], Or = m["Core/Processing Initialized Marker"], Ar = m["Core/Processing Terminated Marker"], Dr = m["Core/Channel Event Checkpoint"], Br = I["MyOS/Document Anchors"], xr = I["MyOS/Document Links"], _r = I["MyOS/MyOS Participants Orchestration"], Lr = I["MyOS/MyOS Session Interaction"], Fr = I["MyOS/MyOS Worker Agency"], Ur = w["Conversation/Composite Timeline Channel"], le = /* @__PURE__ */ new Map([
|
|
1790
1856
|
[
|
|
1791
|
-
|
|
1857
|
+
Pr,
|
|
1792
1858
|
hn
|
|
1793
1859
|
],
|
|
1794
1860
|
[
|
|
1795
|
-
|
|
1861
|
+
Mr,
|
|
1796
1862
|
pn
|
|
1797
1863
|
],
|
|
1798
1864
|
[
|
|
@@ -1800,55 +1866,55 @@ const Ir = m["Core/Document Update Channel"], Pr = m["Core/Embedded Node Channel
|
|
|
1800
1866
|
mn
|
|
1801
1867
|
],
|
|
1802
1868
|
[
|
|
1803
|
-
|
|
1869
|
+
Nr,
|
|
1804
1870
|
En
|
|
1805
1871
|
]
|
|
1806
|
-
]),
|
|
1807
|
-
[
|
|
1808
|
-
Nr,
|
|
1809
|
-
Tn
|
|
1810
|
-
],
|
|
1872
|
+
]), $r = /* @__PURE__ */ new Map([
|
|
1811
1873
|
[
|
|
1812
1874
|
Or,
|
|
1813
|
-
|
|
1875
|
+
In
|
|
1814
1876
|
],
|
|
1815
1877
|
[
|
|
1816
1878
|
Ar,
|
|
1817
|
-
|
|
1879
|
+
Rn
|
|
1818
1880
|
],
|
|
1819
1881
|
[
|
|
1820
1882
|
Dr,
|
|
1821
|
-
|
|
1883
|
+
bn
|
|
1822
1884
|
],
|
|
1823
1885
|
[
|
|
1824
1886
|
Br,
|
|
1825
|
-
|
|
1887
|
+
Dn
|
|
1826
1888
|
],
|
|
1827
1889
|
[
|
|
1828
1890
|
xr,
|
|
1829
|
-
|
|
1891
|
+
_n
|
|
1830
1892
|
],
|
|
1831
1893
|
[
|
|
1832
1894
|
_r,
|
|
1833
|
-
|
|
1895
|
+
Fn
|
|
1834
1896
|
],
|
|
1835
1897
|
[
|
|
1836
1898
|
Lr,
|
|
1837
|
-
|
|
1899
|
+
$n
|
|
1900
|
+
],
|
|
1901
|
+
[
|
|
1902
|
+
Fr,
|
|
1903
|
+
Hn
|
|
1838
1904
|
]
|
|
1839
1905
|
]);
|
|
1840
|
-
class
|
|
1906
|
+
class zr {
|
|
1841
1907
|
constructor(e, t) {
|
|
1842
|
-
this.registry = e, this.blue = t, this.handlerRegistration = new
|
|
1908
|
+
this.registry = e, this.blue = t, this.handlerRegistration = new br(
|
|
1843
1909
|
this.blue,
|
|
1844
1910
|
this.registry,
|
|
1845
|
-
|
|
1911
|
+
le
|
|
1846
1912
|
);
|
|
1847
1913
|
}
|
|
1848
1914
|
handlerRegistration;
|
|
1849
1915
|
load(e, t) {
|
|
1850
1916
|
try {
|
|
1851
|
-
const n =
|
|
1917
|
+
const n = H.builder(), r = e.getContracts();
|
|
1852
1918
|
if (!r)
|
|
1853
1919
|
return n.build();
|
|
1854
1920
|
const o = this.buildScopeContractsIndex(r);
|
|
@@ -1861,7 +1927,7 @@ class Ur {
|
|
|
1861
1927
|
const r = n?.message ?? "Failed to load contracts";
|
|
1862
1928
|
throw new y(
|
|
1863
1929
|
`Failed to load contracts for scope ${t}: ${r}`,
|
|
1864
|
-
|
|
1930
|
+
v.runtimeFatal(
|
|
1865
1931
|
`Failed to load contracts for scope ${t}`,
|
|
1866
1932
|
n
|
|
1867
1933
|
)
|
|
@@ -1872,16 +1938,24 @@ class Ur {
|
|
|
1872
1938
|
const o = n.getType()?.getBlueId();
|
|
1873
1939
|
if (!o)
|
|
1874
1940
|
return;
|
|
1875
|
-
if (
|
|
1941
|
+
if (this.blue.isTypeOfBlueId(n, Ue)) {
|
|
1876
1942
|
this.handleProcessEmbedded(e, t, n);
|
|
1877
1943
|
return;
|
|
1878
1944
|
}
|
|
1879
|
-
const s =
|
|
1945
|
+
const s = Y(
|
|
1946
|
+
this.blue,
|
|
1947
|
+
n,
|
|
1948
|
+
$r
|
|
1949
|
+
);
|
|
1880
1950
|
if (s) {
|
|
1881
1951
|
this.handleMarker(e, t, n, s, o);
|
|
1882
1952
|
return;
|
|
1883
1953
|
}
|
|
1884
|
-
const a =
|
|
1954
|
+
const a = Y(
|
|
1955
|
+
this.blue,
|
|
1956
|
+
n,
|
|
1957
|
+
le
|
|
1958
|
+
);
|
|
1885
1959
|
if (a) {
|
|
1886
1960
|
this.handleChannel(
|
|
1887
1961
|
e,
|
|
@@ -1893,7 +1967,10 @@ class Ur {
|
|
|
1893
1967
|
);
|
|
1894
1968
|
return;
|
|
1895
1969
|
}
|
|
1896
|
-
const c = this.registry.
|
|
1970
|
+
const c = this.registry.lookupChannelForNode(
|
|
1971
|
+
this.blue,
|
|
1972
|
+
n
|
|
1973
|
+
);
|
|
1897
1974
|
if (c) {
|
|
1898
1975
|
this.handleChannel(
|
|
1899
1976
|
e,
|
|
@@ -1905,7 +1982,10 @@ class Ur {
|
|
|
1905
1982
|
);
|
|
1906
1983
|
return;
|
|
1907
1984
|
}
|
|
1908
|
-
const u = this.registry.
|
|
1985
|
+
const u = this.registry.lookupHandlerForNode(
|
|
1986
|
+
this.blue,
|
|
1987
|
+
n
|
|
1988
|
+
);
|
|
1909
1989
|
if (u) {
|
|
1910
1990
|
this.handlerRegistration.register({
|
|
1911
1991
|
builder: e,
|
|
@@ -1917,7 +1997,7 @@ class Ur {
|
|
|
1917
1997
|
});
|
|
1918
1998
|
return;
|
|
1919
1999
|
}
|
|
1920
|
-
const h = this.registry.
|
|
2000
|
+
const h = this.registry.lookupMarkerForNode(this.blue, n);
|
|
1921
2001
|
if (h) {
|
|
1922
2002
|
this.handleMarker(
|
|
1923
2003
|
e,
|
|
@@ -1928,9 +2008,9 @@ class Ur {
|
|
|
1928
2008
|
);
|
|
1929
2009
|
return;
|
|
1930
2010
|
}
|
|
1931
|
-
throw
|
|
2011
|
+
throw je(o) ? new y(
|
|
1932
2012
|
"Built-in processor-managed channel is missing schema registration",
|
|
1933
|
-
|
|
2013
|
+
v.invalidContract(
|
|
1934
2014
|
o,
|
|
1935
2015
|
"Built-in processor-managed channel is missing schema registration",
|
|
1936
2016
|
t
|
|
@@ -1945,17 +2025,17 @@ class Ur {
|
|
|
1945
2025
|
);
|
|
1946
2026
|
e.setEmbedded(r);
|
|
1947
2027
|
} catch (r) {
|
|
1948
|
-
throw
|
|
2028
|
+
throw ue(r) ? new y(
|
|
1949
2029
|
"Failed to parse ProcessEmbedded marker",
|
|
1950
|
-
|
|
1951
|
-
|
|
2030
|
+
v.invalidContract(
|
|
2031
|
+
Ue,
|
|
1952
2032
|
"Failed to parse ProcessEmbedded marker",
|
|
1953
2033
|
t,
|
|
1954
2034
|
r
|
|
1955
2035
|
)
|
|
1956
2036
|
) : new y(
|
|
1957
2037
|
r?.message ?? "Failed to register ProcessEmbedded marker",
|
|
1958
|
-
|
|
2038
|
+
v.illegalState(
|
|
1959
2039
|
r?.message ?? "Failed to register ProcessEmbedded marker"
|
|
1960
2040
|
)
|
|
1961
2041
|
);
|
|
@@ -1967,19 +2047,19 @@ class Ur {
|
|
|
1967
2047
|
n,
|
|
1968
2048
|
r
|
|
1969
2049
|
);
|
|
1970
|
-
|
|
2050
|
+
this.blue.isTypeOfBlueId(n, Ur) && this.validateCompositeChannel(
|
|
1971
2051
|
t,
|
|
1972
2052
|
a,
|
|
1973
2053
|
s,
|
|
1974
2054
|
o
|
|
1975
|
-
), e.addChannel(t, a, o);
|
|
2055
|
+
), e.addChannel(t, a, o, n);
|
|
1976
2056
|
} catch (a) {
|
|
1977
2057
|
if (a instanceof y || a instanceof z)
|
|
1978
2058
|
throw a;
|
|
1979
|
-
if (
|
|
2059
|
+
if (ue(a))
|
|
1980
2060
|
throw new y(
|
|
1981
2061
|
"Failed to parse channel contract",
|
|
1982
|
-
|
|
2062
|
+
v.invalidContract(
|
|
1983
2063
|
o,
|
|
1984
2064
|
"Failed to parse channel contract",
|
|
1985
2065
|
t,
|
|
@@ -1989,7 +2069,7 @@ class Ur {
|
|
|
1989
2069
|
const c = a?.message ?? "Failed to register channel contract";
|
|
1990
2070
|
throw new y(
|
|
1991
2071
|
c,
|
|
1992
|
-
|
|
2072
|
+
v.illegalState(c)
|
|
1993
2073
|
);
|
|
1994
2074
|
}
|
|
1995
2075
|
}
|
|
@@ -2001,34 +2081,33 @@ class Ur {
|
|
|
2001
2081
|
if (!a)
|
|
2002
2082
|
throw new y(
|
|
2003
2083
|
`Composite channel ${e} references unknown channel '${s}'`,
|
|
2004
|
-
|
|
2084
|
+
v.invalidContract(
|
|
2005
2085
|
r,
|
|
2006
2086
|
`Channel '${s}' is not declared in this scope`,
|
|
2007
2087
|
`/contracts/${s}`
|
|
2008
2088
|
)
|
|
2009
2089
|
);
|
|
2010
|
-
if (!this.isRegisteredChannel(a
|
|
2090
|
+
if (!this.isRegisteredChannel(a))
|
|
2011
2091
|
throw new y(
|
|
2012
2092
|
`Contract '${s}' is not a channel`,
|
|
2013
|
-
|
|
2093
|
+
v.invalidContract(
|
|
2014
2094
|
a.nodeTypeBlueId,
|
|
2015
2095
|
`Contract '${s}' is not a channel`,
|
|
2016
2096
|
`/contracts/${s}`
|
|
2017
2097
|
)
|
|
2018
2098
|
);
|
|
2019
2099
|
}
|
|
2020
|
-
|
|
2100
|
+
Ir({
|
|
2021
2101
|
compositeKey: e,
|
|
2022
2102
|
contract: t,
|
|
2023
2103
|
scopeContracts: n,
|
|
2024
2104
|
blueId: r,
|
|
2025
|
-
blue: this.blue
|
|
2026
|
-
compositeChannelBlueId: Ue
|
|
2105
|
+
blue: this.blue
|
|
2027
2106
|
});
|
|
2028
2107
|
}
|
|
2029
2108
|
}
|
|
2030
2109
|
isRegisteredChannel(e) {
|
|
2031
|
-
return
|
|
2110
|
+
return Y(this.blue, e.node, le) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
|
|
2032
2111
|
}
|
|
2033
2112
|
handleMarker(e, t, n, r, o) {
|
|
2034
2113
|
try {
|
|
@@ -2038,10 +2117,10 @@ class Ur {
|
|
|
2038
2117
|
);
|
|
2039
2118
|
e.addMarker(t, s, o);
|
|
2040
2119
|
} catch (s) {
|
|
2041
|
-
if (
|
|
2120
|
+
if (ue(s))
|
|
2042
2121
|
throw new y(
|
|
2043
2122
|
"Failed to parse marker contract",
|
|
2044
|
-
|
|
2123
|
+
v.invalidContract(
|
|
2045
2124
|
o,
|
|
2046
2125
|
"Failed to parse marker contract",
|
|
2047
2126
|
t,
|
|
@@ -2051,7 +2130,7 @@ class Ur {
|
|
|
2051
2130
|
const a = s?.message ?? "Failed to register marker contract";
|
|
2052
2131
|
throw new y(
|
|
2053
2132
|
a,
|
|
2054
|
-
|
|
2133
|
+
v.illegalState(a)
|
|
2055
2134
|
);
|
|
2056
2135
|
}
|
|
2057
2136
|
}
|
|
@@ -2066,18 +2145,18 @@ class Ur {
|
|
|
2066
2145
|
return t;
|
|
2067
2146
|
}
|
|
2068
2147
|
}
|
|
2069
|
-
function
|
|
2070
|
-
return i instanceof
|
|
2148
|
+
function ue(i) {
|
|
2149
|
+
return i instanceof Ee;
|
|
2071
2150
|
}
|
|
2072
|
-
const
|
|
2073
|
-
function
|
|
2151
|
+
const Hr = m["Core/Channel Event Checkpoint"];
|
|
2152
|
+
function Vr(i) {
|
|
2074
2153
|
return i.jsonValueToNode({
|
|
2075
|
-
type: { blueId:
|
|
2154
|
+
type: { blueId: Hr },
|
|
2076
2155
|
lastEvents: {},
|
|
2077
2156
|
lastSignatures: {}
|
|
2078
2157
|
});
|
|
2079
2158
|
}
|
|
2080
|
-
function
|
|
2159
|
+
function Kr() {
|
|
2081
2160
|
return {
|
|
2082
2161
|
lastEvents: {},
|
|
2083
2162
|
lastSignatures: {}
|
|
@@ -2086,7 +2165,7 @@ function Vr() {
|
|
|
2086
2165
|
function $e(i) {
|
|
2087
2166
|
return i != null && Object.prototype.hasOwnProperty.call(i, "lastEvents") && Object.prototype.hasOwnProperty.call(i, "lastSignatures");
|
|
2088
2167
|
}
|
|
2089
|
-
class
|
|
2168
|
+
class Wr {
|
|
2090
2169
|
constructor(e, t, n, r, o) {
|
|
2091
2170
|
this.markerKey = e, this.checkpoint = t, this.channelKey = n, this.lastEventNode = r, this.lastEventSignature = o;
|
|
2092
2171
|
}
|
|
@@ -2096,15 +2175,15 @@ class Hr {
|
|
|
2096
2175
|
return e != null && e === this.lastEventSignature;
|
|
2097
2176
|
}
|
|
2098
2177
|
}
|
|
2099
|
-
class
|
|
2178
|
+
class Gr {
|
|
2100
2179
|
constructor(e, t) {
|
|
2101
2180
|
this.runtime = e, this.signatureFn = t;
|
|
2102
2181
|
}
|
|
2103
2182
|
ensureCheckpointMarker(e, t) {
|
|
2104
|
-
const n = t.marker(A), r =
|
|
2183
|
+
const n = t.marker(A), r = T(e, Qe);
|
|
2105
2184
|
if (!n) {
|
|
2106
|
-
const o =
|
|
2107
|
-
this.runtime.directWrite(r, o), t.registerCheckpointMarker(
|
|
2185
|
+
const o = Vr(this.runtime.blue());
|
|
2186
|
+
this.runtime.directWrite(r, o), t.registerCheckpointMarker(Kr());
|
|
2108
2187
|
return;
|
|
2109
2188
|
}
|
|
2110
2189
|
if (!$e(n))
|
|
@@ -2117,7 +2196,7 @@ class Kr {
|
|
|
2117
2196
|
if (!$e(r))
|
|
2118
2197
|
continue;
|
|
2119
2198
|
const s = (r.lastEvents?.[t] ?? null)?.clone() ?? null, c = r.lastSignatures?.[t] ?? null ?? this.signatureFn(s);
|
|
2120
|
-
return new
|
|
2199
|
+
return new Wr(
|
|
2121
2200
|
n,
|
|
2122
2201
|
r,
|
|
2123
2202
|
t,
|
|
@@ -2133,19 +2212,19 @@ class Kr {
|
|
|
2133
2212
|
persist(e, t, n, r, o) {
|
|
2134
2213
|
if (!n)
|
|
2135
2214
|
return;
|
|
2136
|
-
const s =
|
|
2215
|
+
const s = T(
|
|
2137
2216
|
e,
|
|
2138
2217
|
Ze(n.markerKey, n.channelKey)
|
|
2139
2218
|
), a = o?.clone() ?? null;
|
|
2140
2219
|
this.runtime.gasMeter().chargeCheckpointUpdate(), this.runtime.directWrite(s, 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;
|
|
2141
|
-
const c =
|
|
2220
|
+
const c = T(
|
|
2142
2221
|
e,
|
|
2143
2222
|
et(n.markerKey, n.channelKey)
|
|
2144
2223
|
), u = r == null ? null : new p().setValue(r);
|
|
2145
2224
|
this.runtime.directWrite(c, u), n.checkpoint.lastSignatures || (n.checkpoint.lastSignatures = {}), r == null ? delete n.checkpoint.lastSignatures[n.channelKey] : n.checkpoint.lastSignatures[n.channelKey] = r, n.lastEventSignature = r ?? null;
|
|
2146
2225
|
}
|
|
2147
2226
|
}
|
|
2148
|
-
class
|
|
2227
|
+
class qr {
|
|
2149
2228
|
constructor(e, t, n) {
|
|
2150
2229
|
this.runtime = e, this.checkpointManager = t, this.deps = n;
|
|
2151
2230
|
}
|
|
@@ -2255,7 +2334,7 @@ class Wr {
|
|
|
2255
2334
|
async shouldProcessRelativeToCheckpoint(e, t, n, r, o) {
|
|
2256
2335
|
if (!o?.lastEventNode)
|
|
2257
2336
|
return !0;
|
|
2258
|
-
const s = this.deps.channelProcessorFor(n.
|
|
2337
|
+
const s = this.deps.channelProcessorFor(n.node());
|
|
2259
2338
|
if (!s || typeof s.isNewerEvent != "function")
|
|
2260
2339
|
return !0;
|
|
2261
2340
|
const a = {
|
|
@@ -2272,12 +2351,12 @@ class Wr {
|
|
|
2272
2351
|
);
|
|
2273
2352
|
}
|
|
2274
2353
|
}
|
|
2275
|
-
function
|
|
2354
|
+
function jr(i, e) {
|
|
2276
2355
|
return e.isResolved() ? i.createResolvedNode(e) : i.resolve(e);
|
|
2277
2356
|
}
|
|
2278
2357
|
class $ extends y {
|
|
2279
2358
|
constructor(e) {
|
|
2280
|
-
super(e,
|
|
2359
|
+
super(e, v.illegalState(e)), this.name = "IllegalStateException";
|
|
2281
2360
|
}
|
|
2282
2361
|
}
|
|
2283
2362
|
class F extends Error {
|
|
@@ -2285,8 +2364,8 @@ class F extends Error {
|
|
|
2285
2364
|
super(e), this.name = "BoundaryViolationException";
|
|
2286
2365
|
}
|
|
2287
2366
|
}
|
|
2288
|
-
const
|
|
2289
|
-
class
|
|
2367
|
+
const Jr = m["Core/Document Update Channel"], Qr = m["Core/Embedded Node Channel"], Xr = m["Core/Triggered Event Channel"], Yr = m["Core/Lifecycle Event Channel"], ze = m["Core/Processing Initialized Marker"], Zr = m["Core/Document Processing Initiated"];
|
|
2368
|
+
class ei {
|
|
2290
2369
|
runtime;
|
|
2291
2370
|
contractLoader;
|
|
2292
2371
|
channelRunner;
|
|
@@ -2300,18 +2379,18 @@ class Yr {
|
|
|
2300
2379
|
this.runtime = e.runtime, this.contractLoader = e.contractLoader, this.channelRunner = e.channelRunner, this.bundles = e.bundles, this.hooks = e.hooks, this.blueId = e.blueId, this.nodeAt = e.nodeAt, this.createDocumentUpdateEvent = e.createDocumentUpdateEvent, this.matchesDocumentUpdate = e.matchesDocumentUpdate;
|
|
2301
2380
|
}
|
|
2302
2381
|
async initializeScope(e, t) {
|
|
2303
|
-
const n =
|
|
2382
|
+
const n = b(e), r = /* @__PURE__ */ new Set();
|
|
2304
2383
|
let o = null, s = null;
|
|
2305
2384
|
for (t && this.runtime.gasMeter().chargeScopeEntry(n); ; ) {
|
|
2306
2385
|
const d = this.nodeAt(n);
|
|
2307
2386
|
if (!d)
|
|
2308
2387
|
return;
|
|
2309
2388
|
s || (s = d.clone()), o = this.loadBundle(d, n), this.bundles.set(n, o);
|
|
2310
|
-
const
|
|
2311
|
-
if (!
|
|
2389
|
+
const S = o.embeddedPaths().find((C) => !r.has(C)) ?? null;
|
|
2390
|
+
if (!S)
|
|
2312
2391
|
break;
|
|
2313
|
-
r.add(
|
|
2314
|
-
const f =
|
|
2392
|
+
r.add(S);
|
|
2393
|
+
const f = T(n, S);
|
|
2315
2394
|
this.nodeAt(f) && await this.initializeScope(f, !0);
|
|
2316
2395
|
}
|
|
2317
2396
|
if (!o)
|
|
@@ -2334,22 +2413,22 @@ class Yr {
|
|
|
2334
2413
|
await this.deliverLifecycle(n, o, u, !0), await this.addInitializationMarker(h, c);
|
|
2335
2414
|
}
|
|
2336
2415
|
loadBundles(e) {
|
|
2337
|
-
const t =
|
|
2416
|
+
const t = b(e);
|
|
2338
2417
|
if (this.bundles.has(t))
|
|
2339
2418
|
return;
|
|
2340
|
-
const n = this.nodeAt(t), r = n ? this.loadBundle(n, t) :
|
|
2419
|
+
const n = this.nodeAt(t), r = n ? this.loadBundle(n, t) : H.empty();
|
|
2341
2420
|
this.bundles.set(t, r);
|
|
2342
2421
|
for (const o of r.embeddedPaths()) {
|
|
2343
|
-
const s =
|
|
2422
|
+
const s = T(t, o);
|
|
2344
2423
|
this.loadBundles(s);
|
|
2345
2424
|
}
|
|
2346
2425
|
}
|
|
2347
2426
|
async processExternalEvent(e, t) {
|
|
2348
|
-
const n =
|
|
2427
|
+
const n = jr(this.runtime.blue(), t);
|
|
2349
2428
|
await this.processPreparedExternalEvent(e, n);
|
|
2350
2429
|
}
|
|
2351
2430
|
async processPreparedExternalEvent(e, t) {
|
|
2352
|
-
const n =
|
|
2431
|
+
const n = b(e);
|
|
2353
2432
|
if (this.hooks.isScopeInactive(n))
|
|
2354
2433
|
return;
|
|
2355
2434
|
this.runtime.gasMeter().chargeScopeEntry(n);
|
|
@@ -2364,7 +2443,7 @@ class Yr {
|
|
|
2364
2443
|
for (const s of o) {
|
|
2365
2444
|
if (this.hooks.isScopeInactive(n))
|
|
2366
2445
|
break;
|
|
2367
|
-
|
|
2446
|
+
this.isProcessorManagedChannel(s) || await this.channelRunner.runExternalChannel(
|
|
2368
2447
|
n,
|
|
2369
2448
|
r,
|
|
2370
2449
|
s,
|
|
@@ -2410,8 +2489,9 @@ class Yr {
|
|
|
2410
2489
|
const a = this.bundles.get(s);
|
|
2411
2490
|
if (!a || this.hooks.isScopeInactive(s))
|
|
2412
2491
|
continue;
|
|
2413
|
-
const c = this.createDocumentUpdateEvent(o, s), u =
|
|
2414
|
-
|
|
2492
|
+
const c = this.createDocumentUpdateEvent(o, s), u = this.channelsMatching(
|
|
2493
|
+
a,
|
|
2494
|
+
Jr
|
|
2415
2495
|
);
|
|
2416
2496
|
for (const h of u) {
|
|
2417
2497
|
const d = h.contract();
|
|
@@ -2447,8 +2527,9 @@ class Yr {
|
|
|
2447
2527
|
async deliverLifecycle(e, t, n, r) {
|
|
2448
2528
|
if (this.runtime.gasMeter().chargeLifecycleDelivery(), await this.hooks.recordLifecycleForBridging(e, n), !t)
|
|
2449
2529
|
return;
|
|
2450
|
-
const o =
|
|
2451
|
-
|
|
2530
|
+
const o = this.channelsMatching(
|
|
2531
|
+
t,
|
|
2532
|
+
Yr
|
|
2452
2533
|
);
|
|
2453
2534
|
for (const s of o)
|
|
2454
2535
|
if (await this.channelRunner.runHandlers(
|
|
@@ -2462,14 +2543,14 @@ class Yr {
|
|
|
2462
2543
|
r && await this.finalizeScope(e, t);
|
|
2463
2544
|
}
|
|
2464
2545
|
async processEmbeddedChildren(e, t) {
|
|
2465
|
-
const n =
|
|
2546
|
+
const n = b(e), r = /* @__PURE__ */ new Set();
|
|
2466
2547
|
let o = this.refreshBundle(n);
|
|
2467
2548
|
for (; o; ) {
|
|
2468
2549
|
const s = this.nextEmbeddedPath(o, r);
|
|
2469
2550
|
if (!s)
|
|
2470
2551
|
return o;
|
|
2471
2552
|
r.add(s);
|
|
2472
|
-
const a =
|
|
2553
|
+
const a = T(n, s);
|
|
2473
2554
|
if (a === n || this.hooks.isScopeInactive(a)) {
|
|
2474
2555
|
o = this.refreshBundle(n);
|
|
2475
2556
|
continue;
|
|
@@ -2479,7 +2560,7 @@ class Yr {
|
|
|
2479
2560
|
return null;
|
|
2480
2561
|
}
|
|
2481
2562
|
refreshBundle(e) {
|
|
2482
|
-
const t =
|
|
2563
|
+
const t = b(e), n = this.nodeAt(t);
|
|
2483
2564
|
if (!n)
|
|
2484
2565
|
return this.bundles.delete(t), null;
|
|
2485
2566
|
const r = this.loadBundle(n, t);
|
|
@@ -2502,7 +2583,7 @@ class Yr {
|
|
|
2502
2583
|
const r = n?.message ?? "Failed to load contracts";
|
|
2503
2584
|
throw new y(
|
|
2504
2585
|
r,
|
|
2505
|
-
|
|
2586
|
+
v.runtimeFatal(
|
|
2506
2587
|
`Failed to load contracts for scope ${t}`,
|
|
2507
2588
|
n
|
|
2508
2589
|
)
|
|
@@ -2510,7 +2591,7 @@ class Yr {
|
|
|
2510
2591
|
}
|
|
2511
2592
|
}
|
|
2512
2593
|
async addInitializationMarker(e, t) {
|
|
2513
|
-
const n = new p().setType(new p().setBlueId(ze)).addProperty("documentId", new p().setValue(t)), r = e.resolvePointer(
|
|
2594
|
+
const n = new p().setType(new p().setBlueId(ze)).addProperty("documentId", new p().setValue(t)), r = e.resolvePointer(pe);
|
|
2514
2595
|
await e.applyPatch({
|
|
2515
2596
|
op: "ADD",
|
|
2516
2597
|
path: r,
|
|
@@ -2523,18 +2604,19 @@ class Yr {
|
|
|
2523
2604
|
async bridgeEmbeddedEmissions(e, t) {
|
|
2524
2605
|
if (this.hooks.isScopeInactive(e) || t.embeddedPaths().length === 0)
|
|
2525
2606
|
return;
|
|
2526
|
-
const n =
|
|
2527
|
-
|
|
2607
|
+
const n = this.channelsMatching(
|
|
2608
|
+
t,
|
|
2609
|
+
Qr
|
|
2528
2610
|
);
|
|
2529
2611
|
if (n.length !== 0)
|
|
2530
2612
|
for (const r of t.embeddedPaths()) {
|
|
2531
|
-
const o =
|
|
2613
|
+
const o = T(e, r), a = this.runtime.scope(o).drainBridgeableEvents();
|
|
2532
2614
|
if (a.length !== 0)
|
|
2533
2615
|
for (const c of a) {
|
|
2534
2616
|
let u = !1;
|
|
2535
2617
|
for (const h of n) {
|
|
2536
|
-
const
|
|
2537
|
-
|
|
2618
|
+
const S = h.contract().childPath ?? "/";
|
|
2619
|
+
T(e, S) === o && (u || (this.runtime.gasMeter().chargeBridge(), u = !0), await this.channelRunner.runHandlers(
|
|
2538
2620
|
e,
|
|
2539
2621
|
t,
|
|
2540
2622
|
h.key(),
|
|
@@ -2548,8 +2630,9 @@ class Yr {
|
|
|
2548
2630
|
async drainTriggeredQueue(e, t) {
|
|
2549
2631
|
if (this.hooks.isScopeInactive(e))
|
|
2550
2632
|
return;
|
|
2551
|
-
const n = this.runtime.scope(e), r =
|
|
2552
|
-
|
|
2633
|
+
const n = this.runtime.scope(e), r = this.channelsMatching(
|
|
2634
|
+
t,
|
|
2635
|
+
Xr
|
|
2553
2636
|
);
|
|
2554
2637
|
if (r.length === 0) {
|
|
2555
2638
|
n.clearTriggered();
|
|
@@ -2578,8 +2661,24 @@ class Yr {
|
|
|
2578
2661
|
}
|
|
2579
2662
|
}
|
|
2580
2663
|
}
|
|
2664
|
+
channelsMatching(e, ...t) {
|
|
2665
|
+
if (t.length === 0)
|
|
2666
|
+
return e.channelsOfType();
|
|
2667
|
+
const n = this.runtime.blue();
|
|
2668
|
+
return e.channelsOfType().filter((r) => {
|
|
2669
|
+
const o = r.node();
|
|
2670
|
+
return t.some((s) => n.isTypeOfBlueId(o, s));
|
|
2671
|
+
});
|
|
2672
|
+
}
|
|
2673
|
+
isProcessorManagedChannel(e) {
|
|
2674
|
+
const t = this.runtime.blue(), n = e.node();
|
|
2675
|
+
for (const r of Ce)
|
|
2676
|
+
if (t.isTypeOfBlueId(n, r))
|
|
2677
|
+
return !0;
|
|
2678
|
+
return !1;
|
|
2679
|
+
}
|
|
2581
2680
|
validatePatchBoundary(e, t, n) {
|
|
2582
|
-
const r =
|
|
2681
|
+
const r = b(e), o = P(n.path);
|
|
2583
2682
|
if (o === r)
|
|
2584
2683
|
throw new F(
|
|
2585
2684
|
`Self-root mutation is forbidden at scope ${r}`
|
|
@@ -2589,7 +2688,7 @@ class Yr {
|
|
|
2589
2688
|
`Patch path ${o} is outside scope ${r}`
|
|
2590
2689
|
);
|
|
2591
2690
|
for (const s of t.embeddedPaths()) {
|
|
2592
|
-
const a =
|
|
2691
|
+
const a = T(r, s);
|
|
2593
2692
|
if (o.startsWith(`${a}/`))
|
|
2594
2693
|
throw new F(
|
|
2595
2694
|
`Boundary violation: patch ${o} enters embedded scope ${a}`
|
|
@@ -2599,11 +2698,11 @@ class Yr {
|
|
|
2599
2698
|
enforceReservedKeyWriteProtection(e, t, n) {
|
|
2600
2699
|
if (n)
|
|
2601
2700
|
return;
|
|
2602
|
-
const r =
|
|
2603
|
-
for (const s of
|
|
2604
|
-
const a =
|
|
2701
|
+
const r = b(e), o = P(t.path);
|
|
2702
|
+
for (const s of ye) {
|
|
2703
|
+
const a = T(
|
|
2605
2704
|
r,
|
|
2606
|
-
|
|
2705
|
+
ie(s)
|
|
2607
2706
|
);
|
|
2608
2707
|
if (o === a || o.startsWith(`${a}/`))
|
|
2609
2708
|
throw new F(
|
|
@@ -2616,12 +2715,12 @@ class Yr {
|
|
|
2616
2715
|
return;
|
|
2617
2716
|
const r = P(n.path);
|
|
2618
2717
|
for (const o of t.embeddedPaths()) {
|
|
2619
|
-
const s =
|
|
2718
|
+
const s = T(e, o);
|
|
2620
2719
|
r === s && (n.op === "remove" || n.op === "replace") && await this.hooks.markCutOff(s);
|
|
2621
2720
|
}
|
|
2622
2721
|
}
|
|
2623
2722
|
hasInitializationMarker(e) {
|
|
2624
|
-
const t =
|
|
2723
|
+
const t = T(e, pe), n = this.nodeAt(t);
|
|
2625
2724
|
if (!n)
|
|
2626
2725
|
return !1;
|
|
2627
2726
|
if (!(n instanceof p)) {
|
|
@@ -2635,69 +2734,69 @@ class Yr {
|
|
|
2635
2734
|
return !0;
|
|
2636
2735
|
}
|
|
2637
2736
|
createLifecycleEvent(e) {
|
|
2638
|
-
return new p().setType(new p().setBlueId(
|
|
2737
|
+
return new p().setType(new p().setBlueId(Zr)).setProperties({
|
|
2639
2738
|
type: new p().setValue("Core/Document Processing Initiated"),
|
|
2640
2739
|
documentId: new p().setValue(e)
|
|
2641
2740
|
});
|
|
2642
2741
|
}
|
|
2643
2742
|
}
|
|
2644
|
-
class
|
|
2743
|
+
class ne extends Error {
|
|
2645
2744
|
constructor(e) {
|
|
2646
2745
|
super(
|
|
2647
2746
|
e ? "Processing terminated due to fatal error" : "Processing terminated"
|
|
2648
2747
|
), this.fatal = e, this.name = "RunTerminationError";
|
|
2649
2748
|
}
|
|
2650
2749
|
}
|
|
2651
|
-
const
|
|
2652
|
-
class
|
|
2750
|
+
const ti = m["Core/Processing Terminated Marker"], ni = m["Core/Document Processing Terminated"];
|
|
2751
|
+
class ri {
|
|
2653
2752
|
constructor(e) {
|
|
2654
2753
|
this.runtime = e;
|
|
2655
2754
|
}
|
|
2656
2755
|
async terminateScope(e, t, n, r, o) {
|
|
2657
2756
|
e.recordPendingTermination(t, r, o ?? null);
|
|
2658
|
-
const s = e.normalizeScope(t), a =
|
|
2757
|
+
const s = e.normalizeScope(t), a = T(s, Je);
|
|
2659
2758
|
this.runtime.directWrite(
|
|
2660
2759
|
a,
|
|
2661
|
-
|
|
2760
|
+
ii(this.runtime.blue(), r, o)
|
|
2662
2761
|
), this.runtime.gasMeter().chargeTerminationMarker();
|
|
2663
|
-
const c = n ?? e.bundleForScope(s) ?? null, u =
|
|
2762
|
+
const c = n ?? e.bundleForScope(s) ?? null, u = oi(r, o);
|
|
2664
2763
|
if (await e.deliverLifecycle(
|
|
2665
2764
|
s,
|
|
2666
2765
|
c,
|
|
2667
2766
|
u,
|
|
2668
2767
|
!1
|
|
2669
2768
|
), this.runtime.scope(s).finalizeTermination(r, o ?? null), e.clearPendingTermination(t), r === "FATAL" && this.runtime.gasMeter().chargeFatalTerminationOverhead(), r === "FATAL" && s === "/")
|
|
2670
|
-
throw this.runtime.markRunTerminated(), new
|
|
2769
|
+
throw this.runtime.markRunTerminated(), new ne(!0);
|
|
2671
2770
|
if (r === "GRACEFUL" && s === "/")
|
|
2672
|
-
throw this.runtime.markRunTerminated(), new
|
|
2771
|
+
throw this.runtime.markRunTerminated(), new ne(!1);
|
|
2673
2772
|
}
|
|
2674
2773
|
}
|
|
2675
|
-
function
|
|
2676
|
-
return
|
|
2677
|
-
type: { blueId:
|
|
2774
|
+
function ii(i, e, t) {
|
|
2775
|
+
return si(i, {
|
|
2776
|
+
type: { blueId: ti },
|
|
2678
2777
|
cause: e === "GRACEFUL" ? "graceful" : "fatal",
|
|
2679
2778
|
...t ? { reason: t } : {}
|
|
2680
2779
|
});
|
|
2681
2780
|
}
|
|
2682
|
-
function
|
|
2781
|
+
function oi(i, e) {
|
|
2683
2782
|
const t = new p().setType(
|
|
2684
|
-
new p().setBlueId(
|
|
2783
|
+
new p().setBlueId(ni)
|
|
2685
2784
|
);
|
|
2686
2785
|
return t.addProperty(
|
|
2687
2786
|
"cause",
|
|
2688
2787
|
new p().setValue(i === "GRACEFUL" ? "graceful" : "fatal")
|
|
2689
2788
|
), e && t.addProperty("reason", new p().setValue(e)), t;
|
|
2690
2789
|
}
|
|
2691
|
-
function
|
|
2790
|
+
function si(i, e) {
|
|
2692
2791
|
return i.jsonValueToNode(e);
|
|
2693
2792
|
}
|
|
2694
2793
|
const j = "-";
|
|
2695
|
-
class
|
|
2794
|
+
class ai {
|
|
2696
2795
|
constructor(e) {
|
|
2697
2796
|
this.document = e;
|
|
2698
2797
|
}
|
|
2699
2798
|
applyPatch(e, t) {
|
|
2700
|
-
const n =
|
|
2799
|
+
const n = b(e), r = P(t.path), o = Ve(r), s = He(this.document, o, "before", r);
|
|
2701
2800
|
switch (t.op) {
|
|
2702
2801
|
case "ADD":
|
|
2703
2802
|
this.applyAdd(o, r, t.val ?? null);
|
|
@@ -2709,21 +2808,21 @@ class oi {
|
|
|
2709
2808
|
this.applyRemove(o, r);
|
|
2710
2809
|
break;
|
|
2711
2810
|
}
|
|
2712
|
-
const a = t.op === "REMOVE" ? null :
|
|
2811
|
+
const a = t.op === "REMOVE" ? null : He(this.document, o, "after", r);
|
|
2713
2812
|
return {
|
|
2714
2813
|
path: r,
|
|
2715
2814
|
before: s,
|
|
2716
2815
|
after: a,
|
|
2717
2816
|
op: t.op.toLowerCase(),
|
|
2718
2817
|
originScope: n,
|
|
2719
|
-
cascadeScopes:
|
|
2818
|
+
cascadeScopes: ci(n)
|
|
2720
2819
|
};
|
|
2721
2820
|
}
|
|
2722
2821
|
directWrite(e, t) {
|
|
2723
2822
|
const n = P(e);
|
|
2724
2823
|
if (n === "/")
|
|
2725
2824
|
throw new Error("Direct write cannot target root document");
|
|
2726
|
-
const r =
|
|
2825
|
+
const r = Ve(n), { parent: o, leaf: s } = this.resolveParent(r);
|
|
2727
2826
|
if (s === j)
|
|
2728
2827
|
throw new Error(
|
|
2729
2828
|
`Direct write does not support append token '-' for path ${n}`
|
|
@@ -2736,7 +2835,7 @@ class oi {
|
|
|
2736
2835
|
this.directWriteObject(o, s, t);
|
|
2737
2836
|
}
|
|
2738
2837
|
directWriteArray(e, t, n, r, o) {
|
|
2739
|
-
const s =
|
|
2838
|
+
const s = he(e, t), a = x(n, o);
|
|
2740
2839
|
if (r == null) {
|
|
2741
2840
|
if (a < 0 || a >= s.length)
|
|
2742
2841
|
return;
|
|
@@ -2783,7 +2882,7 @@ class oi {
|
|
|
2783
2882
|
);
|
|
2784
2883
|
const o = e.getItems();
|
|
2785
2884
|
if (o && U(t)) {
|
|
2786
|
-
const c =
|
|
2885
|
+
const c = x(t, G(n, r));
|
|
2787
2886
|
if (c < 0 || c >= o.length)
|
|
2788
2887
|
throw new Error(
|
|
2789
2888
|
`Array index out of bounds: ${G(n, r)}`
|
|
@@ -2815,13 +2914,13 @@ class oi {
|
|
|
2815
2914
|
h ? `Append token '-' requires array at ${s}` : `Array index segment requires array at ${s}`
|
|
2816
2915
|
);
|
|
2817
2916
|
if (h) {
|
|
2818
|
-
|
|
2917
|
+
he(r, u).push(q(n));
|
|
2819
2918
|
return;
|
|
2820
2919
|
}
|
|
2821
|
-
const d =
|
|
2920
|
+
const d = x(o, t);
|
|
2822
2921
|
if (d < 0 || d > u.length)
|
|
2823
2922
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2824
|
-
|
|
2923
|
+
he(r, u).splice(d, 0, q(n));
|
|
2825
2924
|
return;
|
|
2826
2925
|
}
|
|
2827
2926
|
const c = X(r);
|
|
@@ -2843,7 +2942,7 @@ class oi {
|
|
|
2843
2942
|
const c = r.getItems();
|
|
2844
2943
|
if (!c)
|
|
2845
2944
|
throw new Error(`Array index segment requires array at ${t}`);
|
|
2846
|
-
const u =
|
|
2945
|
+
const u = x(o, t);
|
|
2847
2946
|
if (u < 0 || u >= c.length)
|
|
2848
2947
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2849
2948
|
c[u] = q(n), r.setItems(c);
|
|
@@ -2867,7 +2966,7 @@ class oi {
|
|
|
2867
2966
|
const a = n.getItems();
|
|
2868
2967
|
if (!a)
|
|
2869
2968
|
throw new Error(`Array index segment requires array at ${t}`);
|
|
2870
|
-
const c =
|
|
2969
|
+
const c = x(r, t);
|
|
2871
2970
|
if (c < 0 || c >= a.length)
|
|
2872
2971
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2873
2972
|
a.splice(c, 1), n.setItems(a);
|
|
@@ -2887,13 +2986,13 @@ class oi {
|
|
|
2887
2986
|
for (let a = 0; a < e.length - 1; a += 1) {
|
|
2888
2987
|
const c = e[a], u = G(e, a + 1);
|
|
2889
2988
|
if (U(c)) {
|
|
2890
|
-
const
|
|
2891
|
-
if (!
|
|
2989
|
+
const S = r.getItems();
|
|
2990
|
+
if (!S)
|
|
2892
2991
|
throw new Error(`Array index segment requires array at ${u}`);
|
|
2893
|
-
const f =
|
|
2894
|
-
if (f < 0 || f >=
|
|
2992
|
+
const f = x(c, u);
|
|
2993
|
+
if (f < 0 || f >= S.length)
|
|
2895
2994
|
throw new Error(`Array index out of bounds in path: ${u}`);
|
|
2896
|
-
const E =
|
|
2995
|
+
const E = S[f];
|
|
2897
2996
|
if (!(E instanceof p))
|
|
2898
2997
|
throw new Error(`Array index out of bounds in path: ${u}`);
|
|
2899
2998
|
r = E;
|
|
@@ -2917,7 +3016,7 @@ class oi {
|
|
|
2917
3016
|
}
|
|
2918
3017
|
}
|
|
2919
3018
|
}
|
|
2920
|
-
function
|
|
3019
|
+
function ci(i) {
|
|
2921
3020
|
const e = [];
|
|
2922
3021
|
let t = i;
|
|
2923
3022
|
for (; e.push(t), t !== "/"; ) {
|
|
@@ -2926,26 +3025,26 @@ function si(i) {
|
|
|
2926
3025
|
}
|
|
2927
3026
|
return e;
|
|
2928
3027
|
}
|
|
2929
|
-
function
|
|
3028
|
+
function He(i, e, t, n) {
|
|
2930
3029
|
try {
|
|
2931
3030
|
if (e.length === 0)
|
|
2932
3031
|
return i.clone();
|
|
2933
|
-
const r =
|
|
3032
|
+
const r = li(i, e, t, n);
|
|
2934
3033
|
return r ? r.clone() : null;
|
|
2935
3034
|
} catch {
|
|
2936
3035
|
return null;
|
|
2937
3036
|
}
|
|
2938
3037
|
}
|
|
2939
|
-
function
|
|
3038
|
+
function li(i, e, t, n) {
|
|
2940
3039
|
let r = i;
|
|
2941
3040
|
for (let o = 0; o < e.length; o += 1) {
|
|
2942
3041
|
const s = e[o] ?? "", a = o === e.length - 1;
|
|
2943
|
-
if (r =
|
|
3042
|
+
if (r = ui(r, s, a, t, n), !r)
|
|
2944
3043
|
return null;
|
|
2945
3044
|
}
|
|
2946
3045
|
return r;
|
|
2947
3046
|
}
|
|
2948
|
-
function
|
|
3047
|
+
function ui(i, e, t, n, r) {
|
|
2949
3048
|
if (!i)
|
|
2950
3049
|
return null;
|
|
2951
3050
|
const o = i.getItems();
|
|
@@ -2955,7 +3054,7 @@ function ci(i, e, t, n, r) {
|
|
|
2955
3054
|
throw new Error(`Append token '-' must be final segment: ${r}`);
|
|
2956
3055
|
return n === "before" || o.length === 0 ? null : o[o.length - 1] ?? null;
|
|
2957
3056
|
}
|
|
2958
|
-
const c =
|
|
3057
|
+
const c = x(e, r);
|
|
2959
3058
|
return c < 0 || c >= o.length ? null : o[c] ?? null;
|
|
2960
3059
|
}
|
|
2961
3060
|
const s = i.getProperties();
|
|
@@ -2964,13 +3063,13 @@ function ci(i, e, t, n, r) {
|
|
|
2964
3063
|
const a = s[e];
|
|
2965
3064
|
return a instanceof p ? a : null;
|
|
2966
3065
|
}
|
|
2967
|
-
function
|
|
3066
|
+
function Ve(i) {
|
|
2968
3067
|
if (i === "/" || i === "")
|
|
2969
3068
|
return [];
|
|
2970
3069
|
const e = i.startsWith("/") ? i.slice(1) : i;
|
|
2971
3070
|
return e.length === 0 ? [] : e.split("/");
|
|
2972
3071
|
}
|
|
2973
|
-
function
|
|
3072
|
+
function x(i, e) {
|
|
2974
3073
|
const t = Number.parseInt(i, 10);
|
|
2975
3074
|
if (Number.isNaN(t))
|
|
2976
3075
|
throw new Error(`Expected numeric array index in path: ${e}`);
|
|
@@ -2987,7 +3086,7 @@ function G(i, e) {
|
|
|
2987
3086
|
n += `/${i[r] ?? ""}`;
|
|
2988
3087
|
return n === "" ? "/" : n;
|
|
2989
3088
|
}
|
|
2990
|
-
function
|
|
3089
|
+
function he(i, e) {
|
|
2991
3090
|
const t = [...e];
|
|
2992
3091
|
return i.setItems(t), t;
|
|
2993
3092
|
}
|
|
@@ -3006,7 +3105,7 @@ function U(i) {
|
|
|
3006
3105
|
function q(i) {
|
|
3007
3106
|
return i == null ? new p().setValue(null) : i.clone();
|
|
3008
3107
|
}
|
|
3009
|
-
class
|
|
3108
|
+
class hi {
|
|
3010
3109
|
constructor(e) {
|
|
3011
3110
|
this.path = e;
|
|
3012
3111
|
}
|
|
@@ -3068,7 +3167,7 @@ class li {
|
|
|
3068
3167
|
return this.cutOff;
|
|
3069
3168
|
}
|
|
3070
3169
|
}
|
|
3071
|
-
class
|
|
3170
|
+
class di {
|
|
3072
3171
|
scopesMap = /* @__PURE__ */ new Map();
|
|
3073
3172
|
rootEmissionList = [];
|
|
3074
3173
|
scopes() {
|
|
@@ -3076,7 +3175,7 @@ class ui {
|
|
|
3076
3175
|
}
|
|
3077
3176
|
scope(e) {
|
|
3078
3177
|
let t = this.scopesMap.get(e);
|
|
3079
|
-
return t || (t = new
|
|
3178
|
+
return t || (t = new hi(e), this.scopesMap.set(e, t)), t;
|
|
3080
3179
|
}
|
|
3081
3180
|
existingScope(e) {
|
|
3082
3181
|
return this.scopesMap.get(e);
|
|
@@ -3097,30 +3196,30 @@ class ui {
|
|
|
3097
3196
|
function Ct(i) {
|
|
3098
3197
|
return Math.floor((i + 99) / 100);
|
|
3099
3198
|
}
|
|
3100
|
-
function
|
|
3199
|
+
function pi(i) {
|
|
3101
3200
|
const e = P(i);
|
|
3102
3201
|
return e === "/" ? 0 : e.split("/").length - 1;
|
|
3103
3202
|
}
|
|
3104
|
-
function
|
|
3203
|
+
function fi(i) {
|
|
3105
3204
|
return 40 + 5 * Math.max(0, i);
|
|
3106
3205
|
}
|
|
3107
|
-
function
|
|
3108
|
-
return 8 +
|
|
3206
|
+
function mi(i, e) {
|
|
3207
|
+
return 8 + pi(i) + Ct(e);
|
|
3109
3208
|
}
|
|
3110
|
-
const
|
|
3111
|
-
function
|
|
3209
|
+
const gi = 1e3, Ei = 5, yi = 50, Ci = 2, vi = 10, Si = 10, wi = 10, bi = 20, ki = 20, Ii = 30, Ti = 30, Pi = 100;
|
|
3210
|
+
function Mi(i) {
|
|
3112
3211
|
return 50 + 10 * i;
|
|
3113
3212
|
}
|
|
3114
|
-
function
|
|
3213
|
+
function Ri(i) {
|
|
3115
3214
|
return 20 + i;
|
|
3116
3215
|
}
|
|
3117
|
-
function
|
|
3216
|
+
function Ni(i) {
|
|
3118
3217
|
return 10 * i;
|
|
3119
3218
|
}
|
|
3120
|
-
function
|
|
3219
|
+
function Oi(i) {
|
|
3121
3220
|
return 20 + i;
|
|
3122
3221
|
}
|
|
3123
|
-
class
|
|
3222
|
+
class Ai {
|
|
3124
3223
|
constructor(e) {
|
|
3125
3224
|
this.blue = e;
|
|
3126
3225
|
}
|
|
@@ -3132,59 +3231,59 @@ class Ni {
|
|
|
3132
3231
|
this.total += e;
|
|
3133
3232
|
}
|
|
3134
3233
|
chargeScopeEntry(e) {
|
|
3135
|
-
this.add(
|
|
3234
|
+
this.add(Mi(this.scopeDepth(e)));
|
|
3136
3235
|
}
|
|
3137
3236
|
chargeInitialization() {
|
|
3138
|
-
this.add(
|
|
3237
|
+
this.add(gi);
|
|
3139
3238
|
}
|
|
3140
3239
|
chargeChannelMatchAttempt() {
|
|
3141
|
-
this.add(
|
|
3240
|
+
this.add(Ei);
|
|
3142
3241
|
}
|
|
3143
3242
|
chargeHandlerOverhead() {
|
|
3144
|
-
this.add(
|
|
3243
|
+
this.add(yi);
|
|
3145
3244
|
}
|
|
3146
3245
|
chargeBoundaryCheck() {
|
|
3147
|
-
this.add(
|
|
3246
|
+
this.add(Ci);
|
|
3148
3247
|
}
|
|
3149
3248
|
chargePatchAddOrReplace(e) {
|
|
3150
|
-
this.add(
|
|
3249
|
+
this.add(Ri(this.payloadSizeCharge(e)));
|
|
3151
3250
|
}
|
|
3152
3251
|
chargePatchRemove() {
|
|
3153
|
-
this.add(
|
|
3252
|
+
this.add(vi);
|
|
3154
3253
|
}
|
|
3155
3254
|
chargeCascadeRouting(e) {
|
|
3156
|
-
e > 0 && this.add(
|
|
3255
|
+
e > 0 && this.add(Ni(e));
|
|
3157
3256
|
}
|
|
3158
3257
|
chargeEmitEvent(e) {
|
|
3159
|
-
this.add(
|
|
3258
|
+
this.add(Oi(this.payloadSizeCharge(e)));
|
|
3160
3259
|
}
|
|
3161
3260
|
chargeBridge() {
|
|
3162
|
-
this.add(
|
|
3261
|
+
this.add(Si);
|
|
3163
3262
|
}
|
|
3164
3263
|
chargeDrainEvent() {
|
|
3165
|
-
this.add(
|
|
3264
|
+
this.add(wi);
|
|
3166
3265
|
}
|
|
3167
3266
|
chargeCheckpointUpdate() {
|
|
3168
|
-
this.add(
|
|
3267
|
+
this.add(bi);
|
|
3169
3268
|
}
|
|
3170
3269
|
chargeTerminationMarker() {
|
|
3171
|
-
this.add(
|
|
3270
|
+
this.add(ki);
|
|
3172
3271
|
}
|
|
3173
3272
|
chargeLifecycleDelivery() {
|
|
3174
|
-
this.add(
|
|
3273
|
+
this.add(Ii);
|
|
3175
3274
|
}
|
|
3176
3275
|
chargeFatalTerminationOverhead() {
|
|
3177
|
-
this.add(
|
|
3276
|
+
this.add(Pi);
|
|
3178
3277
|
}
|
|
3179
3278
|
chargeTriggerEventBase() {
|
|
3180
|
-
this.add(
|
|
3279
|
+
this.add(Ti);
|
|
3181
3280
|
}
|
|
3182
3281
|
chargeUpdateDocumentBase(e) {
|
|
3183
|
-
this.add(
|
|
3282
|
+
this.add(fi(e));
|
|
3184
3283
|
}
|
|
3185
3284
|
chargeDocumentSnapshot(e, t) {
|
|
3186
|
-
const n = t ?
|
|
3187
|
-
this.add(
|
|
3285
|
+
const n = t ? Ne(this.blue, t) : 0;
|
|
3286
|
+
this.add(mi(e, n));
|
|
3188
3287
|
}
|
|
3189
3288
|
chargeWasmGas(e) {
|
|
3190
3289
|
const t = Jt(e);
|
|
@@ -3193,11 +3292,11 @@ class Ni {
|
|
|
3193
3292
|
payloadSizeCharge(e) {
|
|
3194
3293
|
if (!e)
|
|
3195
3294
|
return 0;
|
|
3196
|
-
const t =
|
|
3295
|
+
const t = Ne(this.blue, e);
|
|
3197
3296
|
return Ct(t);
|
|
3198
3297
|
}
|
|
3199
3298
|
scopeDepth(e) {
|
|
3200
|
-
const t =
|
|
3299
|
+
const t = b(e);
|
|
3201
3300
|
if (t === "/" || t.length <= 1)
|
|
3202
3301
|
return 0;
|
|
3203
3302
|
let n = 1;
|
|
@@ -3206,12 +3305,12 @@ class Ni {
|
|
|
3206
3305
|
return n;
|
|
3207
3306
|
}
|
|
3208
3307
|
}
|
|
3209
|
-
class
|
|
3308
|
+
class Di {
|
|
3210
3309
|
constructor(e, t) {
|
|
3211
|
-
this.documentRef = e, this.blueRef = t, this.patchEngine = new
|
|
3310
|
+
this.documentRef = e, this.blueRef = t, this.patchEngine = new ai(this.documentRef), this.meter = new Ai(this.blueRef);
|
|
3212
3311
|
}
|
|
3213
3312
|
patchEngine;
|
|
3214
|
-
emissionRegistry = new
|
|
3313
|
+
emissionRegistry = new di();
|
|
3215
3314
|
meter;
|
|
3216
3315
|
runTerminated = !1;
|
|
3217
3316
|
document() {
|
|
@@ -3260,15 +3359,15 @@ class Oi {
|
|
|
3260
3359
|
return this.patchEngine.applyPatch(e, t);
|
|
3261
3360
|
}
|
|
3262
3361
|
}
|
|
3263
|
-
const
|
|
3264
|
-
class
|
|
3362
|
+
const Bi = m["Core/Processing Initialized Marker"], xi = m["Core/Document Update"];
|
|
3363
|
+
class _i {
|
|
3265
3364
|
constructor(e, t, n, r) {
|
|
3266
|
-
this.contractLoader = e, this.registry = t, this.runtimeRef = new
|
|
3365
|
+
this.contractLoader = e, this.registry = t, this.runtimeRef = new Di(r, n);
|
|
3267
3366
|
const o = (s) => nt(this.runtimeRef.blue(), s);
|
|
3268
|
-
this.checkpointManager = new
|
|
3367
|
+
this.checkpointManager = new Gr(
|
|
3269
3368
|
this.runtimeRef,
|
|
3270
3369
|
o
|
|
3271
|
-
), this.terminationService = new
|
|
3370
|
+
), this.terminationService = new ri(this.runtimeRef), this.channelRunner = new qr(
|
|
3272
3371
|
this.runtimeRef,
|
|
3273
3372
|
this.checkpointManager,
|
|
3274
3373
|
{
|
|
@@ -3282,12 +3381,12 @@ class Bi {
|
|
|
3282
3381
|
!1
|
|
3283
3382
|
),
|
|
3284
3383
|
shouldRunHandler: async (s, a) => {
|
|
3285
|
-
const c = this.
|
|
3384
|
+
const c = this.lookupHandlerProcessor(s);
|
|
3286
3385
|
if (!c) {
|
|
3287
3386
|
const h = `No processor registered for handler contract ${s.blueId()}`;
|
|
3288
3387
|
throw new y(
|
|
3289
3388
|
h,
|
|
3290
|
-
|
|
3389
|
+
v.illegalState(h)
|
|
3291
3390
|
);
|
|
3292
3391
|
}
|
|
3293
3392
|
const u = c.matches;
|
|
@@ -3296,9 +3395,9 @@ class Bi {
|
|
|
3296
3395
|
executeHandler: async (s, a) => this.executeHandler(s, a),
|
|
3297
3396
|
handleHandlerError: async (s, a, c) => this.handleHandlerError(s, a, c),
|
|
3298
3397
|
canonicalSignature: o,
|
|
3299
|
-
channelProcessorFor: (s) => this.
|
|
3398
|
+
channelProcessorFor: (s) => this.lookupChannelProcessor(s)
|
|
3300
3399
|
}
|
|
3301
|
-
), this.scopeExecutor = new
|
|
3400
|
+
), this.scopeExecutor = new ei({
|
|
3302
3401
|
runtime: this.runtimeRef,
|
|
3303
3402
|
contractLoader: this.contractLoader,
|
|
3304
3403
|
channelRunner: this.channelRunner,
|
|
@@ -3349,7 +3448,7 @@ class Bi {
|
|
|
3349
3448
|
);
|
|
3350
3449
|
}
|
|
3351
3450
|
createContext(e, t, n, r = !1, o = !1) {
|
|
3352
|
-
return new
|
|
3451
|
+
return new Li(
|
|
3353
3452
|
this,
|
|
3354
3453
|
t,
|
|
3355
3454
|
e,
|
|
@@ -3370,10 +3469,10 @@ class Bi {
|
|
|
3370
3469
|
return this.runtimeRef;
|
|
3371
3470
|
}
|
|
3372
3471
|
bundleForScope(e) {
|
|
3373
|
-
return this.bundles.get(
|
|
3472
|
+
return this.bundles.get(b(e));
|
|
3374
3473
|
}
|
|
3375
3474
|
isScopeInactive(e) {
|
|
3376
|
-
const t =
|
|
3475
|
+
const t = b(e);
|
|
3377
3476
|
return this.cutOffScopes.has(t) || this.pendingTerminations.has(t) || this.runtimeRef.isScopeTerminated(t);
|
|
3378
3477
|
}
|
|
3379
3478
|
async enterGracefulTermination(e, t, n) {
|
|
@@ -3383,13 +3482,13 @@ class Bi {
|
|
|
3383
3482
|
await this.terminate(e, t, "FATAL", n);
|
|
3384
3483
|
}
|
|
3385
3484
|
recordPendingTermination(e, t, n) {
|
|
3386
|
-
this.pendingTerminations.set(
|
|
3485
|
+
this.pendingTerminations.set(b(e), { kind: t, reason: n });
|
|
3387
3486
|
}
|
|
3388
3487
|
clearPendingTermination(e) {
|
|
3389
|
-
this.pendingTerminations.delete(
|
|
3488
|
+
this.pendingTerminations.delete(b(e));
|
|
3390
3489
|
}
|
|
3391
3490
|
async markCutOff(e) {
|
|
3392
|
-
const t =
|
|
3491
|
+
const t = b(e);
|
|
3393
3492
|
this.cutOffScopes.add(t) && this.runtimeRef.existingScope(t)?.markCutOff();
|
|
3394
3493
|
}
|
|
3395
3494
|
async deliverLifecycle(e, t, n, r) {
|
|
@@ -3404,13 +3503,13 @@ class Bi {
|
|
|
3404
3503
|
this.runtimeRef.scope(e).recordBridgeable(t.clone()), e === "/" && this.runtimeRef.recordRootEmission(t.clone());
|
|
3405
3504
|
}
|
|
3406
3505
|
normalizeScope(e) {
|
|
3407
|
-
return
|
|
3506
|
+
return b(e);
|
|
3408
3507
|
}
|
|
3409
3508
|
resolvePointer(e, t) {
|
|
3410
|
-
return
|
|
3509
|
+
return T(e, t);
|
|
3411
3510
|
}
|
|
3412
3511
|
async terminate(e, t, n, r) {
|
|
3413
|
-
const o =
|
|
3512
|
+
const o = b(e);
|
|
3414
3513
|
this.pendingTerminations.has(o) || this.runtimeRef.isScopeTerminated(o) || (this.pendingTerminations.set(o, { kind: n, reason: r }), await this.terminationService.terminateScope(
|
|
3415
3514
|
this,
|
|
3416
3515
|
e,
|
|
@@ -3420,13 +3519,13 @@ class Bi {
|
|
|
3420
3519
|
));
|
|
3421
3520
|
}
|
|
3422
3521
|
nodeAt(e) {
|
|
3423
|
-
const t =
|
|
3424
|
-
return
|
|
3522
|
+
const t = b(e);
|
|
3523
|
+
return re.nodeAt(this.runtimeRef.document(), t, {
|
|
3425
3524
|
calculateBlueId: (n) => this.runtimeRef.blue().calculateBlueIdSync(n)
|
|
3426
3525
|
});
|
|
3427
3526
|
}
|
|
3428
3527
|
async evaluateChannel(e, t, n, r) {
|
|
3429
|
-
const o = this.
|
|
3528
|
+
const o = this.lookupChannelProcessor(e.node());
|
|
3430
3529
|
if (!o)
|
|
3431
3530
|
return { matches: !1 };
|
|
3432
3531
|
const s = this.runtimeRef.blue().calculateBlueIdSync(r), a = r.clone(), c = e.contract(), u = c.event;
|
|
@@ -3439,7 +3538,7 @@ class Bi {
|
|
|
3439
3538
|
markers: t.markers(),
|
|
3440
3539
|
bindingKey: e.key(),
|
|
3441
3540
|
resolveChannel: (C) => t.channelEntry(C),
|
|
3442
|
-
channelProcessorFor: (C) => this.
|
|
3541
|
+
channelProcessorFor: (C) => this.lookupChannelProcessor(C)
|
|
3443
3542
|
}, d = o.evaluate;
|
|
3444
3543
|
if (typeof d == "function")
|
|
3445
3544
|
return await d.call(o, c, h);
|
|
@@ -3453,12 +3552,12 @@ class Bi {
|
|
|
3453
3552
|
};
|
|
3454
3553
|
}
|
|
3455
3554
|
async executeHandler(e, t) {
|
|
3456
|
-
const n = this.
|
|
3555
|
+
const n = this.lookupHandlerProcessor(e);
|
|
3457
3556
|
if (!n) {
|
|
3458
3557
|
const r = `No processor registered for handler contract ${e.blueId()}`;
|
|
3459
3558
|
throw new y(
|
|
3460
3559
|
r,
|
|
3461
|
-
|
|
3560
|
+
v.illegalState(r)
|
|
3462
3561
|
);
|
|
3463
3562
|
}
|
|
3464
3563
|
await n.execute(e.contract(), t, {
|
|
@@ -3472,7 +3571,7 @@ class Bi {
|
|
|
3472
3571
|
* the outer run logic can react according to spec (§22).
|
|
3473
3572
|
*/
|
|
3474
3573
|
async handleHandlerError(e, t, n) {
|
|
3475
|
-
if (n instanceof
|
|
3574
|
+
if (n instanceof ne || n instanceof z)
|
|
3476
3575
|
throw n;
|
|
3477
3576
|
const r = this.fatalReason(n, "Runtime fatal");
|
|
3478
3577
|
await this.enterFatalTermination(e, t, r);
|
|
@@ -3480,9 +3579,18 @@ class Bi {
|
|
|
3480
3579
|
fatalReason(e, t) {
|
|
3481
3580
|
return e instanceof Error && typeof e.message == "string" ? e.message : t;
|
|
3482
3581
|
}
|
|
3582
|
+
lookupHandlerProcessor(e) {
|
|
3583
|
+
return this.registry.lookupHandlerForNode(
|
|
3584
|
+
this.runtimeRef.blue(),
|
|
3585
|
+
e.node()
|
|
3586
|
+
);
|
|
3587
|
+
}
|
|
3588
|
+
lookupChannelProcessor(e) {
|
|
3589
|
+
return this.registry.lookupChannelForNode(this.runtimeRef.blue(), e) ?? null;
|
|
3590
|
+
}
|
|
3483
3591
|
createDocumentUpdateEvent(e, t) {
|
|
3484
3592
|
const n = Ft(t, e.path), r = e.before != null ? e.before.clone() : new p().setValue(null), o = e.after != null ? e.after.clone() : new p().setValue(null), s = new p().setType(
|
|
3485
|
-
new p().setBlueId(
|
|
3593
|
+
new p().setBlueId(xi)
|
|
3486
3594
|
);
|
|
3487
3595
|
return s.setProperties({
|
|
3488
3596
|
op: new p().setValue(e.op),
|
|
@@ -3494,11 +3602,11 @@ class Bi {
|
|
|
3494
3602
|
matchesDocumentUpdate(e, t, n) {
|
|
3495
3603
|
if (!t || t.length === 0)
|
|
3496
3604
|
return !1;
|
|
3497
|
-
const r = P(
|
|
3605
|
+
const r = P(T(e, t)), o = P(n);
|
|
3498
3606
|
return r === "/" || o === r ? !0 : o.startsWith(`${r}/`);
|
|
3499
3607
|
}
|
|
3500
3608
|
}
|
|
3501
|
-
class
|
|
3609
|
+
class re {
|
|
3502
3610
|
constructor(e, t, n) {
|
|
3503
3611
|
this.contractLoader = e, this.registry = t, this.blue = n;
|
|
3504
3612
|
}
|
|
@@ -3522,7 +3630,7 @@ class ne {
|
|
|
3522
3630
|
return this.initializationMarker(e) != null;
|
|
3523
3631
|
}
|
|
3524
3632
|
createExecution(e) {
|
|
3525
|
-
return new
|
|
3633
|
+
return new _i(
|
|
3526
3634
|
this.contractLoader,
|
|
3527
3635
|
this.registry,
|
|
3528
3636
|
this.blue,
|
|
@@ -3533,7 +3641,7 @@ class ne {
|
|
|
3533
3641
|
try {
|
|
3534
3642
|
await n();
|
|
3535
3643
|
} catch (r) {
|
|
3536
|
-
if (r instanceof
|
|
3644
|
+
if (r instanceof ne)
|
|
3537
3645
|
return t.result();
|
|
3538
3646
|
if (r instanceof z) {
|
|
3539
3647
|
const o = e.clone();
|
|
@@ -3553,14 +3661,14 @@ class ne {
|
|
|
3553
3661
|
if (!(n instanceof p))
|
|
3554
3662
|
throw new y(
|
|
3555
3663
|
"Initialization Marker must be a BlueNode",
|
|
3556
|
-
|
|
3664
|
+
v.illegalState(
|
|
3557
3665
|
"Initialization Marker must be a BlueNode"
|
|
3558
3666
|
)
|
|
3559
3667
|
);
|
|
3560
|
-
if (n.getType()?.getBlueId() !==
|
|
3668
|
+
if (n.getType()?.getBlueId() !== Bi)
|
|
3561
3669
|
throw new y(
|
|
3562
3670
|
"Initialization Marker must declare type 'Processing Initialized Marker'",
|
|
3563
|
-
|
|
3671
|
+
v.illegalState(
|
|
3564
3672
|
"Initialization Marker must declare type 'Processing Initialized Marker'"
|
|
3565
3673
|
)
|
|
3566
3674
|
);
|
|
@@ -3631,7 +3739,7 @@ class ne {
|
|
|
3631
3739
|
}
|
|
3632
3740
|
}
|
|
3633
3741
|
}
|
|
3634
|
-
class
|
|
3742
|
+
class Li {
|
|
3635
3743
|
constructor(e, t, n, r, o, s) {
|
|
3636
3744
|
this.execution = e, this.bundle = t, this.scopePathValue = n, this.eventNode = r, this.allowTerminatedWork = o, this.allowReservedMutation = s;
|
|
3637
3745
|
}
|
|
@@ -3667,7 +3775,7 @@ class xi {
|
|
|
3667
3775
|
this.shouldSkipTerminatedWork() || this.execution.runtime().addGas(e);
|
|
3668
3776
|
}
|
|
3669
3777
|
throwFatal(e) {
|
|
3670
|
-
throw new y(e,
|
|
3778
|
+
throw new y(e, v.runtimeFatal(e));
|
|
3671
3779
|
}
|
|
3672
3780
|
resolvePointer(e) {
|
|
3673
3781
|
return this.execution.resolvePointer(this.scopePathValue, e);
|
|
@@ -3686,7 +3794,7 @@ class xi {
|
|
|
3686
3794
|
if (!e)
|
|
3687
3795
|
return !1;
|
|
3688
3796
|
try {
|
|
3689
|
-
return
|
|
3797
|
+
return re.nodeAt(
|
|
3690
3798
|
this.execution.runtime().document(),
|
|
3691
3799
|
e,
|
|
3692
3800
|
{
|
|
@@ -3698,7 +3806,7 @@ class xi {
|
|
|
3698
3806
|
}
|
|
3699
3807
|
}
|
|
3700
3808
|
documentNodeAt(e) {
|
|
3701
|
-
const t =
|
|
3809
|
+
const t = re.nodeAt(
|
|
3702
3810
|
this.execution.runtime().document(),
|
|
3703
3811
|
e,
|
|
3704
3812
|
{
|
|
@@ -3725,16 +3833,16 @@ class xi {
|
|
|
3725
3833
|
return !this.allowTerminatedWork && this.execution.isScopeInactive(this.scopePathValue);
|
|
3726
3834
|
}
|
|
3727
3835
|
}
|
|
3728
|
-
const
|
|
3729
|
-
repositories: [
|
|
3836
|
+
const Fi = new Mt({
|
|
3837
|
+
repositories: [Rt]
|
|
3730
3838
|
});
|
|
3731
|
-
class
|
|
3839
|
+
class Ui {
|
|
3732
3840
|
blue;
|
|
3733
3841
|
registryRef;
|
|
3734
3842
|
contractLoaderRef;
|
|
3735
3843
|
engine;
|
|
3736
3844
|
constructor(e) {
|
|
3737
|
-
this.registryRef = e?.registry ??
|
|
3845
|
+
this.registryRef = e?.registry ?? ae.create().registerDefaults().build(), this.blue = e?.blue ?? Fi, this.contractLoaderRef = new zr(this.registryRef, this.blue), this.engine = new re(
|
|
3738
3846
|
this.contractLoaderRef,
|
|
3739
3847
|
this.registryRef,
|
|
3740
3848
|
this.blue
|
|
@@ -3767,14 +3875,14 @@ class Li {
|
|
|
3767
3875
|
return this.contractLoaderRef;
|
|
3768
3876
|
}
|
|
3769
3877
|
static builder() {
|
|
3770
|
-
return new
|
|
3878
|
+
return new $i();
|
|
3771
3879
|
}
|
|
3772
3880
|
}
|
|
3773
|
-
class
|
|
3881
|
+
class $i {
|
|
3774
3882
|
contractRegistry;
|
|
3775
3883
|
blueInstance;
|
|
3776
3884
|
constructor() {
|
|
3777
|
-
this.contractRegistry =
|
|
3885
|
+
this.contractRegistry = ae.create().registerDefaults().build();
|
|
3778
3886
|
}
|
|
3779
3887
|
withRegistry(e) {
|
|
3780
3888
|
return this.contractRegistry = e, this;
|
|
@@ -3786,16 +3894,16 @@ class Fi {
|
|
|
3786
3894
|
return this.blueInstance = e, this;
|
|
3787
3895
|
}
|
|
3788
3896
|
build() {
|
|
3789
|
-
return new
|
|
3897
|
+
return new Ui({
|
|
3790
3898
|
registry: this.contractRegistry,
|
|
3791
3899
|
blue: this.blueInstance
|
|
3792
3900
|
});
|
|
3793
3901
|
}
|
|
3794
3902
|
}
|
|
3795
|
-
class
|
|
3903
|
+
class vt {
|
|
3796
3904
|
process(e, t) {
|
|
3797
3905
|
const n = t.getValue();
|
|
3798
|
-
if (
|
|
3906
|
+
if (ee(n)) {
|
|
3799
3907
|
const r = t.clone();
|
|
3800
3908
|
return r.setValue(n), r.setProperties(void 0), r.setItems(void 0), r.setType(void 0), r;
|
|
3801
3909
|
}
|
|
@@ -3806,79 +3914,80 @@ class St {
|
|
|
3806
3914
|
*/
|
|
3807
3915
|
postProcess(e, t) {
|
|
3808
3916
|
const n = t.getValue();
|
|
3809
|
-
if (
|
|
3917
|
+
if (ee(n) && e.getValue() !== n && n !== void 0) {
|
|
3810
3918
|
const r = e.clone();
|
|
3811
3919
|
return r.setValue(n), r;
|
|
3812
3920
|
}
|
|
3813
3921
|
return e;
|
|
3814
3922
|
}
|
|
3815
3923
|
}
|
|
3816
|
-
const
|
|
3924
|
+
const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3817
3925
|
__proto__: null,
|
|
3818
|
-
ExpressionPreserver:
|
|
3926
|
+
ExpressionPreserver: vt
|
|
3819
3927
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3820
|
-
function
|
|
3821
|
-
return new
|
|
3822
|
-
new
|
|
3823
|
-
new
|
|
3824
|
-
new
|
|
3825
|
-
new
|
|
3826
|
-
new
|
|
3827
|
-
new
|
|
3928
|
+
function uo() {
|
|
3929
|
+
return new B.SequentialMergingProcessor([
|
|
3930
|
+
new B.ValuePropagator(),
|
|
3931
|
+
new vt(),
|
|
3932
|
+
new B.TypeAssigner(),
|
|
3933
|
+
new B.ListProcessor(),
|
|
3934
|
+
new B.DictionaryProcessor(),
|
|
3935
|
+
new B.MetadataPropagator(),
|
|
3936
|
+
new B.BasicTypesVerifier()
|
|
3828
3937
|
]);
|
|
3829
3938
|
}
|
|
3830
3939
|
export {
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3940
|
+
vr as ChannelBinding,
|
|
3941
|
+
qr as ChannelRunner,
|
|
3942
|
+
Gr as CheckpointManager,
|
|
3943
|
+
Wr as CheckpointRecord,
|
|
3835
3944
|
ot as CodeBlockEvaluationError,
|
|
3836
|
-
|
|
3945
|
+
H as ContractBundle,
|
|
3837
3946
|
wr as ContractBundleBuilder,
|
|
3838
|
-
|
|
3947
|
+
zr as ContractLoader,
|
|
3839
3948
|
qn as ContractProcessorRegistry,
|
|
3840
|
-
|
|
3949
|
+
ae as ContractProcessorRegistryBuilder,
|
|
3841
3950
|
Ke as DocumentProcessingResult,
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3951
|
+
Di as DocumentProcessingRuntime,
|
|
3952
|
+
Ui as DocumentProcessor,
|
|
3953
|
+
$i as DocumentProcessorBuilder,
|
|
3954
|
+
di as EmissionRegistry,
|
|
3955
|
+
Ai as GasMeter,
|
|
3956
|
+
Sr as HandlerBinding,
|
|
3848
3957
|
A as KEY_CHECKPOINT,
|
|
3849
3958
|
We as KEY_EMBEDDED,
|
|
3850
3959
|
Ge as KEY_INITIALIZED,
|
|
3851
3960
|
qe as KEY_TERMINATED,
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3961
|
+
lo as MergingProcessors,
|
|
3962
|
+
Ce as PROCESSOR_MANAGED_CHANNEL_BLUE_IDS,
|
|
3963
|
+
ai as PatchEngine,
|
|
3964
|
+
io as ProcessorContractConstants,
|
|
3965
|
+
re as ProcessorEngine,
|
|
3966
|
+
v as ProcessorErrors,
|
|
3967
|
+
_i as ProcessorExecution,
|
|
3968
|
+
Li as ProcessorExecutionContext,
|
|
3860
3969
|
y as ProcessorFatalError,
|
|
3861
|
-
|
|
3862
|
-
|
|
3970
|
+
oo as ProcessorPointerConstants,
|
|
3971
|
+
ve as QuickJSEvaluator,
|
|
3863
3972
|
Qe as RELATIVE_CHECKPOINT,
|
|
3864
|
-
|
|
3973
|
+
V as RELATIVE_CONTRACTS,
|
|
3865
3974
|
Lt as RELATIVE_EMBEDDED,
|
|
3866
|
-
|
|
3975
|
+
pe as RELATIVE_INITIALIZED,
|
|
3867
3976
|
Je as RELATIVE_TERMINATED,
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3977
|
+
ye as RESERVED_CONTRACT_KEYS,
|
|
3978
|
+
ne as RunTerminationError,
|
|
3979
|
+
ei as ScopeExecutor,
|
|
3980
|
+
hi as ScopeRuntimeContext,
|
|
3981
|
+
ri as TerminationService,
|
|
3982
|
+
eo as andThen,
|
|
3874
3983
|
nt as canonicalSignature,
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3984
|
+
Ne as canonicalSize,
|
|
3985
|
+
L as channelContractBaseSchema,
|
|
3986
|
+
bn as channelEventCheckpointSchema,
|
|
3878
3987
|
dt as compositeTimelineChannelSchema,
|
|
3879
3988
|
sn as containsExpression,
|
|
3880
3989
|
Se as contractBaseSchema,
|
|
3881
|
-
|
|
3990
|
+
uo as createDefaultMergingProcessor,
|
|
3882
3991
|
ct as createPicomatchShouldResolve,
|
|
3883
3992
|
Dn as documentAnchorsMarkerSchema,
|
|
3884
3993
|
_n as documentLinksMarkerSchema,
|
|
@@ -3888,42 +3997,42 @@ export {
|
|
|
3888
3997
|
at as evaluateQuickJSExpression,
|
|
3889
3998
|
an as extractExpressionContent,
|
|
3890
3999
|
ut as handlerContractBaseSchema,
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
4000
|
+
In as initializationMarkerSchema,
|
|
4001
|
+
Xi as isErr,
|
|
4002
|
+
ee as isExpression,
|
|
4003
|
+
Qi as isOk,
|
|
4004
|
+
je as isProcessorManagedChannelBlueId,
|
|
3896
4005
|
_t as isReservedContractKey,
|
|
3897
|
-
|
|
3898
|
-
|
|
4006
|
+
so as joinRelativePointers,
|
|
4007
|
+
ao as jsonPatchSchema,
|
|
3899
4008
|
mn as lifecycleChannelSchema,
|
|
3900
|
-
|
|
3901
|
-
|
|
4009
|
+
Yi as map,
|
|
4010
|
+
Zi as mapErr,
|
|
3902
4011
|
N as markerContractBaseSchema,
|
|
3903
|
-
|
|
4012
|
+
ro as match,
|
|
3904
4013
|
Fn as myosParticipantsOrchestrationMarkerSchema,
|
|
3905
4014
|
$n as myosSessionInteractionMarkerSchema,
|
|
3906
|
-
|
|
3907
|
-
|
|
4015
|
+
vn as myosTimelineChannelSchema,
|
|
4016
|
+
Hn as myosWorkerAgencyMarkerSchema,
|
|
3908
4017
|
P as normalizePointer,
|
|
3909
|
-
|
|
4018
|
+
b as normalizeScope,
|
|
3910
4019
|
Nt as ok,
|
|
3911
4020
|
Nn as operationMarkerSchema,
|
|
3912
4021
|
Pn as processEmbeddedMarkerSchema,
|
|
3913
|
-
|
|
4022
|
+
Rn as processingTerminatedMarkerSchema,
|
|
3914
4023
|
Ze as relativeCheckpointLastEvent,
|
|
3915
4024
|
et as relativeCheckpointLastSignature,
|
|
3916
|
-
|
|
4025
|
+
ie as relativeContractsEntry,
|
|
3917
4026
|
Ft as relativizePointer,
|
|
3918
|
-
|
|
3919
|
-
|
|
4027
|
+
te as resolveNodeExpressions,
|
|
4028
|
+
T as resolvePointer,
|
|
3920
4029
|
cn as resolveTemplateString,
|
|
3921
4030
|
Wn as sequentialWorkflowOperationSchema,
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
4031
|
+
Vn as sequentialWorkflowSchema,
|
|
4032
|
+
co as sequentialWorkflowStepSchema,
|
|
4033
|
+
Me as stripSlashes,
|
|
3925
4034
|
yn as timelineChannelSchema,
|
|
3926
4035
|
En as triggeredEventChannelSchema,
|
|
3927
|
-
|
|
3928
|
-
|
|
4036
|
+
to as unwrapOr,
|
|
4037
|
+
no as unwrapOrElse
|
|
3929
4038
|
};
|