@blue-labs/document-processor 3.1.0 → 3.2.0

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