@blue-labs/document-processor 3.9.2 → 3.11.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,84 +1,84 @@
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 Te, BlueIdCalculator as Pt, Blue as Mt, MergingProcessors as B } from "@blue-labs/language";
5
- import Pe from "picomatch";
6
- import { z as l, ZodError as Ee } from "zod";
7
- import { isNullable as de } from "@blue-labs/shared-utils";
8
- import { repository as Rt } from "@blue-repository/types";
9
- function Nt(i) {
10
- return { ok: !0, value: i };
1
+ import { evaluate as Mt } from "@blue-quickjs/quickjs-runtime";
2
+ import { validateDv as Nt, DV_LIMIT_DEFAULTS as Ot } from "@blue-quickjs/dv";
3
+ import { HOST_V1_MANIFEST as Dt, HOST_V1_HASH as Bt } from "@blue-quickjs/abi-manifest";
4
+ import { BlueNode as p, withTypeBlueId as g, blueNodeField as k, Properties as Pe, BlueIdCalculator as Lt, Blue as xt, MergingProcessors as B } from "@blue-labs/language";
5
+ import Re from "picomatch";
6
+ import { z as l, ZodError as Ce } from "zod";
7
+ import { isNullable as pe } from "@blue-labs/shared-utils";
8
+ import { repository as _t } from "@blue-repository/types";
9
+ function Ft(o) {
10
+ return { ok: !0, value: o };
11
11
  }
12
- function Ot(i) {
13
- return { ok: !1, error: i };
12
+ function Ut(o) {
13
+ return { ok: !1, error: o };
14
14
  }
15
- function Xi(i) {
16
- return i.ok;
15
+ function bi(o) {
16
+ return o.ok;
17
17
  }
18
- function Zi(i) {
19
- return !i.ok;
18
+ function ki(o) {
19
+ return !o.ok;
20
20
  }
21
- function Yi(i, e) {
22
- return i.ok ? Nt(e(i.value)) : i;
21
+ function Ti(o, e) {
22
+ return o.ok ? Ft(e(o.value)) : o;
23
23
  }
24
- function eo(i, e) {
25
- return i.ok ? i : Ot(e(i.error));
24
+ function Ii(o, e) {
25
+ return o.ok ? o : Ut(e(o.error));
26
26
  }
27
- function to(i, e) {
28
- return i.ok ? e(i.value) : i;
27
+ function Pi(o, e) {
28
+ return o.ok ? e(o.value) : o;
29
29
  }
30
- function no(i, e) {
31
- return i.ok ? i.value : e;
30
+ function Ri(o, e) {
31
+ return o.ok ? o.value : e;
32
32
  }
33
- function ro(i, e) {
34
- return i.ok ? i.value : e(i.error);
33
+ function Ai(o, e) {
34
+ return o.ok ? o.value : e(o.error);
35
35
  }
36
- function io(i, e) {
37
- return i.ok ? e.ok(i.value) : e.err(i.error);
36
+ function Mi(o, e) {
37
+ return o.ok ? e.ok(o.value) : e.err(o.error);
38
38
  }
39
39
  const S = {
40
- capabilityFailure(i, e, t) {
41
- return { kind: "CapabilityFailure", capability: i, reason: e, details: t };
40
+ capabilityFailure(o, e, t) {
41
+ return { kind: "CapabilityFailure", capability: o, reason: e, details: t };
42
42
  },
43
- boundaryViolation(i, e) {
44
- return { kind: "BoundaryViolation", pointer: i, reason: e };
43
+ boundaryViolation(o, e) {
44
+ return { kind: "BoundaryViolation", pointer: o, reason: e };
45
45
  },
46
- runtimeFatal(i, e) {
47
- return { kind: "RuntimeFatal", reason: i, cause: e };
46
+ runtimeFatal(o, e) {
47
+ return { kind: "RuntimeFatal", reason: o, cause: e };
48
48
  },
49
- invalidContract(i, e, t, n) {
50
- return { kind: "InvalidContract", contractId: i, reason: e, pointer: t, details: n };
49
+ invalidContract(o, e, t, n) {
50
+ return { kind: "InvalidContract", contractId: o, reason: e, pointer: t, details: n };
51
51
  },
52
- illegalState(i) {
53
- return { kind: "IllegalState", reason: i };
52
+ illegalState(o) {
53
+ return { kind: "IllegalState", reason: o };
54
54
  },
55
- unsupported(i, e) {
56
- return { kind: "UnsupportedOp", operation: i, reason: e };
55
+ unsupported(o, e) {
56
+ return { kind: "UnsupportedOp", operation: o, reason: e };
57
57
  }
58
58
  };
59
- function At(i) {
60
- return Object.freeze([...i]);
59
+ function Ht(o) {
60
+ return Object.freeze([...o]);
61
61
  }
62
- const Dt = {
63
- of(i, e, t) {
62
+ const zt = {
63
+ of(o, e, t) {
64
64
  return {
65
- document: i,
66
- triggeredEvents: At(e),
65
+ document: o,
66
+ triggeredEvents: Ht(e),
67
67
  totalGas: t,
68
68
  capabilityFailure: !1,
69
69
  failureReason: null
70
70
  };
71
71
  },
72
- capabilityFailure(i, e) {
72
+ capabilityFailure(o, e) {
73
73
  return {
74
- document: i,
74
+ document: o,
75
75
  triggeredEvents: Object.freeze([]),
76
76
  totalGas: 0,
77
77
  capabilityFailure: !0,
78
78
  failureReason: e ?? null
79
79
  };
80
80
  }
81
- }, Ke = Dt, m = {
81
+ }, Ge = zt, m = {
82
82
  "Core/Channel": "DcoJyCh7XXxy1nR5xjy7qfkUgQ1GiZnKKSxh8DJusBSr",
83
83
  "Core/Channel Event Checkpoint": "B7YQeYdQzUNuzaDQ4tNTd2iJqgd4YnVQkgz4QgymDWWU",
84
84
  "Core/Contract": "AERp8BWnuUsjoPciAeNXuUWS9fmqPNMdWbxmKn3tcitx",
@@ -95,71 +95,71 @@ const Dt = {
95
95
  "Core/Processing Initialized Marker": "EVguxFmq5iFtMZaBQgHfjWDojaoesQ1vEXCQFZ59yL28",
96
96
  "Core/Processing Terminated Marker": "5NiEhupJ6uF54Q3vs4GwQX4UX4ExtwHpKRVvjKEHtvjR",
97
97
  "Core/Triggered Event Channel": "C77W4kVGcxL7Mkx9WL9QESPEFFL2GzWAe647s1Efprt"
98
- }, Bt = [
98
+ }, $t = [
99
99
  "embedded",
100
100
  "initialized",
101
101
  "terminated",
102
102
  "checkpoint"
103
- ], xt = [
103
+ ], Vt = [
104
104
  m["Core/Document Update Channel"],
105
105
  m["Core/Triggered Event Channel"],
106
106
  m["Core/Lifecycle Event Channel"],
107
107
  m["Core/Embedded Node Channel"]
108
- ], We = "embedded", Ge = "initialized", qe = "terminated", A = "checkpoint", ye = new Set(
109
- Bt
110
- ), Ce = new Set(xt);
111
- function _t(i) {
112
- return i != null && ye.has(i);
113
- }
114
- function je(i) {
115
- return i != null && Ce.has(
116
- i
108
+ ], je = "embedded", Ye = "initialized", Je = "terminated", O = "checkpoint", ye = new Set(
109
+ $t
110
+ ), ve = new Set(Vt);
111
+ function Wt(o) {
112
+ return o != null && ye.has(o);
113
+ }
114
+ function Xe(o) {
115
+ return o != null && ve.has(
116
+ o
117
117
  );
118
118
  }
119
- const oo = {
120
- KEY_EMBEDDED: We,
121
- KEY_INITIALIZED: Ge,
122
- KEY_TERMINATED: qe,
123
- KEY_CHECKPOINT: A,
119
+ const Ni = {
120
+ KEY_EMBEDDED: je,
121
+ KEY_INITIALIZED: Ye,
122
+ KEY_TERMINATED: Je,
123
+ KEY_CHECKPOINT: O,
124
124
  RESERVED_CONTRACT_KEYS: ye,
125
- PROCESSOR_MANAGED_CHANNEL_BLUE_IDS: Ce,
126
- isReservedContractKey: _t,
127
- isProcessorManagedChannelBlueId: je
128
- }, V = "/contracts", pe = `${V}/${Ge}`, Je = `${V}/${qe}`, Lt = `${V}/${We}`, Qe = `${V}/${A}`, Xe = "/lastEvents", Ze = "/lastSignatures";
129
- function ie(i) {
130
- return `${V}/${i}`;
131
- }
132
- function Ye(i, e) {
133
- return `${ie(i)}${Xe}/${e}`;
134
- }
135
- function et(i, e) {
136
- return `${ie(i)}${Ze}/${e}`;
137
- }
138
- const so = {
139
- RELATIVE_CONTRACTS: V,
140
- RELATIVE_INITIALIZED: pe,
141
- RELATIVE_TERMINATED: Je,
142
- RELATIVE_EMBEDDED: Lt,
143
- RELATIVE_CHECKPOINT: Qe,
144
- LAST_EVENTS_SUFFIX: Xe,
145
- LAST_SIGNATURES_SUFFIX: Ze,
146
- relativeContractsEntry: ie,
147
- relativeCheckpointLastEvent: Ye,
148
- relativeCheckpointLastSignature: et
125
+ PROCESSOR_MANAGED_CHANNEL_BLUE_IDS: ve,
126
+ isReservedContractKey: Wt,
127
+ isProcessorManagedChannelBlueId: Xe
128
+ }, W = "/contracts", fe = `${W}/${Ye}`, Qe = `${W}/${Je}`, Kt = `${W}/${je}`, Ze = `${W}/${O}`, et = "/lastEvents", tt = "/lastSignatures";
129
+ function oe(o) {
130
+ return `${W}/${o}`;
131
+ }
132
+ function nt(o, e) {
133
+ return `${oe(o)}${et}/${e}`;
134
+ }
135
+ function rt(o, e) {
136
+ return `${oe(o)}${tt}/${e}`;
137
+ }
138
+ const Oi = {
139
+ RELATIVE_CONTRACTS: W,
140
+ RELATIVE_INITIALIZED: fe,
141
+ RELATIVE_TERMINATED: Qe,
142
+ RELATIVE_EMBEDDED: Kt,
143
+ RELATIVE_CHECKPOINT: Ze,
144
+ LAST_EVENTS_SUFFIX: et,
145
+ LAST_SIGNATURES_SUFFIX: tt,
146
+ relativeContractsEntry: oe,
147
+ relativeCheckpointLastEvent: nt,
148
+ relativeCheckpointLastSignature: rt
149
149
  };
150
- function tt(i) {
151
- return i == null || i.length === 0;
150
+ function ot(o) {
151
+ return o == null || o.length === 0;
152
152
  }
153
- function k(i) {
154
- return tt(i) ? "/" : i.startsWith("/") ? i : `/${i}`;
153
+ function b(o) {
154
+ return ot(o) ? "/" : o.startsWith("/") ? o : `/${o}`;
155
155
  }
156
- function P(i) {
157
- return tt(i) ? "/" : i.startsWith("/") ? i : `/${i}`;
156
+ function P(o) {
157
+ return ot(o) ? "/" : o.startsWith("/") ? o : `/${o}`;
158
158
  }
159
- function Me(i) {
160
- if (i == null)
159
+ function Ae(o) {
160
+ if (o == null)
161
161
  return "";
162
- let e = i.trim();
162
+ let e = o.trim();
163
163
  if (e.length === 0)
164
164
  return "";
165
165
  for (; e.startsWith("/"); )
@@ -168,16 +168,16 @@ function Me(i) {
168
168
  e = e.substring(0, e.length - 1);
169
169
  return e;
170
170
  }
171
- function ao(i, e) {
172
- const t = Me(i), n = Me(e);
171
+ function Di(o, e) {
172
+ const t = Ae(o), n = Ae(e);
173
173
  return t.length === 0 && n.length === 0 ? "/" : t.length === 0 ? `/${n}` : n.length === 0 ? `/${t}` : `/${t}/${n}`;
174
174
  }
175
- function T(i, e) {
176
- const t = k(i), n = P(e);
175
+ function I(o, e) {
176
+ const t = b(o), n = P(e);
177
177
  return t === "/" ? n : n === "/" || n.length === 1 ? t : `${t}${n}`;
178
178
  }
179
- function Ft(i, e) {
180
- const t = k(i), n = P(e);
179
+ function qt(o, e) {
180
+ const t = b(o), n = P(e);
181
181
  if (t === "/" || !n.startsWith(t))
182
182
  return n;
183
183
  if (n.length === t.length)
@@ -185,66 +185,66 @@ function Ft(i, e) {
185
185
  const r = n.substring(t.length);
186
186
  return r.length === 0 ? "/" : r.startsWith("/") ? r : `/${r}`;
187
187
  }
188
- function $t(i) {
189
- return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
188
+ function Gt(o) {
189
+ return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
190
190
  }
191
- var ce, Re;
192
- function Ut() {
193
- return Re || (Re = 1, ce = function i(e) {
191
+ var ce, Me;
192
+ function jt() {
193
+ return Me || (Me = 1, ce = function o(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))
197
197
  throw new Error("Infinity is not allowed");
198
- return e === null || typeof e != "object" ? JSON.stringify(e) : e.toJSON instanceof Function ? i(e.toJSON()) : Array.isArray(e) ? `[${e.reduce((r, o, s) => `${r}${s === 0 ? "" : ","}${i(o === void 0 || typeof o == "symbol" ? null : o)}`, "")}]` : `{${Object.keys(e).sort().reduce((n, r) => {
198
+ return e === null || typeof e != "object" ? JSON.stringify(e) : e.toJSON instanceof Function ? o(e.toJSON()) : Array.isArray(e) ? `[${e.reduce((r, i, s) => `${r}${s === 0 ? "" : ","}${o(i === void 0 || typeof i == "symbol" ? null : i)}`, "")}]` : `{${Object.keys(e).sort().reduce((n, r) => {
199
199
  if (e[r] === void 0 || typeof e[r] == "symbol")
200
200
  return n;
201
- const o = n.length === 0 ? "" : ",";
202
- return `${n}${o}${i(r)}:${i(e[r])}`;
201
+ const i = n.length === 0 ? "" : ",";
202
+ return `${n}${i}${o(r)}:${o(e[r])}`;
203
203
  }, "")}}`;
204
204
  }), ce;
205
205
  }
206
- var zt = Ut();
207
- const Ht = /* @__PURE__ */ $t(zt);
208
- function Vt(i, e) {
209
- return i.nodeToJson(e, "official");
206
+ var Yt = jt();
207
+ const Jt = /* @__PURE__ */ Gt(Yt);
208
+ function Xt(o, e) {
209
+ return o.nodeToJson(e, "official");
210
210
  }
211
- function Kt(i, e) {
212
- const t = Vt(i, e);
213
- return Ht(t);
211
+ function Qt(o, e) {
212
+ const t = Xt(o, e);
213
+ return Jt(t);
214
214
  }
215
- function nt(i, e) {
216
- return e ? Kt(i, e) : null;
215
+ function it(o, e) {
216
+ return e ? Qt(o, e) : null;
217
217
  }
218
- function Ne(i, e) {
219
- const t = nt(i, e);
218
+ function Ne(o, e) {
219
+ const t = it(o, e);
220
220
  return t == null ? 0 : new TextEncoder().encode(t).length;
221
221
  }
222
- const Wt = 1700, fe = BigInt(
223
- Wt
224
- ), Gt = BigInt(Number.MAX_SAFE_INTEGER), qt = 4e4, jt = 4e4;
225
- function Jt(i) {
222
+ const Zt = 1700, me = BigInt(
223
+ Zt
224
+ ), en = BigInt(Number.MAX_SAFE_INTEGER), tn = 4e4, nn = 4e4;
225
+ function rn(o) {
226
226
  let e;
227
- if (typeof i == "bigint")
228
- e = i;
227
+ if (typeof o == "bigint")
228
+ e = o;
229
229
  else {
230
- if (!Number.isFinite(i) || i <= 0)
230
+ if (!Number.isFinite(o) || o <= 0)
231
231
  return 0;
232
- e = BigInt(Math.trunc(i));
232
+ e = BigInt(Math.trunc(o));
233
233
  }
234
234
  if (e <= 0n)
235
235
  return 0;
236
- const t = (e + fe - 1n) / fe;
237
- return t > Gt ? Number.MAX_SAFE_INTEGER : Number(t);
238
- }
239
- function rt(i) {
240
- const e = BigInt(Math.max(0, Math.trunc(i)));
241
- return e <= 0n ? 0n : e * fe;
242
- }
243
- const it = rt(
244
- qt
245
- ), Qt = rt(
246
- jt
247
- ), O = 1, Xt = /* @__PURE__ */ new Set([
236
+ const t = (e + me - 1n) / me;
237
+ return t > en ? Number.MAX_SAFE_INTEGER : Number(t);
238
+ }
239
+ function st(o) {
240
+ const e = BigInt(Math.max(0, Math.trunc(o)));
241
+ return e <= 0n ? 0n : e * me;
242
+ }
243
+ const at = st(
244
+ tn
245
+ ), on = st(
246
+ nn
247
+ ), N = 1, sn = /* @__PURE__ */ new Set([
248
248
  "event",
249
249
  "eventCanonical",
250
250
  "steps",
@@ -257,9 +257,9 @@ class Se {
257
257
  // Serialize evaluations to avoid races when updating host handler bindings.
258
258
  evaluationQueue = Promise.resolve();
259
259
  handlerState = {
260
- documentGet: () => ({ ok: null, units: O }),
261
- documentGetCanonical: () => ({ ok: null, units: O }),
262
- emit: () => ({ ok: null, units: O })
260
+ documentGet: () => ({ ok: null, units: N }),
261
+ documentGetCanonical: () => ({ ok: null, units: N }),
262
+ emit: () => ({ ok: null, units: N })
263
263
  };
264
264
  handlers = {
265
265
  document: {
@@ -283,49 +283,49 @@ class Se {
283
283
  wasmGasLimit: n,
284
284
  onWasmGasUsed: r
285
285
  }) {
286
- const o = this.prepareBindings(t), s = n ?? it, a = {
286
+ const i = this.prepareBindings(t), s = n ?? at, a = {
287
287
  code: this.wrapCode(e),
288
288
  abiId: "Host.v1",
289
289
  abiVersion: 1,
290
- abiManifestHash: Tt
290
+ abiManifestHash: Bt
291
291
  };
292
292
  try {
293
- const c = await wt({
293
+ const c = await Mt({
294
294
  program: a,
295
- input: o,
295
+ input: i,
296
296
  gasLimit: s,
297
- manifest: It,
297
+ manifest: Dt,
298
298
  handlers: this.handlers
299
299
  });
300
300
  if (n !== void 0 && r && r({
301
301
  used: c.gasUsed,
302
302
  remaining: c.gasRemaining
303
303
  }), !c.ok)
304
- throw en(c);
305
- return Y(c.value);
304
+ throw ln(c);
305
+ return Z(c.value);
306
306
  } catch (c) {
307
- throw tn(c);
307
+ throw un(c);
308
308
  }
309
309
  }
310
310
  prepareBindings(e) {
311
311
  const t = e ?? {};
312
- Zt(t);
313
- const n = W(t.event, null, "event"), r = W(
312
+ an(t);
313
+ const n = K(t.event, null, "event"), r = K(
314
314
  t.eventCanonical ?? n,
315
315
  n,
316
316
  "eventCanonical"
317
- ), o = W(t.steps, [], "steps"), s = W(
317
+ ), i = K(t.steps, [], "steps"), s = K(
318
318
  t.currentContract,
319
319
  null,
320
320
  "currentContract"
321
- ), a = W(
321
+ ), a = K(
322
322
  t.currentContractCanonical,
323
323
  s,
324
324
  "currentContractCanonical"
325
325
  ), c = {
326
326
  event: n,
327
327
  eventCanonical: r,
328
- steps: o,
328
+ steps: i,
329
329
  currentContract: s,
330
330
  currentContractCanonical: a
331
331
  }, u = this.extractDocumentBinding(t), h = typeof u?.canonical == "function" ? u.canonical : void 0;
@@ -333,7 +333,7 @@ class Se {
333
333
  h ?? u
334
334
  );
335
335
  const d = this.extractEmitBinding(t);
336
- return this.handlerState.emit = Yt(d), c;
336
+ return this.handlerState.emit = cn(d), c;
337
337
  }
338
338
  extractDocumentBinding(e) {
339
339
  if (!Object.prototype.hasOwnProperty.call(e, "document"))
@@ -363,184 +363,184 @@ ${e}
363
363
  })()`;
364
364
  }
365
365
  }
366
- function Zt(i) {
367
- for (const e of Object.keys(i))
368
- if (!Xt.has(e))
366
+ function an(o) {
367
+ for (const e of Object.keys(o))
368
+ if (!sn.has(e))
369
369
  throw new TypeError(`Unsupported QuickJS binding: "${e}"`);
370
370
  }
371
- function W(i, e, t) {
372
- const n = i === void 0 ? e : i;
371
+ function K(o, e, t) {
372
+ const n = o === void 0 ? e : o;
373
373
  try {
374
- kt(n, { limits: bt });
374
+ Nt(n, { limits: Ot });
375
375
  } catch (r) {
376
- const o = r instanceof Error ? r.message : String(r);
376
+ const i = r instanceof Error ? r.message : String(r);
377
377
  throw new TypeError(
378
- `QuickJS ${t} binding must be valid DV: ${o}`
378
+ `QuickJS ${t} binding must be valid DV: ${i}`
379
379
  );
380
380
  }
381
381
  return n;
382
382
  }
383
- function Oe(i) {
384
- return i ? (e) => {
383
+ function Oe(o) {
384
+ return o ? (e) => {
385
385
  try {
386
- const t = i(e);
386
+ const t = o(e);
387
387
  return {
388
388
  ok: t === void 0 ? null : t,
389
- units: O
389
+ units: N
390
390
  };
391
391
  } catch {
392
392
  return {
393
393
  err: { code: "INVALID_PATH", tag: "host/invalid_path" },
394
- units: O
394
+ units: N
395
395
  };
396
396
  }
397
- } : () => ({ ok: null, units: O });
397
+ } : () => ({ ok: null, units: N });
398
398
  }
399
- function Yt(i) {
400
- return i ? (e) => {
399
+ function cn(o) {
400
+ return o ? (e) => {
401
401
  try {
402
- if (i(Y(e)) instanceof Promise)
402
+ if (o(Z(e)) instanceof Promise)
403
403
  throw new Error("Async emit handlers are not supported");
404
- return { ok: null, units: O };
404
+ return { ok: null, units: N };
405
405
  } catch {
406
406
  return {
407
407
  err: { code: "LIMIT_EXCEEDED", tag: "host/limit" },
408
- units: O
408
+ units: N
409
409
  };
410
410
  }
411
- } : () => ({ ok: null, units: O });
411
+ } : () => ({ ok: null, units: N });
412
412
  }
413
- function Y(i) {
414
- if (i == null)
415
- return i;
416
- if (Array.isArray(i))
417
- return i.map((e) => Y(e));
418
- if (typeof i == "object") {
419
- const e = Object.getPrototypeOf(i);
413
+ function Z(o) {
414
+ if (o == null)
415
+ return o;
416
+ if (Array.isArray(o))
417
+ return o.map((e) => Z(e));
418
+ if (typeof o == "object") {
419
+ const e = Object.getPrototypeOf(o);
420
420
  if (e !== Object.prototype && e !== null)
421
- return i;
421
+ return o;
422
422
  const t = {};
423
- for (const [n, r] of Object.entries(i))
424
- t[n] = Y(r);
423
+ for (const [n, r] of Object.entries(o))
424
+ t[n] = Z(r);
425
425
  return t;
426
426
  }
427
- return i;
427
+ return o;
428
428
  }
429
- function en(i) {
430
- if (i.ok)
429
+ function ln(o) {
430
+ if (o.ok)
431
431
  return new Error("Unexpected evaluation result");
432
- if (i.type === "invalid-output") {
433
- const r = new Error(i.message);
432
+ if (o.type === "invalid-output") {
433
+ const r = new Error(o.message);
434
434
  return r.name = "InvalidOutputError", r;
435
435
  }
436
- const e = i.error;
436
+ const e = o.error;
437
437
  if (e.kind === "out-of-gas") {
438
438
  const r = new Error(
439
439
  `OutOfGas: ${e.message || "out of gas"}`
440
440
  );
441
441
  return r.name = "OutOfGasError", r;
442
442
  }
443
- const t = e.message || i.message, n = new Error(t);
443
+ const t = e.message || o.message, n = new Error(t);
444
444
  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);
445
445
  }
446
- function tn(i) {
447
- return i instanceof Error ? i : new Error(String(i ?? "Unknown error"));
446
+ function un(o) {
447
+ return o instanceof Error ? o : new Error(String(o ?? "Unknown error"));
448
448
  }
449
- const Ae = 120;
450
- function nn(i) {
451
- return i.length <= Ae ? i : `${i.slice(0, Ae - 3)}...`;
449
+ const De = 120;
450
+ function hn(o) {
451
+ return o.length <= De ? o : `${o.slice(0, De - 3)}...`;
452
452
  }
453
- class ot extends Error {
453
+ class ct extends Error {
454
454
  constructor(e, t) {
455
- super(`Failed to evaluate code block: ${nn(e)}`, { cause: t }), this.code = e, this.cause = t, this.name = "CodeBlockEvaluationError";
455
+ super(`Failed to evaluate code block: ${hn(e)}`, { cause: t }), this.code = e, this.cause = t, this.name = "CodeBlockEvaluationError";
456
456
  }
457
457
  }
458
- const st = /^\$\{([\s\S]*)\}$/, rn = /\$\{([\s\S]+?)\}/, on = /\$\{([\s\S]+?)\}/g;
459
- function ee(i) {
460
- if (typeof i != "string" || !st.test(i))
458
+ const lt = /^\$\{([\s\S]*)\}$/, dn = /\$\{([\s\S]+?)\}/, pn = /\$\{([\s\S]+?)\}/g;
459
+ function ee(o) {
460
+ if (typeof o != "string" || !lt.test(o))
461
461
  return !1;
462
- const e = i.indexOf("${"), t = i.lastIndexOf("${");
462
+ const e = o.indexOf("${"), t = o.lastIndexOf("${");
463
463
  return e === t;
464
464
  }
465
- function sn(i) {
466
- return typeof i != "string" ? !1 : st.test(i) ? !0 : rn.test(i);
465
+ function fn(o) {
466
+ return typeof o != "string" ? !1 : lt.test(o) ? !0 : dn.test(o);
467
467
  }
468
- function an(i) {
469
- if (!ee(i))
470
- throw new Error(`Invalid expression: ${i}`);
471
- return i.slice(2, -1);
468
+ function mn(o) {
469
+ if (!ee(o))
470
+ throw new Error(`Invalid expression: ${o}`);
471
+ return o.slice(2, -1);
472
472
  }
473
- async function at(i, e, t, n, r) {
474
- const o = `return (${e});`;
473
+ async function ut(o, e, t, n, r) {
474
+ const i = `return (${e});`;
475
475
  try {
476
- return await i.evaluate({
477
- code: o,
476
+ return await o.evaluate({
477
+ code: i,
478
478
  bindings: t,
479
479
  wasmGasLimit: n,
480
480
  onWasmGasUsed: r
481
481
  });
482
482
  } catch (s) {
483
- throw new ot(e, s);
483
+ throw new ct(e, s);
484
484
  }
485
485
  }
486
- async function cn(i, e, t, n, r) {
487
- let o = "", s = 0;
488
- for (const a of e.matchAll(on)) {
486
+ async function gn(o, e, t, n, r) {
487
+ let i = "", s = 0;
488
+ for (const a of e.matchAll(pn)) {
489
489
  const c = a[0], u = a[1], h = a.index ?? 0;
490
- o += e.slice(s, h);
491
- const d = await at(
492
- i,
490
+ i += e.slice(s, h);
491
+ const d = await ut(
492
+ o,
493
493
  u,
494
494
  t,
495
495
  n,
496
496
  r
497
497
  );
498
- o += d == null ? "" : String(d), s = h + c.length;
498
+ i += d == null ? "" : String(d), s = h + c.length;
499
499
  }
500
- return o += e.slice(s), o;
500
+ return i += e.slice(s), i;
501
501
  }
502
- function ct({
503
- include: i,
502
+ function ht({
503
+ include: o,
504
504
  exclude: e = [],
505
505
  options: t
506
506
  }) {
507
- const n = { dot: !0, ...t ?? {} }, r = i.map(
508
- (s) => Pe(s, n)
509
- ), o = e.map(
510
- (s) => Pe(s, n)
507
+ const n = { dot: !0, ...t ?? {} }, r = o.map(
508
+ (s) => Re(s, n)
509
+ ), i = e.map(
510
+ (s) => Re(s, n)
511
511
  );
512
- return (s) => r.some((a) => a(s)) && !o.some((a) => a(s));
512
+ return (s) => r.some((a) => a(s)) && !i.some((a) => a(s));
513
513
  }
514
- async function te(i) {
514
+ async function te(o) {
515
515
  const {
516
516
  evaluator: e,
517
517
  node: t,
518
518
  bindings: n,
519
519
  shouldResolve: r,
520
- shouldDescend: o = () => !0,
520
+ shouldDescend: i = () => !0,
521
521
  context: s,
522
522
  pointer: a = "/"
523
- } = i, c = Qt, u = ({
523
+ } = o, c = on, u = ({
524
524
  used: E
525
525
  }) => {
526
526
  s.gasMeter().chargeWasmGas(E);
527
527
  }, h = t.clone();
528
- if (!o(a, h))
528
+ if (!i(a, h))
529
529
  return h;
530
530
  const d = h.getValue();
531
531
  if (d !== void 0) {
532
532
  if (typeof d == "string" && r(a)) {
533
533
  if (ee(d)) {
534
- const E = an(d), C = await at(
534
+ const E = mn(d), v = await ut(
535
535
  e,
536
536
  E,
537
537
  n,
538
538
  c,
539
539
  u
540
540
  );
541
- return s.blue.jsonValueToNode(C ?? null);
542
- } else if (sn(d)) {
543
- const E = await cn(
541
+ return s.blue.jsonValueToNode(v ?? null);
542
+ } else if (fn(d)) {
543
+ const E = await gn(
544
544
  e,
545
545
  d,
546
546
  n,
@@ -552,14 +552,14 @@ async function te(i) {
552
552
  }
553
553
  return h;
554
554
  }
555
- const v = h.getItems?.();
556
- if (Array.isArray(v)) {
555
+ const w = h.getItems?.();
556
+ if (Array.isArray(w)) {
557
557
  const E = await Promise.all(
558
- v.map(
559
- (C, M) => te({
560
- ...i,
561
- node: C,
562
- pointer: `${a}/${M}`
558
+ w.map(
559
+ (v, A) => te({
560
+ ...o,
561
+ node: v,
562
+ pointer: `${a}/${A}`
563
563
  })
564
564
  )
565
565
  );
@@ -568,11 +568,11 @@ async function te(i) {
568
568
  const f = h.getProperties?.();
569
569
  if (f) {
570
570
  const E = {};
571
- for (const [C, M] of Object.entries(f)) {
572
- const D = a === "/" ? `/${C}` : `${a}/${C}`;
573
- E[C] = await te({
574
- ...i,
575
- node: M,
571
+ for (const [v, A] of Object.entries(f)) {
572
+ const D = a === "/" ? `/${v}` : `${a}/${v}`;
573
+ E[v] = await te({
574
+ ...o,
575
+ node: A,
576
576
  pointer: D
577
577
  });
578
578
  }
@@ -580,84 +580,125 @@ async function te(i) {
580
580
  }
581
581
  return h;
582
582
  }
583
- const oe = g(m["Core/Contract"])(l.object({
583
+ const ie = g(m["Core/Contract"])(l.object({
584
584
  description: l.string().optional(),
585
585
  name: l.string().optional(),
586
586
  order: l.number().optional()
587
- })), ve = oe, _ = g(m["Core/Channel"])(oe.extend({
587
+ })), we = ie, _ = g(m["Core/Channel"])(ie.extend({
588
588
  description: l.string().optional(),
589
- event: b().optional(),
589
+ event: k().optional(),
590
590
  name: l.string().optional()
591
- })), L = _.merge(
592
- ve
591
+ })), F = _.merge(
592
+ we
593
593
  ).extend({
594
594
  path: l.string().optional(),
595
- definition: b().optional()
596
- }), lt = g(m["Core/Handler"])(oe.extend({
595
+ definition: k().optional()
596
+ }), dt = g(m["Core/Handler"])(ie.extend({
597
597
  channel: l.string().optional(),
598
598
  description: l.string().optional(),
599
- event: b().optional(),
599
+ event: k().optional(),
600
600
  name: l.string().optional()
601
- })), ut = lt.merge(ve), K = g(m["Core/Marker"])(oe.extend({
601
+ })), pt = dt.merge(we), U = g(m["Core/Marker"])(ie.extend({
602
602
  description: l.string().optional(),
603
603
  name: l.string().optional()
604
- })), R = K.merge(ve), ln = l.object({
604
+ })), R = U.merge(we), En = l.object({
605
605
  op: l.enum(["ADD", "REPLACE", "REMOVE"]),
606
606
  path: l.string(),
607
- val: b().optional()
608
- }), co = g("JsonPatch")(
609
- ln
610
- ).superRefine((i, e) => {
611
- i.op === "REMOVE" && i.val !== void 0 && e.addIssue({
607
+ val: k().optional()
608
+ }), Bi = g("JsonPatch")(
609
+ En
610
+ ).superRefine((o, e) => {
611
+ o.op === "REMOVE" && o.val !== void 0 && e.addIssue({
612
612
  code: l.ZodIssueCode.custom,
613
613
  message: "REMOVE operations cannot include a value",
614
614
  path: ["val"]
615
- }), i.op !== "REMOVE" && i.val === void 0 && e.addIssue({
615
+ }), o.op !== "REMOVE" && o.val === void 0 && e.addIssue({
616
616
  code: l.ZodIssueCode.custom,
617
- message: `${i.op} operations must include a value`,
617
+ message: `${o.op} operations must include a value`,
618
618
  path: ["val"]
619
619
  });
620
- }), un = g(m["Core/Document Update Channel"])(_.extend({
620
+ }), Cn = g(m["Core/Document Update Channel"])(_.extend({
621
621
  description: l.string().optional(),
622
622
  name: l.string().optional(),
623
623
  path: l.string().optional()
624
- })), hn = un.merge(
625
- L
626
- ), dn = g(m["Core/Embedded Node Channel"])(_.extend({
624
+ })), yn = Cn.merge(
625
+ F
626
+ ), vn = g(m["Core/Embedded Node Channel"])(_.extend({
627
627
  childPath: l.string().optional(),
628
628
  description: l.string().optional(),
629
629
  name: l.string().optional()
630
- })), pn = dn.merge(
631
- L
632
- ), fn = g(m["Core/Lifecycle Event Channel"])(_.extend({
630
+ })), Sn = vn.merge(
631
+ F
632
+ ), wn = g(m["Core/Lifecycle Event Channel"])(_.extend({
633
633
  description: l.string().optional(),
634
634
  name: l.string().optional()
635
- })), mn = fn.merge(
636
- L
637
- ), gn = g(m["Core/Triggered Event Channel"])(_.extend({
635
+ })), bn = wn.merge(
636
+ F
637
+ ), kn = g(m["Core/Triggered Event Channel"])(_.extend({
638
638
  description: l.string().optional(),
639
639
  name: l.string().optional()
640
- })), En = gn.merge(L), w = {
640
+ })), Tn = kn.merge(F), C = {
641
+ "Conversation/Accept Change Operation": "APk3siB8g9pvWLG3qyqtGjRNNGB7RDpFWQtG4epj5Avv",
642
+ "Conversation/Accept Change Workflow": "Eh2y8JypsGTdFMpEGEK64vBdGtaJ9Q7Q5t7ChqHafwCV",
641
643
  "Conversation/Actor": "CN5efWVizJbRsMCw8YWRfT2q9vM9XfeGDN9wFvYcvMnQ",
644
+ "Conversation/Actor Policy": "EeWqP1Tw9WXo5nq8kx93FuTw9HRqpv34mbWFjH72nR7o",
645
+ "Conversation/Agent Actor": "FM1K89eMHRDN6vHtHfGwFNojmgvSnACuYdtc3qQ6qPYB",
646
+ "Conversation/API Call": "HCTXeqkKBbVbsa3WfN2bPFSX7mthbtZ6ZhzByf9VDJJs",
647
+ "Conversation/Browser Session": "8UVUYbhSVBAx7BAupgjSeeFuuyrgdFcGbaXBitEZD9B1",
648
+ "Conversation/Change Operation": "Hd5uuFjqxyw5mrFPgJf2mcatij8ddtmGAMJu9ij5K1tc",
649
+ "Conversation/Change Request": "FW7iYkzig4fepCdwfCdgNJw4DQ1fKwnAUf3YpjgfTPmG",
650
+ "Conversation/Change Workflow": "4pFvBSYyitoq8rWqTmY5rLywU2tpZsivDUCAo5vwoAT9",
651
+ "Conversation/Chat Message": "AkUKoKY1hHY1CytCrAXDPKCd4md1QGmn1WNcQtWBsyAD",
642
652
  "Conversation/Composite Timeline Channel": "HsNatiPt2YvmkWQoqtfrFCbdp75ZUBLBUkWeq84WTfnr",
653
+ "Conversation/Contracts Change Policy": "6FDVZRQwuhXdXtnXq8kRg3f3DM8SUdbN3TT8rSGJcS2U",
654
+ "Conversation/Customer Action Requested": "6ZLHE59mb1ytEjW78jmYCU3DXxj4Fzfjea7tz3VEkwyX",
655
+ "Conversation/Customer Action Responded": "GFyes2Px1cY5Yfk2oiA1qpzhz2purMED3g1L74Bu1Ho6",
656
+ "Conversation/Customer Consent": "5UeiZ6EC1y3KMafuX6ioNqHHM62S5Xf3ULrC9L3m7MJx",
657
+ "Conversation/Customer Consent Revoked": "9h1AhEexkxxKLYv1NHbEESYCPtvW7Nt51msGtuQC5jWK",
658
+ "Conversation/Document Bootstrap Completed": "HH5u8PwvdXrARNkT4oyWR4QjgkwhKfPWGnNtEwfUBiUg",
659
+ "Conversation/Document Bootstrap Failed": "B8b1ayXMrAYbwkqaJfAS6Aspp2kZyJda8ay9QeFkZ9MH",
660
+ "Conversation/Document Bootstrap Requested": "4derXUpwPZDDkBpYPCTMr6t3mbeGU7AUYmvfW22cZior",
661
+ "Conversation/Document Bootstrap Responded": "1Ucfmhtb9xjvyLxLKSVkqXZjVVuAdXyzdjb11QG11Uv",
662
+ "Conversation/Document Request": "7jZFAkmthHTeg6zAu5kBCDHswd2J5HNVnYPo9y435sin",
663
+ "Conversation/Document Section": "JBfupL6eyZsqj7CYbReFaS5ga784SLT8aP8r9W64vbLm",
664
+ "Conversation/Document Section Change Entry": "9xv7YjqsSn7W7P8rnUhSpdWGfSrgL4Jt3cmiACJT5VQs",
665
+ "Conversation/Document Section Changes": "DEmFwGa1sWm2BKhrN98LREKiB8j8B8kFAo7KBkkaojnN",
666
+ "Conversation/Document Status": "58B8orsFkxxy7bWqjLXJmtBs2b5rwnNQNbeoAbGhPkJc",
667
+ "Conversation/Event": "5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we",
668
+ "Conversation/Inform User About Pending Action": "8Akr9sdTkxBqMYWSGh8gHgoXQQeYEPfhV4s8fXeKTd9W",
643
669
  "Conversation/JavaScript Code": "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS",
670
+ "Conversation/Lifecycle Event": "5YZEAtUaHhNfnVnwtSsyBnBakpcSwdL75UcgtrtnqeYn",
644
671
  "Conversation/Operation": "BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC",
645
672
  "Conversation/Operation Request": "HM4Ku4LFcjC5MxnhPMRwQ8w3BbHmJKKZfHTTzsd4jbJq",
673
+ "Conversation/Principal Actor": "FqipbF4UATjCRTqovGdREPAoaxj59NECb9xtnWRW1SWi",
674
+ "Conversation/Propose Change Operation": "BeiedmmcKDhStxDnnQqUaXDJLofWSnqX6CazKTvVpfbW",
675
+ "Conversation/Propose Change Workflow": "7icTT1chbH3UA2ybXgpfSSyNEAR4Wmm3EkbdGFaZSydo",
676
+ "Conversation/Proposed Change Invalid": "EbGQYtYR9UNAxcn7auCCujXmnz6DWxMpqVcgYSsKE85M",
677
+ "Conversation/Reject Change Operation": "4T5AmhKAXSJAAHDEjtVJ2FQgCyz2qyd9qG5uoh627Ux6",
678
+ "Conversation/Reject Change Workflow": "DUjCaEniHH5oDXU3Ss5jWWft3pT9TUcNhv7HoCDU1NTB",
679
+ "Conversation/Request": "8f9UhHMbRe62sFgzQVheToaJPYi7t7HPNVvpQTbqfL5n",
680
+ "Conversation/Response": "36epvrpVHZLjapbeZsNodz2NDnm7XZeNZcnkWHgkP1pp",
646
681
  "Conversation/Sequential Workflow": "7X3LkN54Yp88JgZbppPhP6hM3Jqiqv8Z2i4kS7phXtQe",
647
682
  "Conversation/Sequential Workflow Operation": "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv",
648
683
  "Conversation/Sequential Workflow Step": "HYsLiqsqk7t98d5fK6YxKEQGeqBaHNVjM4rRNdxK4yUW",
684
+ "Conversation/Source": "6ADCPYXkusrp4dL1FC126L2ccuzYfqGdBf1w6EXh2hnC",
685
+ "Conversation/Status Change": "C48nKSkbxraMSv4gCiGYVHKFjmtK12k63Yasn95zknWE",
686
+ "Conversation/Status Completed": "EhPFqrRCreg7StsZEcW8fRQ1FQVdqYSsMSis2CHHJZ1G",
687
+ "Conversation/Status Failed": "Guus3kHbivXvy5G93yhiKs3Pc8sxCc4XVvSo7CqLsQEc",
688
+ "Conversation/Status In Progress": "56Lhu3Z2oF3kuYG41eZAK8TvgVtRNevkbRi4D31kKWZm",
689
+ "Conversation/Status Pending": "ETAPjwZVyYEfPUWvXkCWAuybBhYUayg4hKC2V7mLXmsv",
649
690
  "Conversation/Timeline": "3Ge54FsGJaaeZmm8nTKJdS6HVdYhiR3g18fDwg3Ev1Sa",
650
691
  "Conversation/Timeline Channel": "EvuCWsG1E6WJQg8QXmk6rwMANYTZjoLWVZ1vYQWUwdTH",
651
- "Conversation/Timeline Entry": "EzDiC9Frs8V5yQBMtDYh1DobVnWtWpFemXDX5fGUULBn",
692
+ "Conversation/Timeline Entry": "29tcU8MkrV3KL5HqH6DHJDPPfJMheoqwiKJsaHnrp9hT",
652
693
  "Conversation/Trigger Event": "2bSWEoMSZwzf32Hnr4BDVsuq8NRjrWEpnhZvMZAJGhh2",
653
694
  "Conversation/Update Document": "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa"
654
- }, ht = g(w["Conversation/Timeline Channel"])(_.extend({
695
+ }, ft = g(C["Conversation/Timeline Channel"])(_.extend({
655
696
  description: l.string().optional(),
656
697
  name: l.string().optional(),
657
698
  timelineId: l.string().optional()
658
- })), yn = ht.merge(
659
- L
660
- ), I = {
699
+ })), In = ft.merge(
700
+ F
701
+ ), T = {
661
702
  "MyOS/Document Anchor": "HS9yo34TGEAM2LGcNbLh7XPN4goPRhqdGZQkiyh473Wb",
662
703
  "MyOS/Document Anchors": "7Usvk6dZMVqas3yqs23ZEXn1zu1YDPjgYiZFNYaw3puH",
663
704
  "MyOS/Document Links": "4cmrbevB6K23ZenjqwmNxpnaw6RF4VB3wkP7XB59V7W5",
@@ -666,106 +707,171 @@ const oe = g(m["Core/Contract"])(l.object({
666
707
  "MyOS/MyOS Session Interaction": "CeWyRmXAMZqvWBvby2KbRUZWcS7Pdxs42vnMXgn9gg6H",
667
708
  "MyOS/MyOS Timeline": "2gyToM86KgFJpB8inz8TBVEMZk8UVGYdRozF4mfvxtuk",
668
709
  "MyOS/MyOS Timeline Channel": "HCF8mXnX3dFjQ8osjxb4Wzm2Nm1DoXnTYuA5sPnV7NTs",
669
- "MyOS/MyOS Timeline Entry": "Furgmg5xcJVMDmaQXZRfZ1XehSf7PWctrioo8etRYJHQ",
710
+ "MyOS/MyOS Timeline Entry": "F3mQaGQ1B48yMedKZojFTxeKxtee4xU66QBbiyEMvGeZ",
670
711
  "MyOS/MyOS Worker Agency": "4Lix4AKXvBDvrwxw2htSdYFKxL4wugEQzqoSEYet5Dh1"
671
- }, Cn = g(I["MyOS/MyOS Timeline Channel"])(ht.extend({
712
+ }, Pn = g(T["MyOS/MyOS Timeline Channel"])(ft.extend({
672
713
  accountId: l.string().optional(),
673
714
  description: l.string().optional(),
674
715
  email: l.string().optional(),
675
716
  name: l.string().optional()
676
- })), Sn = Cn.merge(L), vn = g(w["Conversation/Composite Timeline Channel"])(_.extend({
717
+ })), Rn = Pn.merge(F), An = g(C["Conversation/Composite Timeline Channel"])(_.extend({
677
718
  channels: l.array(l.string()).optional(),
678
719
  description: l.string().optional(),
679
720
  name: l.string().optional()
680
- })), dt = vn.merge(L), wn = g(m["Core/Channel Event Checkpoint"])(K.extend({
721
+ })), mt = An.merge(F), Mn = g(C["Conversation/Actor Policy"])(U.extend({
722
+ description: l.string().optional(),
723
+ name: l.string().optional(),
724
+ operations: l.record(l.string(), l.object({
725
+ excludeSource: l.string().optional(),
726
+ requiresActor: l.string().optional(),
727
+ requiresSource: l.string().optional()
728
+ })).optional()
729
+ })), gt = ["principal", "agent", "any"], Et = [
730
+ "browserSession",
731
+ "apiCall",
732
+ "documentRequest"
733
+ ], Nn = l.enum(gt), Be = l.enum(Et), On = l.object({
734
+ excludeSource: Be.optional(),
735
+ requiresActor: Nn.optional(),
736
+ requiresSource: Be.optional()
737
+ }), Ct = Mn.merge(
738
+ R
739
+ ).extend({
740
+ operations: l.record(l.string(), On).optional()
741
+ }), Dn = new Set(gt), Le = new Set(Et);
742
+ class yt extends Error {
743
+ constructor(e) {
744
+ super(e), this.name = "ActorPolicyLiteralValidationError";
745
+ }
746
+ }
747
+ function Bn(o) {
748
+ const e = o.getProperties()?.operations;
749
+ if (!(e instanceof p))
750
+ return;
751
+ const t = e.getProperties();
752
+ if (t)
753
+ for (const [n, r] of Object.entries(t)) {
754
+ if (!(r instanceof p))
755
+ continue;
756
+ const i = r.getProperties();
757
+ i && (le(
758
+ n,
759
+ "requiresActor",
760
+ i.requiresActor,
761
+ Dn
762
+ ), le(
763
+ n,
764
+ "requiresSource",
765
+ i.requiresSource,
766
+ Le
767
+ ), le(
768
+ n,
769
+ "excludeSource",
770
+ i.excludeSource,
771
+ Le
772
+ ));
773
+ }
774
+ }
775
+ function le(o, e, t, n) {
776
+ if (!(t instanceof p))
777
+ return;
778
+ const r = t.getValue();
779
+ if (r != null && (typeof r != "string" || !n.has(r)))
780
+ throw new yt(
781
+ `Actor Policy operation '${o}' declares unsupported ${e} '${String(
782
+ r
783
+ )}'`
784
+ );
785
+ }
786
+ const Ln = g(m["Core/Channel Event Checkpoint"])(U.extend({
681
787
  description: l.string().optional(),
682
- lastEvents: l.record(l.string(), b()).optional(),
788
+ lastEvents: l.record(l.string(), k()).optional(),
683
789
  name: l.string().optional()
684
- })), kn = wn.merge(R).extend({
790
+ })), xn = Ln.merge(R).extend({
685
791
  lastSignatures: l.record(l.string()).optional()
686
- }), bn = g(m["Core/Processing Initialized Marker"])(K.extend({
792
+ }), _n = g(m["Core/Processing Initialized Marker"])(U.extend({
687
793
  description: l.string().optional(),
688
794
  documentId: l.string().optional(),
689
795
  name: l.string().optional()
690
- })), In = bn.merge(R), Tn = g(m["Core/Process Embedded"])(K.extend({
796
+ })), Fn = _n.merge(R), Un = g(m["Core/Process Embedded"])(U.extend({
691
797
  description: l.string().optional(),
692
798
  name: l.string().optional(),
693
799
  paths: l.array(l.string()).optional()
694
- })), Pn = Tn.merge(
800
+ })), Hn = Un.merge(
695
801
  R
696
- ), Mn = g(m["Core/Processing Terminated Marker"])(K.extend({
802
+ ), zn = g(m["Core/Processing Terminated Marker"])(U.extend({
697
803
  cause: l.string().optional(),
698
804
  description: l.string().optional(),
699
805
  name: l.string().optional(),
700
806
  reason: l.string().optional()
701
- })), Rn = Mn.merge(R), J = g(w["Conversation/Operation"])(K.extend({
807
+ })), $n = zn.merge(R), Y = g(C["Conversation/Operation"])(U.extend({
702
808
  channel: l.string().optional(),
703
809
  description: l.string().optional(),
704
810
  name: l.string().optional(),
705
- request: b().optional()
706
- })), Nn = J.merge(
811
+ request: k().optional()
812
+ })), Vn = Y.merge(
707
813
  R
708
- ), On = g(I["MyOS/Document Anchor"])(l.object({
814
+ ), Wn = g(T["MyOS/Document Anchor"])(l.object({
709
815
  description: l.string().optional(),
710
816
  name: l.string().optional(),
711
- template: b().optional()
712
- })), An = g(I["MyOS/Document Anchors"])(l.object({}).catchall(On)), Dn = An.merge(R), Bn = g(I["MyOS/Link"])(l.object({
817
+ template: k().optional()
818
+ })), Kn = g(T["MyOS/Document Anchors"])(l.object({}).catchall(Wn)), qn = Kn.merge(R), Gn = g(T["MyOS/Link"])(l.object({
713
819
  anchor: l.string().optional(),
714
820
  description: l.string().optional(),
715
821
  name: l.string().optional()
716
- })), xn = g(I["MyOS/Document Links"])(l.object({}).catchall(Bn)), _n = xn.merge(
822
+ })), jn = g(T["MyOS/Document Links"])(l.object({}).catchall(Gn)), Yn = jn.merge(
717
823
  R
718
- ), Ln = g(I["MyOS/MyOS Participants Orchestration"])(l.object({
824
+ ), Jn = g(T["MyOS/MyOS Participants Orchestration"])(l.object({
719
825
  name: l.string().optional()
720
- })), Fn = Ln.merge(R), $n = g(I["MyOS/MyOS Session Interaction"])(l.object({
826
+ })), Xn = Jn.merge(R), Qn = g(T["MyOS/MyOS Session Interaction"])(l.object({
721
827
  name: l.string().optional()
722
- })), Un = $n.merge(R), zn = g(I["MyOS/MyOS Worker Agency"])(l.object({
828
+ })), Zn = Qn.merge(R), er = g(T["MyOS/MyOS Worker Agency"])(l.object({
723
829
  name: l.string().optional()
724
- })), Hn = zn.merge(
830
+ })), tr = er.merge(
725
831
  R
726
- ), se = g(w["Conversation/Sequential Workflow Step"])(l.object({
832
+ ), se = g(C["Conversation/Sequential Workflow Step"])(l.object({
727
833
  description: l.string().optional(),
728
834
  name: l.string().optional()
729
- })), pt = g(w["Conversation/Sequential Workflow"])(lt.extend({
835
+ })), vt = g(C["Conversation/Sequential Workflow"])(dt.extend({
730
836
  description: l.string().optional(),
731
837
  name: l.string().optional(),
732
838
  steps: l.array(se).optional()
733
- })), lo = b(), Vn = pt.merge(ut).extend({
734
- steps: l.array(b()).optional()
735
- }), Kn = g(w["Conversation/Sequential Workflow Operation"])(pt.extend({
839
+ })), Li = k(), nr = vt.merge(pt).extend({
840
+ steps: l.array(k()).optional()
841
+ }), rr = g(C["Conversation/Sequential Workflow Operation"])(vt.extend({
736
842
  description: l.string().optional(),
737
843
  name: l.string().optional(),
738
844
  operation: l.string().optional()
739
- })), Wn = Kn.merge(
740
- ut
845
+ })), or = rr.merge(
846
+ pt
741
847
  ).extend({
742
- steps: l.array(b()).optional()
848
+ steps: l.array(k()).optional()
743
849
  });
744
- function Gn(i) {
745
- if (!Array.isArray(i.blueIds) || i.blueIds.length === 0)
850
+ function ir(o) {
851
+ if (!Array.isArray(o.blueIds) || o.blueIds.length === 0)
746
852
  throw new Error("Contract processors must declare at least one BlueId");
747
- for (const e of i.blueIds)
853
+ for (const e of o.blueIds)
748
854
  if (typeof e != "string" || e.trim().length === 0)
749
855
  throw new Error("Contract processor BlueIds must be non-empty strings");
750
856
  }
751
- function Q(i, e) {
752
- Gn(i);
753
- for (const t of i.blueIds)
754
- e.set(t, i);
857
+ function J(o, e) {
858
+ ir(o);
859
+ for (const t of o.blueIds)
860
+ e.set(t, o);
755
861
  }
756
- class qn {
862
+ class sr {
757
863
  processorsByBlueId = /* @__PURE__ */ new Map();
758
864
  handlerProcessors = /* @__PURE__ */ new Map();
759
865
  channelProcessors = /* @__PURE__ */ new Map();
760
866
  markerProcessors = /* @__PURE__ */ new Map();
761
867
  registerHandler(e) {
762
- Q(e, this.handlerProcessors), this.registerProcessorMap(e);
868
+ J(e, this.handlerProcessors), this.registerProcessorMap(e);
763
869
  }
764
870
  registerChannel(e) {
765
- Q(e, this.channelProcessors), this.registerProcessorMap(e);
871
+ J(e, this.channelProcessors), this.registerProcessorMap(e);
766
872
  }
767
873
  registerMarker(e) {
768
- Q(e, this.markerProcessors), this.registerProcessorMap(e);
874
+ J(e, this.markerProcessors), this.registerProcessorMap(e);
769
875
  }
770
876
  register(e) {
771
877
  switch (e.kind) {
@@ -808,15 +914,15 @@ class qn {
808
914
  return new Map(this.processorsByBlueId);
809
915
  }
810
916
  registerProcessorMap(e) {
811
- Q(e, this.processorsByBlueId);
917
+ J(e, this.processorsByBlueId);
812
918
  }
813
919
  lookupProcessorForNode(e, t, n) {
814
920
  const r = t.getType();
815
921
  if (!r)
816
922
  return;
817
- const o = r.getBlueId();
818
- if (o) {
819
- const c = n.get(o);
923
+ const i = r.getBlueId();
924
+ if (i) {
925
+ const c = n.get(i);
820
926
  if (c)
821
927
  return c;
822
928
  }
@@ -853,19 +959,26 @@ class qn {
853
959
  return { blueId: s.blueId, value: s.value };
854
960
  }
855
961
  }
856
- const jn = "compositeSourceChannelKey";
857
- function Jn(i, e) {
858
- return `${i}::${e}`;
962
+ class ar {
963
+ kind = "marker";
964
+ blueIds = [
965
+ C["Conversation/Actor Policy"]
966
+ ];
967
+ schema = Ct;
968
+ }
969
+ const cr = "compositeSourceChannelKey";
970
+ function lr(o, e) {
971
+ return `${o}::${e}`;
859
972
  }
860
- function Qn(i) {
861
- return i != null && Object.prototype.hasOwnProperty.call(i, "lastEvents") && Object.prototype.hasOwnProperty.call(i, "lastSignatures");
973
+ function ur(o) {
974
+ return o != null && Object.prototype.hasOwnProperty.call(o, "lastEvents") && Object.prototype.hasOwnProperty.call(o, "lastSignatures");
862
975
  }
863
- class Xn {
976
+ class hr {
864
977
  kind = "channel";
865
978
  blueIds = [
866
- w["Conversation/Composite Timeline Channel"]
979
+ C["Conversation/Composite Timeline Channel"]
867
980
  ];
868
- schema = dt;
981
+ schema = mt;
869
982
  /**
870
983
  * Fallback match hook that delegates to {@link evaluate} for consistent behavior.
871
984
  */
@@ -883,14 +996,14 @@ class Xn {
883
996
  const r = e.channels?.filter((u) => u.trim().length > 0) ?? [];
884
997
  if (r.length === 0)
885
998
  return { matches: !1 };
886
- const o = t.resolveChannel, s = t.channelProcessorFor;
887
- if (!o || !s)
999
+ const i = t.resolveChannel, s = t.channelProcessorFor;
1000
+ if (!i || !s)
888
1001
  throw new Error(
889
1002
  "Composite timeline channel evaluation requires channel resolution helpers"
890
1003
  );
891
1004
  const a = t.blue.calculateBlueIdSync(n), c = [];
892
1005
  for (const u of r) {
893
- const h = o(u);
1006
+ const h = i(u);
894
1007
  if (!h)
895
1008
  throw new Error(
896
1009
  `Composite timeline channel '${t.bindingKey}' references missing channel '${u}'`
@@ -900,19 +1013,19 @@ class Xn {
900
1013
  throw new Error(
901
1014
  `No processor registered for child channel '${u}' (${h.blueId})`
902
1015
  );
903
- const v = n.clone(), f = {
1016
+ const w = n.clone(), f = {
904
1017
  ...t,
905
- event: v,
1018
+ event: w,
906
1019
  bindingKey: u
907
- }, E = h.contract, C = E.event;
908
- if (C && !t.blue.isTypeOfNode(v, C) || !await d.matches(E, f))
1020
+ }, E = h.contract, v = E.event;
1021
+ if (v && !t.blue.isTypeOfNode(w, v) || !await d.matches(E, f))
909
1022
  continue;
910
- const D = d.channelize, be = (D ? D.call(d, E, f) : void 0) ?? v.clone();
911
- this.enrichEvent(be, u);
912
- const Ie = Jn(
1023
+ const D = d.channelize, Te = (D ? D.call(d, E, f) : void 0) ?? w.clone();
1024
+ this.enrichEvent(Te, u);
1025
+ const Ie = lr(
913
1026
  t.bindingKey,
914
1027
  u
915
- ), vt = await this.shouldProcessChild({
1028
+ ), At = await this.shouldProcessChild({
916
1029
  childProcessor: d,
917
1030
  childContract: E,
918
1031
  context: {
@@ -923,10 +1036,10 @@ class Xn {
923
1036
  markers: t.markers
924
1037
  });
925
1038
  c.push({
926
- eventNode: be,
1039
+ eventNode: Te,
927
1040
  eventId: a,
928
1041
  checkpointKey: Ie,
929
- shouldProcess: vt
1042
+ shouldProcess: At
930
1043
  });
931
1044
  }
932
1045
  return {
@@ -938,17 +1051,17 @@ class Xn {
938
1051
  * Determine recency by checking whether any child delivery should process.
939
1052
  */
940
1053
  async isNewerEvent(e, t, n) {
941
- const r = await this.evaluate(e, t), o = r.deliveries ?? [];
942
- return !r.matches || o.length === 0 ? !1 : o.some((s) => s.shouldProcess !== !1);
1054
+ const r = await this.evaluate(e, t), i = r.deliveries ?? [];
1055
+ return !r.matches || i.length === 0 ? !1 : i.some((s) => s.shouldProcess !== !1);
943
1056
  }
944
1057
  /**
945
1058
  * Attach the source child channel key to event metadata for handler logic.
946
1059
  */
947
1060
  enrichEvent(e, t) {
948
- const n = e.getProperties() ?? {}, r = n.meta instanceof p ? n.meta.clone() : new p(), o = r.getProperties() ?? {};
1061
+ const n = e.getProperties() ?? {}, r = n.meta instanceof p ? n.meta.clone() : new p(), i = r.getProperties() ?? {};
949
1062
  r.setProperties({
950
- ...o,
951
- [jn]: new p().setValue(t)
1063
+ ...i,
1064
+ [cr]: new p().setValue(t)
952
1065
  }), e.setProperties({ ...n, meta: r });
953
1066
  }
954
1067
  /**
@@ -970,189 +1083,190 @@ class Xn {
970
1083
  * Resolve the checkpoint marker for the current scope, if present.
971
1084
  */
972
1085
  resolveCheckpoint(e) {
973
- const t = e.get(A);
974
- return Qn(t) ? t : null;
1086
+ const t = e.get(O);
1087
+ return ur(t) ? t : null;
975
1088
  }
976
1089
  }
977
- const Zn = g(w["Conversation/Actor"])(l.object({
1090
+ const dr = g(C["Conversation/Actor"])(l.object({
978
1091
  description: l.string().optional(),
979
1092
  name: l.string().optional()
980
- })), ft = g(w["Conversation/Timeline"])(l.object({
1093
+ })), St = g(C["Conversation/Timeline"])(l.object({
981
1094
  description: l.string().optional(),
982
1095
  name: l.string().optional(),
983
1096
  timelineId: l.string().optional()
984
- })), N = g(w["Conversation/Timeline Entry"])(l.object({
985
- actor: Zn.optional(),
1097
+ })), M = g(C["Conversation/Timeline Entry"])(l.object({
1098
+ actor: dr.optional(),
986
1099
  description: l.string().optional(),
987
- message: b().optional(),
1100
+ message: k().optional(),
988
1101
  name: l.string().optional(),
989
- prevEntry: b().optional(),
990
- timeline: ft.optional(),
1102
+ prevEntry: k().optional(),
1103
+ source: k().optional(),
1104
+ timeline: St.optional(),
991
1105
  timestamp: l.number().optional()
992
- })), Yn = g(I["MyOS/MyOS Timeline"])(ft.extend({
1106
+ })), pr = g(T["MyOS/MyOS Timeline"])(St.extend({
993
1107
  accountId: l.string().optional(),
994
1108
  description: l.string().optional(),
995
1109
  name: l.string().optional()
996
- })), De = g(I["MyOS/MyOS Timeline Entry"])(N.extend({
1110
+ })), xe = g(T["MyOS/MyOS Timeline Entry"])(M.extend({
997
1111
  description: l.string().optional(),
998
1112
  name: l.string().optional(),
999
- timeline: Yn.optional()
1113
+ timeline: pr.optional()
1000
1114
  }));
1001
- function Be(i, e) {
1002
- return e && i.isTypeOf(e, N, { checkSchemaExtensions: !0 }) ? i.nodeToSchemaOutput(e, N) : null;
1115
+ function _e(o, e) {
1116
+ return e && o.isTypeOf(e, M, { checkSchemaExtensions: !0 }) ? o.nodeToSchemaOutput(e, M) : null;
1003
1117
  }
1004
- function mt(i, e, t) {
1005
- const n = Be(i, e), r = Be(i, t);
1118
+ function wt(o, e, t) {
1119
+ const n = _e(o, e), r = _e(o, t);
1006
1120
  if (!n || !r)
1007
1121
  return !0;
1008
- const o = n.timestamp, s = r.timestamp;
1009
- return typeof o != "number" || typeof s != "number" ? !0 : o >= s;
1122
+ const i = n.timestamp, s = r.timestamp;
1123
+ return typeof i != "number" || typeof s != "number" ? !0 : i >= s;
1010
1124
  }
1011
- function xe(i, e) {
1012
- return i.isTypeOf(e, De) ? i.nodeToSchemaOutput(e, De) : i.isTypeOf(e, N) ? i.nodeToSchemaOutput(e, N) : null;
1125
+ function Fe(o, e) {
1126
+ return o.isTypeOf(e, xe) ? o.nodeToSchemaOutput(e, xe) : o.isTypeOf(e, M) ? o.nodeToSchemaOutput(e, M) : null;
1013
1127
  }
1014
- class er {
1128
+ class fr {
1015
1129
  kind = "channel";
1016
- blueIds = [I["MyOS/MyOS Timeline Channel"]];
1017
- schema = Sn;
1130
+ blueIds = [T["MyOS/MyOS Timeline Channel"]];
1131
+ schema = Rn;
1018
1132
  matches(e, t) {
1019
1133
  const { event: n, blue: r } = t;
1020
1134
  if (!n)
1021
1135
  return !1;
1022
- const o = xe(r, n);
1023
- if (!o)
1136
+ const i = Fe(r, n);
1137
+ if (!i)
1024
1138
  return !1;
1025
- const s = o.timeline?.timelineId;
1139
+ const s = i.timeline?.timelineId;
1026
1140
  return !s || !e.timelineId ? !1 : s === e.timelineId;
1027
1141
  }
1028
1142
  channelize(e, t) {
1029
1143
  const { event: n, blue: r } = t;
1030
- return !n || !xe(r, n) ? null : n.clone();
1144
+ return !n || !Fe(r, n) ? null : n.clone();
1031
1145
  }
1032
1146
  isNewerEvent(e, t, n) {
1033
- const { event: r, blue: o } = t;
1034
- return r ? mt(o, r, n) : !0;
1147
+ const { event: r, blue: i } = t;
1148
+ return r ? wt(i, r, n) : !0;
1035
1149
  }
1036
1150
  }
1037
- class tr {
1151
+ class mr {
1038
1152
  kind = "channel";
1039
- blueIds = [w["Conversation/Timeline Channel"]];
1040
- schema = yn;
1153
+ blueIds = [C["Conversation/Timeline Channel"]];
1154
+ schema = In;
1041
1155
  matches(e, t) {
1042
1156
  const { event: n, blue: r } = t;
1043
- if (!n || !r.isTypeOf(n, N))
1157
+ if (!n || !r.isTypeOf(n, M))
1044
1158
  return !1;
1045
- const s = r.nodeToSchemaOutput(n, N).timeline?.timelineId;
1159
+ const s = r.nodeToSchemaOutput(n, M).timeline?.timelineId;
1046
1160
  return !(!s || !e.timelineId || s !== e.timelineId);
1047
1161
  }
1048
1162
  channelize(e, t) {
1049
1163
  const { event: n, blue: r } = t;
1050
- return !n || !r.isTypeOf(n, N) ? null : n.clone();
1164
+ return !n || !r.isTypeOf(n, M) ? null : n.clone();
1051
1165
  }
1052
1166
  isNewerEvent(e, t, n) {
1053
- const { event: r, blue: o } = t;
1054
- return r ? mt(o, r, n) : !0;
1167
+ const { event: r, blue: i } = t;
1168
+ return r ? wt(i, r, n) : !0;
1055
1169
  }
1056
1170
  }
1057
- const _e = g(w["Conversation/Trigger Event"])(se.extend({
1171
+ const Ue = g(C["Conversation/Trigger Event"])(se.extend({
1058
1172
  description: l.string().optional(),
1059
- event: b().optional(),
1173
+ event: k().optional(),
1060
1174
  name: l.string().optional()
1061
1175
  }));
1062
- function we(i) {
1063
- const { context: e, eventNode: t, stepResults: n, contractNode: r } = i, o = rr(e), s = r != null ? e.blue.nodeToJson(r, "simple") : null, a = r != null ? e.blue.nodeToJson(r, "official") : s;
1176
+ function be(o) {
1177
+ const { context: e, eventNode: t, stepResults: n, contractNode: r } = o, i = Er(e), s = r != null ? e.blue.nodeToJson(r, "simple") : null, a = r != null ? e.blue.nodeToJson(r, "official") : s;
1064
1178
  return {
1065
1179
  event: e.blue.nodeToJson(t, "simple"),
1066
1180
  eventCanonical: e.blue.nodeToJson(t, "official"),
1067
1181
  steps: n,
1068
- document: o,
1182
+ document: i,
1069
1183
  currentContract: s,
1070
1184
  currentContractCanonical: a
1071
1185
  };
1072
1186
  }
1073
- const nr = /* @__PURE__ */ new Set(["blueId", "name", "description", "value"]);
1074
- function rr(i) {
1075
- const e = (o) => {
1076
- if (o === "/")
1187
+ const gr = /* @__PURE__ */ new Set(["blueId", "name", "description", "value"]);
1188
+ function Er(o) {
1189
+ const e = (i) => {
1190
+ if (i === "/")
1077
1191
  return !1;
1078
- const s = o.lastIndexOf("/"), a = o.substring(s + 1);
1079
- return nr.has(a);
1080
- }, t = (o) => {
1081
- const s = o == null ? "/" : typeof o == "string" ? o : (() => {
1192
+ const s = i.lastIndexOf("/"), a = i.substring(s + 1);
1193
+ return gr.has(a);
1194
+ }, t = (i) => {
1195
+ const s = i == null ? "/" : typeof i == "string" ? i : (() => {
1082
1196
  throw new TypeError("document() expects a string pointer");
1083
- })(), a = s.startsWith("/") ? s : i.resolvePointer(s), c = P(a), u = i.documentAt(c);
1084
- return i.gasMeter().chargeDocumentSnapshot(c, u), { snapshot: u, normalizedPointer: c };
1085
- }, n = (o, s) => {
1086
- const { snapshot: a, normalizedPointer: c } = t(o);
1197
+ })(), a = s.startsWith("/") ? s : o.resolvePointer(s), c = P(a), u = o.documentAt(c);
1198
+ return o.gasMeter().chargeDocumentSnapshot(c, u), { snapshot: u, normalizedPointer: c };
1199
+ }, n = (i, s) => {
1200
+ const { snapshot: a, normalizedPointer: c } = t(i);
1087
1201
  if (a)
1088
- return e(c) ? i.blue.nodeToJson(a, "simple") : i.blue.nodeToJson(a, s);
1089
- }, r = ((o) => n(o, "simple"));
1090
- return r.canonical = (o) => n(o, "official"), r;
1202
+ return e(c) ? o.blue.nodeToJson(a, "simple") : o.blue.nodeToJson(a, s);
1203
+ }, r = ((i) => n(i, "simple"));
1204
+ return r.canonical = (i) => n(i, "official"), r;
1091
1205
  }
1092
- class ir {
1206
+ class Cr {
1093
1207
  supportedBlueIds = [
1094
- w["Conversation/Trigger Event"]
1208
+ C["Conversation/Trigger Event"]
1095
1209
  ];
1096
1210
  evaluator = new Se();
1097
1211
  async execute(e) {
1098
1212
  const { stepNode: t, context: n } = e;
1099
- if (!n.blue.isTypeOf(t, _e))
1213
+ if (!n.blue.isTypeOf(t, Ue))
1100
1214
  return n.throwFatal("Trigger Event step payload is invalid");
1101
1215
  n.gasMeter().chargeTriggerEventBase();
1102
1216
  const r = await te({
1103
1217
  evaluator: this.evaluator,
1104
1218
  node: t,
1105
- bindings: we(e),
1106
- shouldResolve: ct({
1219
+ bindings: be(e),
1220
+ shouldResolve: ht({
1107
1221
  include: ["/event", "/event/**"]
1108
1222
  }),
1109
- shouldDescend: or(),
1223
+ shouldDescend: yr(),
1110
1224
  context: n
1111
1225
  }), s = n.blue.nodeToSchemaOutput(
1112
1226
  r,
1113
- _e
1227
+ Ue
1114
1228
  ).event;
1115
- if (de(s))
1229
+ if (pe(s))
1116
1230
  return n.throwFatal(
1117
1231
  "Trigger Event step must declare event payload"
1118
1232
  );
1119
1233
  n.emitEvent(s.clone());
1120
1234
  }
1121
1235
  }
1122
- function or() {
1123
- return (i, e) => i === "/event" || !i.startsWith("/event/") ? !0 : !sr(e);
1236
+ function yr() {
1237
+ return (o, e) => o === "/event" || !o.startsWith("/event/") ? !0 : !vr(e);
1124
1238
  }
1125
- function sr(i) {
1126
- const e = i.getProperties?.();
1239
+ function vr(o) {
1240
+ const e = o.getProperties?.();
1127
1241
  return e ? !!e.contracts : !1;
1128
1242
  }
1129
- const Le = g(w["Conversation/JavaScript Code"])(se.extend({
1243
+ const He = g(C["Conversation/JavaScript Code"])(se.extend({
1130
1244
  code: l.string().optional(),
1131
1245
  description: l.string().optional(),
1132
1246
  name: l.string().optional()
1133
1247
  }));
1134
- class ar {
1248
+ class Sr {
1135
1249
  supportedBlueIds = [
1136
- w["Conversation/JavaScript Code"]
1250
+ C["Conversation/JavaScript Code"]
1137
1251
  ];
1138
1252
  evaluator = new Se();
1139
1253
  wasmGasLimit;
1140
1254
  constructor(e = {}) {
1141
- this.wasmGasLimit = e.wasmGasLimit ?? it;
1255
+ this.wasmGasLimit = e.wasmGasLimit ?? at;
1142
1256
  }
1143
1257
  async execute(e) {
1144
1258
  const { context: t, stepNode: n } = e, { blue: r } = t;
1145
- if (!r.isTypeOf(n, Le))
1259
+ if (!r.isTypeOf(n, He))
1146
1260
  return t.throwFatal("JavaScript Code step payload is invalid");
1147
1261
  const s = r.nodeToSchemaOutput(
1148
1262
  n,
1149
- Le
1263
+ He
1150
1264
  ).code;
1151
1265
  if (!s)
1152
1266
  return t.throwFatal(
1153
1267
  "JavaScript Code step must include code to execute"
1154
1268
  );
1155
- const a = we(e);
1269
+ const a = be(e);
1156
1270
  try {
1157
1271
  const c = await this.evaluator.evaluate({
1158
1272
  code: s,
@@ -1162,7 +1276,7 @@ class ar {
1162
1276
  });
1163
1277
  return this.handleEvents(c, t), c;
1164
1278
  } catch (c) {
1165
- throw new ot(s, c);
1279
+ throw new ct(s, c);
1166
1280
  }
1167
1281
  }
1168
1282
  handleEvents(e, t) {
@@ -1171,40 +1285,40 @@ class ar {
1171
1285
  const n = e;
1172
1286
  if (Array.isArray(n.events))
1173
1287
  for (const r of n.events) {
1174
- const o = t.blue.jsonValueToNode(r);
1175
- t.emitEvent(o);
1288
+ const i = t.blue.jsonValueToNode(r);
1289
+ t.emitEvent(i);
1176
1290
  }
1177
1291
  }
1178
1292
  }
1179
- const cr = g(m["Core/Json Patch Entry"])(l.object({
1293
+ const wr = g(m["Core/Json Patch Entry"])(l.object({
1180
1294
  description: l.string().optional(),
1181
1295
  name: l.string().optional(),
1182
1296
  op: l.string().optional(),
1183
1297
  path: l.string().optional(),
1184
- val: b().optional()
1185
- })), Fe = g(w["Conversation/Update Document"])(se.extend({
1186
- changeset: l.array(cr).optional(),
1298
+ val: k().optional()
1299
+ })), ze = g(C["Conversation/Update Document"])(se.extend({
1300
+ changeset: l.array(wr).optional(),
1187
1301
  description: l.string().optional(),
1188
1302
  name: l.string().optional()
1189
1303
  }));
1190
- class lr {
1304
+ class br {
1191
1305
  supportedBlueIds = [
1192
- w["Conversation/Update Document"]
1306
+ C["Conversation/Update Document"]
1193
1307
  ];
1194
1308
  evaluator = new Se();
1195
1309
  async execute(e) {
1196
1310
  const { context: t, stepNode: n } = e, { blue: r } = t;
1197
- if (!r.isTypeOf(n, Fe))
1311
+ if (!r.isTypeOf(n, ze))
1198
1312
  return t.throwFatal("Update Document step payload is invalid");
1199
- const o = await te({
1313
+ const i = await te({
1200
1314
  evaluator: this.evaluator,
1201
1315
  node: n,
1202
- bindings: we(e),
1203
- shouldResolve: ct({
1316
+ bindings: be(e),
1317
+ shouldResolve: ht({
1204
1318
  include: ["/changeset", "/changeset/**"]
1205
1319
  }),
1206
1320
  context: t
1207
- }), s = this.extractChanges(o, t);
1321
+ }), s = this.extractChanges(i, t);
1208
1322
  t.gasMeter().chargeUpdateDocumentBase(s.length);
1209
1323
  for (const a of s) {
1210
1324
  const c = this.createPatch(a, t);
@@ -1214,12 +1328,12 @@ class lr {
1214
1328
  extractChanges(e, t) {
1215
1329
  return t.blue.nodeToSchemaOutput(
1216
1330
  e,
1217
- Fe
1331
+ ze
1218
1332
  ).changeset ?? [];
1219
1333
  }
1220
1334
  createPatch(e, t) {
1221
- const n = this.normalizeOperation(e.op, t), r = this.normalizePath(e.path, t), o = t.resolvePointer(r);
1222
- return n === "REMOVE" ? { op: n, path: o } : { op: n, path: o, val: e.val };
1335
+ const n = this.normalizeOperation(e.op, t), r = this.normalizePath(e.path, t), i = t.resolvePointer(r);
1336
+ return n === "REMOVE" ? { op: n, path: i } : { op: n, path: i, val: e.val };
1223
1337
  }
1224
1338
  normalizeOperation(e, t) {
1225
1339
  const n = typeof e == "string" ? e : void 0, r = (n ?? "REPLACE").toUpperCase();
@@ -1235,11 +1349,11 @@ class lr {
1235
1349
  }
1236
1350
  }
1237
1351
  const ke = [
1238
- new ir(),
1239
- new ar(),
1240
- new lr()
1352
+ new Cr(),
1353
+ new Sr(),
1354
+ new br()
1241
1355
  ];
1242
- class gt {
1356
+ class bt {
1243
1357
  executorIndex;
1244
1358
  constructor(e = ke) {
1245
1359
  const t = /* @__PURE__ */ new Map();
@@ -1249,32 +1363,32 @@ class gt {
1249
1363
  this.executorIndex = t;
1250
1364
  }
1251
1365
  async run(e) {
1252
- const { workflow: t, eventNode: n, context: r, contractNode: o } = e, s = t.steps ?? [];
1366
+ const { workflow: t, eventNode: n, context: r, contractNode: i } = e, s = t.steps ?? [];
1253
1367
  if (s.length === 0)
1254
1368
  return {};
1255
1369
  const a = {};
1256
1370
  for (const [c, u] of s.entries()) {
1257
1371
  const h = u.getType?.()?.getBlueId();
1258
- if (de(h))
1372
+ if (pe(h))
1259
1373
  return r.throwFatal(
1260
1374
  "Sequential workflow step is missing type metadata"
1261
1375
  );
1262
1376
  const d = this.executorIndex.get(h);
1263
- if (de(d)) {
1377
+ if (pe(d)) {
1264
1378
  const E = u.getType?.()?.getName?.() ?? h;
1265
1379
  return r.throwFatal(
1266
1380
  `Unsupported workflow step type "${E}"`
1267
1381
  );
1268
1382
  }
1269
- const v = {
1383
+ const w = {
1270
1384
  workflow: t,
1271
1385
  stepNode: u,
1272
1386
  eventNode: n,
1273
1387
  context: r,
1274
1388
  stepResults: a,
1275
1389
  stepIndex: c,
1276
- contractNode: o
1277
- }, f = await d.execute(v);
1390
+ contractNode: i
1391
+ }, f = await d.execute(w);
1278
1392
  if (f !== void 0) {
1279
1393
  const E = this.stepResultKey(u, c);
1280
1394
  a[E] = f;
@@ -1287,15 +1401,15 @@ class gt {
1287
1401
  return n && typeof n == "string" && n.length > 0 ? n : `Step${t + 1}`;
1288
1402
  }
1289
1403
  }
1290
- class ur {
1404
+ class kr {
1291
1405
  kind = "handler";
1292
1406
  blueIds = [
1293
- w["Conversation/Sequential Workflow"]
1407
+ C["Conversation/Sequential Workflow"]
1294
1408
  ];
1295
- schema = Vn;
1409
+ schema = nr;
1296
1410
  runner;
1297
1411
  constructor(e = ke) {
1298
- this.runner = new gt(e);
1412
+ this.runner = new bt(e);
1299
1413
  }
1300
1414
  async matches(e, t) {
1301
1415
  const n = t.event();
@@ -1311,26 +1425,26 @@ class ur {
1311
1425
  });
1312
1426
  }
1313
1427
  }
1314
- class hr {
1428
+ class Tr {
1315
1429
  kind = "marker";
1316
1430
  blueIds = [m["Core/Marker"]];
1317
1431
  schema = R;
1318
1432
  }
1319
- class dr {
1433
+ class Ir {
1320
1434
  kind = "marker";
1321
- blueIds = [w["Conversation/Operation"]];
1322
- schema = Nn;
1435
+ blueIds = [C["Conversation/Operation"]];
1436
+ schema = Vn;
1323
1437
  }
1324
- const me = g(w["Conversation/Operation Request"])(l.object({
1438
+ const ge = g(C["Conversation/Operation Request"])(l.object({
1325
1439
  allowNewerVersion: l.boolean().optional(),
1326
1440
  description: l.string().optional(),
1327
- document: b().optional(),
1441
+ document: k().optional(),
1328
1442
  name: l.string().optional(),
1329
1443
  operation: l.string().optional(),
1330
- request: b().optional()
1444
+ request: k().optional()
1331
1445
  }));
1332
- function Et(i) {
1333
- const e = i.channel;
1446
+ function kt(o) {
1447
+ const e = o.channel;
1334
1448
  if (typeof e == "string") {
1335
1449
  const t = e.trim();
1336
1450
  if (t.length > 0)
@@ -1338,50 +1452,50 @@ function Et(i) {
1338
1452
  }
1339
1453
  return null;
1340
1454
  }
1341
- function pr(i, e) {
1342
- const t = i.getProperties()?.document;
1455
+ function Pr(o, e) {
1456
+ const t = o.getProperties()?.document;
1343
1457
  return t instanceof p ? e.blue.calculateBlueIdSync(t) : null;
1344
1458
  }
1345
- function fr(i, e) {
1346
- if (e.isTypeOf(i, me, {
1459
+ function Rr(o, e) {
1460
+ if (e.isTypeOf(o, ge, {
1347
1461
  checkSchemaExtensions: !0
1348
1462
  }))
1349
- return i;
1350
- if (e.isTypeOf(i, N, {
1463
+ return o;
1464
+ if (e.isTypeOf(o, M, {
1351
1465
  checkSchemaExtensions: !0
1352
1466
  })) {
1353
- const n = e.nodeToSchemaOutput(i, N).message;
1354
- if (n && e.isTypeOf(n, me, {
1467
+ const n = e.nodeToSchemaOutput(o, M).message;
1468
+ if (n && e.isTypeOf(n, ge, {
1355
1469
  checkSchemaExtensions: !0
1356
1470
  }))
1357
1471
  return n;
1358
1472
  }
1359
1473
  return null;
1360
1474
  }
1361
- function mr(i, e, t, n) {
1362
- const { blue: r } = n, o = i.operation;
1363
- return !(!o || t.operation !== o || i.event && !r.isTypeOfNode(e, i.event));
1475
+ function Ar(o, e, t, n) {
1476
+ const { blue: r } = n, i = o.operation;
1477
+ return !(!i || t.operation !== i || o.event && !r.isTypeOfNode(e, o.event));
1364
1478
  }
1365
- function gr(i, e) {
1366
- const t = i.operation;
1479
+ function Mr(o, e) {
1480
+ const t = o.operation;
1367
1481
  if (!t)
1368
1482
  return null;
1369
1483
  const n = e.resolvePointer(`/contracts/${t}`), r = e.documentAt(n);
1370
- if (!r || !e.blue.isTypeOf(r, J, {
1484
+ if (!r || !e.blue.isTypeOf(r, Y, {
1371
1485
  checkSchemaExtensions: !0
1372
1486
  }))
1373
1487
  return null;
1374
- const o = e.blue.nodeToSchemaOutput(
1488
+ const i = e.blue.nodeToSchemaOutput(
1375
1489
  r,
1376
- J
1377
- ), s = Et(o);
1378
- return { operationNode: r, operation: o, channelKey: s };
1490
+ Y
1491
+ ), s = kt(i);
1492
+ return { operationNode: r, operation: i, channelKey: s };
1379
1493
  }
1380
- function Er(i, e) {
1381
- return !(i && e && i !== e);
1494
+ function Nr(o, e) {
1495
+ return !(o && e && o !== e);
1382
1496
  }
1383
- function yr(i, e, t) {
1384
- const n = i.getProperties()?.request, r = e.getProperties()?.request;
1497
+ function Or(o, e, t) {
1498
+ const n = o.getProperties()?.request, r = e.getProperties()?.request;
1385
1499
  if (!(n instanceof p) || !(r instanceof p))
1386
1500
  return !1;
1387
1501
  try {
@@ -1392,65 +1506,107 @@ function yr(i, e, t) {
1392
1506
  }
1393
1507
  return !0;
1394
1508
  }
1395
- function Cr(i, e, t) {
1396
- if (!i || i.allowNewerVersion !== !1)
1509
+ function Dr(o, e, t) {
1510
+ if (!o || o.allowNewerVersion !== !1)
1397
1511
  return !0;
1398
- const n = pr(e, t);
1512
+ const n = Pr(e, t);
1399
1513
  if (!n)
1400
1514
  return !0;
1401
- const r = t.resolvePointer("/"), o = t.documentAt(r);
1402
- if (!o)
1515
+ const r = t.resolvePointer("/"), i = t.documentAt(r);
1516
+ if (!i)
1403
1517
  return !1;
1404
- const c = (o.getContracts()?.initialized ?? null)?.get("/documentId") ?? null, u = typeof c == "string" && c.length > 0 ? c : t.blue.calculateBlueIdSync(o);
1518
+ const c = (i.getContracts()?.initialized ?? null)?.get("/documentId") ?? null, u = typeof c == "string" && c.length > 0 ? c : t.blue.calculateBlueIdSync(i);
1405
1519
  return n === u;
1406
1520
  }
1407
- class Sr {
1521
+ const Br = C["Conversation/Actor Policy"], Lr = C["Conversation/Principal Actor"], xr = C["Conversation/Agent Actor"], _r = C["Conversation/Browser Session"], Fr = C["Conversation/API Call"], Ur = C["Conversation/Document Request"];
1522
+ function Hr(o, e, t) {
1523
+ const r = zr(t)?.operations?.[o];
1524
+ if (!r)
1525
+ return !0;
1526
+ const i = $r(e, t), s = Vr(e, t);
1527
+ return Wr(r, i, s);
1528
+ }
1529
+ function zr(o) {
1530
+ const e = o.resolvePointer("/contracts"), n = o.documentAt(e)?.getProperties();
1531
+ if (!n)
1532
+ return null;
1533
+ for (const r of Object.values(n))
1534
+ if (r instanceof p && o.blue.isTypeOfBlueId(r, Br))
1535
+ return o.blue.nodeToSchemaOutput(
1536
+ r,
1537
+ Ct
1538
+ );
1539
+ return null;
1540
+ }
1541
+ function $r(o, e) {
1542
+ const t = Tt(o, "actor", e);
1543
+ return t ? e.blue.isTypeOfBlueId(t, xr) ? "agent" : e.blue.isTypeOfBlueId(t, Lr) ? "principal" : null : null;
1544
+ }
1545
+ function Vr(o, e) {
1546
+ const t = Tt(o, "source", e);
1547
+ return t ? e.blue.isTypeOfBlueId(t, _r) ? "browserSession" : e.blue.isTypeOfBlueId(t, Fr) ? "apiCall" : e.blue.isTypeOfBlueId(t, Ur) ? "documentRequest" : null : null;
1548
+ }
1549
+ function Tt(o, e, t) {
1550
+ if (!t.blue.isTypeOf(o, M, {
1551
+ checkSchemaExtensions: !0
1552
+ }))
1553
+ return null;
1554
+ const n = o.getProperties()?.[e];
1555
+ return n instanceof p ? n : null;
1556
+ }
1557
+ function Wr(o, e, t) {
1558
+ return !(o.requiresActor && (!e || o.requiresActor !== "any" && o.requiresActor !== e) || o.requiresSource && (!t || o.requiresSource !== t) || o.excludeSource && (!t || o.excludeSource === t));
1559
+ }
1560
+ class Kr {
1408
1561
  kind = "handler";
1409
1562
  blueIds = [
1410
- w["Conversation/Sequential Workflow Operation"]
1563
+ C["Conversation/Sequential Workflow Operation"]
1411
1564
  ];
1412
- schema = Wn;
1565
+ schema = or;
1413
1566
  runner;
1414
1567
  constructor(e = ke) {
1415
- this.runner = new gt(e);
1568
+ this.runner = new bt(e);
1416
1569
  }
1417
1570
  deriveChannel(e, t) {
1418
1571
  const n = e.operation;
1419
1572
  if (!n)
1420
1573
  return null;
1421
1574
  const r = t.scopeContracts.get(n);
1422
- if (!r || !t.blue.isTypeOf(r.node, J, {
1575
+ if (!r || !t.blue.isTypeOf(r.node, Y, {
1423
1576
  checkSchemaExtensions: !0
1424
1577
  }))
1425
1578
  return null;
1426
- const o = t.blue.nodeToSchemaOutput(r.node, J);
1427
- return o ? Et(o) : null;
1579
+ const i = t.blue.nodeToSchemaOutput(r.node, Y);
1580
+ return i ? kt(i) : null;
1428
1581
  }
1429
1582
  async matches(e, t) {
1430
1583
  const n = t.event();
1431
1584
  if (!n)
1432
1585
  return !1;
1433
- const r = fr(
1586
+ const r = Rr(
1434
1587
  n,
1435
1588
  t.blue
1436
1589
  );
1437
1590
  if (!r)
1438
1591
  return !1;
1439
- const o = t.blue.nodeToSchemaOutput(
1592
+ const i = t.blue.nodeToSchemaOutput(
1440
1593
  r,
1441
- me
1594
+ ge
1442
1595
  );
1443
- if (!o || !mr(e, n, o, t))
1596
+ if (!i || !Ar(e, n, i, t))
1444
1597
  return !1;
1445
- const s = gr(e, t);
1598
+ const s = Mr(e, t);
1446
1599
  if (!s)
1447
1600
  return !1;
1448
1601
  const a = typeof e.channel == "string" ? e.channel.trim() : "", c = a.length > 0 ? a : null;
1449
- return !(!Er(s.channelKey, c) || !yr(
1602
+ if (!Nr(s.channelKey, c) || !Or(
1450
1603
  r,
1451
1604
  s.operationNode,
1452
1605
  t.blue
1453
- ) || o?.allowNewerVersion === !1 && !Cr(o, r, t));
1606
+ ) || i?.allowNewerVersion === !1 && !Dr(i, r, t))
1607
+ return !1;
1608
+ const u = e.operation;
1609
+ return !(!u || !Hr(u, n, t));
1454
1610
  }
1455
1611
  async execute(e, t, n) {
1456
1612
  const r = t.event();
@@ -1468,11 +1624,11 @@ class ae {
1468
1624
  }
1469
1625
  static create() {
1470
1626
  return new ae(
1471
- new qn()
1627
+ new sr()
1472
1628
  );
1473
1629
  }
1474
1630
  registerDefaults() {
1475
- 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 dr()), this.registry.register(new hr()), this.registry.register(new Sr()), this;
1631
+ return this.registry.register(new hr()), this.registry.register(new fr()), this.registry.register(new mr()), this.registry.register(new kr()), this.registry.register(new ar()), this.registry.register(new Ir()), this.registry.register(new Tr()), this.registry.register(new Kr()), this;
1476
1632
  }
1477
1633
  register(e) {
1478
1634
  return this.registry.register(e), this;
@@ -1481,11 +1637,11 @@ class ae {
1481
1637
  return this.registry;
1482
1638
  }
1483
1639
  }
1484
- const ge = m["Core/Channel Event Checkpoint"];
1485
- function yt(i) {
1486
- return typeof i.order == "number" ? i.order : 0;
1640
+ const Ee = m["Core/Channel Event Checkpoint"];
1641
+ function It(o) {
1642
+ return typeof o.order == "number" ? o.order : 0;
1487
1643
  }
1488
- class vr {
1644
+ class qr {
1489
1645
  constructor(e, t, n, r) {
1490
1646
  this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n, this.bindingNode = r;
1491
1647
  }
@@ -1502,10 +1658,10 @@ class vr {
1502
1658
  return this.bindingNode.clone();
1503
1659
  }
1504
1660
  order() {
1505
- return yt(this.bindingContract);
1661
+ return It(this.bindingContract);
1506
1662
  }
1507
1663
  }
1508
- class wr {
1664
+ class Gr {
1509
1665
  constructor(e, t, n, r) {
1510
1666
  this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n, this.bindingNode = r;
1511
1667
  }
@@ -1522,28 +1678,28 @@ class wr {
1522
1678
  return this.bindingNode.clone();
1523
1679
  }
1524
1680
  order() {
1525
- return yt(this.bindingContract);
1681
+ return It(this.bindingContract);
1526
1682
  }
1527
1683
  }
1528
- class H {
1529
- constructor(e, t, n, r, o) {
1530
- this.channels = e, this.handlersByChannel = t, this.markerStore = n, this.embeddedPathsInternal = r, this.checkpointDeclared = o;
1684
+ class V {
1685
+ constructor(e, t, n, r, i) {
1686
+ this.channels = e, this.handlersByChannel = t, this.markerStore = n, this.embeddedPathsInternal = r, this.checkpointDeclared = i;
1531
1687
  }
1532
1688
  checkpointDeclared;
1533
- static fromComponents(e, t, n, r, o) {
1534
- return new H(
1689
+ static fromComponents(e, t, n, r, i) {
1690
+ return new V(
1535
1691
  e,
1536
1692
  t,
1537
1693
  n,
1538
1694
  r,
1539
- o
1695
+ i
1540
1696
  );
1541
1697
  }
1542
1698
  static builder() {
1543
- return new kr();
1699
+ return new jr();
1544
1700
  }
1545
1701
  static empty() {
1546
- return H.builder().build();
1702
+ return V.builder().build();
1547
1703
  }
1548
1704
  markers() {
1549
1705
  return new Map(
@@ -1573,24 +1729,24 @@ class H {
1573
1729
  throw new Error(
1574
1730
  "Duplicate Channel Event Checkpoint markers detected in same contracts map"
1575
1731
  );
1576
- this.markerStore.set(A, {
1577
- key: A,
1732
+ this.markerStore.set(O, {
1733
+ key: O,
1578
1734
  contract: e,
1579
- blueId: ge
1735
+ blueId: Ee
1580
1736
  }), this.checkpointDeclared = !0;
1581
1737
  }
1582
1738
  handlersFor(e) {
1583
1739
  const t = this.handlersByChannel.get(e);
1584
1740
  return !t || t.length === 0 ? [] : [...t].map(
1585
- (n) => new wr(
1741
+ (n) => new Gr(
1586
1742
  n.key,
1587
1743
  n.contract,
1588
1744
  n.blueId,
1589
1745
  n.node
1590
1746
  )
1591
1747
  ).sort((n, r) => {
1592
- const o = n.order() - r.order();
1593
- return o !== 0 ? o : n.key().localeCompare(r.key());
1748
+ const i = n.order() - r.order();
1749
+ return i !== 0 ? i : n.key().localeCompare(r.key());
1594
1750
  });
1595
1751
  }
1596
1752
  channelEntry(e) {
@@ -1604,20 +1760,20 @@ class H {
1604
1760
  }
1605
1761
  channelsOfType(...e) {
1606
1762
  const t = e.length > 0 ? new Set(e) : null, n = Array.from(this.channels.values()).filter((r) => !t || t.has(r.blueId)).map(
1607
- (r) => new vr(
1763
+ (r) => new qr(
1608
1764
  r.key,
1609
1765
  r.contract,
1610
1766
  r.blueId,
1611
1767
  r.node
1612
1768
  )
1613
1769
  );
1614
- return n.sort((r, o) => {
1615
- const s = r.order() - o.order();
1616
- return s !== 0 ? s : r.key().localeCompare(o.key());
1770
+ return n.sort((r, i) => {
1771
+ const s = r.order() - i.order();
1772
+ return s !== 0 ? s : r.key().localeCompare(i.key());
1617
1773
  }), n;
1618
1774
  }
1619
1775
  }
1620
- class kr {
1776
+ class jr {
1621
1777
  channels = /* @__PURE__ */ new Map();
1622
1778
  handlersByChannel = /* @__PURE__ */ new Map();
1623
1779
  markerStore = /* @__PURE__ */ new Map();
@@ -1628,11 +1784,11 @@ class kr {
1628
1784
  return this.channels.set(e, { key: e, contract: t, blueId: n, node: r }), this;
1629
1785
  }
1630
1786
  addHandler(e, t, n, r) {
1631
- const o = t.channel;
1632
- if (!o)
1787
+ const i = t.channel;
1788
+ if (!i)
1633
1789
  throw new Error(`Handler ${e} must declare channel`);
1634
- const s = this.handlersByChannel.get(o) ?? [];
1635
- return s.push({ key: e, contract: t, blueId: n, node: r }), this.handlersByChannel.set(o, s), this;
1790
+ const s = this.handlersByChannel.get(i) ?? [];
1791
+ return s.push({ key: e, contract: t, blueId: n, node: r }), this.handlersByChannel.set(i, s), this;
1636
1792
  }
1637
1793
  setEmbedded(e) {
1638
1794
  if (this.embeddedDeclared)
@@ -1642,12 +1798,12 @@ class kr {
1642
1798
  return this.embeddedDeclared = !0, this.embeddedPaths = e.paths ? [...e.paths] : [], this;
1643
1799
  }
1644
1800
  addMarker(e, t, n) {
1645
- if (e === A && n !== ge)
1801
+ if (e === O && n !== Ee)
1646
1802
  throw new Error(
1647
1803
  "Reserved key 'checkpoint' must contain a Channel Event Checkpoint"
1648
1804
  );
1649
- if (n === ge) {
1650
- if (e !== A)
1805
+ if (n === Ee) {
1806
+ if (e !== O)
1651
1807
  throw new Error(
1652
1808
  `Channel Event Checkpoint must use reserved key 'checkpoint' at key '${e}'`
1653
1809
  );
@@ -1660,7 +1816,7 @@ class kr {
1660
1816
  return this.markerStore.set(e, { key: e, contract: t, blueId: n }), this;
1661
1817
  }
1662
1818
  build() {
1663
- return H.fromComponents(
1819
+ return V.fromComponents(
1664
1820
  new Map(this.channels),
1665
1821
  new Map(
1666
1822
  Array.from(this.handlersByChannel.entries(), ([e, t]) => [
@@ -1679,13 +1835,13 @@ class y extends Error {
1679
1835
  super(e || "Processor fatal error"), this.processorError = t, this.name = "ProcessorFatalError";
1680
1836
  }
1681
1837
  }
1682
- function Z(i, e, t) {
1838
+ function Q(o, e, t) {
1683
1839
  for (const [n, r] of t.entries())
1684
- if (i.isTypeOfBlueId(e, n))
1840
+ if (o.isTypeOfBlueId(e, n))
1685
1841
  return r;
1686
1842
  return null;
1687
1843
  }
1688
- class br {
1844
+ class Yr {
1689
1845
  constructor(e, t, n) {
1690
1846
  this.blue = e, this.registry = t, this.builtinChannelSchemas = n;
1691
1847
  }
@@ -1694,7 +1850,7 @@ class br {
1694
1850
  key: t,
1695
1851
  node: n,
1696
1852
  processor: r,
1697
- blueId: o,
1853
+ blueId: i,
1698
1854
  scopeContracts: s
1699
1855
  }) {
1700
1856
  try {
@@ -1711,7 +1867,7 @@ class br {
1711
1867
  throw new y(
1712
1868
  `Handler ${t} references unknown channel '${u}'`,
1713
1869
  S.invalidContract(
1714
- o,
1870
+ i,
1715
1871
  `Channel '${u}' is not declared in this scope`,
1716
1872
  `/contracts/${u}`
1717
1873
  )
@@ -1729,7 +1885,7 @@ class br {
1729
1885
  this.setContractChannel(d, u), e.addHandler(
1730
1886
  t,
1731
1887
  { ...c, channel: u },
1732
- o,
1888
+ i,
1733
1889
  d
1734
1890
  );
1735
1891
  } catch (a) {
@@ -1737,7 +1893,7 @@ class br {
1737
1893
  throw new y(
1738
1894
  "Failed to parse handler contract",
1739
1895
  S.invalidContract(
1740
- o,
1896
+ i,
1741
1897
  "Failed to parse handler contract",
1742
1898
  t,
1743
1899
  a
@@ -1756,28 +1912,28 @@ class br {
1756
1912
  scopeContracts: n,
1757
1913
  handlerKey: r
1758
1914
  }) {
1759
- let o = typeof e.channel == "string" ? e.channel.trim() : null;
1760
- if (o && o.length === 0 && (o = null), !o) {
1915
+ let i = typeof e.channel == "string" ? e.channel.trim() : null;
1916
+ if (i && i.length === 0 && (i = null), !i) {
1761
1917
  const s = t.deriveChannel?.call(t, e, {
1762
1918
  blue: this.blue,
1763
1919
  scopeContracts: n
1764
1920
  }) ?? null;
1765
1921
  if (typeof s == "string") {
1766
1922
  const a = s.trim();
1767
- a.length > 0 && (o = a);
1923
+ a.length > 0 && (i = a);
1768
1924
  }
1769
1925
  }
1770
- if (!o)
1926
+ if (!i)
1771
1927
  throw new y(
1772
1928
  `Handler ${r} must declare channel (missing explicit channel and derivation failed)`,
1773
1929
  S.illegalState(
1774
1930
  `Handler ${r} must declare channel (missing explicit channel and derivation failed)`
1775
1931
  )
1776
1932
  );
1777
- return o;
1933
+ return i;
1778
1934
  }
1779
1935
  isRegisteredChannel(e) {
1780
- return Z(this.blue, e.node, this.builtinChannelSchemas) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
1936
+ return Q(this.blue, e.node, this.builtinChannelSchemas) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
1781
1937
  }
1782
1938
  setContractChannel(e, t) {
1783
1939
  const r = e.getProperties()?.channel;
@@ -1788,50 +1944,50 @@ class br {
1788
1944
  e.addProperty("channel", new p().setValue(t));
1789
1945
  }
1790
1946
  isZodError(e) {
1791
- return e instanceof Ee;
1947
+ return e instanceof Ce;
1792
1948
  }
1793
1949
  }
1794
- class z extends Error {
1950
+ class x extends Error {
1795
1951
  constructor(e) {
1796
1952
  super(e ?? "MustUnderstand failure"), this.name = "MustUnderstandFailure";
1797
1953
  }
1798
1954
  }
1799
- const Ir = w["Conversation/Composite Timeline Channel"];
1800
- function Tr(i) {
1801
- const { compositeKey: e, contract: t, scopeContracts: n, blueId: r, blue: o } = i, s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), c = [], u = /* @__PURE__ */ new Map([
1955
+ const Jr = C["Conversation/Composite Timeline Channel"];
1956
+ function Xr(o) {
1957
+ 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([
1802
1958
  [e, t]
1803
- ]), h = (f) => o.isTypeOfBlueId(f.node, Ir), d = (f) => {
1959
+ ]), h = (f) => i.isTypeOfBlueId(f.node, Jr), d = (f) => {
1804
1960
  if (u.has(f))
1805
1961
  return u.get(f) ?? null;
1806
1962
  const E = n.get(f);
1807
1963
  if (!E || !h(E))
1808
1964
  return u.set(f, null), null;
1809
1965
  try {
1810
- const C = o.nodeToSchemaOutput(
1966
+ const v = i.nodeToSchemaOutput(
1811
1967
  E.node,
1812
- dt
1968
+ mt
1813
1969
  );
1814
- return u.set(f, C), C;
1815
- } catch (C) {
1816
- if (Pr(C))
1970
+ return u.set(f, v), v;
1971
+ } catch (v) {
1972
+ if (Qr(v))
1817
1973
  throw new y(
1818
1974
  "Failed to parse channel contract",
1819
1975
  S.invalidContract(
1820
1976
  E.nodeTypeBlueId,
1821
1977
  "Failed to parse channel contract",
1822
1978
  `/contracts/${f}`,
1823
- C
1979
+ v
1824
1980
  )
1825
1981
  );
1826
- const M = C?.message ?? "Failed to parse channel contract";
1982
+ const A = v?.message ?? "Failed to parse channel contract";
1827
1983
  throw new y(
1828
- M,
1829
- S.illegalState(M)
1984
+ A,
1985
+ S.illegalState(A)
1830
1986
  );
1831
1987
  }
1832
- }, v = (f) => {
1988
+ }, w = (f) => {
1833
1989
  if (a.has(f)) {
1834
- const C = c.indexOf(f), D = [...c.slice(C), f].join(" -> ");
1990
+ const v = c.indexOf(f), D = [...c.slice(v), f].join(" -> ");
1835
1991
  throw new y(
1836
1992
  `Composite channel ${e} has a cyclic reference: ${D}`,
1837
1993
  S.invalidContract(
@@ -1846,88 +2002,88 @@ function Tr(i) {
1846
2002
  a.add(f), c.push(f);
1847
2003
  const E = d(f);
1848
2004
  if (E)
1849
- for (const C of E.channels ?? []) {
1850
- const M = n.get(C);
1851
- M && h(M) && v(C);
2005
+ for (const v of E.channels ?? []) {
2006
+ const A = n.get(v);
2007
+ A && h(A) && w(v);
1852
2008
  }
1853
2009
  c.pop(), a.delete(f), s.add(f);
1854
2010
  };
1855
- v(e);
2011
+ w(e);
1856
2012
  }
1857
- function Pr(i) {
1858
- return i instanceof Ee;
2013
+ function Qr(o) {
2014
+ return o instanceof Ce;
1859
2015
  }
1860
- const Mr = m["Core/Document Update Channel"], Rr = m["Core/Embedded Node Channel"], Nr = m["Core/Lifecycle Event Channel"], Or = m["Core/Triggered Event Channel"], $e = m["Core/Process Embedded"], Ar = m["Core/Processing Initialized Marker"], Dr = m["Core/Processing Terminated Marker"], Br = m["Core/Channel Event Checkpoint"], xr = I["MyOS/Document Anchors"], _r = I["MyOS/Document Links"], Lr = I["MyOS/MyOS Participants Orchestration"], Fr = I["MyOS/MyOS Session Interaction"], $r = I["MyOS/MyOS Worker Agency"], Ur = w["Conversation/Composite Timeline Channel"], le = /* @__PURE__ */ new Map([
2016
+ const Zr = m["Core/Document Update Channel"], eo = m["Core/Embedded Node Channel"], to = m["Core/Lifecycle Event Channel"], no = m["Core/Triggered Event Channel"], $e = m["Core/Process Embedded"], ro = m["Core/Processing Initialized Marker"], oo = m["Core/Processing Terminated Marker"], io = m["Core/Channel Event Checkpoint"], so = T["MyOS/Document Anchors"], ao = T["MyOS/Document Links"], co = T["MyOS/MyOS Participants Orchestration"], lo = T["MyOS/MyOS Session Interaction"], uo = T["MyOS/MyOS Worker Agency"], ho = C["Conversation/Composite Timeline Channel"], ue = /* @__PURE__ */ new Map([
1861
2017
  [
1862
- Mr,
1863
- hn
2018
+ Zr,
2019
+ yn
1864
2020
  ],
1865
2021
  [
1866
- Rr,
1867
- pn
2022
+ eo,
2023
+ Sn
1868
2024
  ],
1869
2025
  [
1870
- Nr,
1871
- mn
2026
+ to,
2027
+ bn
1872
2028
  ],
1873
2029
  [
1874
- Or,
1875
- En
2030
+ no,
2031
+ Tn
1876
2032
  ]
1877
- ]), zr = /* @__PURE__ */ new Map([
2033
+ ]), po = /* @__PURE__ */ new Map([
1878
2034
  [
1879
- Ar,
1880
- In
2035
+ ro,
2036
+ Fn
1881
2037
  ],
1882
2038
  [
1883
- Dr,
1884
- Rn
2039
+ oo,
2040
+ $n
1885
2041
  ],
1886
2042
  [
1887
- Br,
1888
- kn
2043
+ io,
2044
+ xn
1889
2045
  ],
1890
2046
  [
1891
- xr,
1892
- Dn
2047
+ so,
2048
+ qn
1893
2049
  ],
1894
2050
  [
1895
- _r,
1896
- _n
2051
+ ao,
2052
+ Yn
1897
2053
  ],
1898
2054
  [
1899
- Lr,
1900
- Fn
2055
+ co,
2056
+ Xn
1901
2057
  ],
1902
2058
  [
1903
- Fr,
1904
- Un
2059
+ lo,
2060
+ Zn
1905
2061
  ],
1906
2062
  [
1907
- $r,
1908
- Hn
2063
+ uo,
2064
+ tr
1909
2065
  ]
1910
2066
  ]);
1911
- class Hr {
2067
+ class fo {
1912
2068
  constructor(e, t) {
1913
- this.registry = e, this.blue = t, this.handlerRegistration = new br(
2069
+ this.registry = e, this.blue = t, this.handlerRegistration = new Yr(
1914
2070
  this.blue,
1915
2071
  this.registry,
1916
- le
2072
+ ue
1917
2073
  );
1918
2074
  }
1919
2075
  handlerRegistration;
1920
2076
  load(e, t) {
1921
2077
  try {
1922
- const n = H.builder(), r = e.getContracts();
2078
+ const n = V.builder(), r = e.getContracts();
1923
2079
  if (!r)
1924
2080
  return n.build();
1925
- const o = this.buildScopeContractsIndex(r);
2081
+ const i = this.buildScopeContractsIndex(r);
1926
2082
  for (const [s, a] of Object.entries(r))
1927
- a && this.processContract(n, s, a, o);
2083
+ a && this.processContract(n, s, a, i);
1928
2084
  return n.build();
1929
2085
  } catch (n) {
1930
- if (n instanceof z || n instanceof y)
2086
+ if (n instanceof x || n instanceof y)
1931
2087
  throw n;
1932
2088
  const r = n?.message ?? "Failed to load contracts";
1933
2089
  throw new y(
@@ -1940,26 +2096,33 @@ class Hr {
1940
2096
  }
1941
2097
  }
1942
2098
  processContract(e, t, n, r) {
1943
- const o = n.getType()?.getBlueId();
1944
- if (!o)
2099
+ const i = n.getType()?.getBlueId();
2100
+ if (!i)
1945
2101
  return;
1946
2102
  if (this.blue.isTypeOfBlueId(n, $e)) {
1947
2103
  this.handleProcessEmbedded(e, t, n);
1948
2104
  return;
1949
2105
  }
1950
- const s = Z(
2106
+ const s = Q(
1951
2107
  this.blue,
1952
2108
  n,
1953
- zr
2109
+ po
1954
2110
  );
1955
2111
  if (s) {
1956
- this.handleMarker(e, t, n, s, o);
2112
+ this.handleMarker(
2113
+ e,
2114
+ t,
2115
+ n,
2116
+ s,
2117
+ i,
2118
+ r
2119
+ );
1957
2120
  return;
1958
2121
  }
1959
- const a = Z(
2122
+ const a = Q(
1960
2123
  this.blue,
1961
2124
  n,
1962
- le
2125
+ ue
1963
2126
  );
1964
2127
  if (a) {
1965
2128
  this.handleChannel(
@@ -1967,7 +2130,7 @@ class Hr {
1967
2130
  t,
1968
2131
  n,
1969
2132
  a,
1970
- o,
2133
+ i,
1971
2134
  r
1972
2135
  );
1973
2136
  return;
@@ -1982,7 +2145,7 @@ class Hr {
1982
2145
  t,
1983
2146
  n,
1984
2147
  c.schema,
1985
- o,
2148
+ i,
1986
2149
  r
1987
2150
  );
1988
2151
  return;
@@ -1997,7 +2160,7 @@ class Hr {
1997
2160
  key: t,
1998
2161
  node: n,
1999
2162
  processor: u,
2000
- blueId: o,
2163
+ blueId: i,
2001
2164
  scopeContracts: r
2002
2165
  });
2003
2166
  return;
@@ -2009,28 +2172,29 @@ class Hr {
2009
2172
  t,
2010
2173
  n,
2011
2174
  h.schema,
2012
- o
2175
+ i,
2176
+ r
2013
2177
  );
2014
2178
  return;
2015
2179
  }
2016
- throw je(o) ? new y(
2180
+ throw Xe(i) ? new y(
2017
2181
  "Built-in processor-managed channel is missing schema registration",
2018
2182
  S.invalidContract(
2019
- o,
2183
+ i,
2020
2184
  "Built-in processor-managed channel is missing schema registration",
2021
2185
  t
2022
2186
  )
2023
- ) : new z(`Unsupported contract type: ${o}`);
2187
+ ) : new x(`Unsupported contract type: ${i}`);
2024
2188
  }
2025
2189
  handleProcessEmbedded(e, t, n) {
2026
2190
  try {
2027
2191
  const r = this.blue.nodeToSchemaOutput(
2028
2192
  n,
2029
- Pn
2193
+ Hn
2030
2194
  );
2031
2195
  e.setEmbedded(r);
2032
2196
  } catch (r) {
2033
- throw ue(r) ? new y(
2197
+ throw he(r) ? new y(
2034
2198
  "Failed to parse ProcessEmbedded marker",
2035
2199
  S.invalidContract(
2036
2200
  $e,
@@ -2046,26 +2210,26 @@ class Hr {
2046
2210
  );
2047
2211
  }
2048
2212
  }
2049
- handleChannel(e, t, n, r, o, s) {
2213
+ handleChannel(e, t, n, r, i, s) {
2050
2214
  try {
2051
2215
  const a = this.blue.nodeToSchemaOutput(
2052
2216
  n,
2053
2217
  r
2054
2218
  );
2055
- this.blue.isTypeOfBlueId(n, Ur) && this.validateCompositeChannel(
2219
+ this.blue.isTypeOfBlueId(n, ho) && this.validateCompositeChannel(
2056
2220
  t,
2057
2221
  a,
2058
2222
  s,
2059
- o
2060
- ), e.addChannel(t, a, o, n);
2223
+ i
2224
+ ), e.addChannel(t, a, i, n);
2061
2225
  } catch (a) {
2062
- if (a instanceof y || a instanceof z)
2226
+ if (a instanceof y || a instanceof x)
2063
2227
  throw a;
2064
- if (ue(a))
2228
+ if (he(a))
2065
2229
  throw new y(
2066
2230
  "Failed to parse channel contract",
2067
2231
  S.invalidContract(
2068
- o,
2232
+ i,
2069
2233
  "Failed to parse channel contract",
2070
2234
  t,
2071
2235
  a
@@ -2079,9 +2243,9 @@ class Hr {
2079
2243
  }
2080
2244
  }
2081
2245
  validateCompositeChannel(e, t, n, r) {
2082
- const o = t.channels ?? [];
2083
- if (o.length !== 0) {
2084
- for (const s of o) {
2246
+ const i = t.channels ?? [];
2247
+ if (i.length !== 0) {
2248
+ for (const s of i) {
2085
2249
  const a = n.get(s);
2086
2250
  if (!a)
2087
2251
  throw new y(
@@ -2102,7 +2266,7 @@ class Hr {
2102
2266
  )
2103
2267
  );
2104
2268
  }
2105
- Tr({
2269
+ Xr({
2106
2270
  compositeKey: e,
2107
2271
  contract: t,
2108
2272
  scopeContracts: n,
@@ -2112,67 +2276,92 @@ class Hr {
2112
2276
  }
2113
2277
  }
2114
2278
  isRegisteredChannel(e) {
2115
- return Z(this.blue, e.node, le) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
2279
+ return Q(this.blue, e.node, ue) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
2116
2280
  }
2117
- handleMarker(e, t, n, r, o) {
2281
+ handleMarker(e, t, n, r, i, s) {
2118
2282
  try {
2119
- const s = this.blue.nodeToSchemaOutput(
2283
+ const a = C["Conversation/Actor Policy"];
2284
+ this.blue.isTypeOfBlueId(n, a) && (this.assertSingleActorPolicyMarker(t, s, i), Bn(n));
2285
+ const c = this.blue.nodeToSchemaOutput(
2120
2286
  n,
2121
2287
  r
2122
2288
  );
2123
- e.addMarker(t, s, o);
2124
- } catch (s) {
2125
- if (ue(s))
2289
+ e.addMarker(t, c, i);
2290
+ } catch (a) {
2291
+ if (a instanceof y || a instanceof x)
2292
+ throw a;
2293
+ if (a instanceof yt)
2294
+ throw new y(
2295
+ a.message,
2296
+ S.invalidContract(i, a.message, t, a)
2297
+ );
2298
+ if (he(a))
2126
2299
  throw new y(
2127
2300
  "Failed to parse marker contract",
2128
2301
  S.invalidContract(
2129
- o,
2302
+ i,
2130
2303
  "Failed to parse marker contract",
2131
2304
  t,
2132
- s
2305
+ a
2133
2306
  )
2134
2307
  );
2135
- const a = s?.message ?? "Failed to register marker contract";
2308
+ const c = a?.message ?? "Failed to register marker contract";
2136
2309
  throw new y(
2137
- a,
2138
- S.illegalState(a)
2310
+ c,
2311
+ S.illegalState(c)
2139
2312
  );
2140
2313
  }
2141
2314
  }
2315
+ assertSingleActorPolicyMarker(e, t, n) {
2316
+ const r = C["Conversation/Actor Policy"], i = Array.from(t.entries()).find(
2317
+ ([a, c]) => a !== e && this.blue.isTypeOfBlueId(c.node, r)
2318
+ );
2319
+ if (!i)
2320
+ return;
2321
+ const [s] = i;
2322
+ throw new y(
2323
+ `Multiple Actor Policy markers declared in the same scope: '${e}' conflicts with '${s}'`,
2324
+ S.invalidContract(
2325
+ n,
2326
+ "Multiple Actor Policy markers declared in the same scope",
2327
+ `/contracts/${e}`
2328
+ )
2329
+ );
2330
+ }
2142
2331
  buildScopeContractsIndex(e) {
2143
2332
  const t = /* @__PURE__ */ new Map();
2144
2333
  for (const [n, r] of Object.entries(e)) {
2145
2334
  if (!r)
2146
2335
  continue;
2147
- const o = r.getType()?.getBlueId();
2148
- typeof o == "string" && o.trim().length > 0 && t.set(n, { node: r, nodeTypeBlueId: o });
2336
+ const i = r.getType()?.getBlueId();
2337
+ typeof i == "string" && i.trim().length > 0 && t.set(n, { node: r, nodeTypeBlueId: i });
2149
2338
  }
2150
2339
  return t;
2151
2340
  }
2152
2341
  }
2153
- function ue(i) {
2154
- return i instanceof Ee;
2342
+ function he(o) {
2343
+ return o instanceof Ce;
2155
2344
  }
2156
- const Vr = m["Core/Channel Event Checkpoint"];
2157
- function Kr(i) {
2158
- return i.jsonValueToNode({
2159
- type: { blueId: Vr },
2345
+ const mo = m["Core/Channel Event Checkpoint"];
2346
+ function go(o) {
2347
+ return o.jsonValueToNode({
2348
+ type: { blueId: mo },
2160
2349
  lastEvents: {},
2161
2350
  lastSignatures: {}
2162
2351
  });
2163
2352
  }
2164
- function Wr() {
2353
+ function Eo() {
2165
2354
  return {
2166
2355
  lastEvents: {},
2167
2356
  lastSignatures: {}
2168
2357
  };
2169
2358
  }
2170
- function Ue(i) {
2171
- return i != null && Object.prototype.hasOwnProperty.call(i, "lastEvents") && Object.prototype.hasOwnProperty.call(i, "lastSignatures");
2359
+ function Ve(o) {
2360
+ return o != null && Object.prototype.hasOwnProperty.call(o, "lastEvents") && Object.prototype.hasOwnProperty.call(o, "lastSignatures");
2172
2361
  }
2173
- class Gr {
2174
- constructor(e, t, n, r, o) {
2175
- this.markerKey = e, this.checkpoint = t, this.channelKey = n, this.lastEventNode = r, this.lastEventSignature = o;
2362
+ class Co {
2363
+ constructor(e, t, n, r, i) {
2364
+ this.markerKey = e, this.checkpoint = t, this.channelKey = n, this.lastEventNode = r, this.lastEventSignature = i;
2176
2365
  }
2177
2366
  lastEventNode;
2178
2367
  lastEventSignature;
@@ -2180,28 +2369,28 @@ class Gr {
2180
2369
  return e != null && e === this.lastEventSignature;
2181
2370
  }
2182
2371
  }
2183
- class qr {
2372
+ class yo {
2184
2373
  constructor(e, t) {
2185
2374
  this.runtime = e, this.signatureFn = t;
2186
2375
  }
2187
2376
  ensureCheckpointMarker(e, t) {
2188
- const n = t.marker(A), r = T(e, Qe);
2377
+ const n = t.marker(O), r = I(e, Ze);
2189
2378
  if (!n) {
2190
- const o = Kr(this.runtime.blue());
2191
- this.runtime.directWrite(r, o), t.registerCheckpointMarker(Wr());
2379
+ const i = go(this.runtime.blue());
2380
+ this.runtime.directWrite(r, i), t.registerCheckpointMarker(Eo());
2192
2381
  return;
2193
2382
  }
2194
- if (!Ue(n))
2383
+ if (!Ve(n))
2195
2384
  throw new Error(
2196
2385
  `Reserved key 'checkpoint' must contain a Channel Event Checkpoint at ${r}`
2197
2386
  );
2198
2387
  }
2199
2388
  findCheckpoint(e, t) {
2200
2389
  for (const [n, r] of e.markerEntries()) {
2201
- if (!Ue(r))
2390
+ if (!Ve(r))
2202
2391
  continue;
2203
2392
  const s = (r.lastEvents?.[t] ?? null)?.clone() ?? null, c = r.lastSignatures?.[t] ?? null ?? this.signatureFn(s);
2204
- return new Gr(
2393
+ return new Co(
2205
2394
  n,
2206
2395
  r,
2207
2396
  t,
@@ -2214,22 +2403,22 @@ class qr {
2214
2403
  isDuplicate(e, t) {
2215
2404
  return e != null && e.matches(t);
2216
2405
  }
2217
- persist(e, t, n, r, o) {
2406
+ persist(e, t, n, r, i) {
2218
2407
  if (!n)
2219
2408
  return;
2220
- const s = T(
2409
+ const s = I(
2221
2410
  e,
2222
- Ye(n.markerKey, n.channelKey)
2223
- ), a = o?.clone() ?? null;
2411
+ nt(n.markerKey, n.channelKey)
2412
+ ), a = i?.clone() ?? null;
2224
2413
  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;
2225
- const c = T(
2414
+ const c = I(
2226
2415
  e,
2227
- et(n.markerKey, n.channelKey)
2416
+ rt(n.markerKey, n.channelKey)
2228
2417
  ), u = r == null ? null : new p().setValue(r);
2229
2418
  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;
2230
2419
  }
2231
2420
  }
2232
- class jr {
2421
+ class vo {
2233
2422
  constructor(e, t, n) {
2234
2423
  this.runtime = e, this.checkpointManager = t, this.deps = n;
2235
2424
  }
@@ -2237,7 +2426,7 @@ class jr {
2237
2426
  if (this.deps.isScopeInactive(e))
2238
2427
  return;
2239
2428
  this.runtime.gasMeter().chargeChannelMatchAttempt();
2240
- const o = r, s = await this.deps.evaluateChannel(
2429
+ const i = r, s = await this.deps.evaluateChannel(
2241
2430
  n,
2242
2431
  t,
2243
2432
  e,
@@ -2254,12 +2443,12 @@ class jr {
2254
2443
  const c = this.checkpointManager.findCheckpoint(
2255
2444
  t,
2256
2445
  n.key()
2257
- ), u = s.eventId ?? this.deps.canonicalSignature(o);
2446
+ ), u = s.eventId ?? this.deps.canonicalSignature(i);
2258
2447
  this.checkpointManager.isDuplicate(c, u) || !await this.shouldProcessRelativeToCheckpoint(
2259
2448
  e,
2260
2449
  t,
2261
2450
  n,
2262
- o,
2451
+ i,
2263
2452
  c
2264
2453
  ) || (await this.runHandlers(
2265
2454
  e,
@@ -2272,11 +2461,11 @@ class jr {
2272
2461
  t,
2273
2462
  c,
2274
2463
  u ?? null,
2275
- o
2464
+ i
2276
2465
  ));
2277
2466
  }
2278
- async runDeliveries(e, t, n, r, o) {
2279
- const s = o.deliveries ?? [];
2467
+ async runDeliveries(e, t, n, r, i) {
2468
+ const s = i.deliveries ?? [];
2280
2469
  if (s.length === 0)
2281
2470
  return;
2282
2471
  this.checkpointManager.ensureCheckpointMarker(e, t);
@@ -2313,22 +2502,22 @@ class jr {
2313
2502
  }
2314
2503
  }
2315
2504
  }
2316
- async runHandlers(e, t, n, r, o) {
2505
+ async runHandlers(e, t, n, r, i) {
2317
2506
  const s = t.handlersFor(n);
2318
2507
  if (s.length !== 0)
2319
2508
  for (const a of s) {
2320
- if (!o && this.deps.isScopeInactive(e))
2509
+ if (!i && this.deps.isScopeInactive(e))
2321
2510
  break;
2322
2511
  try {
2323
2512
  const c = this.deps.createContext(
2324
2513
  e,
2325
2514
  t,
2326
2515
  r,
2327
- o
2516
+ i
2328
2517
  );
2329
2518
  if (!await this.deps.shouldRunHandler(a, c))
2330
2519
  continue;
2331
- if (this.runtime.gasMeter().chargeHandlerOverhead(), await this.deps.executeHandler(a, c), !o && this.deps.isScopeInactive(e))
2520
+ if (this.runtime.gasMeter().chargeHandlerOverhead(), await this.deps.executeHandler(a, c), !i && this.deps.isScopeInactive(e))
2332
2521
  break;
2333
2522
  } catch (c) {
2334
2523
  await this.deps.handleHandlerError(e, t, c);
@@ -2336,8 +2525,8 @@ class jr {
2336
2525
  }
2337
2526
  }
2338
2527
  }
2339
- async shouldProcessRelativeToCheckpoint(e, t, n, r, o) {
2340
- if (!o?.lastEventNode)
2528
+ async shouldProcessRelativeToCheckpoint(e, t, n, r, i) {
2529
+ if (!i?.lastEventNode)
2341
2530
  return !0;
2342
2531
  const s = this.deps.channelProcessorFor(n.node());
2343
2532
  if (!s || typeof s.isNewerEvent != "function")
@@ -2352,25 +2541,25 @@ class jr {
2352
2541
  return await s.isNewerEvent(
2353
2542
  n.contract(),
2354
2543
  a,
2355
- o.lastEventNode.clone()
2544
+ i.lastEventNode.clone()
2356
2545
  );
2357
2546
  }
2358
2547
  }
2359
- function Jr(i, e) {
2360
- return e.isResolved() ? i.createResolvedNode(e) : i.resolve(e);
2548
+ function So(o, e) {
2549
+ return e.isResolved() ? o.createResolvedNode(e) : o.resolve(e);
2361
2550
  }
2362
- class U extends y {
2551
+ class $ extends y {
2363
2552
  constructor(e) {
2364
2553
  super(e, S.illegalState(e)), this.name = "IllegalStateException";
2365
2554
  }
2366
2555
  }
2367
- class F extends Error {
2556
+ class H extends Error {
2368
2557
  constructor(e) {
2369
2558
  super(e), this.name = "BoundaryViolationException";
2370
2559
  }
2371
2560
  }
2372
- const Qr = m["Core/Document Update Channel"], Xr = m["Core/Embedded Node Channel"], Zr = m["Core/Triggered Event Channel"], Yr = m["Core/Lifecycle Event Channel"], ze = m["Core/Processing Initialized Marker"], ei = m["Core/Document Processing Initiated"];
2373
- class ti {
2561
+ const wo = m["Core/Document Update Channel"], bo = m["Core/Embedded Node Channel"], ko = m["Core/Triggered Event Channel"], To = m["Core/Lifecycle Event Channel"], We = m["Core/Processing Initialized Marker"], Io = m["Core/Document Processing Initiated"];
2562
+ class Po {
2374
2563
  runtime;
2375
2564
  contractLoader;
2376
2565
  channelRunner;
@@ -2384,25 +2573,25 @@ class ti {
2384
2573
  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;
2385
2574
  }
2386
2575
  async initializeScope(e, t) {
2387
- const n = k(e), r = /* @__PURE__ */ new Set();
2388
- let o = null, s = null;
2576
+ const n = b(e), r = /* @__PURE__ */ new Set();
2577
+ let i = null, s = null;
2389
2578
  for (t && this.runtime.gasMeter().chargeScopeEntry(n); ; ) {
2390
2579
  const d = this.nodeAt(n);
2391
2580
  if (!d)
2392
2581
  return;
2393
- s || (s = d.clone()), o = this.loadBundle(d, n), this.bundles.set(n, o);
2394
- const v = o.embeddedPaths().find((C) => !r.has(C)) ?? null;
2395
- if (!v)
2582
+ s || (s = d.clone()), i = this.loadBundle(d, n), this.bundles.set(n, i);
2583
+ const w = i.embeddedPaths().find((v) => !r.has(v)) ?? null;
2584
+ if (!w)
2396
2585
  break;
2397
- r.add(v);
2398
- const f = T(n, v);
2586
+ r.add(w);
2587
+ const f = I(n, w);
2399
2588
  this.nodeAt(f) && await this.initializeScope(f, !0);
2400
2589
  }
2401
- if (!o)
2590
+ if (!i)
2402
2591
  return;
2403
2592
  const a = this.hasInitializationMarker(n);
2404
- if (!a && o.hasCheckpoint())
2405
- throw new U(
2593
+ if (!a && i.hasCheckpoint())
2594
+ throw new $(
2406
2595
  `Reserved key 'checkpoint' must not appear before initialization at scope ${n}`
2407
2596
  );
2408
2597
  if (a)
@@ -2410,42 +2599,42 @@ class ti {
2410
2599
  this.runtime.gasMeter().chargeInitialization();
2411
2600
  const c = this.blueId(s ?? new p()), u = this.createLifecycleEvent(c), h = this.hooks.createContext(
2412
2601
  n,
2413
- o,
2602
+ i,
2414
2603
  u,
2415
2604
  !1,
2416
2605
  !0
2417
2606
  );
2418
- await this.deliverLifecycle(n, o, u, !0), await this.addInitializationMarker(h, c);
2607
+ await this.deliverLifecycle(n, i, u, !0), await this.addInitializationMarker(h, c);
2419
2608
  }
2420
2609
  loadBundles(e) {
2421
- const t = k(e);
2610
+ const t = b(e);
2422
2611
  if (this.bundles.has(t))
2423
2612
  return;
2424
- const n = this.nodeAt(t), r = n ? this.loadBundle(n, t) : H.empty();
2613
+ const n = this.nodeAt(t), r = n ? this.loadBundle(n, t) : V.empty();
2425
2614
  this.bundles.set(t, r);
2426
- for (const o of r.embeddedPaths()) {
2427
- const s = T(t, o);
2615
+ for (const i of r.embeddedPaths()) {
2616
+ const s = I(t, i);
2428
2617
  this.loadBundles(s);
2429
2618
  }
2430
2619
  }
2431
2620
  async processExternalEvent(e, t) {
2432
- const n = Jr(this.runtime.blue(), t);
2621
+ const n = So(this.runtime.blue(), t);
2433
2622
  await this.processPreparedExternalEvent(e, n);
2434
2623
  }
2435
2624
  async processPreparedExternalEvent(e, t) {
2436
- const n = k(e);
2625
+ const n = b(e);
2437
2626
  if (this.hooks.isScopeInactive(n))
2438
2627
  return;
2439
2628
  this.runtime.gasMeter().chargeScopeEntry(n);
2440
2629
  const r = await this.processEmbeddedChildren(n, t);
2441
2630
  if (!r)
2442
2631
  return;
2443
- const o = r.channelsOfType();
2444
- if (o.length === 0) {
2632
+ const i = r.channelsOfType();
2633
+ if (i.length === 0) {
2445
2634
  this.finalizeScope(n, r);
2446
2635
  return;
2447
2636
  }
2448
- for (const s of o) {
2637
+ for (const s of i) {
2449
2638
  if (this.hooks.isScopeInactive(n))
2450
2639
  break;
2451
2640
  this.isProcessorManagedChannel(s) || await this.channelRunner.runExternalChannel(
@@ -2466,13 +2655,13 @@ class ti {
2466
2655
  n,
2467
2656
  r
2468
2657
  );
2469
- } catch (o) {
2470
- if (o instanceof F) {
2471
- const s = this.hooks.fatalReason(o, "Boundary violation");
2658
+ } catch (i) {
2659
+ if (i instanceof H) {
2660
+ const s = this.hooks.fatalReason(i, "Boundary violation");
2472
2661
  await this.hooks.enterFatalTermination(e, t, s);
2473
2662
  return;
2474
2663
  }
2475
- throw o;
2664
+ throw i;
2476
2665
  }
2477
2666
  try {
2478
2667
  switch (n.op) {
@@ -2486,24 +2675,24 @@ class ti {
2486
2675
  default:
2487
2676
  break;
2488
2677
  }
2489
- const o = this.runtime.applyPatch(e, n);
2490
- if (!o)
2678
+ const i = this.runtime.applyPatch(e, n);
2679
+ if (!i)
2491
2680
  return;
2492
- await this.markCutOffChildrenIfNeeded(e, t, o), this.runtime.gasMeter().chargeCascadeRouting(o.cascadeScopes.length);
2493
- for (const s of o.cascadeScopes) {
2681
+ await this.markCutOffChildrenIfNeeded(e, t, i), this.runtime.gasMeter().chargeCascadeRouting(i.cascadeScopes.length);
2682
+ for (const s of i.cascadeScopes) {
2494
2683
  const a = this.bundles.get(s);
2495
2684
  if (!a || this.hooks.isScopeInactive(s))
2496
2685
  continue;
2497
- const c = this.createDocumentUpdateEvent(o, s), u = this.channelsMatching(
2686
+ const c = this.createDocumentUpdateEvent(i, s), u = this.channelsMatching(
2498
2687
  a,
2499
- Qr
2688
+ wo
2500
2689
  );
2501
2690
  for (const h of u) {
2502
2691
  const d = h.contract();
2503
2692
  if (this.matchesDocumentUpdate(
2504
2693
  s,
2505
2694
  d.path ?? null,
2506
- o.path
2695
+ i.path
2507
2696
  ) && (await this.channelRunner.runHandlers(
2508
2697
  s,
2509
2698
  a,
@@ -2514,29 +2703,29 @@ class ti {
2514
2703
  break;
2515
2704
  }
2516
2705
  }
2517
- } catch (o) {
2518
- if (o instanceof F) {
2519
- const s = this.hooks.fatalReason(o, "Boundary violation");
2706
+ } catch (i) {
2707
+ if (i instanceof H) {
2708
+ const s = this.hooks.fatalReason(i, "Boundary violation");
2520
2709
  await this.hooks.enterFatalTermination(e, t, s);
2521
2710
  return;
2522
2711
  }
2523
- if (o instanceof U || o instanceof Error && !(o instanceof y)) {
2524
- const s = this.hooks.fatalReason(o, "Runtime fatal");
2712
+ if (i instanceof $ || i instanceof Error && !(i instanceof y)) {
2713
+ const s = this.hooks.fatalReason(i, "Runtime fatal");
2525
2714
  await this.hooks.enterFatalTermination(e, t, s);
2526
2715
  return;
2527
2716
  }
2528
- throw o;
2717
+ throw i;
2529
2718
  }
2530
2719
  }
2531
2720
  }
2532
2721
  async deliverLifecycle(e, t, n, r) {
2533
2722
  if (this.runtime.gasMeter().chargeLifecycleDelivery(), await this.hooks.recordLifecycleForBridging(e, n), !t)
2534
2723
  return;
2535
- const o = this.channelsMatching(
2724
+ const i = this.channelsMatching(
2536
2725
  t,
2537
- Yr
2726
+ To
2538
2727
  );
2539
- for (const s of o)
2728
+ for (const s of i)
2540
2729
  if (await this.channelRunner.runHandlers(
2541
2730
  e,
2542
2731
  t,
@@ -2548,24 +2737,24 @@ class ti {
2548
2737
  r && await this.finalizeScope(e, t);
2549
2738
  }
2550
2739
  async processEmbeddedChildren(e, t) {
2551
- const n = k(e), r = /* @__PURE__ */ new Set();
2552
- let o = this.refreshBundle(n);
2553
- for (; o; ) {
2554
- const s = this.nextEmbeddedPath(o, r);
2740
+ const n = b(e), r = /* @__PURE__ */ new Set();
2741
+ let i = this.refreshBundle(n);
2742
+ for (; i; ) {
2743
+ const s = this.nextEmbeddedPath(i, r);
2555
2744
  if (!s)
2556
- return o;
2745
+ return i;
2557
2746
  r.add(s);
2558
- const a = T(n, s);
2747
+ const a = I(n, s);
2559
2748
  if (a === n || this.hooks.isScopeInactive(a)) {
2560
- o = this.refreshBundle(n);
2749
+ i = this.refreshBundle(n);
2561
2750
  continue;
2562
2751
  }
2563
- this.nodeAt(a) && (await this.initializeScope(a, !1), await this.processPreparedExternalEvent(a, t)), o = this.refreshBundle(n);
2752
+ this.nodeAt(a) && (await this.initializeScope(a, !1), await this.processPreparedExternalEvent(a, t)), i = this.refreshBundle(n);
2564
2753
  }
2565
2754
  return null;
2566
2755
  }
2567
2756
  refreshBundle(e) {
2568
- const t = k(e), n = this.nodeAt(t);
2757
+ const t = b(e), n = this.nodeAt(t);
2569
2758
  if (!n)
2570
2759
  return this.bundles.delete(t), null;
2571
2760
  const r = this.loadBundle(n, t);
@@ -2583,7 +2772,7 @@ class ti {
2583
2772
  try {
2584
2773
  return this.contractLoader.load(e, t);
2585
2774
  } catch (n) {
2586
- if (n instanceof y || n instanceof z)
2775
+ if (n instanceof y || n instanceof x)
2587
2776
  throw n;
2588
2777
  const r = n?.message ?? "Failed to load contracts";
2589
2778
  throw new y(
@@ -2596,7 +2785,7 @@ class ti {
2596
2785
  }
2597
2786
  }
2598
2787
  async addInitializationMarker(e, t) {
2599
- const n = new p().setType(new p().setBlueId(ze)).addProperty("documentId", new p().setValue(t)), r = e.resolvePointer(pe);
2788
+ const n = new p().setType(new p().setBlueId(We)).addProperty("documentId", new p().setValue(t)), r = e.resolvePointer(fe);
2600
2789
  await e.applyPatch({
2601
2790
  op: "ADD",
2602
2791
  path: r,
@@ -2611,17 +2800,17 @@ class ti {
2611
2800
  return;
2612
2801
  const n = this.channelsMatching(
2613
2802
  t,
2614
- Xr
2803
+ bo
2615
2804
  );
2616
2805
  if (n.length !== 0)
2617
2806
  for (const r of t.embeddedPaths()) {
2618
- const o = T(e, r), a = this.runtime.scope(o).drainBridgeableEvents();
2807
+ const i = I(e, r), a = this.runtime.scope(i).drainBridgeableEvents();
2619
2808
  if (a.length !== 0)
2620
2809
  for (const c of a) {
2621
2810
  let u = !1;
2622
2811
  for (const h of n) {
2623
- const v = h.contract().childPath ?? "/";
2624
- T(e, v) === o && (u || (this.runtime.gasMeter().chargeBridge(), u = !0), await this.channelRunner.runHandlers(
2812
+ const w = h.contract().childPath ?? "/";
2813
+ I(e, w) === i && (u || (this.runtime.gasMeter().chargeBridge(), u = !0), await this.channelRunner.runHandlers(
2625
2814
  e,
2626
2815
  t,
2627
2816
  h.key(),
@@ -2637,15 +2826,15 @@ class ti {
2637
2826
  return;
2638
2827
  const n = this.runtime.scope(e), r = this.channelsMatching(
2639
2828
  t,
2640
- Zr
2829
+ ko
2641
2830
  );
2642
2831
  if (r.length === 0) {
2643
2832
  n.clearTriggered();
2644
2833
  return;
2645
2834
  }
2646
2835
  for (; !n.triggeredIsEmpty(); ) {
2647
- const o = n.pollTriggered();
2648
- if (!o)
2836
+ const i = n.pollTriggered();
2837
+ if (!i)
2649
2838
  break;
2650
2839
  this.runtime.gasMeter().chargeDrainEvent();
2651
2840
  for (const s of r) {
@@ -2657,7 +2846,7 @@ class ti {
2657
2846
  e,
2658
2847
  t,
2659
2848
  s.key(),
2660
- o.clone(),
2849
+ i.clone(),
2661
2850
  !1
2662
2851
  ), this.hooks.isScopeInactive(e)) {
2663
2852
  n.clearTriggered();
@@ -2671,46 +2860,46 @@ class ti {
2671
2860
  return e.channelsOfType();
2672
2861
  const n = this.runtime.blue();
2673
2862
  return e.channelsOfType().filter((r) => {
2674
- const o = r.node();
2675
- return t.some((s) => n.isTypeOfBlueId(o, s));
2863
+ const i = r.node();
2864
+ return t.some((s) => n.isTypeOfBlueId(i, s));
2676
2865
  });
2677
2866
  }
2678
2867
  isProcessorManagedChannel(e) {
2679
2868
  const t = this.runtime.blue(), n = e.node();
2680
- for (const r of Ce)
2869
+ for (const r of ve)
2681
2870
  if (t.isTypeOfBlueId(n, r))
2682
2871
  return !0;
2683
2872
  return !1;
2684
2873
  }
2685
2874
  validatePatchBoundary(e, t, n) {
2686
- const r = k(e), o = P(n.path);
2687
- if (o === r)
2688
- throw new F(
2875
+ const r = b(e), i = P(n.path);
2876
+ if (i === r)
2877
+ throw new H(
2689
2878
  `Self-root mutation is forbidden at scope ${r}`
2690
2879
  );
2691
- if (r !== "/" && !o.startsWith(`${r}/`))
2692
- throw new F(
2693
- `Patch path ${o} is outside scope ${r}`
2880
+ if (r !== "/" && !i.startsWith(`${r}/`))
2881
+ throw new H(
2882
+ `Patch path ${i} is outside scope ${r}`
2694
2883
  );
2695
2884
  for (const s of t.embeddedPaths()) {
2696
- const a = T(r, s);
2697
- if (o.startsWith(`${a}/`))
2698
- throw new F(
2699
- `Boundary violation: patch ${o} enters embedded scope ${a}`
2885
+ const a = I(r, s);
2886
+ if (i.startsWith(`${a}/`))
2887
+ throw new H(
2888
+ `Boundary violation: patch ${i} enters embedded scope ${a}`
2700
2889
  );
2701
2890
  }
2702
2891
  }
2703
2892
  enforceReservedKeyWriteProtection(e, t, n) {
2704
2893
  if (n)
2705
2894
  return;
2706
- const r = k(e), o = P(t.path);
2895
+ const r = b(e), i = P(t.path);
2707
2896
  for (const s of ye) {
2708
- const a = T(
2897
+ const a = I(
2709
2898
  r,
2710
- ie(s)
2899
+ oe(s)
2711
2900
  );
2712
- if (o === a || o.startsWith(`${a}/`))
2713
- throw new F(
2901
+ if (i === a || i.startsWith(`${a}/`))
2902
+ throw new H(
2714
2903
  `Reserved key '${s}' is write-protected at ${a}`
2715
2904
  );
2716
2905
  }
@@ -2719,27 +2908,27 @@ class ti {
2719
2908
  if (t.embeddedPaths().length === 0)
2720
2909
  return;
2721
2910
  const r = P(n.path);
2722
- for (const o of t.embeddedPaths()) {
2723
- const s = T(e, o);
2911
+ for (const i of t.embeddedPaths()) {
2912
+ const s = I(e, i);
2724
2913
  r === s && (n.op === "remove" || n.op === "replace") && await this.hooks.markCutOff(s);
2725
2914
  }
2726
2915
  }
2727
2916
  hasInitializationMarker(e) {
2728
- const t = T(e, pe), n = this.nodeAt(t);
2917
+ const t = I(e, fe), n = this.nodeAt(t);
2729
2918
  if (!n)
2730
2919
  return !1;
2731
2920
  if (!(n instanceof p)) {
2732
- const o = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
2733
- throw new U(o);
2921
+ const i = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
2922
+ throw new $(i);
2734
2923
  }
2735
- if (n.getType()?.getBlueId() !== ze) {
2736
- const o = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
2737
- throw new U(o);
2924
+ if (n.getType()?.getBlueId() !== We) {
2925
+ const i = `Reserved key 'initialized' must contain a Processing Initialized Marker at ${t}`;
2926
+ throw new $(i);
2738
2927
  }
2739
2928
  return !0;
2740
2929
  }
2741
2930
  createLifecycleEvent(e) {
2742
- return new p().setType(new p().setBlueId(ei)).setProperties({
2931
+ return new p().setType(new p().setBlueId(Io)).setProperties({
2743
2932
  type: new p().setValue("Core/Document Processing Initiated"),
2744
2933
  documentId: new p().setValue(e)
2745
2934
  });
@@ -2752,95 +2941,95 @@ class ne extends Error {
2752
2941
  ), this.fatal = e, this.name = "RunTerminationError";
2753
2942
  }
2754
2943
  }
2755
- const ni = m["Core/Processing Terminated Marker"], ri = m["Core/Document Processing Terminated"];
2756
- class ii {
2944
+ const Ro = m["Core/Processing Terminated Marker"], Ao = m["Core/Document Processing Terminated"];
2945
+ class Mo {
2757
2946
  constructor(e) {
2758
2947
  this.runtime = e;
2759
2948
  }
2760
- async terminateScope(e, t, n, r, o) {
2761
- e.recordPendingTermination(t, r, o ?? null);
2762
- const s = e.normalizeScope(t), a = T(s, Je);
2949
+ async terminateScope(e, t, n, r, i) {
2950
+ e.recordPendingTermination(t, r, i ?? null);
2951
+ const s = e.normalizeScope(t), a = I(s, Qe);
2763
2952
  this.runtime.directWrite(
2764
2953
  a,
2765
- oi(this.runtime.blue(), r, o)
2954
+ No(this.runtime.blue(), r, i)
2766
2955
  ), this.runtime.gasMeter().chargeTerminationMarker();
2767
- const c = n ?? e.bundleForScope(s) ?? null, u = si(r, o);
2956
+ const c = n ?? e.bundleForScope(s) ?? null, u = Oo(r, i);
2768
2957
  if (await e.deliverLifecycle(
2769
2958
  s,
2770
2959
  c,
2771
2960
  u,
2772
2961
  !1
2773
- ), this.runtime.scope(s).finalizeTermination(r, o ?? null), e.clearPendingTermination(t), r === "FATAL" && this.runtime.gasMeter().chargeFatalTerminationOverhead(), r === "FATAL" && s === "/")
2962
+ ), this.runtime.scope(s).finalizeTermination(r, i ?? null), e.clearPendingTermination(t), r === "FATAL" && this.runtime.gasMeter().chargeFatalTerminationOverhead(), r === "FATAL" && s === "/")
2774
2963
  throw this.runtime.markRunTerminated(), new ne(!0);
2775
2964
  if (r === "GRACEFUL" && s === "/")
2776
2965
  throw this.runtime.markRunTerminated(), new ne(!1);
2777
2966
  }
2778
2967
  }
2779
- function oi(i, e, t) {
2780
- return ai(i, {
2781
- type: { blueId: ni },
2968
+ function No(o, e, t) {
2969
+ return Do(o, {
2970
+ type: { blueId: Ro },
2782
2971
  cause: e === "GRACEFUL" ? "graceful" : "fatal",
2783
2972
  ...t ? { reason: t } : {}
2784
2973
  });
2785
2974
  }
2786
- function si(i, e) {
2975
+ function Oo(o, e) {
2787
2976
  const t = new p().setType(
2788
- new p().setBlueId(ri)
2977
+ new p().setBlueId(Ao)
2789
2978
  );
2790
2979
  return t.addProperty(
2791
2980
  "cause",
2792
- new p().setValue(i === "GRACEFUL" ? "graceful" : "fatal")
2981
+ new p().setValue(o === "GRACEFUL" ? "graceful" : "fatal")
2793
2982
  ), e && t.addProperty("reason", new p().setValue(e)), t;
2794
2983
  }
2795
- function ai(i, e) {
2796
- return i.jsonValueToNode(e);
2984
+ function Do(o, e) {
2985
+ return o.jsonValueToNode(e);
2797
2986
  }
2798
2987
  const j = "-";
2799
- class ci {
2988
+ class Bo {
2800
2989
  constructor(e) {
2801
2990
  this.document = e;
2802
2991
  }
2803
2992
  applyPatch(e, t) {
2804
- const n = k(e), r = P(t.path), o = Ve(r), s = He(this.document, o, "before", r);
2993
+ const n = b(e), r = P(t.path), i = qe(r), s = Ke(this.document, i, "before", r);
2805
2994
  switch (t.op) {
2806
2995
  case "ADD":
2807
- this.applyAdd(o, r, t.val ?? null);
2996
+ this.applyAdd(i, r, t.val ?? null);
2808
2997
  break;
2809
2998
  case "REPLACE":
2810
- this.applyReplace(o, r, t.val ?? null);
2999
+ this.applyReplace(i, r, t.val ?? null);
2811
3000
  break;
2812
3001
  case "REMOVE":
2813
- this.applyRemove(o, r);
3002
+ this.applyRemove(i, r);
2814
3003
  break;
2815
3004
  }
2816
- const a = t.op === "REMOVE" ? null : He(this.document, o, "after", r);
3005
+ const a = t.op === "REMOVE" ? null : Ke(this.document, i, "after", r);
2817
3006
  return {
2818
3007
  path: r,
2819
3008
  before: s,
2820
3009
  after: a,
2821
3010
  op: t.op.toLowerCase(),
2822
3011
  originScope: n,
2823
- cascadeScopes: li(n)
3012
+ cascadeScopes: Lo(n)
2824
3013
  };
2825
3014
  }
2826
3015
  directWrite(e, t) {
2827
3016
  const n = P(e);
2828
3017
  if (n === "/")
2829
3018
  throw new Error("Direct write cannot target root document");
2830
- const r = Ve(n), { parent: o, leaf: s } = this.resolveParent(r);
3019
+ const r = qe(n), { parent: i, leaf: s } = this.resolveParent(r);
2831
3020
  if (s === j)
2832
3021
  throw new Error(
2833
3022
  `Direct write does not support append token '-' for path ${n}`
2834
3023
  );
2835
- const a = o.getItems();
2836
- if (a && $(s)) {
2837
- this.directWriteArray(o, a, s, t, n);
3024
+ const a = i.getItems();
3025
+ if (a && z(s)) {
3026
+ this.directWriteArray(i, a, s, t, n);
2838
3027
  return;
2839
3028
  }
2840
- this.directWriteObject(o, s, t);
3029
+ this.directWriteObject(i, s, t);
2841
3030
  }
2842
- directWriteArray(e, t, n, r, o) {
2843
- const s = he(e, t), a = x(n, o);
3031
+ directWriteArray(e, t, n, r, i) {
3032
+ const s = de(e, t), a = L(n, i);
2844
3033
  if (r == null) {
2845
3034
  if (a < 0 || a >= s.length)
2846
3035
  return;
@@ -2857,7 +3046,7 @@ class ci {
2857
3046
  return;
2858
3047
  }
2859
3048
  throw new Error(
2860
- `Array index out of bounds for direct write: ${o}`
3049
+ `Array index out of bounds for direct write: ${i}`
2861
3050
  );
2862
3051
  }
2863
3052
  directWriteObject(e, t, n) {
@@ -2883,19 +3072,19 @@ class ci {
2883
3072
  getOrCreateChild(e, t, n, r) {
2884
3073
  if (t === j)
2885
3074
  throw new Error(
2886
- `Append token '-' must be final segment: ${G(n, r)}`
3075
+ `Append token '-' must be final segment: ${q(n, r)}`
2887
3076
  );
2888
- const o = e.getItems();
2889
- if (o && $(t)) {
2890
- const c = x(t, G(n, r));
2891
- if (c < 0 || c >= o.length)
3077
+ const i = e.getItems();
3078
+ if (i && z(t)) {
3079
+ const c = L(t, q(n, r));
3080
+ if (c < 0 || c >= i.length)
2892
3081
  throw new Error(
2893
- `Array index out of bounds: ${G(n, r)}`
3082
+ `Array index out of bounds: ${q(n, r)}`
2894
3083
  );
2895
- const u = o[c];
3084
+ const u = i[c];
2896
3085
  if (!u)
2897
3086
  throw new Error(
2898
- `Path does not exist: ${G(n, r)}`
3087
+ `Path does not exist: ${q(n, r)}`
2899
3088
  );
2900
3089
  return u;
2901
3090
  }
@@ -2906,30 +3095,30 @@ class ci {
2906
3095
  applyAdd(e, t, n) {
2907
3096
  if (t === "/" || t.length === 0)
2908
3097
  throw new Error("ADD operation cannot target document root");
2909
- const { parent: r, key: o, pointer: s, created: a } = this.resolveParentForPatch(
3098
+ const { parent: r, key: i, pointer: s, created: a } = this.resolveParentForPatch(
2910
3099
  e,
2911
3100
  t,
2912
3101
  "ADD"
2913
3102
  );
2914
3103
  try {
2915
- if ($(o)) {
2916
- const u = r.getItems(), h = o === j;
3104
+ if (z(i)) {
3105
+ const u = r.getItems(), h = i === j;
2917
3106
  if (!u)
2918
3107
  throw new Error(
2919
3108
  h ? `Append token '-' requires array at ${s}` : `Array index segment requires array at ${s}`
2920
3109
  );
2921
3110
  if (h) {
2922
- he(r, u).push(q(n));
3111
+ de(r, u).push(G(n));
2923
3112
  return;
2924
3113
  }
2925
- const d = x(o, t);
3114
+ const d = L(i, t);
2926
3115
  if (d < 0 || d > u.length)
2927
3116
  throw new Error(`Array index out of bounds in path: ${t}`);
2928
- he(r, u).splice(d, 0, q(n));
3117
+ de(r, u).splice(d, 0, G(n));
2929
3118
  return;
2930
3119
  }
2931
3120
  const c = X(r);
2932
- c[o] = q(n), r.setProperties(c);
3121
+ c[i] = G(n), r.setProperties(c);
2933
3122
  } catch (c) {
2934
3123
  throw this.rollbackCreated(a), c;
2935
3124
  }
@@ -2937,24 +3126,24 @@ class ci {
2937
3126
  applyReplace(e, t, n) {
2938
3127
  if (t === "/" || t.length === 0)
2939
3128
  throw new Error("REPLACE operation cannot target document root");
2940
- const { parent: r, key: o, created: s } = this.resolveParentForPatch(
3129
+ const { parent: r, key: i, created: s } = this.resolveParentForPatch(
2941
3130
  e,
2942
3131
  t,
2943
3132
  "REPLACE"
2944
3133
  );
2945
3134
  try {
2946
- if ($(o)) {
3135
+ if (z(i)) {
2947
3136
  const c = r.getItems();
2948
3137
  if (!c)
2949
3138
  throw new Error(`Array index segment requires array at ${t}`);
2950
- const u = x(o, t);
3139
+ const u = L(i, t);
2951
3140
  if (u < 0 || u >= c.length)
2952
3141
  throw new Error(`Array index out of bounds in path: ${t}`);
2953
- c[u] = q(n), r.setItems(c);
3142
+ c[u] = G(n), r.setItems(c);
2954
3143
  return;
2955
3144
  }
2956
3145
  const a = X(r);
2957
- a[o] = q(n), r.setProperties(a);
3146
+ a[i] = G(n), r.setProperties(a);
2958
3147
  } catch (a) {
2959
3148
  throw this.rollbackCreated(s), a;
2960
3149
  }
@@ -2967,37 +3156,37 @@ class ci {
2967
3156
  t,
2968
3157
  "REMOVE"
2969
3158
  );
2970
- if ($(r)) {
3159
+ if (z(r)) {
2971
3160
  const a = n.getItems();
2972
3161
  if (!a)
2973
3162
  throw new Error(`Array index segment requires array at ${t}`);
2974
- const c = x(r, t);
3163
+ const c = L(r, t);
2975
3164
  if (c < 0 || c >= a.length)
2976
3165
  throw new Error(`Array index out of bounds in path: ${t}`);
2977
3166
  a.splice(c, 1), n.setItems(a);
2978
3167
  return;
2979
3168
  }
2980
- const o = n.getProperties();
2981
- if (!o || !Object.prototype.hasOwnProperty.call(o, r))
3169
+ const i = n.getProperties();
3170
+ if (!i || !Object.prototype.hasOwnProperty.call(i, r))
2982
3171
  throw new Error(`Path does not exist: ${t}`);
2983
- const s = { ...o };
3172
+ const s = { ...i };
2984
3173
  delete s[r], n.setProperties(s);
2985
3174
  }
2986
3175
  resolveParentForPatch(e, t, n) {
2987
3176
  if (e.length === 0)
2988
3177
  throw new Error(`${n} operation cannot target document root`);
2989
3178
  let r = this.document;
2990
- const o = [];
3179
+ const i = [];
2991
3180
  for (let a = 0; a < e.length - 1; a += 1) {
2992
- const c = e[a], u = G(e, a + 1);
2993
- if ($(c)) {
2994
- const v = r.getItems();
2995
- if (!v)
3181
+ const c = e[a], u = q(e, a + 1);
3182
+ if (z(c)) {
3183
+ const w = r.getItems();
3184
+ if (!w)
2996
3185
  throw new Error(`Array index segment requires array at ${u}`);
2997
- const f = x(c, u);
2998
- if (f < 0 || f >= v.length)
3186
+ const f = L(c, u);
3187
+ if (f < 0 || f >= w.length)
2999
3188
  throw new Error(`Array index out of bounds in path: ${u}`);
3000
- const E = v[f];
3189
+ const E = w[f];
3001
3190
  if (!(E instanceof p))
3002
3191
  throw new Error(`Array index out of bounds in path: ${u}`);
3003
3192
  r = E;
@@ -3007,110 +3196,110 @@ class ci {
3007
3196
  if (!(d instanceof p)) {
3008
3197
  if (n === "REMOVE")
3009
3198
  throw new Error(`Path does not exist: ${u}`);
3010
- d = new p(), h || (h = {}), h[c] = d, r.setProperties(h), o.push({ owner: r, key: c });
3199
+ d = new p(), h || (h = {}), h[c] = d, r.setProperties(h), i.push({ owner: r, key: c });
3011
3200
  }
3012
3201
  r = d;
3013
3202
  }
3014
3203
  const s = e[e.length - 1];
3015
- return { parent: r, key: s, pointer: t, created: o };
3204
+ return { parent: r, key: s, pointer: t, created: i };
3016
3205
  }
3017
3206
  rollbackCreated(e) {
3018
3207
  for (let t = e.length - 1; t >= 0; t -= 1) {
3019
- const { owner: n, key: r } = e[t], o = n.getProperties();
3020
- o && (delete o[r], Object.keys(o).length === 0 ? n.setProperties(void 0) : n.setProperties(o));
3208
+ const { owner: n, key: r } = e[t], i = n.getProperties();
3209
+ i && (delete i[r], Object.keys(i).length === 0 ? n.setProperties(void 0) : n.setProperties(i));
3021
3210
  }
3022
3211
  }
3023
3212
  }
3024
- function li(i) {
3213
+ function Lo(o) {
3025
3214
  const e = [];
3026
- let t = i;
3215
+ let t = o;
3027
3216
  for (; e.push(t), t !== "/"; ) {
3028
3217
  const n = t.lastIndexOf("/");
3029
3218
  t = n <= 0 ? "/" : t.substring(0, n);
3030
3219
  }
3031
3220
  return e;
3032
3221
  }
3033
- function He(i, e, t, n) {
3222
+ function Ke(o, e, t, n) {
3034
3223
  try {
3035
3224
  if (e.length === 0)
3036
- return i.clone();
3037
- const r = ui(i, e, t, n);
3225
+ return o.clone();
3226
+ const r = xo(o, e, t, n);
3038
3227
  return r ? r.clone() : null;
3039
3228
  } catch {
3040
3229
  return null;
3041
3230
  }
3042
3231
  }
3043
- function ui(i, e, t, n) {
3044
- let r = i;
3045
- for (let o = 0; o < e.length; o += 1) {
3046
- const s = e[o] ?? "", a = o === e.length - 1;
3047
- if (r = hi(r, s, a, t, n), !r)
3232
+ function xo(o, e, t, n) {
3233
+ let r = o;
3234
+ for (let i = 0; i < e.length; i += 1) {
3235
+ const s = e[i] ?? "", a = i === e.length - 1;
3236
+ if (r = _o(r, s, a, t, n), !r)
3048
3237
  return null;
3049
3238
  }
3050
3239
  return r;
3051
3240
  }
3052
- function hi(i, e, t, n, r) {
3053
- if (!i)
3241
+ function _o(o, e, t, n, r) {
3242
+ if (!o)
3054
3243
  return null;
3055
- const o = i.getItems();
3056
- if (o) {
3244
+ const i = o.getItems();
3245
+ if (i) {
3057
3246
  if (e === j) {
3058
3247
  if (!t)
3059
3248
  throw new Error(`Append token '-' must be final segment: ${r}`);
3060
- return n === "before" || o.length === 0 ? null : o[o.length - 1] ?? null;
3249
+ return n === "before" || i.length === 0 ? null : i[i.length - 1] ?? null;
3061
3250
  }
3062
- const c = x(e, r);
3063
- return c < 0 || c >= o.length ? null : o[c] ?? null;
3251
+ const c = L(e, r);
3252
+ return c < 0 || c >= i.length ? null : i[c] ?? null;
3064
3253
  }
3065
- const s = i.getProperties();
3254
+ const s = o.getProperties();
3066
3255
  if (!s)
3067
3256
  return null;
3068
3257
  const a = s[e];
3069
3258
  return a instanceof p ? a : null;
3070
3259
  }
3071
- function Ve(i) {
3072
- if (i === "/" || i === "")
3260
+ function qe(o) {
3261
+ if (o === "/" || o === "")
3073
3262
  return [];
3074
- const e = i.startsWith("/") ? i.slice(1) : i;
3263
+ const e = o.startsWith("/") ? o.slice(1) : o;
3075
3264
  return e.length === 0 ? [] : e.split("/");
3076
3265
  }
3077
- function x(i, e) {
3078
- const t = Number.parseInt(i, 10);
3266
+ function L(o, e) {
3267
+ const t = Number.parseInt(o, 10);
3079
3268
  if (Number.isNaN(t))
3080
3269
  throw new Error(`Expected numeric array index in path: ${e}`);
3081
3270
  if (t < 0)
3082
3271
  throw new Error(`Negative array index in path: ${e}`);
3083
3272
  return t;
3084
3273
  }
3085
- function G(i, e) {
3274
+ function q(o, e) {
3086
3275
  if (e <= 0)
3087
3276
  return "/";
3088
- const t = Math.min(e, i.length);
3277
+ const t = Math.min(e, o.length);
3089
3278
  let n = "";
3090
3279
  for (let r = 0; r < t; r += 1)
3091
- n += `/${i[r] ?? ""}`;
3280
+ n += `/${o[r] ?? ""}`;
3092
3281
  return n === "" ? "/" : n;
3093
3282
  }
3094
- function he(i, e) {
3283
+ function de(o, e) {
3095
3284
  const t = [...e];
3096
- return i.setItems(t), t;
3285
+ return o.setItems(t), t;
3097
3286
  }
3098
- function X(i) {
3099
- const e = i.getProperties();
3287
+ function X(o) {
3288
+ const e = o.getProperties();
3100
3289
  if (!e) {
3101
3290
  const n = {};
3102
- return i.setProperties(n), n;
3291
+ return o.setProperties(n), n;
3103
3292
  }
3104
3293
  const t = { ...e };
3105
- return i.setProperties(t), t;
3294
+ return o.setProperties(t), t;
3106
3295
  }
3107
- function $(i) {
3108
- return i === j || /^\d+$/.test(i);
3296
+ function z(o) {
3297
+ return o === j || /^\d+$/.test(o);
3109
3298
  }
3110
- function q(i) {
3111
- return i == null ? new p().setValue(null) : i.clone();
3299
+ function G(o) {
3300
+ return o == null ? new p().setValue(null) : o.clone();
3112
3301
  }
3113
- class di {
3302
+ class Fo {
3114
3303
  constructor(e) {
3115
3304
  this.path = e;
3116
3305
  }
@@ -3172,7 +3361,7 @@ class di {
3172
3361
  return this.cutOff;
3173
3362
  }
3174
3363
  }
3175
- class pi {
3364
+ class Uo {
3176
3365
  scopesMap = /* @__PURE__ */ new Map();
3177
3366
  rootEmissionList = [];
3178
3367
  scopes() {
@@ -3180,7 +3369,7 @@ class pi {
3180
3369
  }
3181
3370
  scope(e) {
3182
3371
  let t = this.scopesMap.get(e);
3183
- return t || (t = new di(e), this.scopesMap.set(e, t)), t;
3372
+ return t || (t = new Fo(e), this.scopesMap.set(e, t)), t;
3184
3373
  }
3185
3374
  existingScope(e) {
3186
3375
  return this.scopesMap.get(e);
@@ -3198,33 +3387,33 @@ class pi {
3198
3387
  this.scopesMap.delete(e);
3199
3388
  }
3200
3389
  }
3201
- function Ct(i) {
3202
- return Math.floor((i + 99) / 100);
3390
+ function Pt(o) {
3391
+ return Math.floor((o + 99) / 100);
3203
3392
  }
3204
- function fi(i) {
3205
- const e = P(i);
3393
+ function Ho(o) {
3394
+ const e = P(o);
3206
3395
  return e === "/" ? 0 : e.split("/").length - 1;
3207
3396
  }
3208
- function mi(i) {
3209
- return 40 + 5 * Math.max(0, i);
3397
+ function zo(o) {
3398
+ return 40 + 5 * Math.max(0, o);
3210
3399
  }
3211
- function gi(i, e) {
3212
- return 8 + fi(i) + Ct(e);
3400
+ function $o(o, e) {
3401
+ return 8 + Ho(o) + Pt(e);
3213
3402
  }
3214
- const Ei = 1e3, yi = 5, Ci = 50, Si = 2, vi = 10, wi = 10, ki = 10, bi = 20, Ii = 20, Ti = 30, Pi = 30, Mi = 100;
3215
- function Ri(i) {
3216
- return 50 + 10 * i;
3403
+ const Vo = 1e3, Wo = 5, Ko = 50, qo = 2, Go = 10, jo = 10, Yo = 10, Jo = 20, Xo = 20, Qo = 30, Zo = 30, ei = 100;
3404
+ function ti(o) {
3405
+ return 50 + 10 * o;
3217
3406
  }
3218
- function Ni(i) {
3219
- return 20 + i;
3407
+ function ni(o) {
3408
+ return 20 + o;
3220
3409
  }
3221
- function Oi(i) {
3222
- return 10 * i;
3410
+ function ri(o) {
3411
+ return 10 * o;
3223
3412
  }
3224
- function Ai(i) {
3225
- return 20 + i;
3413
+ function oi(o) {
3414
+ return 20 + o;
3226
3415
  }
3227
- class Di {
3416
+ class ii {
3228
3417
  constructor(e) {
3229
3418
  this.blue = e;
3230
3419
  }
@@ -3236,72 +3425,72 @@ class Di {
3236
3425
  this.total += e;
3237
3426
  }
3238
3427
  chargeScopeEntry(e) {
3239
- this.add(Ri(this.scopeDepth(e)));
3428
+ this.add(ti(this.scopeDepth(e)));
3240
3429
  }
3241
3430
  chargeInitialization() {
3242
- this.add(Ei);
3431
+ this.add(Vo);
3243
3432
  }
3244
3433
  chargeChannelMatchAttempt() {
3245
- this.add(yi);
3434
+ this.add(Wo);
3246
3435
  }
3247
3436
  chargeHandlerOverhead() {
3248
- this.add(Ci);
3437
+ this.add(Ko);
3249
3438
  }
3250
3439
  chargeBoundaryCheck() {
3251
- this.add(Si);
3440
+ this.add(qo);
3252
3441
  }
3253
3442
  chargePatchAddOrReplace(e) {
3254
- this.add(Ni(this.payloadSizeCharge(e)));
3443
+ this.add(ni(this.payloadSizeCharge(e)));
3255
3444
  }
3256
3445
  chargePatchRemove() {
3257
- this.add(vi);
3446
+ this.add(Go);
3258
3447
  }
3259
3448
  chargeCascadeRouting(e) {
3260
- e > 0 && this.add(Oi(e));
3449
+ e > 0 && this.add(ri(e));
3261
3450
  }
3262
3451
  chargeEmitEvent(e) {
3263
- this.add(Ai(this.payloadSizeCharge(e)));
3452
+ this.add(oi(this.payloadSizeCharge(e)));
3264
3453
  }
3265
3454
  chargeBridge() {
3266
- this.add(wi);
3455
+ this.add(jo);
3267
3456
  }
3268
3457
  chargeDrainEvent() {
3269
- this.add(ki);
3458
+ this.add(Yo);
3270
3459
  }
3271
3460
  chargeCheckpointUpdate() {
3272
- this.add(bi);
3461
+ this.add(Jo);
3273
3462
  }
3274
3463
  chargeTerminationMarker() {
3275
- this.add(Ii);
3464
+ this.add(Xo);
3276
3465
  }
3277
3466
  chargeLifecycleDelivery() {
3278
- this.add(Ti);
3467
+ this.add(Qo);
3279
3468
  }
3280
3469
  chargeFatalTerminationOverhead() {
3281
- this.add(Mi);
3470
+ this.add(ei);
3282
3471
  }
3283
3472
  chargeTriggerEventBase() {
3284
- this.add(Pi);
3473
+ this.add(Zo);
3285
3474
  }
3286
3475
  chargeUpdateDocumentBase(e) {
3287
- this.add(mi(e));
3476
+ this.add(zo(e));
3288
3477
  }
3289
3478
  chargeDocumentSnapshot(e, t) {
3290
3479
  const n = t ? Ne(this.blue, t) : 0;
3291
- this.add(gi(e, n));
3480
+ this.add($o(e, n));
3292
3481
  }
3293
3482
  chargeWasmGas(e) {
3294
- const t = Jt(e);
3483
+ const t = rn(e);
3295
3484
  t > 0 && this.add(t);
3296
3485
  }
3297
3486
  payloadSizeCharge(e) {
3298
3487
  if (!e)
3299
3488
  return 0;
3300
3489
  const t = Ne(this.blue, e);
3301
- return Ct(t);
3490
+ return Pt(t);
3302
3491
  }
3303
3492
  scopeDepth(e) {
3304
- const t = k(e);
3493
+ const t = b(e);
3305
3494
  if (t === "/" || t.length <= 1)
3306
3495
  return 0;
3307
3496
  let n = 1;
@@ -3310,12 +3499,12 @@ class Di {
3310
3499
  return n;
3311
3500
  }
3312
3501
  }
3313
- class Bi {
3502
+ class si {
3314
3503
  constructor(e, t) {
3315
- this.documentRef = e, this.blueRef = t, this.patchEngine = new ci(this.documentRef), this.meter = new Di(this.blueRef);
3504
+ this.documentRef = e, this.blueRef = t, this.patchEngine = new Bo(this.documentRef), this.meter = new ii(this.blueRef);
3316
3505
  }
3317
3506
  patchEngine;
3318
- emissionRegistry = new pi();
3507
+ emissionRegistry = new Uo();
3319
3508
  meter;
3320
3509
  runTerminated = !1;
3321
3510
  document() {
@@ -3364,15 +3553,15 @@ class Bi {
3364
3553
  return this.patchEngine.applyPatch(e, t);
3365
3554
  }
3366
3555
  }
3367
- const xi = m["Core/Processing Initialized Marker"], _i = m["Core/Document Update"];
3368
- class Li {
3556
+ const ai = m["Core/Processing Initialized Marker"], ci = m["Core/Document Update"];
3557
+ class li {
3369
3558
  constructor(e, t, n, r) {
3370
- this.contractLoader = e, this.registry = t, this.runtimeRef = new Bi(r, n);
3371
- const o = (s) => nt(this.runtimeRef.blue(), s);
3372
- this.checkpointManager = new qr(
3559
+ this.contractLoader = e, this.registry = t, this.runtimeRef = new si(r, n);
3560
+ const i = (s) => it(this.runtimeRef.blue(), s);
3561
+ this.checkpointManager = new yo(
3373
3562
  this.runtimeRef,
3374
- o
3375
- ), this.terminationService = new ii(this.runtimeRef), this.channelRunner = new jr(
3563
+ i
3564
+ ), this.terminationService = new Mo(this.runtimeRef), this.channelRunner = new vo(
3376
3565
  this.runtimeRef,
3377
3566
  this.checkpointManager,
3378
3567
  {
@@ -3399,10 +3588,10 @@ class Li {
3399
3588
  },
3400
3589
  executeHandler: async (s, a) => this.executeHandler(s, a),
3401
3590
  handleHandlerError: async (s, a, c) => this.handleHandlerError(s, a, c),
3402
- canonicalSignature: o,
3591
+ canonicalSignature: i,
3403
3592
  channelProcessorFor: (s) => this.lookupChannelProcessor(s)
3404
3593
  }
3405
- ), this.scopeExecutor = new ti({
3594
+ ), this.scopeExecutor = new Po({
3406
3595
  runtime: this.runtimeRef,
3407
3596
  contractLoader: this.contractLoader,
3408
3597
  channelRunner: this.channelRunner,
@@ -3452,19 +3641,19 @@ class Li {
3452
3641
  r
3453
3642
  );
3454
3643
  }
3455
- createContext(e, t, n, r = !1, o = !1) {
3456
- return new Fi(
3644
+ createContext(e, t, n, r = !1, i = !1) {
3645
+ return new ui(
3457
3646
  this,
3458
3647
  t,
3459
3648
  e,
3460
3649
  n.clone(),
3461
3650
  r,
3462
- o
3651
+ i
3463
3652
  );
3464
3653
  }
3465
3654
  result() {
3466
3655
  const e = this.runtimeRef.document().clone(), t = this.runtimeRef.rootEmissions().map((n) => n.clone());
3467
- return Ke.of(
3656
+ return Ge.of(
3468
3657
  e,
3469
3658
  t,
3470
3659
  this.runtimeRef.totalGas()
@@ -3474,10 +3663,10 @@ class Li {
3474
3663
  return this.runtimeRef;
3475
3664
  }
3476
3665
  bundleForScope(e) {
3477
- return this.bundles.get(k(e));
3666
+ return this.bundles.get(b(e));
3478
3667
  }
3479
3668
  isScopeInactive(e) {
3480
- const t = k(e);
3669
+ const t = b(e);
3481
3670
  return this.cutOffScopes.has(t) || this.pendingTerminations.has(t) || this.runtimeRef.isScopeTerminated(t);
3482
3671
  }
3483
3672
  async enterGracefulTermination(e, t, n) {
@@ -3487,13 +3676,13 @@ class Li {
3487
3676
  await this.terminate(e, t, "FATAL", n);
3488
3677
  }
3489
3678
  recordPendingTermination(e, t, n) {
3490
- this.pendingTerminations.set(k(e), { kind: t, reason: n });
3679
+ this.pendingTerminations.set(b(e), { kind: t, reason: n });
3491
3680
  }
3492
3681
  clearPendingTermination(e) {
3493
- this.pendingTerminations.delete(k(e));
3682
+ this.pendingTerminations.delete(b(e));
3494
3683
  }
3495
3684
  async markCutOff(e) {
3496
- const t = k(e);
3685
+ const t = b(e);
3497
3686
  this.cutOffScopes.add(t) && this.runtimeRef.existingScope(t)?.markCutOff();
3498
3687
  }
3499
3688
  async deliverLifecycle(e, t, n, r) {
@@ -3508,14 +3697,14 @@ class Li {
3508
3697
  this.runtimeRef.scope(e).recordBridgeable(t.clone()), e === "/" && this.runtimeRef.recordRootEmission(t.clone());
3509
3698
  }
3510
3699
  normalizeScope(e) {
3511
- return k(e);
3700
+ return b(e);
3512
3701
  }
3513
3702
  resolvePointer(e, t) {
3514
- return T(e, t);
3703
+ return I(e, t);
3515
3704
  }
3516
3705
  async terminate(e, t, n, r) {
3517
- const o = k(e);
3518
- this.pendingTerminations.has(o) || this.runtimeRef.isScopeTerminated(o) || (this.pendingTerminations.set(o, { kind: n, reason: r }), await this.terminationService.terminateScope(
3706
+ const i = b(e);
3707
+ this.pendingTerminations.has(i) || this.runtimeRef.isScopeTerminated(i) || (this.pendingTerminations.set(i, { kind: n, reason: r }), await this.terminationService.terminateScope(
3519
3708
  this,
3520
3709
  e,
3521
3710
  t,
@@ -3524,14 +3713,14 @@ class Li {
3524
3713
  ));
3525
3714
  }
3526
3715
  nodeAt(e) {
3527
- const t = k(e);
3716
+ const t = b(e);
3528
3717
  return re.nodeAt(this.runtimeRef.document(), t, {
3529
3718
  calculateBlueId: (n) => this.runtimeRef.blue().calculateBlueIdSync(n)
3530
3719
  });
3531
3720
  }
3532
3721
  async evaluateChannel(e, t, n, r) {
3533
- const o = this.lookupChannelProcessor(e.node());
3534
- if (!o)
3722
+ const i = this.lookupChannelProcessor(e.node());
3723
+ if (!i)
3535
3724
  return { matches: !1 };
3536
3725
  const s = this.runtimeRef.blue().calculateBlueIdSync(r), a = r.clone(), c = e.contract(), u = c.event;
3537
3726
  if (u && !this.runtimeRef.blue().isTypeOfNode(a, u))
@@ -3542,14 +3731,14 @@ class Li {
3542
3731
  event: a,
3543
3732
  markers: t.markers(),
3544
3733
  bindingKey: e.key(),
3545
- resolveChannel: (C) => t.channelEntry(C),
3546
- channelProcessorFor: (C) => this.lookupChannelProcessor(C)
3547
- }, d = o.evaluate;
3734
+ resolveChannel: (v) => t.channelEntry(v),
3735
+ channelProcessorFor: (v) => this.lookupChannelProcessor(v)
3736
+ }, d = i.evaluate;
3548
3737
  if (typeof d == "function")
3549
- return await d.call(o, c, h);
3550
- if (!await o.matches(c, h))
3738
+ return await d.call(i, c, h);
3739
+ if (!await i.matches(c, h))
3551
3740
  return { matches: !1 };
3552
- const f = o.channelize, E = f ? f.call(o, c, h) : void 0;
3741
+ const f = i.channelize, E = f ? f.call(i, c, h) : void 0;
3553
3742
  return {
3554
3743
  matches: !0,
3555
3744
  eventId: s,
@@ -3576,7 +3765,7 @@ class Li {
3576
3765
  * the outer run logic can react according to spec (§22).
3577
3766
  */
3578
3767
  async handleHandlerError(e, t, n) {
3579
- if (n instanceof ne || n instanceof z)
3768
+ if (n instanceof ne || n instanceof x)
3580
3769
  throw n;
3581
3770
  const r = this.fatalReason(n, "Runtime fatal");
3582
3771
  await this.enterFatalTermination(e, t, r);
@@ -3594,21 +3783,21 @@ class Li {
3594
3783
  return this.registry.lookupChannelForNode(this.runtimeRef.blue(), e) ?? null;
3595
3784
  }
3596
3785
  createDocumentUpdateEvent(e, t) {
3597
- 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(
3598
- new p().setBlueId(_i)
3786
+ 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(
3787
+ new p().setBlueId(ci)
3599
3788
  );
3600
3789
  return s.setProperties({
3601
3790
  op: new p().setValue(e.op),
3602
3791
  path: new p().setValue(n),
3603
3792
  before: r,
3604
- after: o
3793
+ after: i
3605
3794
  }), s;
3606
3795
  }
3607
3796
  matchesDocumentUpdate(e, t, n) {
3608
3797
  if (!t || t.length === 0)
3609
3798
  return !1;
3610
- const r = P(T(e, t)), o = P(n);
3611
- return r === "/" || o === r ? !0 : o.startsWith(`${r}/`);
3799
+ const r = P(I(e, t)), i = P(n);
3800
+ return r === "/" || i === r ? !0 : i.startsWith(`${r}/`);
3612
3801
  }
3613
3802
  }
3614
3803
  class re {
@@ -3617,7 +3806,7 @@ class re {
3617
3806
  }
3618
3807
  async initializeDocument(e) {
3619
3808
  if (this.isInitialized(e))
3620
- throw new U("Document already initialized");
3809
+ throw new $("Document already initialized");
3621
3810
  const t = this.createExecution(e.clone());
3622
3811
  return this.run(e, t, async () => {
3623
3812
  await t.initializeScope("/", !0);
@@ -3625,7 +3814,7 @@ class re {
3625
3814
  }
3626
3815
  async processDocument(e, t) {
3627
3816
  if (!this.isInitialized(e))
3628
- throw new U("Document not initialized");
3817
+ throw new $("Document not initialized");
3629
3818
  const n = this.createExecution(e.clone()), r = t.clone();
3630
3819
  return this.run(e, n, async () => {
3631
3820
  n.loadBundles("/"), await n.processExternalEvent("/", r);
@@ -3635,7 +3824,7 @@ class re {
3635
3824
  return this.initializationMarker(e) != null;
3636
3825
  }
3637
3826
  createExecution(e) {
3638
- return new Li(
3827
+ return new li(
3639
3828
  this.contractLoader,
3640
3829
  this.registry,
3641
3830
  this.blue,
@@ -3648,10 +3837,10 @@ class re {
3648
3837
  } catch (r) {
3649
3838
  if (r instanceof ne)
3650
3839
  return t.result();
3651
- if (r instanceof z) {
3652
- const o = e.clone();
3653
- return Ke.capabilityFailure(
3654
- o,
3840
+ if (r instanceof x) {
3841
+ const i = e.clone();
3842
+ return Ge.capabilityFailure(
3843
+ i,
3655
3844
  r.message ?? null
3656
3845
  );
3657
3846
  }
@@ -3660,7 +3849,7 @@ class re {
3660
3849
  return t.result();
3661
3850
  }
3662
3851
  initializationMarker(e) {
3663
- const n = e.getProperties()?.[Te.OBJECT_CONTRACTS]?.getProperties()?.initialized ?? null;
3852
+ const n = e.getProperties()?.[Pe.OBJECT_CONTRACTS]?.getProperties()?.initialized ?? null;
3664
3853
  if (!n)
3665
3854
  return null;
3666
3855
  if (!(n instanceof p))
@@ -3670,7 +3859,7 @@ class re {
3670
3859
  "Initialization Marker must be a BlueNode"
3671
3860
  )
3672
3861
  );
3673
- if (n.getType()?.getBlueId() !== xi)
3862
+ if (n.getType()?.getBlueId() !== ai)
3674
3863
  throw new y(
3675
3864
  "Initialization Marker must declare type 'Processing Initialized Marker'",
3676
3865
  S.illegalState(
@@ -3685,9 +3874,9 @@ class re {
3685
3874
  const r = P(t);
3686
3875
  if (r === "/")
3687
3876
  return e;
3688
- const o = r.slice(1).split("/");
3877
+ const i = r.slice(1).split("/");
3689
3878
  let s = e;
3690
- for (const a of o) {
3879
+ for (const a of i) {
3691
3880
  if (!s)
3692
3881
  return null;
3693
3882
  if (!a)
@@ -3733,10 +3922,10 @@ class re {
3733
3922
  return new p().setValue(e.getValue() ?? null);
3734
3923
  case "blue":
3735
3924
  return e.getBlue() ?? null;
3736
- case Te.OBJECT_CONTRACTS:
3925
+ case Pe.OBJECT_CONTRACTS:
3737
3926
  return new p().setContracts(e.getContracts());
3738
3927
  case "blueId": {
3739
- const r = e.getBlueId() ?? n?.calculateBlueId?.(e) ?? Pt.calculateBlueIdSync(e);
3928
+ const r = e.getBlueId() ?? n?.calculateBlueId?.(e) ?? Lt.calculateBlueIdSync(e);
3740
3929
  return new p().setValue(r ?? null);
3741
3930
  }
3742
3931
  default:
@@ -3744,9 +3933,9 @@ class re {
3744
3933
  }
3745
3934
  }
3746
3935
  }
3747
- class Fi {
3748
- constructor(e, t, n, r, o, s) {
3749
- this.execution = e, this.bundle = t, this.scopePathValue = n, this.eventNode = r, this.allowTerminatedWork = o, this.allowReservedMutation = s;
3936
+ class ui {
3937
+ constructor(e, t, n, r, i, s) {
3938
+ this.execution = e, this.bundle = t, this.scopePathValue = n, this.eventNode = r, this.allowTerminatedWork = i, this.allowReservedMutation = s;
3750
3939
  }
3751
3940
  get scopePath() {
3752
3941
  return this.scopePathValue;
@@ -3838,16 +4027,16 @@ class Fi {
3838
4027
  return !this.allowTerminatedWork && this.execution.isScopeInactive(this.scopePathValue);
3839
4028
  }
3840
4029
  }
3841
- const $i = new Mt({
3842
- repositories: [Rt]
4030
+ const hi = new xt({
4031
+ repositories: [_t]
3843
4032
  });
3844
- class Ui {
4033
+ class di {
3845
4034
  blue;
3846
4035
  registryRef;
3847
4036
  contractLoaderRef;
3848
4037
  engine;
3849
4038
  constructor(e) {
3850
- this.registryRef = e?.registry ?? ae.create().registerDefaults().build(), this.blue = e?.blue ?? $i, this.contractLoaderRef = new Hr(this.registryRef, this.blue), this.engine = new re(
4039
+ this.registryRef = e?.registry ?? ae.create().registerDefaults().build(), this.blue = e?.blue ?? hi, this.contractLoaderRef = new fo(this.registryRef, this.blue), this.engine = new re(
3851
4040
  this.contractLoaderRef,
3852
4041
  this.registryRef,
3853
4042
  this.blue
@@ -3880,10 +4069,10 @@ class Ui {
3880
4069
  return this.contractLoaderRef;
3881
4070
  }
3882
4071
  static builder() {
3883
- return new zi();
4072
+ return new pi();
3884
4073
  }
3885
4074
  }
3886
- class zi {
4075
+ class pi {
3887
4076
  contractRegistry;
3888
4077
  blueInstance;
3889
4078
  constructor() {
@@ -3899,13 +4088,13 @@ class zi {
3899
4088
  return this.blueInstance = e, this;
3900
4089
  }
3901
4090
  build() {
3902
- return new Ui({
4091
+ return new di({
3903
4092
  registry: this.contractRegistry,
3904
4093
  blue: this.blueInstance
3905
4094
  });
3906
4095
  }
3907
4096
  }
3908
- class St {
4097
+ class Rt {
3909
4098
  process(e, t) {
3910
4099
  const n = t.getValue();
3911
4100
  if (ee(n)) {
@@ -3926,14 +4115,14 @@ class St {
3926
4115
  return e;
3927
4116
  }
3928
4117
  }
3929
- const uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4118
+ const xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3930
4119
  __proto__: null,
3931
- ExpressionPreserver: St
4120
+ ExpressionPreserver: Rt
3932
4121
  }, Symbol.toStringTag, { value: "Module" }));
3933
- function ho() {
4122
+ function _i() {
3934
4123
  return new B.SequentialMergingProcessor([
3935
4124
  new B.ValuePropagator(),
3936
- new St(),
4125
+ new Rt(),
3937
4126
  new B.TypeAssigner(),
3938
4127
  new B.ListProcessor(),
3939
4128
  new B.DictionaryProcessor(),
@@ -3942,102 +4131,106 @@ function ho() {
3942
4131
  ]);
3943
4132
  }
3944
4133
  export {
3945
- vr as ChannelBinding,
3946
- jr as ChannelRunner,
3947
- qr as CheckpointManager,
3948
- Gr as CheckpointRecord,
3949
- ot as CodeBlockEvaluationError,
3950
- H as ContractBundle,
3951
- kr as ContractBundleBuilder,
3952
- Hr as ContractLoader,
3953
- qn as ContractProcessorRegistry,
4134
+ yt as ActorPolicyLiteralValidationError,
4135
+ qr as ChannelBinding,
4136
+ vo as ChannelRunner,
4137
+ yo as CheckpointManager,
4138
+ Co as CheckpointRecord,
4139
+ ct as CodeBlockEvaluationError,
4140
+ V as ContractBundle,
4141
+ jr as ContractBundleBuilder,
4142
+ fo as ContractLoader,
4143
+ sr as ContractProcessorRegistry,
3954
4144
  ae as ContractProcessorRegistryBuilder,
3955
- Ke as DocumentProcessingResult,
3956
- Bi as DocumentProcessingRuntime,
3957
- Ui as DocumentProcessor,
3958
- zi as DocumentProcessorBuilder,
3959
- pi as EmissionRegistry,
3960
- Di as GasMeter,
3961
- wr as HandlerBinding,
3962
- A as KEY_CHECKPOINT,
3963
- We as KEY_EMBEDDED,
3964
- Ge as KEY_INITIALIZED,
3965
- qe as KEY_TERMINATED,
3966
- uo as MergingProcessors,
3967
- Ce as PROCESSOR_MANAGED_CHANNEL_BLUE_IDS,
3968
- ci as PatchEngine,
3969
- oo as ProcessorContractConstants,
4145
+ Ge as DocumentProcessingResult,
4146
+ si as DocumentProcessingRuntime,
4147
+ di as DocumentProcessor,
4148
+ pi as DocumentProcessorBuilder,
4149
+ Uo as EmissionRegistry,
4150
+ ii as GasMeter,
4151
+ Gr as HandlerBinding,
4152
+ O as KEY_CHECKPOINT,
4153
+ je as KEY_EMBEDDED,
4154
+ Ye as KEY_INITIALIZED,
4155
+ Je as KEY_TERMINATED,
4156
+ xi as MergingProcessors,
4157
+ ve as PROCESSOR_MANAGED_CHANNEL_BLUE_IDS,
4158
+ Bo as PatchEngine,
4159
+ Ni as ProcessorContractConstants,
3970
4160
  re as ProcessorEngine,
3971
4161
  S as ProcessorErrors,
3972
- Li as ProcessorExecution,
3973
- Fi as ProcessorExecutionContext,
4162
+ li as ProcessorExecution,
4163
+ ui as ProcessorExecutionContext,
3974
4164
  y as ProcessorFatalError,
3975
- so as ProcessorPointerConstants,
4165
+ Oi as ProcessorPointerConstants,
3976
4166
  Se as QuickJSEvaluator,
3977
- Qe as RELATIVE_CHECKPOINT,
3978
- V as RELATIVE_CONTRACTS,
3979
- Lt as RELATIVE_EMBEDDED,
3980
- pe as RELATIVE_INITIALIZED,
3981
- Je as RELATIVE_TERMINATED,
4167
+ Ze as RELATIVE_CHECKPOINT,
4168
+ W as RELATIVE_CONTRACTS,
4169
+ Kt as RELATIVE_EMBEDDED,
4170
+ fe as RELATIVE_INITIALIZED,
4171
+ Qe as RELATIVE_TERMINATED,
3982
4172
  ye as RESERVED_CONTRACT_KEYS,
3983
4173
  ne as RunTerminationError,
3984
- ti as ScopeExecutor,
3985
- di as ScopeRuntimeContext,
3986
- ii as TerminationService,
3987
- to as andThen,
3988
- nt as canonicalSignature,
4174
+ Po as ScopeExecutor,
4175
+ Fo as ScopeRuntimeContext,
4176
+ Mo as TerminationService,
4177
+ Ct as actorPolicyMarkerSchema,
4178
+ On as actorPolicyRuleSchema,
4179
+ Pi as andThen,
4180
+ it as canonicalSignature,
3989
4181
  Ne as canonicalSize,
3990
- L as channelContractBaseSchema,
3991
- kn as channelEventCheckpointSchema,
3992
- dt as compositeTimelineChannelSchema,
3993
- sn as containsExpression,
3994
- ve as contractBaseSchema,
3995
- ho as createDefaultMergingProcessor,
3996
- ct as createPicomatchShouldResolve,
3997
- Dn as documentAnchorsMarkerSchema,
3998
- _n as documentLinksMarkerSchema,
3999
- hn as documentUpdateChannelSchema,
4000
- pn as embeddedNodeChannelSchema,
4001
- Ot as err,
4002
- at as evaluateQuickJSExpression,
4003
- an as extractExpressionContent,
4004
- ut as handlerContractBaseSchema,
4005
- In as initializationMarkerSchema,
4006
- Zi as isErr,
4182
+ F as channelContractBaseSchema,
4183
+ xn as channelEventCheckpointSchema,
4184
+ mt as compositeTimelineChannelSchema,
4185
+ fn as containsExpression,
4186
+ we as contractBaseSchema,
4187
+ _i as createDefaultMergingProcessor,
4188
+ ht as createPicomatchShouldResolve,
4189
+ qn as documentAnchorsMarkerSchema,
4190
+ Yn as documentLinksMarkerSchema,
4191
+ yn as documentUpdateChannelSchema,
4192
+ Sn as embeddedNodeChannelSchema,
4193
+ Ut as err,
4194
+ ut as evaluateQuickJSExpression,
4195
+ mn as extractExpressionContent,
4196
+ pt as handlerContractBaseSchema,
4197
+ Fn as initializationMarkerSchema,
4198
+ ki as isErr,
4007
4199
  ee as isExpression,
4008
- Xi as isOk,
4009
- je as isProcessorManagedChannelBlueId,
4010
- _t as isReservedContractKey,
4011
- ao as joinRelativePointers,
4012
- co as jsonPatchSchema,
4013
- mn as lifecycleChannelSchema,
4014
- Yi as map,
4015
- eo as mapErr,
4200
+ bi as isOk,
4201
+ Xe as isProcessorManagedChannelBlueId,
4202
+ Wt as isReservedContractKey,
4203
+ Di as joinRelativePointers,
4204
+ Bi as jsonPatchSchema,
4205
+ bn as lifecycleChannelSchema,
4206
+ Ti as map,
4207
+ Ii as mapErr,
4016
4208
  R as markerContractBaseSchema,
4017
- io as match,
4018
- Fn as myosParticipantsOrchestrationMarkerSchema,
4019
- Un as myosSessionInteractionMarkerSchema,
4020
- Sn as myosTimelineChannelSchema,
4021
- Hn as myosWorkerAgencyMarkerSchema,
4209
+ Mi as match,
4210
+ Xn as myosParticipantsOrchestrationMarkerSchema,
4211
+ Zn as myosSessionInteractionMarkerSchema,
4212
+ Rn as myosTimelineChannelSchema,
4213
+ tr as myosWorkerAgencyMarkerSchema,
4022
4214
  P as normalizePointer,
4023
- k as normalizeScope,
4024
- Nt as ok,
4025
- Nn as operationMarkerSchema,
4026
- Pn as processEmbeddedMarkerSchema,
4027
- Rn as processingTerminatedMarkerSchema,
4028
- Ye as relativeCheckpointLastEvent,
4029
- et as relativeCheckpointLastSignature,
4030
- ie as relativeContractsEntry,
4031
- Ft as relativizePointer,
4215
+ b as normalizeScope,
4216
+ Ft as ok,
4217
+ Vn as operationMarkerSchema,
4218
+ Hn as processEmbeddedMarkerSchema,
4219
+ $n as processingTerminatedMarkerSchema,
4220
+ nt as relativeCheckpointLastEvent,
4221
+ rt as relativeCheckpointLastSignature,
4222
+ oe as relativeContractsEntry,
4223
+ qt as relativizePointer,
4032
4224
  te as resolveNodeExpressions,
4033
- T as resolvePointer,
4034
- cn as resolveTemplateString,
4035
- Wn as sequentialWorkflowOperationSchema,
4036
- Vn as sequentialWorkflowSchema,
4037
- lo as sequentialWorkflowStepSchema,
4038
- Me as stripSlashes,
4039
- yn as timelineChannelSchema,
4040
- En as triggeredEventChannelSchema,
4041
- no as unwrapOr,
4042
- ro as unwrapOrElse
4225
+ I as resolvePointer,
4226
+ gn as resolveTemplateString,
4227
+ or as sequentialWorkflowOperationSchema,
4228
+ nr as sequentialWorkflowSchema,
4229
+ Li as sequentialWorkflowStepSchema,
4230
+ Ae as stripSlashes,
4231
+ In as timelineChannelSchema,
4232
+ Tn as triggeredEventChannelSchema,
4233
+ Ri as unwrapOr,
4234
+ Ai as unwrapOrElse,
4235
+ Bn as validateActorPolicyNode
4043
4236
  };