@blue-labs/document-processor 3.0.0 → 3.2.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 +3 -6
- package/dist/engine/channel-runner.d.ts.map +1 -1
- package/dist/engine/composite-channel-validation.d.ts +14 -0
- package/dist/engine/composite-channel-validation.d.ts.map +1 -0
- package/dist/engine/contract-bundle.d.ts +7 -15
- package/dist/engine/contract-bundle.d.ts.map +1 -1
- package/dist/engine/contract-loader.d.ts +2 -1
- package/dist/engine/contract-loader.d.ts.map +1 -1
- package/dist/engine/processor-engine.d.ts.map +1 -1
- package/dist/index.js +1399 -1176
- package/dist/model/channels/composite-timeline-channel.d.ts +47 -0
- package/dist/model/channels/composite-timeline-channel.d.ts.map +1 -0
- package/dist/model/channels/document-update-channel.d.ts +4 -4
- package/dist/model/channels/embedded-node-channel.d.ts +4 -4
- package/dist/model/channels/index.d.ts +1 -0
- package/dist/model/channels/index.d.ts.map +1 -1
- package/dist/model/channels/lifecycle-channel.d.ts +4 -4
- package/dist/model/channels/myos-timeline-channel.d.ts +4 -4
- package/dist/model/channels/timeline-channel.d.ts +4 -4
- package/dist/model/channels/triggered-event-channel.d.ts +4 -4
- package/dist/model/handlers/sequential-workflow-operation.d.ts +6 -6
- package/dist/model/handlers/sequential-workflow.d.ts +6 -6
- package/dist/model/markers/channel-event-checkpoint.d.ts +2 -2
- package/dist/model/markers/document-anchors.d.ts +2 -2
- package/dist/model/markers/document-links.d.ts +2 -2
- package/dist/model/markers/initialization-marker.d.ts +2 -2
- package/dist/model/markers/myos-participants-orchestration.d.ts +2 -2
- package/dist/model/markers/myos-session-interaction.d.ts +2 -2
- package/dist/model/markers/myos-worker-agency.d.ts +2 -2
- package/dist/model/markers/operation.d.ts +2 -2
- package/dist/model/markers/process-embedded.d.ts +2 -2
- package/dist/model/markers/processing-terminated-marker.d.ts +2 -2
- package/dist/model/shared/channel-contract-base.d.ts +4 -4
- package/dist/model/shared/handler-contract-base.d.ts +4 -4
- package/dist/model/shared/marker-contract-base.d.ts +2 -2
- package/dist/model/types.d.ts +2 -2
- package/dist/model/types.d.ts.map +1 -1
- package/dist/registry/contract-processor-registry-builder.d.ts.map +1 -1
- package/dist/registry/processors/composite-timeline-channel-processor.d.ts +81 -0
- package/dist/registry/processors/composite-timeline-channel-processor.d.ts.map +1 -0
- package/dist/registry/processors/myos-timeline-channel-processor.d.ts +4 -4
- package/dist/registry/processors/myos-timeline-channel-processor.d.ts.map +1 -1
- package/dist/registry/processors/operation-marker-processor.d.ts +2 -2
- package/dist/registry/processors/operation-marker-processor.d.ts.map +1 -1
- package/dist/registry/processors/sequential-workflow-operation-processor.d.ts +6 -6
- package/dist/registry/processors/sequential-workflow-operation-processor.d.ts.map +1 -1
- package/dist/registry/processors/sequential-workflow-processor.d.ts +6 -6
- package/dist/registry/processors/sequential-workflow-processor.d.ts.map +1 -1
- package/dist/registry/processors/steps/javascript-code-step-executor.d.ts +6 -0
- package/dist/registry/processors/steps/javascript-code-step-executor.d.ts.map +1 -1
- package/dist/registry/processors/steps/trigger-event-step-executor.d.ts.map +1 -1
- package/dist/registry/processors/steps/update-document-step-executor.d.ts.map +1 -1
- package/dist/registry/processors/timeline-channel-processor.d.ts +4 -4
- package/dist/registry/processors/timeline-channel-processor.d.ts.map +1 -1
- package/dist/registry/types.d.ts +26 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/runtime/gas-helpers.d.ts +0 -3
- package/dist/runtime/gas-helpers.d.ts.map +1 -1
- package/dist/runtime/gas-meter.d.ts +1 -3
- package/dist/runtime/gas-meter.d.ts.map +1 -1
- package/dist/runtime/gas-schedule.d.ts +8 -0
- package/dist/runtime/gas-schedule.d.ts.map +1 -0
- package/dist/test-support/blue.d.ts.map +1 -1
- package/dist/types/channel-contract-entry.d.ts +7 -0
- package/dist/types/channel-contract-entry.d.ts.map +1 -0
- package/dist/types/handler-contract-entry.d.ts +7 -0
- package/dist/types/handler-contract-entry.d.ts.map +1 -0
- package/dist/types/marker-contract-entry.d.ts +7 -0
- package/dist/types/marker-contract-entry.d.ts.map +1 -0
- package/dist/util/expression/quickjs-config.d.ts +2 -0
- package/dist/util/expression/quickjs-config.d.ts.map +1 -0
- package/dist/util/expression/quickjs-evaluator.d.ts +23 -22
- package/dist/util/expression/quickjs-evaluator.d.ts.map +1 -1
- package/dist/util/expression/quickjs-expression-utils.d.ts +3 -3
- package/dist/util/expression/quickjs-expression-utils.d.ts.map +1 -1
- package/package.json +9 -7
package/dist/index.js
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { evaluate as wt } from "@blue-quickjs/quickjs-runtime";
|
|
2
|
+
import { validateDv as kt, DV_LIMIT_DEFAULTS as bt } 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 b, Properties as Ie, BlueIdCalculator as Rt, Blue as Pt, MergingProcessors as L } from "@blue-labs/language";
|
|
5
|
+
import Te from "picomatch";
|
|
6
|
+
import { z as l, ZodError as ge } from "zod";
|
|
7
|
+
import { isNullable as he } from "@blue-labs/shared-utils";
|
|
8
|
+
import { repository as Mt } from "@blue-repository/types";
|
|
9
|
+
function Nt(i) {
|
|
8
10
|
return { ok: !0, value: i };
|
|
9
11
|
}
|
|
10
|
-
function
|
|
12
|
+
function Ot(i) {
|
|
11
13
|
return { ok: !1, error: i };
|
|
12
14
|
}
|
|
13
|
-
function
|
|
15
|
+
function ji(i) {
|
|
14
16
|
return i.ok;
|
|
15
17
|
}
|
|
16
|
-
function
|
|
18
|
+
function Ji(i) {
|
|
17
19
|
return !i.ok;
|
|
18
20
|
}
|
|
19
|
-
function
|
|
20
|
-
return i.ok ?
|
|
21
|
+
function Qi(i, e) {
|
|
22
|
+
return i.ok ? Nt(e(i.value)) : i;
|
|
21
23
|
}
|
|
22
|
-
function
|
|
23
|
-
return i.ok ? i :
|
|
24
|
+
function Xi(i, e) {
|
|
25
|
+
return i.ok ? i : Ot(e(i.error));
|
|
24
26
|
}
|
|
25
|
-
function
|
|
27
|
+
function Yi(i, e) {
|
|
26
28
|
return i.ok ? e(i.value) : i;
|
|
27
29
|
}
|
|
28
|
-
function
|
|
30
|
+
function Zi(i, e) {
|
|
29
31
|
return i.ok ? i.value : e;
|
|
30
32
|
}
|
|
31
|
-
function
|
|
33
|
+
function eo(i, e) {
|
|
32
34
|
return i.ok ? i.value : e(i.error);
|
|
33
35
|
}
|
|
34
|
-
function
|
|
36
|
+
function to(i, e) {
|
|
35
37
|
return i.ok ? e.ok(i.value) : e.err(i.error);
|
|
36
38
|
}
|
|
37
|
-
const
|
|
39
|
+
const v = {
|
|
38
40
|
capabilityFailure(i, e, t) {
|
|
39
41
|
return { kind: "CapabilityFailure", capability: i, reason: e, details: t };
|
|
40
42
|
},
|
|
@@ -54,14 +56,14 @@ const w = {
|
|
|
54
56
|
return { kind: "UnsupportedOp", operation: i, reason: e };
|
|
55
57
|
}
|
|
56
58
|
};
|
|
57
|
-
function
|
|
59
|
+
function At(i) {
|
|
58
60
|
return Object.freeze([...i]);
|
|
59
61
|
}
|
|
60
|
-
const
|
|
62
|
+
const Dt = {
|
|
61
63
|
of(i, e, t) {
|
|
62
64
|
return {
|
|
63
65
|
document: i,
|
|
64
|
-
triggeredEvents:
|
|
66
|
+
triggeredEvents: At(e),
|
|
65
67
|
totalGas: t,
|
|
66
68
|
capabilityFailure: !1,
|
|
67
69
|
failureReason: null
|
|
@@ -76,7 +78,7 @@ const wt = {
|
|
|
76
78
|
failureReason: e ?? null
|
|
77
79
|
};
|
|
78
80
|
}
|
|
79
|
-
},
|
|
81
|
+
}, Ke = Dt, f = {
|
|
80
82
|
"Core/Channel": "DcoJyCh7XXxy1nR5xjy7qfkUgQ1GiZnKKSxh8DJusBSr",
|
|
81
83
|
"Core/Channel Event Checkpoint": "B7YQeYdQzUNuzaDQ4tNTd2iJqgd4YnVQkgz4QgymDWWU",
|
|
82
84
|
"Core/Contract": "AERp8BWnuUsjoPciAeNXuUWS9fmqPNMdWbxmKn3tcitx",
|
|
@@ -93,68 +95,68 @@ const wt = {
|
|
|
93
95
|
"Core/Processing Initialized Marker": "EVguxFmq5iFtMZaBQgHfjWDojaoesQ1vEXCQFZ59yL28",
|
|
94
96
|
"Core/Processing Terminated Marker": "5NiEhupJ6uF54Q3vs4GwQX4UX4ExtwHpKRVvjKEHtvjR",
|
|
95
97
|
"Core/Triggered Event Channel": "C77W4kVGcxL7Mkx9WL9QESPEFFL2GzWAe647s1Efprt"
|
|
96
|
-
},
|
|
98
|
+
}, Bt = [
|
|
97
99
|
"embedded",
|
|
98
100
|
"initialized",
|
|
99
101
|
"terminated",
|
|
100
102
|
"checkpoint"
|
|
101
|
-
],
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
],
|
|
107
|
-
|
|
108
|
-
),
|
|
109
|
-
function
|
|
110
|
-
return i != null &&
|
|
111
|
-
}
|
|
112
|
-
function
|
|
113
|
-
return i != null &&
|
|
103
|
+
], xt = [
|
|
104
|
+
f["Core/Document Update Channel"],
|
|
105
|
+
f["Core/Triggered Event Channel"],
|
|
106
|
+
f["Core/Lifecycle Event Channel"],
|
|
107
|
+
f["Core/Embedded Node Channel"]
|
|
108
|
+
], We = "embedded", Ge = "initialized", qe = "terminated", A = "checkpoint", Ee = new Set(
|
|
109
|
+
Bt
|
|
110
|
+
), je = new Set(xt);
|
|
111
|
+
function _t(i) {
|
|
112
|
+
return i != null && Ee.has(i);
|
|
113
|
+
}
|
|
114
|
+
function ye(i) {
|
|
115
|
+
return i != null && je.has(
|
|
114
116
|
i
|
|
115
117
|
);
|
|
116
118
|
}
|
|
117
|
-
const
|
|
118
|
-
KEY_EMBEDDED:
|
|
119
|
-
KEY_INITIALIZED:
|
|
120
|
-
KEY_TERMINATED:
|
|
121
|
-
KEY_CHECKPOINT:
|
|
122
|
-
RESERVED_CONTRACT_KEYS:
|
|
123
|
-
PROCESSOR_MANAGED_CHANNEL_BLUE_IDS:
|
|
124
|
-
isReservedContractKey:
|
|
125
|
-
isProcessorManagedChannelBlueId:
|
|
126
|
-
},
|
|
127
|
-
function
|
|
128
|
-
return `${
|
|
129
|
-
}
|
|
130
|
-
function
|
|
131
|
-
return `${
|
|
132
|
-
}
|
|
133
|
-
function
|
|
134
|
-
return `${
|
|
135
|
-
}
|
|
136
|
-
const
|
|
137
|
-
RELATIVE_CONTRACTS:
|
|
138
|
-
RELATIVE_INITIALIZED:
|
|
139
|
-
RELATIVE_TERMINATED:
|
|
140
|
-
RELATIVE_EMBEDDED:
|
|
141
|
-
RELATIVE_CHECKPOINT:
|
|
142
|
-
LAST_EVENTS_SUFFIX:
|
|
143
|
-
LAST_SIGNATURES_SUFFIX:
|
|
144
|
-
relativeContractsEntry:
|
|
145
|
-
relativeCheckpointLastEvent:
|
|
146
|
-
relativeCheckpointLastSignature:
|
|
119
|
+
const no = {
|
|
120
|
+
KEY_EMBEDDED: We,
|
|
121
|
+
KEY_INITIALIZED: Ge,
|
|
122
|
+
KEY_TERMINATED: qe,
|
|
123
|
+
KEY_CHECKPOINT: A,
|
|
124
|
+
RESERVED_CONTRACT_KEYS: Ee,
|
|
125
|
+
PROCESSOR_MANAGED_CHANNEL_BLUE_IDS: je,
|
|
126
|
+
isReservedContractKey: _t,
|
|
127
|
+
isProcessorManagedChannelBlueId: ye
|
|
128
|
+
}, H = "/contracts", de = `${H}/${Ge}`, Je = `${H}/${qe}`, Lt = `${H}/${We}`, Qe = `${H}/${A}`, Xe = "/lastEvents", Ye = "/lastSignatures";
|
|
129
|
+
function ne(i) {
|
|
130
|
+
return `${H}/${i}`;
|
|
131
|
+
}
|
|
132
|
+
function Ze(i, e) {
|
|
133
|
+
return `${ne(i)}${Xe}/${e}`;
|
|
134
|
+
}
|
|
135
|
+
function et(i, e) {
|
|
136
|
+
return `${ne(i)}${Ye}/${e}`;
|
|
137
|
+
}
|
|
138
|
+
const ro = {
|
|
139
|
+
RELATIVE_CONTRACTS: H,
|
|
140
|
+
RELATIVE_INITIALIZED: de,
|
|
141
|
+
RELATIVE_TERMINATED: Je,
|
|
142
|
+
RELATIVE_EMBEDDED: Lt,
|
|
143
|
+
RELATIVE_CHECKPOINT: Qe,
|
|
144
|
+
LAST_EVENTS_SUFFIX: Xe,
|
|
145
|
+
LAST_SIGNATURES_SUFFIX: Ye,
|
|
146
|
+
relativeContractsEntry: ne,
|
|
147
|
+
relativeCheckpointLastEvent: Ze,
|
|
148
|
+
relativeCheckpointLastSignature: et
|
|
147
149
|
};
|
|
148
|
-
function
|
|
150
|
+
function tt(i) {
|
|
149
151
|
return i == null || i.length === 0;
|
|
150
152
|
}
|
|
151
|
-
function
|
|
152
|
-
return
|
|
153
|
+
function k(i) {
|
|
154
|
+
return tt(i) ? "/" : i.startsWith("/") ? i : `/${i}`;
|
|
153
155
|
}
|
|
154
|
-
function
|
|
155
|
-
return
|
|
156
|
+
function R(i) {
|
|
157
|
+
return tt(i) ? "/" : i.startsWith("/") ? i : `/${i}`;
|
|
156
158
|
}
|
|
157
|
-
function
|
|
159
|
+
function Re(i) {
|
|
158
160
|
if (i == null)
|
|
159
161
|
return "";
|
|
160
162
|
let e = i.trim();
|
|
@@ -166,16 +168,16 @@ function Ce(i) {
|
|
|
166
168
|
e = e.substring(0, e.length - 1);
|
|
167
169
|
return e;
|
|
168
170
|
}
|
|
169
|
-
function
|
|
170
|
-
const t =
|
|
171
|
+
function io(i, e) {
|
|
172
|
+
const t = Re(i), n = Re(e);
|
|
171
173
|
return t.length === 0 && n.length === 0 ? "/" : t.length === 0 ? `/${n}` : n.length === 0 ? `/${t}` : `/${t}/${n}`;
|
|
172
174
|
}
|
|
173
|
-
function
|
|
174
|
-
const t =
|
|
175
|
+
function T(i, e) {
|
|
176
|
+
const t = k(i), n = R(e);
|
|
175
177
|
return t === "/" ? n : n === "/" || n.length === 1 ? t : `${t}${n}`;
|
|
176
178
|
}
|
|
177
|
-
function
|
|
178
|
-
const t =
|
|
179
|
+
function Ft(i, e) {
|
|
180
|
+
const t = k(i), n = R(e);
|
|
179
181
|
if (t === "/" || !n.startsWith(t))
|
|
180
182
|
return n;
|
|
181
183
|
if (n.length === t.length)
|
|
@@ -183,12 +185,12 @@ function kt(i, e) {
|
|
|
183
185
|
const r = n.substring(t.length);
|
|
184
186
|
return r.length === 0 ? "/" : r.startsWith("/") ? r : `/${r}`;
|
|
185
187
|
}
|
|
186
|
-
function
|
|
188
|
+
function Ut(i) {
|
|
187
189
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
188
190
|
}
|
|
189
|
-
var
|
|
190
|
-
function
|
|
191
|
-
return
|
|
191
|
+
var se, Pe;
|
|
192
|
+
function $t() {
|
|
193
|
+
return Pe || (Pe = 1, se = function i(e) {
|
|
192
194
|
if (typeof e == "number" && isNaN(e))
|
|
193
195
|
throw new Error("NaN is not allowed");
|
|
194
196
|
if (typeof e == "number" && !isFinite(e))
|
|
@@ -199,372 +201,305 @@ function It() {
|
|
|
199
201
|
const o = n.length === 0 ? "" : ",";
|
|
200
202
|
return `${n}${o}${i(r)}:${i(e[r])}`;
|
|
201
203
|
}, "")}}`;
|
|
202
|
-
}),
|
|
204
|
+
}), se;
|
|
203
205
|
}
|
|
204
|
-
var
|
|
205
|
-
const
|
|
206
|
-
function
|
|
206
|
+
var zt = $t();
|
|
207
|
+
const Vt = /* @__PURE__ */ Ut(zt);
|
|
208
|
+
function Ht(i, e) {
|
|
207
209
|
return i.nodeToJson(e, "official");
|
|
208
210
|
}
|
|
209
|
-
function
|
|
210
|
-
const t =
|
|
211
|
-
return
|
|
211
|
+
function Kt(i, e) {
|
|
212
|
+
const t = Ht(i, e);
|
|
213
|
+
return Vt(t);
|
|
212
214
|
}
|
|
213
|
-
function
|
|
214
|
-
return e ?
|
|
215
|
+
function nt(i, e) {
|
|
216
|
+
return e ? Kt(i, e) : null;
|
|
215
217
|
}
|
|
216
|
-
function
|
|
217
|
-
const t =
|
|
218
|
+
function Me(i, e) {
|
|
219
|
+
const t = nt(i, e);
|
|
218
220
|
return t == null ? 0 : new TextEncoder().encode(t).length;
|
|
219
221
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
function
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
222
|
+
const Wt = 1700, pe = BigInt(
|
|
223
|
+
Wt
|
|
224
|
+
), Gt = BigInt(Number.MAX_SAFE_INTEGER), qt = 4e4, jt = 4e4;
|
|
225
|
+
function Jt(i) {
|
|
226
|
+
let e;
|
|
227
|
+
if (typeof i == "bigint")
|
|
228
|
+
e = i;
|
|
229
|
+
else {
|
|
230
|
+
if (!Number.isFinite(i) || i <= 0)
|
|
231
|
+
return 0;
|
|
232
|
+
e = BigInt(Math.trunc(i));
|
|
233
|
+
}
|
|
234
|
+
if (e <= 0n)
|
|
235
|
+
return 0;
|
|
236
|
+
const t = (e + pe - 1n) / pe;
|
|
237
|
+
return t > Gt ? Number.MAX_SAFE_INTEGER : Number(t);
|
|
238
|
+
}
|
|
239
|
+
function rt(i) {
|
|
240
|
+
const e = BigInt(Math.max(0, Math.trunc(i)));
|
|
241
|
+
return e <= 0n ? 0n : e * pe;
|
|
242
|
+
}
|
|
243
|
+
const it = rt(
|
|
244
|
+
qt
|
|
245
|
+
), Qt = rt(
|
|
246
|
+
jt
|
|
247
|
+
), O = 1, Xt = /* @__PURE__ */ new Set([
|
|
248
|
+
"event",
|
|
249
|
+
"eventCanonical",
|
|
250
|
+
"steps",
|
|
251
|
+
"document",
|
|
252
|
+
"emit"
|
|
253
|
+
]);
|
|
254
|
+
class Ce {
|
|
255
|
+
// Serialize evaluations to avoid races when updating host handler bindings.
|
|
256
|
+
evaluationQueue = Promise.resolve();
|
|
257
|
+
handlerState = {
|
|
258
|
+
documentGet: () => ({ ok: null, units: O }),
|
|
259
|
+
documentGetCanonical: () => ({ ok: null, units: O }),
|
|
260
|
+
emit: () => ({ ok: null, units: O })
|
|
261
|
+
};
|
|
262
|
+
handlers = {
|
|
263
|
+
document: {
|
|
264
|
+
get: (e) => this.handlerState.documentGet(e),
|
|
265
|
+
getCanonical: (e) => this.handlerState.documentGetCanonical(e)
|
|
266
|
+
},
|
|
267
|
+
emit: (e) => this.handlerState.emit(e)
|
|
268
|
+
};
|
|
269
|
+
async evaluate(e) {
|
|
270
|
+
const t = this.evaluationQueue.then(() => this.evaluateOnce(e));
|
|
271
|
+
return this.evaluationQueue = t.then(
|
|
272
|
+
() => {
|
|
273
|
+
},
|
|
274
|
+
() => {
|
|
275
|
+
}
|
|
276
|
+
), t;
|
|
271
277
|
}
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
const Bt = 500, Lt = 32 * 1024 * 1024;
|
|
275
|
-
class pe {
|
|
276
|
-
modulePromise;
|
|
277
|
-
moduleInstance;
|
|
278
|
-
async evaluate({
|
|
278
|
+
async evaluateOnce({
|
|
279
279
|
code: e,
|
|
280
280
|
bindings: t,
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
wasmGasLimit: n,
|
|
282
|
+
onWasmGasUsed: r
|
|
283
283
|
}) {
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
284
|
+
const o = this.prepareBindings(t), s = n ?? it, a = {
|
|
285
|
+
code: this.wrapCode(e),
|
|
286
|
+
abiId: "Host.v1",
|
|
287
|
+
abiVersion: 1,
|
|
288
|
+
abiManifestHash: Tt
|
|
289
|
+
};
|
|
289
290
|
try {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
|
|
291
|
+
const c = await wt({
|
|
292
|
+
program: a,
|
|
293
|
+
input: o,
|
|
294
|
+
gasLimit: s,
|
|
295
|
+
manifest: It,
|
|
296
|
+
handlers: this.handlers
|
|
297
|
+
});
|
|
298
|
+
if (n !== void 0 && r && r({
|
|
299
|
+
used: c.gasUsed,
|
|
300
|
+
remaining: c.gasRemaining
|
|
301
|
+
}), !c.ok)
|
|
302
|
+
throw en(c);
|
|
303
|
+
return X(c.value);
|
|
304
|
+
} catch (c) {
|
|
305
|
+
throw tn(c);
|
|
305
306
|
}
|
|
306
307
|
}
|
|
307
|
-
|
|
308
|
-
|
|
308
|
+
prepareBindings(e) {
|
|
309
|
+
const t = e ?? {};
|
|
310
|
+
Yt(t);
|
|
311
|
+
const n = ae(t.event, null, "event"), r = ae(
|
|
312
|
+
t.eventCanonical ?? n,
|
|
313
|
+
n,
|
|
314
|
+
"eventCanonical"
|
|
315
|
+
), o = ae(t.steps, [], "steps"), s = {
|
|
316
|
+
event: n,
|
|
317
|
+
eventCanonical: r,
|
|
318
|
+
steps: o
|
|
319
|
+
}, a = this.extractDocumentBinding(t), c = typeof a?.canonical == "function" ? a.canonical : void 0;
|
|
320
|
+
this.handlerState.documentGet = Ne(a), this.handlerState.documentGetCanonical = Ne(
|
|
321
|
+
c ?? a
|
|
322
|
+
);
|
|
323
|
+
const u = this.extractEmitBinding(t);
|
|
324
|
+
return this.handlerState.emit = Zt(u), s;
|
|
325
|
+
}
|
|
326
|
+
extractDocumentBinding(e) {
|
|
327
|
+
if (!Object.prototype.hasOwnProperty.call(e, "document"))
|
|
328
|
+
return;
|
|
329
|
+
const t = e.document;
|
|
330
|
+
if (t != null) {
|
|
331
|
+
if (typeof t != "function")
|
|
332
|
+
throw new TypeError("QuickJS document binding must be a function");
|
|
333
|
+
return t;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
extractEmitBinding(e) {
|
|
337
|
+
if (!Object.prototype.hasOwnProperty.call(e, "emit"))
|
|
338
|
+
return;
|
|
339
|
+
const t = e.emit;
|
|
340
|
+
if (t != null) {
|
|
341
|
+
if (typeof t != "function")
|
|
342
|
+
throw new TypeError("QuickJS emit binding must be a function");
|
|
343
|
+
return t;
|
|
344
|
+
}
|
|
309
345
|
}
|
|
310
346
|
wrapCode(e) {
|
|
311
|
-
return `(
|
|
347
|
+
return `(() => {
|
|
348
|
+
return (() => {
|
|
312
349
|
${e}
|
|
350
|
+
})()
|
|
313
351
|
})()`;
|
|
314
352
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
installDeterministicGlobals(e) {
|
|
329
|
-
e.setProp(e.global, "Date", e.undefined.dup());
|
|
330
|
-
}
|
|
331
|
-
installCanonNamespace(e) {
|
|
332
|
-
e.newObject().consume((t) => {
|
|
333
|
-
e.newFunction("unwrap", (...n) => {
|
|
334
|
-
try {
|
|
335
|
-
const [r, o] = n, s = r !== void 0 ? e.dump(r) : void 0, a = o === void 0 ? !0 : !!e.dump(o), c = H(s, a);
|
|
336
|
-
return this.createReturnHandle(e, c);
|
|
337
|
-
} catch (r) {
|
|
338
|
-
const o = r instanceof Error ? r.message : String(r);
|
|
339
|
-
return e.newError(o);
|
|
340
|
-
}
|
|
341
|
-
}).consume((n) => e.setProp(t, "unwrap", n)), e.newFunction("at", (...n) => {
|
|
342
|
-
try {
|
|
343
|
-
const [r, o] = n, s = r !== void 0 ? e.dump(r) : void 0;
|
|
344
|
-
if (o === void 0)
|
|
345
|
-
throw new TypeError(
|
|
346
|
-
"canon.at(target, pointer) requires a pointer argument"
|
|
347
|
-
);
|
|
348
|
-
const a = e.dump(o);
|
|
349
|
-
if (typeof a != "string")
|
|
350
|
-
throw new TypeError("canon.at pointer must be a string");
|
|
351
|
-
const c = Dt(s, a);
|
|
352
|
-
return this.createReturnHandle(e, c);
|
|
353
|
-
} catch (r) {
|
|
354
|
-
const o = r instanceof Error ? r.message : String(r);
|
|
355
|
-
return e.newError(o);
|
|
356
|
-
}
|
|
357
|
-
}).consume((n) => e.setProp(t, "at", n)), e.setProp(e.global, "canon", t);
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
installBindings(e, t) {
|
|
361
|
-
if (t)
|
|
362
|
-
for (const [n, r] of Object.entries(t))
|
|
363
|
-
typeof r == "function" ? this.createFunctionHandle(
|
|
364
|
-
e,
|
|
365
|
-
n,
|
|
366
|
-
r
|
|
367
|
-
).consume(
|
|
368
|
-
(s) => e.setProp(e.global, n, s)
|
|
369
|
-
) : r !== void 0 && this.createOwnedHandle(e, r).consume(
|
|
370
|
-
(s) => e.setProp(e.global, n, s)
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
createFunctionHandle(e, t, n) {
|
|
374
|
-
const r = e.newFunction(
|
|
375
|
-
t,
|
|
376
|
-
(...o) => {
|
|
377
|
-
try {
|
|
378
|
-
const s = o.map((c) => e.dump(c)), a = n(...s);
|
|
379
|
-
if (a instanceof Promise)
|
|
380
|
-
throw new TypeError("Async bindings are not supported");
|
|
381
|
-
return this.createReturnHandle(e, a);
|
|
382
|
-
} catch (s) {
|
|
383
|
-
const a = s instanceof Error ? s.message : String(s);
|
|
384
|
-
return e.newError(a);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
);
|
|
388
|
-
return this.applyFunctionProperties(e, r, n), r;
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Copies enumerable properties from a host function onto the QuickJS handle.
|
|
392
|
-
* Nested functions (e.g. `document.canonical = () => {}`) are recursively wrapped
|
|
393
|
-
* so they stay callable inside QuickJS; plain values are serialized via
|
|
394
|
-
* `createOwnedHandle`. This preserves helper namespaces on binding functions.
|
|
395
|
-
*/
|
|
396
|
-
applyFunctionProperties(e, t, n) {
|
|
397
|
-
if (!(n === null || typeof n != "object" && typeof n != "function"))
|
|
398
|
-
for (const [r, o] of Object.entries(
|
|
399
|
-
n
|
|
400
|
-
)) {
|
|
401
|
-
if (o === void 0)
|
|
402
|
-
continue;
|
|
403
|
-
if (typeof o == "function") {
|
|
404
|
-
this.createFunctionHandle(
|
|
405
|
-
e,
|
|
406
|
-
r,
|
|
407
|
-
o
|
|
408
|
-
).consume(
|
|
409
|
-
(c) => e.setProp(t, r, c)
|
|
410
|
-
);
|
|
411
|
-
continue;
|
|
412
|
-
}
|
|
413
|
-
this.createOwnedHandle(e, o).consume(
|
|
414
|
-
(a) => e.setProp(t, r, a)
|
|
415
|
-
);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
createOwnedHandle(e, t) {
|
|
419
|
-
if (t === void 0)
|
|
420
|
-
return e.undefined.dup();
|
|
421
|
-
if (t === null)
|
|
422
|
-
return e.null.dup();
|
|
423
|
-
if (typeof t == "boolean")
|
|
424
|
-
return (t ? e.true : e.false).dup();
|
|
425
|
-
if (typeof t == "number")
|
|
426
|
-
return e.newNumber(t);
|
|
427
|
-
if (typeof t == "string")
|
|
428
|
-
return e.newString(t);
|
|
429
|
-
if (typeof t == "bigint")
|
|
430
|
-
return e.newBigInt(t);
|
|
431
|
-
if (Array.isArray(t) || typeof t == "object") {
|
|
432
|
-
const n = JSON.stringify(t);
|
|
433
|
-
if (n === void 0)
|
|
434
|
-
return e.undefined.dup();
|
|
435
|
-
const r = e.evalCode(`(${n})`);
|
|
436
|
-
return e.unwrapResult(r);
|
|
437
|
-
}
|
|
353
|
+
}
|
|
354
|
+
function Yt(i) {
|
|
355
|
+
for (const e of Object.keys(i))
|
|
356
|
+
if (!Xt.has(e))
|
|
357
|
+
throw new TypeError(`Unsupported QuickJS binding: "${e}"`);
|
|
358
|
+
}
|
|
359
|
+
function ae(i, e, t) {
|
|
360
|
+
const n = i === void 0 ? e : i;
|
|
361
|
+
try {
|
|
362
|
+
kt(n, { limits: bt });
|
|
363
|
+
} catch (r) {
|
|
364
|
+
const o = r instanceof Error ? r.message : String(r);
|
|
438
365
|
throw new TypeError(
|
|
439
|
-
`
|
|
366
|
+
`QuickJS ${t} binding must be valid DV: ${o}`
|
|
440
367
|
);
|
|
441
368
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
return
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
if (n === void 0)
|
|
458
|
-
return e.undefined;
|
|
459
|
-
const r = e.evalCode(`(${n})`);
|
|
460
|
-
return e.unwrapResult(r);
|
|
369
|
+
return n;
|
|
370
|
+
}
|
|
371
|
+
function Ne(i) {
|
|
372
|
+
return i ? (e) => {
|
|
373
|
+
try {
|
|
374
|
+
const t = i(e);
|
|
375
|
+
return {
|
|
376
|
+
ok: t === void 0 ? null : t,
|
|
377
|
+
units: O
|
|
378
|
+
};
|
|
379
|
+
} catch {
|
|
380
|
+
return {
|
|
381
|
+
err: { code: "INVALID_PATH", tag: "host/invalid_path" },
|
|
382
|
+
units: O
|
|
383
|
+
};
|
|
461
384
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
try {
|
|
476
|
-
c = e.unwrapResult(a);
|
|
477
|
-
} finally {
|
|
478
|
-
a.dispose();
|
|
479
|
-
}
|
|
480
|
-
if (c === 0) {
|
|
481
|
-
if (r !== void 0 && Date.now() > r)
|
|
482
|
-
throw o.dispose(), new Error(
|
|
483
|
-
"QuickJS execution timed out while awaiting Promise"
|
|
484
|
-
);
|
|
485
|
-
await new Promise((u) => setTimeout(u, 0));
|
|
486
|
-
}
|
|
487
|
-
continue;
|
|
488
|
-
}
|
|
489
|
-
if (s.type === "fulfilled") {
|
|
490
|
-
if (s.notAPromise)
|
|
491
|
-
return o;
|
|
492
|
-
o.dispose(), o = s.value;
|
|
493
|
-
continue;
|
|
494
|
-
}
|
|
495
|
-
if (s.type === "rejected")
|
|
496
|
-
try {
|
|
497
|
-
const a = e.dump(s.error);
|
|
498
|
-
throw a instanceof Error ? a : a && typeof a == "object" && "message" in a ? new Error(
|
|
499
|
-
String(a.message)
|
|
500
|
-
) : new Error(
|
|
501
|
-
typeof a == "string" ? a : JSON.stringify(a)
|
|
502
|
-
);
|
|
503
|
-
} finally {
|
|
504
|
-
s.error.dispose(), o.dispose();
|
|
505
|
-
}
|
|
385
|
+
} : () => ({ ok: null, units: O });
|
|
386
|
+
}
|
|
387
|
+
function Zt(i) {
|
|
388
|
+
return i ? (e) => {
|
|
389
|
+
try {
|
|
390
|
+
if (i(X(e)) instanceof Promise)
|
|
391
|
+
throw new Error("Async emit handlers are not supported");
|
|
392
|
+
return { ok: null, units: O };
|
|
393
|
+
} catch {
|
|
394
|
+
return {
|
|
395
|
+
err: { code: "LIMIT_EXCEEDED", tag: "host/limit" },
|
|
396
|
+
units: O
|
|
397
|
+
};
|
|
506
398
|
}
|
|
399
|
+
} : () => ({ ok: null, units: O });
|
|
400
|
+
}
|
|
401
|
+
function X(i) {
|
|
402
|
+
if (i == null)
|
|
403
|
+
return i;
|
|
404
|
+
if (Array.isArray(i))
|
|
405
|
+
return i.map((e) => X(e));
|
|
406
|
+
if (typeof i == "object") {
|
|
407
|
+
const e = Object.getPrototypeOf(i);
|
|
408
|
+
if (e !== Object.prototype && e !== null)
|
|
409
|
+
return i;
|
|
410
|
+
const t = {};
|
|
411
|
+
for (const [n, r] of Object.entries(i))
|
|
412
|
+
t[n] = X(r);
|
|
413
|
+
return t;
|
|
507
414
|
}
|
|
415
|
+
return i;
|
|
508
416
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
417
|
+
function en(i) {
|
|
418
|
+
if (i.ok)
|
|
419
|
+
return new Error("Unexpected evaluation result");
|
|
420
|
+
if (i.type === "invalid-output") {
|
|
421
|
+
const r = new Error(i.message);
|
|
422
|
+
return r.name = "InvalidOutputError", r;
|
|
423
|
+
}
|
|
424
|
+
const e = i.error;
|
|
425
|
+
if (e.kind === "out-of-gas") {
|
|
426
|
+
const r = new Error(
|
|
427
|
+
`OutOfGas: ${e.message || "out of gas"}`
|
|
428
|
+
);
|
|
429
|
+
return r.name = "OutOfGasError", r;
|
|
430
|
+
}
|
|
431
|
+
const t = e.message || i.message, n = new Error(t);
|
|
432
|
+
return e.kind === "js-exception" ? (n.name = e.name || "Error", n) : e.kind === "host-error" ? (n.name = "HostError", n) : e.kind === "manifest-error" ? (n.name = "ManifestError", n) : (e.kind === "unknown" && e.name && (n.name = e.name), n);
|
|
512
433
|
}
|
|
513
|
-
|
|
434
|
+
function tn(i) {
|
|
435
|
+
return i instanceof Error ? i : new Error(String(i ?? "Unknown error"));
|
|
436
|
+
}
|
|
437
|
+
const Oe = 120;
|
|
438
|
+
function nn(i) {
|
|
439
|
+
return i.length <= Oe ? i : `${i.slice(0, Oe - 3)}...`;
|
|
440
|
+
}
|
|
441
|
+
class ot extends Error {
|
|
514
442
|
constructor(e, t) {
|
|
515
|
-
super(`Failed to evaluate code block: ${
|
|
443
|
+
super(`Failed to evaluate code block: ${nn(e)}`, { cause: t }), this.code = e, this.cause = t, this.name = "CodeBlockEvaluationError";
|
|
516
444
|
}
|
|
517
445
|
}
|
|
518
|
-
const
|
|
519
|
-
function
|
|
520
|
-
if (typeof i != "string" || !
|
|
446
|
+
const st = /^\$\{([\s\S]*)\}$/, rn = /\$\{([\s\S]+?)\}/, on = /\$\{([\s\S]+?)\}/g;
|
|
447
|
+
function Y(i) {
|
|
448
|
+
if (typeof i != "string" || !st.test(i))
|
|
521
449
|
return !1;
|
|
522
450
|
const e = i.indexOf("${"), t = i.lastIndexOf("${");
|
|
523
451
|
return e === t;
|
|
524
452
|
}
|
|
525
|
-
function
|
|
526
|
-
return typeof i != "string" ? !1 :
|
|
453
|
+
function sn(i) {
|
|
454
|
+
return typeof i != "string" ? !1 : st.test(i) ? !0 : rn.test(i);
|
|
527
455
|
}
|
|
528
|
-
function
|
|
529
|
-
if (!
|
|
456
|
+
function an(i) {
|
|
457
|
+
if (!Y(i))
|
|
530
458
|
throw new Error(`Invalid expression: ${i}`);
|
|
531
459
|
return i.slice(2, -1);
|
|
532
460
|
}
|
|
533
|
-
async function
|
|
534
|
-
const
|
|
461
|
+
async function at(i, e, t, n, r) {
|
|
462
|
+
const o = `return (${e});`;
|
|
535
463
|
try {
|
|
536
|
-
return await i.evaluate({
|
|
537
|
-
|
|
538
|
-
|
|
464
|
+
return await i.evaluate({
|
|
465
|
+
code: o,
|
|
466
|
+
bindings: t,
|
|
467
|
+
wasmGasLimit: n,
|
|
468
|
+
onWasmGasUsed: r
|
|
469
|
+
});
|
|
470
|
+
} catch (s) {
|
|
471
|
+
throw new ot(e, s);
|
|
539
472
|
}
|
|
540
473
|
}
|
|
541
|
-
async function
|
|
542
|
-
let
|
|
543
|
-
for (const
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
const
|
|
474
|
+
async function cn(i, e, t, n, r) {
|
|
475
|
+
let o = "", s = 0;
|
|
476
|
+
for (const a of e.matchAll(on)) {
|
|
477
|
+
const c = a[0], u = a[1], h = a.index ?? 0;
|
|
478
|
+
o += e.slice(s, h);
|
|
479
|
+
const d = await at(
|
|
547
480
|
i,
|
|
548
|
-
|
|
549
|
-
t
|
|
481
|
+
u,
|
|
482
|
+
t,
|
|
483
|
+
n,
|
|
484
|
+
r
|
|
550
485
|
);
|
|
551
|
-
|
|
486
|
+
o += d == null ? "" : String(d), s = h + c.length;
|
|
552
487
|
}
|
|
553
|
-
return
|
|
488
|
+
return o += e.slice(s), o;
|
|
554
489
|
}
|
|
555
|
-
function
|
|
490
|
+
function ct({
|
|
556
491
|
include: i,
|
|
557
492
|
exclude: e = [],
|
|
558
493
|
options: t
|
|
559
494
|
}) {
|
|
560
495
|
const n = { dot: !0, ...t ?? {} }, r = i.map(
|
|
561
|
-
(s) =>
|
|
496
|
+
(s) => Te(s, n)
|
|
562
497
|
), o = e.map(
|
|
563
|
-
(s) =>
|
|
498
|
+
(s) => Te(s, n)
|
|
564
499
|
);
|
|
565
500
|
return (s) => r.some((a) => a(s)) && !o.some((a) => a(s));
|
|
566
501
|
}
|
|
567
|
-
async function
|
|
502
|
+
async function Z(i) {
|
|
568
503
|
const {
|
|
569
504
|
evaluator: e,
|
|
570
505
|
node: t,
|
|
@@ -573,92 +508,93 @@ async function Q(i) {
|
|
|
573
508
|
shouldDescend: o = () => !0,
|
|
574
509
|
context: s,
|
|
575
510
|
pointer: a = "/"
|
|
576
|
-
} = i, c =
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
511
|
+
} = i, c = Qt, u = ({
|
|
512
|
+
used: E
|
|
513
|
+
}) => {
|
|
514
|
+
s.gasMeter().chargeWasmGas(E);
|
|
515
|
+
}, h = t.clone();
|
|
516
|
+
if (!o(a, h))
|
|
517
|
+
return h;
|
|
518
|
+
const d = h.getValue();
|
|
519
|
+
if (d !== void 0) {
|
|
520
|
+
if (typeof d == "string" && r(a)) {
|
|
521
|
+
if (Y(d)) {
|
|
522
|
+
const E = an(d), C = await at(
|
|
586
523
|
e,
|
|
587
|
-
|
|
588
|
-
n
|
|
524
|
+
E,
|
|
525
|
+
n,
|
|
526
|
+
c,
|
|
527
|
+
u
|
|
589
528
|
);
|
|
590
|
-
return s.blue.jsonValueToNode(
|
|
591
|
-
} else if (
|
|
592
|
-
const
|
|
593
|
-
let y = 0;
|
|
594
|
-
for (m.lastIndex = 0; m.exec(u); )
|
|
595
|
-
y += 1;
|
|
596
|
-
s.gasMeter().chargeTemplate(y, u);
|
|
597
|
-
const P = await zt(
|
|
529
|
+
return s.blue.jsonValueToNode(C ?? null);
|
|
530
|
+
} else if (sn(d)) {
|
|
531
|
+
const E = await cn(
|
|
598
532
|
e,
|
|
599
|
-
|
|
600
|
-
n
|
|
533
|
+
d,
|
|
534
|
+
n,
|
|
535
|
+
c,
|
|
536
|
+
u
|
|
601
537
|
);
|
|
602
|
-
return new
|
|
538
|
+
return new p().setValue(E);
|
|
603
539
|
}
|
|
604
540
|
}
|
|
605
|
-
return
|
|
541
|
+
return h;
|
|
606
542
|
}
|
|
607
|
-
const
|
|
608
|
-
if (Array.isArray(
|
|
609
|
-
const
|
|
610
|
-
|
|
611
|
-
(
|
|
543
|
+
const S = h.getItems?.();
|
|
544
|
+
if (Array.isArray(S)) {
|
|
545
|
+
const E = await Promise.all(
|
|
546
|
+
S.map(
|
|
547
|
+
(C, P) => Z({
|
|
612
548
|
...i,
|
|
613
|
-
node:
|
|
549
|
+
node: C,
|
|
614
550
|
pointer: `${a}/${P}`
|
|
615
551
|
})
|
|
616
552
|
)
|
|
617
553
|
);
|
|
618
|
-
return
|
|
619
|
-
}
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
const
|
|
623
|
-
for (const [
|
|
624
|
-
const
|
|
625
|
-
|
|
554
|
+
return h.setItems(E), h;
|
|
555
|
+
}
|
|
556
|
+
const m = h.getProperties?.();
|
|
557
|
+
if (m) {
|
|
558
|
+
const E = {};
|
|
559
|
+
for (const [C, P] of Object.entries(m)) {
|
|
560
|
+
const D = a === "/" ? `/${C}` : `${a}/${C}`;
|
|
561
|
+
E[C] = await Z({
|
|
626
562
|
...i,
|
|
627
563
|
node: P,
|
|
628
|
-
pointer:
|
|
564
|
+
pointer: D
|
|
629
565
|
});
|
|
630
566
|
}
|
|
631
|
-
|
|
567
|
+
h.setProperties(E);
|
|
632
568
|
}
|
|
633
|
-
return
|
|
569
|
+
return h;
|
|
634
570
|
}
|
|
635
|
-
const
|
|
571
|
+
const re = g(f["Core/Contract"])(l.object({
|
|
636
572
|
description: l.string().optional(),
|
|
637
573
|
name: l.string().optional(),
|
|
638
574
|
order: l.number().optional()
|
|
639
|
-
})),
|
|
575
|
+
})), Se = re, x = g(f["Core/Channel"])(re.extend({
|
|
640
576
|
description: l.string().optional(),
|
|
641
|
-
event:
|
|
577
|
+
event: b().optional(),
|
|
642
578
|
name: l.string().optional()
|
|
643
|
-
})),
|
|
644
|
-
|
|
579
|
+
})), _ = x.merge(
|
|
580
|
+
Se
|
|
645
581
|
).extend({
|
|
646
582
|
path: l.string().optional(),
|
|
647
|
-
definition:
|
|
648
|
-
}),
|
|
583
|
+
definition: b().optional()
|
|
584
|
+
}), lt = g(f["Core/Handler"])(re.extend({
|
|
649
585
|
channel: l.string().optional(),
|
|
650
586
|
description: l.string().optional(),
|
|
651
|
-
event:
|
|
587
|
+
event: b().optional(),
|
|
652
588
|
name: l.string().optional()
|
|
653
|
-
})),
|
|
589
|
+
})), ut = lt.merge(Se), K = g(f["Core/Marker"])(re.extend({
|
|
654
590
|
description: l.string().optional(),
|
|
655
591
|
name: l.string().optional()
|
|
656
|
-
})),
|
|
592
|
+
})), N = K.merge(Se), ln = l.object({
|
|
657
593
|
op: l.enum(["ADD", "REPLACE", "REMOVE"]),
|
|
658
594
|
path: l.string(),
|
|
659
|
-
val:
|
|
660
|
-
}),
|
|
661
|
-
|
|
595
|
+
val: b().optional()
|
|
596
|
+
}), oo = g("JsonPatch")(
|
|
597
|
+
ln
|
|
662
598
|
).superRefine((i, e) => {
|
|
663
599
|
i.op === "REMOVE" && i.val !== void 0 && e.addIssue({
|
|
664
600
|
code: l.ZodIssueCode.custom,
|
|
@@ -669,28 +605,29 @@ const ee = f(p["Core/Contract"])(l.object({
|
|
|
669
605
|
message: `${i.op} operations must include a value`,
|
|
670
606
|
path: ["val"]
|
|
671
607
|
});
|
|
672
|
-
}),
|
|
608
|
+
}), un = g(f["Core/Document Update Channel"])(x.extend({
|
|
673
609
|
description: l.string().optional(),
|
|
674
610
|
name: l.string().optional(),
|
|
675
611
|
path: l.string().optional()
|
|
676
|
-
})),
|
|
677
|
-
|
|
678
|
-
),
|
|
612
|
+
})), hn = un.merge(
|
|
613
|
+
_
|
|
614
|
+
), dn = g(f["Core/Embedded Node Channel"])(x.extend({
|
|
679
615
|
childPath: l.string().optional(),
|
|
680
616
|
description: l.string().optional(),
|
|
681
617
|
name: l.string().optional()
|
|
682
|
-
})),
|
|
683
|
-
|
|
684
|
-
),
|
|
618
|
+
})), pn = dn.merge(
|
|
619
|
+
_
|
|
620
|
+
), mn = g(f["Core/Lifecycle Event Channel"])(x.extend({
|
|
685
621
|
description: l.string().optional(),
|
|
686
622
|
name: l.string().optional()
|
|
687
|
-
})),
|
|
688
|
-
|
|
689
|
-
),
|
|
623
|
+
})), fn = mn.merge(
|
|
624
|
+
_
|
|
625
|
+
), gn = g(f["Core/Triggered Event Channel"])(x.extend({
|
|
690
626
|
description: l.string().optional(),
|
|
691
627
|
name: l.string().optional()
|
|
692
|
-
})),
|
|
628
|
+
})), En = gn.merge(_), w = {
|
|
693
629
|
"Conversation/Actor": "CN5efWVizJbRsMCw8YWRfT2q9vM9XfeGDN9wFvYcvMnQ",
|
|
630
|
+
"Conversation/Composite Timeline Channel": "HsNatiPt2YvmkWQoqtfrFCbdp75ZUBLBUkWeq84WTfnr",
|
|
694
631
|
"Conversation/JavaScript Code": "3hYcmWMtMUPAzXBLFLb7BpuG9537tuTJPCr7pxWXvTZK",
|
|
695
632
|
"Conversation/Operation": "BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC",
|
|
696
633
|
"Conversation/Operation Request": "HM4Ku4LFcjC5MxnhPMRwQ8w3BbHmJKKZfHTTzsd4jbJq",
|
|
@@ -702,13 +639,13 @@ const ee = f(p["Core/Contract"])(l.object({
|
|
|
702
639
|
"Conversation/Timeline Entry": "EzDiC9Frs8V5yQBMtDYh1DobVnWtWpFemXDX5fGUULBn",
|
|
703
640
|
"Conversation/Trigger Event": "GxUtWr3eH9a6YQeioQkujEnsPjD5s9RU8ZhEfmsV1vuU",
|
|
704
641
|
"Conversation/Update Document": "BnnNLCnKF49TUJ1bRfZ5rSMaFw8SVfUNfnE4kJFG7HtM"
|
|
705
|
-
},
|
|
642
|
+
}, ht = g(w["Conversation/Timeline Channel"])(x.extend({
|
|
706
643
|
description: l.string().optional(),
|
|
707
644
|
name: l.string().optional(),
|
|
708
645
|
timelineId: l.string().optional()
|
|
709
|
-
})),
|
|
710
|
-
|
|
711
|
-
),
|
|
646
|
+
})), yn = ht.merge(
|
|
647
|
+
_
|
|
648
|
+
), I = {
|
|
712
649
|
"MyOS/Document Anchor": "HS9yo34TGEAM2LGcNbLh7XPN4goPRhqdGZQkiyh473Wb",
|
|
713
650
|
"MyOS/Document Anchors": "7Usvk6dZMVqas3yqs23ZEXn1zu1YDPjgYiZFNYaw3puH",
|
|
714
651
|
"MyOS/Document Links": "4cmrbevB6K23ZenjqwmNxpnaw6RF4VB3wkP7XB59V7W5",
|
|
@@ -719,100 +656,104 @@ const ee = f(p["Core/Contract"])(l.object({
|
|
|
719
656
|
"MyOS/MyOS Timeline Channel": "HCF8mXnX3dFjQ8osjxb4Wzm2Nm1DoXnTYuA5sPnV7NTs",
|
|
720
657
|
"MyOS/MyOS Timeline Entry": "Furgmg5xcJVMDmaQXZRfZ1XehSf7PWctrioo8etRYJHQ",
|
|
721
658
|
"MyOS/MyOS Worker Agency": "4Lix4AKXvBDvrwxw2htSdYFKxL4wugEQzqoSEYet5Dh1"
|
|
722
|
-
},
|
|
659
|
+
}, Cn = g(I["MyOS/MyOS Timeline Channel"])(ht.extend({
|
|
723
660
|
accountId: l.string().optional(),
|
|
724
661
|
description: l.string().optional(),
|
|
725
662
|
email: l.string().optional(),
|
|
726
663
|
name: l.string().optional()
|
|
727
|
-
})),
|
|
664
|
+
})), Sn = Cn.merge(_), vn = g(w["Conversation/Composite Timeline Channel"])(x.extend({
|
|
665
|
+
channels: l.array(l.string()).optional(),
|
|
728
666
|
description: l.string().optional(),
|
|
729
|
-
lastEvents: l.record(l.string(), v()).optional(),
|
|
730
667
|
name: l.string().optional()
|
|
731
|
-
})),
|
|
668
|
+
})), dt = vn.merge(_), wn = g(f["Core/Channel Event Checkpoint"])(K.extend({
|
|
669
|
+
description: l.string().optional(),
|
|
670
|
+
lastEvents: l.record(l.string(), b()).optional(),
|
|
671
|
+
name: l.string().optional()
|
|
672
|
+
})), kn = wn.merge(N).extend({
|
|
732
673
|
lastSignatures: l.record(l.string()).optional()
|
|
733
|
-
}),
|
|
674
|
+
}), bn = g(f["Core/Processing Initialized Marker"])(K.extend({
|
|
734
675
|
description: l.string().optional(),
|
|
735
676
|
documentId: l.string().optional(),
|
|
736
677
|
name: l.string().optional()
|
|
737
|
-
})),
|
|
678
|
+
})), In = bn.merge(N), Tn = g(f["Core/Process Embedded"])(K.extend({
|
|
738
679
|
description: l.string().optional(),
|
|
739
680
|
name: l.string().optional(),
|
|
740
681
|
paths: l.array(l.string()).optional()
|
|
741
|
-
})),
|
|
742
|
-
|
|
743
|
-
),
|
|
682
|
+
})), Rn = Tn.merge(
|
|
683
|
+
N
|
|
684
|
+
), Pn = g(f["Core/Processing Terminated Marker"])(K.extend({
|
|
744
685
|
cause: l.string().optional(),
|
|
745
686
|
description: l.string().optional(),
|
|
746
687
|
name: l.string().optional(),
|
|
747
688
|
reason: l.string().optional()
|
|
748
|
-
})),
|
|
689
|
+
})), Mn = Pn.merge(N), j = g(w["Conversation/Operation"])(K.extend({
|
|
749
690
|
channel: l.string().optional(),
|
|
750
691
|
description: l.string().optional(),
|
|
751
692
|
name: l.string().optional(),
|
|
752
|
-
request:
|
|
753
|
-
})),
|
|
754
|
-
|
|
755
|
-
),
|
|
693
|
+
request: b().optional()
|
|
694
|
+
})), Nn = j.merge(
|
|
695
|
+
N
|
|
696
|
+
), On = g(I["MyOS/Document Anchor"])(l.object({
|
|
756
697
|
description: l.string().optional(),
|
|
757
698
|
name: l.string().optional(),
|
|
758
|
-
template:
|
|
759
|
-
})),
|
|
699
|
+
template: b().optional()
|
|
700
|
+
})), An = g(I["MyOS/Document Anchors"])(l.object({}).catchall(On)), Dn = An.merge(N), Bn = g(I["MyOS/Link"])(l.object({
|
|
760
701
|
anchor: l.string().optional(),
|
|
761
702
|
description: l.string().optional(),
|
|
762
703
|
name: l.string().optional()
|
|
763
|
-
})),
|
|
764
|
-
|
|
765
|
-
),
|
|
704
|
+
})), xn = g(I["MyOS/Document Links"])(l.object({}).catchall(Bn)), _n = xn.merge(
|
|
705
|
+
N
|
|
706
|
+
), Ln = g(I["MyOS/MyOS Participants Orchestration"])(l.object({
|
|
766
707
|
name: l.string().optional()
|
|
767
|
-
})),
|
|
708
|
+
})), Fn = Ln.merge(N), Un = g(I["MyOS/MyOS Session Interaction"])(l.object({
|
|
768
709
|
name: l.string().optional()
|
|
769
|
-
})),
|
|
710
|
+
})), $n = Un.merge(N), zn = g(I["MyOS/MyOS Worker Agency"])(l.object({
|
|
770
711
|
name: l.string().optional()
|
|
771
|
-
})),
|
|
772
|
-
|
|
773
|
-
),
|
|
712
|
+
})), Vn = zn.merge(
|
|
713
|
+
N
|
|
714
|
+
), ie = g(w["Conversation/Sequential Workflow Step"])(l.object({
|
|
774
715
|
description: l.string().optional(),
|
|
775
716
|
name: l.string().optional()
|
|
776
|
-
})),
|
|
717
|
+
})), pt = g(w["Conversation/Sequential Workflow"])(lt.extend({
|
|
777
718
|
description: l.string().optional(),
|
|
778
719
|
name: l.string().optional(),
|
|
779
|
-
steps: l.array(
|
|
780
|
-
})),
|
|
781
|
-
steps: l.array(
|
|
782
|
-
}),
|
|
720
|
+
steps: l.array(ie).optional()
|
|
721
|
+
})), so = b(), Hn = pt.merge(ut).extend({
|
|
722
|
+
steps: l.array(b()).optional()
|
|
723
|
+
}), Kn = g(w["Conversation/Sequential Workflow Operation"])(pt.extend({
|
|
783
724
|
description: l.string().optional(),
|
|
784
725
|
name: l.string().optional(),
|
|
785
726
|
operation: l.string().optional()
|
|
786
|
-
})),
|
|
787
|
-
|
|
727
|
+
})), Wn = Kn.merge(
|
|
728
|
+
ut
|
|
788
729
|
).extend({
|
|
789
|
-
steps: l.array(
|
|
730
|
+
steps: l.array(b()).optional()
|
|
790
731
|
});
|
|
791
|
-
function
|
|
732
|
+
function Gn(i) {
|
|
792
733
|
if (!Array.isArray(i.blueIds) || i.blueIds.length === 0)
|
|
793
734
|
throw new Error("Contract processors must declare at least one BlueId");
|
|
794
735
|
for (const e of i.blueIds)
|
|
795
736
|
if (typeof e != "string" || e.trim().length === 0)
|
|
796
737
|
throw new Error("Contract processor BlueIds must be non-empty strings");
|
|
797
738
|
}
|
|
798
|
-
function
|
|
799
|
-
|
|
739
|
+
function J(i, e) {
|
|
740
|
+
Gn(i);
|
|
800
741
|
for (const t of i.blueIds)
|
|
801
742
|
e.set(t, i);
|
|
802
743
|
}
|
|
803
|
-
class
|
|
744
|
+
class qn {
|
|
804
745
|
processorsByBlueId = /* @__PURE__ */ new Map();
|
|
805
746
|
handlerProcessors = /* @__PURE__ */ new Map();
|
|
806
747
|
channelProcessors = /* @__PURE__ */ new Map();
|
|
807
748
|
markerProcessors = /* @__PURE__ */ new Map();
|
|
808
749
|
registerHandler(e) {
|
|
809
|
-
|
|
750
|
+
J(e, this.handlerProcessors), this.registerProcessorMap(e);
|
|
810
751
|
}
|
|
811
752
|
registerChannel(e) {
|
|
812
|
-
|
|
753
|
+
J(e, this.channelProcessors), this.registerProcessorMap(e);
|
|
813
754
|
}
|
|
814
755
|
registerMarker(e) {
|
|
815
|
-
|
|
756
|
+
J(e, this.markerProcessors), this.registerProcessorMap(e);
|
|
816
757
|
}
|
|
817
758
|
register(e) {
|
|
818
759
|
switch (e.kind) {
|
|
@@ -846,55 +787,176 @@ class Tn {
|
|
|
846
787
|
return new Map(this.processorsByBlueId);
|
|
847
788
|
}
|
|
848
789
|
registerProcessorMap(e) {
|
|
849
|
-
|
|
790
|
+
J(e, this.processorsByBlueId);
|
|
850
791
|
}
|
|
851
792
|
}
|
|
852
|
-
const
|
|
793
|
+
const jn = "compositeSourceChannelKey";
|
|
794
|
+
function Jn(i, e) {
|
|
795
|
+
return `${i}::${e}`;
|
|
796
|
+
}
|
|
797
|
+
function Qn(i) {
|
|
798
|
+
return i != null && Object.prototype.hasOwnProperty.call(i, "lastEvents") && Object.prototype.hasOwnProperty.call(i, "lastSignatures");
|
|
799
|
+
}
|
|
800
|
+
class Xn {
|
|
801
|
+
kind = "channel";
|
|
802
|
+
blueIds = [
|
|
803
|
+
w["Conversation/Composite Timeline Channel"]
|
|
804
|
+
];
|
|
805
|
+
schema = dt;
|
|
806
|
+
/**
|
|
807
|
+
* Fallback match hook that delegates to {@link evaluate} for consistent behavior.
|
|
808
|
+
*/
|
|
809
|
+
matches(e, t) {
|
|
810
|
+
return this.evaluate(e, t).then((n) => n.matches);
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Resolve child channels and return a delivery per matching child, enriching
|
|
814
|
+
* each delivered event with the source channel key.
|
|
815
|
+
*/
|
|
816
|
+
async evaluate(e, t) {
|
|
817
|
+
const n = t.event;
|
|
818
|
+
if (!n)
|
|
819
|
+
return { matches: !1 };
|
|
820
|
+
const r = e.channels?.filter((u) => u.trim().length > 0) ?? [];
|
|
821
|
+
if (r.length === 0)
|
|
822
|
+
return { matches: !1 };
|
|
823
|
+
const o = t.resolveChannel, s = t.channelProcessorFor;
|
|
824
|
+
if (!o || !s)
|
|
825
|
+
throw new Error(
|
|
826
|
+
"Composite timeline channel evaluation requires channel resolution helpers"
|
|
827
|
+
);
|
|
828
|
+
const a = t.blue.calculateBlueIdSync(n), c = [];
|
|
829
|
+
for (const u of r) {
|
|
830
|
+
const h = o(u);
|
|
831
|
+
if (!h)
|
|
832
|
+
throw new Error(
|
|
833
|
+
`Composite timeline channel '${t.bindingKey}' references missing channel '${u}'`
|
|
834
|
+
);
|
|
835
|
+
const d = s(h.blueId);
|
|
836
|
+
if (!d)
|
|
837
|
+
throw new Error(
|
|
838
|
+
`No processor registered for child channel '${u}' (${h.blueId})`
|
|
839
|
+
);
|
|
840
|
+
const S = n.clone(), m = {
|
|
841
|
+
...t,
|
|
842
|
+
event: S,
|
|
843
|
+
bindingKey: u
|
|
844
|
+
}, E = h.contract, C = E.event;
|
|
845
|
+
if (C && !t.blue.isTypeOfNode(S, C) || !await d.matches(E, m))
|
|
846
|
+
continue;
|
|
847
|
+
const D = d.channelize, ke = (D ? D.call(d, E, m) : void 0) ?? S.clone();
|
|
848
|
+
this.enrichEvent(ke, u);
|
|
849
|
+
const be = Jn(
|
|
850
|
+
t.bindingKey,
|
|
851
|
+
u
|
|
852
|
+
), vt = await this.shouldProcessChild({
|
|
853
|
+
childProcessor: d,
|
|
854
|
+
childContract: E,
|
|
855
|
+
context: {
|
|
856
|
+
...m,
|
|
857
|
+
event: n.clone()
|
|
858
|
+
},
|
|
859
|
+
checkpointKey: be,
|
|
860
|
+
markers: t.markers
|
|
861
|
+
});
|
|
862
|
+
c.push({
|
|
863
|
+
eventNode: ke,
|
|
864
|
+
eventId: a,
|
|
865
|
+
checkpointKey: be,
|
|
866
|
+
shouldProcess: vt
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
return {
|
|
870
|
+
matches: c.length > 0,
|
|
871
|
+
deliveries: c
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Determine recency by checking whether any child delivery should process.
|
|
876
|
+
*/
|
|
877
|
+
async isNewerEvent(e, t, n) {
|
|
878
|
+
const r = await this.evaluate(e, t), o = r.deliveries ?? [];
|
|
879
|
+
return !r.matches || o.length === 0 ? !1 : o.some((s) => s.shouldProcess !== !1);
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Attach the source child channel key to event metadata for handler logic.
|
|
883
|
+
*/
|
|
884
|
+
enrichEvent(e, t) {
|
|
885
|
+
const n = e.getProperties() ?? {}, r = n.meta instanceof p ? n.meta.clone() : new p(), o = r.getProperties() ?? {};
|
|
886
|
+
r.setProperties({
|
|
887
|
+
...o,
|
|
888
|
+
[jn]: new p().setValue(t)
|
|
889
|
+
}), e.setProperties({ ...n, meta: r });
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Apply child-level recency rules using the composite-scoped checkpoint entry.
|
|
893
|
+
*/
|
|
894
|
+
async shouldProcessChild(e) {
|
|
895
|
+
const t = e.childProcessor.isNewerEvent;
|
|
896
|
+
if (typeof t != "function")
|
|
897
|
+
return !0;
|
|
898
|
+
const r = this.resolveCheckpoint(e.markers)?.lastEvents?.[e.checkpointKey] ?? null;
|
|
899
|
+
return !r || typeof r.clone != "function" ? !0 : await t.call(
|
|
900
|
+
e.childProcessor,
|
|
901
|
+
e.childContract,
|
|
902
|
+
e.context,
|
|
903
|
+
r.clone()
|
|
904
|
+
);
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Resolve the checkpoint marker for the current scope, if present.
|
|
908
|
+
*/
|
|
909
|
+
resolveCheckpoint(e) {
|
|
910
|
+
const t = e.get(A);
|
|
911
|
+
return Qn(t) ? t : null;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
const Yn = g(w["Conversation/Actor"])(l.object({
|
|
853
915
|
description: l.string().optional(),
|
|
854
916
|
name: l.string().optional()
|
|
855
|
-
})),
|
|
917
|
+
})), mt = g(w["Conversation/Timeline"])(l.object({
|
|
856
918
|
description: l.string().optional(),
|
|
857
919
|
name: l.string().optional(),
|
|
858
920
|
timelineId: l.string().optional()
|
|
859
|
-
})),
|
|
860
|
-
actor:
|
|
921
|
+
})), M = g(w["Conversation/Timeline Entry"])(l.object({
|
|
922
|
+
actor: Yn.optional(),
|
|
861
923
|
description: l.string().optional(),
|
|
862
|
-
message:
|
|
924
|
+
message: b().optional(),
|
|
863
925
|
name: l.string().optional(),
|
|
864
|
-
prevEntry:
|
|
865
|
-
timeline:
|
|
926
|
+
prevEntry: b().optional(),
|
|
927
|
+
timeline: mt.optional(),
|
|
866
928
|
timestamp: l.number().optional()
|
|
867
|
-
})),
|
|
929
|
+
})), Zn = g(I["MyOS/MyOS Timeline"])(mt.extend({
|
|
868
930
|
accountId: l.string().optional(),
|
|
869
931
|
description: l.string().optional(),
|
|
870
932
|
name: l.string().optional()
|
|
871
|
-
})),
|
|
933
|
+
})), Ae = g(I["MyOS/MyOS Timeline Entry"])(M.extend({
|
|
872
934
|
description: l.string().optional(),
|
|
873
935
|
name: l.string().optional(),
|
|
874
|
-
timeline:
|
|
936
|
+
timeline: Zn.optional()
|
|
875
937
|
}));
|
|
876
|
-
function
|
|
877
|
-
return e && i.isTypeOf(e,
|
|
938
|
+
function De(i, e) {
|
|
939
|
+
return e && i.isTypeOf(e, M, { checkSchemaExtensions: !0 }) ? i.nodeToSchemaOutput(e, M) : null;
|
|
878
940
|
}
|
|
879
|
-
function
|
|
880
|
-
const n =
|
|
941
|
+
function ft(i, e, t) {
|
|
942
|
+
const n = De(i, e), r = De(i, t);
|
|
881
943
|
if (!n || !r)
|
|
882
944
|
return !0;
|
|
883
945
|
const o = n.timestamp, s = r.timestamp;
|
|
884
946
|
return typeof o != "number" || typeof s != "number" ? !0 : o >= s;
|
|
885
947
|
}
|
|
886
|
-
function
|
|
887
|
-
return i.isTypeOf(e,
|
|
948
|
+
function Be(i, e) {
|
|
949
|
+
return i.isTypeOf(e, Ae) ? i.nodeToSchemaOutput(e, Ae) : i.isTypeOf(e, M) ? i.nodeToSchemaOutput(e, M) : null;
|
|
888
950
|
}
|
|
889
|
-
class
|
|
951
|
+
class er {
|
|
890
952
|
kind = "channel";
|
|
891
|
-
blueIds = [
|
|
892
|
-
schema =
|
|
953
|
+
blueIds = [I["MyOS/MyOS Timeline Channel"]];
|
|
954
|
+
schema = Sn;
|
|
893
955
|
matches(e, t) {
|
|
894
956
|
const { event: n, blue: r } = t;
|
|
895
957
|
if (!n)
|
|
896
958
|
return !1;
|
|
897
|
-
const o =
|
|
959
|
+
const o = Be(r, n);
|
|
898
960
|
if (!o)
|
|
899
961
|
return !1;
|
|
900
962
|
const s = o.timeline?.timelineId;
|
|
@@ -902,40 +964,40 @@ class Pn {
|
|
|
902
964
|
}
|
|
903
965
|
channelize(e, t) {
|
|
904
966
|
const { event: n, blue: r } = t;
|
|
905
|
-
return !n || !
|
|
967
|
+
return !n || !Be(r, n) ? null : n.clone();
|
|
906
968
|
}
|
|
907
969
|
isNewerEvent(e, t, n) {
|
|
908
970
|
const { event: r, blue: o } = t;
|
|
909
|
-
return r ?
|
|
971
|
+
return r ? ft(o, r, n) : !0;
|
|
910
972
|
}
|
|
911
973
|
}
|
|
912
|
-
class
|
|
974
|
+
class tr {
|
|
913
975
|
kind = "channel";
|
|
914
|
-
blueIds = [
|
|
915
|
-
schema =
|
|
976
|
+
blueIds = [w["Conversation/Timeline Channel"]];
|
|
977
|
+
schema = yn;
|
|
916
978
|
matches(e, t) {
|
|
917
979
|
const { event: n, blue: r } = t;
|
|
918
|
-
if (!n || !r.isTypeOf(n,
|
|
980
|
+
if (!n || !r.isTypeOf(n, M))
|
|
919
981
|
return !1;
|
|
920
|
-
const s = r.nodeToSchemaOutput(n,
|
|
982
|
+
const s = r.nodeToSchemaOutput(n, M).timeline?.timelineId;
|
|
921
983
|
return !(!s || !e.timelineId || s !== e.timelineId);
|
|
922
984
|
}
|
|
923
985
|
channelize(e, t) {
|
|
924
986
|
const { event: n, blue: r } = t;
|
|
925
|
-
return !n || !r.isTypeOf(n,
|
|
987
|
+
return !n || !r.isTypeOf(n, M) ? null : n.clone();
|
|
926
988
|
}
|
|
927
989
|
isNewerEvent(e, t, n) {
|
|
928
990
|
const { event: r, blue: o } = t;
|
|
929
|
-
return r ?
|
|
991
|
+
return r ? ft(o, r, n) : !0;
|
|
930
992
|
}
|
|
931
993
|
}
|
|
932
|
-
const
|
|
994
|
+
const xe = g(w["Conversation/Trigger Event"])(ie.extend({
|
|
933
995
|
description: l.string().optional(),
|
|
934
|
-
event:
|
|
996
|
+
event: b().optional(),
|
|
935
997
|
name: l.string().optional()
|
|
936
998
|
}));
|
|
937
|
-
function
|
|
938
|
-
const { context: e, eventNode: t, stepResults: n } = i, r =
|
|
999
|
+
function ve(i) {
|
|
1000
|
+
const { context: e, eventNode: t, stepResults: n } = i, r = rr(e);
|
|
939
1001
|
return {
|
|
940
1002
|
event: e.blue.nodeToJson(t, "simple"),
|
|
941
1003
|
eventCanonical: e.blue.nodeToJson(t, "official"),
|
|
@@ -943,94 +1005,99 @@ function me(i) {
|
|
|
943
1005
|
document: r
|
|
944
1006
|
};
|
|
945
1007
|
}
|
|
946
|
-
const
|
|
947
|
-
function
|
|
1008
|
+
const nr = /* @__PURE__ */ new Set(["blueId", "name", "description", "value"]);
|
|
1009
|
+
function rr(i) {
|
|
948
1010
|
const e = (o) => {
|
|
949
1011
|
if (o === "/")
|
|
950
1012
|
return !1;
|
|
951
1013
|
const s = o.lastIndexOf("/"), a = o.substring(s + 1);
|
|
952
|
-
return
|
|
1014
|
+
return nr.has(a);
|
|
953
1015
|
}, t = (o) => {
|
|
954
1016
|
const s = o == null ? "/" : typeof o == "string" ? o : (() => {
|
|
955
1017
|
throw new TypeError("document() expects a string pointer");
|
|
956
|
-
})(), a = s.startsWith("/") ? s : i.resolvePointer(s), c =
|
|
1018
|
+
})(), a = s.startsWith("/") ? s : i.resolvePointer(s), c = R(a), u = i.documentAt(c);
|
|
957
1019
|
return i.gasMeter().chargeDocumentSnapshot(c, u), { snapshot: u, normalizedPointer: c };
|
|
958
1020
|
}, n = (o, s) => {
|
|
959
1021
|
const { snapshot: a, normalizedPointer: c } = t(o);
|
|
960
1022
|
if (a)
|
|
961
1023
|
return e(c) ? i.blue.nodeToJson(a, "simple") : i.blue.nodeToJson(a, s);
|
|
962
|
-
}, r = (o) => n(o, "simple");
|
|
1024
|
+
}, r = ((o) => n(o, "simple"));
|
|
963
1025
|
return r.canonical = (o) => n(o, "official"), r;
|
|
964
1026
|
}
|
|
965
|
-
class
|
|
1027
|
+
class ir {
|
|
966
1028
|
supportedBlueIds = [
|
|
967
|
-
|
|
1029
|
+
w["Conversation/Trigger Event"]
|
|
968
1030
|
];
|
|
969
|
-
evaluator = new
|
|
1031
|
+
evaluator = new Ce();
|
|
970
1032
|
async execute(e) {
|
|
971
1033
|
const { stepNode: t, context: n } = e;
|
|
972
|
-
if (!n.blue.isTypeOf(t,
|
|
1034
|
+
if (!n.blue.isTypeOf(t, xe))
|
|
973
1035
|
return n.throwFatal("Trigger Event step payload is invalid");
|
|
974
1036
|
n.gasMeter().chargeTriggerEventBase();
|
|
975
|
-
const r = await
|
|
1037
|
+
const r = await Z({
|
|
976
1038
|
evaluator: this.evaluator,
|
|
977
1039
|
node: t,
|
|
978
|
-
bindings:
|
|
979
|
-
shouldResolve:
|
|
1040
|
+
bindings: ve(e),
|
|
1041
|
+
shouldResolve: ct({
|
|
980
1042
|
include: ["/event", "/event/**"]
|
|
981
1043
|
}),
|
|
982
|
-
shouldDescend:
|
|
1044
|
+
shouldDescend: or(),
|
|
983
1045
|
context: n
|
|
984
1046
|
}), s = n.blue.nodeToSchemaOutput(
|
|
985
1047
|
r,
|
|
986
|
-
|
|
1048
|
+
xe
|
|
987
1049
|
).event;
|
|
988
|
-
if (
|
|
1050
|
+
if (he(s))
|
|
989
1051
|
return n.throwFatal(
|
|
990
1052
|
"Trigger Event step must declare event payload"
|
|
991
1053
|
);
|
|
992
1054
|
n.emitEvent(s.clone());
|
|
993
1055
|
}
|
|
994
1056
|
}
|
|
995
|
-
function
|
|
996
|
-
return (i, e) => i === "/event" || !i.startsWith("/event/") ? !0 : !
|
|
1057
|
+
function or() {
|
|
1058
|
+
return (i, e) => i === "/event" || !i.startsWith("/event/") ? !0 : !sr(e);
|
|
997
1059
|
}
|
|
998
|
-
function
|
|
1060
|
+
function sr(i) {
|
|
999
1061
|
const e = i.getProperties?.();
|
|
1000
1062
|
return e ? !!e.contracts : !1;
|
|
1001
1063
|
}
|
|
1002
|
-
const
|
|
1064
|
+
const _e = g(w["Conversation/JavaScript Code"])(ie.extend({
|
|
1003
1065
|
code: l.string().optional(),
|
|
1004
1066
|
description: l.string().optional(),
|
|
1005
1067
|
name: l.string().optional()
|
|
1006
1068
|
}));
|
|
1007
|
-
class
|
|
1069
|
+
class ar {
|
|
1008
1070
|
supportedBlueIds = [
|
|
1009
|
-
|
|
1071
|
+
w["Conversation/JavaScript Code"]
|
|
1010
1072
|
];
|
|
1011
|
-
evaluator = new
|
|
1073
|
+
evaluator = new Ce();
|
|
1074
|
+
wasmGasLimit;
|
|
1075
|
+
constructor(e = {}) {
|
|
1076
|
+
this.wasmGasLimit = e.wasmGasLimit ?? it;
|
|
1077
|
+
}
|
|
1012
1078
|
async execute(e) {
|
|
1013
1079
|
const { context: t, stepNode: n } = e, { blue: r } = t;
|
|
1014
|
-
if (!r.isTypeOf(n,
|
|
1080
|
+
if (!r.isTypeOf(n, _e))
|
|
1015
1081
|
return t.throwFatal("JavaScript Code step payload is invalid");
|
|
1016
1082
|
const s = r.nodeToSchemaOutput(
|
|
1017
1083
|
n,
|
|
1018
|
-
|
|
1084
|
+
_e
|
|
1019
1085
|
).code;
|
|
1020
1086
|
if (!s)
|
|
1021
1087
|
return t.throwFatal(
|
|
1022
1088
|
"JavaScript Code step must include code to execute"
|
|
1023
1089
|
);
|
|
1024
|
-
|
|
1025
|
-
const a = me(e);
|
|
1090
|
+
const a = ve(e);
|
|
1026
1091
|
try {
|
|
1027
1092
|
const c = await this.evaluator.evaluate({
|
|
1028
1093
|
code: s,
|
|
1029
|
-
bindings: a
|
|
1094
|
+
bindings: a,
|
|
1095
|
+
wasmGasLimit: this.wasmGasLimit,
|
|
1096
|
+
onWasmGasUsed: ({ used: u }) => t.gasMeter().chargeWasmGas(u)
|
|
1030
1097
|
});
|
|
1031
1098
|
return this.handleEvents(c, t), c;
|
|
1032
1099
|
} catch (c) {
|
|
1033
|
-
throw new
|
|
1100
|
+
throw new ot(s, c);
|
|
1034
1101
|
}
|
|
1035
1102
|
}
|
|
1036
1103
|
handleEvents(e, t) {
|
|
@@ -1044,31 +1111,31 @@ class Ln {
|
|
|
1044
1111
|
}
|
|
1045
1112
|
}
|
|
1046
1113
|
}
|
|
1047
|
-
const
|
|
1114
|
+
const cr = g(f["Core/Json Patch Entry"])(l.object({
|
|
1048
1115
|
description: l.string().optional(),
|
|
1049
1116
|
name: l.string().optional(),
|
|
1050
1117
|
op: l.string().optional(),
|
|
1051
1118
|
path: l.string().optional(),
|
|
1052
|
-
val:
|
|
1053
|
-
})),
|
|
1054
|
-
changeset: l.array(
|
|
1119
|
+
val: b().optional()
|
|
1120
|
+
})), Le = g(w["Conversation/Update Document"])(ie.extend({
|
|
1121
|
+
changeset: l.array(cr).optional(),
|
|
1055
1122
|
description: l.string().optional(),
|
|
1056
1123
|
name: l.string().optional()
|
|
1057
1124
|
}));
|
|
1058
|
-
class
|
|
1125
|
+
class lr {
|
|
1059
1126
|
supportedBlueIds = [
|
|
1060
|
-
|
|
1127
|
+
w["Conversation/Update Document"]
|
|
1061
1128
|
];
|
|
1062
|
-
evaluator = new
|
|
1129
|
+
evaluator = new Ce();
|
|
1063
1130
|
async execute(e) {
|
|
1064
1131
|
const { context: t, stepNode: n } = e, { blue: r } = t;
|
|
1065
|
-
if (!r.isTypeOf(n,
|
|
1132
|
+
if (!r.isTypeOf(n, Le))
|
|
1066
1133
|
return t.throwFatal("Update Document step payload is invalid");
|
|
1067
|
-
const o = await
|
|
1134
|
+
const o = await Z({
|
|
1068
1135
|
evaluator: this.evaluator,
|
|
1069
1136
|
node: n,
|
|
1070
|
-
bindings:
|
|
1071
|
-
shouldResolve:
|
|
1137
|
+
bindings: ve(e),
|
|
1138
|
+
shouldResolve: ct({
|
|
1072
1139
|
include: ["/changeset", "/changeset/**"]
|
|
1073
1140
|
}),
|
|
1074
1141
|
context: t
|
|
@@ -1082,7 +1149,7 @@ class _n {
|
|
|
1082
1149
|
extractChanges(e, t) {
|
|
1083
1150
|
return t.blue.nodeToSchemaOutput(
|
|
1084
1151
|
e,
|
|
1085
|
-
|
|
1152
|
+
Le
|
|
1086
1153
|
).changeset ?? [];
|
|
1087
1154
|
}
|
|
1088
1155
|
createPatch(e, t) {
|
|
@@ -1102,14 +1169,14 @@ class _n {
|
|
|
1102
1169
|
return n.length === 0 ? t.throwFatal("Update Document path cannot be empty") : n;
|
|
1103
1170
|
}
|
|
1104
1171
|
}
|
|
1105
|
-
const
|
|
1106
|
-
new
|
|
1107
|
-
new
|
|
1108
|
-
new
|
|
1172
|
+
const we = [
|
|
1173
|
+
new ir(),
|
|
1174
|
+
new ar(),
|
|
1175
|
+
new lr()
|
|
1109
1176
|
];
|
|
1110
|
-
class
|
|
1177
|
+
class gt {
|
|
1111
1178
|
executorIndex;
|
|
1112
|
-
constructor(e =
|
|
1179
|
+
constructor(e = we) {
|
|
1113
1180
|
const t = /* @__PURE__ */ new Map();
|
|
1114
1181
|
for (const n of e)
|
|
1115
1182
|
for (const r of n.supportedBlueIds)
|
|
@@ -1123,28 +1190,28 @@ class ct {
|
|
|
1123
1190
|
const s = {};
|
|
1124
1191
|
for (const [a, c] of o.entries()) {
|
|
1125
1192
|
const u = c.getType?.()?.getBlueId();
|
|
1126
|
-
if (
|
|
1193
|
+
if (he(u))
|
|
1127
1194
|
return r.throwFatal(
|
|
1128
1195
|
"Sequential workflow step is missing type metadata"
|
|
1129
1196
|
);
|
|
1130
|
-
const
|
|
1131
|
-
if (
|
|
1132
|
-
const
|
|
1197
|
+
const h = this.executorIndex.get(u);
|
|
1198
|
+
if (he(h)) {
|
|
1199
|
+
const m = c.getType?.()?.getName?.() ?? u;
|
|
1133
1200
|
return r.throwFatal(
|
|
1134
|
-
`Unsupported workflow step type "${
|
|
1201
|
+
`Unsupported workflow step type "${m}"`
|
|
1135
1202
|
);
|
|
1136
1203
|
}
|
|
1137
|
-
const
|
|
1204
|
+
const d = {
|
|
1138
1205
|
workflow: t,
|
|
1139
1206
|
stepNode: c,
|
|
1140
1207
|
eventNode: n,
|
|
1141
1208
|
context: r,
|
|
1142
1209
|
stepResults: s,
|
|
1143
1210
|
stepIndex: a
|
|
1144
|
-
},
|
|
1145
|
-
if (
|
|
1146
|
-
const
|
|
1147
|
-
s[
|
|
1211
|
+
}, S = await h.execute(d);
|
|
1212
|
+
if (S !== void 0) {
|
|
1213
|
+
const m = this.stepResultKey(c, a);
|
|
1214
|
+
s[m] = S;
|
|
1148
1215
|
}
|
|
1149
1216
|
}
|
|
1150
1217
|
return s;
|
|
@@ -1154,15 +1221,15 @@ class ct {
|
|
|
1154
1221
|
return n && typeof n == "string" && n.length > 0 ? n : `Step${t + 1}`;
|
|
1155
1222
|
}
|
|
1156
1223
|
}
|
|
1157
|
-
class
|
|
1224
|
+
class ur {
|
|
1158
1225
|
kind = "handler";
|
|
1159
1226
|
blueIds = [
|
|
1160
|
-
|
|
1227
|
+
w["Conversation/Sequential Workflow"]
|
|
1161
1228
|
];
|
|
1162
|
-
schema =
|
|
1229
|
+
schema = Hn;
|
|
1163
1230
|
runner;
|
|
1164
|
-
constructor(e =
|
|
1165
|
-
this.runner = new
|
|
1231
|
+
constructor(e = we) {
|
|
1232
|
+
this.runner = new gt(e);
|
|
1166
1233
|
}
|
|
1167
1234
|
async matches(e, t) {
|
|
1168
1235
|
const n = t.event();
|
|
@@ -1173,20 +1240,20 @@ class Fn {
|
|
|
1173
1240
|
n && await this.runner.run({ workflow: e, eventNode: n, context: t });
|
|
1174
1241
|
}
|
|
1175
1242
|
}
|
|
1176
|
-
class
|
|
1243
|
+
class hr {
|
|
1177
1244
|
kind = "marker";
|
|
1178
|
-
blueIds = [
|
|
1179
|
-
schema =
|
|
1245
|
+
blueIds = [w["Conversation/Operation"]];
|
|
1246
|
+
schema = Nn;
|
|
1180
1247
|
}
|
|
1181
|
-
const
|
|
1248
|
+
const me = g(w["Conversation/Operation Request"])(l.object({
|
|
1182
1249
|
allowNewerVersion: l.boolean().optional(),
|
|
1183
1250
|
description: l.string().optional(),
|
|
1184
|
-
document:
|
|
1251
|
+
document: b().optional(),
|
|
1185
1252
|
name: l.string().optional(),
|
|
1186
1253
|
operation: l.string().optional(),
|
|
1187
|
-
request:
|
|
1254
|
+
request: b().optional()
|
|
1188
1255
|
}));
|
|
1189
|
-
function
|
|
1256
|
+
function Et(i) {
|
|
1190
1257
|
const e = i.channel;
|
|
1191
1258
|
if (typeof e == "string") {
|
|
1192
1259
|
const t = e.trim();
|
|
@@ -1195,49 +1262,49 @@ function lt(i) {
|
|
|
1195
1262
|
}
|
|
1196
1263
|
return null;
|
|
1197
1264
|
}
|
|
1198
|
-
function
|
|
1265
|
+
function dr(i, e) {
|
|
1199
1266
|
const t = i.getProperties()?.document;
|
|
1200
|
-
return t instanceof
|
|
1267
|
+
return t instanceof p ? e.blue.calculateBlueIdSync(t) : null;
|
|
1201
1268
|
}
|
|
1202
|
-
function
|
|
1203
|
-
if (e.isTypeOf(i,
|
|
1269
|
+
function pr(i, e) {
|
|
1270
|
+
if (e.isTypeOf(i, me, {
|
|
1204
1271
|
checkSchemaExtensions: !0
|
|
1205
1272
|
}))
|
|
1206
1273
|
return i;
|
|
1207
|
-
if (e.isTypeOf(i,
|
|
1274
|
+
if (e.isTypeOf(i, M, {
|
|
1208
1275
|
checkSchemaExtensions: !0
|
|
1209
1276
|
})) {
|
|
1210
|
-
const n = e.nodeToSchemaOutput(i,
|
|
1211
|
-
if (n && e.isTypeOf(n,
|
|
1277
|
+
const n = e.nodeToSchemaOutput(i, M).message;
|
|
1278
|
+
if (n && e.isTypeOf(n, me, {
|
|
1212
1279
|
checkSchemaExtensions: !0
|
|
1213
1280
|
}))
|
|
1214
1281
|
return n;
|
|
1215
1282
|
}
|
|
1216
1283
|
return null;
|
|
1217
1284
|
}
|
|
1218
|
-
function
|
|
1285
|
+
function mr(i, e, t, n) {
|
|
1219
1286
|
const { blue: r } = n, o = i.operation;
|
|
1220
1287
|
return !(!o || t.operation !== o || i.event && !r.isTypeOfNode(e, i.event));
|
|
1221
1288
|
}
|
|
1222
|
-
function
|
|
1289
|
+
function fr(i, e) {
|
|
1223
1290
|
const t = i.operation;
|
|
1224
1291
|
if (!t)
|
|
1225
1292
|
return null;
|
|
1226
1293
|
const n = e.resolvePointer(`/contracts/${t}`), r = e.documentAt(n);
|
|
1227
|
-
if (!r || !e.blue.isTypeOf(r,
|
|
1294
|
+
if (!r || !e.blue.isTypeOf(r, j))
|
|
1228
1295
|
return null;
|
|
1229
1296
|
const o = e.blue.nodeToSchemaOutput(
|
|
1230
1297
|
r,
|
|
1231
|
-
|
|
1232
|
-
), s =
|
|
1298
|
+
j
|
|
1299
|
+
), s = Et(o);
|
|
1233
1300
|
return { operationNode: r, operation: o, channelKey: s };
|
|
1234
1301
|
}
|
|
1235
|
-
function
|
|
1302
|
+
function gr(i, e) {
|
|
1236
1303
|
return !(i && e && i !== e);
|
|
1237
1304
|
}
|
|
1238
|
-
function
|
|
1305
|
+
function Er(i, e, t) {
|
|
1239
1306
|
const n = i.getProperties()?.request, r = e.getProperties()?.request;
|
|
1240
|
-
if (!(n instanceof
|
|
1307
|
+
if (!(n instanceof p) || !(r instanceof p))
|
|
1241
1308
|
return !1;
|
|
1242
1309
|
try {
|
|
1243
1310
|
if (!t.isTypeOfNode(n, r))
|
|
@@ -1247,10 +1314,10 @@ function Kn(i, e, t) {
|
|
|
1247
1314
|
}
|
|
1248
1315
|
return !0;
|
|
1249
1316
|
}
|
|
1250
|
-
function
|
|
1317
|
+
function yr(i, e, t) {
|
|
1251
1318
|
if (!i || i.allowNewerVersion !== !1)
|
|
1252
1319
|
return !0;
|
|
1253
|
-
const n =
|
|
1320
|
+
const n = dr(e, t);
|
|
1254
1321
|
if (!n)
|
|
1255
1322
|
return !0;
|
|
1256
1323
|
const r = t.resolvePointer("/"), o = t.documentAt(r);
|
|
@@ -1259,33 +1326,33 @@ function qn(i, e, t) {
|
|
|
1259
1326
|
const c = (o.getContracts()?.initialized ?? null)?.get("/documentId") ?? null, u = typeof c == "string" && c.length > 0 ? c : t.blue.calculateBlueIdSync(o);
|
|
1260
1327
|
return n === u;
|
|
1261
1328
|
}
|
|
1262
|
-
class
|
|
1329
|
+
class Cr {
|
|
1263
1330
|
kind = "handler";
|
|
1264
1331
|
blueIds = [
|
|
1265
|
-
|
|
1332
|
+
w["Conversation/Sequential Workflow Operation"]
|
|
1266
1333
|
];
|
|
1267
|
-
schema =
|
|
1334
|
+
schema = Wn;
|
|
1268
1335
|
runner;
|
|
1269
|
-
constructor(e =
|
|
1270
|
-
this.runner = new
|
|
1336
|
+
constructor(e = we) {
|
|
1337
|
+
this.runner = new gt(e);
|
|
1271
1338
|
}
|
|
1272
1339
|
deriveChannel(e, t) {
|
|
1273
1340
|
const n = e.operation;
|
|
1274
1341
|
if (!n)
|
|
1275
1342
|
return null;
|
|
1276
1343
|
const r = t.scopeContracts.get(n);
|
|
1277
|
-
if (!r || !t.blue.isTypeOf(r.node,
|
|
1344
|
+
if (!r || !t.blue.isTypeOf(r.node, j, {
|
|
1278
1345
|
checkSchemaExtensions: !0
|
|
1279
1346
|
}))
|
|
1280
1347
|
return null;
|
|
1281
|
-
const o = t.blue.nodeToSchemaOutput(r.node,
|
|
1282
|
-
return o ?
|
|
1348
|
+
const o = t.blue.nodeToSchemaOutput(r.node, j);
|
|
1349
|
+
return o ? Et(o) : null;
|
|
1283
1350
|
}
|
|
1284
1351
|
async matches(e, t) {
|
|
1285
1352
|
const n = t.event();
|
|
1286
1353
|
if (!n)
|
|
1287
1354
|
return !1;
|
|
1288
|
-
const r =
|
|
1355
|
+
const r = pr(
|
|
1289
1356
|
n,
|
|
1290
1357
|
t.blue
|
|
1291
1358
|
);
|
|
@@ -1293,19 +1360,19 @@ class jn {
|
|
|
1293
1360
|
return !1;
|
|
1294
1361
|
const o = t.blue.nodeToSchemaOutput(
|
|
1295
1362
|
r,
|
|
1296
|
-
|
|
1363
|
+
me
|
|
1297
1364
|
);
|
|
1298
|
-
if (!o || !
|
|
1365
|
+
if (!o || !mr(e, n, o, t))
|
|
1299
1366
|
return !1;
|
|
1300
|
-
const s =
|
|
1367
|
+
const s = fr(e, t);
|
|
1301
1368
|
if (!s)
|
|
1302
1369
|
return !1;
|
|
1303
1370
|
const a = typeof e.channel == "string" ? e.channel.trim() : "", c = a.length > 0 ? a : null;
|
|
1304
|
-
return !(!
|
|
1371
|
+
return !(!gr(s.channelKey, c) || !Er(
|
|
1305
1372
|
r,
|
|
1306
1373
|
s.operationNode,
|
|
1307
1374
|
t.blue
|
|
1308
|
-
) || o?.allowNewerVersion === !1 && !
|
|
1375
|
+
) || o?.allowNewerVersion === !1 && !yr(o, r, t));
|
|
1309
1376
|
}
|
|
1310
1377
|
async execute(e, t) {
|
|
1311
1378
|
const n = t.event();
|
|
@@ -1316,17 +1383,17 @@ class jn {
|
|
|
1316
1383
|
});
|
|
1317
1384
|
}
|
|
1318
1385
|
}
|
|
1319
|
-
class
|
|
1386
|
+
class oe {
|
|
1320
1387
|
constructor(e) {
|
|
1321
1388
|
this.registry = e;
|
|
1322
1389
|
}
|
|
1323
1390
|
static create() {
|
|
1324
|
-
return new
|
|
1325
|
-
new
|
|
1391
|
+
return new oe(
|
|
1392
|
+
new qn()
|
|
1326
1393
|
);
|
|
1327
1394
|
}
|
|
1328
1395
|
registerDefaults() {
|
|
1329
|
-
return this.registry.register(new
|
|
1396
|
+
return this.registry.register(new Xn()), this.registry.register(new er()), this.registry.register(new tr()), this.registry.register(new ur()), this.registry.register(new hr()), this.registry.register(new Cr()), this;
|
|
1330
1397
|
}
|
|
1331
1398
|
register(e) {
|
|
1332
1399
|
return this.registry.register(e), this;
|
|
@@ -1335,11 +1402,11 @@ class ne {
|
|
|
1335
1402
|
return this.registry;
|
|
1336
1403
|
}
|
|
1337
1404
|
}
|
|
1338
|
-
const
|
|
1339
|
-
function
|
|
1405
|
+
const fe = f["Core/Channel Event Checkpoint"];
|
|
1406
|
+
function yt(i) {
|
|
1340
1407
|
return typeof i.order == "number" ? i.order : 0;
|
|
1341
1408
|
}
|
|
1342
|
-
class
|
|
1409
|
+
class Sr {
|
|
1343
1410
|
constructor(e, t, n) {
|
|
1344
1411
|
this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n;
|
|
1345
1412
|
}
|
|
@@ -1353,10 +1420,10 @@ class Jn {
|
|
|
1353
1420
|
return this.bindingBlueId;
|
|
1354
1421
|
}
|
|
1355
1422
|
order() {
|
|
1356
|
-
return
|
|
1423
|
+
return yt(this.bindingContract);
|
|
1357
1424
|
}
|
|
1358
1425
|
}
|
|
1359
|
-
class
|
|
1426
|
+
class vr {
|
|
1360
1427
|
constructor(e, t, n) {
|
|
1361
1428
|
this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n;
|
|
1362
1429
|
}
|
|
@@ -1370,16 +1437,16 @@ class Gn {
|
|
|
1370
1437
|
return this.bindingBlueId;
|
|
1371
1438
|
}
|
|
1372
1439
|
order() {
|
|
1373
|
-
return
|
|
1440
|
+
return yt(this.bindingContract);
|
|
1374
1441
|
}
|
|
1375
1442
|
}
|
|
1376
|
-
class
|
|
1443
|
+
class V {
|
|
1377
1444
|
constructor(e, t, n, r, o) {
|
|
1378
1445
|
this.channels = e, this.handlersByChannel = t, this.markerStore = n, this.embeddedPathsInternal = r, this.checkpointDeclared = o;
|
|
1379
1446
|
}
|
|
1380
1447
|
checkpointDeclared;
|
|
1381
1448
|
static fromComponents(e, t, n, r, o) {
|
|
1382
|
-
return new
|
|
1449
|
+
return new V(
|
|
1383
1450
|
e,
|
|
1384
1451
|
t,
|
|
1385
1452
|
n,
|
|
@@ -1388,10 +1455,10 @@ class L {
|
|
|
1388
1455
|
);
|
|
1389
1456
|
}
|
|
1390
1457
|
static builder() {
|
|
1391
|
-
return new
|
|
1458
|
+
return new wr();
|
|
1392
1459
|
}
|
|
1393
1460
|
static empty() {
|
|
1394
|
-
return
|
|
1461
|
+
return V.builder().build();
|
|
1395
1462
|
}
|
|
1396
1463
|
markers() {
|
|
1397
1464
|
return new Map(
|
|
@@ -1421,24 +1488,28 @@ class L {
|
|
|
1421
1488
|
throw new Error(
|
|
1422
1489
|
"Duplicate Channel Event Checkpoint markers detected in same contracts map"
|
|
1423
1490
|
);
|
|
1424
|
-
this.markerStore.set(
|
|
1425
|
-
key:
|
|
1491
|
+
this.markerStore.set(A, {
|
|
1492
|
+
key: A,
|
|
1426
1493
|
contract: e,
|
|
1427
|
-
blueId:
|
|
1494
|
+
blueId: fe
|
|
1428
1495
|
}), this.checkpointDeclared = !0;
|
|
1429
1496
|
}
|
|
1430
1497
|
handlersFor(e) {
|
|
1431
1498
|
const t = this.handlersByChannel.get(e);
|
|
1432
1499
|
return !t || t.length === 0 ? [] : [...t].map(
|
|
1433
|
-
(n) => new
|
|
1500
|
+
(n) => new vr(n.key, n.contract, n.blueId)
|
|
1434
1501
|
).sort((n, r) => {
|
|
1435
1502
|
const o = n.order() - r.order();
|
|
1436
1503
|
return o !== 0 ? o : n.key().localeCompare(r.key());
|
|
1437
1504
|
});
|
|
1438
1505
|
}
|
|
1506
|
+
channelEntry(e) {
|
|
1507
|
+
const t = this.channels.get(e);
|
|
1508
|
+
return t ? { key: t.key, contract: t.contract, blueId: t.blueId } : null;
|
|
1509
|
+
}
|
|
1439
1510
|
channelsOfType(...e) {
|
|
1440
1511
|
const t = e.length > 0 ? new Set(e) : null, n = Array.from(this.channels.values()).filter((r) => !t || t.has(r.blueId)).map(
|
|
1441
|
-
(r) => new
|
|
1512
|
+
(r) => new Sr(r.key, r.contract, r.blueId)
|
|
1442
1513
|
);
|
|
1443
1514
|
return n.sort((r, o) => {
|
|
1444
1515
|
const s = r.order() - o.order();
|
|
@@ -1446,7 +1517,7 @@ class L {
|
|
|
1446
1517
|
}), n;
|
|
1447
1518
|
}
|
|
1448
1519
|
}
|
|
1449
|
-
class
|
|
1520
|
+
class wr {
|
|
1450
1521
|
channels = /* @__PURE__ */ new Map();
|
|
1451
1522
|
handlersByChannel = /* @__PURE__ */ new Map();
|
|
1452
1523
|
markerStore = /* @__PURE__ */ new Map();
|
|
@@ -1471,12 +1542,12 @@ class Qn {
|
|
|
1471
1542
|
return this.embeddedDeclared = !0, this.embeddedPaths = e.paths ? [...e.paths] : [], this;
|
|
1472
1543
|
}
|
|
1473
1544
|
addMarker(e, t, n) {
|
|
1474
|
-
if (e ===
|
|
1545
|
+
if (e === A && n !== fe)
|
|
1475
1546
|
throw new Error(
|
|
1476
1547
|
"Reserved key 'checkpoint' must contain a Channel Event Checkpoint"
|
|
1477
1548
|
);
|
|
1478
|
-
if (n ===
|
|
1479
|
-
if (e !==
|
|
1549
|
+
if (n === fe) {
|
|
1550
|
+
if (e !== A)
|
|
1480
1551
|
throw new Error(
|
|
1481
1552
|
`Channel Event Checkpoint must use reserved key 'checkpoint' at key '${e}'`
|
|
1482
1553
|
);
|
|
@@ -1489,7 +1560,7 @@ class Qn {
|
|
|
1489
1560
|
return this.markerStore.set(e, { key: e, contract: t, blueId: n }), this;
|
|
1490
1561
|
}
|
|
1491
1562
|
build() {
|
|
1492
|
-
return
|
|
1563
|
+
return V.fromComponents(
|
|
1493
1564
|
new Map(this.channels),
|
|
1494
1565
|
new Map(
|
|
1495
1566
|
Array.from(this.handlersByChannel.entries(), ([e, t]) => [
|
|
@@ -1503,12 +1574,12 @@ class Qn {
|
|
|
1503
1574
|
);
|
|
1504
1575
|
}
|
|
1505
1576
|
}
|
|
1506
|
-
class
|
|
1577
|
+
class y extends Error {
|
|
1507
1578
|
constructor(e, t) {
|
|
1508
1579
|
super(e || "Processor fatal error"), this.processorError = t, this.name = "ProcessorFatalError";
|
|
1509
1580
|
}
|
|
1510
1581
|
}
|
|
1511
|
-
class
|
|
1582
|
+
class kr {
|
|
1512
1583
|
constructor(e, t, n) {
|
|
1513
1584
|
this.blue = e, this.registry = t, this.builtinChannelSchemas = n;
|
|
1514
1585
|
}
|
|
@@ -1529,21 +1600,21 @@ class Yn {
|
|
|
1529
1600
|
processor: r,
|
|
1530
1601
|
scopeContracts: s,
|
|
1531
1602
|
handlerKey: t
|
|
1532
|
-
}),
|
|
1533
|
-
if (!
|
|
1534
|
-
throw new
|
|
1603
|
+
}), h = s.get(u);
|
|
1604
|
+
if (!h)
|
|
1605
|
+
throw new y(
|
|
1535
1606
|
`Handler ${t} references unknown channel '${u}'`,
|
|
1536
|
-
|
|
1607
|
+
v.invalidContract(
|
|
1537
1608
|
o,
|
|
1538
1609
|
`Channel '${u}' is not declared in this scope`,
|
|
1539
1610
|
`/contracts/${u}`
|
|
1540
1611
|
)
|
|
1541
1612
|
);
|
|
1542
|
-
if (!this.isRegisteredChannel(
|
|
1543
|
-
throw new
|
|
1613
|
+
if (!this.isRegisteredChannel(h.nodeTypeBlueId))
|
|
1614
|
+
throw new y(
|
|
1544
1615
|
`Contract '${u}' is not a channel`,
|
|
1545
|
-
|
|
1546
|
-
|
|
1616
|
+
v.invalidContract(
|
|
1617
|
+
h.nodeTypeBlueId,
|
|
1547
1618
|
`Contract '${u}' is not a channel`,
|
|
1548
1619
|
`/contracts/${u}`
|
|
1549
1620
|
)
|
|
@@ -1551,9 +1622,9 @@ class Yn {
|
|
|
1551
1622
|
e.addHandler(t, { ...c, channel: u }, o);
|
|
1552
1623
|
} catch (a) {
|
|
1553
1624
|
if (this.isZodError(a))
|
|
1554
|
-
throw new
|
|
1625
|
+
throw new y(
|
|
1555
1626
|
"Failed to parse handler contract",
|
|
1556
|
-
|
|
1627
|
+
v.invalidContract(
|
|
1557
1628
|
o,
|
|
1558
1629
|
"Failed to parse handler contract",
|
|
1559
1630
|
t,
|
|
@@ -1561,9 +1632,9 @@ class Yn {
|
|
|
1561
1632
|
)
|
|
1562
1633
|
);
|
|
1563
1634
|
const c = a?.message ?? "Failed to register handler contract";
|
|
1564
|
-
throw new
|
|
1635
|
+
throw new y(
|
|
1565
1636
|
c,
|
|
1566
|
-
|
|
1637
|
+
v.illegalState(c)
|
|
1567
1638
|
);
|
|
1568
1639
|
}
|
|
1569
1640
|
}
|
|
@@ -1585,9 +1656,9 @@ class Yn {
|
|
|
1585
1656
|
}
|
|
1586
1657
|
}
|
|
1587
1658
|
if (!o)
|
|
1588
|
-
throw new
|
|
1659
|
+
throw new y(
|
|
1589
1660
|
`Handler ${r} must declare channel (missing explicit channel and derivation failed)`,
|
|
1590
|
-
|
|
1661
|
+
v.illegalState(
|
|
1591
1662
|
`Handler ${r} must declare channel (missing explicit channel and derivation failed)`
|
|
1592
1663
|
)
|
|
1593
1664
|
);
|
|
@@ -1597,77 +1668,144 @@ class Yn {
|
|
|
1597
1668
|
return this.builtinChannelSchemas.has(e) ? !0 : this.registry.lookupChannel(e) != null;
|
|
1598
1669
|
}
|
|
1599
1670
|
isZodError(e) {
|
|
1600
|
-
return e instanceof
|
|
1671
|
+
return e instanceof ge;
|
|
1601
1672
|
}
|
|
1602
1673
|
}
|
|
1603
|
-
class
|
|
1674
|
+
class z extends Error {
|
|
1604
1675
|
constructor(e) {
|
|
1605
1676
|
super(e ?? "MustUnderstand failure"), this.name = "MustUnderstandFailure";
|
|
1606
1677
|
}
|
|
1607
1678
|
}
|
|
1608
|
-
|
|
1679
|
+
function br(i) {
|
|
1680
|
+
const {
|
|
1681
|
+
compositeKey: e,
|
|
1682
|
+
contract: t,
|
|
1683
|
+
scopeContracts: n,
|
|
1684
|
+
blueId: r,
|
|
1685
|
+
blue: o,
|
|
1686
|
+
compositeChannelBlueId: s
|
|
1687
|
+
} = i, a = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), u = [], h = /* @__PURE__ */ new Map([
|
|
1688
|
+
[e, t]
|
|
1689
|
+
]), d = (m) => {
|
|
1690
|
+
if (h.has(m))
|
|
1691
|
+
return h.get(m) ?? null;
|
|
1692
|
+
const E = n.get(m);
|
|
1693
|
+
if (!E || E.nodeTypeBlueId !== s)
|
|
1694
|
+
return h.set(m, null), null;
|
|
1695
|
+
try {
|
|
1696
|
+
const C = o.nodeToSchemaOutput(
|
|
1697
|
+
E.node,
|
|
1698
|
+
dt
|
|
1699
|
+
);
|
|
1700
|
+
return h.set(m, C), C;
|
|
1701
|
+
} catch (C) {
|
|
1702
|
+
if (Ir(C))
|
|
1703
|
+
throw new y(
|
|
1704
|
+
"Failed to parse channel contract",
|
|
1705
|
+
v.invalidContract(
|
|
1706
|
+
E.nodeTypeBlueId,
|
|
1707
|
+
"Failed to parse channel contract",
|
|
1708
|
+
`/contracts/${m}`,
|
|
1709
|
+
C
|
|
1710
|
+
)
|
|
1711
|
+
);
|
|
1712
|
+
const P = C?.message ?? "Failed to parse channel contract";
|
|
1713
|
+
throw new y(
|
|
1714
|
+
P,
|
|
1715
|
+
v.illegalState(P)
|
|
1716
|
+
);
|
|
1717
|
+
}
|
|
1718
|
+
}, S = (m) => {
|
|
1719
|
+
if (c.has(m)) {
|
|
1720
|
+
const C = u.indexOf(m), D = [...u.slice(C), m].join(" -> ");
|
|
1721
|
+
throw new y(
|
|
1722
|
+
`Composite channel ${e} has a cyclic reference: ${D}`,
|
|
1723
|
+
v.invalidContract(
|
|
1724
|
+
r,
|
|
1725
|
+
`Composite channel '${e}' has a cyclic reference: ${D}`,
|
|
1726
|
+
`/contracts/${e}`
|
|
1727
|
+
)
|
|
1728
|
+
);
|
|
1729
|
+
}
|
|
1730
|
+
if (a.has(m))
|
|
1731
|
+
return;
|
|
1732
|
+
c.add(m), u.push(m);
|
|
1733
|
+
const E = d(m);
|
|
1734
|
+
if (E)
|
|
1735
|
+
for (const C of E.channels ?? []) {
|
|
1736
|
+
const P = n.get(C);
|
|
1737
|
+
P && P.nodeTypeBlueId === s && S(C);
|
|
1738
|
+
}
|
|
1739
|
+
u.pop(), c.delete(m), a.add(m);
|
|
1740
|
+
};
|
|
1741
|
+
S(e);
|
|
1742
|
+
}
|
|
1743
|
+
function Ir(i) {
|
|
1744
|
+
return i instanceof ge;
|
|
1745
|
+
}
|
|
1746
|
+
const Tr = f["Core/Document Update Channel"], Rr = f["Core/Embedded Node Channel"], Pr = f["Core/Lifecycle Event Channel"], Mr = f["Core/Triggered Event Channel"], Fe = f["Core/Process Embedded"], Nr = f["Core/Processing Initialized Marker"], Or = f["Core/Processing Terminated Marker"], Ar = f["Core/Channel Event Checkpoint"], Dr = I["MyOS/Document Anchors"], Br = I["MyOS/Document Links"], xr = I["MyOS/MyOS Participants Orchestration"], _r = I["MyOS/MyOS Session Interaction"], Lr = I["MyOS/MyOS Worker Agency"], Ue = w["Conversation/Composite Timeline Channel"], ce = /* @__PURE__ */ new Map([
|
|
1609
1747
|
[
|
|
1610
|
-
|
|
1611
|
-
|
|
1748
|
+
Tr,
|
|
1749
|
+
hn
|
|
1612
1750
|
],
|
|
1613
1751
|
[
|
|
1614
|
-
|
|
1615
|
-
|
|
1752
|
+
Rr,
|
|
1753
|
+
pn
|
|
1616
1754
|
],
|
|
1617
1755
|
[
|
|
1618
|
-
|
|
1619
|
-
|
|
1756
|
+
Pr,
|
|
1757
|
+
fn
|
|
1620
1758
|
],
|
|
1621
1759
|
[
|
|
1622
|
-
|
|
1623
|
-
|
|
1760
|
+
Mr,
|
|
1761
|
+
En
|
|
1624
1762
|
]
|
|
1625
|
-
]),
|
|
1763
|
+
]), Fr = /* @__PURE__ */ new Map([
|
|
1626
1764
|
[
|
|
1627
|
-
|
|
1628
|
-
|
|
1765
|
+
Nr,
|
|
1766
|
+
In
|
|
1629
1767
|
],
|
|
1630
1768
|
[
|
|
1631
|
-
|
|
1632
|
-
|
|
1769
|
+
Or,
|
|
1770
|
+
Mn
|
|
1633
1771
|
],
|
|
1634
1772
|
[
|
|
1635
|
-
|
|
1636
|
-
|
|
1773
|
+
Ar,
|
|
1774
|
+
kn
|
|
1637
1775
|
],
|
|
1638
1776
|
[
|
|
1639
|
-
|
|
1640
|
-
|
|
1777
|
+
Dr,
|
|
1778
|
+
Dn
|
|
1641
1779
|
],
|
|
1642
1780
|
[
|
|
1643
|
-
|
|
1644
|
-
|
|
1781
|
+
Br,
|
|
1782
|
+
_n
|
|
1645
1783
|
],
|
|
1646
1784
|
[
|
|
1647
|
-
|
|
1648
|
-
|
|
1785
|
+
xr,
|
|
1786
|
+
Fn
|
|
1649
1787
|
],
|
|
1650
1788
|
[
|
|
1651
|
-
|
|
1652
|
-
|
|
1789
|
+
_r,
|
|
1790
|
+
$n
|
|
1653
1791
|
],
|
|
1654
1792
|
[
|
|
1655
|
-
|
|
1656
|
-
|
|
1793
|
+
Lr,
|
|
1794
|
+
Vn
|
|
1657
1795
|
]
|
|
1658
1796
|
]);
|
|
1659
|
-
class
|
|
1797
|
+
class Ur {
|
|
1660
1798
|
constructor(e, t) {
|
|
1661
|
-
this.registry = e, this.blue = t, this.handlerRegistration = new
|
|
1799
|
+
this.registry = e, this.blue = t, this.handlerRegistration = new kr(
|
|
1662
1800
|
this.blue,
|
|
1663
1801
|
this.registry,
|
|
1664
|
-
|
|
1802
|
+
ce
|
|
1665
1803
|
);
|
|
1666
1804
|
}
|
|
1667
1805
|
handlerRegistration;
|
|
1668
1806
|
load(e, t) {
|
|
1669
1807
|
try {
|
|
1670
|
-
const n =
|
|
1808
|
+
const n = V.builder(), r = e.getContracts();
|
|
1671
1809
|
if (!r)
|
|
1672
1810
|
return n.build();
|
|
1673
1811
|
const o = this.buildScopeContractsIndex(r);
|
|
@@ -1675,12 +1813,12 @@ class dr {
|
|
|
1675
1813
|
a && this.processContract(n, s, a, o);
|
|
1676
1814
|
return n.build();
|
|
1677
1815
|
} catch (n) {
|
|
1678
|
-
if (n instanceof
|
|
1816
|
+
if (n instanceof z || n instanceof y)
|
|
1679
1817
|
throw n;
|
|
1680
1818
|
const r = n?.message ?? "Failed to load contracts";
|
|
1681
|
-
throw new
|
|
1819
|
+
throw new y(
|
|
1682
1820
|
`Failed to load contracts for scope ${t}: ${r}`,
|
|
1683
|
-
|
|
1821
|
+
v.runtimeFatal(
|
|
1684
1822
|
`Failed to load contracts for scope ${t}`,
|
|
1685
1823
|
n
|
|
1686
1824
|
)
|
|
@@ -1691,18 +1829,25 @@ class dr {
|
|
|
1691
1829
|
const o = n.getType()?.getBlueId();
|
|
1692
1830
|
if (!o)
|
|
1693
1831
|
return;
|
|
1694
|
-
if (o ===
|
|
1832
|
+
if (o === Fe) {
|
|
1695
1833
|
this.handleProcessEmbedded(e, t, n);
|
|
1696
1834
|
return;
|
|
1697
1835
|
}
|
|
1698
|
-
const s =
|
|
1836
|
+
const s = Fr.get(o);
|
|
1699
1837
|
if (s) {
|
|
1700
1838
|
this.handleMarker(e, t, n, s, o);
|
|
1701
1839
|
return;
|
|
1702
1840
|
}
|
|
1703
|
-
const a =
|
|
1841
|
+
const a = ce.get(o);
|
|
1704
1842
|
if (a) {
|
|
1705
|
-
this.handleChannel(
|
|
1843
|
+
this.handleChannel(
|
|
1844
|
+
e,
|
|
1845
|
+
t,
|
|
1846
|
+
n,
|
|
1847
|
+
a,
|
|
1848
|
+
o,
|
|
1849
|
+
r
|
|
1850
|
+
);
|
|
1706
1851
|
return;
|
|
1707
1852
|
}
|
|
1708
1853
|
const c = this.registry.lookupChannel(o);
|
|
@@ -1712,7 +1857,8 @@ class dr {
|
|
|
1712
1857
|
t,
|
|
1713
1858
|
n,
|
|
1714
1859
|
c.schema,
|
|
1715
|
-
o
|
|
1860
|
+
o,
|
|
1861
|
+
r
|
|
1716
1862
|
);
|
|
1717
1863
|
return;
|
|
1718
1864
|
}
|
|
@@ -1728,81 +1874,131 @@ class dr {
|
|
|
1728
1874
|
});
|
|
1729
1875
|
return;
|
|
1730
1876
|
}
|
|
1731
|
-
const
|
|
1732
|
-
if (
|
|
1877
|
+
const h = this.registry.lookupMarker(o);
|
|
1878
|
+
if (h) {
|
|
1733
1879
|
this.handleMarker(
|
|
1734
1880
|
e,
|
|
1735
1881
|
t,
|
|
1736
1882
|
n,
|
|
1737
|
-
|
|
1883
|
+
h.schema,
|
|
1738
1884
|
o
|
|
1739
1885
|
);
|
|
1740
1886
|
return;
|
|
1741
1887
|
}
|
|
1742
|
-
throw
|
|
1888
|
+
throw ye(o) ? new y(
|
|
1743
1889
|
"Built-in processor-managed channel is missing schema registration",
|
|
1744
|
-
|
|
1890
|
+
v.invalidContract(
|
|
1745
1891
|
o,
|
|
1746
1892
|
"Built-in processor-managed channel is missing schema registration",
|
|
1747
1893
|
t
|
|
1748
1894
|
)
|
|
1749
|
-
) : new
|
|
1895
|
+
) : new z(`Unsupported contract type: ${o}`);
|
|
1750
1896
|
}
|
|
1751
1897
|
handleProcessEmbedded(e, t, n) {
|
|
1752
1898
|
try {
|
|
1753
|
-
const r = this.
|
|
1899
|
+
const r = this.blue.nodeToSchemaOutput(
|
|
1754
1900
|
n,
|
|
1755
|
-
|
|
1901
|
+
Rn
|
|
1756
1902
|
);
|
|
1757
1903
|
e.setEmbedded(r);
|
|
1758
1904
|
} catch (r) {
|
|
1759
|
-
throw
|
|
1905
|
+
throw le(r) ? new y(
|
|
1760
1906
|
"Failed to parse ProcessEmbedded marker",
|
|
1761
|
-
|
|
1762
|
-
|
|
1907
|
+
v.invalidContract(
|
|
1908
|
+
Fe,
|
|
1763
1909
|
"Failed to parse ProcessEmbedded marker",
|
|
1764
1910
|
t,
|
|
1765
1911
|
r
|
|
1766
1912
|
)
|
|
1767
|
-
) : new
|
|
1913
|
+
) : new y(
|
|
1768
1914
|
r?.message ?? "Failed to register ProcessEmbedded marker",
|
|
1769
|
-
|
|
1915
|
+
v.illegalState(
|
|
1770
1916
|
r?.message ?? "Failed to register ProcessEmbedded marker"
|
|
1771
1917
|
)
|
|
1772
1918
|
);
|
|
1773
1919
|
}
|
|
1774
1920
|
}
|
|
1775
|
-
handleChannel(e, t, n, r, o) {
|
|
1921
|
+
handleChannel(e, t, n, r, o, s) {
|
|
1776
1922
|
try {
|
|
1777
|
-
const
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1923
|
+
const a = this.blue.nodeToSchemaOutput(
|
|
1924
|
+
n,
|
|
1925
|
+
r
|
|
1926
|
+
);
|
|
1927
|
+
o === Ue && this.validateCompositeChannel(
|
|
1928
|
+
t,
|
|
1929
|
+
a,
|
|
1930
|
+
s,
|
|
1931
|
+
o
|
|
1932
|
+
), e.addChannel(t, a, o);
|
|
1933
|
+
} catch (a) {
|
|
1934
|
+
if (a instanceof y || a instanceof z)
|
|
1935
|
+
throw a;
|
|
1936
|
+
if (le(a))
|
|
1937
|
+
throw new y(
|
|
1782
1938
|
"Failed to parse channel contract",
|
|
1783
|
-
|
|
1939
|
+
v.invalidContract(
|
|
1784
1940
|
o,
|
|
1785
1941
|
"Failed to parse channel contract",
|
|
1786
1942
|
t,
|
|
1787
|
-
|
|
1943
|
+
a
|
|
1788
1944
|
)
|
|
1789
1945
|
);
|
|
1790
|
-
const
|
|
1791
|
-
throw new
|
|
1792
|
-
|
|
1793
|
-
|
|
1946
|
+
const c = a?.message ?? "Failed to register channel contract";
|
|
1947
|
+
throw new y(
|
|
1948
|
+
c,
|
|
1949
|
+
v.illegalState(c)
|
|
1794
1950
|
);
|
|
1795
1951
|
}
|
|
1796
1952
|
}
|
|
1953
|
+
validateCompositeChannel(e, t, n, r) {
|
|
1954
|
+
const o = t.channels ?? [];
|
|
1955
|
+
if (o.length !== 0) {
|
|
1956
|
+
for (const s of o) {
|
|
1957
|
+
const a = n.get(s);
|
|
1958
|
+
if (!a)
|
|
1959
|
+
throw new y(
|
|
1960
|
+
`Composite channel ${e} references unknown channel '${s}'`,
|
|
1961
|
+
v.invalidContract(
|
|
1962
|
+
r,
|
|
1963
|
+
`Channel '${s}' is not declared in this scope`,
|
|
1964
|
+
`/contracts/${s}`
|
|
1965
|
+
)
|
|
1966
|
+
);
|
|
1967
|
+
if (!this.isRegisteredChannel(a.nodeTypeBlueId))
|
|
1968
|
+
throw new y(
|
|
1969
|
+
`Contract '${s}' is not a channel`,
|
|
1970
|
+
v.invalidContract(
|
|
1971
|
+
a.nodeTypeBlueId,
|
|
1972
|
+
`Contract '${s}' is not a channel`,
|
|
1973
|
+
`/contracts/${s}`
|
|
1974
|
+
)
|
|
1975
|
+
);
|
|
1976
|
+
}
|
|
1977
|
+
br({
|
|
1978
|
+
compositeKey: e,
|
|
1979
|
+
contract: t,
|
|
1980
|
+
scopeContracts: n,
|
|
1981
|
+
blueId: r,
|
|
1982
|
+
blue: this.blue,
|
|
1983
|
+
compositeChannelBlueId: Ue
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
isRegisteredChannel(e) {
|
|
1988
|
+
return ce.has(e) ? !0 : this.registry.lookupChannel(e) != null;
|
|
1989
|
+
}
|
|
1797
1990
|
handleMarker(e, t, n, r, o) {
|
|
1798
1991
|
try {
|
|
1799
|
-
const s = this.
|
|
1992
|
+
const s = this.blue.nodeToSchemaOutput(
|
|
1993
|
+
n,
|
|
1994
|
+
r
|
|
1995
|
+
);
|
|
1800
1996
|
e.addMarker(t, s, o);
|
|
1801
1997
|
} catch (s) {
|
|
1802
|
-
if (
|
|
1803
|
-
throw new
|
|
1998
|
+
if (le(s))
|
|
1999
|
+
throw new y(
|
|
1804
2000
|
"Failed to parse marker contract",
|
|
1805
|
-
|
|
2001
|
+
v.invalidContract(
|
|
1806
2002
|
o,
|
|
1807
2003
|
"Failed to parse marker contract",
|
|
1808
2004
|
t,
|
|
@@ -1810,9 +2006,9 @@ class dr {
|
|
|
1810
2006
|
)
|
|
1811
2007
|
);
|
|
1812
2008
|
const a = s?.message ?? "Failed to register marker contract";
|
|
1813
|
-
throw new
|
|
2009
|
+
throw new y(
|
|
1814
2010
|
a,
|
|
1815
|
-
|
|
2011
|
+
v.illegalState(a)
|
|
1816
2012
|
);
|
|
1817
2013
|
}
|
|
1818
2014
|
}
|
|
@@ -1826,31 +2022,28 @@ class dr {
|
|
|
1826
2022
|
}
|
|
1827
2023
|
return t;
|
|
1828
2024
|
}
|
|
1829
|
-
convert(e, t) {
|
|
1830
|
-
return this.blue.nodeToSchemaOutput(e, t);
|
|
1831
|
-
}
|
|
1832
2025
|
}
|
|
1833
|
-
function
|
|
1834
|
-
return i instanceof
|
|
2026
|
+
function le(i) {
|
|
2027
|
+
return i instanceof ge;
|
|
1835
2028
|
}
|
|
1836
|
-
const
|
|
1837
|
-
function
|
|
2029
|
+
const $r = f["Core/Channel Event Checkpoint"];
|
|
2030
|
+
function zr(i) {
|
|
1838
2031
|
return i.jsonValueToNode({
|
|
1839
|
-
type: { blueId:
|
|
2032
|
+
type: { blueId: $r },
|
|
1840
2033
|
lastEvents: {},
|
|
1841
2034
|
lastSignatures: {}
|
|
1842
2035
|
});
|
|
1843
2036
|
}
|
|
1844
|
-
function
|
|
2037
|
+
function Vr() {
|
|
1845
2038
|
return {
|
|
1846
2039
|
lastEvents: {},
|
|
1847
2040
|
lastSignatures: {}
|
|
1848
2041
|
};
|
|
1849
2042
|
}
|
|
1850
|
-
function
|
|
2043
|
+
function $e(i) {
|
|
1851
2044
|
return i != null && Object.prototype.hasOwnProperty.call(i, "lastEvents") && Object.prototype.hasOwnProperty.call(i, "lastSignatures");
|
|
1852
2045
|
}
|
|
1853
|
-
class
|
|
2046
|
+
class Hr {
|
|
1854
2047
|
constructor(e, t, n, r, o) {
|
|
1855
2048
|
this.markerKey = e, this.checkpoint = t, this.channelKey = n, this.lastEventNode = r, this.lastEventSignature = o;
|
|
1856
2049
|
}
|
|
@@ -1860,28 +2053,28 @@ class mr {
|
|
|
1860
2053
|
return e != null && e === this.lastEventSignature;
|
|
1861
2054
|
}
|
|
1862
2055
|
}
|
|
1863
|
-
class
|
|
2056
|
+
class Kr {
|
|
1864
2057
|
constructor(e, t) {
|
|
1865
2058
|
this.runtime = e, this.signatureFn = t;
|
|
1866
2059
|
}
|
|
1867
2060
|
ensureCheckpointMarker(e, t) {
|
|
1868
|
-
const n = t.marker(
|
|
2061
|
+
const n = t.marker(A), r = T(e, Qe);
|
|
1869
2062
|
if (!n) {
|
|
1870
|
-
const o =
|
|
1871
|
-
this.runtime.directWrite(r, o), t.registerCheckpointMarker(
|
|
2063
|
+
const o = zr(this.runtime.blue());
|
|
2064
|
+
this.runtime.directWrite(r, o), t.registerCheckpointMarker(Vr());
|
|
1872
2065
|
return;
|
|
1873
2066
|
}
|
|
1874
|
-
if (
|
|
2067
|
+
if (!$e(n))
|
|
1875
2068
|
throw new Error(
|
|
1876
2069
|
`Reserved key 'checkpoint' must contain a Channel Event Checkpoint at ${r}`
|
|
1877
2070
|
);
|
|
1878
2071
|
}
|
|
1879
2072
|
findCheckpoint(e, t) {
|
|
1880
2073
|
for (const [n, r] of e.markerEntries()) {
|
|
1881
|
-
if (
|
|
2074
|
+
if (!$e(r))
|
|
1882
2075
|
continue;
|
|
1883
2076
|
const s = (r.lastEvents?.[t] ?? null)?.clone() ?? null, c = r.lastSignatures?.[t] ?? null ?? this.signatureFn(s);
|
|
1884
|
-
return new
|
|
2077
|
+
return new Hr(
|
|
1885
2078
|
n,
|
|
1886
2079
|
r,
|
|
1887
2080
|
t,
|
|
@@ -1897,19 +2090,19 @@ class gr {
|
|
|
1897
2090
|
persist(e, t, n, r, o) {
|
|
1898
2091
|
if (!n)
|
|
1899
2092
|
return;
|
|
1900
|
-
const s =
|
|
2093
|
+
const s = T(
|
|
1901
2094
|
e,
|
|
1902
|
-
|
|
2095
|
+
Ze(n.markerKey, n.channelKey)
|
|
1903
2096
|
), a = o?.clone() ?? null;
|
|
1904
2097
|
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;
|
|
1905
|
-
const c =
|
|
2098
|
+
const c = T(
|
|
1906
2099
|
e,
|
|
1907
|
-
|
|
1908
|
-
), u = r == null ? null : new
|
|
2100
|
+
et(n.markerKey, n.channelKey)
|
|
2101
|
+
), u = r == null ? null : new p().setValue(r);
|
|
1909
2102
|
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;
|
|
1910
2103
|
}
|
|
1911
2104
|
}
|
|
1912
|
-
class
|
|
2105
|
+
class Wr {
|
|
1913
2106
|
constructor(e, t, n) {
|
|
1914
2107
|
this.runtime = e, this.checkpointManager = t, this.deps = n;
|
|
1915
2108
|
}
|
|
@@ -1925,6 +2118,10 @@ class yr {
|
|
|
1925
2118
|
);
|
|
1926
2119
|
if (!s.matches)
|
|
1927
2120
|
return;
|
|
2121
|
+
if (s.deliveries && s.deliveries.length > 0) {
|
|
2122
|
+
await this.runDeliveries(e, t, n, r, s);
|
|
2123
|
+
return;
|
|
2124
|
+
}
|
|
1928
2125
|
const a = s.eventNode ?? r;
|
|
1929
2126
|
this.checkpointManager.ensureCheckpointMarker(e, t);
|
|
1930
2127
|
const c = this.checkpointManager.findCheckpoint(
|
|
@@ -1951,6 +2148,44 @@ class yr {
|
|
|
1951
2148
|
o
|
|
1952
2149
|
));
|
|
1953
2150
|
}
|
|
2151
|
+
async runDeliveries(e, t, n, r, o) {
|
|
2152
|
+
const s = o.deliveries ?? [];
|
|
2153
|
+
if (s.length === 0)
|
|
2154
|
+
return;
|
|
2155
|
+
this.checkpointManager.ensureCheckpointMarker(e, t);
|
|
2156
|
+
const a = this.deps.canonicalSignature(r);
|
|
2157
|
+
for (const c of s) {
|
|
2158
|
+
if (this.deps.isScopeInactive(e))
|
|
2159
|
+
return;
|
|
2160
|
+
const u = c.checkpointKey ?? n.key(), h = this.checkpointManager.findCheckpoint(
|
|
2161
|
+
t,
|
|
2162
|
+
u
|
|
2163
|
+
), d = c.eventId ?? a;
|
|
2164
|
+
if (!(this.checkpointManager.isDuplicate(h, d) || !(typeof c.shouldProcess == "boolean" ? c.shouldProcess : await this.shouldProcessRelativeToCheckpoint(
|
|
2165
|
+
e,
|
|
2166
|
+
t,
|
|
2167
|
+
n,
|
|
2168
|
+
r,
|
|
2169
|
+
h
|
|
2170
|
+
)))) {
|
|
2171
|
+
if (await this.runHandlers(
|
|
2172
|
+
e,
|
|
2173
|
+
t,
|
|
2174
|
+
n.key(),
|
|
2175
|
+
c.eventNode,
|
|
2176
|
+
!1
|
|
2177
|
+
), this.deps.isScopeInactive(e))
|
|
2178
|
+
return;
|
|
2179
|
+
this.checkpointManager.persist(
|
|
2180
|
+
e,
|
|
2181
|
+
t,
|
|
2182
|
+
h,
|
|
2183
|
+
d ?? null,
|
|
2184
|
+
r
|
|
2185
|
+
);
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
1954
2189
|
async runHandlers(e, t, n, r, o) {
|
|
1955
2190
|
const s = t.handlersFor(n);
|
|
1956
2191
|
if (s.length !== 0)
|
|
@@ -1994,21 +2229,21 @@ class yr {
|
|
|
1994
2229
|
);
|
|
1995
2230
|
}
|
|
1996
2231
|
}
|
|
1997
|
-
function
|
|
2232
|
+
function Gr(i, e) {
|
|
1998
2233
|
return e.isResolved() ? i.createResolvedNode(e) : i.resolve(e);
|
|
1999
2234
|
}
|
|
2000
|
-
class
|
|
2235
|
+
class $ extends y {
|
|
2001
2236
|
constructor(e) {
|
|
2002
|
-
super(e,
|
|
2237
|
+
super(e, v.illegalState(e)), this.name = "IllegalStateException";
|
|
2003
2238
|
}
|
|
2004
2239
|
}
|
|
2005
|
-
class
|
|
2240
|
+
class F extends Error {
|
|
2006
2241
|
constructor(e) {
|
|
2007
2242
|
super(e), this.name = "BoundaryViolationException";
|
|
2008
2243
|
}
|
|
2009
2244
|
}
|
|
2010
|
-
const
|
|
2011
|
-
class
|
|
2245
|
+
const qr = f["Core/Document Update Channel"], jr = f["Core/Embedded Node Channel"], Jr = f["Core/Triggered Event Channel"], Qr = f["Core/Lifecycle Event Channel"], ze = f["Core/Processing Initialized Marker"], Xr = f["Core/Document Processing Initiated"];
|
|
2246
|
+
class Yr {
|
|
2012
2247
|
runtime;
|
|
2013
2248
|
contractLoader;
|
|
2014
2249
|
channelRunner;
|
|
@@ -2022,56 +2257,56 @@ class kr {
|
|
|
2022
2257
|
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;
|
|
2023
2258
|
}
|
|
2024
2259
|
async initializeScope(e, t) {
|
|
2025
|
-
const n =
|
|
2260
|
+
const n = k(e), r = /* @__PURE__ */ new Set();
|
|
2026
2261
|
let o = null, s = null;
|
|
2027
2262
|
for (t && this.runtime.gasMeter().chargeScopeEntry(n); ; ) {
|
|
2028
|
-
const
|
|
2029
|
-
if (!
|
|
2263
|
+
const d = this.nodeAt(n);
|
|
2264
|
+
if (!d)
|
|
2030
2265
|
return;
|
|
2031
|
-
s || (s =
|
|
2032
|
-
const
|
|
2033
|
-
if (!
|
|
2266
|
+
s || (s = d.clone()), o = this.loadBundle(d, n), this.bundles.set(n, o);
|
|
2267
|
+
const S = o.embeddedPaths().find((C) => !r.has(C)) ?? null;
|
|
2268
|
+
if (!S)
|
|
2034
2269
|
break;
|
|
2035
|
-
r.add(
|
|
2036
|
-
const
|
|
2037
|
-
this.nodeAt(
|
|
2270
|
+
r.add(S);
|
|
2271
|
+
const m = T(n, S);
|
|
2272
|
+
this.nodeAt(m) && await this.initializeScope(m, !0);
|
|
2038
2273
|
}
|
|
2039
2274
|
if (!o)
|
|
2040
2275
|
return;
|
|
2041
2276
|
const a = this.hasInitializationMarker(n);
|
|
2042
2277
|
if (!a && o.hasCheckpoint())
|
|
2043
|
-
throw new
|
|
2278
|
+
throw new $(
|
|
2044
2279
|
`Reserved key 'checkpoint' must not appear before initialization at scope ${n}`
|
|
2045
2280
|
);
|
|
2046
2281
|
if (a)
|
|
2047
2282
|
return;
|
|
2048
2283
|
this.runtime.gasMeter().chargeInitialization();
|
|
2049
|
-
const c = this.blueId(s ?? new
|
|
2284
|
+
const c = this.blueId(s ?? new p()), u = this.createLifecycleEvent(c), h = this.hooks.createContext(
|
|
2050
2285
|
n,
|
|
2051
2286
|
o,
|
|
2052
2287
|
u,
|
|
2053
2288
|
!1,
|
|
2054
2289
|
!0
|
|
2055
2290
|
);
|
|
2056
|
-
await this.deliverLifecycle(n, o, u, !0), await this.addInitializationMarker(
|
|
2291
|
+
await this.deliverLifecycle(n, o, u, !0), await this.addInitializationMarker(h, c);
|
|
2057
2292
|
}
|
|
2058
2293
|
loadBundles(e) {
|
|
2059
|
-
const t =
|
|
2294
|
+
const t = k(e);
|
|
2060
2295
|
if (this.bundles.has(t))
|
|
2061
2296
|
return;
|
|
2062
|
-
const n = this.nodeAt(t), r = n ? this.loadBundle(n, t) :
|
|
2297
|
+
const n = this.nodeAt(t), r = n ? this.loadBundle(n, t) : V.empty();
|
|
2063
2298
|
this.bundles.set(t, r);
|
|
2064
2299
|
for (const o of r.embeddedPaths()) {
|
|
2065
|
-
const s =
|
|
2300
|
+
const s = T(t, o);
|
|
2066
2301
|
this.loadBundles(s);
|
|
2067
2302
|
}
|
|
2068
2303
|
}
|
|
2069
2304
|
async processExternalEvent(e, t) {
|
|
2070
|
-
const n =
|
|
2305
|
+
const n = Gr(this.runtime.blue(), t);
|
|
2071
2306
|
await this.processPreparedExternalEvent(e, n);
|
|
2072
2307
|
}
|
|
2073
2308
|
async processPreparedExternalEvent(e, t) {
|
|
2074
|
-
const n =
|
|
2309
|
+
const n = k(e);
|
|
2075
2310
|
if (this.hooks.isScopeInactive(n))
|
|
2076
2311
|
return;
|
|
2077
2312
|
this.runtime.gasMeter().chargeScopeEntry(n);
|
|
@@ -2086,7 +2321,7 @@ class kr {
|
|
|
2086
2321
|
for (const s of o) {
|
|
2087
2322
|
if (this.hooks.isScopeInactive(n))
|
|
2088
2323
|
break;
|
|
2089
|
-
|
|
2324
|
+
ye(s.blueId()) || await this.channelRunner.runExternalChannel(
|
|
2090
2325
|
n,
|
|
2091
2326
|
r,
|
|
2092
2327
|
s,
|
|
@@ -2105,7 +2340,7 @@ class kr {
|
|
|
2105
2340
|
r
|
|
2106
2341
|
);
|
|
2107
2342
|
} catch (o) {
|
|
2108
|
-
if (o instanceof
|
|
2343
|
+
if (o instanceof F) {
|
|
2109
2344
|
const s = this.hooks.fatalReason(o, "Boundary violation");
|
|
2110
2345
|
await this.hooks.enterFatalTermination(e, t, s);
|
|
2111
2346
|
return;
|
|
@@ -2133,18 +2368,18 @@ class kr {
|
|
|
2133
2368
|
if (!a || this.hooks.isScopeInactive(s))
|
|
2134
2369
|
continue;
|
|
2135
2370
|
const c = this.createDocumentUpdateEvent(o, s), u = a.channelsOfType(
|
|
2136
|
-
|
|
2371
|
+
qr
|
|
2137
2372
|
);
|
|
2138
|
-
for (const
|
|
2139
|
-
const
|
|
2373
|
+
for (const h of u) {
|
|
2374
|
+
const d = h.contract();
|
|
2140
2375
|
if (this.matchesDocumentUpdate(
|
|
2141
2376
|
s,
|
|
2142
|
-
|
|
2377
|
+
d.path ?? null,
|
|
2143
2378
|
o.path
|
|
2144
2379
|
) && (await this.channelRunner.runHandlers(
|
|
2145
2380
|
s,
|
|
2146
2381
|
a,
|
|
2147
|
-
|
|
2382
|
+
h.key(),
|
|
2148
2383
|
c,
|
|
2149
2384
|
!1
|
|
2150
2385
|
), this.hooks.isScopeInactive(s)))
|
|
@@ -2152,12 +2387,12 @@ class kr {
|
|
|
2152
2387
|
}
|
|
2153
2388
|
}
|
|
2154
2389
|
} catch (o) {
|
|
2155
|
-
if (o instanceof
|
|
2390
|
+
if (o instanceof F) {
|
|
2156
2391
|
const s = this.hooks.fatalReason(o, "Boundary violation");
|
|
2157
2392
|
await this.hooks.enterFatalTermination(e, t, s);
|
|
2158
2393
|
return;
|
|
2159
2394
|
}
|
|
2160
|
-
if (o instanceof
|
|
2395
|
+
if (o instanceof $ || o instanceof Error && !(o instanceof y)) {
|
|
2161
2396
|
const s = this.hooks.fatalReason(o, "Runtime fatal");
|
|
2162
2397
|
await this.hooks.enterFatalTermination(e, t, s);
|
|
2163
2398
|
return;
|
|
@@ -2170,7 +2405,7 @@ class kr {
|
|
|
2170
2405
|
if (this.runtime.gasMeter().chargeLifecycleDelivery(), await this.hooks.recordLifecycleForBridging(e, n), !t)
|
|
2171
2406
|
return;
|
|
2172
2407
|
const o = t.channelsOfType(
|
|
2173
|
-
|
|
2408
|
+
Qr
|
|
2174
2409
|
);
|
|
2175
2410
|
for (const s of o)
|
|
2176
2411
|
if (await this.channelRunner.runHandlers(
|
|
@@ -2184,14 +2419,14 @@ class kr {
|
|
|
2184
2419
|
r && await this.finalizeScope(e, t);
|
|
2185
2420
|
}
|
|
2186
2421
|
async processEmbeddedChildren(e, t) {
|
|
2187
|
-
const n =
|
|
2422
|
+
const n = k(e), r = /* @__PURE__ */ new Set();
|
|
2188
2423
|
let o = this.refreshBundle(n);
|
|
2189
2424
|
for (; o; ) {
|
|
2190
2425
|
const s = this.nextEmbeddedPath(o, r);
|
|
2191
2426
|
if (!s)
|
|
2192
2427
|
return o;
|
|
2193
2428
|
r.add(s);
|
|
2194
|
-
const a =
|
|
2429
|
+
const a = T(n, s);
|
|
2195
2430
|
if (a === n || this.hooks.isScopeInactive(a)) {
|
|
2196
2431
|
o = this.refreshBundle(n);
|
|
2197
2432
|
continue;
|
|
@@ -2201,7 +2436,7 @@ class kr {
|
|
|
2201
2436
|
return null;
|
|
2202
2437
|
}
|
|
2203
2438
|
refreshBundle(e) {
|
|
2204
|
-
const t =
|
|
2439
|
+
const t = k(e), n = this.nodeAt(t);
|
|
2205
2440
|
if (!n)
|
|
2206
2441
|
return this.bundles.delete(t), null;
|
|
2207
2442
|
const r = this.loadBundle(n, t);
|
|
@@ -2219,12 +2454,12 @@ class kr {
|
|
|
2219
2454
|
try {
|
|
2220
2455
|
return this.contractLoader.load(e, t);
|
|
2221
2456
|
} catch (n) {
|
|
2222
|
-
if (n instanceof
|
|
2457
|
+
if (n instanceof y || n instanceof z)
|
|
2223
2458
|
throw n;
|
|
2224
2459
|
const r = n?.message ?? "Failed to load contracts";
|
|
2225
|
-
throw new
|
|
2460
|
+
throw new y(
|
|
2226
2461
|
r,
|
|
2227
|
-
|
|
2462
|
+
v.runtimeFatal(
|
|
2228
2463
|
`Failed to load contracts for scope ${t}`,
|
|
2229
2464
|
n
|
|
2230
2465
|
)
|
|
@@ -2232,7 +2467,7 @@ class kr {
|
|
|
2232
2467
|
}
|
|
2233
2468
|
}
|
|
2234
2469
|
async addInitializationMarker(e, t) {
|
|
2235
|
-
const n = new
|
|
2470
|
+
const n = new p().setType(new p().setBlueId(ze)).addProperty("documentId", new p().setValue(t)), r = e.resolvePointer(de);
|
|
2236
2471
|
await e.applyPatch({
|
|
2237
2472
|
op: "ADD",
|
|
2238
2473
|
path: r,
|
|
@@ -2246,20 +2481,20 @@ class kr {
|
|
|
2246
2481
|
if (this.hooks.isScopeInactive(e) || t.embeddedPaths().length === 0)
|
|
2247
2482
|
return;
|
|
2248
2483
|
const n = t.channelsOfType(
|
|
2249
|
-
|
|
2484
|
+
jr
|
|
2250
2485
|
);
|
|
2251
2486
|
if (n.length !== 0)
|
|
2252
2487
|
for (const r of t.embeddedPaths()) {
|
|
2253
|
-
const o =
|
|
2488
|
+
const o = T(e, r), a = this.runtime.scope(o).drainBridgeableEvents();
|
|
2254
2489
|
if (a.length !== 0)
|
|
2255
2490
|
for (const c of a) {
|
|
2256
2491
|
let u = !1;
|
|
2257
|
-
for (const
|
|
2258
|
-
const
|
|
2259
|
-
|
|
2492
|
+
for (const h of n) {
|
|
2493
|
+
const S = h.contract().childPath ?? "/";
|
|
2494
|
+
T(e, S) === o && (u || (this.runtime.gasMeter().chargeBridge(), u = !0), await this.channelRunner.runHandlers(
|
|
2260
2495
|
e,
|
|
2261
2496
|
t,
|
|
2262
|
-
|
|
2497
|
+
h.key(),
|
|
2263
2498
|
c.clone(),
|
|
2264
2499
|
!1
|
|
2265
2500
|
));
|
|
@@ -2271,7 +2506,7 @@ class kr {
|
|
|
2271
2506
|
if (this.hooks.isScopeInactive(e))
|
|
2272
2507
|
return;
|
|
2273
2508
|
const n = this.runtime.scope(e), r = t.channelsOfType(
|
|
2274
|
-
|
|
2509
|
+
Jr
|
|
2275
2510
|
);
|
|
2276
2511
|
if (r.length === 0) {
|
|
2277
2512
|
n.clearTriggered();
|
|
@@ -2301,19 +2536,19 @@ class kr {
|
|
|
2301
2536
|
}
|
|
2302
2537
|
}
|
|
2303
2538
|
validatePatchBoundary(e, t, n) {
|
|
2304
|
-
const r =
|
|
2539
|
+
const r = k(e), o = R(n.path);
|
|
2305
2540
|
if (o === r)
|
|
2306
|
-
throw new
|
|
2541
|
+
throw new F(
|
|
2307
2542
|
`Self-root mutation is forbidden at scope ${r}`
|
|
2308
2543
|
);
|
|
2309
2544
|
if (r !== "/" && !o.startsWith(`${r}/`))
|
|
2310
|
-
throw new
|
|
2545
|
+
throw new F(
|
|
2311
2546
|
`Patch path ${o} is outside scope ${r}`
|
|
2312
2547
|
);
|
|
2313
2548
|
for (const s of t.embeddedPaths()) {
|
|
2314
|
-
const a =
|
|
2549
|
+
const a = T(r, s);
|
|
2315
2550
|
if (o.startsWith(`${a}/`))
|
|
2316
|
-
throw new
|
|
2551
|
+
throw new F(
|
|
2317
2552
|
`Boundary violation: patch ${o} enters embedded scope ${a}`
|
|
2318
2553
|
);
|
|
2319
2554
|
}
|
|
@@ -2321,14 +2556,14 @@ class kr {
|
|
|
2321
2556
|
enforceReservedKeyWriteProtection(e, t, n) {
|
|
2322
2557
|
if (n)
|
|
2323
2558
|
return;
|
|
2324
|
-
const r =
|
|
2325
|
-
for (const s of
|
|
2326
|
-
const a =
|
|
2559
|
+
const r = k(e), o = R(t.path);
|
|
2560
|
+
for (const s of Ee) {
|
|
2561
|
+
const a = T(
|
|
2327
2562
|
r,
|
|
2328
|
-
|
|
2563
|
+
ne(s)
|
|
2329
2564
|
);
|
|
2330
2565
|
if (o === a || o.startsWith(`${a}/`))
|
|
2331
|
-
throw new
|
|
2566
|
+
throw new F(
|
|
2332
2567
|
`Reserved key '${s}' is write-protected at ${a}`
|
|
2333
2568
|
);
|
|
2334
2569
|
}
|
|
@@ -2336,90 +2571,90 @@ class kr {
|
|
|
2336
2571
|
async markCutOffChildrenIfNeeded(e, t, n) {
|
|
2337
2572
|
if (t.embeddedPaths().length === 0)
|
|
2338
2573
|
return;
|
|
2339
|
-
const r =
|
|
2574
|
+
const r = R(n.path);
|
|
2340
2575
|
for (const o of t.embeddedPaths()) {
|
|
2341
|
-
const s =
|
|
2576
|
+
const s = T(e, o);
|
|
2342
2577
|
r === s && (n.op === "remove" || n.op === "replace") && await this.hooks.markCutOff(s);
|
|
2343
2578
|
}
|
|
2344
2579
|
}
|
|
2345
2580
|
hasInitializationMarker(e) {
|
|
2346
|
-
const t =
|
|
2581
|
+
const t = T(e, de), n = this.nodeAt(t);
|
|
2347
2582
|
if (!n)
|
|
2348
2583
|
return !1;
|
|
2349
|
-
if (!(n instanceof
|
|
2584
|
+
if (!(n instanceof p)) {
|
|
2350
2585
|
const o = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
|
|
2351
|
-
throw new
|
|
2586
|
+
throw new $(o);
|
|
2352
2587
|
}
|
|
2353
|
-
if (n.getType()?.getBlueId() !==
|
|
2588
|
+
if (n.getType()?.getBlueId() !== ze) {
|
|
2354
2589
|
const o = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
|
|
2355
|
-
throw new
|
|
2590
|
+
throw new $(o);
|
|
2356
2591
|
}
|
|
2357
2592
|
return !0;
|
|
2358
2593
|
}
|
|
2359
2594
|
createLifecycleEvent(e) {
|
|
2360
|
-
return new
|
|
2361
|
-
type: new
|
|
2362
|
-
documentId: new
|
|
2595
|
+
return new p().setType(new p().setBlueId(Xr)).setProperties({
|
|
2596
|
+
type: new p().setValue("Core/Document Processing Initiated"),
|
|
2597
|
+
documentId: new p().setValue(e)
|
|
2363
2598
|
});
|
|
2364
2599
|
}
|
|
2365
2600
|
}
|
|
2366
|
-
class
|
|
2601
|
+
class ee extends Error {
|
|
2367
2602
|
constructor(e) {
|
|
2368
2603
|
super(
|
|
2369
2604
|
e ? "Processing terminated due to fatal error" : "Processing terminated"
|
|
2370
2605
|
), this.fatal = e, this.name = "RunTerminationError";
|
|
2371
2606
|
}
|
|
2372
2607
|
}
|
|
2373
|
-
const
|
|
2374
|
-
class
|
|
2608
|
+
const Zr = f["Core/Processing Terminated Marker"], ei = f["Core/Document Processing Terminated"];
|
|
2609
|
+
class ti {
|
|
2375
2610
|
constructor(e) {
|
|
2376
2611
|
this.runtime = e;
|
|
2377
2612
|
}
|
|
2378
2613
|
async terminateScope(e, t, n, r, o) {
|
|
2379
2614
|
e.recordPendingTermination(t, r, o ?? null);
|
|
2380
|
-
const s = e.normalizeScope(t), a =
|
|
2615
|
+
const s = e.normalizeScope(t), a = T(s, Je);
|
|
2381
2616
|
this.runtime.directWrite(
|
|
2382
2617
|
a,
|
|
2383
|
-
|
|
2618
|
+
ni(this.runtime.blue(), r, o)
|
|
2384
2619
|
), this.runtime.gasMeter().chargeTerminationMarker();
|
|
2385
|
-
const c = n ?? e.bundleForScope(s) ?? null, u =
|
|
2620
|
+
const c = n ?? e.bundleForScope(s) ?? null, u = ri(r, o);
|
|
2386
2621
|
if (await e.deliverLifecycle(
|
|
2387
2622
|
s,
|
|
2388
2623
|
c,
|
|
2389
2624
|
u,
|
|
2390
2625
|
!1
|
|
2391
2626
|
), this.runtime.scope(s).finalizeTermination(r, o ?? null), e.clearPendingTermination(t), r === "FATAL" && this.runtime.gasMeter().chargeFatalTerminationOverhead(), r === "FATAL" && s === "/")
|
|
2392
|
-
throw this.runtime.markRunTerminated(), new
|
|
2627
|
+
throw this.runtime.markRunTerminated(), new ee(!0);
|
|
2393
2628
|
if (r === "GRACEFUL" && s === "/")
|
|
2394
|
-
throw this.runtime.markRunTerminated(), new
|
|
2629
|
+
throw this.runtime.markRunTerminated(), new ee(!1);
|
|
2395
2630
|
}
|
|
2396
2631
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return
|
|
2399
|
-
type: { blueId:
|
|
2632
|
+
function ni(i, e, t) {
|
|
2633
|
+
return ii(i, {
|
|
2634
|
+
type: { blueId: Zr },
|
|
2400
2635
|
cause: e === "GRACEFUL" ? "graceful" : "fatal",
|
|
2401
2636
|
...t ? { reason: t } : {}
|
|
2402
2637
|
});
|
|
2403
2638
|
}
|
|
2404
|
-
function
|
|
2405
|
-
const t = new
|
|
2406
|
-
new
|
|
2639
|
+
function ri(i, e) {
|
|
2640
|
+
const t = new p().setType(
|
|
2641
|
+
new p().setBlueId(ei)
|
|
2407
2642
|
);
|
|
2408
2643
|
return t.addProperty(
|
|
2409
2644
|
"cause",
|
|
2410
|
-
new
|
|
2411
|
-
), e && t.addProperty("reason", new
|
|
2645
|
+
new p().setValue(i === "GRACEFUL" ? "graceful" : "fatal")
|
|
2646
|
+
), e && t.addProperty("reason", new p().setValue(e)), t;
|
|
2412
2647
|
}
|
|
2413
|
-
function
|
|
2648
|
+
function ii(i, e) {
|
|
2414
2649
|
return i.jsonValueToNode(e);
|
|
2415
2650
|
}
|
|
2416
|
-
const
|
|
2417
|
-
class
|
|
2651
|
+
const q = "-";
|
|
2652
|
+
class oi {
|
|
2418
2653
|
constructor(e) {
|
|
2419
2654
|
this.document = e;
|
|
2420
2655
|
}
|
|
2421
2656
|
applyPatch(e, t) {
|
|
2422
|
-
const n =
|
|
2657
|
+
const n = k(e), r = R(t.path), o = He(r), s = Ve(this.document, o, "before", r);
|
|
2423
2658
|
switch (t.op) {
|
|
2424
2659
|
case "ADD":
|
|
2425
2660
|
this.applyAdd(o, r, t.val ?? null);
|
|
@@ -2431,34 +2666,34 @@ class Or {
|
|
|
2431
2666
|
this.applyRemove(o, r);
|
|
2432
2667
|
break;
|
|
2433
2668
|
}
|
|
2434
|
-
const a = t.op === "REMOVE" ? null :
|
|
2669
|
+
const a = t.op === "REMOVE" ? null : Ve(this.document, o, "after", r);
|
|
2435
2670
|
return {
|
|
2436
2671
|
path: r,
|
|
2437
2672
|
before: s,
|
|
2438
2673
|
after: a,
|
|
2439
2674
|
op: t.op.toLowerCase(),
|
|
2440
2675
|
originScope: n,
|
|
2441
|
-
cascadeScopes:
|
|
2676
|
+
cascadeScopes: si(n)
|
|
2442
2677
|
};
|
|
2443
2678
|
}
|
|
2444
2679
|
directWrite(e, t) {
|
|
2445
|
-
const n =
|
|
2680
|
+
const n = R(e);
|
|
2446
2681
|
if (n === "/")
|
|
2447
2682
|
throw new Error("Direct write cannot target root document");
|
|
2448
|
-
const r =
|
|
2449
|
-
if (s ===
|
|
2683
|
+
const r = He(n), { parent: o, leaf: s } = this.resolveParent(r);
|
|
2684
|
+
if (s === q)
|
|
2450
2685
|
throw new Error(
|
|
2451
2686
|
`Direct write does not support append token '-' for path ${n}`
|
|
2452
2687
|
);
|
|
2453
2688
|
const a = o.getItems();
|
|
2454
|
-
if (a &&
|
|
2689
|
+
if (a && U(s)) {
|
|
2455
2690
|
this.directWriteArray(o, a, s, t, n);
|
|
2456
2691
|
return;
|
|
2457
2692
|
}
|
|
2458
2693
|
this.directWriteObject(o, s, t);
|
|
2459
2694
|
}
|
|
2460
2695
|
directWriteArray(e, t, n, r, o) {
|
|
2461
|
-
const s =
|
|
2696
|
+
const s = ue(e, t), a = B(n, o);
|
|
2462
2697
|
if (r == null) {
|
|
2463
2698
|
if (a < 0 || a >= s.length)
|
|
2464
2699
|
return;
|
|
@@ -2479,7 +2714,7 @@ class Or {
|
|
|
2479
2714
|
);
|
|
2480
2715
|
}
|
|
2481
2716
|
directWriteObject(e, t, n) {
|
|
2482
|
-
const r =
|
|
2717
|
+
const r = Q(e);
|
|
2483
2718
|
if (n == null) {
|
|
2484
2719
|
delete r[t], e.setProperties(
|
|
2485
2720
|
Object.keys(r).length > 0 ? r : void 0
|
|
@@ -2499,27 +2734,27 @@ class Or {
|
|
|
2499
2734
|
return { parent: t, leaf: e[e.length - 1] };
|
|
2500
2735
|
}
|
|
2501
2736
|
getOrCreateChild(e, t, n, r) {
|
|
2502
|
-
if (t ===
|
|
2737
|
+
if (t === q)
|
|
2503
2738
|
throw new Error(
|
|
2504
|
-
`Append token '-' must be final segment: ${
|
|
2739
|
+
`Append token '-' must be final segment: ${W(n, r)}`
|
|
2505
2740
|
);
|
|
2506
2741
|
const o = e.getItems();
|
|
2507
|
-
if (o &&
|
|
2508
|
-
const c =
|
|
2742
|
+
if (o && U(t)) {
|
|
2743
|
+
const c = B(t, W(n, r));
|
|
2509
2744
|
if (c < 0 || c >= o.length)
|
|
2510
2745
|
throw new Error(
|
|
2511
|
-
`Array index out of bounds: ${
|
|
2746
|
+
`Array index out of bounds: ${W(n, r)}`
|
|
2512
2747
|
);
|
|
2513
2748
|
const u = o[c];
|
|
2514
2749
|
if (!u)
|
|
2515
2750
|
throw new Error(
|
|
2516
|
-
`Path does not exist: ${
|
|
2751
|
+
`Path does not exist: ${W(n, r)}`
|
|
2517
2752
|
);
|
|
2518
2753
|
return u;
|
|
2519
2754
|
}
|
|
2520
|
-
const s =
|
|
2755
|
+
const s = Q(e);
|
|
2521
2756
|
let a = s[t];
|
|
2522
|
-
return a || (a = new
|
|
2757
|
+
return a || (a = new p(), s[t] = a, e.setProperties(s)), a;
|
|
2523
2758
|
}
|
|
2524
2759
|
applyAdd(e, t, n) {
|
|
2525
2760
|
if (t === "/" || t.length === 0)
|
|
@@ -2530,24 +2765,24 @@ class Or {
|
|
|
2530
2765
|
"ADD"
|
|
2531
2766
|
);
|
|
2532
2767
|
try {
|
|
2533
|
-
if (
|
|
2534
|
-
const u = r.getItems(),
|
|
2768
|
+
if (U(o)) {
|
|
2769
|
+
const u = r.getItems(), h = o === q;
|
|
2535
2770
|
if (!u)
|
|
2536
2771
|
throw new Error(
|
|
2537
|
-
|
|
2772
|
+
h ? `Append token '-' requires array at ${s}` : `Array index segment requires array at ${s}`
|
|
2538
2773
|
);
|
|
2539
|
-
if (
|
|
2540
|
-
|
|
2774
|
+
if (h) {
|
|
2775
|
+
ue(r, u).push(G(n));
|
|
2541
2776
|
return;
|
|
2542
2777
|
}
|
|
2543
|
-
const
|
|
2544
|
-
if (
|
|
2778
|
+
const d = B(o, t);
|
|
2779
|
+
if (d < 0 || d > u.length)
|
|
2545
2780
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2546
|
-
|
|
2781
|
+
ue(r, u).splice(d, 0, G(n));
|
|
2547
2782
|
return;
|
|
2548
2783
|
}
|
|
2549
|
-
const c =
|
|
2550
|
-
c[o] =
|
|
2784
|
+
const c = Q(r);
|
|
2785
|
+
c[o] = G(n), r.setProperties(c);
|
|
2551
2786
|
} catch (c) {
|
|
2552
2787
|
throw this.rollbackCreated(a), c;
|
|
2553
2788
|
}
|
|
@@ -2561,18 +2796,18 @@ class Or {
|
|
|
2561
2796
|
"REPLACE"
|
|
2562
2797
|
);
|
|
2563
2798
|
try {
|
|
2564
|
-
if (
|
|
2799
|
+
if (U(o)) {
|
|
2565
2800
|
const c = r.getItems();
|
|
2566
2801
|
if (!c)
|
|
2567
2802
|
throw new Error(`Array index segment requires array at ${t}`);
|
|
2568
|
-
const u =
|
|
2803
|
+
const u = B(o, t);
|
|
2569
2804
|
if (u < 0 || u >= c.length)
|
|
2570
2805
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2571
|
-
c[u] =
|
|
2806
|
+
c[u] = G(n), r.setItems(c);
|
|
2572
2807
|
return;
|
|
2573
2808
|
}
|
|
2574
|
-
const a =
|
|
2575
|
-
a[o] =
|
|
2809
|
+
const a = Q(r);
|
|
2810
|
+
a[o] = G(n), r.setProperties(a);
|
|
2576
2811
|
} catch (a) {
|
|
2577
2812
|
throw this.rollbackCreated(s), a;
|
|
2578
2813
|
}
|
|
@@ -2585,11 +2820,11 @@ class Or {
|
|
|
2585
2820
|
t,
|
|
2586
2821
|
"REMOVE"
|
|
2587
2822
|
);
|
|
2588
|
-
if (
|
|
2823
|
+
if (U(r)) {
|
|
2589
2824
|
const a = n.getItems();
|
|
2590
2825
|
if (!a)
|
|
2591
2826
|
throw new Error(`Array index segment requires array at ${t}`);
|
|
2592
|
-
const c =
|
|
2827
|
+
const c = B(r, t);
|
|
2593
2828
|
if (c < 0 || c >= a.length)
|
|
2594
2829
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2595
2830
|
a.splice(c, 1), n.setItems(a);
|
|
@@ -2607,27 +2842,27 @@ class Or {
|
|
|
2607
2842
|
let r = this.document;
|
|
2608
2843
|
const o = [];
|
|
2609
2844
|
for (let a = 0; a < e.length - 1; a += 1) {
|
|
2610
|
-
const c = e[a], u =
|
|
2611
|
-
if (
|
|
2612
|
-
const
|
|
2613
|
-
if (!
|
|
2845
|
+
const c = e[a], u = W(e, a + 1);
|
|
2846
|
+
if (U(c)) {
|
|
2847
|
+
const S = r.getItems();
|
|
2848
|
+
if (!S)
|
|
2614
2849
|
throw new Error(`Array index segment requires array at ${u}`);
|
|
2615
|
-
const
|
|
2616
|
-
if (
|
|
2850
|
+
const m = B(c, u);
|
|
2851
|
+
if (m < 0 || m >= S.length)
|
|
2617
2852
|
throw new Error(`Array index out of bounds in path: ${u}`);
|
|
2618
|
-
const
|
|
2619
|
-
if (!(
|
|
2853
|
+
const E = S[m];
|
|
2854
|
+
if (!(E instanceof p))
|
|
2620
2855
|
throw new Error(`Array index out of bounds in path: ${u}`);
|
|
2621
|
-
r =
|
|
2856
|
+
r = E;
|
|
2622
2857
|
continue;
|
|
2623
2858
|
}
|
|
2624
|
-
let
|
|
2625
|
-
if (!(
|
|
2859
|
+
let h = r.getProperties(), d = h?.[c] ?? null;
|
|
2860
|
+
if (!(d instanceof p)) {
|
|
2626
2861
|
if (n === "REMOVE")
|
|
2627
2862
|
throw new Error(`Path does not exist: ${u}`);
|
|
2628
|
-
|
|
2863
|
+
d = new p(), h || (h = {}), h[c] = d, r.setProperties(h), o.push({ owner: r, key: c });
|
|
2629
2864
|
}
|
|
2630
|
-
r =
|
|
2865
|
+
r = d;
|
|
2631
2866
|
}
|
|
2632
2867
|
const s = e[e.length - 1];
|
|
2633
2868
|
return { parent: r, key: s, pointer: t, created: o };
|
|
@@ -2639,7 +2874,7 @@ class Or {
|
|
|
2639
2874
|
}
|
|
2640
2875
|
}
|
|
2641
2876
|
}
|
|
2642
|
-
function
|
|
2877
|
+
function si(i) {
|
|
2643
2878
|
const e = [];
|
|
2644
2879
|
let t = i;
|
|
2645
2880
|
for (; e.push(t), t !== "/"; ) {
|
|
@@ -2648,51 +2883,51 @@ function Ar(i) {
|
|
|
2648
2883
|
}
|
|
2649
2884
|
return e;
|
|
2650
2885
|
}
|
|
2651
|
-
function
|
|
2886
|
+
function Ve(i, e, t, n) {
|
|
2652
2887
|
try {
|
|
2653
2888
|
if (e.length === 0)
|
|
2654
2889
|
return i.clone();
|
|
2655
|
-
const r =
|
|
2890
|
+
const r = ai(i, e, t, n);
|
|
2656
2891
|
return r ? r.clone() : null;
|
|
2657
2892
|
} catch {
|
|
2658
2893
|
return null;
|
|
2659
2894
|
}
|
|
2660
2895
|
}
|
|
2661
|
-
function
|
|
2896
|
+
function ai(i, e, t, n) {
|
|
2662
2897
|
let r = i;
|
|
2663
2898
|
for (let o = 0; o < e.length; o += 1) {
|
|
2664
2899
|
const s = e[o] ?? "", a = o === e.length - 1;
|
|
2665
|
-
if (r =
|
|
2900
|
+
if (r = ci(r, s, a, t, n), !r)
|
|
2666
2901
|
return null;
|
|
2667
2902
|
}
|
|
2668
2903
|
return r;
|
|
2669
2904
|
}
|
|
2670
|
-
function
|
|
2905
|
+
function ci(i, e, t, n, r) {
|
|
2671
2906
|
if (!i)
|
|
2672
2907
|
return null;
|
|
2673
2908
|
const o = i.getItems();
|
|
2674
2909
|
if (o) {
|
|
2675
|
-
if (e ===
|
|
2910
|
+
if (e === q) {
|
|
2676
2911
|
if (!t)
|
|
2677
2912
|
throw new Error(`Append token '-' must be final segment: ${r}`);
|
|
2678
2913
|
return n === "before" || o.length === 0 ? null : o[o.length - 1] ?? null;
|
|
2679
2914
|
}
|
|
2680
|
-
const c =
|
|
2915
|
+
const c = B(e, r);
|
|
2681
2916
|
return c < 0 || c >= o.length ? null : o[c] ?? null;
|
|
2682
2917
|
}
|
|
2683
2918
|
const s = i.getProperties();
|
|
2684
2919
|
if (!s)
|
|
2685
2920
|
return null;
|
|
2686
2921
|
const a = s[e];
|
|
2687
|
-
return a instanceof
|
|
2922
|
+
return a instanceof p ? a : null;
|
|
2688
2923
|
}
|
|
2689
|
-
function
|
|
2924
|
+
function He(i) {
|
|
2690
2925
|
if (i === "/" || i === "")
|
|
2691
2926
|
return [];
|
|
2692
2927
|
const e = i.startsWith("/") ? i.slice(1) : i;
|
|
2693
2928
|
return e.length === 0 ? [] : e.split("/");
|
|
2694
2929
|
}
|
|
2695
|
-
function
|
|
2930
|
+
function B(i, e) {
|
|
2696
2931
|
const t = Number.parseInt(i, 10);
|
|
2697
2932
|
if (Number.isNaN(t))
|
|
2698
2933
|
throw new Error(`Expected numeric array index in path: ${e}`);
|
|
@@ -2700,7 +2935,7 @@ function M(i, e) {
|
|
|
2700
2935
|
throw new Error(`Negative array index in path: ${e}`);
|
|
2701
2936
|
return t;
|
|
2702
2937
|
}
|
|
2703
|
-
function
|
|
2938
|
+
function W(i, e) {
|
|
2704
2939
|
if (e <= 0)
|
|
2705
2940
|
return "/";
|
|
2706
2941
|
const t = Math.min(e, i.length);
|
|
@@ -2709,11 +2944,11 @@ function z(i, e) {
|
|
|
2709
2944
|
n += `/${i[r] ?? ""}`;
|
|
2710
2945
|
return n === "" ? "/" : n;
|
|
2711
2946
|
}
|
|
2712
|
-
function
|
|
2947
|
+
function ue(i, e) {
|
|
2713
2948
|
const t = [...e];
|
|
2714
2949
|
return i.setItems(t), t;
|
|
2715
2950
|
}
|
|
2716
|
-
function
|
|
2951
|
+
function Q(i) {
|
|
2717
2952
|
const e = i.getProperties();
|
|
2718
2953
|
if (!e) {
|
|
2719
2954
|
const n = {};
|
|
@@ -2722,13 +2957,13 @@ function J(i) {
|
|
|
2722
2957
|
const t = { ...e };
|
|
2723
2958
|
return i.setProperties(t), t;
|
|
2724
2959
|
}
|
|
2725
|
-
function
|
|
2726
|
-
return i ===
|
|
2960
|
+
function U(i) {
|
|
2961
|
+
return i === q || /^\d+$/.test(i);
|
|
2727
2962
|
}
|
|
2728
|
-
function
|
|
2729
|
-
return i == null ? new
|
|
2963
|
+
function G(i) {
|
|
2964
|
+
return i == null ? new p().setValue(null) : i.clone();
|
|
2730
2965
|
}
|
|
2731
|
-
class
|
|
2966
|
+
class li {
|
|
2732
2967
|
constructor(e) {
|
|
2733
2968
|
this.path = e;
|
|
2734
2969
|
}
|
|
@@ -2790,7 +3025,7 @@ class Lr {
|
|
|
2790
3025
|
return this.cutOff;
|
|
2791
3026
|
}
|
|
2792
3027
|
}
|
|
2793
|
-
class
|
|
3028
|
+
class ui {
|
|
2794
3029
|
scopesMap = /* @__PURE__ */ new Map();
|
|
2795
3030
|
rootEmissionList = [];
|
|
2796
3031
|
scopes() {
|
|
@@ -2798,7 +3033,7 @@ class xr {
|
|
|
2798
3033
|
}
|
|
2799
3034
|
scope(e) {
|
|
2800
3035
|
let t = this.scopesMap.get(e);
|
|
2801
|
-
return t || (t = new
|
|
3036
|
+
return t || (t = new li(e), this.scopesMap.set(e, t)), t;
|
|
2802
3037
|
}
|
|
2803
3038
|
existingScope(e) {
|
|
2804
3039
|
return this.scopesMap.get(e);
|
|
@@ -2816,45 +3051,33 @@ class xr {
|
|
|
2816
3051
|
this.scopesMap.delete(e);
|
|
2817
3052
|
}
|
|
2818
3053
|
}
|
|
2819
|
-
function
|
|
3054
|
+
function Ct(i) {
|
|
2820
3055
|
return Math.floor((i + 99) / 100);
|
|
2821
3056
|
}
|
|
2822
|
-
function
|
|
2823
|
-
|
|
2824
|
-
}
|
|
2825
|
-
function _r(i) {
|
|
2826
|
-
const e = T(i);
|
|
3057
|
+
function hi(i) {
|
|
3058
|
+
const e = R(i);
|
|
2827
3059
|
return e === "/" ? 0 : e.split("/").length - 1;
|
|
2828
3060
|
}
|
|
2829
|
-
function
|
|
2830
|
-
return 100 + q(ye(i));
|
|
2831
|
-
}
|
|
2832
|
-
function Ur(i) {
|
|
3061
|
+
function di(i) {
|
|
2833
3062
|
return 40 + 5 * Math.max(0, i);
|
|
2834
3063
|
}
|
|
2835
|
-
function
|
|
2836
|
-
return
|
|
3064
|
+
function pi(i, e) {
|
|
3065
|
+
return 8 + hi(i) + Ct(e);
|
|
2837
3066
|
}
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
}
|
|
2841
|
-
function Hr(i, e) {
|
|
2842
|
-
return 8 + _r(i) + q(e);
|
|
2843
|
-
}
|
|
2844
|
-
const Vr = 1e3, Wr = 5, Kr = 50, qr = 2, jr = 10, Jr = 10, Gr = 10, Qr = 20, Yr = 20, Xr = 30, Zr = 30, ei = 100;
|
|
2845
|
-
function ti(i) {
|
|
3067
|
+
const mi = 1e3, fi = 5, gi = 50, Ei = 2, yi = 10, Ci = 10, Si = 10, vi = 20, wi = 20, ki = 30, bi = 30, Ii = 100;
|
|
3068
|
+
function Ti(i) {
|
|
2846
3069
|
return 50 + 10 * i;
|
|
2847
3070
|
}
|
|
2848
|
-
function
|
|
3071
|
+
function Ri(i) {
|
|
2849
3072
|
return 20 + i;
|
|
2850
3073
|
}
|
|
2851
|
-
function
|
|
3074
|
+
function Pi(i) {
|
|
2852
3075
|
return 10 * i;
|
|
2853
3076
|
}
|
|
2854
|
-
function
|
|
3077
|
+
function Mi(i) {
|
|
2855
3078
|
return 20 + i;
|
|
2856
3079
|
}
|
|
2857
|
-
class
|
|
3080
|
+
class Ni {
|
|
2858
3081
|
constructor(e) {
|
|
2859
3082
|
this.blue = e;
|
|
2860
3083
|
}
|
|
@@ -2866,77 +3089,72 @@ class oi {
|
|
|
2866
3089
|
this.total += e;
|
|
2867
3090
|
}
|
|
2868
3091
|
chargeScopeEntry(e) {
|
|
2869
|
-
this.add(
|
|
3092
|
+
this.add(Ti(this.scopeDepth(e)));
|
|
2870
3093
|
}
|
|
2871
3094
|
chargeInitialization() {
|
|
2872
|
-
this.add(
|
|
3095
|
+
this.add(mi);
|
|
2873
3096
|
}
|
|
2874
3097
|
chargeChannelMatchAttempt() {
|
|
2875
|
-
this.add(
|
|
3098
|
+
this.add(fi);
|
|
2876
3099
|
}
|
|
2877
3100
|
chargeHandlerOverhead() {
|
|
2878
|
-
this.add(
|
|
3101
|
+
this.add(gi);
|
|
2879
3102
|
}
|
|
2880
3103
|
chargeBoundaryCheck() {
|
|
2881
|
-
this.add(
|
|
3104
|
+
this.add(Ei);
|
|
2882
3105
|
}
|
|
2883
3106
|
chargePatchAddOrReplace(e) {
|
|
2884
|
-
this.add(
|
|
3107
|
+
this.add(Ri(this.payloadSizeCharge(e)));
|
|
2885
3108
|
}
|
|
2886
3109
|
chargePatchRemove() {
|
|
2887
|
-
this.add(
|
|
3110
|
+
this.add(yi);
|
|
2888
3111
|
}
|
|
2889
3112
|
chargeCascadeRouting(e) {
|
|
2890
|
-
e > 0 && this.add(
|
|
3113
|
+
e > 0 && this.add(Pi(e));
|
|
2891
3114
|
}
|
|
2892
3115
|
chargeEmitEvent(e) {
|
|
2893
|
-
this.add(
|
|
3116
|
+
this.add(Mi(this.payloadSizeCharge(e)));
|
|
2894
3117
|
}
|
|
2895
3118
|
chargeBridge() {
|
|
2896
|
-
this.add(
|
|
3119
|
+
this.add(Ci);
|
|
2897
3120
|
}
|
|
2898
3121
|
chargeDrainEvent() {
|
|
2899
|
-
this.add(
|
|
3122
|
+
this.add(Si);
|
|
2900
3123
|
}
|
|
2901
3124
|
chargeCheckpointUpdate() {
|
|
2902
|
-
this.add(
|
|
3125
|
+
this.add(vi);
|
|
2903
3126
|
}
|
|
2904
3127
|
chargeTerminationMarker() {
|
|
2905
|
-
this.add(
|
|
3128
|
+
this.add(wi);
|
|
2906
3129
|
}
|
|
2907
3130
|
chargeLifecycleDelivery() {
|
|
2908
|
-
this.add(
|
|
3131
|
+
this.add(ki);
|
|
2909
3132
|
}
|
|
2910
3133
|
chargeFatalTerminationOverhead() {
|
|
2911
|
-
this.add(
|
|
2912
|
-
}
|
|
2913
|
-
chargeJavaScriptCodeBase(e) {
|
|
2914
|
-
this.add(Fr(e));
|
|
3134
|
+
this.add(Ii);
|
|
2915
3135
|
}
|
|
2916
3136
|
chargeTriggerEventBase() {
|
|
2917
|
-
this.add(
|
|
3137
|
+
this.add(bi);
|
|
2918
3138
|
}
|
|
2919
3139
|
chargeUpdateDocumentBase(e) {
|
|
2920
|
-
this.add(
|
|
2921
|
-
}
|
|
2922
|
-
chargeExpression(e) {
|
|
2923
|
-
this.add(zr(e));
|
|
2924
|
-
}
|
|
2925
|
-
chargeTemplate(e, t) {
|
|
2926
|
-
this.add($r(e, t));
|
|
3140
|
+
this.add(di(e));
|
|
2927
3141
|
}
|
|
2928
3142
|
chargeDocumentSnapshot(e, t) {
|
|
2929
|
-
const n = t ?
|
|
2930
|
-
this.add(
|
|
3143
|
+
const n = t ? Me(this.blue, t) : 0;
|
|
3144
|
+
this.add(pi(e, n));
|
|
3145
|
+
}
|
|
3146
|
+
chargeWasmGas(e) {
|
|
3147
|
+
const t = Jt(e);
|
|
3148
|
+
t > 0 && this.add(t);
|
|
2931
3149
|
}
|
|
2932
3150
|
payloadSizeCharge(e) {
|
|
2933
3151
|
if (!e)
|
|
2934
3152
|
return 0;
|
|
2935
|
-
const t =
|
|
2936
|
-
return
|
|
3153
|
+
const t = Me(this.blue, e);
|
|
3154
|
+
return Ct(t);
|
|
2937
3155
|
}
|
|
2938
3156
|
scopeDepth(e) {
|
|
2939
|
-
const t =
|
|
3157
|
+
const t = k(e);
|
|
2940
3158
|
if (t === "/" || t.length <= 1)
|
|
2941
3159
|
return 0;
|
|
2942
3160
|
let n = 1;
|
|
@@ -2945,12 +3163,12 @@ class oi {
|
|
|
2945
3163
|
return n;
|
|
2946
3164
|
}
|
|
2947
3165
|
}
|
|
2948
|
-
class
|
|
3166
|
+
class Oi {
|
|
2949
3167
|
constructor(e, t) {
|
|
2950
|
-
this.documentRef = e, this.blueRef = t, this.patchEngine = new
|
|
3168
|
+
this.documentRef = e, this.blueRef = t, this.patchEngine = new oi(this.documentRef), this.meter = new Ni(this.blueRef);
|
|
2951
3169
|
}
|
|
2952
3170
|
patchEngine;
|
|
2953
|
-
emissionRegistry = new
|
|
3171
|
+
emissionRegistry = new ui();
|
|
2954
3172
|
meter;
|
|
2955
3173
|
runTerminated = !1;
|
|
2956
3174
|
document() {
|
|
@@ -2999,15 +3217,15 @@ class si {
|
|
|
2999
3217
|
return this.patchEngine.applyPatch(e, t);
|
|
3000
3218
|
}
|
|
3001
3219
|
}
|
|
3002
|
-
const
|
|
3003
|
-
class
|
|
3220
|
+
const Ai = f["Core/Processing Initialized Marker"], Di = f["Core/Document Update"];
|
|
3221
|
+
class Bi {
|
|
3004
3222
|
constructor(e, t, n, r) {
|
|
3005
|
-
this.contractLoader = e, this.registry = t, this.runtimeRef = new
|
|
3006
|
-
const o = (s) =>
|
|
3007
|
-
this.checkpointManager = new
|
|
3223
|
+
this.contractLoader = e, this.registry = t, this.runtimeRef = new Oi(r, n);
|
|
3224
|
+
const o = (s) => nt(this.runtimeRef.blue(), s);
|
|
3225
|
+
this.checkpointManager = new Kr(
|
|
3008
3226
|
this.runtimeRef,
|
|
3009
3227
|
o
|
|
3010
|
-
), this.terminationService = new
|
|
3228
|
+
), this.terminationService = new ti(this.runtimeRef), this.channelRunner = new Wr(
|
|
3011
3229
|
this.runtimeRef,
|
|
3012
3230
|
this.checkpointManager,
|
|
3013
3231
|
{
|
|
@@ -3023,10 +3241,10 @@ class li {
|
|
|
3023
3241
|
shouldRunHandler: async (s, a) => {
|
|
3024
3242
|
const c = this.registry.lookupHandler(s.blueId());
|
|
3025
3243
|
if (!c) {
|
|
3026
|
-
const
|
|
3027
|
-
throw new
|
|
3028
|
-
|
|
3029
|
-
|
|
3244
|
+
const h = `No processor registered for handler contract ${s.blueId()}`;
|
|
3245
|
+
throw new y(
|
|
3246
|
+
h,
|
|
3247
|
+
v.illegalState(h)
|
|
3030
3248
|
);
|
|
3031
3249
|
}
|
|
3032
3250
|
const u = c.matches;
|
|
@@ -3037,19 +3255,19 @@ class li {
|
|
|
3037
3255
|
canonicalSignature: o,
|
|
3038
3256
|
channelProcessorFor: (s) => this.registry.lookupChannel(s) ?? null
|
|
3039
3257
|
}
|
|
3040
|
-
), this.scopeExecutor = new
|
|
3258
|
+
), this.scopeExecutor = new Yr({
|
|
3041
3259
|
runtime: this.runtimeRef,
|
|
3042
3260
|
contractLoader: this.contractLoader,
|
|
3043
3261
|
channelRunner: this.channelRunner,
|
|
3044
3262
|
bundles: this.bundles,
|
|
3045
3263
|
hooks: {
|
|
3046
3264
|
isScopeInactive: (s) => this.isScopeInactive(s),
|
|
3047
|
-
createContext: (s, a, c, u,
|
|
3265
|
+
createContext: (s, a, c, u, h) => this.createContext(
|
|
3048
3266
|
s,
|
|
3049
3267
|
a,
|
|
3050
3268
|
c,
|
|
3051
3269
|
u,
|
|
3052
|
-
|
|
3270
|
+
h ?? !1
|
|
3053
3271
|
),
|
|
3054
3272
|
recordLifecycleForBridging: (s, a) => this.recordLifecycleForBridging(s, a),
|
|
3055
3273
|
enterFatalTermination: (s, a, c) => this.enterFatalTermination(s, a, c ?? null),
|
|
@@ -3088,7 +3306,7 @@ class li {
|
|
|
3088
3306
|
);
|
|
3089
3307
|
}
|
|
3090
3308
|
createContext(e, t, n, r = !1, o = !1) {
|
|
3091
|
-
return new
|
|
3309
|
+
return new xi(
|
|
3092
3310
|
this,
|
|
3093
3311
|
t,
|
|
3094
3312
|
e,
|
|
@@ -3099,7 +3317,7 @@ class li {
|
|
|
3099
3317
|
}
|
|
3100
3318
|
result() {
|
|
3101
3319
|
const e = this.runtimeRef.document().clone(), t = this.runtimeRef.rootEmissions().map((n) => n.clone());
|
|
3102
|
-
return
|
|
3320
|
+
return Ke.of(
|
|
3103
3321
|
e,
|
|
3104
3322
|
t,
|
|
3105
3323
|
this.runtimeRef.totalGas()
|
|
@@ -3109,10 +3327,10 @@ class li {
|
|
|
3109
3327
|
return this.runtimeRef;
|
|
3110
3328
|
}
|
|
3111
3329
|
bundleForScope(e) {
|
|
3112
|
-
return this.bundles.get(
|
|
3330
|
+
return this.bundles.get(k(e));
|
|
3113
3331
|
}
|
|
3114
3332
|
isScopeInactive(e) {
|
|
3115
|
-
const t =
|
|
3333
|
+
const t = k(e);
|
|
3116
3334
|
return this.cutOffScopes.has(t) || this.pendingTerminations.has(t) || this.runtimeRef.isScopeTerminated(t);
|
|
3117
3335
|
}
|
|
3118
3336
|
async enterGracefulTermination(e, t, n) {
|
|
@@ -3122,13 +3340,13 @@ class li {
|
|
|
3122
3340
|
await this.terminate(e, t, "FATAL", n);
|
|
3123
3341
|
}
|
|
3124
3342
|
recordPendingTermination(e, t, n) {
|
|
3125
|
-
this.pendingTerminations.set(
|
|
3343
|
+
this.pendingTerminations.set(k(e), { kind: t, reason: n });
|
|
3126
3344
|
}
|
|
3127
3345
|
clearPendingTermination(e) {
|
|
3128
|
-
this.pendingTerminations.delete(
|
|
3346
|
+
this.pendingTerminations.delete(k(e));
|
|
3129
3347
|
}
|
|
3130
3348
|
async markCutOff(e) {
|
|
3131
|
-
const t =
|
|
3349
|
+
const t = k(e);
|
|
3132
3350
|
this.cutOffScopes.add(t) && this.runtimeRef.existingScope(t)?.markCutOff();
|
|
3133
3351
|
}
|
|
3134
3352
|
async deliverLifecycle(e, t, n, r) {
|
|
@@ -3143,13 +3361,13 @@ class li {
|
|
|
3143
3361
|
this.runtimeRef.scope(e).recordBridgeable(t.clone()), e === "/" && this.runtimeRef.recordRootEmission(t.clone());
|
|
3144
3362
|
}
|
|
3145
3363
|
normalizeScope(e) {
|
|
3146
|
-
return
|
|
3364
|
+
return k(e);
|
|
3147
3365
|
}
|
|
3148
3366
|
resolvePointer(e, t) {
|
|
3149
|
-
return
|
|
3367
|
+
return T(e, t);
|
|
3150
3368
|
}
|
|
3151
3369
|
async terminate(e, t, n, r) {
|
|
3152
|
-
const o =
|
|
3370
|
+
const o = k(e);
|
|
3153
3371
|
this.pendingTerminations.has(o) || this.runtimeRef.isScopeTerminated(o) || (this.pendingTerminations.set(o, { kind: n, reason: r }), await this.terminationService.terminateScope(
|
|
3154
3372
|
this,
|
|
3155
3373
|
e,
|
|
@@ -3159,8 +3377,8 @@ class li {
|
|
|
3159
3377
|
));
|
|
3160
3378
|
}
|
|
3161
3379
|
nodeAt(e) {
|
|
3162
|
-
const t =
|
|
3163
|
-
return
|
|
3380
|
+
const t = k(e);
|
|
3381
|
+
return te.nodeAt(this.runtimeRef.document(), t, {
|
|
3164
3382
|
calculateBlueId: (n) => this.runtimeRef.blue().calculateBlueIdSync(n)
|
|
3165
3383
|
});
|
|
3166
3384
|
}
|
|
@@ -3171,29 +3389,33 @@ class li {
|
|
|
3171
3389
|
const s = this.runtimeRef.blue().calculateBlueIdSync(r), a = r.clone(), c = e.contract(), u = c.event;
|
|
3172
3390
|
if (u && !this.runtimeRef.blue().isTypeOfNode(a, u))
|
|
3173
3391
|
return { matches: !1 };
|
|
3174
|
-
const
|
|
3392
|
+
const h = {
|
|
3175
3393
|
scopePath: n,
|
|
3176
3394
|
blue: this.runtimeRef.blue(),
|
|
3177
3395
|
event: a,
|
|
3178
3396
|
markers: t.markers(),
|
|
3179
|
-
bindingKey: e.key()
|
|
3180
|
-
|
|
3181
|
-
|
|
3397
|
+
bindingKey: e.key(),
|
|
3398
|
+
resolveChannel: (C) => t.channelEntry(C),
|
|
3399
|
+
channelProcessorFor: (C) => this.registry.lookupChannel(C) ?? null
|
|
3400
|
+
}, d = o.evaluate;
|
|
3401
|
+
if (typeof d == "function")
|
|
3402
|
+
return await d.call(o, c, h);
|
|
3403
|
+
if (!await o.matches(c, h))
|
|
3182
3404
|
return { matches: !1 };
|
|
3183
|
-
const m = o.channelize,
|
|
3405
|
+
const m = o.channelize, E = m ? m.call(o, c, h) : void 0;
|
|
3184
3406
|
return {
|
|
3185
3407
|
matches: !0,
|
|
3186
3408
|
eventId: s,
|
|
3187
|
-
eventNode:
|
|
3409
|
+
eventNode: E ?? a.clone()
|
|
3188
3410
|
};
|
|
3189
3411
|
}
|
|
3190
3412
|
async executeHandler(e, t) {
|
|
3191
3413
|
const n = this.registry.lookupHandler(e.blueId());
|
|
3192
3414
|
if (!n) {
|
|
3193
3415
|
const r = `No processor registered for handler contract ${e.blueId()}`;
|
|
3194
|
-
throw new
|
|
3416
|
+
throw new y(
|
|
3195
3417
|
r,
|
|
3196
|
-
|
|
3418
|
+
v.illegalState(r)
|
|
3197
3419
|
);
|
|
3198
3420
|
}
|
|
3199
3421
|
await n.execute(e.contract(), t);
|
|
@@ -3204,7 +3426,7 @@ class li {
|
|
|
3204
3426
|
* the outer run logic can react according to spec (§22).
|
|
3205
3427
|
*/
|
|
3206
3428
|
async handleHandlerError(e, t, n) {
|
|
3207
|
-
if (n instanceof
|
|
3429
|
+
if (n instanceof ee || n instanceof z)
|
|
3208
3430
|
throw n;
|
|
3209
3431
|
const r = this.fatalReason(n, "Runtime fatal");
|
|
3210
3432
|
await this.enterFatalTermination(e, t, r);
|
|
@@ -3213,12 +3435,12 @@ class li {
|
|
|
3213
3435
|
return e instanceof Error && typeof e.message == "string" ? e.message : t;
|
|
3214
3436
|
}
|
|
3215
3437
|
createDocumentUpdateEvent(e, t) {
|
|
3216
|
-
const n =
|
|
3217
|
-
new
|
|
3438
|
+
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(
|
|
3439
|
+
new p().setBlueId(Di)
|
|
3218
3440
|
);
|
|
3219
3441
|
return s.setProperties({
|
|
3220
|
-
op: new
|
|
3221
|
-
path: new
|
|
3442
|
+
op: new p().setValue(e.op),
|
|
3443
|
+
path: new p().setValue(n),
|
|
3222
3444
|
before: r,
|
|
3223
3445
|
after: o
|
|
3224
3446
|
}), s;
|
|
@@ -3226,17 +3448,17 @@ class li {
|
|
|
3226
3448
|
matchesDocumentUpdate(e, t, n) {
|
|
3227
3449
|
if (!t || t.length === 0)
|
|
3228
3450
|
return !1;
|
|
3229
|
-
const r = T(
|
|
3451
|
+
const r = R(T(e, t)), o = R(n);
|
|
3230
3452
|
return r === "/" || o === r ? !0 : o.startsWith(`${r}/`);
|
|
3231
3453
|
}
|
|
3232
3454
|
}
|
|
3233
|
-
class
|
|
3455
|
+
class te {
|
|
3234
3456
|
constructor(e, t, n) {
|
|
3235
3457
|
this.contractLoader = e, this.registry = t, this.blue = n;
|
|
3236
3458
|
}
|
|
3237
3459
|
async initializeDocument(e) {
|
|
3238
3460
|
if (this.isInitialized(e))
|
|
3239
|
-
throw new
|
|
3461
|
+
throw new $("Document already initialized");
|
|
3240
3462
|
const t = this.createExecution(e.clone());
|
|
3241
3463
|
return this.run(e, t, async () => {
|
|
3242
3464
|
await t.initializeScope("/", !0);
|
|
@@ -3244,7 +3466,7 @@ class X {
|
|
|
3244
3466
|
}
|
|
3245
3467
|
async processDocument(e, t) {
|
|
3246
3468
|
if (!this.isInitialized(e))
|
|
3247
|
-
throw new
|
|
3469
|
+
throw new $("Document not initialized");
|
|
3248
3470
|
const n = this.createExecution(e.clone()), r = t.clone();
|
|
3249
3471
|
return this.run(e, n, async () => {
|
|
3250
3472
|
n.loadBundles("/"), await n.processExternalEvent("/", r);
|
|
@@ -3254,7 +3476,7 @@ class X {
|
|
|
3254
3476
|
return this.initializationMarker(e) != null;
|
|
3255
3477
|
}
|
|
3256
3478
|
createExecution(e) {
|
|
3257
|
-
return new
|
|
3479
|
+
return new Bi(
|
|
3258
3480
|
this.contractLoader,
|
|
3259
3481
|
this.registry,
|
|
3260
3482
|
this.blue,
|
|
@@ -3265,11 +3487,11 @@ class X {
|
|
|
3265
3487
|
try {
|
|
3266
3488
|
await n();
|
|
3267
3489
|
} catch (r) {
|
|
3268
|
-
if (r instanceof
|
|
3490
|
+
if (r instanceof ee)
|
|
3269
3491
|
return t.result();
|
|
3270
|
-
if (r instanceof
|
|
3492
|
+
if (r instanceof z) {
|
|
3271
3493
|
const o = e.clone();
|
|
3272
|
-
return
|
|
3494
|
+
return Ke.capabilityFailure(
|
|
3273
3495
|
o,
|
|
3274
3496
|
r.message ?? null
|
|
3275
3497
|
);
|
|
@@ -3279,29 +3501,29 @@ class X {
|
|
|
3279
3501
|
return t.result();
|
|
3280
3502
|
}
|
|
3281
3503
|
initializationMarker(e) {
|
|
3282
|
-
const n = e.getProperties()?.[
|
|
3504
|
+
const n = e.getProperties()?.[Ie.OBJECT_CONTRACTS]?.getProperties()?.initialized ?? null;
|
|
3283
3505
|
if (!n)
|
|
3284
3506
|
return null;
|
|
3285
|
-
if (!(n instanceof
|
|
3286
|
-
throw new
|
|
3507
|
+
if (!(n instanceof p))
|
|
3508
|
+
throw new y(
|
|
3287
3509
|
"Initialization Marker must be a BlueNode",
|
|
3288
|
-
|
|
3510
|
+
v.illegalState(
|
|
3289
3511
|
"Initialization Marker must be a BlueNode"
|
|
3290
3512
|
)
|
|
3291
3513
|
);
|
|
3292
|
-
if (n.getType()?.getBlueId() !==
|
|
3293
|
-
throw new
|
|
3514
|
+
if (n.getType()?.getBlueId() !== Ai)
|
|
3515
|
+
throw new y(
|
|
3294
3516
|
"Initialization Marker must declare type 'Processing Initialized Marker'",
|
|
3295
|
-
|
|
3517
|
+
v.illegalState(
|
|
3296
3518
|
"Initialization Marker must declare type 'Processing Initialized Marker'"
|
|
3297
3519
|
)
|
|
3298
3520
|
);
|
|
3299
3521
|
return n;
|
|
3300
3522
|
}
|
|
3301
3523
|
static nodeAt(e, t, n) {
|
|
3302
|
-
if (!(e instanceof
|
|
3524
|
+
if (!(e instanceof p))
|
|
3303
3525
|
return null;
|
|
3304
|
-
const r =
|
|
3526
|
+
const r = R(t);
|
|
3305
3527
|
if (r === "/")
|
|
3306
3528
|
return e;
|
|
3307
3529
|
const o = r.slice(1).split("/");
|
|
@@ -3313,21 +3535,21 @@ class X {
|
|
|
3313
3535
|
continue;
|
|
3314
3536
|
const c = s.getItems();
|
|
3315
3537
|
if (c && /^\d+$/.test(a)) {
|
|
3316
|
-
const
|
|
3317
|
-
s = c[
|
|
3538
|
+
const d = Number.parseInt(a, 10);
|
|
3539
|
+
s = c[d] ?? null;
|
|
3318
3540
|
continue;
|
|
3319
3541
|
}
|
|
3320
3542
|
const u = s.getProperties();
|
|
3321
3543
|
if (u && a in u) {
|
|
3322
|
-
const
|
|
3323
|
-
if (!(
|
|
3544
|
+
const d = u[a];
|
|
3545
|
+
if (!(d instanceof p))
|
|
3324
3546
|
return null;
|
|
3325
|
-
s =
|
|
3547
|
+
s = d;
|
|
3326
3548
|
continue;
|
|
3327
3549
|
}
|
|
3328
|
-
const
|
|
3329
|
-
if (
|
|
3330
|
-
s =
|
|
3550
|
+
const h = this.specialSegmentNode(s, a, n);
|
|
3551
|
+
if (h !== void 0) {
|
|
3552
|
+
s = h;
|
|
3331
3553
|
continue;
|
|
3332
3554
|
}
|
|
3333
3555
|
return null;
|
|
@@ -3337,9 +3559,9 @@ class X {
|
|
|
3337
3559
|
static specialSegmentNode(e, t, n) {
|
|
3338
3560
|
switch (t) {
|
|
3339
3561
|
case "name":
|
|
3340
|
-
return new
|
|
3562
|
+
return new p().setValue(e.getName() ?? null);
|
|
3341
3563
|
case "description":
|
|
3342
|
-
return new
|
|
3564
|
+
return new p().setValue(e.getDescription() ?? null);
|
|
3343
3565
|
case "type":
|
|
3344
3566
|
return e.getType() ?? null;
|
|
3345
3567
|
case "itemType":
|
|
@@ -3349,21 +3571,21 @@ class X {
|
|
|
3349
3571
|
case "valueType":
|
|
3350
3572
|
return e.getValueType() ?? null;
|
|
3351
3573
|
case "value":
|
|
3352
|
-
return new
|
|
3574
|
+
return new p().setValue(e.getValue() ?? null);
|
|
3353
3575
|
case "blue":
|
|
3354
3576
|
return e.getBlue() ?? null;
|
|
3355
|
-
case
|
|
3356
|
-
return new
|
|
3577
|
+
case Ie.OBJECT_CONTRACTS:
|
|
3578
|
+
return new p().setContracts(e.getContracts());
|
|
3357
3579
|
case "blueId": {
|
|
3358
|
-
const r = e.getBlueId() ?? n?.calculateBlueId?.(e) ??
|
|
3359
|
-
return new
|
|
3580
|
+
const r = e.getBlueId() ?? n?.calculateBlueId?.(e) ?? Rt.calculateBlueIdSync(e);
|
|
3581
|
+
return new p().setValue(r ?? null);
|
|
3360
3582
|
}
|
|
3361
3583
|
default:
|
|
3362
3584
|
return;
|
|
3363
3585
|
}
|
|
3364
3586
|
}
|
|
3365
3587
|
}
|
|
3366
|
-
class
|
|
3588
|
+
class xi {
|
|
3367
3589
|
constructor(e, t, n, r, o, s) {
|
|
3368
3590
|
this.execution = e, this.bundle = t, this.scopePathValue = n, this.eventNode = r, this.allowTerminatedWork = o, this.allowReservedMutation = s;
|
|
3369
3591
|
}
|
|
@@ -3399,7 +3621,7 @@ class ui {
|
|
|
3399
3621
|
this.shouldSkipTerminatedWork() || this.execution.runtime().addGas(e);
|
|
3400
3622
|
}
|
|
3401
3623
|
throwFatal(e) {
|
|
3402
|
-
throw new
|
|
3624
|
+
throw new y(e, v.runtimeFatal(e));
|
|
3403
3625
|
}
|
|
3404
3626
|
resolvePointer(e) {
|
|
3405
3627
|
return this.execution.resolvePointer(this.scopePathValue, e);
|
|
@@ -3418,7 +3640,7 @@ class ui {
|
|
|
3418
3640
|
if (!e)
|
|
3419
3641
|
return !1;
|
|
3420
3642
|
try {
|
|
3421
|
-
return
|
|
3643
|
+
return te.nodeAt(
|
|
3422
3644
|
this.execution.runtime().document(),
|
|
3423
3645
|
e,
|
|
3424
3646
|
{
|
|
@@ -3430,14 +3652,14 @@ class ui {
|
|
|
3430
3652
|
}
|
|
3431
3653
|
}
|
|
3432
3654
|
documentNodeAt(e) {
|
|
3433
|
-
const t =
|
|
3655
|
+
const t = te.nodeAt(
|
|
3434
3656
|
this.execution.runtime().document(),
|
|
3435
3657
|
e,
|
|
3436
3658
|
{
|
|
3437
3659
|
calculateBlueId: (n) => this.execution.runtime().blue().calculateBlueIdSync(n)
|
|
3438
3660
|
}
|
|
3439
3661
|
);
|
|
3440
|
-
return t instanceof
|
|
3662
|
+
return t instanceof p ? t : null;
|
|
3441
3663
|
}
|
|
3442
3664
|
async terminateGracefully(e) {
|
|
3443
3665
|
await this.execution.enterGracefulTermination(
|
|
@@ -3457,16 +3679,16 @@ class ui {
|
|
|
3457
3679
|
return !this.allowTerminatedWork && this.execution.isScopeInactive(this.scopePathValue);
|
|
3458
3680
|
}
|
|
3459
3681
|
}
|
|
3460
|
-
const
|
|
3461
|
-
repositories: [
|
|
3682
|
+
const _i = new Pt({
|
|
3683
|
+
repositories: [Mt]
|
|
3462
3684
|
});
|
|
3463
|
-
class
|
|
3685
|
+
class Li {
|
|
3464
3686
|
blue;
|
|
3465
3687
|
registryRef;
|
|
3466
3688
|
contractLoaderRef;
|
|
3467
3689
|
engine;
|
|
3468
3690
|
constructor(e) {
|
|
3469
|
-
this.registryRef = e?.registry ??
|
|
3691
|
+
this.registryRef = e?.registry ?? oe.create().registerDefaults().build(), this.blue = e?.blue ?? _i, this.contractLoaderRef = new Ur(this.registryRef, this.blue), this.engine = new te(
|
|
3470
3692
|
this.contractLoaderRef,
|
|
3471
3693
|
this.registryRef,
|
|
3472
3694
|
this.blue
|
|
@@ -3499,14 +3721,14 @@ class hi {
|
|
|
3499
3721
|
return this.contractLoaderRef;
|
|
3500
3722
|
}
|
|
3501
3723
|
static builder() {
|
|
3502
|
-
return new
|
|
3724
|
+
return new Fi();
|
|
3503
3725
|
}
|
|
3504
3726
|
}
|
|
3505
|
-
class
|
|
3727
|
+
class Fi {
|
|
3506
3728
|
contractRegistry;
|
|
3507
3729
|
blueInstance;
|
|
3508
3730
|
constructor() {
|
|
3509
|
-
this.contractRegistry =
|
|
3731
|
+
this.contractRegistry = oe.create().registerDefaults().build();
|
|
3510
3732
|
}
|
|
3511
3733
|
withRegistry(e) {
|
|
3512
3734
|
return this.contractRegistry = e, this;
|
|
@@ -3518,16 +3740,16 @@ class pi {
|
|
|
3518
3740
|
return this.blueInstance = e, this;
|
|
3519
3741
|
}
|
|
3520
3742
|
build() {
|
|
3521
|
-
return new
|
|
3743
|
+
return new Li({
|
|
3522
3744
|
registry: this.contractRegistry,
|
|
3523
3745
|
blue: this.blueInstance
|
|
3524
3746
|
});
|
|
3525
3747
|
}
|
|
3526
3748
|
}
|
|
3527
|
-
class
|
|
3749
|
+
class St {
|
|
3528
3750
|
process(e, t) {
|
|
3529
3751
|
const n = t.getValue();
|
|
3530
|
-
if (
|
|
3752
|
+
if (Y(n)) {
|
|
3531
3753
|
const r = t.clone();
|
|
3532
3754
|
return r.setValue(n), r.setProperties(void 0), r.setItems(void 0), r.setType(void 0), r;
|
|
3533
3755
|
}
|
|
@@ -3538,123 +3760,124 @@ class dt {
|
|
|
3538
3760
|
*/
|
|
3539
3761
|
postProcess(e, t) {
|
|
3540
3762
|
const n = t.getValue();
|
|
3541
|
-
if (
|
|
3763
|
+
if (Y(n) && e.getValue() !== n && n !== void 0) {
|
|
3542
3764
|
const r = e.clone();
|
|
3543
3765
|
return r.setValue(n), r;
|
|
3544
3766
|
}
|
|
3545
3767
|
return e;
|
|
3546
3768
|
}
|
|
3547
3769
|
}
|
|
3548
|
-
const
|
|
3770
|
+
const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3549
3771
|
__proto__: null,
|
|
3550
|
-
ExpressionPreserver:
|
|
3772
|
+
ExpressionPreserver: St
|
|
3551
3773
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3552
|
-
function
|
|
3553
|
-
return new
|
|
3554
|
-
new
|
|
3555
|
-
new
|
|
3556
|
-
new
|
|
3557
|
-
new
|
|
3558
|
-
new
|
|
3559
|
-
new
|
|
3774
|
+
function co() {
|
|
3775
|
+
return new L.SequentialMergingProcessor([
|
|
3776
|
+
new L.ValuePropagator(),
|
|
3777
|
+
new St(),
|
|
3778
|
+
new L.TypeAssigner(),
|
|
3779
|
+
new L.ListProcessor(),
|
|
3780
|
+
new L.DictionaryProcessor(),
|
|
3781
|
+
new L.BasicTypesVerifier()
|
|
3560
3782
|
]);
|
|
3561
3783
|
}
|
|
3562
3784
|
export {
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3785
|
+
Sr as ChannelBinding,
|
|
3786
|
+
Wr as ChannelRunner,
|
|
3787
|
+
Kr as CheckpointManager,
|
|
3788
|
+
Hr as CheckpointRecord,
|
|
3789
|
+
ot as CodeBlockEvaluationError,
|
|
3790
|
+
V as ContractBundle,
|
|
3791
|
+
wr as ContractBundleBuilder,
|
|
3792
|
+
Ur as ContractLoader,
|
|
3793
|
+
qn as ContractProcessorRegistry,
|
|
3794
|
+
oe as ContractProcessorRegistryBuilder,
|
|
3795
|
+
Ke as DocumentProcessingResult,
|
|
3796
|
+
Oi as DocumentProcessingRuntime,
|
|
3797
|
+
Li as DocumentProcessor,
|
|
3798
|
+
Fi as DocumentProcessorBuilder,
|
|
3799
|
+
ui as EmissionRegistry,
|
|
3800
|
+
Ni as GasMeter,
|
|
3801
|
+
vr as HandlerBinding,
|
|
3802
|
+
A as KEY_CHECKPOINT,
|
|
3803
|
+
We as KEY_EMBEDDED,
|
|
3804
|
+
Ge as KEY_INITIALIZED,
|
|
3805
|
+
qe as KEY_TERMINATED,
|
|
3806
|
+
ao as MergingProcessors,
|
|
3807
|
+
je as PROCESSOR_MANAGED_CHANNEL_BLUE_IDS,
|
|
3808
|
+
oi as PatchEngine,
|
|
3809
|
+
no as ProcessorContractConstants,
|
|
3810
|
+
te as ProcessorEngine,
|
|
3811
|
+
v as ProcessorErrors,
|
|
3812
|
+
Bi as ProcessorExecution,
|
|
3813
|
+
xi as ProcessorExecutionContext,
|
|
3814
|
+
y as ProcessorFatalError,
|
|
3815
|
+
ro as ProcessorPointerConstants,
|
|
3816
|
+
Ce as QuickJSEvaluator,
|
|
3817
|
+
Qe as RELATIVE_CHECKPOINT,
|
|
3818
|
+
H as RELATIVE_CONTRACTS,
|
|
3819
|
+
Lt as RELATIVE_EMBEDDED,
|
|
3820
|
+
de as RELATIVE_INITIALIZED,
|
|
3821
|
+
Je as RELATIVE_TERMINATED,
|
|
3822
|
+
Ee as RESERVED_CONTRACT_KEYS,
|
|
3823
|
+
ee as RunTerminationError,
|
|
3824
|
+
Yr as ScopeExecutor,
|
|
3825
|
+
li as ScopeRuntimeContext,
|
|
3826
|
+
ti as TerminationService,
|
|
3827
|
+
Yi as andThen,
|
|
3828
|
+
nt as canonicalSignature,
|
|
3829
|
+
Me as canonicalSize,
|
|
3830
|
+
_ as channelContractBaseSchema,
|
|
3831
|
+
kn as channelEventCheckpointSchema,
|
|
3832
|
+
dt as compositeTimelineChannelSchema,
|
|
3833
|
+
sn as containsExpression,
|
|
3834
|
+
Se as contractBaseSchema,
|
|
3835
|
+
co as createDefaultMergingProcessor,
|
|
3836
|
+
ct as createPicomatchShouldResolve,
|
|
3837
|
+
Dn as documentAnchorsMarkerSchema,
|
|
3838
|
+
_n as documentLinksMarkerSchema,
|
|
3839
|
+
hn as documentUpdateChannelSchema,
|
|
3840
|
+
pn as embeddedNodeChannelSchema,
|
|
3841
|
+
Ot as err,
|
|
3842
|
+
at as evaluateQuickJSExpression,
|
|
3843
|
+
an as extractExpressionContent,
|
|
3844
|
+
ut as handlerContractBaseSchema,
|
|
3845
|
+
In as initializationMarkerSchema,
|
|
3846
|
+
Ji as isErr,
|
|
3847
|
+
Y as isExpression,
|
|
3848
|
+
ji as isOk,
|
|
3849
|
+
ye as isProcessorManagedChannelBlueId,
|
|
3850
|
+
_t as isReservedContractKey,
|
|
3851
|
+
io as joinRelativePointers,
|
|
3852
|
+
oo as jsonPatchSchema,
|
|
3853
|
+
fn as lifecycleChannelSchema,
|
|
3854
|
+
Qi as map,
|
|
3855
|
+
Xi as mapErr,
|
|
3856
|
+
N as markerContractBaseSchema,
|
|
3857
|
+
to as match,
|
|
3858
|
+
Fn as myosParticipantsOrchestrationMarkerSchema,
|
|
3859
|
+
$n as myosSessionInteractionMarkerSchema,
|
|
3860
|
+
Sn as myosTimelineChannelSchema,
|
|
3861
|
+
Vn as myosWorkerAgencyMarkerSchema,
|
|
3862
|
+
R as normalizePointer,
|
|
3863
|
+
k as normalizeScope,
|
|
3864
|
+
Nt as ok,
|
|
3865
|
+
Nn as operationMarkerSchema,
|
|
3866
|
+
Rn as processEmbeddedMarkerSchema,
|
|
3867
|
+
Mn as processingTerminatedMarkerSchema,
|
|
3868
|
+
Ze as relativeCheckpointLastEvent,
|
|
3869
|
+
et as relativeCheckpointLastSignature,
|
|
3870
|
+
ne as relativeContractsEntry,
|
|
3871
|
+
Ft as relativizePointer,
|
|
3872
|
+
Z as resolveNodeExpressions,
|
|
3873
|
+
T as resolvePointer,
|
|
3874
|
+
cn as resolveTemplateString,
|
|
3875
|
+
Wn as sequentialWorkflowOperationSchema,
|
|
3876
|
+
Hn as sequentialWorkflowSchema,
|
|
3877
|
+
so as sequentialWorkflowStepSchema,
|
|
3878
|
+
Re as stripSlashes,
|
|
3879
|
+
yn as timelineChannelSchema,
|
|
3880
|
+
En as triggeredEventChannelSchema,
|
|
3881
|
+
Zi as unwrapOr,
|
|
3882
|
+
eo as unwrapOrElse
|
|
3660
3883
|
};
|