@blue-labs/document-processor 3.9.1 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +108 -107
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12,10 +12,10 @@ function Nt(i) {
12
12
  function Ot(i) {
13
13
  return { ok: !1, error: i };
14
14
  }
15
- function Xi(i) {
15
+ function Zi(i) {
16
16
  return i.ok;
17
17
  }
18
- function Zi(i) {
18
+ function Xi(i) {
19
19
  return !i.ok;
20
20
  }
21
21
  function Yi(i, e) {
@@ -36,7 +36,7 @@ function ro(i, e) {
36
36
  function io(i, e) {
37
37
  return i.ok ? e.ok(i.value) : e.err(i.error);
38
38
  }
39
- const S = {
39
+ const v = {
40
40
  capabilityFailure(i, e, t) {
41
41
  return { kind: "CapabilityFailure", capability: i, reason: e, details: t };
42
42
  },
@@ -125,15 +125,15 @@ const oo = {
125
125
  PROCESSOR_MANAGED_CHANNEL_BLUE_IDS: Ce,
126
126
  isReservedContractKey: _t,
127
127
  isProcessorManagedChannelBlueId: je
128
- }, V = "/contracts", pe = `${V}/${Ge}`, Je = `${V}/${qe}`, Lt = `${V}/${We}`, Qe = `${V}/${A}`, Xe = "/lastEvents", Ze = "/lastSignatures";
128
+ }, V = "/contracts", pe = `${V}/${Ge}`, Je = `${V}/${qe}`, Lt = `${V}/${We}`, Qe = `${V}/${A}`, Ze = "/lastEvents", Xe = "/lastSignatures";
129
129
  function ie(i) {
130
130
  return `${V}/${i}`;
131
131
  }
132
132
  function Ye(i, e) {
133
- return `${ie(i)}${Xe}/${e}`;
133
+ return `${ie(i)}${Ze}/${e}`;
134
134
  }
135
135
  function et(i, e) {
136
- return `${ie(i)}${Ze}/${e}`;
136
+ return `${ie(i)}${Xe}/${e}`;
137
137
  }
138
138
  const so = {
139
139
  RELATIVE_CONTRACTS: V,
@@ -141,8 +141,8 @@ const so = {
141
141
  RELATIVE_TERMINATED: Je,
142
142
  RELATIVE_EMBEDDED: Lt,
143
143
  RELATIVE_CHECKPOINT: Qe,
144
- LAST_EVENTS_SUFFIX: Xe,
145
- LAST_SIGNATURES_SUFFIX: Ze,
144
+ LAST_EVENTS_SUFFIX: Ze,
145
+ LAST_SIGNATURES_SUFFIX: Xe,
146
146
  relativeContractsEntry: ie,
147
147
  relativeCheckpointLastEvent: Ye,
148
148
  relativeCheckpointLastSignature: et
@@ -244,7 +244,7 @@ const it = rt(
244
244
  qt
245
245
  ), Qt = rt(
246
246
  jt
247
- ), O = 1, Xt = /* @__PURE__ */ new Set([
247
+ ), O = 1, Zt = /* @__PURE__ */ new Set([
248
248
  "event",
249
249
  "eventCanonical",
250
250
  "steps",
@@ -253,7 +253,7 @@ const it = rt(
253
253
  "currentContract",
254
254
  "currentContractCanonical"
255
255
  ]);
256
- class Se {
256
+ class ve {
257
257
  // Serialize evaluations to avoid races when updating host handler bindings.
258
258
  evaluationQueue = Promise.resolve();
259
259
  handlerState = {
@@ -309,7 +309,7 @@ class Se {
309
309
  }
310
310
  prepareBindings(e) {
311
311
  const t = e ?? {};
312
- Zt(t);
312
+ Xt(t);
313
313
  const n = W(t.event, null, "event"), r = W(
314
314
  t.eventCanonical ?? n,
315
315
  n,
@@ -363,9 +363,9 @@ ${e}
363
363
  })()`;
364
364
  }
365
365
  }
366
- function Zt(i) {
366
+ function Xt(i) {
367
367
  for (const e of Object.keys(i))
368
- if (!Xt.has(e))
368
+ if (!Zt.has(e))
369
369
  throw new TypeError(`Unsupported QuickJS binding: "${e}"`);
370
370
  }
371
371
  function W(i, e, t) {
@@ -552,10 +552,10 @@ async function te(i) {
552
552
  }
553
553
  return h;
554
554
  }
555
- const v = h.getItems?.();
556
- if (Array.isArray(v)) {
555
+ const S = h.getItems?.();
556
+ if (Array.isArray(S)) {
557
557
  const E = await Promise.all(
558
- v.map(
558
+ S.map(
559
559
  (C, M) => te({
560
560
  ...i,
561
561
  node: C,
@@ -584,12 +584,12 @@ const oe = 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
+ })), Se = oe, _ = g(m["Core/Channel"])(oe.extend({
588
588
  description: l.string().optional(),
589
589
  event: b().optional(),
590
590
  name: l.string().optional()
591
591
  })), L = _.merge(
592
- ve
592
+ Se
593
593
  ).extend({
594
594
  path: l.string().optional(),
595
595
  definition: b().optional()
@@ -598,10 +598,10 @@ const oe = g(m["Core/Contract"])(l.object({
598
598
  description: l.string().optional(),
599
599
  event: b().optional(),
600
600
  name: l.string().optional()
601
- })), ut = lt.merge(ve), K = g(m["Core/Marker"])(oe.extend({
601
+ })), ut = lt.merge(Se), K = g(m["Core/Marker"])(oe.extend({
602
602
  description: l.string().optional(),
603
603
  name: l.string().optional()
604
- })), R = K.merge(ve), ln = l.object({
604
+ })), R = K.merge(Se), ln = l.object({
605
605
  op: l.enum(["ADD", "REPLACE", "REMOVE"]),
606
606
  path: l.string(),
607
607
  val: b().optional()
@@ -648,7 +648,7 @@ const oe = g(m["Core/Contract"])(l.object({
648
648
  "Conversation/Sequential Workflow Step": "HYsLiqsqk7t98d5fK6YxKEQGeqBaHNVjM4rRNdxK4yUW",
649
649
  "Conversation/Timeline": "3Ge54FsGJaaeZmm8nTKJdS6HVdYhiR3g18fDwg3Ev1Sa",
650
650
  "Conversation/Timeline Channel": "EvuCWsG1E6WJQg8QXmk6rwMANYTZjoLWVZ1vYQWUwdTH",
651
- "Conversation/Timeline Entry": "EzDiC9Frs8V5yQBMtDYh1DobVnWtWpFemXDX5fGUULBn",
651
+ "Conversation/Timeline Entry": "29tcU8MkrV3KL5HqH6DHJDPPfJMheoqwiKJsaHnrp9hT",
652
652
  "Conversation/Trigger Event": "2bSWEoMSZwzf32Hnr4BDVsuq8NRjrWEpnhZvMZAJGhh2",
653
653
  "Conversation/Update Document": "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa"
654
654
  }, ht = g(w["Conversation/Timeline Channel"])(_.extend({
@@ -666,18 +666,18 @@ const oe = g(m["Core/Contract"])(l.object({
666
666
  "MyOS/MyOS Session Interaction": "CeWyRmXAMZqvWBvby2KbRUZWcS7Pdxs42vnMXgn9gg6H",
667
667
  "MyOS/MyOS Timeline": "2gyToM86KgFJpB8inz8TBVEMZk8UVGYdRozF4mfvxtuk",
668
668
  "MyOS/MyOS Timeline Channel": "HCF8mXnX3dFjQ8osjxb4Wzm2Nm1DoXnTYuA5sPnV7NTs",
669
- "MyOS/MyOS Timeline Entry": "Furgmg5xcJVMDmaQXZRfZ1XehSf7PWctrioo8etRYJHQ",
669
+ "MyOS/MyOS Timeline Entry": "F3mQaGQ1B48yMedKZojFTxeKxtee4xU66QBbiyEMvGeZ",
670
670
  "MyOS/MyOS Worker Agency": "4Lix4AKXvBDvrwxw2htSdYFKxL4wugEQzqoSEYet5Dh1"
671
671
  }, Cn = g(I["MyOS/MyOS Timeline Channel"])(ht.extend({
672
672
  accountId: l.string().optional(),
673
673
  description: l.string().optional(),
674
674
  email: l.string().optional(),
675
675
  name: l.string().optional()
676
- })), Sn = Cn.merge(L), vn = g(w["Conversation/Composite Timeline Channel"])(_.extend({
676
+ })), vn = Cn.merge(L), Sn = g(w["Conversation/Composite Timeline Channel"])(_.extend({
677
677
  channels: l.array(l.string()).optional(),
678
678
  description: l.string().optional(),
679
679
  name: l.string().optional()
680
- })), dt = vn.merge(L), wn = g(m["Core/Channel Event Checkpoint"])(K.extend({
680
+ })), dt = Sn.merge(L), wn = g(m["Core/Channel Event Checkpoint"])(K.extend({
681
681
  description: l.string().optional(),
682
682
  lastEvents: l.record(l.string(), b()).optional(),
683
683
  name: l.string().optional()
@@ -860,7 +860,7 @@ function Jn(i, e) {
860
860
  function Qn(i) {
861
861
  return i != null && Object.prototype.hasOwnProperty.call(i, "lastEvents") && Object.prototype.hasOwnProperty.call(i, "lastSignatures");
862
862
  }
863
- class Xn {
863
+ class Zn {
864
864
  kind = "channel";
865
865
  blueIds = [
866
866
  w["Conversation/Composite Timeline Channel"]
@@ -900,19 +900,19 @@ class Xn {
900
900
  throw new Error(
901
901
  `No processor registered for child channel '${u}' (${h.blueId})`
902
902
  );
903
- const v = n.clone(), f = {
903
+ const S = n.clone(), f = {
904
904
  ...t,
905
- event: v,
905
+ event: S,
906
906
  bindingKey: u
907
907
  }, E = h.contract, C = E.event;
908
- if (C && !t.blue.isTypeOfNode(v, C) || !await d.matches(E, f))
908
+ if (C && !t.blue.isTypeOfNode(S, C) || !await d.matches(E, f))
909
909
  continue;
910
- const D = d.channelize, be = (D ? D.call(d, E, f) : void 0) ?? v.clone();
910
+ const D = d.channelize, be = (D ? D.call(d, E, f) : void 0) ?? S.clone();
911
911
  this.enrichEvent(be, u);
912
912
  const Ie = Jn(
913
913
  t.bindingKey,
914
914
  u
915
- ), vt = await this.shouldProcessChild({
915
+ ), St = await this.shouldProcessChild({
916
916
  childProcessor: d,
917
917
  childContract: E,
918
918
  context: {
@@ -926,7 +926,7 @@ class Xn {
926
926
  eventNode: be,
927
927
  eventId: a,
928
928
  checkpointKey: Ie,
929
- shouldProcess: vt
929
+ shouldProcess: St
930
930
  });
931
931
  }
932
932
  return {
@@ -974,7 +974,7 @@ class Xn {
974
974
  return Qn(t) ? t : null;
975
975
  }
976
976
  }
977
- const Zn = g(w["Conversation/Actor"])(l.object({
977
+ const Xn = g(w["Conversation/Actor"])(l.object({
978
978
  description: l.string().optional(),
979
979
  name: l.string().optional()
980
980
  })), ft = g(w["Conversation/Timeline"])(l.object({
@@ -982,11 +982,12 @@ const Zn = g(w["Conversation/Actor"])(l.object({
982
982
  name: l.string().optional(),
983
983
  timelineId: l.string().optional()
984
984
  })), N = g(w["Conversation/Timeline Entry"])(l.object({
985
- actor: Zn.optional(),
985
+ actor: Xn.optional(),
986
986
  description: l.string().optional(),
987
987
  message: b().optional(),
988
988
  name: l.string().optional(),
989
989
  prevEntry: b().optional(),
990
+ source: b().optional(),
990
991
  timeline: ft.optional(),
991
992
  timestamp: l.number().optional()
992
993
  })), Yn = g(I["MyOS/MyOS Timeline"])(ft.extend({
@@ -1014,7 +1015,7 @@ function xe(i, e) {
1014
1015
  class er {
1015
1016
  kind = "channel";
1016
1017
  blueIds = [I["MyOS/MyOS Timeline Channel"]];
1017
- schema = Sn;
1018
+ schema = vn;
1018
1019
  matches(e, t) {
1019
1020
  const { event: n, blue: r } = t;
1020
1021
  if (!n)
@@ -1093,7 +1094,7 @@ class ir {
1093
1094
  supportedBlueIds = [
1094
1095
  w["Conversation/Trigger Event"]
1095
1096
  ];
1096
- evaluator = new Se();
1097
+ evaluator = new ve();
1097
1098
  async execute(e) {
1098
1099
  const { stepNode: t, context: n } = e;
1099
1100
  if (!n.blue.isTypeOf(t, _e))
@@ -1135,7 +1136,7 @@ class ar {
1135
1136
  supportedBlueIds = [
1136
1137
  w["Conversation/JavaScript Code"]
1137
1138
  ];
1138
- evaluator = new Se();
1139
+ evaluator = new ve();
1139
1140
  wasmGasLimit;
1140
1141
  constructor(e = {}) {
1141
1142
  this.wasmGasLimit = e.wasmGasLimit ?? it;
@@ -1191,7 +1192,7 @@ class lr {
1191
1192
  supportedBlueIds = [
1192
1193
  w["Conversation/Update Document"]
1193
1194
  ];
1194
- evaluator = new Se();
1195
+ evaluator = new ve();
1195
1196
  async execute(e) {
1196
1197
  const { context: t, stepNode: n } = e, { blue: r } = t;
1197
1198
  if (!r.isTypeOf(n, Fe))
@@ -1266,7 +1267,7 @@ class gt {
1266
1267
  `Unsupported workflow step type "${E}"`
1267
1268
  );
1268
1269
  }
1269
- const v = {
1270
+ const S = {
1270
1271
  workflow: t,
1271
1272
  stepNode: u,
1272
1273
  eventNode: n,
@@ -1274,7 +1275,7 @@ class gt {
1274
1275
  stepResults: a,
1275
1276
  stepIndex: c,
1276
1277
  contractNode: o
1277
- }, f = await d.execute(v);
1278
+ }, f = await d.execute(S);
1278
1279
  if (f !== void 0) {
1279
1280
  const E = this.stepResultKey(u, c);
1280
1281
  a[E] = f;
@@ -1404,7 +1405,7 @@ function Cr(i, e, t) {
1404
1405
  const c = (o.getContracts()?.initialized ?? null)?.get("/documentId") ?? null, u = typeof c == "string" && c.length > 0 ? c : t.blue.calculateBlueIdSync(o);
1405
1406
  return n === u;
1406
1407
  }
1407
- class Sr {
1408
+ class vr {
1408
1409
  kind = "handler";
1409
1410
  blueIds = [
1410
1411
  w["Conversation/Sequential Workflow Operation"]
@@ -1472,7 +1473,7 @@ class ae {
1472
1473
  );
1473
1474
  }
1474
1475
  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;
1476
+ return this.registry.register(new Zn()), 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 vr()), this;
1476
1477
  }
1477
1478
  register(e) {
1478
1479
  return this.registry.register(e), this;
@@ -1485,7 +1486,7 @@ const ge = m["Core/Channel Event Checkpoint"];
1485
1486
  function yt(i) {
1486
1487
  return typeof i.order == "number" ? i.order : 0;
1487
1488
  }
1488
- class vr {
1489
+ class Sr {
1489
1490
  constructor(e, t, n, r) {
1490
1491
  this.bindingKey = e, this.bindingContract = t, this.bindingBlueId = n, this.bindingNode = r;
1491
1492
  }
@@ -1604,7 +1605,7 @@ class H {
1604
1605
  }
1605
1606
  channelsOfType(...e) {
1606
1607
  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(
1608
+ (r) => new Sr(
1608
1609
  r.key,
1609
1610
  r.contract,
1610
1611
  r.blueId,
@@ -1679,7 +1680,7 @@ class y extends Error {
1679
1680
  super(e || "Processor fatal error"), this.processorError = t, this.name = "ProcessorFatalError";
1680
1681
  }
1681
1682
  }
1682
- function Z(i, e, t) {
1683
+ function X(i, e, t) {
1683
1684
  for (const [n, r] of t.entries())
1684
1685
  if (i.isTypeOfBlueId(e, n))
1685
1686
  return r;
@@ -1710,7 +1711,7 @@ class br {
1710
1711
  if (!h)
1711
1712
  throw new y(
1712
1713
  `Handler ${t} references unknown channel '${u}'`,
1713
- S.invalidContract(
1714
+ v.invalidContract(
1714
1715
  o,
1715
1716
  `Channel '${u}' is not declared in this scope`,
1716
1717
  `/contracts/${u}`
@@ -1719,7 +1720,7 @@ class br {
1719
1720
  if (!this.isRegisteredChannel(h))
1720
1721
  throw new y(
1721
1722
  `Contract '${u}' is not a channel`,
1722
- S.invalidContract(
1723
+ v.invalidContract(
1723
1724
  h.nodeTypeBlueId,
1724
1725
  `Contract '${u}' is not a channel`,
1725
1726
  `/contracts/${u}`
@@ -1736,7 +1737,7 @@ class br {
1736
1737
  if (this.isZodError(a))
1737
1738
  throw new y(
1738
1739
  "Failed to parse handler contract",
1739
- S.invalidContract(
1740
+ v.invalidContract(
1740
1741
  o,
1741
1742
  "Failed to parse handler contract",
1742
1743
  t,
@@ -1746,7 +1747,7 @@ class br {
1746
1747
  const c = a?.message ?? "Failed to register handler contract";
1747
1748
  throw new y(
1748
1749
  c,
1749
- S.illegalState(c)
1750
+ v.illegalState(c)
1750
1751
  );
1751
1752
  }
1752
1753
  }
@@ -1770,14 +1771,14 @@ class br {
1770
1771
  if (!o)
1771
1772
  throw new y(
1772
1773
  `Handler ${r} must declare channel (missing explicit channel and derivation failed)`,
1773
- S.illegalState(
1774
+ v.illegalState(
1774
1775
  `Handler ${r} must declare channel (missing explicit channel and derivation failed)`
1775
1776
  )
1776
1777
  );
1777
1778
  return o;
1778
1779
  }
1779
1780
  isRegisteredChannel(e) {
1780
- return Z(this.blue, e.node, this.builtinChannelSchemas) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
1781
+ return X(this.blue, e.node, this.builtinChannelSchemas) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
1781
1782
  }
1782
1783
  setContractChannel(e, t) {
1783
1784
  const r = e.getProperties()?.channel;
@@ -1816,7 +1817,7 @@ function Tr(i) {
1816
1817
  if (Pr(C))
1817
1818
  throw new y(
1818
1819
  "Failed to parse channel contract",
1819
- S.invalidContract(
1820
+ v.invalidContract(
1820
1821
  E.nodeTypeBlueId,
1821
1822
  "Failed to parse channel contract",
1822
1823
  `/contracts/${f}`,
@@ -1826,15 +1827,15 @@ function Tr(i) {
1826
1827
  const M = C?.message ?? "Failed to parse channel contract";
1827
1828
  throw new y(
1828
1829
  M,
1829
- S.illegalState(M)
1830
+ v.illegalState(M)
1830
1831
  );
1831
1832
  }
1832
- }, v = (f) => {
1833
+ }, S = (f) => {
1833
1834
  if (a.has(f)) {
1834
1835
  const C = c.indexOf(f), D = [...c.slice(C), f].join(" -> ");
1835
1836
  throw new y(
1836
1837
  `Composite channel ${e} has a cyclic reference: ${D}`,
1837
- S.invalidContract(
1838
+ v.invalidContract(
1838
1839
  r,
1839
1840
  `Composite channel '${e}' has a cyclic reference: ${D}`,
1840
1841
  `/contracts/${e}`
@@ -1848,11 +1849,11 @@ function Tr(i) {
1848
1849
  if (E)
1849
1850
  for (const C of E.channels ?? []) {
1850
1851
  const M = n.get(C);
1851
- M && h(M) && v(C);
1852
+ M && h(M) && S(C);
1852
1853
  }
1853
1854
  c.pop(), a.delete(f), s.add(f);
1854
1855
  };
1855
- v(e);
1856
+ S(e);
1856
1857
  }
1857
1858
  function Pr(i) {
1858
1859
  return i instanceof Ee;
@@ -1932,7 +1933,7 @@ class Hr {
1932
1933
  const r = n?.message ?? "Failed to load contracts";
1933
1934
  throw new y(
1934
1935
  `Failed to load contracts for scope ${t}: ${r}`,
1935
- S.runtimeFatal(
1936
+ v.runtimeFatal(
1936
1937
  `Failed to load contracts for scope ${t}`,
1937
1938
  n
1938
1939
  )
@@ -1947,7 +1948,7 @@ class Hr {
1947
1948
  this.handleProcessEmbedded(e, t, n);
1948
1949
  return;
1949
1950
  }
1950
- const s = Z(
1951
+ const s = X(
1951
1952
  this.blue,
1952
1953
  n,
1953
1954
  zr
@@ -1956,7 +1957,7 @@ class Hr {
1956
1957
  this.handleMarker(e, t, n, s, o);
1957
1958
  return;
1958
1959
  }
1959
- const a = Z(
1960
+ const a = X(
1960
1961
  this.blue,
1961
1962
  n,
1962
1963
  le
@@ -2015,7 +2016,7 @@ class Hr {
2015
2016
  }
2016
2017
  throw je(o) ? new y(
2017
2018
  "Built-in processor-managed channel is missing schema registration",
2018
- S.invalidContract(
2019
+ v.invalidContract(
2019
2020
  o,
2020
2021
  "Built-in processor-managed channel is missing schema registration",
2021
2022
  t
@@ -2032,7 +2033,7 @@ class Hr {
2032
2033
  } catch (r) {
2033
2034
  throw ue(r) ? new y(
2034
2035
  "Failed to parse ProcessEmbedded marker",
2035
- S.invalidContract(
2036
+ v.invalidContract(
2036
2037
  $e,
2037
2038
  "Failed to parse ProcessEmbedded marker",
2038
2039
  t,
@@ -2040,7 +2041,7 @@ class Hr {
2040
2041
  )
2041
2042
  ) : new y(
2042
2043
  r?.message ?? "Failed to register ProcessEmbedded marker",
2043
- S.illegalState(
2044
+ v.illegalState(
2044
2045
  r?.message ?? "Failed to register ProcessEmbedded marker"
2045
2046
  )
2046
2047
  );
@@ -2064,7 +2065,7 @@ class Hr {
2064
2065
  if (ue(a))
2065
2066
  throw new y(
2066
2067
  "Failed to parse channel contract",
2067
- S.invalidContract(
2068
+ v.invalidContract(
2068
2069
  o,
2069
2070
  "Failed to parse channel contract",
2070
2071
  t,
@@ -2074,7 +2075,7 @@ class Hr {
2074
2075
  const c = a?.message ?? "Failed to register channel contract";
2075
2076
  throw new y(
2076
2077
  c,
2077
- S.illegalState(c)
2078
+ v.illegalState(c)
2078
2079
  );
2079
2080
  }
2080
2081
  }
@@ -2086,7 +2087,7 @@ class Hr {
2086
2087
  if (!a)
2087
2088
  throw new y(
2088
2089
  `Composite channel ${e} references unknown channel '${s}'`,
2089
- S.invalidContract(
2090
+ v.invalidContract(
2090
2091
  r,
2091
2092
  `Channel '${s}' is not declared in this scope`,
2092
2093
  `/contracts/${s}`
@@ -2095,7 +2096,7 @@ class Hr {
2095
2096
  if (!this.isRegisteredChannel(a))
2096
2097
  throw new y(
2097
2098
  `Contract '${s}' is not a channel`,
2098
- S.invalidContract(
2099
+ v.invalidContract(
2099
2100
  a.nodeTypeBlueId,
2100
2101
  `Contract '${s}' is not a channel`,
2101
2102
  `/contracts/${s}`
@@ -2112,7 +2113,7 @@ class Hr {
2112
2113
  }
2113
2114
  }
2114
2115
  isRegisteredChannel(e) {
2115
- return Z(this.blue, e.node, le) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
2116
+ return X(this.blue, e.node, le) ? !0 : this.registry.lookupChannelForNode(this.blue, e.node) != null;
2116
2117
  }
2117
2118
  handleMarker(e, t, n, r, o) {
2118
2119
  try {
@@ -2125,7 +2126,7 @@ class Hr {
2125
2126
  if (ue(s))
2126
2127
  throw new y(
2127
2128
  "Failed to parse marker contract",
2128
- S.invalidContract(
2129
+ v.invalidContract(
2129
2130
  o,
2130
2131
  "Failed to parse marker contract",
2131
2132
  t,
@@ -2135,7 +2136,7 @@ class Hr {
2135
2136
  const a = s?.message ?? "Failed to register marker contract";
2136
2137
  throw new y(
2137
2138
  a,
2138
- S.illegalState(a)
2139
+ v.illegalState(a)
2139
2140
  );
2140
2141
  }
2141
2142
  }
@@ -2361,7 +2362,7 @@ function Jr(i, e) {
2361
2362
  }
2362
2363
  class U extends y {
2363
2364
  constructor(e) {
2364
- super(e, S.illegalState(e)), this.name = "IllegalStateException";
2365
+ super(e, v.illegalState(e)), this.name = "IllegalStateException";
2365
2366
  }
2366
2367
  }
2367
2368
  class F extends Error {
@@ -2369,7 +2370,7 @@ class F extends Error {
2369
2370
  super(e), this.name = "BoundaryViolationException";
2370
2371
  }
2371
2372
  }
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
+ const Qr = m["Core/Document Update Channel"], Zr = m["Core/Embedded Node Channel"], Xr = m["Core/Triggered Event Channel"], Yr = m["Core/Lifecycle Event Channel"], ze = m["Core/Processing Initialized Marker"], ei = m["Core/Document Processing Initiated"];
2373
2374
  class ti {
2374
2375
  runtime;
2375
2376
  contractLoader;
@@ -2391,11 +2392,11 @@ class ti {
2391
2392
  if (!d)
2392
2393
  return;
2393
2394
  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)
2395
+ const S = o.embeddedPaths().find((C) => !r.has(C)) ?? null;
2396
+ if (!S)
2396
2397
  break;
2397
- r.add(v);
2398
- const f = T(n, v);
2398
+ r.add(S);
2399
+ const f = T(n, S);
2399
2400
  this.nodeAt(f) && await this.initializeScope(f, !0);
2400
2401
  }
2401
2402
  if (!o)
@@ -2588,7 +2589,7 @@ class ti {
2588
2589
  const r = n?.message ?? "Failed to load contracts";
2589
2590
  throw new y(
2590
2591
  r,
2591
- S.runtimeFatal(
2592
+ v.runtimeFatal(
2592
2593
  `Failed to load contracts for scope ${t}`,
2593
2594
  n
2594
2595
  )
@@ -2611,7 +2612,7 @@ class ti {
2611
2612
  return;
2612
2613
  const n = this.channelsMatching(
2613
2614
  t,
2614
- Xr
2615
+ Zr
2615
2616
  );
2616
2617
  if (n.length !== 0)
2617
2618
  for (const r of t.embeddedPaths()) {
@@ -2620,8 +2621,8 @@ class ti {
2620
2621
  for (const c of a) {
2621
2622
  let u = !1;
2622
2623
  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(
2624
+ const S = h.contract().childPath ?? "/";
2625
+ T(e, S) === o && (u || (this.runtime.gasMeter().chargeBridge(), u = !0), await this.channelRunner.runHandlers(
2625
2626
  e,
2626
2627
  t,
2627
2628
  h.key(),
@@ -2637,7 +2638,7 @@ class ti {
2637
2638
  return;
2638
2639
  const n = this.runtime.scope(e), r = this.channelsMatching(
2639
2640
  t,
2640
- Zr
2641
+ Xr
2641
2642
  );
2642
2643
  if (r.length === 0) {
2643
2644
  n.clearTriggered();
@@ -2861,7 +2862,7 @@ class ci {
2861
2862
  );
2862
2863
  }
2863
2864
  directWriteObject(e, t, n) {
2864
- const r = X(e);
2865
+ const r = Z(e);
2865
2866
  if (n == null) {
2866
2867
  delete r[t], e.setProperties(
2867
2868
  Object.keys(r).length > 0 ? r : void 0
@@ -2899,7 +2900,7 @@ class ci {
2899
2900
  );
2900
2901
  return u;
2901
2902
  }
2902
- const s = X(e);
2903
+ const s = Z(e);
2903
2904
  let a = s[t];
2904
2905
  return a || (a = new p(), s[t] = a, e.setProperties(s)), a;
2905
2906
  }
@@ -2928,7 +2929,7 @@ class ci {
2928
2929
  he(r, u).splice(d, 0, q(n));
2929
2930
  return;
2930
2931
  }
2931
- const c = X(r);
2932
+ const c = Z(r);
2932
2933
  c[o] = q(n), r.setProperties(c);
2933
2934
  } catch (c) {
2934
2935
  throw this.rollbackCreated(a), c;
@@ -2953,7 +2954,7 @@ class ci {
2953
2954
  c[u] = q(n), r.setItems(c);
2954
2955
  return;
2955
2956
  }
2956
- const a = X(r);
2957
+ const a = Z(r);
2957
2958
  a[o] = q(n), r.setProperties(a);
2958
2959
  } catch (a) {
2959
2960
  throw this.rollbackCreated(s), a;
@@ -2991,13 +2992,13 @@ class ci {
2991
2992
  for (let a = 0; a < e.length - 1; a += 1) {
2992
2993
  const c = e[a], u = G(e, a + 1);
2993
2994
  if ($(c)) {
2994
- const v = r.getItems();
2995
- if (!v)
2995
+ const S = r.getItems();
2996
+ if (!S)
2996
2997
  throw new Error(`Array index segment requires array at ${u}`);
2997
2998
  const f = x(c, u);
2998
- if (f < 0 || f >= v.length)
2999
+ if (f < 0 || f >= S.length)
2999
3000
  throw new Error(`Array index out of bounds in path: ${u}`);
3000
- const E = v[f];
3001
+ const E = S[f];
3001
3002
  if (!(E instanceof p))
3002
3003
  throw new Error(`Array index out of bounds in path: ${u}`);
3003
3004
  r = E;
@@ -3095,7 +3096,7 @@ function he(i, e) {
3095
3096
  const t = [...e];
3096
3097
  return i.setItems(t), t;
3097
3098
  }
3098
- function X(i) {
3099
+ function Z(i) {
3099
3100
  const e = i.getProperties();
3100
3101
  if (!e) {
3101
3102
  const n = {};
@@ -3211,7 +3212,7 @@ function mi(i) {
3211
3212
  function gi(i, e) {
3212
3213
  return 8 + fi(i) + Ct(e);
3213
3214
  }
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
+ const Ei = 1e3, yi = 5, Ci = 50, vi = 2, Si = 10, wi = 10, ki = 10, bi = 20, Ii = 20, Ti = 30, Pi = 30, Mi = 100;
3215
3216
  function Ri(i) {
3216
3217
  return 50 + 10 * i;
3217
3218
  }
@@ -3248,13 +3249,13 @@ class Di {
3248
3249
  this.add(Ci);
3249
3250
  }
3250
3251
  chargeBoundaryCheck() {
3251
- this.add(Si);
3252
+ this.add(vi);
3252
3253
  }
3253
3254
  chargePatchAddOrReplace(e) {
3254
3255
  this.add(Ni(this.payloadSizeCharge(e)));
3255
3256
  }
3256
3257
  chargePatchRemove() {
3257
- this.add(vi);
3258
+ this.add(Si);
3258
3259
  }
3259
3260
  chargeCascadeRouting(e) {
3260
3261
  e > 0 && this.add(Oi(e));
@@ -3391,7 +3392,7 @@ class Li {
3391
3392
  const h = `No processor registered for handler contract ${s.blueId()}`;
3392
3393
  throw new y(
3393
3394
  h,
3394
- S.illegalState(h)
3395
+ v.illegalState(h)
3395
3396
  );
3396
3397
  }
3397
3398
  const u = c.matches;
@@ -3562,7 +3563,7 @@ class Li {
3562
3563
  const r = `No processor registered for handler contract ${e.blueId()}`;
3563
3564
  throw new y(
3564
3565
  r,
3565
- S.illegalState(r)
3566
+ v.illegalState(r)
3566
3567
  );
3567
3568
  }
3568
3569
  await n.execute(e.contract(), t, {
@@ -3666,14 +3667,14 @@ class re {
3666
3667
  if (!(n instanceof p))
3667
3668
  throw new y(
3668
3669
  "Initialization Marker must be a BlueNode",
3669
- S.illegalState(
3670
+ v.illegalState(
3670
3671
  "Initialization Marker must be a BlueNode"
3671
3672
  )
3672
3673
  );
3673
3674
  if (n.getType()?.getBlueId() !== xi)
3674
3675
  throw new y(
3675
3676
  "Initialization Marker must declare type 'Processing Initialized Marker'",
3676
- S.illegalState(
3677
+ v.illegalState(
3677
3678
  "Initialization Marker must declare type 'Processing Initialized Marker'"
3678
3679
  )
3679
3680
  );
@@ -3780,7 +3781,7 @@ class Fi {
3780
3781
  this.shouldSkipTerminatedWork() || this.execution.runtime().addGas(e);
3781
3782
  }
3782
3783
  throwFatal(e) {
3783
- throw new y(e, S.runtimeFatal(e));
3784
+ throw new y(e, v.runtimeFatal(e));
3784
3785
  }
3785
3786
  resolvePointer(e) {
3786
3787
  return this.execution.resolvePointer(this.scopePathValue, e);
@@ -3905,7 +3906,7 @@ class zi {
3905
3906
  });
3906
3907
  }
3907
3908
  }
3908
- class St {
3909
+ class vt {
3909
3910
  process(e, t) {
3910
3911
  const n = t.getValue();
3911
3912
  if (ee(n)) {
@@ -3928,12 +3929,12 @@ class St {
3928
3929
  }
3929
3930
  const uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3930
3931
  __proto__: null,
3931
- ExpressionPreserver: St
3932
+ ExpressionPreserver: vt
3932
3933
  }, Symbol.toStringTag, { value: "Module" }));
3933
3934
  function ho() {
3934
3935
  return new B.SequentialMergingProcessor([
3935
3936
  new B.ValuePropagator(),
3936
- new St(),
3937
+ new vt(),
3937
3938
  new B.TypeAssigner(),
3938
3939
  new B.ListProcessor(),
3939
3940
  new B.DictionaryProcessor(),
@@ -3942,7 +3943,7 @@ function ho() {
3942
3943
  ]);
3943
3944
  }
3944
3945
  export {
3945
- vr as ChannelBinding,
3946
+ Sr as ChannelBinding,
3946
3947
  jr as ChannelRunner,
3947
3948
  qr as CheckpointManager,
3948
3949
  Gr as CheckpointRecord,
@@ -3968,12 +3969,12 @@ export {
3968
3969
  ci as PatchEngine,
3969
3970
  oo as ProcessorContractConstants,
3970
3971
  re as ProcessorEngine,
3971
- S as ProcessorErrors,
3972
+ v as ProcessorErrors,
3972
3973
  Li as ProcessorExecution,
3973
3974
  Fi as ProcessorExecutionContext,
3974
3975
  y as ProcessorFatalError,
3975
3976
  so as ProcessorPointerConstants,
3976
- Se as QuickJSEvaluator,
3977
+ ve as QuickJSEvaluator,
3977
3978
  Qe as RELATIVE_CHECKPOINT,
3978
3979
  V as RELATIVE_CONTRACTS,
3979
3980
  Lt as RELATIVE_EMBEDDED,
@@ -3991,7 +3992,7 @@ export {
3991
3992
  kn as channelEventCheckpointSchema,
3992
3993
  dt as compositeTimelineChannelSchema,
3993
3994
  sn as containsExpression,
3994
- ve as contractBaseSchema,
3995
+ Se as contractBaseSchema,
3995
3996
  ho as createDefaultMergingProcessor,
3996
3997
  ct as createPicomatchShouldResolve,
3997
3998
  Dn as documentAnchorsMarkerSchema,
@@ -4003,9 +4004,9 @@ export {
4003
4004
  an as extractExpressionContent,
4004
4005
  ut as handlerContractBaseSchema,
4005
4006
  In as initializationMarkerSchema,
4006
- Zi as isErr,
4007
+ Xi as isErr,
4007
4008
  ee as isExpression,
4008
- Xi as isOk,
4009
+ Zi as isOk,
4009
4010
  je as isProcessorManagedChannelBlueId,
4010
4011
  _t as isReservedContractKey,
4011
4012
  ao as joinRelativePointers,
@@ -4017,7 +4018,7 @@ export {
4017
4018
  io as match,
4018
4019
  Fn as myosParticipantsOrchestrationMarkerSchema,
4019
4020
  Un as myosSessionInteractionMarkerSchema,
4020
- Sn as myosTimelineChannelSchema,
4021
+ vn as myosTimelineChannelSchema,
4021
4022
  Hn as myosWorkerAgencyMarkerSchema,
4022
4023
  P as normalizePointer,
4023
4024
  k as normalizeScope,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blue-labs/document-processor",
3
- "version": "3.9.1",
3
+ "version": "3.10.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",