@blue-labs/document-processor 2.0.0-rc.2 → 2.0.0-rc.21
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/constants/processor-contract-constants.d.ts +2 -2
- package/dist/constants/processor-contract-constants.d.ts.map +1 -1
- package/dist/engine/channel-runner.d.ts +5 -2
- package/dist/engine/channel-runner.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/external-event.d.ts +3 -0
- package/dist/engine/external-event.d.ts.map +1 -0
- package/dist/engine/processor-engine.d.ts +4 -1
- package/dist/engine/processor-engine.d.ts.map +1 -1
- package/dist/engine/processor-execution-context.d.ts.map +1 -1
- package/dist/engine/scope-executor.d.ts +1 -0
- package/dist/engine/scope-executor.d.ts.map +1 -1
- package/dist/index.js +1480 -1153
- package/dist/model/channels/document-update-channel.d.ts +4 -0
- package/dist/model/channels/document-update-channel.d.ts.map +1 -1
- package/dist/model/channels/embedded-node-channel.d.ts +4 -0
- package/dist/model/channels/embedded-node-channel.d.ts.map +1 -1
- package/dist/model/channels/lifecycle-channel.d.ts +4 -0
- package/dist/model/channels/lifecycle-channel.d.ts.map +1 -1
- package/dist/model/channels/myos-timeline-channel.d.ts +4 -0
- package/dist/model/channels/myos-timeline-channel.d.ts.map +1 -1
- package/dist/model/channels/timeline-channel.d.ts +4 -0
- package/dist/model/channels/timeline-channel.d.ts.map +1 -1
- package/dist/model/channels/triggered-event-channel.d.ts +4 -0
- package/dist/model/channels/triggered-event-channel.d.ts.map +1 -1
- package/dist/model/handlers/sequential-workflow-operation.d.ts +2 -2
- package/dist/model/handlers/sequential-workflow-operation.d.ts.map +1 -1
- package/dist/model/handlers/sequential-workflow.d.ts +2 -2
- package/dist/model/handlers/sequential-workflow.d.ts.map +1 -1
- package/dist/model/markers/document-anchors.d.ts +23 -0
- package/dist/model/markers/document-anchors.d.ts.map +1 -0
- package/dist/model/markers/document-links.d.ts +23 -0
- package/dist/model/markers/document-links.d.ts.map +1 -0
- package/dist/model/markers/index.d.ts +5 -0
- package/dist/model/markers/index.d.ts.map +1 -1
- package/dist/model/markers/myos-participants-orchestration.d.ts +25 -0
- package/dist/model/markers/myos-participants-orchestration.d.ts.map +1 -0
- package/dist/model/markers/myos-session-interaction.d.ts +25 -0
- package/dist/model/markers/myos-session-interaction.d.ts.map +1 -0
- package/dist/model/markers/myos-worker-agency.d.ts +25 -0
- package/dist/model/markers/myos-worker-agency.d.ts.map +1 -0
- package/dist/model/shared/channel-contract-base.d.ts +3 -0
- package/dist/model/shared/channel-contract-base.d.ts.map +1 -1
- package/dist/model/shared/handler-contract-base.d.ts +2 -2
- package/dist/model/types.d.ts +2 -2
- package/dist/model/types.d.ts.map +1 -1
- package/dist/registry/processors/myos-timeline-channel-processor.d.ts +6 -1
- package/dist/registry/processors/myos-timeline-channel-processor.d.ts.map +1 -1
- package/dist/registry/processors/operation-marker-processor.d.ts.map +1 -1
- package/dist/registry/processors/sequential-workflow-operation-processor.d.ts +2 -2
- package/dist/registry/processors/sequential-workflow-operation-processor.d.ts.map +1 -1
- package/dist/registry/processors/sequential-workflow-processor.d.ts +2 -2
- package/dist/registry/processors/sequential-workflow-processor.d.ts.map +1 -1
- package/dist/registry/processors/shared/timeline-recency.d.ts +3 -0
- package/dist/registry/processors/shared/timeline-recency.d.ts.map +1 -0
- package/dist/registry/processors/steps/javascript-code-step-executor.d.ts +1 -1
- package/dist/registry/processors/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 +6 -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/registry/types.d.ts +5 -0
- package/dist/registry/types.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/dist/util/expression/quickjs-expression-utils.d.ts +2 -0
- package/dist/util/expression/quickjs-expression-utils.d.ts.map +1 -1
- package/package.json +5 -7
package/dist/index.js
CHANGED
|
@@ -1,42 +1,40 @@
|
|
|
1
|
-
import { blueIds as p, ContractSchema as Xe, ChannelSchema as et, HandlerSchema as tt, MarkerSchema as nt, DocumentUpdateChannelSchema as rt, EmbeddedNodeChannelSchema as it, LifecycleEventChannelSchema as st, TriggeredEventChannelSchema as ot, ChannelEventCheckpointSchema as at, ProcessingInitializedMarkerSchema as ct, ProcessEmbeddedSchema as lt, ProcessingTerminatedMarkerSchema as ut, repository as dt } from "@blue-repository/core";
|
|
2
1
|
import { getQuickJS as ht } from "quickjs-emscripten";
|
|
3
|
-
import { BlueNode as
|
|
4
|
-
import
|
|
5
|
-
import { z as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
function Ct(i) {
|
|
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 g = {
|
|
|
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 vt = {
|
|
|
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
|
-
p["Document Update Channel"],
|
|
88
|
-
p["Triggered Event Channel"],
|
|
89
|
-
p["Lifecycle Event Channel"],
|
|
90
|
-
p["Embedded Node Channel"]
|
|
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 ge(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 Mt(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,37 +271,37 @@ function Ft(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() {
|
|
@@ -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,222 +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
|
-
const
|
|
495
|
-
function
|
|
496
|
-
return i.length <=
|
|
509
|
+
const be = 120;
|
|
510
|
+
function xt(i) {
|
|
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
|
|
504
|
-
function
|
|
505
|
-
if (typeof i != "string" || !
|
|
518
|
+
const Xe = /^\$\{([\s\S]*)\}$/, _t = /\$\{([\s\S]+?)\}/, Ze = /\$\{([\s\S]+?)\}/g;
|
|
519
|
+
function G(i) {
|
|
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
|
|
514
|
-
if (!
|
|
528
|
+
function Ut(i) {
|
|
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,
|
|
573
|
+
shouldDescend: o = () => !0,
|
|
558
574
|
context: s,
|
|
559
|
-
pointer:
|
|
560
|
-
} = i,
|
|
561
|
-
if (c
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
575
|
+
pointer: a = "/"
|
|
576
|
+
} = i, c = t.clone();
|
|
577
|
+
if (!o(a, c))
|
|
578
|
+
return c;
|
|
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(
|
|
567
586
|
e,
|
|
568
|
-
|
|
587
|
+
m,
|
|
569
588
|
n
|
|
570
589
|
);
|
|
571
|
-
return s.blue.jsonValueToNode(
|
|
572
|
-
} else if (
|
|
573
|
-
const
|
|
574
|
-
let
|
|
575
|
-
for (
|
|
576
|
-
|
|
577
|
-
s.gasMeter().chargeTemplate(
|
|
578
|
-
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(
|
|
579
598
|
e,
|
|
580
|
-
|
|
599
|
+
u,
|
|
581
600
|
n
|
|
582
601
|
);
|
|
583
|
-
return new
|
|
602
|
+
return new h().setValue(P);
|
|
584
603
|
}
|
|
585
604
|
}
|
|
586
|
-
return
|
|
605
|
+
return c;
|
|
587
606
|
}
|
|
588
|
-
const
|
|
589
|
-
if (Array.isArray(
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
(
|
|
607
|
+
const d = c.getItems?.();
|
|
608
|
+
if (Array.isArray(d)) {
|
|
609
|
+
const m = await Promise.all(
|
|
610
|
+
d.map(
|
|
611
|
+
(y, P) => Q({
|
|
593
612
|
...i,
|
|
594
|
-
node:
|
|
595
|
-
pointer: `${
|
|
613
|
+
node: y,
|
|
614
|
+
pointer: `${a}/${P}`
|
|
596
615
|
})
|
|
597
616
|
)
|
|
598
617
|
);
|
|
599
|
-
return
|
|
600
|
-
}
|
|
601
|
-
const
|
|
602
|
-
if (
|
|
603
|
-
const
|
|
604
|
-
for (const [
|
|
605
|
-
const
|
|
606
|
-
|
|
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({
|
|
607
626
|
...i,
|
|
608
|
-
node:
|
|
609
|
-
pointer:
|
|
627
|
+
node: P,
|
|
628
|
+
pointer: re
|
|
610
629
|
});
|
|
611
630
|
}
|
|
612
|
-
|
|
613
|
-
}
|
|
614
|
-
return
|
|
615
|
-
}
|
|
616
|
-
const
|
|
617
|
-
|
|
631
|
+
c.setProperties(m);
|
|
632
|
+
}
|
|
633
|
+
return c;
|
|
634
|
+
}
|
|
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
|
|
618
645
|
).extend({
|
|
619
|
-
path:
|
|
620
|
-
definition:
|
|
621
|
-
}),
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
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
|
|
627
662
|
).superRefine((i, e) => {
|
|
628
663
|
i.op === "REMOVE" && i.val !== void 0 && e.addIssue({
|
|
629
|
-
code:
|
|
664
|
+
code: l.ZodIssueCode.custom,
|
|
630
665
|
message: "REMOVE operations cannot include a value",
|
|
631
666
|
path: ["val"]
|
|
632
667
|
}), i.op !== "REMOVE" && i.val === void 0 && e.addIssue({
|
|
633
|
-
code:
|
|
668
|
+
code: l.ZodIssueCode.custom,
|
|
634
669
|
message: `${i.op} operations must include a value`,
|
|
635
670
|
path: ["val"]
|
|
636
671
|
});
|
|
637
|
-
}),
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
),
|
|
642
|
-
|
|
643
|
-
),
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
})
|
|
648
|
-
|
|
649
|
-
),
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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
|
|
655
788
|
).extend({
|
|
656
|
-
steps:
|
|
789
|
+
steps: l.array(v()).optional()
|
|
657
790
|
});
|
|
658
|
-
function
|
|
791
|
+
function kn(i) {
|
|
659
792
|
if (!Array.isArray(i.blueIds) || i.blueIds.length === 0)
|
|
660
793
|
throw new Error("Contract processors must declare at least one BlueId");
|
|
661
794
|
for (const e of i.blueIds)
|
|
662
795
|
if (typeof e != "string" || e.trim().length === 0)
|
|
663
796
|
throw new Error("Contract processor BlueIds must be non-empty strings");
|
|
664
797
|
}
|
|
665
|
-
function
|
|
666
|
-
|
|
798
|
+
function j(i, e) {
|
|
799
|
+
kn(i);
|
|
667
800
|
for (const t of i.blueIds)
|
|
668
801
|
e.set(t, i);
|
|
669
802
|
}
|
|
670
|
-
class
|
|
803
|
+
class Tn {
|
|
671
804
|
processorsByBlueId = /* @__PURE__ */ new Map();
|
|
672
805
|
handlerProcessors = /* @__PURE__ */ new Map();
|
|
673
806
|
channelProcessors = /* @__PURE__ */ new Map();
|
|
674
807
|
markerProcessors = /* @__PURE__ */ new Map();
|
|
675
808
|
registerHandler(e) {
|
|
676
|
-
|
|
809
|
+
j(e, this.handlerProcessors), this.registerProcessorMap(e);
|
|
677
810
|
}
|
|
678
811
|
registerChannel(e) {
|
|
679
|
-
|
|
812
|
+
j(e, this.channelProcessors), this.registerProcessorMap(e);
|
|
680
813
|
}
|
|
681
814
|
registerMarker(e) {
|
|
682
|
-
|
|
815
|
+
j(e, this.markerProcessors), this.registerProcessorMap(e);
|
|
683
816
|
}
|
|
684
817
|
register(e) {
|
|
685
818
|
switch (e.kind) {
|
|
@@ -713,49 +846,96 @@ class ln {
|
|
|
713
846
|
return new Map(this.processorsByBlueId);
|
|
714
847
|
}
|
|
715
848
|
registerProcessorMap(e) {
|
|
716
|
-
|
|
717
|
-
}
|
|
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);
|
|
881
|
+
if (!n || !r)
|
|
882
|
+
return !0;
|
|
883
|
+
const o = n.timestamp, s = r.timestamp;
|
|
884
|
+
return typeof o != "number" || typeof s != "number" ? !0 : o >= s;
|
|
718
885
|
}
|
|
719
|
-
function
|
|
720
|
-
return i.isTypeOf(e,
|
|
886
|
+
function Ie(i, e) {
|
|
887
|
+
return i.isTypeOf(e, ke) ? i.nodeToSchemaOutput(e, ke) : i.isTypeOf(e, I) ? i.nodeToSchemaOutput(e, I) : null;
|
|
721
888
|
}
|
|
722
|
-
class
|
|
889
|
+
class Pn {
|
|
723
890
|
kind = "channel";
|
|
724
|
-
blueIds = [
|
|
891
|
+
blueIds = [b["MyOS/MyOS Timeline Channel"]];
|
|
725
892
|
schema = Xt;
|
|
726
893
|
matches(e, t) {
|
|
727
894
|
const { event: n, blue: r } = t;
|
|
728
895
|
if (!n)
|
|
729
896
|
return !1;
|
|
730
|
-
const
|
|
731
|
-
if (!
|
|
897
|
+
const o = Ie(r, n);
|
|
898
|
+
if (!o)
|
|
732
899
|
return !1;
|
|
733
|
-
const
|
|
734
|
-
return !
|
|
900
|
+
const s = o.timeline?.timelineId;
|
|
901
|
+
return !s || !e.timelineId ? !1 : s === e.timelineId;
|
|
735
902
|
}
|
|
736
903
|
channelize(e, t) {
|
|
737
904
|
const { event: n, blue: r } = t;
|
|
738
|
-
return !n || !
|
|
905
|
+
return !n || !Ie(r, n) ? null : n.clone();
|
|
906
|
+
}
|
|
907
|
+
isNewerEvent(e, t, n) {
|
|
908
|
+
const { event: r, blue: o } = t;
|
|
909
|
+
return r ? at(o, r, n) : !0;
|
|
739
910
|
}
|
|
740
911
|
}
|
|
741
|
-
class
|
|
912
|
+
class Mn {
|
|
742
913
|
kind = "channel";
|
|
743
|
-
blueIds = [
|
|
744
|
-
schema =
|
|
914
|
+
blueIds = [S["Conversation/Timeline Channel"]];
|
|
915
|
+
schema = Qt;
|
|
745
916
|
matches(e, t) {
|
|
746
917
|
const { event: n, blue: r } = t;
|
|
747
|
-
if (!n || !r.isTypeOf(n,
|
|
918
|
+
if (!n || !r.isTypeOf(n, I))
|
|
748
919
|
return !1;
|
|
749
|
-
const
|
|
750
|
-
return !(!
|
|
920
|
+
const s = r.nodeToSchemaOutput(n, I).timeline?.timelineId;
|
|
921
|
+
return !(!s || !e.timelineId || s !== e.timelineId);
|
|
751
922
|
}
|
|
752
923
|
channelize(e, t) {
|
|
753
924
|
const { event: n, blue: r } = t;
|
|
754
|
-
return !n || !r.isTypeOf(n,
|
|
925
|
+
return !n || !r.isTypeOf(n, I) ? null : n.clone();
|
|
926
|
+
}
|
|
927
|
+
isNewerEvent(e, t, n) {
|
|
928
|
+
const { event: r, blue: o } = t;
|
|
929
|
+
return r ? at(o, r, n) : !0;
|
|
755
930
|
}
|
|
756
931
|
}
|
|
757
|
-
|
|
758
|
-
|
|
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);
|
|
759
939
|
return {
|
|
760
940
|
event: e.blue.nodeToJson(t, "simple"),
|
|
761
941
|
eventCanonical: e.blue.nodeToJson(t, "official"),
|
|
@@ -763,71 +943,94 @@ function ce(i) {
|
|
|
763
943
|
document: r
|
|
764
944
|
};
|
|
765
945
|
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
946
|
+
const Nn = /* @__PURE__ */ new Set(["blueId", "name", "description", "value"]);
|
|
947
|
+
function On(i) {
|
|
948
|
+
const e = (o) => {
|
|
949
|
+
if (o === "/")
|
|
950
|
+
return !1;
|
|
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 : (() => {
|
|
769
955
|
throw new TypeError("document() expects a string pointer");
|
|
770
|
-
})(),
|
|
771
|
-
return i.gasMeter().chargeDocumentSnapshot(
|
|
772
|
-
},
|
|
773
|
-
const { snapshot:
|
|
774
|
-
if (
|
|
775
|
-
return i.blue.nodeToJson(
|
|
776
|
-
},
|
|
777
|
-
return
|
|
778
|
-
}
|
|
779
|
-
class
|
|
780
|
-
supportedBlueIds = [
|
|
781
|
-
|
|
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);
|
|
960
|
+
if (a)
|
|
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;
|
|
964
|
+
}
|
|
965
|
+
class An {
|
|
966
|
+
supportedBlueIds = [
|
|
967
|
+
S["Conversation/Trigger Event"]
|
|
968
|
+
];
|
|
969
|
+
evaluator = new pe();
|
|
782
970
|
async execute(e) {
|
|
783
971
|
const { stepNode: t, context: n } = e;
|
|
784
|
-
if (!n.blue.isTypeOf(t,
|
|
972
|
+
if (!n.blue.isTypeOf(t, Re))
|
|
785
973
|
return n.throwFatal("Trigger Event step payload is invalid");
|
|
786
974
|
n.gasMeter().chargeTriggerEventBase();
|
|
787
|
-
const r = await
|
|
975
|
+
const r = await Q({
|
|
788
976
|
evaluator: this.evaluator,
|
|
789
977
|
node: t,
|
|
790
|
-
bindings:
|
|
791
|
-
shouldResolve:
|
|
978
|
+
bindings: me(e),
|
|
979
|
+
shouldResolve: tt({
|
|
792
980
|
include: ["/event", "/event/**"]
|
|
793
981
|
}),
|
|
982
|
+
shouldDescend: Dn(),
|
|
794
983
|
context: n
|
|
795
|
-
}),
|
|
984
|
+
}), s = n.blue.nodeToSchemaOutput(
|
|
796
985
|
r,
|
|
797
|
-
|
|
986
|
+
Re
|
|
798
987
|
).event;
|
|
799
|
-
if (
|
|
988
|
+
if (ae(s))
|
|
800
989
|
return n.throwFatal(
|
|
801
990
|
"Trigger Event step must declare event payload"
|
|
802
991
|
);
|
|
803
|
-
n.emitEvent(
|
|
992
|
+
n.emitEvent(s.clone());
|
|
804
993
|
}
|
|
805
994
|
}
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
995
|
+
function Dn() {
|
|
996
|
+
return (i, e) => i === "/event" || !i.startsWith("/event/") ? !0 : !Bn(e);
|
|
997
|
+
}
|
|
998
|
+
function Bn(i) {
|
|
999
|
+
const e = i.getProperties?.();
|
|
1000
|
+
return e ? !!e.contracts : !1;
|
|
1001
|
+
}
|
|
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();
|
|
809
1012
|
async execute(e) {
|
|
810
1013
|
const { context: t, stepNode: n } = e, { blue: r } = t;
|
|
811
|
-
if (!r.isTypeOf(n,
|
|
1014
|
+
if (!r.isTypeOf(n, Pe))
|
|
812
1015
|
return t.throwFatal("JavaScript Code step payload is invalid");
|
|
813
|
-
const
|
|
1016
|
+
const s = r.nodeToSchemaOutput(
|
|
814
1017
|
n,
|
|
815
|
-
|
|
1018
|
+
Pe
|
|
816
1019
|
).code;
|
|
817
|
-
if (!
|
|
1020
|
+
if (!s)
|
|
818
1021
|
return t.throwFatal(
|
|
819
1022
|
"JavaScript Code step must include code to execute"
|
|
820
1023
|
);
|
|
821
|
-
t.gasMeter().chargeJavaScriptCodeBase(
|
|
822
|
-
const a =
|
|
1024
|
+
t.gasMeter().chargeJavaScriptCodeBase(s);
|
|
1025
|
+
const a = me(e);
|
|
823
1026
|
try {
|
|
824
1027
|
const c = await this.evaluator.evaluate({
|
|
825
|
-
code:
|
|
1028
|
+
code: s,
|
|
826
1029
|
bindings: a
|
|
827
1030
|
});
|
|
828
1031
|
return this.handleEvents(c, t), c;
|
|
829
1032
|
} catch (c) {
|
|
830
|
-
throw new
|
|
1033
|
+
throw new Ye(s, c);
|
|
831
1034
|
}
|
|
832
1035
|
}
|
|
833
1036
|
handleEvents(e, t) {
|
|
@@ -836,29 +1039,42 @@ class pn {
|
|
|
836
1039
|
const n = e;
|
|
837
1040
|
if (Array.isArray(n.events))
|
|
838
1041
|
for (const r of n.events) {
|
|
839
|
-
const
|
|
840
|
-
t.emitEvent(
|
|
1042
|
+
const o = t.blue.jsonValueToNode(r);
|
|
1043
|
+
t.emitEvent(o);
|
|
841
1044
|
}
|
|
842
1045
|
}
|
|
843
1046
|
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
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();
|
|
847
1063
|
async execute(e) {
|
|
848
1064
|
const { context: t, stepNode: n } = e, { blue: r } = t;
|
|
849
|
-
if (!r.isTypeOf(n,
|
|
1065
|
+
if (!r.isTypeOf(n, Me))
|
|
850
1066
|
return t.throwFatal("Update Document step payload is invalid");
|
|
851
|
-
const
|
|
1067
|
+
const o = await Q({
|
|
852
1068
|
evaluator: this.evaluator,
|
|
853
1069
|
node: n,
|
|
854
|
-
bindings:
|
|
855
|
-
shouldResolve:
|
|
1070
|
+
bindings: me(e),
|
|
1071
|
+
shouldResolve: tt({
|
|
856
1072
|
include: ["/changeset", "/changeset/**"]
|
|
857
1073
|
}),
|
|
858
1074
|
context: t
|
|
859
|
-
}),
|
|
860
|
-
t.gasMeter().chargeUpdateDocumentBase(
|
|
861
|
-
for (const a of
|
|
1075
|
+
}), s = this.extractChanges(o, t);
|
|
1076
|
+
t.gasMeter().chargeUpdateDocumentBase(s.length);
|
|
1077
|
+
for (const a of s) {
|
|
862
1078
|
const c = this.createPatch(a, t);
|
|
863
1079
|
await t.applyPatch(c);
|
|
864
1080
|
}
|
|
@@ -866,12 +1082,12 @@ class mn {
|
|
|
866
1082
|
extractChanges(e, t) {
|
|
867
1083
|
return t.blue.nodeToSchemaOutput(
|
|
868
1084
|
e,
|
|
869
|
-
|
|
1085
|
+
Me
|
|
870
1086
|
).changeset ?? [];
|
|
871
1087
|
}
|
|
872
1088
|
createPatch(e, t) {
|
|
873
|
-
const n = this.normalizeOperation(e.op, t), r = this.normalizePath(e.path, t),
|
|
874
|
-
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 };
|
|
875
1091
|
}
|
|
876
1092
|
normalizeOperation(e, t) {
|
|
877
1093
|
const n = typeof e == "string" ? e : void 0, r = (n ?? "REPLACE").toUpperCase();
|
|
@@ -886,14 +1102,14 @@ class mn {
|
|
|
886
1102
|
return n.length === 0 ? t.throwFatal("Update Document path cannot be empty") : n;
|
|
887
1103
|
}
|
|
888
1104
|
}
|
|
889
|
-
const
|
|
890
|
-
new
|
|
891
|
-
new
|
|
892
|
-
new
|
|
1105
|
+
const ge = [
|
|
1106
|
+
new An(),
|
|
1107
|
+
new Ln(),
|
|
1108
|
+
new _n()
|
|
893
1109
|
];
|
|
894
|
-
class
|
|
1110
|
+
class ct {
|
|
895
1111
|
executorIndex;
|
|
896
|
-
constructor(e =
|
|
1112
|
+
constructor(e = ge) {
|
|
897
1113
|
const t = /* @__PURE__ */ new Map();
|
|
898
1114
|
for (const n of e)
|
|
899
1115
|
for (const r of n.supportedBlueIds)
|
|
@@ -901,50 +1117,52 @@ class je {
|
|
|
901
1117
|
this.executorIndex = t;
|
|
902
1118
|
}
|
|
903
1119
|
async run(e) {
|
|
904
|
-
const { workflow: t, eventNode: n, context: r } = e,
|
|
905
|
-
if (
|
|
1120
|
+
const { workflow: t, eventNode: n, context: r } = e, o = t.steps ?? [];
|
|
1121
|
+
if (o.length === 0)
|
|
906
1122
|
return {};
|
|
907
|
-
const
|
|
908
|
-
for (const [a, c] of
|
|
909
|
-
const
|
|
910
|
-
if (
|
|
1123
|
+
const s = {};
|
|
1124
|
+
for (const [a, c] of o.entries()) {
|
|
1125
|
+
const u = c.getType?.()?.getBlueId();
|
|
1126
|
+
if (ae(u))
|
|
911
1127
|
return r.throwFatal(
|
|
912
1128
|
"Sequential workflow step is missing type metadata"
|
|
913
1129
|
);
|
|
914
|
-
const
|
|
915
|
-
if (
|
|
916
|
-
const
|
|
1130
|
+
const d = this.executorIndex.get(u);
|
|
1131
|
+
if (ae(d)) {
|
|
1132
|
+
const y = c.getType?.()?.getName?.() ?? u;
|
|
917
1133
|
return r.throwFatal(
|
|
918
|
-
`Unsupported workflow step type "${
|
|
1134
|
+
`Unsupported workflow step type "${y}"`
|
|
919
1135
|
);
|
|
920
1136
|
}
|
|
921
|
-
const
|
|
1137
|
+
const g = {
|
|
922
1138
|
workflow: t,
|
|
923
1139
|
stepNode: c,
|
|
924
1140
|
eventNode: n,
|
|
925
1141
|
context: r,
|
|
926
|
-
stepResults:
|
|
1142
|
+
stepResults: s,
|
|
927
1143
|
stepIndex: a
|
|
928
|
-
},
|
|
929
|
-
if (
|
|
930
|
-
const
|
|
931
|
-
|
|
1144
|
+
}, m = await d.execute(g);
|
|
1145
|
+
if (m !== void 0) {
|
|
1146
|
+
const y = this.stepResultKey(c, a);
|
|
1147
|
+
s[y] = m;
|
|
932
1148
|
}
|
|
933
1149
|
}
|
|
934
|
-
return
|
|
1150
|
+
return s;
|
|
935
1151
|
}
|
|
936
1152
|
stepResultKey(e, t) {
|
|
937
1153
|
const n = e.getName?.();
|
|
938
1154
|
return n && typeof n == "string" && n.length > 0 ? n : `Step${t + 1}`;
|
|
939
1155
|
}
|
|
940
1156
|
}
|
|
941
|
-
class
|
|
1157
|
+
class Fn {
|
|
942
1158
|
kind = "handler";
|
|
943
|
-
blueIds = [
|
|
944
|
-
|
|
1159
|
+
blueIds = [
|
|
1160
|
+
S["Conversation/Sequential Workflow"]
|
|
1161
|
+
];
|
|
1162
|
+
schema = Sn;
|
|
945
1163
|
runner;
|
|
946
|
-
constructor(e =
|
|
947
|
-
this.runner = new
|
|
1164
|
+
constructor(e = ge) {
|
|
1165
|
+
this.runner = new ct(e);
|
|
948
1166
|
}
|
|
949
1167
|
async matches(e, t) {
|
|
950
1168
|
const n = t.event();
|
|
@@ -955,12 +1173,20 @@ class gn {
|
|
|
955
1173
|
n && await this.runner.run({ workflow: e, eventNode: n, context: t });
|
|
956
1174
|
}
|
|
957
1175
|
}
|
|
958
|
-
class
|
|
1176
|
+
class Un {
|
|
959
1177
|
kind = "marker";
|
|
960
|
-
blueIds = [
|
|
961
|
-
schema =
|
|
962
|
-
}
|
|
963
|
-
|
|
1178
|
+
blueIds = [S["Conversation/Operation"]];
|
|
1179
|
+
schema = cn;
|
|
1180
|
+
}
|
|
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) {
|
|
964
1190
|
const e = i.channel;
|
|
965
1191
|
if (typeof e == "string") {
|
|
966
1192
|
const t = e.trim();
|
|
@@ -969,49 +1195,49 @@ function Je(i) {
|
|
|
969
1195
|
}
|
|
970
1196
|
return null;
|
|
971
1197
|
}
|
|
972
|
-
function
|
|
1198
|
+
function zn(i, e) {
|
|
973
1199
|
const t = i.getProperties()?.document;
|
|
974
|
-
return t instanceof
|
|
1200
|
+
return t instanceof h ? e.blue.calculateBlueIdSync(t) : null;
|
|
975
1201
|
}
|
|
976
|
-
function
|
|
977
|
-
if (e.isTypeOf(i,
|
|
1202
|
+
function $n(i, e) {
|
|
1203
|
+
if (e.isTypeOf(i, le, {
|
|
978
1204
|
checkSchemaExtensions: !0
|
|
979
1205
|
}))
|
|
980
1206
|
return i;
|
|
981
|
-
if (e.isTypeOf(i,
|
|
1207
|
+
if (e.isTypeOf(i, I, {
|
|
982
1208
|
checkSchemaExtensions: !0
|
|
983
1209
|
})) {
|
|
984
|
-
const n = e.nodeToSchemaOutput(i,
|
|
985
|
-
if (n && e.isTypeOf(n,
|
|
1210
|
+
const n = e.nodeToSchemaOutput(i, I).message;
|
|
1211
|
+
if (n && e.isTypeOf(n, le, {
|
|
986
1212
|
checkSchemaExtensions: !0
|
|
987
1213
|
}))
|
|
988
1214
|
return n;
|
|
989
1215
|
}
|
|
990
1216
|
return null;
|
|
991
1217
|
}
|
|
992
|
-
function
|
|
993
|
-
const { blue: r } = n,
|
|
994
|
-
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));
|
|
995
1221
|
}
|
|
996
|
-
function
|
|
1222
|
+
function Vn(i, e) {
|
|
997
1223
|
const t = i.operation;
|
|
998
1224
|
if (!t)
|
|
999
1225
|
return null;
|
|
1000
1226
|
const n = e.resolvePointer(`/contracts/${t}`), r = e.documentAt(n);
|
|
1001
|
-
if (!r || !e.blue.isTypeOf(r,
|
|
1227
|
+
if (!r || !e.blue.isTypeOf(r, W))
|
|
1002
1228
|
return null;
|
|
1003
|
-
const
|
|
1229
|
+
const o = e.blue.nodeToSchemaOutput(
|
|
1004
1230
|
r,
|
|
1005
|
-
|
|
1006
|
-
),
|
|
1007
|
-
return { operationNode: r, operation:
|
|
1231
|
+
W
|
|
1232
|
+
), s = lt(o);
|
|
1233
|
+
return { operationNode: r, operation: o, channelKey: s };
|
|
1008
1234
|
}
|
|
1009
|
-
function
|
|
1235
|
+
function Wn(i, e) {
|
|
1010
1236
|
return !(i && e && i !== e);
|
|
1011
1237
|
}
|
|
1012
|
-
function
|
|
1238
|
+
function Kn(i, e, t) {
|
|
1013
1239
|
const n = i.getProperties()?.request, r = e.getProperties()?.request;
|
|
1014
|
-
if (!(n instanceof
|
|
1240
|
+
if (!(n instanceof h) || !(r instanceof h))
|
|
1015
1241
|
return !1;
|
|
1016
1242
|
try {
|
|
1017
1243
|
if (!t.isTypeOfNode(n, r))
|
|
@@ -1021,65 +1247,65 @@ function kn(i, e, t) {
|
|
|
1021
1247
|
}
|
|
1022
1248
|
return !0;
|
|
1023
1249
|
}
|
|
1024
|
-
function
|
|
1250
|
+
function qn(i, e, t) {
|
|
1025
1251
|
if (!i || i.allowNewerVersion !== !1)
|
|
1026
1252
|
return !0;
|
|
1027
|
-
const n =
|
|
1253
|
+
const n = zn(e, t);
|
|
1028
1254
|
if (!n)
|
|
1029
1255
|
return !0;
|
|
1030
|
-
const r = t.resolvePointer("/"),
|
|
1031
|
-
if (!
|
|
1256
|
+
const r = t.resolvePointer("/"), o = t.documentAt(r);
|
|
1257
|
+
if (!o)
|
|
1032
1258
|
return !1;
|
|
1033
|
-
const c = (
|
|
1034
|
-
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;
|
|
1035
1261
|
}
|
|
1036
|
-
class
|
|
1262
|
+
class jn {
|
|
1037
1263
|
kind = "handler";
|
|
1038
1264
|
blueIds = [
|
|
1039
|
-
|
|
1265
|
+
S["Conversation/Sequential Workflow Operation"]
|
|
1040
1266
|
];
|
|
1041
|
-
schema =
|
|
1267
|
+
schema = bn;
|
|
1042
1268
|
runner;
|
|
1043
|
-
constructor(e =
|
|
1044
|
-
this.runner = new
|
|
1269
|
+
constructor(e = ge) {
|
|
1270
|
+
this.runner = new ct(e);
|
|
1045
1271
|
}
|
|
1046
1272
|
deriveChannel(e, t) {
|
|
1047
1273
|
const n = e.operation;
|
|
1048
1274
|
if (!n)
|
|
1049
1275
|
return null;
|
|
1050
1276
|
const r = t.scopeContracts.get(n);
|
|
1051
|
-
if (!r || !t.blue.isTypeOf(r.node,
|
|
1277
|
+
if (!r || !t.blue.isTypeOf(r.node, W, {
|
|
1052
1278
|
checkSchemaExtensions: !0
|
|
1053
1279
|
}))
|
|
1054
1280
|
return null;
|
|
1055
|
-
const
|
|
1056
|
-
return
|
|
1281
|
+
const o = t.blue.nodeToSchemaOutput(r.node, W);
|
|
1282
|
+
return o ? lt(o) : null;
|
|
1057
1283
|
}
|
|
1058
1284
|
async matches(e, t) {
|
|
1059
1285
|
const n = t.event();
|
|
1060
1286
|
if (!n)
|
|
1061
1287
|
return !1;
|
|
1062
|
-
const r =
|
|
1288
|
+
const r = $n(
|
|
1063
1289
|
n,
|
|
1064
1290
|
t.blue
|
|
1065
1291
|
);
|
|
1066
1292
|
if (!r)
|
|
1067
1293
|
return !1;
|
|
1068
|
-
const
|
|
1294
|
+
const o = t.blue.nodeToSchemaOutput(
|
|
1069
1295
|
r,
|
|
1070
|
-
|
|
1296
|
+
le
|
|
1071
1297
|
);
|
|
1072
|
-
if (!
|
|
1298
|
+
if (!o || !Hn(e, n, o, t))
|
|
1073
1299
|
return !1;
|
|
1074
|
-
const
|
|
1075
|
-
if (!
|
|
1300
|
+
const s = Vn(e, t);
|
|
1301
|
+
if (!s)
|
|
1076
1302
|
return !1;
|
|
1077
1303
|
const a = typeof e.channel == "string" ? e.channel.trim() : "", c = a.length > 0 ? a : null;
|
|
1078
|
-
return !(!
|
|
1304
|
+
return !(!Wn(s.channelKey, c) || !Kn(
|
|
1079
1305
|
r,
|
|
1080
|
-
|
|
1306
|
+
s.operationNode,
|
|
1081
1307
|
t.blue
|
|
1082
|
-
) ||
|
|
1308
|
+
) || o?.allowNewerVersion === !1 && !qn(o, r, t));
|
|
1083
1309
|
}
|
|
1084
1310
|
async execute(e, t) {
|
|
1085
1311
|
const n = t.event();
|
|
@@ -1090,17 +1316,17 @@ class vn {
|
|
|
1090
1316
|
});
|
|
1091
1317
|
}
|
|
1092
1318
|
}
|
|
1093
|
-
class
|
|
1319
|
+
class ne {
|
|
1094
1320
|
constructor(e) {
|
|
1095
1321
|
this.registry = e;
|
|
1096
1322
|
}
|
|
1097
1323
|
static create() {
|
|
1098
|
-
return new
|
|
1099
|
-
new
|
|
1324
|
+
return new ne(
|
|
1325
|
+
new Tn()
|
|
1100
1326
|
);
|
|
1101
1327
|
}
|
|
1102
1328
|
registerDefaults() {
|
|
1103
|
-
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;
|
|
1104
1330
|
}
|
|
1105
1331
|
register(e) {
|
|
1106
1332
|
return this.registry.register(e), this;
|
|
@@ -1109,11 +1335,11 @@ class Q {
|
|
|
1109
1335
|
return this.registry;
|
|
1110
1336
|
}
|
|
1111
1337
|
}
|
|
1112
|
-
const
|
|
1113
|
-
function
|
|
1338
|
+
const ue = p["Core/Channel Event Checkpoint"];
|
|
1339
|
+
function ut(i) {
|
|
1114
1340
|
return typeof i.order == "number" ? i.order : 0;
|
|
1115
1341
|
}
|
|
1116
|
-
class
|
|
1342
|
+
class Jn {
|
|
1117
1343
|
constructor(e, t, n) {
|
|
1118
1344
|
this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n;
|
|
1119
1345
|
}
|
|
@@ -1127,10 +1353,10 @@ class Rn {
|
|
|
1127
1353
|
return this.bindingBlueId;
|
|
1128
1354
|
}
|
|
1129
1355
|
order() {
|
|
1130
|
-
return
|
|
1356
|
+
return ut(this.bindingContract);
|
|
1131
1357
|
}
|
|
1132
1358
|
}
|
|
1133
|
-
class
|
|
1359
|
+
class Gn {
|
|
1134
1360
|
constructor(e, t, n) {
|
|
1135
1361
|
this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n;
|
|
1136
1362
|
}
|
|
@@ -1144,28 +1370,28 @@ class Tn {
|
|
|
1144
1370
|
return this.bindingBlueId;
|
|
1145
1371
|
}
|
|
1146
1372
|
order() {
|
|
1147
|
-
return
|
|
1373
|
+
return ut(this.bindingContract);
|
|
1148
1374
|
}
|
|
1149
1375
|
}
|
|
1150
|
-
class
|
|
1151
|
-
constructor(e, t, n, r,
|
|
1152
|
-
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;
|
|
1153
1379
|
}
|
|
1154
1380
|
checkpointDeclared;
|
|
1155
|
-
static fromComponents(e, t, n, r,
|
|
1156
|
-
return new
|
|
1381
|
+
static fromComponents(e, t, n, r, o) {
|
|
1382
|
+
return new L(
|
|
1157
1383
|
e,
|
|
1158
1384
|
t,
|
|
1159
1385
|
n,
|
|
1160
1386
|
r,
|
|
1161
|
-
|
|
1387
|
+
o
|
|
1162
1388
|
);
|
|
1163
1389
|
}
|
|
1164
1390
|
static builder() {
|
|
1165
|
-
return new
|
|
1391
|
+
return new Qn();
|
|
1166
1392
|
}
|
|
1167
1393
|
static empty() {
|
|
1168
|
-
return
|
|
1394
|
+
return L.builder().build();
|
|
1169
1395
|
}
|
|
1170
1396
|
markers() {
|
|
1171
1397
|
return new Map(
|
|
@@ -1195,32 +1421,32 @@ class M {
|
|
|
1195
1421
|
throw new Error(
|
|
1196
1422
|
"Duplicate Channel Event Checkpoint markers detected in same contracts map"
|
|
1197
1423
|
);
|
|
1198
|
-
this.markerStore.set(
|
|
1199
|
-
key:
|
|
1424
|
+
this.markerStore.set(N, {
|
|
1425
|
+
key: N,
|
|
1200
1426
|
contract: e,
|
|
1201
|
-
blueId:
|
|
1427
|
+
blueId: ue
|
|
1202
1428
|
}), this.checkpointDeclared = !0;
|
|
1203
1429
|
}
|
|
1204
1430
|
handlersFor(e) {
|
|
1205
1431
|
const t = this.handlersByChannel.get(e);
|
|
1206
1432
|
return !t || t.length === 0 ? [] : [...t].map(
|
|
1207
|
-
(n) => new
|
|
1433
|
+
(n) => new Gn(n.key, n.contract, n.blueId)
|
|
1208
1434
|
).sort((n, r) => {
|
|
1209
|
-
const
|
|
1210
|
-
return
|
|
1435
|
+
const o = n.order() - r.order();
|
|
1436
|
+
return o !== 0 ? o : n.key().localeCompare(r.key());
|
|
1211
1437
|
});
|
|
1212
1438
|
}
|
|
1213
1439
|
channelsOfType(...e) {
|
|
1214
1440
|
const t = e.length > 0 ? new Set(e) : null, n = Array.from(this.channels.values()).filter((r) => !t || t.has(r.blueId)).map(
|
|
1215
|
-
(r) => new
|
|
1441
|
+
(r) => new Jn(r.key, r.contract, r.blueId)
|
|
1216
1442
|
);
|
|
1217
|
-
return n.sort((r,
|
|
1218
|
-
const
|
|
1219
|
-
return
|
|
1443
|
+
return n.sort((r, o) => {
|
|
1444
|
+
const s = r.order() - o.order();
|
|
1445
|
+
return s !== 0 ? s : r.key().localeCompare(o.key());
|
|
1220
1446
|
}), n;
|
|
1221
1447
|
}
|
|
1222
1448
|
}
|
|
1223
|
-
class
|
|
1449
|
+
class Qn {
|
|
1224
1450
|
channels = /* @__PURE__ */ new Map();
|
|
1225
1451
|
handlersByChannel = /* @__PURE__ */ new Map();
|
|
1226
1452
|
markerStore = /* @__PURE__ */ new Map();
|
|
@@ -1234,8 +1460,8 @@ class Pn {
|
|
|
1234
1460
|
const r = t.channel;
|
|
1235
1461
|
if (!r)
|
|
1236
1462
|
throw new Error(`Handler ${e} must declare channel`);
|
|
1237
|
-
const
|
|
1238
|
-
return
|
|
1463
|
+
const o = this.handlersByChannel.get(r) ?? [];
|
|
1464
|
+
return o.push({ key: e, contract: t, blueId: n }), this.handlersByChannel.set(r, o), this;
|
|
1239
1465
|
}
|
|
1240
1466
|
setEmbedded(e) {
|
|
1241
1467
|
if (this.embeddedDeclared)
|
|
@@ -1245,12 +1471,12 @@ class Pn {
|
|
|
1245
1471
|
return this.embeddedDeclared = !0, this.embeddedPaths = e.paths ? [...e.paths] : [], this;
|
|
1246
1472
|
}
|
|
1247
1473
|
addMarker(e, t, n) {
|
|
1248
|
-
if (e ===
|
|
1474
|
+
if (e === N && n !== ue)
|
|
1249
1475
|
throw new Error(
|
|
1250
1476
|
"Reserved key 'checkpoint' must contain a Channel Event Checkpoint"
|
|
1251
1477
|
);
|
|
1252
|
-
if (n ===
|
|
1253
|
-
if (e !==
|
|
1478
|
+
if (n === ue) {
|
|
1479
|
+
if (e !== N)
|
|
1254
1480
|
throw new Error(
|
|
1255
1481
|
`Channel Event Checkpoint must use reserved key 'checkpoint' at key '${e}'`
|
|
1256
1482
|
);
|
|
@@ -1263,7 +1489,7 @@ class Pn {
|
|
|
1263
1489
|
return this.markerStore.set(e, { key: e, contract: t, blueId: n }), this;
|
|
1264
1490
|
}
|
|
1265
1491
|
build() {
|
|
1266
|
-
return
|
|
1492
|
+
return L.fromComponents(
|
|
1267
1493
|
new Map(this.channels),
|
|
1268
1494
|
new Map(
|
|
1269
1495
|
Array.from(this.handlersByChannel.entries(), ([e, t]) => [
|
|
@@ -1277,12 +1503,12 @@ class Pn {
|
|
|
1277
1503
|
);
|
|
1278
1504
|
}
|
|
1279
1505
|
}
|
|
1280
|
-
class
|
|
1506
|
+
class E extends Error {
|
|
1281
1507
|
constructor(e, t) {
|
|
1282
1508
|
super(e || "Processor fatal error"), this.processorError = t, this.name = "ProcessorFatalError";
|
|
1283
1509
|
}
|
|
1284
1510
|
}
|
|
1285
|
-
class
|
|
1511
|
+
class Yn {
|
|
1286
1512
|
constructor(e, t, n) {
|
|
1287
1513
|
this.blue = e, this.registry = t, this.builtinChannelSchemas = n;
|
|
1288
1514
|
}
|
|
@@ -1291,53 +1517,53 @@ class Nn {
|
|
|
1291
1517
|
key: t,
|
|
1292
1518
|
node: n,
|
|
1293
1519
|
processor: r,
|
|
1294
|
-
blueId:
|
|
1295
|
-
scopeContracts:
|
|
1520
|
+
blueId: o,
|
|
1521
|
+
scopeContracts: s
|
|
1296
1522
|
}) {
|
|
1297
1523
|
try {
|
|
1298
1524
|
const a = r.schema, c = this.blue.nodeToSchemaOutput(
|
|
1299
1525
|
n,
|
|
1300
1526
|
a
|
|
1301
|
-
),
|
|
1527
|
+
), u = this.resolveChannelKey({
|
|
1302
1528
|
contract: c,
|
|
1303
1529
|
processor: r,
|
|
1304
|
-
scopeContracts:
|
|
1530
|
+
scopeContracts: s,
|
|
1305
1531
|
handlerKey: t
|
|
1306
|
-
}),
|
|
1307
|
-
if (!
|
|
1308
|
-
throw new
|
|
1309
|
-
`Handler ${t} references unknown channel '${
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
`Channel '${
|
|
1313
|
-
`/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}`
|
|
1314
1540
|
)
|
|
1315
1541
|
);
|
|
1316
|
-
if (!this.isRegisteredChannel(
|
|
1317
|
-
throw new
|
|
1318
|
-
`Contract '${
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
`Contract '${
|
|
1322
|
-
`/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}`
|
|
1323
1549
|
)
|
|
1324
1550
|
);
|
|
1325
|
-
e.addHandler(t, { ...c, channel:
|
|
1551
|
+
e.addHandler(t, { ...c, channel: u }, o);
|
|
1326
1552
|
} catch (a) {
|
|
1327
1553
|
if (this.isZodError(a))
|
|
1328
|
-
throw new
|
|
1554
|
+
throw new E(
|
|
1329
1555
|
"Failed to parse handler contract",
|
|
1330
|
-
|
|
1331
|
-
|
|
1556
|
+
w.invalidContract(
|
|
1557
|
+
o,
|
|
1332
1558
|
"Failed to parse handler contract",
|
|
1333
1559
|
t,
|
|
1334
1560
|
a
|
|
1335
1561
|
)
|
|
1336
1562
|
);
|
|
1337
1563
|
const c = a?.message ?? "Failed to register handler contract";
|
|
1338
|
-
throw new
|
|
1564
|
+
throw new E(
|
|
1339
1565
|
c,
|
|
1340
|
-
|
|
1566
|
+
w.illegalState(c)
|
|
1341
1567
|
);
|
|
1342
1568
|
}
|
|
1343
1569
|
}
|
|
@@ -1347,94 +1573,114 @@ class Nn {
|
|
|
1347
1573
|
scopeContracts: n,
|
|
1348
1574
|
handlerKey: r
|
|
1349
1575
|
}) {
|
|
1350
|
-
let
|
|
1351
|
-
if (
|
|
1352
|
-
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, {
|
|
1353
1579
|
blue: this.blue,
|
|
1354
1580
|
scopeContracts: n
|
|
1355
1581
|
}) ?? null;
|
|
1356
|
-
if (typeof
|
|
1357
|
-
const a =
|
|
1358
|
-
a.length > 0 && (
|
|
1582
|
+
if (typeof s == "string") {
|
|
1583
|
+
const a = s.trim();
|
|
1584
|
+
a.length > 0 && (o = a);
|
|
1359
1585
|
}
|
|
1360
1586
|
}
|
|
1361
|
-
if (!
|
|
1362
|
-
throw new
|
|
1587
|
+
if (!o)
|
|
1588
|
+
throw new E(
|
|
1363
1589
|
`Handler ${r} must declare channel (missing explicit channel and derivation failed)`,
|
|
1364
|
-
|
|
1590
|
+
w.illegalState(
|
|
1365
1591
|
`Handler ${r} must declare channel (missing explicit channel and derivation failed)`
|
|
1366
1592
|
)
|
|
1367
1593
|
);
|
|
1368
|
-
return
|
|
1594
|
+
return o;
|
|
1369
1595
|
}
|
|
1370
1596
|
isRegisteredChannel(e) {
|
|
1371
1597
|
return this.builtinChannelSchemas.has(e) ? !0 : this.registry.lookupChannel(e) != null;
|
|
1372
1598
|
}
|
|
1373
1599
|
isZodError(e) {
|
|
1374
|
-
return e instanceof
|
|
1600
|
+
return e instanceof xe;
|
|
1375
1601
|
}
|
|
1376
1602
|
}
|
|
1377
|
-
class
|
|
1603
|
+
class K extends Error {
|
|
1378
1604
|
constructor(e) {
|
|
1379
1605
|
super(e ?? "MustUnderstand failure"), this.name = "MustUnderstandFailure";
|
|
1380
1606
|
}
|
|
1381
1607
|
}
|
|
1382
|
-
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([
|
|
1383
1609
|
[
|
|
1384
|
-
|
|
1385
|
-
|
|
1610
|
+
Xn,
|
|
1611
|
+
Vt
|
|
1386
1612
|
],
|
|
1387
1613
|
[
|
|
1388
|
-
|
|
1389
|
-
|
|
1614
|
+
Zn,
|
|
1615
|
+
Kt
|
|
1390
1616
|
],
|
|
1391
1617
|
[
|
|
1392
|
-
|
|
1393
|
-
|
|
1618
|
+
er,
|
|
1619
|
+
jt
|
|
1394
1620
|
],
|
|
1395
1621
|
[
|
|
1396
|
-
|
|
1397
|
-
|
|
1622
|
+
tr,
|
|
1623
|
+
Gt
|
|
1398
1624
|
]
|
|
1399
|
-
]),
|
|
1625
|
+
]), ur = /* @__PURE__ */ new Map([
|
|
1400
1626
|
[
|
|
1401
|
-
|
|
1402
|
-
|
|
1627
|
+
nr,
|
|
1628
|
+
nn
|
|
1403
1629
|
],
|
|
1404
1630
|
[
|
|
1405
|
-
|
|
1406
|
-
|
|
1631
|
+
rr,
|
|
1632
|
+
an
|
|
1407
1633
|
],
|
|
1408
1634
|
[
|
|
1409
|
-
|
|
1635
|
+
ir,
|
|
1410
1636
|
en
|
|
1637
|
+
],
|
|
1638
|
+
[
|
|
1639
|
+
or,
|
|
1640
|
+
dn
|
|
1641
|
+
],
|
|
1642
|
+
[
|
|
1643
|
+
sr,
|
|
1644
|
+
fn
|
|
1645
|
+
],
|
|
1646
|
+
[
|
|
1647
|
+
ar,
|
|
1648
|
+
gn
|
|
1649
|
+
],
|
|
1650
|
+
[
|
|
1651
|
+
cr,
|
|
1652
|
+
En
|
|
1653
|
+
],
|
|
1654
|
+
[
|
|
1655
|
+
lr,
|
|
1656
|
+
Cn
|
|
1411
1657
|
]
|
|
1412
1658
|
]);
|
|
1413
|
-
class
|
|
1659
|
+
class dr {
|
|
1414
1660
|
constructor(e, t) {
|
|
1415
|
-
this.registry = e, this.blue = t, this.handlerRegistration = new
|
|
1661
|
+
this.registry = e, this.blue = t, this.handlerRegistration = new Yn(
|
|
1416
1662
|
this.blue,
|
|
1417
1663
|
this.registry,
|
|
1418
|
-
|
|
1664
|
+
Oe
|
|
1419
1665
|
);
|
|
1420
1666
|
}
|
|
1421
1667
|
handlerRegistration;
|
|
1422
1668
|
load(e, t) {
|
|
1423
1669
|
try {
|
|
1424
|
-
const n =
|
|
1670
|
+
const n = L.builder(), r = e.getContracts();
|
|
1425
1671
|
if (!r)
|
|
1426
1672
|
return n.build();
|
|
1427
|
-
const
|
|
1428
|
-
for (const [
|
|
1429
|
-
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);
|
|
1430
1676
|
return n.build();
|
|
1431
1677
|
} catch (n) {
|
|
1432
|
-
if (n instanceof
|
|
1678
|
+
if (n instanceof K || n instanceof E)
|
|
1433
1679
|
throw n;
|
|
1434
1680
|
const r = n?.message ?? "Failed to load contracts";
|
|
1435
|
-
throw new
|
|
1681
|
+
throw new E(
|
|
1436
1682
|
`Failed to load contracts for scope ${t}: ${r}`,
|
|
1437
|
-
|
|
1683
|
+
w.runtimeFatal(
|
|
1438
1684
|
`Failed to load contracts for scope ${t}`,
|
|
1439
1685
|
n
|
|
1440
1686
|
)
|
|
@@ -1442,131 +1688,131 @@ class xn {
|
|
|
1442
1688
|
}
|
|
1443
1689
|
}
|
|
1444
1690
|
processContract(e, t, n, r) {
|
|
1445
|
-
const
|
|
1446
|
-
if (!
|
|
1691
|
+
const o = n.getType()?.getBlueId();
|
|
1692
|
+
if (!o)
|
|
1447
1693
|
return;
|
|
1448
|
-
if (
|
|
1694
|
+
if (o === Ne) {
|
|
1449
1695
|
this.handleProcessEmbedded(e, t, n);
|
|
1450
1696
|
return;
|
|
1451
1697
|
}
|
|
1452
|
-
const
|
|
1453
|
-
if (
|
|
1454
|
-
this.handleMarker(e, t, n,
|
|
1698
|
+
const s = ur.get(o);
|
|
1699
|
+
if (s) {
|
|
1700
|
+
this.handleMarker(e, t, n, s, o);
|
|
1455
1701
|
return;
|
|
1456
1702
|
}
|
|
1457
|
-
const a =
|
|
1703
|
+
const a = Oe.get(o);
|
|
1458
1704
|
if (a) {
|
|
1459
|
-
this.handleChannel(e, t, n, a,
|
|
1705
|
+
this.handleChannel(e, t, n, a, o);
|
|
1460
1706
|
return;
|
|
1461
1707
|
}
|
|
1462
|
-
const c = this.registry.lookupChannel(
|
|
1708
|
+
const c = this.registry.lookupChannel(o);
|
|
1463
1709
|
if (c) {
|
|
1464
1710
|
this.handleChannel(
|
|
1465
1711
|
e,
|
|
1466
1712
|
t,
|
|
1467
1713
|
n,
|
|
1468
1714
|
c.schema,
|
|
1469
|
-
|
|
1715
|
+
o
|
|
1470
1716
|
);
|
|
1471
1717
|
return;
|
|
1472
1718
|
}
|
|
1473
|
-
const
|
|
1474
|
-
if (
|
|
1719
|
+
const u = this.registry.lookupHandler(o);
|
|
1720
|
+
if (u) {
|
|
1475
1721
|
this.handlerRegistration.register({
|
|
1476
1722
|
builder: e,
|
|
1477
1723
|
key: t,
|
|
1478
1724
|
node: n,
|
|
1479
|
-
processor:
|
|
1480
|
-
blueId:
|
|
1725
|
+
processor: u,
|
|
1726
|
+
blueId: o,
|
|
1481
1727
|
scopeContracts: r
|
|
1482
1728
|
});
|
|
1483
1729
|
return;
|
|
1484
1730
|
}
|
|
1485
|
-
const
|
|
1486
|
-
if (
|
|
1731
|
+
const d = this.registry.lookupMarker(o);
|
|
1732
|
+
if (d) {
|
|
1487
1733
|
this.handleMarker(
|
|
1488
1734
|
e,
|
|
1489
1735
|
t,
|
|
1490
1736
|
n,
|
|
1491
|
-
|
|
1492
|
-
|
|
1737
|
+
d.schema,
|
|
1738
|
+
o
|
|
1493
1739
|
);
|
|
1494
1740
|
return;
|
|
1495
1741
|
}
|
|
1496
|
-
throw
|
|
1742
|
+
throw he(o) ? new E(
|
|
1497
1743
|
"Built-in processor-managed channel is missing schema registration",
|
|
1498
|
-
|
|
1499
|
-
|
|
1744
|
+
w.invalidContract(
|
|
1745
|
+
o,
|
|
1500
1746
|
"Built-in processor-managed channel is missing schema registration",
|
|
1501
1747
|
t
|
|
1502
1748
|
)
|
|
1503
|
-
) : new
|
|
1749
|
+
) : new K(`Unsupported contract type: ${o}`);
|
|
1504
1750
|
}
|
|
1505
1751
|
handleProcessEmbedded(e, t, n) {
|
|
1506
1752
|
try {
|
|
1507
1753
|
const r = this.convert(
|
|
1508
1754
|
n,
|
|
1509
|
-
|
|
1755
|
+
on
|
|
1510
1756
|
);
|
|
1511
1757
|
e.setEmbedded(r);
|
|
1512
1758
|
} catch (r) {
|
|
1513
|
-
throw
|
|
1759
|
+
throw oe(r) ? new E(
|
|
1514
1760
|
"Failed to parse ProcessEmbedded marker",
|
|
1515
|
-
|
|
1516
|
-
|
|
1761
|
+
w.invalidContract(
|
|
1762
|
+
Ne,
|
|
1517
1763
|
"Failed to parse ProcessEmbedded marker",
|
|
1518
1764
|
t,
|
|
1519
1765
|
r
|
|
1520
1766
|
)
|
|
1521
|
-
) : new
|
|
1767
|
+
) : new E(
|
|
1522
1768
|
r?.message ?? "Failed to register ProcessEmbedded marker",
|
|
1523
|
-
|
|
1769
|
+
w.illegalState(
|
|
1524
1770
|
r?.message ?? "Failed to register ProcessEmbedded marker"
|
|
1525
1771
|
)
|
|
1526
1772
|
);
|
|
1527
1773
|
}
|
|
1528
1774
|
}
|
|
1529
|
-
handleChannel(e, t, n, r,
|
|
1775
|
+
handleChannel(e, t, n, r, o) {
|
|
1530
1776
|
try {
|
|
1531
|
-
const
|
|
1532
|
-
e.addChannel(t,
|
|
1533
|
-
} catch (
|
|
1534
|
-
if (
|
|
1535
|
-
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(
|
|
1536
1782
|
"Failed to parse channel contract",
|
|
1537
|
-
|
|
1538
|
-
|
|
1783
|
+
w.invalidContract(
|
|
1784
|
+
o,
|
|
1539
1785
|
"Failed to parse channel contract",
|
|
1540
1786
|
t,
|
|
1541
|
-
|
|
1787
|
+
s
|
|
1542
1788
|
)
|
|
1543
1789
|
);
|
|
1544
|
-
const a =
|
|
1545
|
-
throw new
|
|
1790
|
+
const a = s?.message ?? "Failed to register channel contract";
|
|
1791
|
+
throw new E(
|
|
1546
1792
|
a,
|
|
1547
|
-
|
|
1793
|
+
w.illegalState(a)
|
|
1548
1794
|
);
|
|
1549
1795
|
}
|
|
1550
1796
|
}
|
|
1551
|
-
handleMarker(e, t, n, r,
|
|
1797
|
+
handleMarker(e, t, n, r, o) {
|
|
1552
1798
|
try {
|
|
1553
|
-
const
|
|
1554
|
-
e.addMarker(t,
|
|
1555
|
-
} catch (
|
|
1556
|
-
if (
|
|
1557
|
-
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(
|
|
1558
1804
|
"Failed to parse marker contract",
|
|
1559
|
-
|
|
1560
|
-
|
|
1805
|
+
w.invalidContract(
|
|
1806
|
+
o,
|
|
1561
1807
|
"Failed to parse marker contract",
|
|
1562
1808
|
t,
|
|
1563
|
-
|
|
1809
|
+
s
|
|
1564
1810
|
)
|
|
1565
1811
|
);
|
|
1566
|
-
const a =
|
|
1567
|
-
throw new
|
|
1812
|
+
const a = s?.message ?? "Failed to register marker contract";
|
|
1813
|
+
throw new E(
|
|
1568
1814
|
a,
|
|
1569
|
-
|
|
1815
|
+
w.illegalState(a)
|
|
1570
1816
|
);
|
|
1571
1817
|
}
|
|
1572
1818
|
}
|
|
@@ -1575,8 +1821,8 @@ class xn {
|
|
|
1575
1821
|
for (const [n, r] of Object.entries(e)) {
|
|
1576
1822
|
if (!r)
|
|
1577
1823
|
continue;
|
|
1578
|
-
const
|
|
1579
|
-
typeof
|
|
1824
|
+
const o = r.getType()?.getBlueId();
|
|
1825
|
+
typeof o == "string" && o.trim().length > 0 && t.set(n, { node: r, nodeTypeBlueId: o });
|
|
1580
1826
|
}
|
|
1581
1827
|
return t;
|
|
1582
1828
|
}
|
|
@@ -1584,29 +1830,29 @@ class xn {
|
|
|
1584
1830
|
return this.blue.nodeToSchemaOutput(e, t);
|
|
1585
1831
|
}
|
|
1586
1832
|
}
|
|
1587
|
-
function
|
|
1588
|
-
return i instanceof
|
|
1833
|
+
function oe(i) {
|
|
1834
|
+
return i instanceof xe;
|
|
1589
1835
|
}
|
|
1590
|
-
const
|
|
1591
|
-
function
|
|
1836
|
+
const hr = p["Core/Channel Event Checkpoint"];
|
|
1837
|
+
function pr(i) {
|
|
1592
1838
|
return i.jsonValueToNode({
|
|
1593
|
-
type: { blueId:
|
|
1839
|
+
type: { blueId: hr },
|
|
1594
1840
|
lastEvents: {},
|
|
1595
1841
|
lastSignatures: {}
|
|
1596
1842
|
});
|
|
1597
1843
|
}
|
|
1598
|
-
function
|
|
1844
|
+
function fr() {
|
|
1599
1845
|
return {
|
|
1600
1846
|
lastEvents: {},
|
|
1601
1847
|
lastSignatures: {}
|
|
1602
1848
|
};
|
|
1603
1849
|
}
|
|
1604
|
-
function
|
|
1850
|
+
function Ae(i) {
|
|
1605
1851
|
return i != null && Object.prototype.hasOwnProperty.call(i, "lastEvents") && Object.prototype.hasOwnProperty.call(i, "lastSignatures");
|
|
1606
1852
|
}
|
|
1607
|
-
class
|
|
1608
|
-
constructor(e, t, n, r,
|
|
1609
|
-
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;
|
|
1610
1856
|
}
|
|
1611
1857
|
lastEventNode;
|
|
1612
1858
|
lastEventSignature;
|
|
@@ -1614,32 +1860,32 @@ class Un {
|
|
|
1614
1860
|
return e != null && e === this.lastEventSignature;
|
|
1615
1861
|
}
|
|
1616
1862
|
}
|
|
1617
|
-
class
|
|
1863
|
+
class gr {
|
|
1618
1864
|
constructor(e, t) {
|
|
1619
1865
|
this.runtime = e, this.signatureFn = t;
|
|
1620
1866
|
}
|
|
1621
1867
|
ensureCheckpointMarker(e, t) {
|
|
1622
|
-
const n = t.marker(
|
|
1868
|
+
const n = t.marker(N), r = k(e, Ve);
|
|
1623
1869
|
if (!n) {
|
|
1624
|
-
const
|
|
1625
|
-
this.runtime.directWrite(r,
|
|
1870
|
+
const o = pr(this.runtime.blue());
|
|
1871
|
+
this.runtime.directWrite(r, o), t.registerCheckpointMarker(fr());
|
|
1626
1872
|
return;
|
|
1627
1873
|
}
|
|
1628
|
-
if (!
|
|
1874
|
+
if (!Ae(n))
|
|
1629
1875
|
throw new Error(
|
|
1630
1876
|
`Reserved key 'checkpoint' must contain a Channel Event Checkpoint at ${r}`
|
|
1631
1877
|
);
|
|
1632
1878
|
}
|
|
1633
1879
|
findCheckpoint(e, t) {
|
|
1634
1880
|
for (const [n, r] of e.markerEntries()) {
|
|
1635
|
-
if (!
|
|
1881
|
+
if (!Ae(r))
|
|
1636
1882
|
continue;
|
|
1637
|
-
const
|
|
1638
|
-
return new
|
|
1883
|
+
const s = (r.lastEvents?.[t] ?? null)?.clone() ?? null, c = r.lastSignatures?.[t] ?? null ?? this.signatureFn(s);
|
|
1884
|
+
return new mr(
|
|
1639
1885
|
n,
|
|
1640
1886
|
r,
|
|
1641
1887
|
t,
|
|
1642
|
-
|
|
1888
|
+
s,
|
|
1643
1889
|
c
|
|
1644
1890
|
);
|
|
1645
1891
|
}
|
|
@@ -1648,22 +1894,22 @@ class Vn {
|
|
|
1648
1894
|
isDuplicate(e, t) {
|
|
1649
1895
|
return e != null && e.matches(t);
|
|
1650
1896
|
}
|
|
1651
|
-
persist(e, t, n, r,
|
|
1897
|
+
persist(e, t, n, r, o) {
|
|
1652
1898
|
if (!n)
|
|
1653
1899
|
return;
|
|
1654
|
-
const
|
|
1900
|
+
const s = k(
|
|
1655
1901
|
e,
|
|
1656
|
-
|
|
1657
|
-
), a =
|
|
1658
|
-
this.runtime.gasMeter().chargeCheckpointUpdate(), this.runtime.directWrite(
|
|
1659
|
-
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(
|
|
1660
1906
|
e,
|
|
1661
|
-
|
|
1662
|
-
),
|
|
1663
|
-
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;
|
|
1664
1910
|
}
|
|
1665
1911
|
}
|
|
1666
|
-
class
|
|
1912
|
+
class yr {
|
|
1667
1913
|
constructor(e, t, n) {
|
|
1668
1914
|
this.runtime = e, this.checkpointManager = t, this.deps = n;
|
|
1669
1915
|
}
|
|
@@ -1671,7 +1917,7 @@ class Kn {
|
|
|
1671
1917
|
if (this.deps.isScopeInactive(e))
|
|
1672
1918
|
return;
|
|
1673
1919
|
this.runtime.gasMeter().chargeChannelMatchAttempt();
|
|
1674
|
-
const s = await this.deps.evaluateChannel(
|
|
1920
|
+
const o = r, s = await this.deps.evaluateChannel(
|
|
1675
1921
|
n,
|
|
1676
1922
|
t,
|
|
1677
1923
|
e,
|
|
@@ -1679,42 +1925,48 @@ class Kn {
|
|
|
1679
1925
|
);
|
|
1680
1926
|
if (!s.matches)
|
|
1681
1927
|
return;
|
|
1682
|
-
const
|
|
1928
|
+
const a = s.eventNode ?? r;
|
|
1683
1929
|
this.checkpointManager.ensureCheckpointMarker(e, t);
|
|
1684
1930
|
const c = this.checkpointManager.findCheckpoint(
|
|
1685
1931
|
t,
|
|
1686
1932
|
n.key()
|
|
1687
|
-
),
|
|
1688
|
-
this.checkpointManager.isDuplicate(c,
|
|
1933
|
+
), u = s.eventId ?? this.deps.canonicalSignature(o);
|
|
1934
|
+
this.checkpointManager.isDuplicate(c, u) || !await this.shouldProcessRelativeToCheckpoint(
|
|
1689
1935
|
e,
|
|
1690
1936
|
t,
|
|
1691
|
-
n
|
|
1937
|
+
n,
|
|
1692
1938
|
o,
|
|
1939
|
+
c
|
|
1940
|
+
) || (await this.runHandlers(
|
|
1941
|
+
e,
|
|
1942
|
+
t,
|
|
1943
|
+
n.key(),
|
|
1944
|
+
a,
|
|
1693
1945
|
!1
|
|
1694
1946
|
), !this.deps.isScopeInactive(e) && this.checkpointManager.persist(
|
|
1695
1947
|
e,
|
|
1696
1948
|
t,
|
|
1697
1949
|
c,
|
|
1698
|
-
|
|
1699
|
-
|
|
1950
|
+
u ?? null,
|
|
1951
|
+
o
|
|
1700
1952
|
));
|
|
1701
1953
|
}
|
|
1702
|
-
async runHandlers(e, t, n, r,
|
|
1703
|
-
const
|
|
1704
|
-
if (
|
|
1705
|
-
for (const a of
|
|
1706
|
-
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))
|
|
1707
1959
|
break;
|
|
1708
1960
|
try {
|
|
1709
1961
|
const c = this.deps.createContext(
|
|
1710
1962
|
e,
|
|
1711
1963
|
t,
|
|
1712
1964
|
r,
|
|
1713
|
-
|
|
1965
|
+
o
|
|
1714
1966
|
);
|
|
1715
1967
|
if (!await this.deps.shouldRunHandler(a, c))
|
|
1716
1968
|
continue;
|
|
1717
|
-
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))
|
|
1718
1970
|
break;
|
|
1719
1971
|
} catch (c) {
|
|
1720
1972
|
await this.deps.handleHandlerError(e, t, c);
|
|
@@ -1722,19 +1974,41 @@ class Kn {
|
|
|
1722
1974
|
}
|
|
1723
1975
|
}
|
|
1724
1976
|
}
|
|
1977
|
+
async shouldProcessRelativeToCheckpoint(e, t, n, r, o) {
|
|
1978
|
+
if (!o?.lastEventNode)
|
|
1979
|
+
return !0;
|
|
1980
|
+
const s = this.deps.channelProcessorFor(n.blueId());
|
|
1981
|
+
if (!s || typeof s.isNewerEvent != "function")
|
|
1982
|
+
return !0;
|
|
1983
|
+
const a = {
|
|
1984
|
+
scopePath: e,
|
|
1985
|
+
blue: this.runtime.blue(),
|
|
1986
|
+
event: r.clone(),
|
|
1987
|
+
markers: t.markers(),
|
|
1988
|
+
bindingKey: n.key()
|
|
1989
|
+
};
|
|
1990
|
+
return await s.isNewerEvent(
|
|
1991
|
+
n.contract(),
|
|
1992
|
+
a,
|
|
1993
|
+
o.lastEventNode.clone()
|
|
1994
|
+
);
|
|
1995
|
+
}
|
|
1725
1996
|
}
|
|
1726
|
-
|
|
1997
|
+
function Er(i, e) {
|
|
1998
|
+
return e.isResolved() ? i.createResolvedNode(e) : i.resolve(e);
|
|
1999
|
+
}
|
|
2000
|
+
class B extends E {
|
|
1727
2001
|
constructor(e) {
|
|
1728
|
-
super(e,
|
|
2002
|
+
super(e, w.illegalState(e)), this.name = "IllegalStateException";
|
|
1729
2003
|
}
|
|
1730
2004
|
}
|
|
1731
|
-
class
|
|
2005
|
+
class A extends Error {
|
|
1732
2006
|
constructor(e) {
|
|
1733
2007
|
super(e), this.name = "BoundaryViolationException";
|
|
1734
2008
|
}
|
|
1735
2009
|
}
|
|
1736
|
-
const
|
|
1737
|
-
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 {
|
|
1738
2012
|
runtime;
|
|
1739
2013
|
contractLoader;
|
|
1740
2014
|
channelRunner;
|
|
@@ -1748,70 +2022,74 @@ class Qn {
|
|
|
1748
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;
|
|
1749
2023
|
}
|
|
1750
2024
|
async initializeScope(e, t) {
|
|
1751
|
-
const n =
|
|
1752
|
-
let
|
|
2025
|
+
const n = C(e), r = /* @__PURE__ */ new Set();
|
|
2026
|
+
let o = null, s = null;
|
|
1753
2027
|
for (t && this.runtime.gasMeter().chargeScopeEntry(n); ; ) {
|
|
1754
|
-
const
|
|
1755
|
-
if (!
|
|
2028
|
+
const g = this.nodeAt(n);
|
|
2029
|
+
if (!g)
|
|
1756
2030
|
return;
|
|
1757
|
-
|
|
1758
|
-
const
|
|
1759
|
-
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)
|
|
1760
2034
|
break;
|
|
1761
|
-
r.add(
|
|
1762
|
-
const
|
|
1763
|
-
this.nodeAt(
|
|
2035
|
+
r.add(m);
|
|
2036
|
+
const y = k(n, m);
|
|
2037
|
+
this.nodeAt(y) && await this.initializeScope(y, !0);
|
|
1764
2038
|
}
|
|
1765
|
-
if (!
|
|
2039
|
+
if (!o)
|
|
1766
2040
|
return;
|
|
1767
2041
|
const a = this.hasInitializationMarker(n);
|
|
1768
|
-
if (!a &&
|
|
1769
|
-
throw new
|
|
2042
|
+
if (!a && o.hasCheckpoint())
|
|
2043
|
+
throw new B(
|
|
1770
2044
|
`Reserved key 'checkpoint' must not appear before initialization at scope ${n}`
|
|
1771
2045
|
);
|
|
1772
2046
|
if (a)
|
|
1773
2047
|
return;
|
|
1774
2048
|
this.runtime.gasMeter().chargeInitialization();
|
|
1775
|
-
const c = this.blueId(
|
|
2049
|
+
const c = this.blueId(s ?? new h()), u = this.createLifecycleEvent(c), d = this.hooks.createContext(
|
|
1776
2050
|
n,
|
|
1777
|
-
|
|
1778
|
-
|
|
2051
|
+
o,
|
|
2052
|
+
u,
|
|
1779
2053
|
!1,
|
|
1780
2054
|
!0
|
|
1781
2055
|
);
|
|
1782
|
-
await this.deliverLifecycle(n,
|
|
2056
|
+
await this.deliverLifecycle(n, o, u, !0), await this.addInitializationMarker(d, c);
|
|
1783
2057
|
}
|
|
1784
2058
|
loadBundles(e) {
|
|
1785
|
-
const t =
|
|
2059
|
+
const t = C(e);
|
|
1786
2060
|
if (this.bundles.has(t))
|
|
1787
2061
|
return;
|
|
1788
|
-
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();
|
|
1789
2063
|
this.bundles.set(t, r);
|
|
1790
|
-
for (const
|
|
1791
|
-
const
|
|
1792
|
-
this.loadBundles(
|
|
2064
|
+
for (const o of r.embeddedPaths()) {
|
|
2065
|
+
const s = k(t, o);
|
|
2066
|
+
this.loadBundles(s);
|
|
1793
2067
|
}
|
|
1794
2068
|
}
|
|
1795
2069
|
async processExternalEvent(e, t) {
|
|
1796
|
-
const n =
|
|
2070
|
+
const n = Er(this.runtime.blue(), t);
|
|
2071
|
+
await this.processPreparedExternalEvent(e, n);
|
|
2072
|
+
}
|
|
2073
|
+
async processPreparedExternalEvent(e, t) {
|
|
2074
|
+
const n = C(e);
|
|
1797
2075
|
if (this.hooks.isScopeInactive(n))
|
|
1798
2076
|
return;
|
|
1799
2077
|
this.runtime.gasMeter().chargeScopeEntry(n);
|
|
1800
2078
|
const r = await this.processEmbeddedChildren(n, t);
|
|
1801
2079
|
if (!r)
|
|
1802
2080
|
return;
|
|
1803
|
-
const
|
|
1804
|
-
if (
|
|
2081
|
+
const o = r.channelsOfType();
|
|
2082
|
+
if (o.length === 0) {
|
|
1805
2083
|
this.finalizeScope(n, r);
|
|
1806
2084
|
return;
|
|
1807
2085
|
}
|
|
1808
|
-
for (const
|
|
2086
|
+
for (const s of o) {
|
|
1809
2087
|
if (this.hooks.isScopeInactive(n))
|
|
1810
2088
|
break;
|
|
1811
|
-
|
|
2089
|
+
he(s.blueId()) || await this.channelRunner.runExternalChannel(
|
|
1812
2090
|
n,
|
|
1813
2091
|
r,
|
|
1814
|
-
|
|
2092
|
+
s,
|
|
1815
2093
|
t
|
|
1816
2094
|
);
|
|
1817
2095
|
}
|
|
@@ -1826,13 +2104,13 @@ class Qn {
|
|
|
1826
2104
|
n,
|
|
1827
2105
|
r
|
|
1828
2106
|
);
|
|
1829
|
-
} catch (
|
|
1830
|
-
if (
|
|
1831
|
-
const
|
|
1832
|
-
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);
|
|
1833
2111
|
return;
|
|
1834
2112
|
}
|
|
1835
|
-
throw
|
|
2113
|
+
throw o;
|
|
1836
2114
|
}
|
|
1837
2115
|
try {
|
|
1838
2116
|
switch (n.op) {
|
|
@@ -1846,59 +2124,59 @@ class Qn {
|
|
|
1846
2124
|
default:
|
|
1847
2125
|
break;
|
|
1848
2126
|
}
|
|
1849
|
-
const
|
|
1850
|
-
if (!
|
|
2127
|
+
const o = this.runtime.applyPatch(e, n);
|
|
2128
|
+
if (!o)
|
|
1851
2129
|
return;
|
|
1852
|
-
await this.markCutOffChildrenIfNeeded(e, t,
|
|
1853
|
-
for (const
|
|
1854
|
-
const a = this.bundles.get(
|
|
1855
|
-
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))
|
|
1856
2134
|
continue;
|
|
1857
|
-
const c = this.createDocumentUpdateEvent(
|
|
1858
|
-
|
|
2135
|
+
const c = this.createDocumentUpdateEvent(o, s), u = a.channelsOfType(
|
|
2136
|
+
wr
|
|
1859
2137
|
);
|
|
1860
|
-
for (const
|
|
1861
|
-
const
|
|
2138
|
+
for (const d of u) {
|
|
2139
|
+
const g = d.contract();
|
|
1862
2140
|
if (this.matchesDocumentUpdate(
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
2141
|
+
s,
|
|
2142
|
+
g.path ?? null,
|
|
2143
|
+
o.path
|
|
1866
2144
|
) && (await this.channelRunner.runHandlers(
|
|
1867
|
-
|
|
2145
|
+
s,
|
|
1868
2146
|
a,
|
|
1869
|
-
|
|
2147
|
+
d.key(),
|
|
1870
2148
|
c,
|
|
1871
2149
|
!1
|
|
1872
|
-
), this.hooks.isScopeInactive(
|
|
2150
|
+
), this.hooks.isScopeInactive(s)))
|
|
1873
2151
|
break;
|
|
1874
2152
|
}
|
|
1875
2153
|
}
|
|
1876
|
-
} catch (
|
|
1877
|
-
if (
|
|
1878
|
-
const
|
|
1879
|
-
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);
|
|
1880
2158
|
return;
|
|
1881
2159
|
}
|
|
1882
|
-
if (
|
|
1883
|
-
const
|
|
1884
|
-
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);
|
|
1885
2163
|
return;
|
|
1886
2164
|
}
|
|
1887
|
-
throw
|
|
2165
|
+
throw o;
|
|
1888
2166
|
}
|
|
1889
2167
|
}
|
|
1890
2168
|
}
|
|
1891
2169
|
async deliverLifecycle(e, t, n, r) {
|
|
1892
2170
|
if (this.runtime.gasMeter().chargeLifecycleDelivery(), await this.hooks.recordLifecycleForBridging(e, n), !t)
|
|
1893
2171
|
return;
|
|
1894
|
-
const
|
|
1895
|
-
|
|
2172
|
+
const o = t.channelsOfType(
|
|
2173
|
+
vr
|
|
1896
2174
|
);
|
|
1897
|
-
for (const
|
|
2175
|
+
for (const s of o)
|
|
1898
2176
|
if (await this.channelRunner.runHandlers(
|
|
1899
2177
|
e,
|
|
1900
2178
|
t,
|
|
1901
|
-
|
|
2179
|
+
s.key(),
|
|
1902
2180
|
n,
|
|
1903
2181
|
!0
|
|
1904
2182
|
), this.hooks.isScopeInactive(e))
|
|
@@ -1906,24 +2184,24 @@ class Qn {
|
|
|
1906
2184
|
r && await this.finalizeScope(e, t);
|
|
1907
2185
|
}
|
|
1908
2186
|
async processEmbeddedChildren(e, t) {
|
|
1909
|
-
const n =
|
|
1910
|
-
let
|
|
1911
|
-
for (;
|
|
1912
|
-
const
|
|
1913
|
-
if (!
|
|
1914
|
-
return
|
|
1915
|
-
r.add(
|
|
1916
|
-
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);
|
|
1917
2195
|
if (a === n || this.hooks.isScopeInactive(a)) {
|
|
1918
|
-
|
|
2196
|
+
o = this.refreshBundle(n);
|
|
1919
2197
|
continue;
|
|
1920
2198
|
}
|
|
1921
|
-
this.nodeAt(a) && (await this.initializeScope(a, !1), await this.
|
|
2199
|
+
this.nodeAt(a) && (await this.initializeScope(a, !1), await this.processPreparedExternalEvent(a, t)), o = this.refreshBundle(n);
|
|
1922
2200
|
}
|
|
1923
2201
|
return null;
|
|
1924
2202
|
}
|
|
1925
2203
|
refreshBundle(e) {
|
|
1926
|
-
const t =
|
|
2204
|
+
const t = C(e), n = this.nodeAt(t);
|
|
1927
2205
|
if (!n)
|
|
1928
2206
|
return this.bundles.delete(t), null;
|
|
1929
2207
|
const r = this.loadBundle(n, t);
|
|
@@ -1941,12 +2219,12 @@ class Qn {
|
|
|
1941
2219
|
try {
|
|
1942
2220
|
return this.contractLoader.load(e, t);
|
|
1943
2221
|
} catch (n) {
|
|
1944
|
-
if (n instanceof
|
|
2222
|
+
if (n instanceof E || n instanceof K)
|
|
1945
2223
|
throw n;
|
|
1946
2224
|
const r = n?.message ?? "Failed to load contracts";
|
|
1947
|
-
throw new
|
|
2225
|
+
throw new E(
|
|
1948
2226
|
r,
|
|
1949
|
-
|
|
2227
|
+
w.runtimeFatal(
|
|
1950
2228
|
`Failed to load contracts for scope ${t}`,
|
|
1951
2229
|
n
|
|
1952
2230
|
)
|
|
@@ -1954,7 +2232,7 @@ class Qn {
|
|
|
1954
2232
|
}
|
|
1955
2233
|
}
|
|
1956
2234
|
async addInitializationMarker(e, t) {
|
|
1957
|
-
const n = new
|
|
2235
|
+
const n = new h().setType(new h().setBlueId(De)).addProperty("documentId", new h().setValue(t)), r = e.resolvePointer(ce);
|
|
1958
2236
|
await e.applyPatch({
|
|
1959
2237
|
op: "ADD",
|
|
1960
2238
|
path: r,
|
|
@@ -1968,20 +2246,20 @@ class Qn {
|
|
|
1968
2246
|
if (this.hooks.isScopeInactive(e) || t.embeddedPaths().length === 0)
|
|
1969
2247
|
return;
|
|
1970
2248
|
const n = t.channelsOfType(
|
|
1971
|
-
|
|
2249
|
+
Cr
|
|
1972
2250
|
);
|
|
1973
2251
|
if (n.length !== 0)
|
|
1974
2252
|
for (const r of t.embeddedPaths()) {
|
|
1975
|
-
const
|
|
2253
|
+
const o = k(e, r), a = this.runtime.scope(o).drainBridgeableEvents();
|
|
1976
2254
|
if (a.length !== 0)
|
|
1977
2255
|
for (const c of a) {
|
|
1978
|
-
let
|
|
1979
|
-
for (const
|
|
1980
|
-
const
|
|
1981
|
-
|
|
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(
|
|
1982
2260
|
e,
|
|
1983
2261
|
t,
|
|
1984
|
-
|
|
2262
|
+
d.key(),
|
|
1985
2263
|
c.clone(),
|
|
1986
2264
|
!1
|
|
1987
2265
|
));
|
|
@@ -1993,18 +2271,18 @@ class Qn {
|
|
|
1993
2271
|
if (this.hooks.isScopeInactive(e))
|
|
1994
2272
|
return;
|
|
1995
2273
|
const n = this.runtime.scope(e), r = t.channelsOfType(
|
|
1996
|
-
|
|
2274
|
+
Sr
|
|
1997
2275
|
);
|
|
1998
2276
|
if (r.length === 0) {
|
|
1999
2277
|
n.clearTriggered();
|
|
2000
2278
|
return;
|
|
2001
2279
|
}
|
|
2002
2280
|
for (; !n.triggeredIsEmpty(); ) {
|
|
2003
|
-
const
|
|
2004
|
-
if (!
|
|
2281
|
+
const o = n.pollTriggered();
|
|
2282
|
+
if (!o)
|
|
2005
2283
|
break;
|
|
2006
2284
|
this.runtime.gasMeter().chargeDrainEvent();
|
|
2007
|
-
for (const
|
|
2285
|
+
for (const s of r) {
|
|
2008
2286
|
if (this.hooks.isScopeInactive(e)) {
|
|
2009
2287
|
n.clearTriggered();
|
|
2010
2288
|
return;
|
|
@@ -2012,8 +2290,8 @@ class Qn {
|
|
|
2012
2290
|
if (await this.channelRunner.runHandlers(
|
|
2013
2291
|
e,
|
|
2014
2292
|
t,
|
|
2015
|
-
|
|
2016
|
-
|
|
2293
|
+
s.key(),
|
|
2294
|
+
o.clone(),
|
|
2017
2295
|
!1
|
|
2018
2296
|
), this.hooks.isScopeInactive(e)) {
|
|
2019
2297
|
n.clearTriggered();
|
|
@@ -2023,185 +2301,185 @@ class Qn {
|
|
|
2023
2301
|
}
|
|
2024
2302
|
}
|
|
2025
2303
|
validatePatchBoundary(e, t, n) {
|
|
2026
|
-
const r =
|
|
2027
|
-
if (
|
|
2028
|
-
throw new
|
|
2304
|
+
const r = C(e), o = T(n.path);
|
|
2305
|
+
if (o === r)
|
|
2306
|
+
throw new A(
|
|
2029
2307
|
`Self-root mutation is forbidden at scope ${r}`
|
|
2030
2308
|
);
|
|
2031
|
-
if (r !== "/" && !
|
|
2032
|
-
throw new
|
|
2033
|
-
`Patch path ${
|
|
2309
|
+
if (r !== "/" && !o.startsWith(`${r}/`))
|
|
2310
|
+
throw new A(
|
|
2311
|
+
`Patch path ${o} is outside scope ${r}`
|
|
2034
2312
|
);
|
|
2035
|
-
for (const
|
|
2036
|
-
const a =
|
|
2037
|
-
if (
|
|
2038
|
-
throw new
|
|
2039
|
-
`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}`
|
|
2040
2318
|
);
|
|
2041
2319
|
}
|
|
2042
2320
|
}
|
|
2043
2321
|
enforceReservedKeyWriteProtection(e, t, n) {
|
|
2044
2322
|
if (n)
|
|
2045
2323
|
return;
|
|
2046
|
-
const r =
|
|
2047
|
-
for (const
|
|
2048
|
-
const a =
|
|
2324
|
+
const r = C(e), o = T(t.path);
|
|
2325
|
+
for (const s of de) {
|
|
2326
|
+
const a = k(
|
|
2049
2327
|
r,
|
|
2050
|
-
|
|
2328
|
+
Z(s)
|
|
2051
2329
|
);
|
|
2052
|
-
if (
|
|
2053
|
-
throw new
|
|
2054
|
-
`Reserved key '${
|
|
2330
|
+
if (o === a || o.startsWith(`${a}/`))
|
|
2331
|
+
throw new A(
|
|
2332
|
+
`Reserved key '${s}' is write-protected at ${a}`
|
|
2055
2333
|
);
|
|
2056
2334
|
}
|
|
2057
2335
|
}
|
|
2058
2336
|
async markCutOffChildrenIfNeeded(e, t, n) {
|
|
2059
2337
|
if (t.embeddedPaths().length === 0)
|
|
2060
2338
|
return;
|
|
2061
|
-
const r =
|
|
2062
|
-
for (const
|
|
2063
|
-
const
|
|
2064
|
-
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);
|
|
2065
2343
|
}
|
|
2066
2344
|
}
|
|
2067
2345
|
hasInitializationMarker(e) {
|
|
2068
|
-
const t =
|
|
2346
|
+
const t = k(e, ce), n = this.nodeAt(t);
|
|
2069
2347
|
if (!n)
|
|
2070
2348
|
return !1;
|
|
2071
|
-
if (!(n instanceof
|
|
2072
|
-
const
|
|
2073
|
-
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);
|
|
2074
2352
|
}
|
|
2075
|
-
if (n.getType()?.getBlueId() !==
|
|
2076
|
-
const
|
|
2077
|
-
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);
|
|
2078
2356
|
}
|
|
2079
2357
|
return !0;
|
|
2080
2358
|
}
|
|
2081
2359
|
createLifecycleEvent(e) {
|
|
2082
|
-
return new
|
|
2083
|
-
type: new
|
|
2084
|
-
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)
|
|
2085
2363
|
});
|
|
2086
2364
|
}
|
|
2087
2365
|
}
|
|
2088
|
-
class
|
|
2366
|
+
class Y extends Error {
|
|
2089
2367
|
constructor(e) {
|
|
2090
2368
|
super(
|
|
2091
2369
|
e ? "Processing terminated due to fatal error" : "Processing terminated"
|
|
2092
2370
|
), this.fatal = e, this.name = "RunTerminationError";
|
|
2093
2371
|
}
|
|
2094
2372
|
}
|
|
2095
|
-
const
|
|
2096
|
-
class
|
|
2373
|
+
const Tr = p["Core/Processing Terminated Marker"], Ir = p["Core/Document Processing Terminated"];
|
|
2374
|
+
class Rr {
|
|
2097
2375
|
constructor(e) {
|
|
2098
2376
|
this.runtime = e;
|
|
2099
2377
|
}
|
|
2100
|
-
async terminateScope(e, t, n, r,
|
|
2101
|
-
e.recordPendingTermination(t, r,
|
|
2102
|
-
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);
|
|
2103
2381
|
this.runtime.directWrite(
|
|
2104
2382
|
a,
|
|
2105
|
-
|
|
2383
|
+
Pr(this.runtime.blue(), r, o)
|
|
2106
2384
|
), this.runtime.gasMeter().chargeTerminationMarker();
|
|
2107
|
-
const c = n ?? e.bundleForScope(
|
|
2385
|
+
const c = n ?? e.bundleForScope(s) ?? null, u = Mr(r, o);
|
|
2108
2386
|
if (await e.deliverLifecycle(
|
|
2109
|
-
|
|
2387
|
+
s,
|
|
2110
2388
|
c,
|
|
2111
|
-
|
|
2389
|
+
u,
|
|
2112
2390
|
!1
|
|
2113
|
-
), this.runtime.scope(
|
|
2114
|
-
throw this.runtime.markRunTerminated(), new
|
|
2115
|
-
if (r === "GRACEFUL" &&
|
|
2116
|
-
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);
|
|
2117
2395
|
}
|
|
2118
2396
|
}
|
|
2119
|
-
function
|
|
2120
|
-
return
|
|
2121
|
-
type: { blueId:
|
|
2397
|
+
function Pr(i, e, t) {
|
|
2398
|
+
return Nr(i, {
|
|
2399
|
+
type: { blueId: Tr },
|
|
2122
2400
|
cause: e === "GRACEFUL" ? "graceful" : "fatal",
|
|
2123
2401
|
...t ? { reason: t } : {}
|
|
2124
2402
|
});
|
|
2125
2403
|
}
|
|
2126
|
-
function
|
|
2127
|
-
const t = new
|
|
2128
|
-
new
|
|
2404
|
+
function Mr(i, e) {
|
|
2405
|
+
const t = new h().setType(
|
|
2406
|
+
new h().setBlueId(Ir)
|
|
2129
2407
|
);
|
|
2130
2408
|
return t.addProperty(
|
|
2131
2409
|
"cause",
|
|
2132
|
-
new
|
|
2133
|
-
), e && t.addProperty("reason", new
|
|
2410
|
+
new h().setValue(i === "GRACEFUL" ? "graceful" : "fatal")
|
|
2411
|
+
), e && t.addProperty("reason", new h().setValue(e)), t;
|
|
2134
2412
|
}
|
|
2135
|
-
function
|
|
2413
|
+
function Nr(i, e) {
|
|
2136
2414
|
return i.jsonValueToNode(e);
|
|
2137
2415
|
}
|
|
2138
|
-
const
|
|
2139
|
-
class
|
|
2416
|
+
const V = "-";
|
|
2417
|
+
class Or {
|
|
2140
2418
|
constructor(e) {
|
|
2141
2419
|
this.document = e;
|
|
2142
2420
|
}
|
|
2143
2421
|
applyPatch(e, t) {
|
|
2144
|
-
const n =
|
|
2422
|
+
const n = C(e), r = T(t.path), o = Le(r), s = Be(this.document, o, "before", r);
|
|
2145
2423
|
switch (t.op) {
|
|
2146
2424
|
case "ADD":
|
|
2147
|
-
this.applyAdd(
|
|
2425
|
+
this.applyAdd(o, r, t.val ?? null);
|
|
2148
2426
|
break;
|
|
2149
2427
|
case "REPLACE":
|
|
2150
|
-
this.applyReplace(
|
|
2428
|
+
this.applyReplace(o, r, t.val ?? null);
|
|
2151
2429
|
break;
|
|
2152
2430
|
case "REMOVE":
|
|
2153
|
-
this.applyRemove(
|
|
2431
|
+
this.applyRemove(o, r);
|
|
2154
2432
|
break;
|
|
2155
2433
|
}
|
|
2156
|
-
const a = t.op === "REMOVE" ? null :
|
|
2434
|
+
const a = t.op === "REMOVE" ? null : Be(this.document, o, "after", r);
|
|
2157
2435
|
return {
|
|
2158
2436
|
path: r,
|
|
2159
|
-
before:
|
|
2437
|
+
before: s,
|
|
2160
2438
|
after: a,
|
|
2161
2439
|
op: t.op.toLowerCase(),
|
|
2162
2440
|
originScope: n,
|
|
2163
|
-
cascadeScopes:
|
|
2441
|
+
cascadeScopes: Ar(n)
|
|
2164
2442
|
};
|
|
2165
2443
|
}
|
|
2166
2444
|
directWrite(e, t) {
|
|
2167
|
-
const n =
|
|
2445
|
+
const n = T(e);
|
|
2168
2446
|
if (n === "/")
|
|
2169
2447
|
throw new Error("Direct write cannot target root document");
|
|
2170
|
-
const r =
|
|
2171
|
-
if (
|
|
2448
|
+
const r = Le(n), { parent: o, leaf: s } = this.resolveParent(r);
|
|
2449
|
+
if (s === V)
|
|
2172
2450
|
throw new Error(
|
|
2173
2451
|
`Direct write does not support append token '-' for path ${n}`
|
|
2174
2452
|
);
|
|
2175
|
-
const a =
|
|
2176
|
-
if (a &&
|
|
2177
|
-
this.directWriteArray(
|
|
2453
|
+
const a = o.getItems();
|
|
2454
|
+
if (a && D(s)) {
|
|
2455
|
+
this.directWriteArray(o, a, s, t, n);
|
|
2178
2456
|
return;
|
|
2179
2457
|
}
|
|
2180
|
-
this.directWriteObject(
|
|
2458
|
+
this.directWriteObject(o, s, t);
|
|
2181
2459
|
}
|
|
2182
|
-
directWriteArray(e, t, n, r,
|
|
2183
|
-
const
|
|
2460
|
+
directWriteArray(e, t, n, r, o) {
|
|
2461
|
+
const s = se(e, t), a = M(n, o);
|
|
2184
2462
|
if (r == null) {
|
|
2185
|
-
if (a < 0 || a >=
|
|
2463
|
+
if (a < 0 || a >= s.length)
|
|
2186
2464
|
return;
|
|
2187
|
-
|
|
2465
|
+
s.splice(a, 1), e.setItems(s);
|
|
2188
2466
|
return;
|
|
2189
2467
|
}
|
|
2190
2468
|
const c = r.clone();
|
|
2191
|
-
if (a ===
|
|
2192
|
-
|
|
2469
|
+
if (a === s.length) {
|
|
2470
|
+
s.push(c), e.setItems(s);
|
|
2193
2471
|
return;
|
|
2194
2472
|
}
|
|
2195
|
-
if (a >= 0 && a <
|
|
2196
|
-
|
|
2473
|
+
if (a >= 0 && a < s.length) {
|
|
2474
|
+
s[a] = c, e.setItems(s);
|
|
2197
2475
|
return;
|
|
2198
2476
|
}
|
|
2199
2477
|
throw new Error(
|
|
2200
|
-
`Array index out of bounds for direct write: ${
|
|
2478
|
+
`Array index out of bounds for direct write: ${o}`
|
|
2201
2479
|
);
|
|
2202
2480
|
}
|
|
2203
2481
|
directWriteObject(e, t, n) {
|
|
2204
|
-
const r =
|
|
2482
|
+
const r = J(e);
|
|
2205
2483
|
if (n == null) {
|
|
2206
2484
|
delete r[t], e.setProperties(
|
|
2207
2485
|
Object.keys(r).length > 0 ? r : void 0
|
|
@@ -2221,55 +2499,55 @@ class rr {
|
|
|
2221
2499
|
return { parent: t, leaf: e[e.length - 1] };
|
|
2222
2500
|
}
|
|
2223
2501
|
getOrCreateChild(e, t, n, r) {
|
|
2224
|
-
if (t ===
|
|
2502
|
+
if (t === V)
|
|
2225
2503
|
throw new Error(
|
|
2226
|
-
`Append token '-' must be final segment: ${
|
|
2504
|
+
`Append token '-' must be final segment: ${z(n, r)}`
|
|
2227
2505
|
);
|
|
2228
|
-
const
|
|
2229
|
-
if (
|
|
2230
|
-
const c =
|
|
2231
|
-
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)
|
|
2232
2510
|
throw new Error(
|
|
2233
|
-
`Array index out of bounds: ${
|
|
2511
|
+
`Array index out of bounds: ${z(n, r)}`
|
|
2234
2512
|
);
|
|
2235
|
-
const
|
|
2236
|
-
if (!
|
|
2513
|
+
const u = o[c];
|
|
2514
|
+
if (!u)
|
|
2237
2515
|
throw new Error(
|
|
2238
|
-
`Path does not exist: ${
|
|
2516
|
+
`Path does not exist: ${z(n, r)}`
|
|
2239
2517
|
);
|
|
2240
|
-
return
|
|
2518
|
+
return u;
|
|
2241
2519
|
}
|
|
2242
|
-
const
|
|
2243
|
-
let a =
|
|
2244
|
-
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;
|
|
2245
2523
|
}
|
|
2246
2524
|
applyAdd(e, t, n) {
|
|
2247
2525
|
if (t === "/" || t.length === 0)
|
|
2248
2526
|
throw new Error("ADD operation cannot target document root");
|
|
2249
|
-
const { parent: r, key:
|
|
2527
|
+
const { parent: r, key: o, pointer: s, created: a } = this.resolveParentForPatch(
|
|
2250
2528
|
e,
|
|
2251
2529
|
t,
|
|
2252
2530
|
"ADD"
|
|
2253
2531
|
);
|
|
2254
2532
|
try {
|
|
2255
|
-
if (
|
|
2256
|
-
const
|
|
2257
|
-
if (!
|
|
2533
|
+
if (D(o)) {
|
|
2534
|
+
const u = r.getItems(), d = o === V;
|
|
2535
|
+
if (!u)
|
|
2258
2536
|
throw new Error(
|
|
2259
|
-
|
|
2537
|
+
d ? `Append token '-' requires array at ${s}` : `Array index segment requires array at ${s}`
|
|
2260
2538
|
);
|
|
2261
|
-
if (
|
|
2262
|
-
|
|
2539
|
+
if (d) {
|
|
2540
|
+
se(r, u).push($(n));
|
|
2263
2541
|
return;
|
|
2264
2542
|
}
|
|
2265
|
-
const
|
|
2266
|
-
if (
|
|
2543
|
+
const g = M(o, t);
|
|
2544
|
+
if (g < 0 || g > u.length)
|
|
2267
2545
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2268
|
-
|
|
2546
|
+
se(r, u).splice(g, 0, $(n));
|
|
2269
2547
|
return;
|
|
2270
2548
|
}
|
|
2271
|
-
const c =
|
|
2272
|
-
c[
|
|
2549
|
+
const c = J(r);
|
|
2550
|
+
c[o] = $(n), r.setProperties(c);
|
|
2273
2551
|
} catch (c) {
|
|
2274
2552
|
throw this.rollbackCreated(a), c;
|
|
2275
2553
|
}
|
|
@@ -2277,26 +2555,26 @@ class rr {
|
|
|
2277
2555
|
applyReplace(e, t, n) {
|
|
2278
2556
|
if (t === "/" || t.length === 0)
|
|
2279
2557
|
throw new Error("REPLACE operation cannot target document root");
|
|
2280
|
-
const { parent: r, key:
|
|
2558
|
+
const { parent: r, key: o, created: s } = this.resolveParentForPatch(
|
|
2281
2559
|
e,
|
|
2282
2560
|
t,
|
|
2283
2561
|
"REPLACE"
|
|
2284
2562
|
);
|
|
2285
2563
|
try {
|
|
2286
|
-
if (
|
|
2564
|
+
if (D(o)) {
|
|
2287
2565
|
const c = r.getItems();
|
|
2288
2566
|
if (!c)
|
|
2289
2567
|
throw new Error(`Array index segment requires array at ${t}`);
|
|
2290
|
-
const
|
|
2291
|
-
if (
|
|
2568
|
+
const u = M(o, t);
|
|
2569
|
+
if (u < 0 || u >= c.length)
|
|
2292
2570
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2293
|
-
c[
|
|
2571
|
+
c[u] = $(n), r.setItems(c);
|
|
2294
2572
|
return;
|
|
2295
2573
|
}
|
|
2296
|
-
const a =
|
|
2297
|
-
a[
|
|
2574
|
+
const a = J(r);
|
|
2575
|
+
a[o] = $(n), r.setProperties(a);
|
|
2298
2576
|
} catch (a) {
|
|
2299
|
-
throw this.rollbackCreated(
|
|
2577
|
+
throw this.rollbackCreated(s), a;
|
|
2300
2578
|
}
|
|
2301
2579
|
}
|
|
2302
2580
|
applyRemove(e, t) {
|
|
@@ -2307,61 +2585,61 @@ class rr {
|
|
|
2307
2585
|
t,
|
|
2308
2586
|
"REMOVE"
|
|
2309
2587
|
);
|
|
2310
|
-
if (
|
|
2588
|
+
if (D(r)) {
|
|
2311
2589
|
const a = n.getItems();
|
|
2312
2590
|
if (!a)
|
|
2313
2591
|
throw new Error(`Array index segment requires array at ${t}`);
|
|
2314
|
-
const c =
|
|
2592
|
+
const c = M(r, t);
|
|
2315
2593
|
if (c < 0 || c >= a.length)
|
|
2316
2594
|
throw new Error(`Array index out of bounds in path: ${t}`);
|
|
2317
2595
|
a.splice(c, 1), n.setItems(a);
|
|
2318
2596
|
return;
|
|
2319
2597
|
}
|
|
2320
|
-
const
|
|
2321
|
-
if (!
|
|
2598
|
+
const o = n.getProperties();
|
|
2599
|
+
if (!o || !Object.prototype.hasOwnProperty.call(o, r))
|
|
2322
2600
|
throw new Error(`Path does not exist: ${t}`);
|
|
2323
|
-
const
|
|
2324
|
-
delete
|
|
2601
|
+
const s = { ...o };
|
|
2602
|
+
delete s[r], n.setProperties(s);
|
|
2325
2603
|
}
|
|
2326
2604
|
resolveParentForPatch(e, t, n) {
|
|
2327
2605
|
if (e.length === 0)
|
|
2328
2606
|
throw new Error(`${n} operation cannot target document root`);
|
|
2329
2607
|
let r = this.document;
|
|
2330
|
-
const
|
|
2608
|
+
const o = [];
|
|
2331
2609
|
for (let a = 0; a < e.length - 1; a += 1) {
|
|
2332
|
-
const c = e[a],
|
|
2333
|
-
if (
|
|
2334
|
-
const
|
|
2335
|
-
if (!
|
|
2336
|
-
throw new Error(`Array index segment requires array at ${
|
|
2337
|
-
const
|
|
2338
|
-
if (
|
|
2339
|
-
throw new Error(`Array index out of bounds in path: ${
|
|
2340
|
-
const
|
|
2341
|
-
if (!(
|
|
2342
|
-
throw new Error(`Array index out of bounds in path: ${
|
|
2343
|
-
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;
|
|
2344
2622
|
continue;
|
|
2345
2623
|
}
|
|
2346
|
-
let
|
|
2347
|
-
if (!(
|
|
2624
|
+
let d = r.getProperties(), g = d?.[c] ?? null;
|
|
2625
|
+
if (!(g instanceof h)) {
|
|
2348
2626
|
if (n === "REMOVE")
|
|
2349
|
-
throw new Error(`Path does not exist: ${
|
|
2350
|
-
|
|
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 });
|
|
2351
2629
|
}
|
|
2352
|
-
r =
|
|
2630
|
+
r = g;
|
|
2353
2631
|
}
|
|
2354
|
-
const
|
|
2355
|
-
return { parent: r, key:
|
|
2632
|
+
const s = e[e.length - 1];
|
|
2633
|
+
return { parent: r, key: s, pointer: t, created: o };
|
|
2356
2634
|
}
|
|
2357
2635
|
rollbackCreated(e) {
|
|
2358
2636
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
2359
|
-
const { owner: n, key: r } = e[t],
|
|
2360
|
-
|
|
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));
|
|
2361
2639
|
}
|
|
2362
2640
|
}
|
|
2363
2641
|
}
|
|
2364
|
-
function
|
|
2642
|
+
function Ar(i) {
|
|
2365
2643
|
const e = [];
|
|
2366
2644
|
let t = i;
|
|
2367
2645
|
for (; e.push(t), t !== "/"; ) {
|
|
@@ -2370,51 +2648,51 @@ function ir(i) {
|
|
|
2370
2648
|
}
|
|
2371
2649
|
return e;
|
|
2372
2650
|
}
|
|
2373
|
-
function
|
|
2651
|
+
function Be(i, e, t, n) {
|
|
2374
2652
|
try {
|
|
2375
2653
|
if (e.length === 0)
|
|
2376
2654
|
return i.clone();
|
|
2377
|
-
const r =
|
|
2655
|
+
const r = Dr(i, e, t, n);
|
|
2378
2656
|
return r ? r.clone() : null;
|
|
2379
2657
|
} catch {
|
|
2380
2658
|
return null;
|
|
2381
2659
|
}
|
|
2382
2660
|
}
|
|
2383
|
-
function
|
|
2661
|
+
function Dr(i, e, t, n) {
|
|
2384
2662
|
let r = i;
|
|
2385
|
-
for (let
|
|
2386
|
-
const
|
|
2387
|
-
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)
|
|
2388
2666
|
return null;
|
|
2389
2667
|
}
|
|
2390
2668
|
return r;
|
|
2391
2669
|
}
|
|
2392
|
-
function
|
|
2670
|
+
function Br(i, e, t, n, r) {
|
|
2393
2671
|
if (!i)
|
|
2394
2672
|
return null;
|
|
2395
|
-
const
|
|
2396
|
-
if (
|
|
2397
|
-
if (e ===
|
|
2673
|
+
const o = i.getItems();
|
|
2674
|
+
if (o) {
|
|
2675
|
+
if (e === V) {
|
|
2398
2676
|
if (!t)
|
|
2399
2677
|
throw new Error(`Append token '-' must be final segment: ${r}`);
|
|
2400
|
-
return n === "before" ||
|
|
2678
|
+
return n === "before" || o.length === 0 ? null : o[o.length - 1] ?? null;
|
|
2401
2679
|
}
|
|
2402
|
-
const c =
|
|
2403
|
-
return c < 0 || c >=
|
|
2680
|
+
const c = M(e, r);
|
|
2681
|
+
return c < 0 || c >= o.length ? null : o[c] ?? null;
|
|
2404
2682
|
}
|
|
2405
|
-
const
|
|
2406
|
-
if (!
|
|
2683
|
+
const s = i.getProperties();
|
|
2684
|
+
if (!s)
|
|
2407
2685
|
return null;
|
|
2408
|
-
const a =
|
|
2409
|
-
return a instanceof
|
|
2686
|
+
const a = s[e];
|
|
2687
|
+
return a instanceof h ? a : null;
|
|
2410
2688
|
}
|
|
2411
|
-
function
|
|
2689
|
+
function Le(i) {
|
|
2412
2690
|
if (i === "/" || i === "")
|
|
2413
2691
|
return [];
|
|
2414
2692
|
const e = i.startsWith("/") ? i.slice(1) : i;
|
|
2415
2693
|
return e.length === 0 ? [] : e.split("/");
|
|
2416
2694
|
}
|
|
2417
|
-
function
|
|
2695
|
+
function M(i, e) {
|
|
2418
2696
|
const t = Number.parseInt(i, 10);
|
|
2419
2697
|
if (Number.isNaN(t))
|
|
2420
2698
|
throw new Error(`Expected numeric array index in path: ${e}`);
|
|
@@ -2422,7 +2700,7 @@ function C(i, e) {
|
|
|
2422
2700
|
throw new Error(`Negative array index in path: ${e}`);
|
|
2423
2701
|
return t;
|
|
2424
2702
|
}
|
|
2425
|
-
function
|
|
2703
|
+
function z(i, e) {
|
|
2426
2704
|
if (e <= 0)
|
|
2427
2705
|
return "/";
|
|
2428
2706
|
const t = Math.min(e, i.length);
|
|
@@ -2431,11 +2709,11 @@ function B(i, e) {
|
|
|
2431
2709
|
n += `/${i[r] ?? ""}`;
|
|
2432
2710
|
return n === "" ? "/" : n;
|
|
2433
2711
|
}
|
|
2434
|
-
function
|
|
2712
|
+
function se(i, e) {
|
|
2435
2713
|
const t = [...e];
|
|
2436
2714
|
return i.setItems(t), t;
|
|
2437
2715
|
}
|
|
2438
|
-
function
|
|
2716
|
+
function J(i) {
|
|
2439
2717
|
const e = i.getProperties();
|
|
2440
2718
|
if (!e) {
|
|
2441
2719
|
const n = {};
|
|
@@ -2444,13 +2722,13 @@ function K(i) {
|
|
|
2444
2722
|
const t = { ...e };
|
|
2445
2723
|
return i.setProperties(t), t;
|
|
2446
2724
|
}
|
|
2447
|
-
function
|
|
2448
|
-
return i ===
|
|
2725
|
+
function D(i) {
|
|
2726
|
+
return i === V || /^\d+$/.test(i);
|
|
2449
2727
|
}
|
|
2450
|
-
function
|
|
2451
|
-
return i == null ? new
|
|
2728
|
+
function $(i) {
|
|
2729
|
+
return i == null ? new h().setValue(null) : i.clone();
|
|
2452
2730
|
}
|
|
2453
|
-
class
|
|
2731
|
+
class Lr {
|
|
2454
2732
|
constructor(e) {
|
|
2455
2733
|
this.path = e;
|
|
2456
2734
|
}
|
|
@@ -2512,7 +2790,7 @@ class ar {
|
|
|
2512
2790
|
return this.cutOff;
|
|
2513
2791
|
}
|
|
2514
2792
|
}
|
|
2515
|
-
class
|
|
2793
|
+
class xr {
|
|
2516
2794
|
scopesMap = /* @__PURE__ */ new Map();
|
|
2517
2795
|
rootEmissionList = [];
|
|
2518
2796
|
scopes() {
|
|
@@ -2520,7 +2798,7 @@ class cr {
|
|
|
2520
2798
|
}
|
|
2521
2799
|
scope(e) {
|
|
2522
2800
|
let t = this.scopesMap.get(e);
|
|
2523
|
-
return t || (t = new
|
|
2801
|
+
return t || (t = new Lr(e), this.scopesMap.set(e, t)), t;
|
|
2524
2802
|
}
|
|
2525
2803
|
existingScope(e) {
|
|
2526
2804
|
return this.scopesMap.get(e);
|
|
@@ -2538,45 +2816,45 @@ class cr {
|
|
|
2538
2816
|
this.scopesMap.delete(e);
|
|
2539
2817
|
}
|
|
2540
2818
|
}
|
|
2541
|
-
function
|
|
2819
|
+
function q(i) {
|
|
2542
2820
|
return Math.floor((i + 99) / 100);
|
|
2543
2821
|
}
|
|
2544
|
-
function
|
|
2822
|
+
function ye(i) {
|
|
2545
2823
|
return new TextEncoder().encode(i).length;
|
|
2546
2824
|
}
|
|
2547
|
-
function
|
|
2548
|
-
const e =
|
|
2825
|
+
function _r(i) {
|
|
2826
|
+
const e = T(i);
|
|
2549
2827
|
return e === "/" ? 0 : e.split("/").length - 1;
|
|
2550
2828
|
}
|
|
2551
|
-
function
|
|
2552
|
-
return 100 +
|
|
2829
|
+
function Fr(i) {
|
|
2830
|
+
return 100 + q(ye(i));
|
|
2553
2831
|
}
|
|
2554
|
-
function
|
|
2832
|
+
function Ur(i) {
|
|
2555
2833
|
return 40 + 5 * Math.max(0, i);
|
|
2556
2834
|
}
|
|
2557
|
-
function
|
|
2558
|
-
return 5 +
|
|
2835
|
+
function zr(i) {
|
|
2836
|
+
return 5 + q(ye(i));
|
|
2559
2837
|
}
|
|
2560
|
-
function
|
|
2561
|
-
return 3 * Math.max(0, i) +
|
|
2838
|
+
function $r(i, e) {
|
|
2839
|
+
return 3 * Math.max(0, i) + q(ye(e));
|
|
2562
2840
|
}
|
|
2563
|
-
function
|
|
2564
|
-
return 8 +
|
|
2841
|
+
function Hr(i, e) {
|
|
2842
|
+
return 8 + _r(i) + q(e);
|
|
2565
2843
|
}
|
|
2566
|
-
const
|
|
2567
|
-
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) {
|
|
2568
2846
|
return 50 + 10 * i;
|
|
2569
2847
|
}
|
|
2570
|
-
function
|
|
2848
|
+
function ni(i) {
|
|
2571
2849
|
return 20 + i;
|
|
2572
2850
|
}
|
|
2573
|
-
function
|
|
2851
|
+
function ri(i) {
|
|
2574
2852
|
return 10 * i;
|
|
2575
2853
|
}
|
|
2576
|
-
function
|
|
2854
|
+
function ii(i) {
|
|
2577
2855
|
return 20 + i;
|
|
2578
2856
|
}
|
|
2579
|
-
class
|
|
2857
|
+
class oi {
|
|
2580
2858
|
constructor(e) {
|
|
2581
2859
|
this.blue = e;
|
|
2582
2860
|
}
|
|
@@ -2588,77 +2866,77 @@ class Ar {
|
|
|
2588
2866
|
this.total += e;
|
|
2589
2867
|
}
|
|
2590
2868
|
chargeScopeEntry(e) {
|
|
2591
|
-
this.add(
|
|
2869
|
+
this.add(ti(this.scopeDepth(e)));
|
|
2592
2870
|
}
|
|
2593
2871
|
chargeInitialization() {
|
|
2594
|
-
this.add(
|
|
2872
|
+
this.add(Vr);
|
|
2595
2873
|
}
|
|
2596
2874
|
chargeChannelMatchAttempt() {
|
|
2597
|
-
this.add(
|
|
2875
|
+
this.add(Wr);
|
|
2598
2876
|
}
|
|
2599
2877
|
chargeHandlerOverhead() {
|
|
2600
|
-
this.add(
|
|
2878
|
+
this.add(Kr);
|
|
2601
2879
|
}
|
|
2602
2880
|
chargeBoundaryCheck() {
|
|
2603
|
-
this.add(
|
|
2881
|
+
this.add(qr);
|
|
2604
2882
|
}
|
|
2605
2883
|
chargePatchAddOrReplace(e) {
|
|
2606
|
-
this.add(
|
|
2884
|
+
this.add(ni(this.payloadSizeCharge(e)));
|
|
2607
2885
|
}
|
|
2608
2886
|
chargePatchRemove() {
|
|
2609
|
-
this.add(
|
|
2887
|
+
this.add(jr);
|
|
2610
2888
|
}
|
|
2611
2889
|
chargeCascadeRouting(e) {
|
|
2612
|
-
e > 0 && this.add(
|
|
2890
|
+
e > 0 && this.add(ri(e));
|
|
2613
2891
|
}
|
|
2614
2892
|
chargeEmitEvent(e) {
|
|
2615
|
-
this.add(
|
|
2893
|
+
this.add(ii(this.payloadSizeCharge(e)));
|
|
2616
2894
|
}
|
|
2617
2895
|
chargeBridge() {
|
|
2618
|
-
this.add(
|
|
2896
|
+
this.add(Jr);
|
|
2619
2897
|
}
|
|
2620
2898
|
chargeDrainEvent() {
|
|
2621
|
-
this.add(
|
|
2899
|
+
this.add(Gr);
|
|
2622
2900
|
}
|
|
2623
2901
|
chargeCheckpointUpdate() {
|
|
2624
|
-
this.add(
|
|
2902
|
+
this.add(Qr);
|
|
2625
2903
|
}
|
|
2626
2904
|
chargeTerminationMarker() {
|
|
2627
|
-
this.add(
|
|
2905
|
+
this.add(Yr);
|
|
2628
2906
|
}
|
|
2629
2907
|
chargeLifecycleDelivery() {
|
|
2630
|
-
this.add(
|
|
2908
|
+
this.add(Xr);
|
|
2631
2909
|
}
|
|
2632
2910
|
chargeFatalTerminationOverhead() {
|
|
2633
|
-
this.add(
|
|
2911
|
+
this.add(ei);
|
|
2634
2912
|
}
|
|
2635
2913
|
chargeJavaScriptCodeBase(e) {
|
|
2636
|
-
this.add(
|
|
2914
|
+
this.add(Fr(e));
|
|
2637
2915
|
}
|
|
2638
2916
|
chargeTriggerEventBase() {
|
|
2639
|
-
this.add(
|
|
2917
|
+
this.add(Zr);
|
|
2640
2918
|
}
|
|
2641
2919
|
chargeUpdateDocumentBase(e) {
|
|
2642
|
-
this.add(
|
|
2920
|
+
this.add(Ur(e));
|
|
2643
2921
|
}
|
|
2644
2922
|
chargeExpression(e) {
|
|
2645
|
-
this.add(
|
|
2923
|
+
this.add(zr(e));
|
|
2646
2924
|
}
|
|
2647
2925
|
chargeTemplate(e, t) {
|
|
2648
|
-
this.add(
|
|
2926
|
+
this.add($r(e, t));
|
|
2649
2927
|
}
|
|
2650
2928
|
chargeDocumentSnapshot(e, t) {
|
|
2651
|
-
const n = t ?
|
|
2652
|
-
this.add(
|
|
2929
|
+
const n = t ? ve(this.blue, t) : 0;
|
|
2930
|
+
this.add(Hr(e, n));
|
|
2653
2931
|
}
|
|
2654
2932
|
payloadSizeCharge(e) {
|
|
2655
2933
|
if (!e)
|
|
2656
2934
|
return 0;
|
|
2657
|
-
const t =
|
|
2658
|
-
return
|
|
2935
|
+
const t = ve(this.blue, e);
|
|
2936
|
+
return q(t);
|
|
2659
2937
|
}
|
|
2660
2938
|
scopeDepth(e) {
|
|
2661
|
-
const t =
|
|
2939
|
+
const t = C(e);
|
|
2662
2940
|
if (t === "/" || t.length <= 1)
|
|
2663
2941
|
return 0;
|
|
2664
2942
|
let n = 1;
|
|
@@ -2667,12 +2945,12 @@ class Ar {
|
|
|
2667
2945
|
return n;
|
|
2668
2946
|
}
|
|
2669
2947
|
}
|
|
2670
|
-
class
|
|
2948
|
+
class si {
|
|
2671
2949
|
constructor(e, t) {
|
|
2672
|
-
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);
|
|
2673
2951
|
}
|
|
2674
2952
|
patchEngine;
|
|
2675
|
-
emissionRegistry = new
|
|
2953
|
+
emissionRegistry = new xr();
|
|
2676
2954
|
meter;
|
|
2677
2955
|
runTerminated = !1;
|
|
2678
2956
|
document() {
|
|
@@ -2721,66 +2999,67 @@ class Or {
|
|
|
2721
2999
|
return this.patchEngine.applyPatch(e, t);
|
|
2722
3000
|
}
|
|
2723
3001
|
}
|
|
2724
|
-
const
|
|
2725
|
-
class
|
|
3002
|
+
const ai = p["Core/Processing Initialized Marker"], ci = p["Core/Document Update"];
|
|
3003
|
+
class li {
|
|
2726
3004
|
constructor(e, t, n, r) {
|
|
2727
|
-
this.contractLoader = e, this.registry = t, this.runtimeRef = new
|
|
2728
|
-
const
|
|
2729
|
-
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(
|
|
2730
3008
|
this.runtimeRef,
|
|
2731
|
-
|
|
2732
|
-
), this.terminationService = new
|
|
3009
|
+
o
|
|
3010
|
+
), this.terminationService = new Rr(this.runtimeRef), this.channelRunner = new yr(
|
|
2733
3011
|
this.runtimeRef,
|
|
2734
3012
|
this.checkpointManager,
|
|
2735
3013
|
{
|
|
2736
|
-
evaluateChannel: async (
|
|
2737
|
-
isScopeInactive: (
|
|
2738
|
-
createContext: (
|
|
2739
|
-
|
|
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,
|
|
2740
3018
|
a,
|
|
2741
3019
|
c,
|
|
2742
|
-
|
|
3020
|
+
u,
|
|
2743
3021
|
!1
|
|
2744
3022
|
),
|
|
2745
|
-
shouldRunHandler: async (
|
|
2746
|
-
const c = this.registry.lookupHandler(
|
|
3023
|
+
shouldRunHandler: async (s, a) => {
|
|
3024
|
+
const c = this.registry.lookupHandler(s.blueId());
|
|
2747
3025
|
if (!c) {
|
|
2748
|
-
const
|
|
2749
|
-
throw new
|
|
2750
|
-
|
|
2751
|
-
|
|
3026
|
+
const d = `No processor registered for handler contract ${s.blueId()}`;
|
|
3027
|
+
throw new E(
|
|
3028
|
+
d,
|
|
3029
|
+
w.illegalState(d)
|
|
2752
3030
|
);
|
|
2753
3031
|
}
|
|
2754
|
-
const
|
|
2755
|
-
return typeof
|
|
3032
|
+
const u = c.matches;
|
|
3033
|
+
return typeof u != "function" ? !0 : await u.call(c, s.contract(), a);
|
|
2756
3034
|
},
|
|
2757
|
-
executeHandler: async (
|
|
2758
|
-
handleHandlerError: async (
|
|
2759
|
-
canonicalSignature:
|
|
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
|
|
2760
3039
|
}
|
|
2761
|
-
), this.scopeExecutor = new
|
|
3040
|
+
), this.scopeExecutor = new kr({
|
|
2762
3041
|
runtime: this.runtimeRef,
|
|
2763
3042
|
contractLoader: this.contractLoader,
|
|
2764
3043
|
channelRunner: this.channelRunner,
|
|
2765
3044
|
bundles: this.bundles,
|
|
2766
3045
|
hooks: {
|
|
2767
|
-
isScopeInactive: (
|
|
2768
|
-
createContext: (
|
|
2769
|
-
|
|
3046
|
+
isScopeInactive: (s) => this.isScopeInactive(s),
|
|
3047
|
+
createContext: (s, a, c, u, d) => this.createContext(
|
|
3048
|
+
s,
|
|
2770
3049
|
a,
|
|
2771
3050
|
c,
|
|
2772
|
-
|
|
2773
|
-
|
|
3051
|
+
u,
|
|
3052
|
+
d ?? !1
|
|
2774
3053
|
),
|
|
2775
|
-
recordLifecycleForBridging: (
|
|
2776
|
-
enterFatalTermination: (
|
|
2777
|
-
fatalReason: (
|
|
2778
|
-
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)
|
|
2779
3058
|
},
|
|
2780
|
-
blueId: (
|
|
2781
|
-
nodeAt: (
|
|
2782
|
-
createDocumentUpdateEvent: (
|
|
2783
|
-
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)
|
|
2784
3063
|
});
|
|
2785
3064
|
}
|
|
2786
3065
|
runtimeRef;
|
|
@@ -2808,19 +3087,19 @@ class Lr {
|
|
|
2808
3087
|
r
|
|
2809
3088
|
);
|
|
2810
3089
|
}
|
|
2811
|
-
createContext(e, t, n, r = !1,
|
|
2812
|
-
return new
|
|
3090
|
+
createContext(e, t, n, r = !1, o = !1) {
|
|
3091
|
+
return new ui(
|
|
2813
3092
|
this,
|
|
2814
3093
|
t,
|
|
2815
3094
|
e,
|
|
2816
3095
|
n.clone(),
|
|
2817
3096
|
r,
|
|
2818
|
-
|
|
3097
|
+
o
|
|
2819
3098
|
);
|
|
2820
3099
|
}
|
|
2821
3100
|
result() {
|
|
2822
3101
|
const e = this.runtimeRef.document().clone(), t = this.runtimeRef.rootEmissions().map((n) => n.clone());
|
|
2823
|
-
return
|
|
3102
|
+
return _e.of(
|
|
2824
3103
|
e,
|
|
2825
3104
|
t,
|
|
2826
3105
|
this.runtimeRef.totalGas()
|
|
@@ -2830,10 +3109,10 @@ class Lr {
|
|
|
2830
3109
|
return this.runtimeRef;
|
|
2831
3110
|
}
|
|
2832
3111
|
bundleForScope(e) {
|
|
2833
|
-
return this.bundles.get(
|
|
3112
|
+
return this.bundles.get(C(e));
|
|
2834
3113
|
}
|
|
2835
3114
|
isScopeInactive(e) {
|
|
2836
|
-
const t =
|
|
3115
|
+
const t = C(e);
|
|
2837
3116
|
return this.cutOffScopes.has(t) || this.pendingTerminations.has(t) || this.runtimeRef.isScopeTerminated(t);
|
|
2838
3117
|
}
|
|
2839
3118
|
async enterGracefulTermination(e, t, n) {
|
|
@@ -2843,13 +3122,13 @@ class Lr {
|
|
|
2843
3122
|
await this.terminate(e, t, "FATAL", n);
|
|
2844
3123
|
}
|
|
2845
3124
|
recordPendingTermination(e, t, n) {
|
|
2846
|
-
this.pendingTerminations.set(
|
|
3125
|
+
this.pendingTerminations.set(C(e), { kind: t, reason: n });
|
|
2847
3126
|
}
|
|
2848
3127
|
clearPendingTermination(e) {
|
|
2849
|
-
this.pendingTerminations.delete(
|
|
3128
|
+
this.pendingTerminations.delete(C(e));
|
|
2850
3129
|
}
|
|
2851
3130
|
async markCutOff(e) {
|
|
2852
|
-
const t =
|
|
3131
|
+
const t = C(e);
|
|
2853
3132
|
this.cutOffScopes.add(t) && this.runtimeRef.existingScope(t)?.markCutOff();
|
|
2854
3133
|
}
|
|
2855
3134
|
async deliverLifecycle(e, t, n, r) {
|
|
@@ -2864,14 +3143,14 @@ class Lr {
|
|
|
2864
3143
|
this.runtimeRef.scope(e).recordBridgeable(t.clone()), e === "/" && this.runtimeRef.recordRootEmission(t.clone());
|
|
2865
3144
|
}
|
|
2866
3145
|
normalizeScope(e) {
|
|
2867
|
-
return
|
|
3146
|
+
return C(e);
|
|
2868
3147
|
}
|
|
2869
3148
|
resolvePointer(e, t) {
|
|
2870
|
-
return
|
|
3149
|
+
return k(e, t);
|
|
2871
3150
|
}
|
|
2872
3151
|
async terminate(e, t, n, r) {
|
|
2873
|
-
const
|
|
2874
|
-
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(
|
|
2875
3154
|
this,
|
|
2876
3155
|
e,
|
|
2877
3156
|
t,
|
|
@@ -2880,39 +3159,41 @@ class Lr {
|
|
|
2880
3159
|
));
|
|
2881
3160
|
}
|
|
2882
3161
|
nodeAt(e) {
|
|
2883
|
-
const t =
|
|
2884
|
-
return
|
|
3162
|
+
const t = C(e);
|
|
3163
|
+
return X.nodeAt(this.runtimeRef.document(), t, {
|
|
3164
|
+
calculateBlueId: (n) => this.runtimeRef.blue().calculateBlueIdSync(n)
|
|
3165
|
+
});
|
|
2885
3166
|
}
|
|
2886
3167
|
async evaluateChannel(e, t, n, r) {
|
|
2887
|
-
const
|
|
2888
|
-
if (!
|
|
3168
|
+
const o = this.registry.lookupChannel(e.blueId());
|
|
3169
|
+
if (!o)
|
|
2889
3170
|
return { matches: !1 };
|
|
2890
|
-
const
|
|
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))
|
|
3173
|
+
return { matches: !1 };
|
|
3174
|
+
const d = {
|
|
2891
3175
|
scopePath: n,
|
|
2892
3176
|
blue: this.runtimeRef.blue(),
|
|
2893
3177
|
event: a,
|
|
2894
3178
|
markers: t.markers(),
|
|
2895
3179
|
bindingKey: e.key()
|
|
2896
3180
|
};
|
|
2897
|
-
if (!await
|
|
2898
|
-
e.contract(),
|
|
2899
|
-
c
|
|
2900
|
-
))
|
|
3181
|
+
if (!await o.matches(c, d))
|
|
2901
3182
|
return { matches: !1 };
|
|
2902
|
-
const
|
|
3183
|
+
const m = o.channelize, y = m ? m.call(o, c, d) : void 0;
|
|
2903
3184
|
return {
|
|
2904
3185
|
matches: !0,
|
|
2905
|
-
eventId:
|
|
2906
|
-
eventNode:
|
|
3186
|
+
eventId: s,
|
|
3187
|
+
eventNode: y ?? a.clone()
|
|
2907
3188
|
};
|
|
2908
3189
|
}
|
|
2909
3190
|
async executeHandler(e, t) {
|
|
2910
3191
|
const n = this.registry.lookupHandler(e.blueId());
|
|
2911
3192
|
if (!n) {
|
|
2912
3193
|
const r = `No processor registered for handler contract ${e.blueId()}`;
|
|
2913
|
-
throw new
|
|
3194
|
+
throw new E(
|
|
2914
3195
|
r,
|
|
2915
|
-
|
|
3196
|
+
w.illegalState(r)
|
|
2916
3197
|
);
|
|
2917
3198
|
}
|
|
2918
3199
|
await n.execute(e.contract(), t);
|
|
@@ -2923,7 +3204,7 @@ class Lr {
|
|
|
2923
3204
|
* the outer run logic can react according to spec (§22).
|
|
2924
3205
|
*/
|
|
2925
3206
|
async handleHandlerError(e, t, n) {
|
|
2926
|
-
if (n instanceof
|
|
3207
|
+
if (n instanceof Y || n instanceof K)
|
|
2927
3208
|
throw n;
|
|
2928
3209
|
const r = this.fatalReason(n, "Runtime fatal");
|
|
2929
3210
|
await this.enterFatalTermination(e, t, r);
|
|
@@ -2932,30 +3213,30 @@ class Lr {
|
|
|
2932
3213
|
return e instanceof Error && typeof e.message == "string" ? e.message : t;
|
|
2933
3214
|
}
|
|
2934
3215
|
createDocumentUpdateEvent(e, t) {
|
|
2935
|
-
const n =
|
|
2936
|
-
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)
|
|
2937
3218
|
);
|
|
2938
|
-
return
|
|
2939
|
-
op: new
|
|
2940
|
-
path: new
|
|
3219
|
+
return s.setProperties({
|
|
3220
|
+
op: new h().setValue(e.op),
|
|
3221
|
+
path: new h().setValue(n),
|
|
2941
3222
|
before: r,
|
|
2942
|
-
after:
|
|
2943
|
-
}),
|
|
3223
|
+
after: o
|
|
3224
|
+
}), s;
|
|
2944
3225
|
}
|
|
2945
3226
|
matchesDocumentUpdate(e, t, n) {
|
|
2946
3227
|
if (!t || t.length === 0)
|
|
2947
3228
|
return !1;
|
|
2948
|
-
const r =
|
|
2949
|
-
return r === "/" ||
|
|
3229
|
+
const r = T(k(e, t)), o = T(n);
|
|
3230
|
+
return r === "/" || o === r ? !0 : o.startsWith(`${r}/`);
|
|
2950
3231
|
}
|
|
2951
3232
|
}
|
|
2952
|
-
class
|
|
3233
|
+
class X {
|
|
2953
3234
|
constructor(e, t, n) {
|
|
2954
3235
|
this.contractLoader = e, this.registry = t, this.blue = n;
|
|
2955
3236
|
}
|
|
2956
3237
|
async initializeDocument(e) {
|
|
2957
3238
|
if (this.isInitialized(e))
|
|
2958
|
-
throw new
|
|
3239
|
+
throw new B("Document already initialized");
|
|
2959
3240
|
const t = this.createExecution(e.clone());
|
|
2960
3241
|
return this.run(e, t, async () => {
|
|
2961
3242
|
await t.initializeScope("/", !0);
|
|
@@ -2963,7 +3244,7 @@ class j {
|
|
|
2963
3244
|
}
|
|
2964
3245
|
async processDocument(e, t) {
|
|
2965
3246
|
if (!this.isInitialized(e))
|
|
2966
|
-
throw new
|
|
3247
|
+
throw new B("Document not initialized");
|
|
2967
3248
|
const n = this.createExecution(e.clone()), r = t.clone();
|
|
2968
3249
|
return this.run(e, n, async () => {
|
|
2969
3250
|
n.loadBundles("/"), await n.processExternalEvent("/", r);
|
|
@@ -2973,7 +3254,7 @@ class j {
|
|
|
2973
3254
|
return this.initializationMarker(e) != null;
|
|
2974
3255
|
}
|
|
2975
3256
|
createExecution(e) {
|
|
2976
|
-
return new
|
|
3257
|
+
return new li(
|
|
2977
3258
|
this.contractLoader,
|
|
2978
3259
|
this.registry,
|
|
2979
3260
|
this.blue,
|
|
@@ -2984,12 +3265,12 @@ class j {
|
|
|
2984
3265
|
try {
|
|
2985
3266
|
await n();
|
|
2986
3267
|
} catch (r) {
|
|
2987
|
-
if (r instanceof
|
|
3268
|
+
if (r instanceof Y)
|
|
2988
3269
|
return t.result();
|
|
2989
|
-
if (r instanceof
|
|
2990
|
-
const
|
|
2991
|
-
return
|
|
2992
|
-
|
|
3270
|
+
if (r instanceof K) {
|
|
3271
|
+
const o = e.clone();
|
|
3272
|
+
return _e.capabilityFailure(
|
|
3273
|
+
o,
|
|
2993
3274
|
r.message ?? null
|
|
2994
3275
|
);
|
|
2995
3276
|
}
|
|
@@ -2998,58 +3279,93 @@ class j {
|
|
|
2998
3279
|
return t.result();
|
|
2999
3280
|
}
|
|
3000
3281
|
initializationMarker(e) {
|
|
3001
|
-
const n = e.getProperties()?.
|
|
3282
|
+
const n = e.getProperties()?.[Ee.OBJECT_CONTRACTS]?.getProperties()?.initialized ?? null;
|
|
3002
3283
|
if (!n)
|
|
3003
3284
|
return null;
|
|
3004
|
-
if (!(n instanceof
|
|
3005
|
-
throw new
|
|
3285
|
+
if (!(n instanceof h))
|
|
3286
|
+
throw new E(
|
|
3006
3287
|
"Initialization Marker must be a BlueNode",
|
|
3007
|
-
|
|
3288
|
+
w.illegalState(
|
|
3008
3289
|
"Initialization Marker must be a BlueNode"
|
|
3009
3290
|
)
|
|
3010
3291
|
);
|
|
3011
|
-
if (n.getType()?.getBlueId() !==
|
|
3012
|
-
throw new
|
|
3292
|
+
if (n.getType()?.getBlueId() !== ai)
|
|
3293
|
+
throw new E(
|
|
3013
3294
|
"Initialization Marker must declare type 'Processing Initialized Marker'",
|
|
3014
|
-
|
|
3295
|
+
w.illegalState(
|
|
3015
3296
|
"Initialization Marker must declare type 'Processing Initialized Marker'"
|
|
3016
3297
|
)
|
|
3017
3298
|
);
|
|
3018
3299
|
return n;
|
|
3019
3300
|
}
|
|
3020
|
-
static nodeAt(e, t) {
|
|
3021
|
-
if (!(e instanceof
|
|
3301
|
+
static nodeAt(e, t, n) {
|
|
3302
|
+
if (!(e instanceof h))
|
|
3022
3303
|
return null;
|
|
3023
|
-
const
|
|
3024
|
-
if (
|
|
3304
|
+
const r = T(t);
|
|
3305
|
+
if (r === "/")
|
|
3025
3306
|
return e;
|
|
3026
|
-
const
|
|
3307
|
+
const o = r.slice(1).split("/");
|
|
3027
3308
|
let s = e;
|
|
3028
|
-
for (const
|
|
3309
|
+
for (const a of o) {
|
|
3029
3310
|
if (!s)
|
|
3030
3311
|
return null;
|
|
3031
|
-
if (!
|
|
3312
|
+
if (!a)
|
|
3032
3313
|
continue;
|
|
3033
|
-
const
|
|
3034
|
-
if (
|
|
3035
|
-
const
|
|
3036
|
-
s =
|
|
3314
|
+
const c = s.getItems();
|
|
3315
|
+
if (c && /^\d+$/.test(a)) {
|
|
3316
|
+
const g = Number.parseInt(a, 10);
|
|
3317
|
+
s = c[g] ?? null;
|
|
3037
3318
|
continue;
|
|
3038
3319
|
}
|
|
3039
|
-
const
|
|
3040
|
-
if (
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3320
|
+
const u = s.getProperties();
|
|
3321
|
+
if (u && a in u) {
|
|
3322
|
+
const g = u[a];
|
|
3323
|
+
if (!(g instanceof h))
|
|
3324
|
+
return null;
|
|
3325
|
+
s = g;
|
|
3326
|
+
continue;
|
|
3327
|
+
}
|
|
3328
|
+
const d = this.specialSegmentNode(s, a, n);
|
|
3329
|
+
if (d !== void 0) {
|
|
3330
|
+
s = d;
|
|
3331
|
+
continue;
|
|
3332
|
+
}
|
|
3333
|
+
return null;
|
|
3046
3334
|
}
|
|
3047
3335
|
return s;
|
|
3048
3336
|
}
|
|
3337
|
+
static specialSegmentNode(e, t, n) {
|
|
3338
|
+
switch (t) {
|
|
3339
|
+
case "name":
|
|
3340
|
+
return new h().setValue(e.getName() ?? null);
|
|
3341
|
+
case "description":
|
|
3342
|
+
return new h().setValue(e.getDescription() ?? null);
|
|
3343
|
+
case "type":
|
|
3344
|
+
return e.getType() ?? null;
|
|
3345
|
+
case "itemType":
|
|
3346
|
+
return e.getItemType() ?? null;
|
|
3347
|
+
case "keyType":
|
|
3348
|
+
return e.getKeyType() ?? null;
|
|
3349
|
+
case "valueType":
|
|
3350
|
+
return e.getValueType() ?? null;
|
|
3351
|
+
case "value":
|
|
3352
|
+
return new h().setValue(e.getValue() ?? null);
|
|
3353
|
+
case "blue":
|
|
3354
|
+
return e.getBlue() ?? null;
|
|
3355
|
+
case Ee.OBJECT_CONTRACTS:
|
|
3356
|
+
return new h().setContracts(e.getContracts());
|
|
3357
|
+
case "blueId": {
|
|
3358
|
+
const r = e.getBlueId() ?? n?.calculateBlueId?.(e) ?? pt.calculateBlueIdSync(e);
|
|
3359
|
+
return new h().setValue(r ?? null);
|
|
3360
|
+
}
|
|
3361
|
+
default:
|
|
3362
|
+
return;
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3049
3365
|
}
|
|
3050
|
-
class
|
|
3051
|
-
constructor(e, t, n, r,
|
|
3052
|
-
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;
|
|
3053
3369
|
}
|
|
3054
3370
|
get scopePath() {
|
|
3055
3371
|
return this.scopePathValue;
|
|
@@ -3083,7 +3399,7 @@ class _r {
|
|
|
3083
3399
|
this.shouldSkipTerminatedWork() || this.execution.runtime().addGas(e);
|
|
3084
3400
|
}
|
|
3085
3401
|
throwFatal(e) {
|
|
3086
|
-
throw new
|
|
3402
|
+
throw new E(e, w.runtimeFatal(e));
|
|
3087
3403
|
}
|
|
3088
3404
|
resolvePointer(e) {
|
|
3089
3405
|
return this.execution.resolvePointer(this.scopePathValue, e);
|
|
@@ -3102,20 +3418,26 @@ class _r {
|
|
|
3102
3418
|
if (!e)
|
|
3103
3419
|
return !1;
|
|
3104
3420
|
try {
|
|
3105
|
-
return
|
|
3421
|
+
return X.nodeAt(
|
|
3106
3422
|
this.execution.runtime().document(),
|
|
3107
|
-
e
|
|
3423
|
+
e,
|
|
3424
|
+
{
|
|
3425
|
+
calculateBlueId: (t) => this.execution.runtime().blue().calculateBlueIdSync(t)
|
|
3426
|
+
}
|
|
3108
3427
|
) != null;
|
|
3109
3428
|
} catch {
|
|
3110
3429
|
return !1;
|
|
3111
3430
|
}
|
|
3112
3431
|
}
|
|
3113
3432
|
documentNodeAt(e) {
|
|
3114
|
-
const t =
|
|
3433
|
+
const t = X.nodeAt(
|
|
3115
3434
|
this.execution.runtime().document(),
|
|
3116
|
-
e
|
|
3435
|
+
e,
|
|
3436
|
+
{
|
|
3437
|
+
calculateBlueId: (n) => this.execution.runtime().blue().calculateBlueIdSync(n)
|
|
3438
|
+
}
|
|
3117
3439
|
);
|
|
3118
|
-
return t instanceof
|
|
3440
|
+
return t instanceof h ? t : null;
|
|
3119
3441
|
}
|
|
3120
3442
|
async terminateGracefully(e) {
|
|
3121
3443
|
await this.execution.enterGracefulTermination(
|
|
@@ -3135,16 +3457,16 @@ class _r {
|
|
|
3135
3457
|
return !this.allowTerminatedWork && this.execution.isScopeInactive(this.scopePathValue);
|
|
3136
3458
|
}
|
|
3137
3459
|
}
|
|
3138
|
-
const
|
|
3139
|
-
repositories: [
|
|
3460
|
+
const di = new ft({
|
|
3461
|
+
repositories: [mt]
|
|
3140
3462
|
});
|
|
3141
|
-
class
|
|
3463
|
+
class hi {
|
|
3142
3464
|
blue;
|
|
3143
3465
|
registryRef;
|
|
3144
3466
|
contractLoaderRef;
|
|
3145
3467
|
engine;
|
|
3146
3468
|
constructor(e) {
|
|
3147
|
-
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(
|
|
3148
3470
|
this.contractLoaderRef,
|
|
3149
3471
|
this.registryRef,
|
|
3150
3472
|
this.blue
|
|
@@ -3177,14 +3499,14 @@ class xr {
|
|
|
3177
3499
|
return this.contractLoaderRef;
|
|
3178
3500
|
}
|
|
3179
3501
|
static builder() {
|
|
3180
|
-
return new
|
|
3502
|
+
return new pi();
|
|
3181
3503
|
}
|
|
3182
3504
|
}
|
|
3183
|
-
class
|
|
3505
|
+
class pi {
|
|
3184
3506
|
contractRegistry;
|
|
3185
3507
|
blueInstance;
|
|
3186
3508
|
constructor() {
|
|
3187
|
-
this.contractRegistry =
|
|
3509
|
+
this.contractRegistry = ne.create().registerDefaults().build();
|
|
3188
3510
|
}
|
|
3189
3511
|
withRegistry(e) {
|
|
3190
3512
|
return this.contractRegistry = e, this;
|
|
@@ -3196,16 +3518,16 @@ class Fr {
|
|
|
3196
3518
|
return this.blueInstance = e, this;
|
|
3197
3519
|
}
|
|
3198
3520
|
build() {
|
|
3199
|
-
return new
|
|
3521
|
+
return new hi({
|
|
3200
3522
|
registry: this.contractRegistry,
|
|
3201
3523
|
blue: this.blueInstance
|
|
3202
3524
|
});
|
|
3203
3525
|
}
|
|
3204
3526
|
}
|
|
3205
|
-
class
|
|
3527
|
+
class dt {
|
|
3206
3528
|
process(e, t) {
|
|
3207
3529
|
const n = t.getValue();
|
|
3208
|
-
if (
|
|
3530
|
+
if (G(n)) {
|
|
3209
3531
|
const r = t.clone();
|
|
3210
3532
|
return r.setValue(n), r.setProperties(void 0), r.setItems(void 0), r.setType(void 0), r;
|
|
3211
3533
|
}
|
|
@@ -3216,118 +3538,123 @@ class Ye {
|
|
|
3216
3538
|
*/
|
|
3217
3539
|
postProcess(e, t) {
|
|
3218
3540
|
const n = t.getValue();
|
|
3219
|
-
if (
|
|
3541
|
+
if (G(n) && e.getValue() !== n && n !== void 0) {
|
|
3220
3542
|
const r = e.clone();
|
|
3221
3543
|
return r.setValue(n), r;
|
|
3222
3544
|
}
|
|
3223
3545
|
return e;
|
|
3224
3546
|
}
|
|
3225
3547
|
}
|
|
3226
|
-
const
|
|
3548
|
+
const Di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3227
3549
|
__proto__: null,
|
|
3228
|
-
ExpressionPreserver:
|
|
3550
|
+
ExpressionPreserver: dt
|
|
3229
3551
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3230
|
-
function
|
|
3231
|
-
return new
|
|
3232
|
-
new
|
|
3233
|
-
new
|
|
3234
|
-
new
|
|
3235
|
-
new
|
|
3236
|
-
new
|
|
3237
|
-
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()
|
|
3238
3560
|
]);
|
|
3239
3561
|
}
|
|
3240
3562
|
export {
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
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,
|
|
3287
3609
|
en as channelEventCheckpointSchema,
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
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,
|
|
3624
|
+
G as isExpression,
|
|
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,
|
|
3635
|
+
gn as myosParticipantsOrchestrationMarkerSchema,
|
|
3636
|
+
En as myosSessionInteractionMarkerSchema,
|
|
3311
3637
|
Xt as myosTimelineChannelSchema,
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
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
|
|
3333
3660
|
};
|