@blue-labs/document-processor 4.0.0 → 4.0.2-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,39 +1,39 @@
1
- import { repository as Ye } from "@blue-repository/types";
2
- import { evaluate as _t } from "@blue-quickjs/quickjs-runtime";
3
- import { validateDv as Lt, DV_LIMIT_DEFAULTS as xt } from "@blue-quickjs/dv";
4
- import { HOST_V1_MANIFEST as Ft, HOST_V1_HASH as $t } from "@blue-quickjs/abi-manifest";
5
- import { BlueNode as p, withTypeBlueId as m, blueNodeField as I, Properties as Ne, MergingProcessors as L, Blue as Ut } from "@blue-labs/language";
6
- import Ae from "picomatch";
7
- import { z as l, ZodError as ve } from "zod";
1
+ import { repository as Ze } from "@blue-repository/types";
2
+ import { evaluate as Lt } from "@blue-quickjs/quickjs-runtime";
3
+ import { DV_LIMIT_DEFAULTS as xt, validateDv as Ft } from "@blue-quickjs/dv";
4
+ import { HOST_V1_MANIFEST as $t, HOST_V1_HASH as Ut } from "@blue-quickjs/abi-manifest";
5
+ import { BlueNode as p, withTypeBlueId as m, blueNodeField as I, Properties as Ae, MergingProcessors as L, Blue as zt } from "@blue-labs/language";
6
+ import De from "picomatch";
7
+ import { z as l, ZodError as we } from "zod";
8
8
  import { isNullable as ge } from "@blue-labs/shared-utils";
