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