@blue-labs/document-processor 2.0.0-rc.5 → 2.0.0-rc.7

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