9
- function zt(o) {
9
+ function Vt(o) {
10
10
  return { ok: !0, value: o };
11
11
  }
12
- function Vt(o) {
12
+ function Ht(o) {
13
13
  return { ok: !1, error: o };
14
14
  }
15
- function Pi(o) {
15
+ function Ri(o) {
16
16
  return o.ok;
17
17
  }
18
- function Ri(o) {
18
+ function Mi(o) {
19
19
  return !o.ok;
20
20
  }
21
- function Mi(o, e) {
22
- return o.ok ? zt(e(o.value)) : o;
23
- }
24
21
  function Oi(o, e) {
25
- return o.ok ? o : Vt(e(o.error));
22
+ return o.ok ? Vt(e(o.value)) : o;
26
23
  }
27
24
  function Ni(o, e) {
28
- return o.ok ? e(o.value) : o;
25
+ return o.ok ? o : Ht(e(o.error));
29
26
  }
30
27
  function Ai(o, e) {
31
- return o.ok ? o.value : e;
28
+ return o.ok ? e(o.value) : o;
32
29
  }
33
30
  function Di(o, e) {
34
- return o.ok ? o.value : e(o.error);
31
+ return o.ok ? o.value : e;
35
32
  }
36
33
  function Bi(o, e) {
34
+ return o.ok ? o.value : e(o.error);
35
+ }
36
+ function _i(o, e) {
37
37
  return o.ok ? e.ok(o.value) : e.err(o.error);
38
38
  }
39
39
  const C = {
@@ -56,14 +56,14 @@ const C = {
56
56
  return { kind: "UnsupportedOp", operation: o, reason: e };
57
57
  }
58
58
  };
59
- function Ht(o) {
59
+ function Kt(o) {
60
60
  return Object.freeze([...o]);
61
61
  }
62
- const Kt = {
62
+ const Wt = {
63
63
  of(o, e, t) {
64
64
  return {
65
65
  document: o,
66
- triggeredEvents: Ht(e),
66
+ triggeredEvents: Kt(e),
67
67
  totalGas: t,
68
68
  capabilityFailure: !1,
69
69
  failureReason: null
@@ -78,75 +78,75 @@ const Kt = {
78
78
  failureReason: e ?? null
79
79
  };
80
80
  }
81
- }, Ze = Kt, S = we("core"), b = we("conversation"), q = we("myos");
82
- function we(o) {
83
- const e = Ye.packages[o];
81
+ }, Xe = Wt, S = be("core"), b = be("conversation"), q = be("myos");
82
+ function be(o) {
83
+ const e = Ze.packages[o];
84
84
  if (!e)
85
85
  throw new Error(`Missing Blue repository package ${o}.`);
86
86
  return e.aliases;
87
87
  }
88
- const Wt = [
88
+ const qt = [
89
89
  "embedded",
90
90
  "initialized",
91
91
  "terminated",
92
92
  "checkpoint"
93
- ], qt = [
93
+ ], Gt = [
94
94
  S["Core/Document Update Channel"],
95
95
  S["Core/Triggered Event Channel"],
96
96
  S["Core/Lifecycle Event Channel"],
97
97
  S["Core/Embedded Node Channel"]
98
- ], Xe = "embedded", et = "initialized", tt = "terminated", B = "checkpoint", be = new Set(
99
- Wt
100
- ), Ie = new Set(qt);
101
- function Gt(o) {
102
- return o != null && be.has(o);
103
- }
104
- function nt(o) {
105
- return o != null && Ie.has(
98
+ ], et = "embedded", tt = "initialized", nt = "terminated", B = "checkpoint", Ie = new Set(
99
+ qt
100
+ ), ke = new Set(Gt);
101
+ function jt(o) {
102
+ return o != null && Ie.has(o);
103
+ }
104
+ function rt(o) {
105
+ return o != null && ke.has(
106
106
  o
107
107
  );
108
108
  }
109
- const _i = {
110
- KEY_EMBEDDED: Xe,
111
- KEY_INITIALIZED: et,
112
- KEY_TERMINATED: tt,
109
+ const Li = {
110
+ KEY_EMBEDDED: et,
111
+ KEY_INITIALIZED: tt,
112
+ KEY_TERMINATED: nt,
113
113
  KEY_CHECKPOINT: B,
114
- RESERVED_CONTRACT_KEYS: be,
115
- PROCESSOR_MANAGED_CHANNEL_BLUE_IDS: Ie,
116
- isReservedContractKey: Gt,
117
- isProcessorManagedChannelBlueId: nt
118
- }, G = "/contracts", Ee = `${G}/${et}`, rt = `${G}/${tt}`, jt = `${G}/${Xe}`, ot = `${G}/${B}`, it = "/lastEvents", st = "/lastSignatures";
114
+ RESERVED_CONTRACT_KEYS: Ie,
115
+ PROCESSOR_MANAGED_CHANNEL_BLUE_IDS: ke,
116
+ isReservedContractKey: jt,
117
+ isProcessorManagedChannelBlueId: rt
118
+ }, G = "/contracts", Ee = `${G}/${tt}`, ot = `${G}/${nt}`, Jt = `${G}/${et}`, it = `${G}/${B}`, st = "/lastEvents", at = "/lastSignatures";
119
119
  function ae(o) {
120
120
  return `${G}/${o}`;
121
121
  }
122
- function at(o, e) {
123
- return `${ae(o)}${it}/${e}`;
124
- }
125
122
  function ct(o, e) {
126
123
  return `${ae(o)}${st}/${e}`;
127
124
  }
128
- const Li = {
125
+ function lt(o, e) {
126
+ return `${ae(o)}${at}/${e}`;
127
+ }
128
+ const xi = {
129
129
  RELATIVE_CONTRACTS: G,
130
130
  RELATIVE_INITIALIZED: Ee,
131
- RELATIVE_TERMINATED: rt,
132
- RELATIVE_EMBEDDED: jt,
133
- RELATIVE_CHECKPOINT: ot,
134
- LAST_EVENTS_SUFFIX: it,
135
- LAST_SIGNATURES_SUFFIX: st,
131
+ RELATIVE_TERMINATED: ot,
132
+ RELATIVE_EMBEDDED: Jt,
133
+ RELATIVE_CHECKPOINT: it,
134
+ LAST_EVENTS_SUFFIX: st,
135
+ LAST_SIGNATURES_SUFFIX: at,
136
136
  relativeContractsEntry: ae,
137
- relativeCheckpointLastEvent: at,
138
- relativeCheckpointLastSignature: ct
137
+ relativeCheckpointLastEvent: ct,
138
+ relativeCheckpointLastSignature: lt
139
139
  };
140
- function lt(o) {
140
+ function ut(o) {
141
141
  return o == null || o.length === 0;
142
142
  }
143
143
  function w(o) {
144
- return lt(o) ? "/" : o.startsWith("/") ? o : `/${o}`;
144
+ return ut(o) ? "/" : o.startsWith("/") ? o : `/${o}`;
145
145
  }
146
146
  function R(o) {
147
- return lt(o) ? "/" : o.startsWith("/") ? o : `/${o}`;
147
+ return ut(o) ? "/" : o.startsWith("/") ? o : `/${o}`;
148
148
  }
149
- function De(o) {
149
+ function Be(o) {
150
150
  if (o == null)
151
151
  return "";
152
152
  let e = o.trim();
@@ -158,15 +158,15 @@ function De(o) {
158
158
  e = e.substring(0, e.length - 1);
159
159
  return e;
160
160
  }
161
- function xi(o, e) {
162
- const t = De(o), n = De(e);
161
+ function Fi(o, e) {
162
+ const t = Be(o), n = Be(e);
163
163
  return t.length === 0 && n.length === 0 ? "/" : t.length === 0 ? `/${n}` : n.length === 0 ? `/${t}` : `/${t}/${n}`;
164
164
  }
165
165
  function k(o, e) {
166
166
  const t = w(o), n = R(e);
167
167
  return t === "/" ? n : n === "/" || n.length === 1 ? t : `${t}${n}`;
168
168
  }
169
- function Jt(o, e) {
169
+ function Qt(o, e) {
170
170
  const t = w(o), n = R(e);
171
171
  if (t === "/" || !n.startsWith(t))
172
172
  return n;
@@ -175,12 +175,12 @@ function Jt(o, e) {
175
175
  const r = n.substring(t.length);
176
176
  return r.length === 0 ? "/" : r.startsWith("/") ? r : `/${r}`;
177
177
  }
178
- function Qt(o) {
178
+ function Yt(o) {
179
179
  return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
180
180
  }
181
- var he, Be;
182
- function Yt() {
183
- return Be || (Be = 1, he = function o(e) {
181
+ var he, _e;
182
+ function Zt() {
183
+ return _e || (_e = 1, he = function o(e) {
184
184
  if (typeof e == "number" && isNaN(e))
185
185
  throw new Error("NaN is not allowed");
186
186
  if (typeof e == "number" && !isFinite(e))
@@ -193,26 +193,26 @@ function Yt() {
193
193
  }, "")}}`;
194
194
  }), he;
195
195
  }
196
- var Zt = Yt();
197
- const Xt = /* @__PURE__ */ Qt(Zt);
198
- function en(o, e) {
196
+ var Xt = Zt();
197
+ const en = /* @__PURE__ */ Yt(Xt);
198
+ function tn(o, e) {
199
199
  return o.nodeToJson(e, "official");
200
200
  }
201
- function tn(o, e) {
202
- const t = en(o, e);
203
- return Xt(t);
201
+ function nn(o, e) {
202
+ const t = tn(o, e);
203
+ return en(t);
204
204
  }
205
- function ut(o, e) {
206
- return e ? tn(o, e) : null;
205
+ function ht(o, e) {
206
+ return e ? nn(o, e) : null;
207
207
  }
208
- function _e(o, e) {
209
- const t = ut(o, e);
208
+ function Le(o, e) {
209
+ const t = ht(o, e);
210
210
  return t == null ? 0 : new TextEncoder().encode(t).length;
211
211
  }
212
- const nn = 1700, ye = BigInt(
213
- nn
214
- ), rn = BigInt(Number.MAX_SAFE_INTEGER), on = 4e4, sn = 4e4;
215
- function an(o) {
212
+ const rn = 1700, ye = BigInt(
213
+ rn
214
+ ), on = BigInt(Number.MAX_SAFE_INTEGER), sn = 4e4, an = 4e4;
215
+ function cn(o) {
216
216
  let e;
217
217
  if (typeof o == "bigint")
218
218
  e = o;
@@ -224,17 +224,20 @@ function an(o) {
224
224
  if (e <= 0n)
225
225
  return 0;
226
226
  const t = (e + ye - 1n) / ye;
227
- return t > rn ? Number.MAX_SAFE_INTEGER : Number(t);
227
+ return t > on ? Number.MAX_SAFE_INTEGER : Number(t);
228
228
  }
229
- function ht(o) {
229
+ function dt(o) {
230
230
  const e = BigInt(Math.max(0, Math.trunc(o)));
231
231
  return e <= 0n ? 0n : e * ye;
232
232
  }
233
- const dt = ht(
234
- on
235
- ), cn = ht(
233
+ const pt = dt(
236
234
  sn
237
- ), D = 1, ln = /* @__PURE__ */ new Set([
235
+ ), ln = dt(
236
+ an
237
+ ), D = 1, Ce = {
238
+ ...xt,
239
+ maxEncodedBytes: 16 * 1024 * 1024
240
+ }, un = /* @__PURE__ */ new Set([
238
241
  "event",
239
242
  "eventCanonical",
240
243
  "steps",
@@ -243,7 +246,7 @@ const dt = ht(
243
246
  "currentContract",
244
247
  "currentContractCanonical"
245
248
  ]);
246
- class ke {
249
+ class Te {
247
250
  // Serialize evaluations to avoid races when updating host handler bindings.
248
251
  evaluationQueue = Promise.resolve();
249
252
  handlerState = {
@@ -273,33 +276,35 @@ class ke {
273
276
  wasmGasLimit: n,
274
277
  onWasmGasUsed: r
275
278
  }) {
276
- const i = this.prepareBindings(t), s = n ?? dt, a = {
279
+ const i = this.prepareBindings(t), s = n ?? pt, a = {
277
280
  code: this.wrapCode(e),
278
281
  abiId: "Host.v1",
279
282
  abiVersion: 1,
280
- abiManifestHash: $t
283
+ abiManifestHash: Ut
281
284
  };
282
285
  try {
283
- const c = await _t({
286
+ const c = await Lt({
284
287
  program: a,
285
288
  input: i,
286
289
  gasLimit: s,
287
- manifest: Ft,
288
- handlers: this.handlers
290
+ manifest: $t,
291
+ handlers: this.handlers,
292
+ dvLimits: Ce,
293
+ outputDvLimits: Ce
289
294
  });
290
295
  if (n !== void 0 && r && r({
291
296
  used: c.gasUsed,
292
297
  remaining: c.gasRemaining
293
298
  }), !c.ok)
294
- throw dn(c);
299
+ throw pn(c);
295
300
  return ne(c.value);
296
301
  } catch (c) {
297
- throw pn(c);
302
+ throw fn(c);
298
303
  }
299
304
  }
300
305
  prepareBindings(e) {
301
306
  const t = e ?? {};
302
- un(t);
307
+ hn(t);
303
308
  const n = j(t.event, null, "event"), r = j(
304
309
  t.eventCanonical ?? n,
305
310
  n,
@@ -319,11 +324,11 @@ class ke {
319
324
  currentContract: s,
320
325
  currentContractCanonical: a
321
326
  }, u = this.extractDocumentBinding(t), h = typeof u?.canonical == "function" ? u.canonical : void 0;
322
- this.handlerState.documentGet = Le(u), this.handlerState.documentGetCanonical = Le(
327
+ this.handlerState.documentGet = xe(u), this.handlerState.documentGetCanonical = xe(
323
328
  h ?? u
324
329
  );
325
330
  const d = this.extractEmitBinding(t);
326
- return this.handlerState.emit = hn(d), c;
331
+ return this.handlerState.emit = dn(d), c;
327
332
  }
328
333
  extractDocumentBinding(e) {
329
334
  if (!Object.prototype.hasOwnProperty.call(e, "document"))
@@ -353,15 +358,15 @@ ${e}
353
358
  })()`;
354
359
  }
355
360
  }
356
- function un(o) {
361
+ function hn(o) {
357
362
  for (const e of Object.keys(o))
358
- if (!ln.has(e))
363
+ if (!un.has(e))
359
364
  throw new TypeError(`Unsupported QuickJS binding: "${e}"`);
360
365
  }
361
366
  function j(o, e, t) {
362
367
  const n = o === void 0 ? e : o;
363
368
  try {
364
- Lt(n, { limits: xt });
369
+ Ft(n, { limits: Ce });
365
370
  } catch (r) {
366
371
  const i = r instanceof Error ? r.message : String(r);
367
372
  throw new TypeError(
@@ -370,7 +375,7 @@ function j(o, e, t) {
370
375
  }
371
376
  return n;
372
377
  }
373
- function Le(o) {
378
+ function xe(o) {
374
379
  return o ? (e) => {
375
380
  try {
376
381
  const t = o(e);
@@ -386,7 +391,7 @@ function Le(o) {
386
391
  }
387
392
  } : () => ({ ok: null, units: D });
388
393
  }
389
- function hn(o) {
394
+ function dn(o) {
390
395
  return o ? (e) => {
391
396
  try {
392
397
  if (o(ne(e)) instanceof Promise)
@@ -416,7 +421,7 @@ function ne(o) {
416
421
  }
417
422
  return o;
418
423
  }
419
- function dn(o) {
424
+ function pn(o) {
420
425
  if (o.ok)
421
426
  return new Error("Unexpected evaluation result");
422
427
  if (o.type === "invalid-output") {
@@ -433,34 +438,34 @@ function dn(o) {
433
438
  const t = e.message || o.message, n = new Error(t);
434
439
  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);
435
440
  }
436
- function pn(o) {
441
+ function fn(o) {
437
442
  return o instanceof Error ? o : new Error(String(o ?? "Unknown error"));
438
443
  }
439
- const xe = 120;
440
- function fn(o) {
441
- return o.length <= xe ? o : `${o.slice(0, xe - 3)}...`;
444
+ const Fe = 120;
445
+ function mn(o) {
446
+ return o.length <= Fe ? o : `${o.slice(0, Fe - 3)}...`;
442
447
  }
443
- class pt extends Error {
448
+ class ft extends Error {
444
449
  constructor(e, t) {
445
- super(`Failed to evaluate code block: ${fn(e)}`, { cause: t }), this.code = e, this.cause = t, this.name = "CodeBlockEvaluationError";
450
+ super(`Failed to evaluate code block: ${mn(e)}`, { cause: t }), this.code = e, this.cause = t, this.name = "CodeBlockEvaluationError";
446
451
  }
447
452
  }
448
- const ft = /^\$\{([\s\S]*)\}$/, mn = /\$\{([\s\S]+?)\}/, gn = /\$\{([\s\S]+?)\}/g;
453
+ const mt = /^\$\{([\s\S]*)\}$/, gn = /\$\{([\s\S]+?)\}/, En = /\$\{([\s\S]+?)\}/g;
449
454
  function re(o) {
450
- if (typeof o != "string" || !ft.test(o))
455
+ if (typeof o != "string" || !mt.test(o))
451
456
  return !1;
452
457
  const e = o.indexOf("${"), t = o.lastIndexOf("${");
453
458
  return e === t;
454
459
  }
455
- function En(o) {
456
- return typeof o != "string" ? !1 : ft.test(o) ? !0 : mn.test(o);
457
- }
458
460
  function yn(o) {
461
+ return typeof o != "string" ? !1 : mt.test(o) ? !0 : gn.test(o);
462
+ }
463
+ function Cn(o) {
459
464
  if (!re(o))
460
465
  throw new Error(`Invalid expression: ${o}`);
461
466
  return o.slice(2, -1);
462
467
  }
463
- async function mt(o, e, t, n, r) {
468
+ async function gt(o, e, t, n, r) {
464
469
  const i = `return (${e});`;
465
470
  try {
466
471
  return await o.evaluate({
@@ -470,15 +475,15 @@ async function mt(o, e, t, n, r) {
470
475
  onWasmGasUsed: r
471
476
  });
472
477
  } catch (s) {
473
- throw new pt(e, s);
478
+ throw new ft(e, s);
474
479
  }
475
480
  }
476
- async function Cn(o, e, t, n, r) {
481
+ async function Sn(o, e, t, n, r) {
477
482
  let i = "", s = 0;
478
- for (const a of e.matchAll(gn)) {
483
+ for (const a of e.matchAll(En)) {
479
484
  const c = a[0], u = a[1], h = a.index ?? 0;
480
485
  i += e.slice(s, h);
481
- const d = await mt(
486
+ const d = await gt(
482
487
  o,
483
488
  u,
484
489
  t,
@@ -489,15 +494,15 @@ async function Cn(o, e, t, n, r) {
489
494
  }
490
495
  return i += e.slice(s), i;
491
496
  }
492
- function gt({
497
+ function Et({
493
498
  include: o,
494
499
  exclude: e = [],
495
500
  options: t
496
501
  }) {
497
502
  const n = { dot: !0, ...t ?? {} }, r = o.map(
498
- (s) => Ae(s, n)
503
+ (s) => De(s, n)
499
504
  ), i = e.map(
500
- (s) => Ae(s, n)
505
+ (s) => De(s, n)
501
506
  );
502
507
  return (s) => r.some((a) => a(s)) && !i.some((a) => a(s));
503
508
  }
@@ -510,7 +515,7 @@ async function oe(o) {
510
515
  shouldDescend: i = () => !0,
511
516
  context: s,
512
517
  pointer: a = "/"
513
- } = o, c = cn, u = ({
518
+ } = o, c = ln, u = ({
514
519
  used: g
515
520
  }) => {
516
521
  s.gasMeter().chargeWasmGas(g);
@@ -521,7 +526,7 @@ async function oe(o) {
521
526
  if (d !== void 0) {
522
527
  if (typeof d == "string" && r(a)) {
523
528
  if (re(d)) {
524
- const g = yn(d), y = await mt(
529
+ const g = Cn(d), y = await gt(
525
530
  e,
526
531
  g,
527
532
  n,
@@ -529,8 +534,8 @@ async function oe(o) {
529
534
  u
530
535
  );
531
536
  return s.blue.jsonValueToNode(y ?? null);
532
- } else if (En(d)) {
533
- const g = await Cn(
537
+ } else if (yn(d)) {
538
+ const g = await Sn(
534
539
  e,
535
540
  d,
536
541
  n,
@@ -588,29 +593,29 @@ const P = {
588
593
  description: l.string().optional(),
589
594
  name: l.string().optional(),
590
595
  order: l.number().optional()
591
- })), Te = ce, $ = m(P["Core/Channel"])(ce.extend({
596
+ })), Pe = ce, $ = m(P["Core/Channel"])(ce.extend({
592
597
  description: l.string().optional(),
593
598
  event: I().optional(),
594
599
  name: l.string().optional()
595
600
  })), U = $.merge(
596
- Te
601
+ Pe
597
602
  ).extend({
598
603
  path: l.string().optional(),
599
604
  definition: I().optional()
600
- }), Et = m(P["Core/Handler"])(ce.extend({
605
+ }), yt = m(P["Core/Handler"])(ce.extend({
601
606
  channel: l.string().optional(),
602
607
  description: l.string().optional(),
603
608
  event: I().optional(),
604
609
  name: l.string().optional()
605
- })), yt = Et.merge(Te), z = m(P["Core/Marker"])(ce.extend({
610
+ })), Ct = yt.merge(Pe), z = m(P["Core/Marker"])(ce.extend({
606
611
  description: l.string().optional(),
607
612
  name: l.string().optional()
608
- })), M = z.merge(Te), Sn = l.object({
613
+ })), M = z.merge(Pe), vn = l.object({
609
614
  op: l.enum(["ADD", "REPLACE", "REMOVE"]),
610
615
  path: l.string(),
611
616
  val: I().optional()
612
- }), Fi = m("JsonPatch")(
613
- Sn
617
+ }), $i = m("JsonPatch")(
618
+ vn
614
619
  ).superRefine((o, e) => {
615
620
  o.op === "REMOVE" && o.val !== void 0 && e.addIssue({
616
621
  code: l.ZodIssueCode.custom,
@@ -621,27 +626,27 @@ const P = {
621
626
  message: `${o.op} operations must include a value`,
622
627
  path: ["val"]
623
628
  });
624
- }), vn = m(P["Core/Document Update Channel"])($.extend({
629
+ }), wn = m(P["Core/Document Update Channel"])($.extend({
625
630
  description: l.string().optional(),
626
631
  name: l.string().optional(),
627
632
  path: l.string().optional()
628
- })), wn = vn.merge(
633
+ })), bn = wn.merge(
629
634
  U
630
- ), bn = m(P["Core/Embedded Node Channel"])($.extend({
635
+ ), In = m(P["Core/Embedded Node Channel"])($.extend({
631
636
  childPath: l.string().optional(),
632
637
  description: l.string().optional(),
633
638
  name: l.string().optional()
634
- })), In = bn.merge(
639
+ })), kn = In.merge(
635
640
  U
636
- ), kn = m(P["Core/Lifecycle Event Channel"])($.extend({
641
+ ), Tn = m(P["Core/Lifecycle Event Channel"])($.extend({
637
642
  description: l.string().optional(),
638
643
  name: l.string().optional()
639
- })), Tn = kn.merge(
644
+ })), Pn = Tn.merge(
640
645
  U
641
- ), Pn = m(P["Core/Triggered Event Channel"])($.extend({
646
+ ), Rn = m(P["Core/Triggered Event Channel"])($.extend({
642
647
  description: l.string().optional(),
643
648
  name: l.string().optional()
644
- })), Rn = Pn.merge(U), T = {
649
+ })), Mn = Rn.merge(U), T = {
645
650
  "Conversation/Actor": "CN5efWVizJbRsMCw8YWRfT2q9vM9XfeGDN9wFvYcvMnQ",
646
651
  "Conversation/Actor Policy": "EeWqP1Tw9WXo5nq8kx93FuTw9HRqpv34mbWFjH72nR7o",
647
652
  "Conversation/Composite Timeline Channel": "HsNatiPt2YvmkWQoqtfrFCbdp75ZUBLBUkWeq84WTfnr",
@@ -656,11 +661,11 @@ const P = {
656
661
  "Conversation/Timeline Entry": "29tcU8MkrV3KL5HqH6DHJDPPfJMheoqwiKJsaHnrp9hT",
657
662
  "Conversation/Trigger Event": "2bSWEoMSZwzf32Hnr4BDVsuq8NRjrWEpnhZvMZAJGhh2",
658
663
  "Conversation/Update Document": "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa"
659
- }, Ct = m(T["Conversation/Timeline Channel"])($.extend({
664
+ }, St = m(T["Conversation/Timeline Channel"])($.extend({
660
665
  description: l.string().optional(),
661
666
  name: l.string().optional(),
662
667
  timelineId: l.string().optional()
663
- })), Mn = Ct.merge(
668
+ })), On = St.merge(
664
669
  U
665
670
  ), A = {
666
671
  "MyOS/Document Anchor": "HS9yo34TGEAM2LGcNbLh7XPN4goPRhqdGZQkiyh473Wb",
@@ -673,16 +678,16 @@ const P = {
673
678
  "MyOS/MyOS Timeline Channel": "HCF8mXnX3dFjQ8osjxb4Wzm2Nm1DoXnTYuA5sPnV7NTs",
674
679
  "MyOS/MyOS Timeline Entry": "F3mQaGQ1B48yMedKZojFTxeKxtee4xU66QBbiyEMvGeZ",
675
680
  "MyOS/MyOS Worker Agency": "4Lix4AKXvBDvrwxw2htSdYFKxL4wugEQzqoSEYet5Dh1"
676
- }, On = m(A["MyOS/MyOS Timeline Channel"])(Ct.extend({
681
+ }, Nn = m(A["MyOS/MyOS Timeline Channel"])(St.extend({
677
682
  accountId: l.string().optional(),
678
683
  description: l.string().optional(),
679
684
  email: l.string().optional(),
680
685
  name: l.string().optional()
681
- })), Nn = On.merge(U), An = m(T["Conversation/Composite Timeline Channel"])($.extend({
686
+ })), An = Nn.merge(U), Dn = m(T["Conversation/Composite Timeline Channel"])($.extend({
682
687
  channels: l.array(l.string()).optional(),
683
688
  description: l.string().optional(),
684
689
  name: l.string().optional()
685
- })), St = An.merge(U), Dn = m(T["Conversation/Actor Policy"])(z.extend({
690
+ })), vt = Dn.merge(U), Bn = m(T["Conversation/Actor Policy"])(z.extend({
686
691
  description: l.string().optional(),
687
692
  name: l.string().optional(),
688
693
  operations: l.record(l.string(), l.object({
@@ -690,25 +695,25 @@ const P = {
690
695
  requiresActor: l.string().optional(),
691
696
  requiresSource: l.string().optional()
692
697
  })).optional()
693
- })), vt = ["principal", "agent", "any"], wt = [
698
+ })), wt = ["principal", "agent", "any"], bt = [
694
699
  "browserSession",
695
700
  "apiCall",
696
701
  "documentRequest"
697
- ], Bn = l.enum(vt), Fe = l.enum(wt), _n = l.object({
698
- excludeSource: Fe.optional(),
699
- requiresActor: Bn.optional(),
700
- requiresSource: Fe.optional()
701
- }), bt = Dn.merge(
702
+ ], _n = l.enum(wt), $e = l.enum(bt), Ln = l.object({
703
+ excludeSource: $e.optional(),
704
+ requiresActor: _n.optional(),
705
+ requiresSource: $e.optional()
706
+ }), It = Bn.merge(
702
707
  M
703
708
  ).extend({
704
- operations: l.record(l.string(), _n).optional()
705
- }), Ln = new Set(vt), $e = new Set(wt);
706
- class It extends Error {
709
+ operations: l.record(l.string(), Ln).optional()
710
+ }), xn = new Set(wt), Ue = new Set(bt);
711
+ class kt extends Error {
707
712
  constructor(e) {
708
713
  super(e), this.name = "ActorPolicyLiteralValidationError";
709
714
  }
710
715
  }
711
- function xn(o) {
716
+ function Fn(o) {
712
717
  const e = o.getProperties()?.operations;
713
718
  if (!(e instanceof p))
714
719
  return;
@@ -722,17 +727,17 @@ function xn(o) {
722
727
  n,
723
728
  "requiresActor",
724
729
  i.requiresActor,
725
- Ln
730
+ xn
726
731
  ), de(
727
732
  n,
728
733
  "requiresSource",
729
734
  i.requiresSource,
730
- $e
735
+ Ue
731
736
  ), de(
732
737
  n,
733
738
  "excludeSource",
734
739
  i.excludeSource,
735
- $e
740
+ Ue
736
741
  ));
737
742
  }
738
743
  }
@@ -741,77 +746,77 @@ function de(o, e, t, n) {
741
746
  return;
742
747
  const r = t.getValue();
743
748
  if (r != null && (typeof r != "string" || !n.has(r)))
744
- throw new It(
749
+ throw new kt(
745
750
  `Actor Policy operation '${o}' declares unsupported ${e} '${String(
746
751
  r
747
752
  )}'`
748
753
  );
749
754
  }
750
- const Fn = m(P["Core/Channel Event Checkpoint"])(z.extend({
755
+ const $n = m(P["Core/Channel Event Checkpoint"])(z.extend({
751
756
  description: l.string().optional(),
752
757
  lastEvents: l.record(l.string(), I()).optional(),
753
758
  name: l.string().optional()
754
- })), $n = Fn.merge(M).extend({
759
+ })), Un = $n.merge(M).extend({
755
760
  lastSignatures: l.record(l.string()).optional()
756
- }), Un = m(P["Core/Processing Initialized Marker"])(z.extend({
761
+ }), zn = m(P["Core/Processing Initialized Marker"])(z.extend({
757
762
  description: l.string().optional(),
758
763
  documentId: l.string().optional(),
759
764
  name: l.string().optional()
760
- })), zn = Un.merge(M), Vn = m(P["Core/Process Embedded"])(z.extend({
765
+ })), Vn = zn.merge(M), Hn = m(P["Core/Process Embedded"])(z.extend({
761
766
  description: l.string().optional(),
762
767
  name: l.string().optional(),
763
768
  paths: l.array(l.string()).optional()
764
- })), Hn = Vn.merge(
769
+ })), Kn = Hn.merge(
765
770
  M
766
- ), Kn = m(P["Core/Processing Terminated Marker"])(z.extend({
771
+ ), Wn = m(P["Core/Processing Terminated Marker"])(z.extend({
767
772
  cause: l.string().optional(),
768
773
  description: l.string().optional(),
769
774
  name: l.string().optional(),
770
775
  reason: l.string().optional()
771
- })), Wn = Kn.merge(M), Z = m(T["Conversation/Operation"])(z.extend({
776
+ })), qn = Wn.merge(M), Z = m(T["Conversation/Operation"])(z.extend({
772
777
  channel: l.string().optional(),
773
778
  description: l.string().optional(),
774
779
  name: l.string().optional(),
775
780
  request: I().optional()
776
- })), qn = Z.merge(
781
+ })), Gn = Z.merge(
777
782
  M
778
- ), Gn = m(A["MyOS/Document Anchor"])(l.object({
783
+ ), jn = m(A["MyOS/Document Anchor"])(l.object({
779
784
  description: l.string().optional(),
780
785
  name: l.string().optional(),
781
786
  template: I().optional()
782
- })), jn = m(A["MyOS/Document Anchors"])(l.object({}).catchall(Gn)), Jn = jn.merge(M), Qn = m(A["MyOS/Link"])(l.object({
787
+ })), Jn = m(A["MyOS/Document Anchors"])(l.object({}).catchall(jn)), Qn = Jn.merge(M), Yn = m(A["MyOS/Link"])(l.object({
783
788
  anchor: l.string().optional(),
784
789
  description: l.string().optional(),
785
790
  name: l.string().optional()
786
- })), Yn = m(A["MyOS/Document Links"])(l.object({}).catchall(Qn)), Zn = Yn.merge(
791
+ })), Zn = m(A["MyOS/Document Links"])(l.object({}).catchall(Yn)), Xn = Zn.merge(
787
792
  M
788
- ), Xn = m(A["MyOS/MyOS Participants Orchestration"])(l.object({
793
+ ), er = m(A["MyOS/MyOS Participants Orchestration"])(l.object({
789
794
  name: l.string().optional()
790
- })), er = Xn.merge(M), tr = m(A["MyOS/MyOS Session Interaction"])(l.object({
795
+ })), tr = er.merge(M), nr = m(A["MyOS/MyOS Session Interaction"])(l.object({
791
796
  name: l.string().optional()
792
- })), nr = tr.merge(M), rr = m(A["MyOS/MyOS Worker Agency"])(l.object({
797
+ })), rr = nr.merge(M), or = m(A["MyOS/MyOS Worker Agency"])(l.object({
793
798
  name: l.string().optional()
794
- })), or = rr.merge(
799
+ })), ir = or.merge(
795
800
  M
796
801
  ), le = m(T["Conversation/Sequential Workflow Step"])(l.object({
797
802
  description: l.string().optional(),
798
803
  name: l.string().optional()
799
- })), kt = m(T["Conversation/Sequential Workflow"])(Et.extend({
804
+ })), Tt = m(T["Conversation/Sequential Workflow"])(yt.extend({
800
805
  description: l.string().optional(),
801
806
  name: l.string().optional(),
802
807
  steps: l.array(le).optional()
803
- })), $i = I(), ir = kt.merge(yt).extend({
808
+ })), Ui = I(), sr = Tt.merge(Ct).extend({
804
809
  steps: l.array(I()).optional()
805
- }), sr = m(T["Conversation/Sequential Workflow Operation"])(kt.extend({
810
+ }), ar = m(T["Conversation/Sequential Workflow Operation"])(Tt.extend({
806
811
  description: l.string().optional(),
807
812
  name: l.string().optional(),
808
813
  operation: l.string().optional()
809
- })), ar = sr.merge(
810
- yt
814
+ })), cr = ar.merge(
815
+ Ct
811
816
  ).extend({
812
817
  steps: l.array(I()).optional()
813
818
  });
814
- function cr(o) {
819
+ function lr(o) {
815
820
  if (!Array.isArray(o.blueIds) || o.blueIds.length === 0)
816
821
  throw new Error("Contract processors must declare at least one BlueId");
817
822
  for (const e of o.blueIds)
@@ -819,11 +824,11 @@ function cr(o) {
819
824
  throw new Error("Contract processor BlueIds must be non-empty strings");
820
825
  }
821
826
  function X(o, e) {
822
- cr(o);
827
+ lr(o);
823
828
  for (const t of o.blueIds)
824
829
  e.set(t, o);
825
830
  }
826
- class lr {
831
+ class ur {
827
832
  processorsByBlueId = /* @__PURE__ */ new Map();
828
833
  handlerProcessors = /* @__PURE__ */ new Map();
829
834
  channelProcessors = /* @__PURE__ */ new Map();
@@ -923,26 +928,26 @@ class lr {
923
928
  return { blueId: s.blueId, value: s.value };
924
929
  }
925
930
  }
926
- class ur {
931
+ class hr {
927
932
  kind = "marker";
928
933
  blueIds = [
929
934
  b["Conversation/Actor Policy"]
930
935
  ];
931
- schema = bt;
936
+ schema = It;
932
937
  }
933
- const hr = "compositeSourceChannelKey";
934
- function dr(o, e) {
938
+ const dr = "compositeSourceChannelKey";
939
+ function pr(o, e) {
935
940
  return `${o}::${e}`;
936
941
  }
937
- function pr(o) {
942
+ function fr(o) {
938
943
  return o != null && Object.prototype.hasOwnProperty.call(o, "lastEvents") && Object.prototype.hasOwnProperty.call(o, "lastSignatures");
939
944
  }
940
- class fr {
945
+ class mr {
941
946
  kind = "channel";
942
947
  blueIds = [
943
948
  b["Conversation/Composite Timeline Channel"]
944
949
  ];
945
- schema = St;
950
+ schema = vt;
946
951
  /**
947
952
  * Fallback match hook that delegates to {@link evaluate} for consistent behavior.
948
953
  */
@@ -984,26 +989,26 @@ class fr {
984
989
  }, g = h.contract, y = g.event;
985
990
  if (y && !t.blue.isTypeOfNode(v, y) || !await d.matches(g, f))
986
991
  continue;
987
- const _ = d.channelize, Me = (_ ? _.call(d, g, f) : void 0) ?? v.clone();
988
- this.enrichEvent(Me, u);
989
- const Oe = dr(
992
+ const _ = d.channelize, Oe = (_ ? _.call(d, g, f) : void 0) ?? v.clone();
993
+ this.enrichEvent(Oe, u);
994
+ const Ne = pr(
990
995
  t.bindingKey,
991
996
  u
992
- ), Bt = await this.shouldProcessChild({
997
+ ), _t = await this.shouldProcessChild({
993
998
  childProcessor: d,
994
999
  childContract: g,
995
1000
  context: {
996
1001
  ...f,
997
1002
  event: n.clone()
998
1003
  },
999
- checkpointKey: Oe,
1004
+ checkpointKey: Ne,
1000
1005
  markers: t.markers
1001
1006
  });
1002
1007
  c.push({
1003
- eventNode: Me,
1008
+ eventNode: Oe,
1004
1009
  eventId: a,
1005
- checkpointKey: Oe,
1006
- shouldProcess: Bt
1010
+ checkpointKey: Ne,
1011
+ shouldProcess: _t
1007
1012
  });
1008
1013
  }
1009
1014
  return {
@@ -1025,7 +1030,7 @@ class fr {
1025
1030
  const n = e.getProperties() ?? {}, r = n.meta instanceof p ? n.meta.clone() : new p(), i = r.getProperties() ?? {};
1026
1031
  r.setProperties({
1027
1032
  ...i,
1028
- [hr]: new p().setValue(t)
1033
+ [dr]: new p().setValue(t)
1029
1034
  }), e.setProperties({ ...n, meta: r });
1030
1035
  }
1031
1036
  /**
@@ -1048,56 +1053,56 @@ class fr {
1048
1053
  */
1049
1054
  resolveCheckpoint(e) {
1050
1055
  const t = e.get(B);
1051
- return pr(t) ? t : null;
1056
+ return fr(t) ? t : null;
1052
1057
  }
1053
1058
  }
1054
- const mr = m(T["Conversation/Actor"])(l.object({
1059
+ const gr = m(T["Conversation/Actor"])(l.object({
1055
1060
  description: l.string().optional(),
1056
1061
  name: l.string().optional()
1057
- })), Tt = m(T["Conversation/Timeline"])(l.object({
1062
+ })), Pt = m(T["Conversation/Timeline"])(l.object({
1058
1063
  description: l.string().optional(),
1059
1064
  name: l.string().optional(),
1060
1065
  timelineId: l.string().optional()
1061
1066
  })), N = m(T["Conversation/Timeline Entry"])(l.object({
1062
- actor: mr.optional(),
1067
+ actor: gr.optional(),
1063
1068
  description: l.string().optional(),
1064
1069
  message: I().optional(),
1065
1070
  name: l.string().optional(),
1066
1071
  prevEntry: I().optional(),
1067
1072
  source: I().optional(),
1068
- timeline: Tt.optional(),
1073
+ timeline: Pt.optional(),
1069
1074
  timestamp: l.number().optional()
1070
- })), gr = m(A["MyOS/MyOS Timeline"])(Tt.extend({
1075
+ })), Er = m(A["MyOS/MyOS Timeline"])(Pt.extend({
1071
1076
  accountId: l.string().optional(),
1072
1077
  description: l.string().optional(),
1073
1078
  name: l.string().optional()
1074
- })), Ue = m(A["MyOS/MyOS Timeline Entry"])(N.extend({
1079
+ })), ze = m(A["MyOS/MyOS Timeline Entry"])(N.extend({
1075
1080
  description: l.string().optional(),
1076
1081
  name: l.string().optional(),
1077
- timeline: gr.optional()
1082
+ timeline: Er.optional()
1078
1083
  }));
1079
- function ze(o, e) {
1084
+ function Ve(o, e) {
1080
1085
  return e && o.isTypeOf(e, N, { checkSchemaExtensions: !0 }) ? o.nodeToSchemaOutput(e, N) : null;
1081
1086
  }
1082
- function Pt(o, e, t) {
1083
- const n = ze(o, e), r = ze(o, t);
1087
+ function Rt(o, e, t) {
1088
+ const n = Ve(o, e), r = Ve(o, t);
1084
1089
  if (!n || !r)
1085
1090
  return !0;
1086
1091
  const i = n.timestamp, s = r.timestamp;
1087
1092
  return typeof i != "number" || typeof s != "number" ? !0 : i >= s;
1088
1093
  }
1089
- function Ve(o, e) {
1090
- return o.isTypeOf(e, Ue) ? o.nodeToSchemaOutput(e, Ue) : o.isTypeOf(e, N) ? o.nodeToSchemaOutput(e, N) : null;
1094
+ function He(o, e) {
1095
+ return o.isTypeOf(e, ze) ? o.nodeToSchemaOutput(e, ze) : o.isTypeOf(e, N) ? o.nodeToSchemaOutput(e, N) : null;
1091
1096
  }
1092
- class Er {
1097
+ class yr {
1093
1098
  kind = "channel";
1094
1099
  blueIds = [q["MyOS/MyOS Timeline Channel"]];
1095
- schema = Nn;
1100
+ schema = An;
1096
1101
  matches(e, t) {
1097
1102
  const { event: n, blue: r } = t;
1098
1103
  if (!n)
1099
1104
  return !1;
1100
- const i = Ve(r, n);
1105
+ const i = He(r, n);
1101
1106
  if (!i)
1102
1107
  return !1;
1103
1108
  const s = i.timeline?.timelineId;
@@ -1105,17 +1110,17 @@ class Er {
1105
1110
  }
1106
1111
  channelize(e, t) {
1107
1112
  const { event: n, blue: r } = t;
1108
- return !n || !Ve(r, n) ? null : n.clone();
1113
+ return !n || !He(r, n) ? null : n.clone();
1109
1114
  }
1110
1115
  isNewerEvent(e, t, n) {
1111
1116
  const { event: r, blue: i } = t;
1112
- return r ? Pt(i, r, n) : !0;
1117
+ return r ? Rt(i, r, n) : !0;
1113
1118
  }
1114
1119
  }
1115
- class yr {
1120
+ class Cr {
1116
1121
  kind = "channel";
1117
1122
  blueIds = [b["Conversation/Timeline Channel"]];
1118
- schema = Mn;
1123
+ schema = On;
1119
1124
  matches(e, t) {
1120
1125
  const { event: n, blue: r } = t;
1121
1126
  if (!n || !r.isTypeOf(n, N))
@@ -1129,16 +1134,16 @@ class yr {
1129
1134
  }
1130
1135
  isNewerEvent(e, t, n) {
1131
1136
  const { event: r, blue: i } = t;
1132
- return r ? Pt(i, r, n) : !0;
1137
+ return r ? Rt(i, r, n) : !0;
1133
1138
  }
1134
1139
  }
1135
- const He = m(T["Conversation/Trigger Event"])(le.extend({
1140
+ const Ke = m(T["Conversation/Trigger Event"])(le.extend({
1136
1141
  description: l.string().optional(),
1137
1142
  event: I().optional(),
1138
1143
  name: l.string().optional()
1139
1144
  }));
1140
- function Pe(o) {
1141
- const { context: e, eventNode: t, stepResults: n, contractNode: r } = o, i = Sr(e), s = r != null ? e.blue.nodeToJson(r, "simple") : null, a = r != null ? e.blue.nodeToJson(r, "official") : s;
1145
+ function Re(o) {
1146
+ const { context: e, eventNode: t, stepResults: n, contractNode: r } = o, i = vr(e), s = r != null ? e.blue.nodeToJson(r, "simple") : null, a = r != null ? e.blue.nodeToJson(r, "official") : s;
1142
1147
  return {
1143
1148
  event: e.blue.nodeToJson(t, "simple"),
1144
1149
  eventCanonical: e.blue.nodeToJson(t, "official"),
@@ -1148,13 +1153,13 @@ function Pe(o) {
1148
1153
  currentContractCanonical: a
1149
1154
  };
1150
1155
  }
1151
- const Cr = /* @__PURE__ */ new Set(["blueId", "name", "description", "value"]);
1152
- function Sr(o) {
1156
+ const Sr = /* @__PURE__ */ new Set(["blueId", "name", "description", "value"]);
1157
+ function vr(o) {
1153
1158
  const e = (i) => {
1154
1159
  if (i === "/")
1155
1160
  return !1;
1156
1161
  const s = i.lastIndexOf("/"), a = i.substring(s + 1);
1157
- return Cr.has(a);
1162
+ return Sr.has(a);
1158
1163
  }, t = (i) => {
1159
1164
  const s = i == null ? "/" : typeof i == "string" ? i : (() => {
1160
1165
  throw new TypeError("document() expects a string pointer");
@@ -1167,28 +1172,28 @@ function Sr(o) {
1167
1172
  }, r = ((i) => n(i, "simple"));
1168
1173
  return r.canonical = (i) => n(i, "official"), r;
1169
1174
  }
1170
- class vr {
1175
+ class wr {
1171
1176
  supportedBlueIds = [
1172
1177
  b["Conversation/Trigger Event"]
1173
1178
  ];
1174
- evaluator = new ke();
1179
+ evaluator = new Te();
1175
1180
  async execute(e) {
1176
1181
  const { stepNode: t, context: n } = e;
1177
- if (!n.blue.isTypeOf(t, He))
1182
+ if (!n.blue.isTypeOf(t, Ke))
1178
1183
  return n.throwFatal("Trigger Event step payload is invalid");
1179
1184
  n.gasMeter().chargeTriggerEventBase();
1180
1185
  const r = await oe({
1181
1186
  evaluator: this.evaluator,
1182
1187
  node: t,
1183
- bindings: Pe(e),
1184
- shouldResolve: gt({
1188
+ bindings: Re(e),
1189
+ shouldResolve: Et({
1185
1190
  include: ["/event", "/event/**"]
1186
1191
  }),
1187
- shouldDescend: wr(),
1192
+ shouldDescend: br(),
1188
1193
  context: n
1189
1194
  }), s = n.blue.nodeToSchemaOutput(
1190
1195
  r,
1191
- He
1196
+ Ke
1192
1197
  ).event;
1193
1198
  if (ge(s))
1194
1199
  return n.throwFatal(
@@ -1197,40 +1202,40 @@ class vr {
1197
1202
  n.emitEvent(s.clone());
1198
1203
  }
1199
1204
  }
1200
- function wr() {
1201
- return (o, e) => o === "/event" || !o.startsWith("/event/") ? !0 : !br(e);
1205
+ function br() {
1206
+ return (o, e) => o === "/event" || !o.startsWith("/event/") ? !0 : !Ir(e);
1202
1207
  }
1203
- function br(o) {
1208
+ function Ir(o) {
1204
1209
  const e = o.getProperties?.();
1205
1210
  return e ? !!e.contracts : !1;
1206
1211
  }
1207
- const Ke = m(T["Conversation/JavaScript Code"])(le.extend({
1212
+ const We = m(T["Conversation/JavaScript Code"])(le.extend({
1208
1213
  code: l.string().optional(),
1209
1214
  description: l.string().optional(),
1210
1215
  name: l.string().optional()
1211
1216
  }));
1212
- class Ir {
1217
+ class kr {
1213
1218
  supportedBlueIds = [
1214
1219
  b["Conversation/JavaScript Code"]
1215
1220
  ];
1216
- evaluator = new ke();
1221
+ evaluator = new Te();
1217
1222
  wasmGasLimit;
1218
1223
  constructor(e = {}) {
1219
- this.wasmGasLimit = e.wasmGasLimit ?? dt;
1224
+ this.wasmGasLimit = e.wasmGasLimit ?? pt;
1220
1225
  }
1221
1226
  async execute(e) {
1222
1227
  const { context: t, stepNode: n } = e, { blue: r } = t;
1223
- if (!r.isTypeOf(n, Ke))
1228
+ if (!r.isTypeOf(n, We))
1224
1229
  return t.throwFatal("JavaScript Code step payload is invalid");
1225
1230
  const s = r.nodeToSchemaOutput(
1226
1231
  n,
1227
- Ke
1232
+ We
1228
1233
  ).code;
1229
1234
  if (!s)
1230
1235
  return t.throwFatal(
1231
1236
  "JavaScript Code step must include code to execute"
1232
1237
  );
1233
- const a = Pe(e);
1238
+ const a = Re(e);
1234
1239
  try {
1235
1240
  const c = await this.evaluator.evaluate({
1236
1241
  code: s,
@@ -1240,7 +1245,7 @@ class Ir {
1240
1245
  });
1241
1246
  return this.handleEvents(c, t), c;
1242
1247
  } catch (c) {
1243
- throw new pt(s, c);
1248
+ throw new ft(s, c);
1244
1249
  }
1245
1250
  }
1246
1251
  handleEvents(e, t) {
@@ -1254,31 +1259,31 @@ class Ir {
1254
1259
  }
1255
1260
  }
1256
1261
  }
1257
- const kr = m(P["Core/Json Patch Entry"])(l.object({
1262
+ const Tr = m(P["Core/Json Patch Entry"])(l.object({
1258
1263
  description: l.string().optional(),
1259
1264
  name: l.string().optional(),
1260
1265
  op: l.string().optional(),
1261
1266
  path: l.string().optional(),
1262
1267
  val: I().optional()
1263
- })), We = m(T["Conversation/Update Document"])(le.extend({
1264
- changeset: l.array(kr).optional(),
1268
+ })), qe = m(T["Conversation/Update Document"])(le.extend({
1269
+ changeset: l.array(Tr).optional(),
1265
1270
  description: l.string().optional(),
1266
1271
  name: l.string().optional()
1267
1272
  }));
1268
- class Tr {
1273
+ class Pr {
1269
1274
  supportedBlueIds = [
1270
1275
  b["Conversation/Update Document"]
1271
1276
  ];
1272
- evaluator = new ke();
1277
+ evaluator = new Te();
1273
1278
  async execute(e) {
1274
1279
  const { context: t, stepNode: n } = e, { blue: r } = t;
1275
- if (!r.isTypeOf(n, We))
1280
+ if (!r.isTypeOf(n, qe))
1276
1281
  return t.throwFatal("Update Document step payload is invalid");
1277
1282
  const i = await oe({
1278
1283
  evaluator: this.evaluator,
1279
1284
  node: n,
1280
- bindings: Pe(e),
1281
- shouldResolve: gt({
1285
+ bindings: Re(e),
1286
+ shouldResolve: Et({
1282
1287
  include: ["/changeset", "/changeset/**"]
1283
1288
  }),
1284
1289
  context: t
@@ -1292,7 +1297,7 @@ class Tr {
1292
1297
  extractChanges(e, t) {
1293
1298
  return t.blue.nodeToSchemaOutput(
1294
1299
  e,
1295
- We
1300
+ qe
1296
1301
  ).changeset ?? [];
1297
1302
  }
1298
1303
  createPatch(e, t) {
@@ -1312,14 +1317,14 @@ class Tr {
1312
1317
  return n.length === 0 ? t.throwFatal("Update Document path cannot be empty") : n;
1313
1318
  }
1314
1319
  }
1315
- const Re = [
1316
- new vr(),
1317
- new Ir(),
1318
- new Tr()
1320
+ const Me = [
1321
+ new wr(),
1322
+ new kr(),
1323
+ new Pr()
1319
1324
  ];
1320
- class Rt {
1325
+ class Mt {
1321
1326
  executorIndex;
1322
- constructor(e = Re) {
1327
+ constructor(e = Me) {
1323
1328
  const t = /* @__PURE__ */ new Map();
1324
1329
  for (const n of e)
1325
1330
  for (const r of n.supportedBlueIds)
@@ -1365,15 +1370,15 @@ class Rt {
1365
1370
  return n && typeof n == "string" && n.length > 0 ? n : `Step${t + 1}`;
1366
1371
  }
1367
1372
  }
1368
- class Pr {
1373
+ class Rr {
1369
1374
  kind = "handler";
1370
1375
  blueIds = [
1371
1376
  b["Conversation/Sequential Workflow"]
1372
1377
  ];
1373
- schema = ir;
1378
+ schema = sr;
1374
1379
  runner;
1375
- constructor(e = Re) {
1376
- this.runner = new Rt(e);
1380
+ constructor(e = Me) {
1381
+ this.runner = new Mt(e);
1377
1382
  }
1378
1383
  async matches(e, t) {
1379
1384
  const n = t.event();
@@ -1389,17 +1394,17 @@ class Pr {
1389
1394
  });
1390
1395
  }
1391
1396
  }
1392
- class Rr {
1397
+ class Mr {
1393
1398
  kind = "marker";
1394
1399
  blueIds = [S["Core/Marker"]];
1395
1400
  schema = M;
1396
1401
  }
1397
- class Mr {
1402
+ class Or {
1398
1403
  kind = "marker";
1399
1404
  blueIds = [b["Conversation/Operation"]];
1400
- schema = qn;
1405
+ schema = Gn;
1401
1406
  }
1402
- const Ce = m(T["Conversation/Operation Request"])(l.object({
1407
+ const Se = m(T["Conversation/Operation Request"])(l.object({
1403
1408
  allowNewerVersion: l.boolean().optional(),
1404
1409
  description: l.string().optional(),
1405
1410
  document: I().optional(),
@@ -1407,7 +1412,7 @@ const Ce = m(T["Conversation/Operation Request"])(l.object({
1407
1412
  operation: l.string().optional(),
1408
1413
  request: I().optional()
1409
1414
  }));
1410
- function Mt(o) {
1415
+ function Ot(o) {
1411
1416
  const e = o.channel;
1412
1417
  if (typeof e == "string") {
1413
1418
  const t = e.trim();
@@ -1416,15 +1421,15 @@ function Mt(o) {
1416
1421
  }
1417
1422
  return null;
1418
1423
  }
1419
- function Or(o, e) {
1424
+ function Nr(o, e) {
1420
1425
  const t = o.getProperties()?.document;
1421
1426
  if (!(t instanceof p))
1422
1427
  return null;
1423
1428
  const n = t.getReferenceBlueId();
1424
1429
  return n || e.blue.calculateBlueIdSync(t);
1425
1430
  }
1426
- function Nr(o, e) {
1427
- if (e.isTypeOf(o, Ce, {
1431
+ function Ar(o, e) {
1432
+ if (e.isTypeOf(o, Se, {
1428
1433
  checkSchemaExtensions: !0
1429
1434
  }))
1430
1435
  return o;
@@ -1432,18 +1437,18 @@ function Nr(o, e) {
1432
1437
  checkSchemaExtensions: !0
1433
1438
  })) {
1434
1439
  const n = e.nodeToSchemaOutput(o, N).message;
1435
- if (n && e.isTypeOf(n, Ce, {
1440
+ if (n && e.isTypeOf(n, Se, {
1436
1441
  checkSchemaExtensions: !0
1437
1442
  }))
1438
1443
  return n;
1439
1444
  }
1440
1445
  return null;
1441
1446
  }
1442
- function Ar(o, e, t, n) {
1447
+ function Dr(o, e, t, n) {
1443
1448
  const { blue: r } = n, i = o.operation;
1444
1449
  return !(!i || t.operation !== i || o.event && !r.isTypeOfNode(e, o.event));
1445
1450
  }
1446
- function Dr(o, e) {
1451
+ function Br(o, e) {
1447
1452
  const t = o.operation;
1448
1453
  if (!t)
1449
1454
  return null;
@@ -1455,20 +1460,20 @@ function Dr(o, e) {
1455
1460
  const i = e.blue.nodeToSchemaOutput(
1456
1461
  r,
1457
1462
  Z
1458
- ), s = Mt(i);
1463
+ ), s = Ot(i);
1459
1464
  return { operationNode: r, operation: i, channelKey: s };
1460
1465
  }
1461
- function Br(o, e) {
1466
+ function _r(o, e) {
1462
1467
  return !(o && e && o !== e);
1463
1468
  }
1464
- function _r(o, e, t) {
1469
+ function Lr(o, e, t) {
1465
1470
  const n = o.getProperties()?.request, r = e.getProperties()?.request;
1466
1471
  return !(!(n instanceof p) || !(r instanceof p) || !t.isTypeOfNode(n, r));
1467
1472
  }
1468
- function Lr(o, e, t) {
1473
+ function xr(o, e, t) {
1469
1474
  if (!o || o.allowNewerVersion !== !1)
1470
1475
  return !0;
1471
- const n = Or(e, t);
1476
+ const n = Nr(e, t);
1472
1477
  if (!n)
1473
1478
  return !0;
1474
1479
  const r = t.resolvePointer("/"), i = t.documentAt(r);
@@ -1477,35 +1482,35 @@ function Lr(o, e, t) {
1477
1482
  const c = (i.getContracts()?.initialized ?? null)?.get("/documentId") ?? null, u = typeof c == "string" && c.length > 0 ? c : t.blue.calculateBlueIdSync(i);
1478
1483
  return n === u;
1479
1484
  }
1480
- const xr = b["Conversation/Actor Policy"], Fr = b["Conversation/Principal Actor"], $r = b["Conversation/Agent Actor"], Ur = b["Conversation/Browser Session"], zr = b["Conversation/API Call"], Vr = b["Conversation/Document Request"];
1481
- function Hr(o, e, t) {
1482
- const r = Kr(t)?.operations?.[o];
1485
+ const Fr = b["Conversation/Actor Policy"], $r = b["Conversation/Principal Actor"], Ur = b["Conversation/Agent Actor"], zr = b["Conversation/Browser Session"], Vr = b["Conversation/API Call"], Hr = b["Conversation/Document Request"];
1486
+ function Kr(o, e, t) {
1487
+ const r = Wr(t)?.operations?.[o];
1483
1488
  if (!r)
1484
1489
  return !0;
1485
- const i = Wr(e, t), s = qr(e, t);
1486
- return Gr(r, i, s);
1490
+ const i = qr(e, t), s = Gr(e, t);
1491
+ return jr(r, i, s);
1487
1492
  }
1488
- function Kr(o) {
1493
+ function Wr(o) {
1489
1494
  const e = o.resolvePointer("/contracts"), n = o.documentAt(e)?.getProperties();
1490
1495
  if (!n)
1491
1496
  return null;
1492
1497
  for (const r of Object.values(n))
1493
- if (r instanceof p && o.blue.isTypeOfBlueId(r, xr))
1498
+ if (r instanceof p && o.blue.isTypeOfBlueId(r, Fr))
1494
1499
  return o.blue.nodeToSchemaOutput(
1495
1500
  r,
1496
- bt
1501
+ It
1497
1502
  );
1498
1503
  return null;
1499
1504
  }
1500
- function Wr(o, e) {
1501
- const t = Ot(o, "actor", e);
1502
- return t ? e.blue.isTypeOfBlueId(t, $r) ? "agent" : e.blue.isTypeOfBlueId(t, Fr) ? "principal" : null : null;
1503
- }
1504
1505
  function qr(o, e) {
1505
- const t = Ot(o, "source", e);
1506
- return t ? e.blue.isTypeOfBlueId(t, Ur) ? "browserSession" : e.blue.isTypeOfBlueId(t, zr) ? "apiCall" : e.blue.isTypeOfBlueId(t, Vr) ? "documentRequest" : null : null;
1506
+ const t = Nt(o, "actor", e);
1507
+ return t ? e.blue.isTypeOfBlueId(t, Ur) ? "agent" : e.blue.isTypeOfBlueId(t, $r) ? "principal" : null : null;
1508
+ }
1509
+ function Gr(o, e) {
1510
+ const t = Nt(o, "source", e);
1511
+ return t ? e.blue.isTypeOfBlueId(t, zr) ? "browserSession" : e.blue.isTypeOfBlueId(t, Vr) ? "apiCall" : e.blue.isTypeOfBlueId(t, Hr) ? "documentRequest" : null : null;
1507
1512
  }
1508
- function Ot(o, e, t) {
1513
+ function Nt(o, e, t) {
1509
1514
  if (!t.blue.isTypeOf(o, N, {
1510
1515
  checkSchemaExtensions: !0
1511
1516
  }))
@@ -1513,18 +1518,18 @@ function Ot(o, e, t) {
1513
1518
  const n = o.getProperties()?.[e];
1514
1519
  return n instanceof p ? n : null;
1515
1520
  }
1516
- function Gr(o, e, t) {
1521
+ function jr(o, e, t) {
1517
1522
  return !(o.requiresActor && (!e || o.requiresActor !== "any" && o.requiresActor !== e) || o.requiresSource && (!t || o.requiresSource !== t) || o.excludeSource && (!t || o.excludeSource === t));
1518
1523
  }
1519
- class jr {
1524
+ class Jr {
1520
1525
  kind = "handler";
1521
1526
  blueIds = [
1522
1527
  b["Conversation/Sequential Workflow Operation"]
1523
1528
  ];
1524
- schema = ar;
1529
+ schema = cr;
1525
1530
  runner;
1526
- constructor(e = Re) {
1527
- this.runner = new Rt(e);
1531
+ constructor(e = Me) {
1532
+ this.runner = new Mt(e);
1528
1533
  }
1529
1534
  deriveChannel(e, t) {
1530
1535
  const n = e.operation;
@@ -1536,13 +1541,13 @@ class jr {
1536
1541
  }))
1537
1542
  return null;
1538
1543
  const i = t.blue.nodeToSchemaOutput(r.node, Z);
1539
- return i ? Mt(i) : null;
1544
+ return i ? Ot(i) : null;
1540
1545
  }
1541
1546
  async matches(e, t) {
1542
1547
  const n = t.event();
1543
1548
  if (!n)
1544
1549
  return !1;
1545
- const r = Nr(
1550
+ const r = Ar(
1546
1551
  n,
1547
1552
  t.blue
1548
1553
  );
@@ -1550,22 +1555,22 @@ class jr {
1550
1555
  return !1;
1551
1556
  const i = t.blue.nodeToSchemaOutput(
1552
1557
  r,
1553
- Ce
1558
+ Se
1554
1559
  );
1555
- if (!i || !Ar(e, n, i, t))
1560
+ if (!i || !Dr(e, n, i, t))
1556
1561
  return !1;
1557
- const s = Dr(e, t);
1562
+ const s = Br(e, t);
1558
1563
  if (!s)
1559
1564
  return !1;
1560
1565
  const a = typeof e.channel == "string" ? e.channel.trim() : "", c = a.length > 0 ? a : null;
1561
- if (!Br(s.channelKey, c) || !_r(
1566
+ if (!_r(s.channelKey, c) || !Lr(
1562
1567
  r,
1563
1568
  s.operationNode,
1564
1569
  t.blue
1565
- ) || i?.allowNewerVersion === !1 && !Lr(i, r, t))
1570
+ ) || i?.allowNewerVersion === !1 && !xr(i, r, t))
1566
1571
  return !1;
1567
1572
  const u = e.operation;
1568
- return !(!u || !Hr(u, n, t));
1573
+ return !(!u || !Kr(u, n, t));
1569
1574
  }
1570
1575
  async execute(e, t, n) {
1571
1576
  const r = t.event();
@@ -1583,11 +1588,11 @@ class ue {
1583
1588
  }
1584
1589
  static create() {
1585
1590
  return new ue(
1586
- new lr()
1591
+ new ur()
1587
1592
  );
1588
1593
  }
1589
1594
  registerDefaults() {
1590
- return this.registry.register(new fr()), this.registry.register(new Er()), this.registry.register(new yr()), this.registry.register(new Pr()), this.registry.register(new ur()), this.registry.register(new Mr()), this.registry.register(new Rr()), this.registry.register(new jr()), this;
1595
+ return this.registry.register(new mr()), this.registry.register(new yr()), this.registry.register(new Cr()), this.registry.register(new Rr()), this.registry.register(new hr()), this.registry.register(new Or()), this.registry.register(new Mr()), this.registry.register(new Jr()), this;
1591
1596
  }
1592
1597
  register(e) {
1593
1598
  return this.registry.register(e), this;
@@ -1596,11 +1601,11 @@ class ue {
1596
1601
  return this.registry;
1597
1602
  }
1598
1603
  }
1599
- const Se = S["Core/Channel Event Checkpoint"];
1600
- function Nt(o) {
1604
+ const ve = S["Core/Channel Event Checkpoint"];
1605
+ function At(o) {
1601
1606
  return typeof o.order == "number" ? o.order : 0;
1602
1607
  }
1603
- class Jr {
1608
+ class Qr {
1604
1609
  constructor(e, t, n, r) {
1605
1610
  this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n, this.bindingNode = r;
1606
1611
  }
@@ -1617,10 +1622,10 @@ class Jr {
1617
1622
  return this.bindingNode.clone();
1618
1623
  }
1619
1624
  order() {
1620
- return Nt(this.bindingContract);
1625
+ return At(this.bindingContract);
1621
1626
  }
1622
1627
  }
1623
- class Qr {
1628
+ class Yr {
1624
1629
  constructor(e, t, n, r) {
1625
1630
  this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n, this.bindingNode = r;
1626
1631
  }
@@ -1637,7 +1642,7 @@ class Qr {
1637
1642
  return this.bindingNode.clone();
1638
1643
  }
1639
1644
  order() {
1640
- return Nt(this.bindingContract);
1645
+ return At(this.bindingContract);
1641
1646
  }
1642
1647
  }
1643
1648
  class W {
@@ -1655,7 +1660,7 @@ class W {
1655
1660
  );
1656
1661
  }
1657
1662
  static builder() {
1658
- return new Yr();
1663
+ return new Zr();
1659
1664
  }
1660
1665
  static empty() {
1661
1666
  return W.builder().build();
@@ -1691,13 +1696,13 @@ class W {
1691
1696
  this.markerStore.set(B, {
1692
1697
  key: B,
1693
1698
  contract: e,
1694
- blueId: Se
1699
+ blueId: ve
1695
1700
  }), this.checkpointDeclared = !0;
1696
1701
  }
1697
1702
  handlersFor(e) {
1698
1703
  const t = this.handlersByChannel.get(e);
1699
1704
  return !t || t.length === 0 ? [] : [...t].map(
1700
- (n) => new Qr(
1705
+ (n) => new Yr(
1701
1706
  n.key,
1702
1707
  n.contract,
1703
1708
  n.blueId,
@@ -1719,7 +1724,7 @@ class W {
1719
1724
  }
1720
1725
  channelsOfType(...e) {
1721
1726
  const t = e.length > 0 ? new Set(e) : null, n = Array.from(this.channels.values()).filter((r) => !t || t.has(r.blueId)).map(
1722
- (r) => new Jr(
1727
+ (r) => new Qr(
1723
1728
  r.key,
1724
1729
  r.contract,
1725
1730
  r.blueId,
@@ -1732,7 +1737,7 @@ class W {
1732
1737
  }), n;
1733
1738
  }
1734
1739
  }
1735
- class Yr {
1740
+ class Zr {
1736
1741
  channels = /* @__PURE__ */ new Map();
1737
1742
  handlersByChannel = /* @__PURE__ */ new Map();
1738
1743
  markerStore = /* @__PURE__ */ new Map();
@@ -1757,11 +1762,11 @@ class Yr {
1757
1762
  return this.embeddedDeclared = !0, this.embeddedPaths = e.paths ? [...e.paths] : [], this;
1758
1763
  }
1759
1764
  addMarker(e, t, n) {
1760
- if (e === B && n !== Se)
1765
+ if (e === B && n !== ve)
1761
1766
  throw new Error(
1762
1767
  "Reserved key 'checkpoint' must contain a Channel Event Checkpoint"
1763
1768
  );
1764
- if (n === Se) {
1769
+ if (n === ve) {
1765
1770
  if (e !== B)
1766
1771
  throw new Error(
1767
1772
  `Channel Event Checkpoint must use reserved key 'checkpoint' at key '${e}'`
@@ -1800,7 +1805,7 @@ function te(o, e, t) {
1800
1805
  return r;
1801
1806
  return null;
1802
1807
  }
1803
- class Zr {
1808
+ class Xr {
1804
1809
  constructor(e, t, n) {
1805
1810
  this.blue = e, this.registry = t, this.builtinChannelSchemas = n;
1806
1811
  }
@@ -1903,7 +1908,7 @@ class Zr {
1903
1908
  e.addProperty("channel", new p().setValue(t));
1904
1909
  }
1905
1910
  isZodError(e) {
1906
- return e instanceof ve;
1911
+ return e instanceof we;
1907
1912
  }
1908
1913
  }
1909
1914
  class F extends Error {
@@ -1911,11 +1916,11 @@ class F extends Error {
1911
1916
  super(e ?? "MustUnderstand failure"), this.name = "MustUnderstandFailure";
1912
1917
  }
1913
1918
  }
1914
- const Xr = b["Conversation/Composite Timeline Channel"];
1915
- function eo(o) {
1919
+ const eo = b["Conversation/Composite Timeline Channel"];
1920
+ function to(o) {
1916
1921
  const { compositeKey: e, contract: t, scopeContracts: n, blueId: r, blue: i } = o, s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), c = [], u = /* @__PURE__ */ new Map([
1917
1922
  [e, t]
1918
- ]), h = (f) => i.isTypeOfBlueId(f.node, Xr), d = (f) => {
1923
+ ]), h = (f) => i.isTypeOfBlueId(f.node, eo), d = (f) => {
1919
1924
  if (u.has(f))
1920
1925
  return u.get(f) ?? null;
1921
1926
  const g = n.get(f);
@@ -1924,11 +1929,11 @@ function eo(o) {
1924
1929
  try {
1925
1930
  const y = i.nodeToSchemaOutput(
1926
1931
  g.node,
1927
- St
1932
+ vt
1928
1933
  );
1929
1934
  return u.set(f, y), y;
1930
1935
  } catch (y) {
1931
- if (to(y))
1936
+ if (no(y))
1932
1937
  throw new E(
1933
1938
  "Failed to parse channel contract",
1934
1939
  C.invalidContract(
@@ -1969,63 +1974,63 @@ function eo(o) {
1969
1974
  };
1970
1975
  v(e);
1971
1976
  }
1972
- function to(o) {
1973
- return o instanceof ve;
1977
+ function no(o) {
1978
+ return o instanceof we;
1974
1979
  }
1975
- const no = S["Core/Document Update Channel"], ro = S["Core/Embedded Node Channel"], oo = S["Core/Lifecycle Event Channel"], io = S["Core/Triggered Event Channel"], qe = S["Core/Process Embedded"], so = S["Core/Processing Initialized Marker"], ao = S["Core/Processing Terminated Marker"], co = S["Core/Channel Event Checkpoint"], lo = q["MyOS/Document Anchors"], uo = q["MyOS/Document Links"], ho = q["MyOS/MyOS Participants Orchestration"], po = q["MyOS/MyOS Session Interaction"], fo = q["MyOS/MyOS Worker Agency"], mo = b["Conversation/Composite Timeline Channel"], pe = /* @__PURE__ */ new Map([
1976
- [
1977
- no,
1978
- wn
1979
- ],
1980
+ const ro = S["Core/Document Update Channel"], oo = S["Core/Embedded Node Channel"], io = S["Core/Lifecycle Event Channel"], so = S["Core/Triggered Event Channel"], Ge = S["Core/Process Embedded"], ao = S["Core/Processing Initialized Marker"], co = S["Core/Processing Terminated Marker"], lo = S["Core/Channel Event Checkpoint"], uo = q["MyOS/Document Anchors"], ho = q["MyOS/Document Links"], po = q["MyOS/MyOS Participants Orchestration"], fo = q["MyOS/MyOS Session Interaction"], mo = q["MyOS/MyOS Worker Agency"], go = b["Conversation/Composite Timeline Channel"], pe = /* @__PURE__ */ new Map([
1980
1981
  [
1981
1982
  ro,
1982
- In
1983
+ bn
1983
1984
  ],
1984
1985
  [
1985
1986
  oo,
1986
- Tn
1987
+ kn
1987
1988
  ],
1988
1989
  [
1989
1990
  io,
1990
- Rn
1991
- ]
1992
- ]), go = /* @__PURE__ */ new Map([
1991
+ Pn
1992
+ ],
1993
1993
  [
1994
1994
  so,
1995
- zn
1996
- ],
1995
+ Mn
1996
+ ]
1997
+ ]), Eo = /* @__PURE__ */ new Map([
1997
1998
  [
1998
1999
  ao,
1999
- Wn
2000
+ Vn
2000
2001
  ],
2001
2002
  [
2002
2003
  co,
2003
- $n
2004
+ qn
2004
2005
  ],
2005
2006
  [
2006
2007
  lo,
2007
- Jn
2008
+ Un
2008
2009
  ],
2009
2010
  [
2010
2011
  uo,
2011
- Zn
2012
+ Qn
2012
2013
  ],
2013
2014
  [
2014
2015
  ho,
2015
- er
2016
+ Xn
2016
2017
  ],
2017
2018
  [
2018
2019
  po,
2019
- nr
2020
+ tr
2020
2021
  ],
2021
2022
  [
2022
2023
  fo,
2023
- or
2024
+ rr
2025
+ ],
2026
+ [
2027
+ mo,
2028
+ ir
2024
2029
  ]
2025
2030
  ]);
2026
- class Eo {
2031
+ class yo {
2027
2032
  constructor(e, t) {
2028
- this.registry = e, this.blue = t, this.handlerRegistration = new Zr(
2033
+ this.registry = e, this.blue = t, this.handlerRegistration = new Xr(
2029
2034
  this.blue,
2030
2035
  this.registry,
2031
2036
  pe
@@ -2058,14 +2063,14 @@ class Eo {
2058
2063
  const i = n.getType()?.getBlueId();
2059
2064
  if (!i)
2060
2065
  return;
2061
- if (this.blue.isTypeOfBlueId(n, qe)) {
2066
+ if (this.blue.isTypeOfBlueId(n, Ge)) {
2062
2067
  this.handleProcessEmbedded(e, t, n);
2063
2068
  return;
2064
2069
  }
2065
2070
  const s = te(
2066
2071
  this.blue,
2067
2072
  n,
2068
- go
2073
+ Eo
2069
2074
  );
2070
2075
  if (s) {
2071
2076
  this.handleMarker(
@@ -2136,7 +2141,7 @@ class Eo {
2136
2141
  );
2137
2142
  return;
2138
2143
  }
2139
- throw nt(i) ? new E(
2144
+ throw rt(i) ? new E(
2140
2145
  "Built-in processor-managed channel is missing schema registration",
2141
2146
  C.invalidContract(
2142
2147
  i,
@@ -2149,14 +2154,14 @@ class Eo {
2149
2154
  try {
2150
2155
  const r = this.blue.nodeToSchemaOutput(
2151
2156
  n,
2152
- Hn
2157
+ Kn
2153
2158
  );
2154
2159
  e.setEmbedded(r);
2155
2160
  } catch (r) {
2156
2161
  throw fe(r) ? new E(
2157
2162
  "Failed to parse ProcessEmbedded marker",
2158
2163
  C.invalidContract(
2159
- qe,
2164
+ Ge,
2160
2165
  "Failed to parse ProcessEmbedded marker",
2161
2166
  t,
2162
2167
  r
@@ -2175,7 +2180,7 @@ class Eo {
2175
2180
  n,
2176
2181
  r
2177
2182
  );
2178
- this.blue.isTypeOfBlueId(n, mo) && this.validateCompositeChannel(
2183
+ this.blue.isTypeOfBlueId(n, go) && this.validateCompositeChannel(
2179
2184
  t,
2180
2185
  a,
2181
2186
  s,
@@ -2225,7 +2230,7 @@ class Eo {
2225
2230
  )
2226
2231
  );
2227
2232
  }
2228
- eo({
2233
+ to({
2229
2234
  compositeKey: e,
2230
2235
  contract: t,
2231
2236
  scopeContracts: n,
@@ -2240,7 +2245,7 @@ class Eo {
2240
2245
  handleMarker(e, t, n, r, i, s) {
2241
2246
  try {
2242
2247
  const a = b["Conversation/Actor Policy"];
2243
- this.blue.isTypeOfBlueId(n, a) && (this.assertSingleActorPolicyMarker(t, s, i), xn(n));
2248
+ this.blue.isTypeOfBlueId(n, a) && (this.assertSingleActorPolicyMarker(t, s, i), Fn(n));
2244
2249
  const c = this.blue.nodeToSchemaOutput(
2245
2250
  n,
2246
2251
  r
@@ -2249,7 +2254,7 @@ class Eo {
2249
2254
  } catch (a) {
2250
2255
  if (a instanceof E || a instanceof F)
2251
2256
  throw a;
2252
- if (a instanceof It)
2257
+ if (a instanceof kt)
2253
2258
  throw new E(
2254
2259
  a.message,
2255
2260
  C.invalidContract(i, a.message, t, a)
@@ -2299,26 +2304,26 @@ class Eo {
2299
2304
  }
2300
2305
  }
2301
2306
  function fe(o) {
2302
- return o instanceof ve;
2307
+ return o instanceof we;
2303
2308
  }
2304
- const yo = S["Core/Channel Event Checkpoint"];
2305
- function Co(o) {
2309
+ const Co = S["Core/Channel Event Checkpoint"];
2310
+ function So(o) {
2306
2311
  return o.jsonValueToNode({
2307
- type: { blueId: yo },
2312
+ type: { blueId: Co },
2308
2313
  lastEvents: {},
2309
2314
  lastSignatures: {}
2310
2315
  });
2311
2316
  }
2312
- function So() {
2317
+ function vo() {
2313
2318
  return {
2314
2319
  lastEvents: {},
2315
2320
  lastSignatures: {}
2316
2321
  };
2317
2322
  }
2318
- function Ge(o) {
2323
+ function je(o) {
2319
2324
  return o != null && Object.prototype.hasOwnProperty.call(o, "lastEvents") && Object.prototype.hasOwnProperty.call(o, "lastSignatures");
2320
2325
  }
2321
- class vo {
2326
+ class wo {
2322
2327
  constructor(e, t, n, r, i) {
2323
2328
  this.markerKey = e, this.checkpoint = t, this.channelKey = n, this.lastEventNode = r, this.lastEventSignature = i;
2324
2329
  }
@@ -2328,28 +2333,28 @@ class vo {
2328
2333
  return e != null && e === this.lastEventSignature;
2329
2334
  }
2330
2335
  }
2331
- class wo {
2336
+ class bo {
2332
2337
  constructor(e, t) {
2333
2338
  this.runtime = e, this.signatureFn = t;
2334
2339
  }
2335
2340
  ensureCheckpointMarker(e, t) {
2336
- const n = t.marker(B), r = k(e, ot);
2341
+ const n = t.marker(B), r = k(e, it);
2337
2342
  if (!n) {
2338
- const i = Co(this.runtime.blue());
2339
- this.runtime.directWrite(r, i), t.registerCheckpointMarker(So());
2343
+ const i = So(this.runtime.blue());
2344
+ this.runtime.directWrite(r, i), t.registerCheckpointMarker(vo());
2340
2345
  return;
2341
2346
  }
2342
- if (!Ge(n))
2347
+ if (!je(n))
2343
2348
  throw new Error(
2344
2349
  `Reserved key 'checkpoint' must contain a Channel Event Checkpoint at ${r}`
2345
2350
  );
2346
2351
  }
2347
2352
  findCheckpoint(e, t) {
2348
2353
  for (const [n, r] of e.markerEntries()) {
2349
- if (!Ge(r))
2354
+ if (!je(r))
2350
2355
  continue;
2351
2356
  const s = (r.lastEvents?.[t] ?? null)?.clone() ?? null, c = r.lastSignatures?.[t] ?? null ?? this.signatureFn(s);
2352
- return new vo(
2357
+ return new wo(
2353
2358
  n,
2354
2359
  r,
2355
2360
  t,
@@ -2367,17 +2372,17 @@ class wo {
2367
2372
  return;
2368
2373
  const s = k(
2369
2374
  e,
2370
- at(n.markerKey, n.channelKey)
2375
+ ct(n.markerKey, n.channelKey)
2371
2376
  ), a = i?.clone() ?? null;
2372
2377
  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;
2373
2378
  const c = k(
2374
2379
  e,
2375
- ct(n.markerKey, n.channelKey)
2380
+ lt(n.markerKey, n.channelKey)
2376
2381
  ), u = r == null ? null : new p().setValue(r);
2377
2382
  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;
2378
2383
  }
2379
2384
  }
2380
- class bo {
2385
+ class Io {
2381
2386
  constructor(e, t, n) {
2382
2387
  this.runtime = e, this.checkpointManager = t, this.deps = n;
2383
2388
  }
@@ -2504,7 +2509,7 @@ class bo {
2504
2509
  );
2505
2510
  }
2506
2511
  }
2507
- function Io(o, e) {
2512
+ function ko(o, e) {
2508
2513
  return e.isResolved() ? o.createResolvedNode(e) : o.resolve(e);
2509
2514
  }
2510
2515
  class K extends E {
@@ -2517,8 +2522,8 @@ class V extends Error {
2517
2522
  super(e), this.name = "BoundaryViolationException";
2518
2523
  }
2519
2524
  }
2520
- const ko = S["Core/Document Update Channel"], To = S["Core/Embedded Node Channel"], Po = S["Core/Triggered Event Channel"], Ro = S["Core/Lifecycle Event Channel"], je = S["Core/Processing Initialized Marker"], Mo = S["Core/Document Processing Initiated"];
2521
- class Oo {
2525
+ const To = S["Core/Document Update Channel"], Po = S["Core/Embedded Node Channel"], Ro = S["Core/Triggered Event Channel"], Mo = S["Core/Lifecycle Event Channel"], Je = S["Core/Processing Initialized Marker"], Oo = S["Core/Document Processing Initiated"];
2526
+ class No {
2522
2527
  runtime;
2523
2528
  contractLoader;
2524
2529
  channelRunner;
@@ -2577,7 +2582,7 @@ class Oo {
2577
2582
  }
2578
2583
  }
2579
2584
  async processExternalEvent(e, t) {
2580
- const n = Io(this.runtime.blue(), t);
2585
+ const n = ko(this.runtime.blue(), t);
2581
2586
  await this.processPreparedExternalEvent(e, n);
2582
2587
  }
2583
2588
  async processPreparedExternalEvent(e, t) {
@@ -2644,7 +2649,7 @@ class Oo {
2644
2649
  continue;
2645
2650
  const c = this.createDocumentUpdateEvent(i, s), u = this.channelsMatching(
2646
2651
  a,
2647
- ko
2652
+ To
2648
2653
  );
2649
2654
  for (const h of u) {
2650
2655
  const d = h.contract();
@@ -2682,7 +2687,7 @@ class Oo {
2682
2687
  return;
2683
2688
  const i = this.channelsMatching(
2684
2689
  t,
2685
- Ro
2690
+ Mo
2686
2691
  );
2687
2692
  for (const s of i)
2688
2693
  if (await this.channelRunner.runHandlers(
@@ -2744,7 +2749,7 @@ class Oo {
2744
2749
  }
2745
2750
  }
2746
2751
  async addInitializationMarker(e, t) {
2747
- const n = new p().setType(new p().setBlueId(je)).addProperty("documentId", new p().setValue(t)), r = e.resolvePointer(Ee);
2752
+ const n = new p().setType(new p().setBlueId(Je)).addProperty("documentId", new p().setValue(t)), r = e.resolvePointer(Ee);
2748
2753
  await e.applyPatch({
2749
2754
  op: "ADD",
2750
2755
  path: r,
@@ -2759,7 +2764,7 @@ class Oo {
2759
2764
  return;
2760
2765
  const n = this.channelsMatching(
2761
2766
  t,
2762
- To
2767
+ Po
2763
2768
  );
2764
2769
  if (n.length !== 0)
2765
2770
  for (const r of t.embeddedPaths()) {
@@ -2785,7 +2790,7 @@ class Oo {
2785
2790
  return;
2786
2791
  const n = this.runtime.scope(e), r = this.channelsMatching(
2787
2792
  t,
2788
- Po
2793
+ Ro
2789
2794
  );
2790
2795
  if (r.length === 0) {
2791
2796
  n.clearTriggered();
@@ -2825,7 +2830,7 @@ class Oo {
2825
2830
  }
2826
2831
  isProcessorManagedChannel(e) {
2827
2832
  const t = this.runtime.blue(), n = e.node();
2828
- for (const r of Ie)
2833
+ for (const r of ke)
2829
2834
  if (t.isTypeOfBlueId(n, r))
2830
2835
  return !0;
2831
2836
  return !1;
@@ -2852,7 +2857,7 @@ class Oo {
2852
2857
  if (n)
2853
2858
  return;
2854
2859
  const r = w(e), i = R(t.path);
2855
- for (const s of be) {
2860
+ for (const s of Ie) {
2856
2861
  const a = k(
2857
2862
  r,
2858
2863
  ae(s)
@@ -2880,14 +2885,14 @@ class Oo {
2880
2885
  const i = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
2881
2886
  throw new K(i);
2882
2887
  }
2883
- if (n.getType()?.getBlueId() !== je) {
2888
+ if (n.getType()?.getBlueId() !== Je) {
2884
2889
  const i = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
2885
2890
  throw new K(i);
2886
2891
  }
2887
2892
  return !0;
2888
2893
  }
2889
2894
  createLifecycleEvent(e) {
2890
- return new p().setType(new p().setBlueId(Mo)).setProperties({
2895
+ return new p().setType(new p().setBlueId(Oo)).setProperties({
2891
2896
  type: new p().setValue("Core/Document Processing Initiated"),
2892
2897
  documentId: new p().setValue(e)
2893
2898
  });
@@ -2900,19 +2905,19 @@ class ie extends Error {
2900
2905
  ), this.fatal = e, this.name = "RunTerminationError";
2901
2906
  }
2902
2907
  }
2903
- const No = S["Core/Processing Terminated Marker"], Ao = S["Core/Document Processing Terminated"];
2904
- class Do {
2908
+ const Ao = S["Core/Processing Terminated Marker"], Do = S["Core/Document Processing Terminated"];
2909
+ class Bo {
2905
2910
  constructor(e) {
2906
2911
  this.runtime = e;
2907
2912
  }
2908
2913
  async terminateScope(e, t, n, r, i) {
2909
2914
  e.recordPendingTermination(t, r, i ?? null);
2910
- const s = e.normalizeScope(t), a = k(s, rt);
2915
+ const s = e.normalizeScope(t), a = k(s, ot);
2911
2916
  this.runtime.directWrite(
2912
2917
  a,
2913
- Bo(this.runtime.blue(), r, i)
2918
+ _o(this.runtime.blue(), r, i)
2914
2919
  ), this.runtime.gasMeter().chargeTerminationMarker();
2915
- const c = n ?? e.bundleForScope(s) ?? null, u = _o(r, i);
2920
+ const c = n ?? e.bundleForScope(s) ?? null, u = Lo(r, i);
2916
2921
  if (await e.deliverLifecycle(
2917
2922
  s,
2918
2923
  c,
@@ -2924,32 +2929,32 @@ class Do {
2924
2929
  throw this.runtime.markRunTerminated(), new ie(!1);
2925
2930
  }
2926
2931
  }
2927
- function Bo(o, e, t) {
2928
- return Lo(o, {
2929
- type: { blueId: No },
2932
+ function _o(o, e, t) {
2933
+ return xo(o, {
2934
+ type: { blueId: Ao },
2930
2935
  cause: e === "GRACEFUL" ? "graceful" : "fatal",
2931
2936
  ...t ? { reason: t } : {}
2932
2937
  });
2933
2938
  }
2934
- function _o(o, e) {
2939
+ function Lo(o, e) {
2935
2940
  const t = new p().setType(
2936
- new p().setBlueId(Ao)
2941
+ new p().setBlueId(Do)
2937
2942
  );
2938
2943
  return t.addProperty(
2939
2944
  "cause",
2940
2945
  new p().setValue(o === "GRACEFUL" ? "graceful" : "fatal")
2941
2946
  ), e && t.addProperty("reason", new p().setValue(e)), t;
2942
2947
  }
2943
- function Lo(o, e) {
2948
+ function xo(o, e) {
2944
2949
  return o.jsonValueToNode(e);
2945
2950
  }
2946
2951
  const Y = "-";
2947
- class xo {
2952
+ class Fo {
2948
2953
  constructor(e) {
2949
2954
  this.document = e;
2950
2955
  }
2951
2956
  applyPatch(e, t) {
2952
- const n = w(e), r = R(t.path), i = Qe(r), s = Je(this.document, i, "before", r);
2957
+ const n = w(e), r = R(t.path), i = Ye(r), s = Qe(this.document, i, "before", r);
2953
2958
  switch (t.op) {
2954
2959
  case "ADD":
2955
2960
  this.applyAdd(i, r, t.val ?? null);
@@ -2961,21 +2966,21 @@ class xo {
2961
2966
  this.applyRemove(i, r);
2962
2967
  break;
2963
2968
  }
2964
- const a = t.op === "REMOVE" ? null : Je(this.document, i, "after", r);
2969
+ const a = t.op === "REMOVE" ? null : Qe(this.document, i, "after", r);
2965
2970
  return {
2966
2971
  path: r,
2967
2972
  before: s,
2968
2973
  after: a,
2969
2974
  op: t.op.toLowerCase(),
2970
2975
  originScope: n,
2971
- cascadeScopes: Fo(n)
2976
+ cascadeScopes: $o(n)
2972
2977
  };
2973
2978
  }
2974
2979
  directWrite(e, t) {
2975
2980
  const n = R(e);
2976
2981
  if (n === "/")
2977
2982
  throw new Error("Direct write cannot target root document");
2978
- const r = Qe(n), { parent: i, leaf: s } = this.resolveParent(r);
2983
+ const r = Ye(n), { parent: i, leaf: s } = this.resolveParent(r);
2979
2984
  if (s === Y)
2980
2985
  throw new Error(
2981
2986
  `Direct write does not support append token '-' for path ${n}`
@@ -3169,7 +3174,7 @@ class xo {
3169
3174
  }
3170
3175
  }
3171
3176
  }
3172
- function Fo(o) {
3177
+ function $o(o) {
3173
3178
  const e = [];
3174
3179
  let t = o;
3175
3180
  for (; e.push(t), t !== "/"; ) {
@@ -3178,26 +3183,26 @@ function Fo(o) {
3178
3183
  }
3179
3184
  return e;
3180
3185
  }
3181
- function Je(o, e, t, n) {
3186
+ function Qe(o, e, t, n) {
3182
3187
  try {
3183
3188
  if (e.length === 0)
3184
3189
  return o.clone();
3185
- const r = $o(o, e, t, n);
3190
+ const r = Uo(o, e, t, n);
3186
3191
  return r ? r.clone() : null;
3187
3192
  } catch {
3188
3193
  return null;
3189
3194
  }
3190
3195
  }
3191
- function $o(o, e, t, n) {
3196
+ function Uo(o, e, t, n) {
3192
3197
  let r = o;
3193
3198
  for (let i = 0; i < e.length; i += 1) {
3194
3199
  const s = e[i] ?? "", a = i === e.length - 1;
3195
- if (r = Uo(r, s, a, t, n), !r)
3200
+ if (r = zo(r, s, a, t, n), !r)
3196
3201
  return null;
3197
3202
  }
3198
3203
  return r;
3199
3204
  }
3200
- function Uo(o, e, t, n, r) {
3205
+ function zo(o, e, t, n, r) {
3201
3206
  if (!o)
3202
3207
  return null;
3203
3208
  const i = o.getItems();
@@ -3216,7 +3221,7 @@ function Uo(o, e, t, n, r) {
3216
3221
  const a = s[e];
3217
3222
  return a instanceof p ? a : null;
3218
3223
  }
3219
- function Qe(o) {
3224
+ function Ye(o) {
3220
3225
  if (o === "/" || o === "")
3221
3226
  return [];
3222
3227
  const e = o.startsWith("/") ? o.slice(1) : o;
@@ -3258,7 +3263,7 @@ function H(o) {
3258
3263
  function Q(o) {
3259
3264
  return o == null ? new p().setValue(null) : o.clone();
3260
3265
  }
3261
- class zo {
3266
+ class Vo {
3262
3267
  constructor(e) {
3263
3268
  this.path = e;
3264
3269
  }
@@ -3320,7 +3325,7 @@ class zo {
3320
3325
  return this.cutOff;
3321
3326
  }
3322
3327
  }
3323
- class Vo {
3328
+ class Ho {
3324
3329
  scopesMap = /* @__PURE__ */ new Map();
3325
3330
  rootEmissionList = [];
3326
3331
  scopes() {
@@ -3328,7 +3333,7 @@ class Vo {
3328
3333
  }
3329
3334
  scope(e) {
3330
3335
  let t = this.scopesMap.get(e);
3331
- return t || (t = new zo(e), this.scopesMap.set(e, t)), t;
3336
+ return t || (t = new Vo(e), this.scopesMap.set(e, t)), t;
3332
3337
  }
3333
3338
  existingScope(e) {
3334
3339
  return this.scopesMap.get(e);
@@ -3346,33 +3351,33 @@ class Vo {
3346
3351
  this.scopesMap.delete(e);
3347
3352
  }
3348
3353
  }
3349
- function At(o) {
3354
+ function Dt(o) {
3350
3355
  return Math.floor((o + 99) / 100);
3351
3356
  }
3352
- function Ho(o) {
3357
+ function Ko(o) {
3353
3358
  const e = R(o);
3354
3359
  return e === "/" ? 0 : e.split("/").length - 1;
3355
3360
  }
3356
- function Ko(o) {
3361
+ function Wo(o) {
3357
3362
  return 40 + 5 * Math.max(0, o);
3358
3363
  }
3359
- function Wo(o, e) {
3360
- return 8 + Ho(o) + At(e);
3364
+ function qo(o, e) {
3365
+ return 8 + Ko(o) + Dt(e);
3361
3366
  }
3362
- const qo = 1e3, Go = 5, jo = 50, Jo = 2, Qo = 10, Yo = 10, Zo = 10, Xo = 20, ei = 20, ti = 30, ni = 30, ri = 100;
3363
- function oi(o) {
3367
+ const Go = 1e3, jo = 5, Jo = 50, Qo = 2, Yo = 10, Zo = 10, Xo = 10, ei = 20, ti = 20, ni = 30, ri = 30, oi = 100;
3368
+ function ii(o) {
3364
3369
  return 50 + 10 * o;
3365
3370
  }
3366
- function ii(o) {
3371
+ function si(o) {
3367
3372
  return 20 + o;
3368
3373
  }
3369
- function si(o) {
3374
+ function ai(o) {
3370
3375
  return 10 * o;
3371
3376
  }
3372
- function ai(o) {
3377
+ function ci(o) {
3373
3378
  return 20 + o;
3374
3379
  }
3375
- class ci {
3380
+ class li {
3376
3381
  constructor(e) {
3377
3382
  this.blue = e;
3378
3383
  }
@@ -3384,69 +3389,69 @@ class ci {
3384
3389
  this.total += e;
3385
3390
  }
3386
3391
  chargeScopeEntry(e) {
3387
- this.add(oi(this.scopeDepth(e)));
3392
+ this.add(ii(this.scopeDepth(e)));
3388
3393
  }
3389
3394
  chargeInitialization() {
3390
- this.add(qo);
3395
+ this.add(Go);
3391
3396
  }
3392
3397
  chargeChannelMatchAttempt() {
3393
- this.add(Go);
3398
+ this.add(jo);
3394
3399
  }
3395
3400
  chargeHandlerOverhead() {
3396
- this.add(jo);
3401
+ this.add(Jo);
3397
3402
  }
3398
3403
  chargeBoundaryCheck() {
3399
- this.add(Jo);
3404
+ this.add(Qo);
3400
3405
  }
3401
3406
  chargePatchAddOrReplace(e) {
3402
- this.add(ii(this.payloadSizeCharge(e)));
3407
+ this.add(si(this.payloadSizeCharge(e)));
3403
3408
  }
3404
3409
  chargePatchRemove() {
3405
- this.add(Qo);
3410
+ this.add(Yo);
3406
3411
  }
3407
3412
  chargeCascadeRouting(e) {
3408
- e > 0 && this.add(si(e));
3413
+ e > 0 && this.add(ai(e));
3409
3414
  }
3410
3415
  chargeEmitEvent(e) {
3411
- this.add(ai(this.payloadSizeCharge(e)));
3416
+ this.add(ci(this.payloadSizeCharge(e)));
3412
3417
  }
3413
3418
  chargeBridge() {
3414
- this.add(Yo);
3419
+ this.add(Zo);
3415
3420
  }
3416
3421
  chargeDrainEvent() {
3417
- this.add(Zo);
3422
+ this.add(Xo);
3418
3423
  }
3419
3424
  chargeCheckpointUpdate() {
3420
- this.add(Xo);
3425
+ this.add(ei);
3421
3426
  }
3422
3427
  chargeTerminationMarker() {
3423
- this.add(ei);
3428
+ this.add(ti);
3424
3429
  }
3425
3430
  chargeLifecycleDelivery() {
3426
- this.add(ti);
3431
+ this.add(ni);
3427
3432
  }
3428
3433
  chargeFatalTerminationOverhead() {
3429
- this.add(ri);
3434
+ this.add(oi);
3430
3435
  }
3431
3436
  chargeTriggerEventBase() {
3432
- this.add(ni);
3437
+ this.add(ri);
3433
3438
  }
3434
3439
  chargeUpdateDocumentBase(e) {
3435
- this.add(Ko(e));
3440
+ this.add(Wo(e));
3436
3441
  }
3437
3442
  chargeDocumentSnapshot(e, t) {
3438
- const n = t ? _e(this.blue, t) : 0;
3439
- this.add(Wo(e, n));
3443
+ const n = t ? Le(this.blue, t) : 0;
3444
+ this.add(qo(e, n));
3440
3445
  }
3441
3446
  chargeWasmGas(e) {
3442
- const t = an(e);
3447
+ const t = cn(e);
3443
3448
  t > 0 && this.add(t);
3444
3449
  }
3445
3450
  payloadSizeCharge(e) {
3446
3451
  if (!e)
3447
3452
  return 0;
3448
- const t = _e(this.blue, e);
3449
- return At(t);
3453
+ const t = Le(this.blue, e);
3454
+ return Dt(t);
3450
3455
  }
3451
3456
  scopeDepth(e) {
3452
3457
  const t = w(e);
@@ -3458,12 +3463,12 @@ class ci {
3458
3463
  return n;
3459
3464
  }
3460
3465
  }
3461
- class li {
3466
+ class ui {
3462
3467
  constructor(e, t) {
3463
- this.documentRef = e, this.blueRef = t, this.patchEngine = new xo(this.documentRef), this.meter = new ci(this.blueRef);
3468
+ this.documentRef = e, this.blueRef = t, this.patchEngine = new Fo(this.documentRef), this.meter = new li(this.blueRef);
3464
3469
  }
3465
3470
  patchEngine;
3466
- emissionRegistry = new Vo();
3471
+ emissionRegistry = new Ho();
3467
3472
  meter;
3468
3473
  runTerminated = !1;
3469
3474
  document() {
@@ -3512,15 +3517,15 @@ class li {
3512
3517
  return this.patchEngine.applyPatch(e, t);
3513
3518
  }
3514
3519
  }
3515
- const ui = S["Core/Processing Initialized Marker"], hi = S["Core/Document Update"];
3516
- class di {
3520
+ const hi = S["Core/Processing Initialized Marker"], di = S["Core/Document Update"];
3521
+ class pi {
3517
3522
  constructor(e, t, n, r) {
3518
- this.contractLoader = e, this.registry = t, this.runtimeRef = new li(r, n);
3519
- const i = (s) => ut(this.runtimeRef.blue(), s);
3520
- this.checkpointManager = new wo(
3523
+ this.contractLoader = e, this.registry = t, this.runtimeRef = new ui(r, n);
3524
+ const i = (s) => ht(this.runtimeRef.blue(), s);
3525
+ this.checkpointManager = new bo(
3521
3526
  this.runtimeRef,
3522
3527
  i
3523
- ), this.terminationService = new Do(this.runtimeRef), this.channelRunner = new bo(
3528
+ ), this.terminationService = new Bo(this.runtimeRef), this.channelRunner = new Io(
3524
3529
  this.runtimeRef,
3525
3530
  this.checkpointManager,
3526
3531
  {
@@ -3550,7 +3555,7 @@ class di {
3550
3555
  canonicalSignature: i,
3551
3556
  channelProcessorFor: (s) => this.lookupChannelProcessor(s)
3552
3557
  }
3553
- ), this.scopeExecutor = new Oo({
3558
+ ), this.scopeExecutor = new No({
3554
3559
  runtime: this.runtimeRef,
3555
3560
  contractLoader: this.contractLoader,
3556
3561
  channelRunner: this.channelRunner,
@@ -3601,7 +3606,7 @@ class di {
3601
3606
  );
3602
3607
  }
3603
3608
  createContext(e, t, n, r = !1, i = !1) {
3604
- return new pi(
3609
+ return new fi(
3605
3610
  this,
3606
3611
  t,
3607
3612
  e,
@@ -3612,7 +3617,7 @@ class di {
3612
3617
  }
3613
3618
  result() {
3614
3619
  const e = this.runtimeRef.document().clone(), t = this.runtimeRef.rootEmissions().map((n) => n.clone());
3615
- return Ze.of(
3620
+ return Xe.of(
3616
3621
  e,
3617
3622
  t,
3618
3623
  this.runtimeRef.totalGas()
@@ -3742,8 +3747,8 @@ class di {
3742
3747
  return this.registry.lookupChannelForNode(this.runtimeRef.blue(), e) ?? null;
3743
3748
  }
3744
3749
  createDocumentUpdateEvent(e, t) {
3745
- const n = Jt(t, e.path), r = e.before != null ? e.before.clone() : new p().setValue(null), i = e.after != null ? e.after.clone() : new p().setValue(null), s = new p().setType(
3746
- new p().setBlueId(hi)
3750
+ const n = Qt(t, e.path), r = e.before != null ? e.before.clone() : new p().setValue(null), i = e.after != null ? e.after.clone() : new p().setValue(null), s = new p().setType(
3751
+ new p().setBlueId(di)
3747
3752
  );
3748
3753
  return s.setProperties({
3749
3754
  op: new p().setValue(e.op),
@@ -3783,7 +3788,7 @@ class se {
3783
3788
  return this.initializationMarker(e) != null;
3784
3789
  }
3785
3790
  createExecution(e) {
3786
- return new di(
3791
+ return new pi(
3787
3792
  this.contractLoader,
3788
3793
  this.registry,
3789
3794
  this.blue,
@@ -3798,7 +3803,7 @@ class se {
3798
3803
  return t.result();
3799
3804
  if (r instanceof F) {
3800
3805
  const i = e.clone();
3801
- return Ze.capabilityFailure(
3806
+ return Xe.capabilityFailure(
3802
3807
  i,
3803
3808
  r.message ?? null
3804
3809
  );
@@ -3808,7 +3813,7 @@ class se {
3808
3813
  return t.result();
3809
3814
  }
3810
3815
  initializationMarker(e) {
3811
- const n = e.getProperties()?.[Ne.OBJECT_CONTRACTS]?.getProperties()?.initialized ?? null;
3816
+ const n = e.getProperties()?.[Ae.OBJECT_CONTRACTS]?.getProperties()?.initialized ?? null;
3812
3817
  if (!n)
3813
3818
  return null;
3814
3819
  if (!(n instanceof p))
@@ -3818,7 +3823,7 @@ class se {
3818
3823
  "Initialization Marker must be a BlueNode"
3819
3824
  )
3820
3825
  );
3821
- if (n.getType()?.getBlueId() !== ui)
3826
+ if (n.getType()?.getBlueId() !== hi)
3822
3827
  throw new E(
3823
3828
  "Initialization Marker must declare type 'Processing Initialized Marker'",
3824
3829
  C.illegalState(
@@ -3881,7 +3886,7 @@ class se {
3881
3886
  return new p().setValue(e.getValue() ?? null);
3882
3887
  case "blue":
3883
3888
  return e.getBlue() ?? null;
3884
- case Ne.OBJECT_CONTRACTS:
3889
+ case Ae.OBJECT_CONTRACTS:
3885
3890
  return new p().setContracts(e.getContracts());
3886
3891
  case "blueId": {
3887
3892
  const r = n?.calculateBlueId?.(e);
@@ -3899,7 +3904,7 @@ class se {
3899
3904
  }
3900
3905
  }
3901
3906
  }
3902
- class pi {
3907
+ class fi {
3903
3908
  constructor(e, t, n, r, i, s) {
3904
3909
  this.execution = e, this.bundle = t, this.scopePathValue = n, this.eventNode = r, this.allowTerminatedWork = i, this.allowReservedMutation = s;
3905
3910
  }
@@ -3993,7 +3998,7 @@ class pi {
3993
3998
  return !this.allowTerminatedWork && this.execution.isScopeInactive(this.scopePathValue);
3994
3999
  }
3995
4000
  }
3996
- class Dt {
4001
+ class Bt {
3997
4002
  process(e, t) {
3998
4003
  const n = t.getValue();
3999
4004
  if (re(n)) {
@@ -4014,10 +4019,10 @@ class Dt {
4014
4019
  return e;
4015
4020
  }
4016
4021
  }
4017
- function fi() {
4022
+ function mi() {
4018
4023
  return new L.SequentialMergingProcessor([
4019
4024
  new L.ValuePropagator(),
4020
- new Dt(),
4025
+ new Bt(),
4021
4026
  new L.TypeAssigner(),
4022
4027
  new L.ListProcessor(),
4023
4028
  new L.DictionaryProcessor(),
@@ -4025,17 +4030,17 @@ function fi() {
4025
4030
  new L.BasicTypesVerifier()
4026
4031
  ]);
4027
4032
  }
4028
- const mi = new Ut({
4029
- repositories: [Ye],
4030
- mergingProcessor: fi()
4033
+ const gi = new zt({
4034
+ repositories: [Ze],
4035
+ mergingProcessor: mi()
4031
4036
  });
4032
- class gi {
4037
+ class Ei {
4033
4038
  blue;
4034
4039
  registryRef;
4035
4040
  contractLoaderRef;
4036
4041
  engine;
4037
4042
  constructor(e) {
4038
- this.registryRef = e?.registry ?? ue.create().registerDefaults().build(), this.blue = e?.blue ?? mi, this.contractLoaderRef = new Eo(this.registryRef, this.blue), this.engine = new se(
4043
+ this.registryRef = e?.registry ?? ue.create().registerDefaults().build(), this.blue = e?.blue ?? gi, this.contractLoaderRef = new yo(this.registryRef, this.blue), this.engine = new se(
4039
4044
  this.contractLoaderRef,
4040
4045
  this.registryRef,
4041
4046
  this.blue
@@ -4068,10 +4073,10 @@ class gi {
4068
4073
  return this.contractLoaderRef;
4069
4074
  }
4070
4075
  static builder() {
4071
- return new Ei();
4076
+ return new yi();
4072
4077
  }
4073
4078
  }
4074
- class Ei {
4079
+ class yi {
4075
4080
  contractRegistry;
4076
4081
  blueInstance;
4077
4082
  constructor() {
@@ -4087,117 +4092,118 @@ class Ei {
4087
4092
  return this.blueInstance = e, this;
4088
4093
  }
4089
4094
  build() {
4090
- return new gi({
4095
+ return new Ei({
4091
4096
  registry: this.contractRegistry,
4092
4097
  blue: this.blueInstance
4093
4098
  });
4094
4099
  }
4095
4100
  }
4096
- const Ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4101
+ const zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4097
4102
  __proto__: null,
4098
- ExpressionPreserver: Dt
4103
+ ExpressionPreserver: Bt
4099
4104
  }, Symbol.toStringTag, { value: "Module" }));
4100
4105
  export {
4101
- It as ActorPolicyLiteralValidationError,
4102
- Jr as ChannelBinding,
4103
- bo as ChannelRunner,
4104
- wo as CheckpointManager,
4105
- vo as CheckpointRecord,
4106
- pt as CodeBlockEvaluationError,
4106
+ kt as ActorPolicyLiteralValidationError,
4107
+ Qr as ChannelBinding,
4108
+ Io as ChannelRunner,
4109
+ bo as CheckpointManager,
4110
+ wo as CheckpointRecord,
4111
+ ft as CodeBlockEvaluationError,
4107
4112
  W as ContractBundle,
4108
- Yr as ContractBundleBuilder,
4109
- Eo as ContractLoader,
4110
- lr as ContractProcessorRegistry,
4113
+ Zr as ContractBundleBuilder,
4114
+ yo as ContractLoader,
4115
+ ur as ContractProcessorRegistry,
4111
4116
  ue as ContractProcessorRegistryBuilder,
4112
- Ze as DocumentProcessingResult,
4113
- li as DocumentProcessingRuntime,
4114
- gi as DocumentProcessor,
4115
- Ei as DocumentProcessorBuilder,
4116
- Vo as EmissionRegistry,
4117
- ci as GasMeter,
4118
- Qr as HandlerBinding,
4117
+ Xe as DocumentProcessingResult,
4118
+ ui as DocumentProcessingRuntime,
4119
+ Ei as DocumentProcessor,
4120
+ yi as DocumentProcessorBuilder,
4121
+ Ho as EmissionRegistry,
4122
+ li as GasMeter,
4123
+ Yr as HandlerBinding,
4119
4124
  B as KEY_CHECKPOINT,
4120
- Xe as KEY_EMBEDDED,
4121
- et as KEY_INITIALIZED,
4122
- tt as KEY_TERMINATED,
4123
- Ui as MergingProcessors,
4124
- Ie as PROCESSOR_MANAGED_CHANNEL_BLUE_IDS,
4125
- xo as PatchEngine,
4126
- _i as ProcessorContractConstants,
4125
+ et as KEY_EMBEDDED,
4126
+ tt as KEY_INITIALIZED,
4127
+ nt as KEY_TERMINATED,
4128
+ zi as MergingProcessors,
4129
+ ke as PROCESSOR_MANAGED_CHANNEL_BLUE_IDS,
4130
+ Fo as PatchEngine,
4131
+ Li as ProcessorContractConstants,
4127
4132
  se as ProcessorEngine,
4128
4133
  C as ProcessorErrors,
4129
- di as ProcessorExecution,
4130
- pi as ProcessorExecutionContext,
4134
+ pi as ProcessorExecution,
4135
+ fi as ProcessorExecutionContext,
4131
4136
  E as ProcessorFatalError,
4132
- Li as ProcessorPointerConstants,
4133
- ke as QuickJSEvaluator,
4134
- ot as RELATIVE_CHECKPOINT,
4137
+ xi as ProcessorPointerConstants,
4138
+ Te as QuickJSEvaluator,
4139
+ it as RELATIVE_CHECKPOINT,
4135
4140
  G as RELATIVE_CONTRACTS,
4136
- jt as RELATIVE_EMBEDDED,
4141
+ Jt as RELATIVE_EMBEDDED,
4137
4142
  Ee as RELATIVE_INITIALIZED,
4138
- rt as RELATIVE_TERMINATED,
4139
- be as RESERVED_CONTRACT_KEYS,
4143
+ ot as RELATIVE_TERMINATED,
4144
+ Ie as RESERVED_CONTRACT_KEYS,
4140
4145
  ie as RunTerminationError,
4141
- Oo as ScopeExecutor,
4142
- zo as ScopeRuntimeContext,
4143
- Do as TerminationService,
4144
- bt as actorPolicyMarkerSchema,
4145
- _n as actorPolicyRuleSchema,
4146
- Ni as andThen,
4147
- ut as canonicalSignature,
4148
- _e as canonicalSize,
4146
+ No as ScopeExecutor,
4147
+ Vo as ScopeRuntimeContext,
4148
+ Bo as TerminationService,
4149
+ Ce as WORKFLOW_DV_LIMITS,
4150
+ It as actorPolicyMarkerSchema,
4151
+ Ln as actorPolicyRuleSchema,
4152
+ Ai as andThen,
4153
+ ht as canonicalSignature,
4154
+ Le as canonicalSize,
4149
4155
  U as channelContractBaseSchema,
4150
- $n as channelEventCheckpointSchema,
4151
- St as compositeTimelineChannelSchema,
4152
- En as containsExpression,
4153
- Te as contractBaseSchema,
4154
- fi as createDefaultMergingProcessor,
4155
- gt as createPicomatchShouldResolve,
4156
- Jn as documentAnchorsMarkerSchema,
4157
- Zn as documentLinksMarkerSchema,
4158
- wn as documentUpdateChannelSchema,
4159
- In as embeddedNodeChannelSchema,
4160
- Vt as err,
4161
- mt as evaluateQuickJSExpression,
4162
- yn as extractExpressionContent,
4163
- yt as handlerContractBaseSchema,
4164
- zn as initializationMarkerSchema,
4165
- Ri as isErr,
4156
+ Un as channelEventCheckpointSchema,
4157
+ vt as compositeTimelineChannelSchema,
4158
+ yn as containsExpression,
4159
+ Pe as contractBaseSchema,
4160
+ mi as createDefaultMergingProcessor,
4161
+ Et as createPicomatchShouldResolve,
4162
+ Qn as documentAnchorsMarkerSchema,
4163
+ Xn as documentLinksMarkerSchema,
4164
+ bn as documentUpdateChannelSchema,
4165
+ kn as embeddedNodeChannelSchema,
4166
+ Ht as err,
4167
+ gt as evaluateQuickJSExpression,
4168
+ Cn as extractExpressionContent,
4169
+ Ct as handlerContractBaseSchema,
4170
+ Vn as initializationMarkerSchema,
4171
+ Mi as isErr,
4166
4172
  re as isExpression,
4167
- Pi as isOk,
4168
- nt as isProcessorManagedChannelBlueId,
4169
- Gt as isReservedContractKey,
4170
- xi as joinRelativePointers,
4171
- Fi as jsonPatchSchema,
4172
- Tn as lifecycleChannelSchema,
4173
- Mi as map,
4174
- Oi as mapErr,
4173
+ Ri as isOk,
4174
+ rt as isProcessorManagedChannelBlueId,
4175
+ jt as isReservedContractKey,
4176
+ Fi as joinRelativePointers,
4177
+ $i as jsonPatchSchema,
4178
+ Pn as lifecycleChannelSchema,
4179
+ Oi as map,
4180
+ Ni as mapErr,
4175
4181
  M as markerContractBaseSchema,
4176
- Bi as match,
4177
- er as myosParticipantsOrchestrationMarkerSchema,
4178
- nr as myosSessionInteractionMarkerSchema,
4179
- Nn as myosTimelineChannelSchema,
4180
- or as myosWorkerAgencyMarkerSchema,
4182
+ _i as match,
4183
+ tr as myosParticipantsOrchestrationMarkerSchema,
4184
+ rr as myosSessionInteractionMarkerSchema,
4185
+ An as myosTimelineChannelSchema,
4186
+ ir as myosWorkerAgencyMarkerSchema,
4181
4187
  R as normalizePointer,
4182
4188
  w as normalizeScope,
4183
- zt as ok,
4184
- qn as operationMarkerSchema,
4185
- Hn as processEmbeddedMarkerSchema,
4186
- Wn as processingTerminatedMarkerSchema,
4187
- at as relativeCheckpointLastEvent,
4188
- ct as relativeCheckpointLastSignature,
4189
+ Vt as ok,
4190
+ Gn as operationMarkerSchema,
4191
+ Kn as processEmbeddedMarkerSchema,
4192
+ qn as processingTerminatedMarkerSchema,
4193
+ ct as relativeCheckpointLastEvent,
4194
+ lt as relativeCheckpointLastSignature,
4189
4195
  ae as relativeContractsEntry,
4190
- Jt as relativizePointer,
4196
+ Qt as relativizePointer,
4191
4197
  oe as resolveNodeExpressions,
4192
4198
  k as resolvePointer,
4193
- Cn as resolveTemplateString,
4194
- ar as sequentialWorkflowOperationSchema,
4195
- ir as sequentialWorkflowSchema,
4196
- $i as sequentialWorkflowStepSchema,
4197
- De as stripSlashes,
4198
- Mn as timelineChannelSchema,
4199
- Rn as triggeredEventChannelSchema,
4200
- Ai as unwrapOr,
4201
- Di as unwrapOrElse,
4202
- xn as validateActorPolicyNode
4199
+ Sn as resolveTemplateString,
4200
+ cr as sequentialWorkflowOperationSchema,
4201
+ sr as sequentialWorkflowSchema,
4202
+ Ui as sequentialWorkflowStepSchema,
4203
+ Be as stripSlashes,
4204
+ On as timelineChannelSchema,
4205
+ Mn as triggeredEventChannelSchema,
4206
+ Di as unwrapOr,
4207
+ Bi as unwrapOrElse,
4208
+ Fn as validateActorPolicyNode
4203
4209
  };