@walkeros/cli 4.1.1-next-1779822275564 → 4.1.1

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/cli.js CHANGED
@@ -246,14 +246,14 @@ function J(e4, t4, n4, r4, o3, i2) {
246
246
  }
247
247
  return c3 && (u4 = B(u4, c3, `$var.${s6}`)), u4;
248
248
  }
249
- const s5 = e4.match(Z);
249
+ const s5 = e4.match(U);
250
250
  if (s5 && r4) {
251
251
  const e5 = s5[1], t5 = s5[2];
252
252
  e5 in r4 || T(`Contract "${e5}" not found`);
253
253
  let n5 = r4[e5];
254
254
  return t5 && (n5 = B(n5, t5, `$contract.${e5}`)), n5;
255
255
  }
256
- const c2 = e4.match(W);
256
+ const c2 = e4.match(Z);
257
257
  if (c2) {
258
258
  const t5 = c2[1], r5 = c2[2], i3 = false === n4?.strictFlowRefs;
259
259
  o3 || T(`$flow.${t5}${r5 ? `.${r5}` : ""} cannot be resolved without a flow resolver`);
@@ -292,7 +292,7 @@ function J(e4, t4, n4, r4, o3, i2) {
292
292
  }
293
293
  return String(f3);
294
294
  });
295
- return l2 = l2.replace(U, (e5, t5, r5) => n4?.deferred ? void 0 !== r5 ? `${V}${t5}:${r5}` : `${V}${t5}` : "undefined" != typeof process && void 0 !== process.env?.[t5] ? process.env[t5] : void 0 !== r5 ? r5 : void T(`Environment variable "${t5}" not found and no default provided`)), l2;
295
+ return l2 = l2.replace(F, (e5, t5, r5) => n4?.deferred ? void 0 !== r5 ? `${V}${t5}:${r5}` : `${V}${t5}` : "undefined" != typeof process && void 0 !== process.env?.[t5] ? process.env[t5] : void 0 !== r5 ? r5 : void T(`Environment variable "${t5}" not found and no default provided`)), l2;
296
296
  }
297
297
  if (Array.isArray(e4)) return e4.map((e5) => J(e5, t4, n4, r4, o3, i2));
298
298
  if (null !== e4 && "object" == typeof e4) {
@@ -513,7 +513,7 @@ function xe(e4 = "entity action", t4 = {}) {
513
513
  const n4 = t4.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), r4 = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, o3 = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
514
514
  return je({ ...{ "cart view": { data: { currency: "EUR", value: 2 * r4.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...r4.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: r4.data.price + o3.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r4, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...o3, context: { shopping: ["checkout", 0] }, nested: [] }], trigger: "load" }, "order complete": { data: { id: "0rd3r1d", currency: "EUR", shipping: 5.22, taxes: 73.76, total: 555 }, context: { shopping: ["complete", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r4, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...o3, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "gift", data: { name: "Surprise" }, context: { shopping: ["complete", 0] }, nested: [] }], trigger: "load" }, "page view": { data: { domain: "www.example.com", title: "walkerOS documentation", referrer: "https://www.walkeros.io/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...r4, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...r4, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...r4.data, position: 3, promo: true }, context: { shopping: ["discover", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "promotion visible": { data: { name: "Setting up tracking easily", position: "hero" }, context: { ab_test: ["engagement", 0] }, globals: { pagegroup: "homepage" }, trigger: "visible" }, "session start": { data: { id: "s3ss10n", start: n4, isNew: true, count: 1, runs: 1, isStart: true, storage: true, referrer: "", device: "c00k13" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n", hash: "h4sh", address: "street number", email: "user@example.com", phone: "+49 123 456 789", userAgent: "Mozilla...", browser: "Chrome", browserVersion: "90", deviceType: "desktop", language: "de-DE", country: "DE", region: "HH", city: "Hamburg", zip: "20354", timezone: "Berlin", os: "walkerOS", osVersion: "1.0", screenSize: "1337x420", ip: "127.0.0.0", internal: true, custom: "value" } } }[e4], ...t4, name: e4 });
515
515
  }
516
- function Oe(e4 = 6, t4) {
516
+ function Ae(e4 = 6, t4) {
517
517
  if (t4) {
518
518
  const n5 = t4.length;
519
519
  let r4 = "";
@@ -588,7 +588,7 @@ function Me(e4) {
588
588
  function De(e4) {
589
589
  return Me(e4) ? e4 : void 0;
590
590
  }
591
- function Ue(e4, t4, n4) {
591
+ function Fe(e4, t4, n4) {
592
592
  return function(...r4) {
593
593
  try {
594
594
  return e4(...r4);
@@ -600,7 +600,7 @@ function Ue(e4, t4, n4) {
600
600
  }
601
601
  };
602
602
  }
603
- function Ze(e4, t4, n4) {
603
+ function Ue(e4, t4, n4) {
604
604
  return async function(...r4) {
605
605
  try {
606
606
  return await e4(...r4);
@@ -612,7 +612,7 @@ function Ze(e4, t4, n4) {
612
612
  }
613
613
  };
614
614
  }
615
- async function Fe(e4, t4, n4) {
615
+ async function We(e4, t4, n4) {
616
616
  const [r4, o3] = (e4.name || "").split(" ");
617
617
  if (!t4 || !r4 || !o3) return {};
618
618
  let i2, a4 = "", s5 = r4, c2 = o3;
@@ -635,8 +635,8 @@ async function He(e4, t4 = {}, n4 = {}) {
635
635
  if (!n4.collector) throw new Error("getMappingValue: context.collector is required");
636
636
  const i2 = { event: o3, mapping: t4, collector: n4.collector, logger: n4.collector.logger, consent: r4 }, a4 = ne(t4) ? t4 : [t4];
637
637
  for (const t5 of a4) {
638
- const r5 = await Ze(Le, (e5) => {
639
- if (e5 instanceof We) throw e5;
638
+ const r5 = await Ue(Le, (e5) => {
639
+ if (e5 instanceof Ze) throw e5;
640
640
  n4.collector && n4.collector.status.failed++, i2.logger.error("mapping processing failed", { event: o3, error: e5 });
641
641
  })(e4, t5, { ...i2, mapping: t5 });
642
642
  if (ie(r5)) return r5;
@@ -649,14 +649,14 @@ async function Le(e4, t4, n4) {
649
649
  const i2 = fe(r4) ? { key: r4 } : r4;
650
650
  if (!Object.keys(i2).length) return;
651
651
  const { condition: a4, consent: s5, fn: c2, key: l2, loop: u4, map: f3, set: p2, validate: d2, value: m3 } = i2, g3 = { ...n4, mapping: r4 };
652
- if (a4 && !await Ze(a4, (e5) => {
653
- if (e5 instanceof We) throw e5;
652
+ if (a4 && !await Ue(a4, (e5) => {
653
+ if (e5 instanceof Ze) throw e5;
654
654
  return g3.logger.error("mapping condition failed", { event: g3.event, error: e5 }), false;
655
655
  })(e4, g3)) return;
656
656
  if (s5 && !be(s5, g3.consent)) return m3;
657
657
  let y2 = ie(m3) ? m3 : e4;
658
- if (c2 && (y2 = await Ze(c2, (e5) => {
659
- if (e5 instanceof We) throw e5;
658
+ if (c2 && (y2 = await Ue(c2, (e5) => {
659
+ if (e5 instanceof Ze) throw e5;
660
660
  g3.logger.error("mapping fn failed", { event: g3.event, error: e5 });
661
661
  })(e4, g3)), l2 && (y2 = de(e4, l2, m3)), u4) {
662
662
  const [t6, n5] = u4, r5 = "this" === t6 ? [e4] : await He(e4, t6, g3);
@@ -665,8 +665,8 @@ async function Le(e4, t4, n4) {
665
665
  const o4 = await t6, i3 = await He(e4, r5, g3);
666
666
  return ie(i3) && (o4[n5] = i3), o4;
667
667
  }, Promise.resolve({})) : p2 && (y2 = await Promise.all(p2.map((t6) => Le(e4, t6, g3))));
668
- d2 && !await Ze(d2, (e5) => {
669
- if (e5 instanceof We) throw e5;
668
+ d2 && !await Ue(d2, (e5) => {
669
+ if (e5 instanceof Ze) throw e5;
670
670
  return g3.logger.error("mapping validate failed", { event: g3.event, error: e5 }), false;
671
671
  })(y2, g3) && (y2 = void 0);
672
672
  const h3 = De(y2);
@@ -678,7 +678,7 @@ async function Ke(e4, t4, n4) {
678
678
  const o4 = await He(e4, r5, { collector: n4, event: e4 });
679
679
  e4 = me(e4, t5, o4);
680
680
  }));
681
- const { eventMapping: r4, mappingKey: o3 } = await Fe(e4, t4.mapping, n4);
681
+ const { eventMapping: r4, mappingKey: o3 } = await We(e4, t4.mapping, n4);
682
682
  r4?.policy && await Promise.all(Object.entries(r4.policy).map(async ([t5, r5]) => {
683
683
  const o4 = await He(e4, r5, { collector: n4, event: e4 });
684
684
  e4 = me(e4, t5, o4);
@@ -737,16 +737,18 @@ function it(e4, t4) {
737
737
  })(e4) / 4294967295 < t4;
738
738
  }
739
739
  function at(e4, t4) {
740
- const n4 = t4.level ?? "standard";
741
- if ("off" === n4) return () => {
742
- };
743
- const r4 = t4.sample ?? 1, o3 = t4.includeIn ?? "trace" === n4, i2 = t4.includeOut ?? "trace" === n4, a4 = t4.includeMappingKey ?? "trace" === n4;
740
+ const n4 = "function" == typeof t4 ? t4 : () => t4;
744
741
  return function(t5) {
745
- if (t5.eventId && !it(t5.eventId, r4)) return;
746
- const n5 = { ...t5 };
747
- o3 || delete n5.inEvent, i2 || delete n5.outEvent, a4 || delete n5.mappingKey;
742
+ const r4 = n4();
743
+ if (!r4) return;
744
+ const o3 = r4.level ?? "standard";
745
+ if ("off" === o3) return;
746
+ const i2 = r4.sample, a4 = "number" == typeof i2 && Number.isFinite(i2) ? i2 : 1;
747
+ if (t5.eventId && !it(t5.eventId, a4)) return;
748
+ const s5 = r4.includeIn ?? "trace" === o3, c2 = r4.includeOut ?? "trace" === o3, l2 = r4.includeMappingKey ?? "trace" === o3, u4 = { ...t5 };
749
+ s5 || delete u4.inEvent, c2 || delete u4.outEvent, l2 || delete u4.mappingKey, "trace" !== o3 && u4.error?.message && u4.error.message.length > 256 && (u4.error = { ...u4.error, message: u4.error.message.slice(0, 256) + "\u2026" });
748
750
  try {
749
- e4(n5);
751
+ e4(u4);
750
752
  } catch {
751
753
  }
752
754
  };
@@ -763,26 +765,28 @@ function ct(e4) {
763
765
  return { flowId: e4.flowId, level: o3, sample: i2 };
764
766
  }
765
767
  function lt(e4, t4) {
766
- for (const n4 of e4.observers) try {
767
- n4(t4);
768
+ if (0 === e4.observers.size) return;
769
+ const n4 = Array.from(e4.observers);
770
+ for (const e5 of n4) try {
771
+ e5(t4);
768
772
  } catch {
769
773
  }
770
774
  }
771
775
  function ut(e4) {
772
- const t4 = e4.batchMs ?? 50, n4 = e4.batchSize ?? 50, r4 = e4.fetch ?? ((e5, t5) => globalThis.fetch(e5, t5)), o3 = e4.onError ?? (() => {
776
+ const t4 = e4.batchMs, n4 = "number" == typeof t4 && Number.isFinite(t4) && t4 > 0 ? Math.floor(t4) : 50, r4 = e4.batchSize, o3 = "number" == typeof r4 && Number.isFinite(r4) && r4 >= 1 ? Math.floor(r4) : 50, i2 = e4.fetch ?? ((e5, t5) => globalThis.fetch(e5, t5)), a4 = e4.onError ?? (() => {
773
777
  });
774
- let i2 = [], a4 = null;
775
- function s5() {
776
- if (0 === i2.length) return;
777
- const t5 = i2;
778
- i2 = [], a4 && (clearTimeout(a4), a4 = null), Promise.resolve().then(() => r4(e4.url, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${e4.token}` }, body: JSON.stringify(t5) })).then((e5) => {
779
- e5 && "object" == typeof e5 && "ok" in e5 && !e5.ok && o3(new Error(`Observer responded ${e5.status}`));
778
+ let s5 = [], c2 = null;
779
+ function l2() {
780
+ if (0 === s5.length) return;
781
+ const t5 = s5;
782
+ s5 = [], c2 && (clearTimeout(c2), c2 = null), Promise.resolve().then(() => i2(e4.url, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${e4.token}` }, body: JSON.stringify(t5) })).then((e5) => {
783
+ e5 && "object" == typeof e5 && "ok" in e5 && !e5.ok && a4(new Error(`Observer responded ${e5.status}`));
780
784
  }).catch((e5) => {
781
- o3(e5);
785
+ a4(e5);
782
786
  });
783
787
  }
784
788
  return (e5) => {
785
- i2.push(e5), i2.length >= n4 ? s5() : null === a4 && (a4 = setTimeout(s5, t4));
789
+ s5.push(e5), s5.length >= o3 ? l2() : null === c2 && (c2 = setTimeout(l2, n4));
786
790
  };
787
791
  }
788
792
  function kt(e4) {
@@ -962,7 +966,7 @@ async function Rt(e4, t4, n4, r4) {
962
966
  function Dt(e4, t4, n4, r4) {
963
967
  e4.set(t4, n4, 1e3 * r4);
964
968
  }
965
- async function Ut(e4, t4, n4, r4) {
969
+ async function Ft(e4, t4, n4, r4) {
966
970
  if (!t4) return e4;
967
971
  let o3 = e4;
968
972
  for (const [e5, i2] of Object.entries(t4)) {
@@ -972,7 +976,7 @@ async function Ut(e4, t4, n4, r4) {
972
976
  }
973
977
  function Lt(e4, t4) {
974
978
  const n4 = (function(e5) {
975
- return /* @__PURE__ */ new Set([...Zt[e5], ...Wt, ...Ft[e5]]);
979
+ return /* @__PURE__ */ new Set([...Ut[e5], ...Zt, ...Wt[e5]]);
976
980
  })(t4);
977
981
  for (const r5 of Object.keys(e4)) if (!n4.has(r5)) return { ok: false, code: "UNKNOWN_KEY", key: r5, reason: `Unknown key "${r5}" on ${t4}. Allowed: ${[...n4].sort().join(", ")}.` };
978
982
  const r4 = void 0 !== e4.package, o3 = void 0 !== e4.import, i2 = void 0 !== e4.code;
@@ -981,7 +985,7 @@ function Lt(e4, t4) {
981
985
  function Kt(e4, t4) {
982
986
  return "Transformer" === t4 && (void 0 === e4.code && void 0 === e4.package && void 0 === e4.import && (void 0 !== e4.before || void 0 !== e4.next || void 0 !== e4.cache || void 0 !== e4.mapping));
983
987
  }
984
- var e, t, r, a, u, f, m, h, b, C, R, D, U, Z, W, V, Q, ye, Ie, We, Ct, Zt, Wt, Ft, Ht;
988
+ var e, t, r, a, u, f, m, h, b, C, R, D, F, U, Z, V, Q, ye, Ie, Ze, Ct, Ut, Zt, Wt, Ht;
985
989
  var init_dist = __esm({
986
990
  "../core/dist/index.mjs"() {
987
991
  "use strict";
@@ -1005,9 +1009,9 @@ var init_dist = __esm({
1005
1009
  C = /* @__PURE__ */ new Set(["description", "examples", "title", "$comment"]);
1006
1010
  R = /^\$var\.([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)$/;
1007
1011
  D = /\$var\.([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)/g;
1008
- U = /\$env\.([a-zA-Z_][a-zA-Z0-9_]*)(?::([^"}\s]*))?/g;
1009
- Z = /^\$contract\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.(.+))?$/;
1010
- W = /^\$flow\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z0-9_.]+))?$/;
1012
+ F = /\$env\.([a-zA-Z_][a-zA-Z0-9_]*)(?::([^"}\s]*))?/g;
1013
+ U = /^\$contract\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.(.+))?$/;
1014
+ Z = /^\$flow\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z0-9_.]+))?$/;
1011
1015
  V = "__WALKEROS_ENV:";
1012
1016
  Q = { merge: true, shallow: true, extend: true };
1013
1017
  ye = { data: (e4) => e4.data, globals: (e4) => e4.globals, context: (e4) => e4.context, user: (e4) => e4.user, source: (e4) => e4.source, event: (e4) => ({ entity: e4.entity, action: e4.action, id: e4.id, timestamp: e4.timestamp, name: e4.name, trigger: e4.trigger, timing: e4.timing }) };
@@ -1015,15 +1019,15 @@ var init_dist = __esm({
1015
1019
  const o3 = `${f[e4]}${r4.length > 0 ? ` [${r4.join(":")}]` : ""}`, i2 = Object.keys(n4).length > 0, a4 = 0 === e4 ? console.error : 1 === e4 ? console.warn : console.log;
1016
1020
  i2 ? a4(o3, t4, n4) : a4(o3, t4);
1017
1021
  };
1018
- We = class e2 extends Error {
1022
+ Ze = class e2 extends Error {
1019
1023
  constructor(t4, n4) {
1020
1024
  super(t4, n4), this.name = "FatalError", Object.setPrototypeOf(this, e2.prototype);
1021
1025
  }
1022
1026
  };
1023
1027
  Ct = /* @__PURE__ */ new WeakMap();
1024
- Zt = { Source: ["code", "package", "import", "before", "next", "cache"], Transformer: ["code", "package", "import", "before", "next", "cache", "mapping"], Destination: ["code", "package", "import", "before", "next", "cache"], Store: ["code", "package", "import", "cache"] };
1025
- Wt = ["config", "env", "validate", "variables", "examples", "disabled", "id", "logger", "mock", "chainMocks"];
1026
- Ft = { Source: ["primary"], Transformer: [], Destination: [], Store: [] };
1028
+ Ut = { Source: ["code", "package", "import", "before", "next", "cache"], Transformer: ["code", "package", "import", "before", "next", "cache", "mapping"], Destination: ["code", "package", "import", "before", "next", "cache"], Store: ["code", "package", "import", "cache"] };
1029
+ Zt = ["config", "env", "validate", "variables", "examples", "disabled", "id", "logger", "mock", "chainMocks"];
1030
+ Wt = { Source: ["primary"], Transformer: [], Destination: [], Store: [] };
1027
1031
  Ht = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
1028
1032
  }
1029
1033
  });
@@ -1040,7 +1044,7 @@ function a2(a4, n4, u4 = {}) {
1040
1044
  e5.on("data", (t5) => {
1041
1045
  r4.push(t5);
1042
1046
  }), e5.on("end", () => {
1043
- const s5 = !!(e5.statusCode && e5.statusCode >= 200 && e5.statusCode < 300), a5 = Buffer.concat(r4).toString(), n6 = Ue(JSON.parse, () => a5)(a5);
1047
+ const s5 = !!(e5.statusCode && e5.statusCode >= 200 && e5.statusCode < 300), a5 = Buffer.concat(r4).toString(), n6 = Fe(JSON.parse, () => a5)(a5);
1044
1048
  t4({ ok: s5, data: n6, error: s5 ? void 0 : `${e5.statusCode} ${e5.statusMessage}` });
1045
1049
  });
1046
1050
  });
@@ -1656,7 +1660,7 @@ function M2(e4) {
1656
1660
  function T2(e4) {
1657
1661
  return n3.object({ policy: e4.optional().describe("Pre-processing policy rules") }).partial();
1658
1662
  }
1659
- function F(e4) {
1663
+ function F2(e4) {
1660
1664
  return n3.object({ consent: e4.optional().describe("Required consent states") }).partial();
1661
1665
  }
1662
1666
  function Pi(e4, t4) {
@@ -1857,7 +1861,7 @@ function wn(e4) {
1857
1861
  for (const [e5, i2] of Object.entries(t4)) i2 && "object" == typeof i2 && ("object" === i2.type && i2.properties && "string" != typeof i2.title && (i2.title = e5), wn(i2));
1858
1862
  }
1859
1863
  }
1860
- var e3, t3, i, r3, a3, s4, c, l, d, p, u3, m2, f2, g2, h2, b2, v2, S2, y, w2, k, C2, x, P2, j, E2, D2, I2, O, J2, z2, L, $, q2, N, A, W2, B2, U2, V2, H, _, Z2, G2, K2, Q2, X2, Y2, ee2, te, ie3, ne3, oe2, re3, ae2, se3, ce3, le3, de3, pe3, ue3, me3, fe3, ge3, he3, be3, ve2, Se2, ye3, we2, ke2, Ce3, xe3, Pe3, je3, Ee3, De3, Ie3, Oe3, Je, Re2, Me3, Te3, Fe2, ze3, Le3, $e3, qe2, Ne2, Ae2, We2, Be2, Ue3, Ve2, He2, _e3, Ze2, Ge, Ke2, Qe, Xe, Ye, et2, tt2, it2, nt2, ot2, rt, at2, st, ct3, lt3, dt, pt2, ut2, mt2, ft2, gt2, ht2, bt, vt, St, yt2, wt, kt2, Ct2, xt2, Pt2, jt2, Et2, Dt2, It2, Ot, Jt, Rt2, Mt2, Tt2, Ft2, zt2, Lt2, $t2, qt, Nt2, At, Wt2, Bt, Ut2, Vt, Ht2, _t2, Zt2, Gt, Kt2, Qt, Xt, Yt, ei, ti, ii, ni, oi, ri, ai, si, ci, li, di, pi, ui, mi, fi, gi, hi, bi, vi, Si, yi, wi, ki, Ci, xi, ji, Ei, Di, Ii, Oi, Ji, Ri, Mi, Ti, Fi, zi, Li, Wi, Bi, Ui, Vi, Hi, _i, Zi, Gi, Ki, Qi, Xi, en, tn, nn, on, an, sn, cn, ln, Cn;
1864
+ var e3, t3, i, r3, a3, s4, c, l, d, p, u3, m2, f2, g2, h2, b2, v2, S2, y, w2, k, C2, x, P2, j, E2, D2, I2, O, J2, z2, L, $, q2, N, A, W, B2, U2, V2, H, _, Z2, G2, K2, Q2, X2, Y2, ee2, te, ie3, ne3, oe2, re3, ae2, se3, ce3, le3, de3, pe3, ue3, me3, fe3, ge3, he3, be3, ve2, Se2, ye3, we2, ke2, Ce3, xe3, Pe3, je3, Ee3, De3, Ie3, Oe2, Je, Re2, Me3, Te3, Fe2, ze3, Le3, $e3, qe2, Ne2, Ae3, We2, Be2, Ue3, Ve2, He2, _e3, Ze2, Ge, Ke2, Qe, Xe, Ye, et2, tt2, it2, nt2, ot2, rt, at2, st, ct3, lt3, dt, pt2, ut2, mt2, ft2, gt2, ht2, bt, vt, St, yt2, wt, kt2, Ct2, xt2, Pt2, jt2, Et2, Dt2, It2, Ot, Jt, Rt2, Mt2, Tt2, Ft2, zt2, Lt2, $t2, qt, Nt2, At, Wt2, Bt, Ut2, Vt, Ht2, _t2, Zt2, Gt, Kt2, Qt, Xt, Yt, ei, ti, ii, ni, oi, ri, ai, si, ci, li, di, pi, ui, mi, fi, gi, hi, bi, vi, Si, yi, wi, ki, Ci, xi, ji, Ei, Di, Ii, Oi, Ji, Ri, Mi, Ti, Fi, zi, Li, Wi, Bi, Ui, Vi, Hi, _i, Zi, Gi, Ki, Qi, Xi, en, tn, nn, on, an, sn, cn, ln, Cn;
1861
1865
  var init_dev = __esm({
1862
1866
  "../core/dist/dev.mjs"() {
1863
1867
  "use strict";
@@ -1866,7 +1870,7 @@ var init_dev = __esm({
1866
1870
  for (var n4 in i2) e3(t4, n4, { get: i2[n4], enumerable: true });
1867
1871
  };
1868
1872
  i = {};
1869
- t3(i, { BaseContextConfig: () => L, CacheRuleSchema: () => Xe, CacheSchema: () => Ye, CacheSchemas: () => _e3, ClickIdEntrySchema: () => on, CodeSchema: () => en, CollectorSchemas: () => Et2, ConsentSchema: () => Z2, ContractActionsSchema: () => Ji, ContractRuleSchema: () => Mi, ContractSchema: () => Ti, ContractSchemaEntry: () => Oi, Counter: () => d, DeepPartialEventSchema: () => te, DestinationSchemas: () => Re2, DestinationsMapConfig: () => N, EntitiesSchema: () => X2, EntitySchema: () => Q2, EventCacheRuleSchema: () => Ze2, EventCacheSchema: () => Ge, EventSchema: () => Y2, FlowBundlePackageSchema: () => hi, FlowBundleSchema: () => bi, FlowCodeSchema: () => vi, FlowConfigSchema: () => Fi, FlowDestinationSchema: () => Di, FlowJsonSchema: () => Li, FlowSchema: () => zi, FlowSchemas: () => ui, FlowSourceSchema: () => ji, FlowStoreSchema: () => Ii, FlowTransformerSchema: () => Ei, GenericEnvConfig: () => J2, GenericSettingsConfig: () => O, HandlersConfig: () => x, HintSchema: () => tn, HintsSchema: () => nn, IdConfig: () => E2, Identifier: () => c, InitConfig: () => D2, LoggerConfigSchema: () => tt2, LoggerHandlerSchema: () => et2, LoopSchema: () => me3, MapSchema: () => ge3, MappingResultSchema: () => ke2, MappingSchemas: () => de3, MatchExpressionSchema: () => ze3, MatcherSchemas: () => Me3, OptionalPrimitiveValue: () => u3, OrderedPropertiesSchema: () => H, PartialEventSchema: () => ee2, PolicySchema: () => be3, PrimaryConfig: () => I2, PrimitiveValue: () => p, ProcessingControlConfig: () => $, PropertiesSchema: () => V2, PropertySchema: () => U2, PropertyTypeSchema: () => B2, QueueConfig: () => j, RequiredBoolean: () => s4, RequiredNumber: () => a3, RequiredString: () => r3, RouteSchema: () => We2, RouteWithoutManySchema: () => He2, RuleSchema: () => Se2, RulesSchema: () => ye3, RuntimeInstanceConfig: () => z2, SetSchema: () => fe3, SourceSchema: () => K2, SourceSchemas: () => Wt2, SourceTypeSchema: () => _, SourcesMapConfig: () => q2, StoreCacheRuleSchema: () => Ke2, StoreCacheSchema: () => Qe, StoreSchemas: () => si, Timestamp: () => l, TransformerSchemas: () => ii, UserSchema: () => G2, UtilitySchemas: () => m2, ValidateEventsSchema: () => Ci, ValidateSchema: () => xi, ValueConfigSchema: () => he3, ValueSchema: () => pe3, ValuesSchema: () => ue3, VerboseConfig: () => P2, WalkerOSSchemas: () => A, configJsonSchema: () => Wi, consentJsonSchema: () => le3, contractJsonSchema: () => Ki, contractRuleJsonSchema: () => Gi, createArraySchema: () => bn, createConsentConfig: () => F, createDataTransformationConfig: () => R2, createEnumSchema: () => vn, createMappingRulesConfig: () => M2, createObjectSchema: () => gn, createPolicyConfig: () => T2, createTupleSchema: () => Sn, destinationJsonSchema: () => Hi, entityJsonSchema: () => se3, eventJsonSchema: () => ie3, flowConfigJsonSchema: () => Ui, flowJsonSchema: () => Bi, loopJsonSchema: () => Pe3, mapJsonSchema: () => Ee3, orderedPropertiesJsonSchema: () => ae2, parseConfig: () => $i, parseFlow: () => Ni, partialEventJsonSchema: () => ne3, policyJsonSchema: () => De3, propertiesJsonSchema: () => re3, ruleJsonSchema: () => Ie3, rulesJsonSchema: () => Oe3, safeParseConfig: () => qi, safeParseFlow: () => Ai, setJsonSchema: () => je3, sourceJsonSchema: () => Vi, sourceTypeJsonSchema: () => ce3, storeJsonSchema: () => Zi, transformerJsonSchema: () => _i, userJsonSchema: () => oe2, validateEventsJsonSchema: () => Xi, validateFlowConfig: () => rn, validateJsonSchema: () => Qi, valueConfigJsonSchema: () => xe3, valueJsonSchema: () => Ce3, z: () => n3, zodToSchema: () => yn });
1873
+ t3(i, { BaseContextConfig: () => L, CacheRuleSchema: () => Xe, CacheSchema: () => Ye, CacheSchemas: () => _e3, ClickIdEntrySchema: () => on, CodeSchema: () => en, CollectorSchemas: () => Et2, ConsentSchema: () => Z2, ContractActionsSchema: () => Ji, ContractRuleSchema: () => Mi, ContractSchema: () => Ti, ContractSchemaEntry: () => Oi, Counter: () => d, DeepPartialEventSchema: () => te, DestinationSchemas: () => Re2, DestinationsMapConfig: () => N, EntitiesSchema: () => X2, EntitySchema: () => Q2, EventCacheRuleSchema: () => Ze2, EventCacheSchema: () => Ge, EventSchema: () => Y2, FlowBundlePackageSchema: () => hi, FlowBundleSchema: () => bi, FlowCodeSchema: () => vi, FlowConfigSchema: () => Fi, FlowDestinationSchema: () => Di, FlowJsonSchema: () => Li, FlowSchema: () => zi, FlowSchemas: () => ui, FlowSourceSchema: () => ji, FlowStoreSchema: () => Ii, FlowTransformerSchema: () => Ei, GenericEnvConfig: () => J2, GenericSettingsConfig: () => O, HandlersConfig: () => x, HintSchema: () => tn, HintsSchema: () => nn, IdConfig: () => E2, Identifier: () => c, InitConfig: () => D2, LoggerConfigSchema: () => tt2, LoggerHandlerSchema: () => et2, LoopSchema: () => me3, MapSchema: () => ge3, MappingResultSchema: () => ke2, MappingSchemas: () => de3, MatchExpressionSchema: () => ze3, MatcherSchemas: () => Me3, OptionalPrimitiveValue: () => u3, OrderedPropertiesSchema: () => H, PartialEventSchema: () => ee2, PolicySchema: () => be3, PrimaryConfig: () => I2, PrimitiveValue: () => p, ProcessingControlConfig: () => $, PropertiesSchema: () => V2, PropertySchema: () => U2, PropertyTypeSchema: () => B2, QueueConfig: () => j, RequiredBoolean: () => s4, RequiredNumber: () => a3, RequiredString: () => r3, RouteSchema: () => We2, RouteWithoutManySchema: () => He2, RuleSchema: () => Se2, RulesSchema: () => ye3, RuntimeInstanceConfig: () => z2, SetSchema: () => fe3, SourceSchema: () => K2, SourceSchemas: () => Wt2, SourceTypeSchema: () => _, SourcesMapConfig: () => q2, StoreCacheRuleSchema: () => Ke2, StoreCacheSchema: () => Qe, StoreSchemas: () => si, Timestamp: () => l, TransformerSchemas: () => ii, UserSchema: () => G2, UtilitySchemas: () => m2, ValidateEventsSchema: () => Ci, ValidateSchema: () => xi, ValueConfigSchema: () => he3, ValueSchema: () => pe3, ValuesSchema: () => ue3, VerboseConfig: () => P2, WalkerOSSchemas: () => A, configJsonSchema: () => Wi, consentJsonSchema: () => le3, contractJsonSchema: () => Ki, contractRuleJsonSchema: () => Gi, createArraySchema: () => bn, createConsentConfig: () => F2, createDataTransformationConfig: () => R2, createEnumSchema: () => vn, createMappingRulesConfig: () => M2, createObjectSchema: () => gn, createPolicyConfig: () => T2, createTupleSchema: () => Sn, destinationJsonSchema: () => Hi, entityJsonSchema: () => se3, eventJsonSchema: () => ie3, flowConfigJsonSchema: () => Ui, flowJsonSchema: () => Bi, loopJsonSchema: () => Pe3, mapJsonSchema: () => Ee3, orderedPropertiesJsonSchema: () => ae2, parseConfig: () => $i, parseFlow: () => Ni, partialEventJsonSchema: () => ne3, policyJsonSchema: () => De3, propertiesJsonSchema: () => re3, ruleJsonSchema: () => Ie3, rulesJsonSchema: () => Oe2, safeParseConfig: () => qi, safeParseFlow: () => Ai, setJsonSchema: () => je3, sourceJsonSchema: () => Vi, sourceTypeJsonSchema: () => ce3, storeJsonSchema: () => Zi, transformerJsonSchema: () => _i, userJsonSchema: () => oe2, validateEventsJsonSchema: () => Xi, validateFlowConfig: () => rn, validateJsonSchema: () => Qi, valueConfigJsonSchema: () => xe3, valueJsonSchema: () => Ce3, z: () => n3, zodToSchema: () => yn });
1870
1874
  r3 = n3.string();
1871
1875
  a3 = n3.number();
1872
1876
  s4 = n3.boolean();
@@ -1924,13 +1928,13 @@ var init_dev = __esm({
1924
1928
  ce3 = o2(_);
1925
1929
  le3 = o2(Z2);
1926
1930
  de3 = {};
1927
- t3(de3, { ConfigSchema: () => we2, LoopSchema: () => me3, MapSchema: () => ge3, PolicySchema: () => be3, ResultSchema: () => ke2, RulePatchSchema: () => ve2, RuleSchema: () => Se2, RulesSchema: () => ye3, SetSchema: () => fe3, ValueConfigSchema: () => he3, ValueSchema: () => pe3, ValuesSchema: () => ue3, configJsonSchema: () => Je, loopJsonSchema: () => Pe3, mapJsonSchema: () => Ee3, policyJsonSchema: () => De3, ruleJsonSchema: () => Ie3, rulesJsonSchema: () => Oe3, setJsonSchema: () => je3, valueConfigJsonSchema: () => xe3, valueJsonSchema: () => Ce3 });
1928
- pe3 = n3.lazy(() => n3.union([n3.string().describe('String value or property path (e.g., "data.id")'), n3.number().describe("Numeric value"), n3.boolean().describe("Boolean value"), n3.lazy(() => W2), n3.array(pe3).describe("Array of values")])).meta({ id: "MappingValue", title: "Mapping.Value", description: "Polymorphic transform primitive used in every mapping field. A string path, constant, operator object (map/loop/set/condition/consent), or array of values." });
1931
+ t3(de3, { ConfigSchema: () => we2, LoopSchema: () => me3, MapSchema: () => ge3, PolicySchema: () => be3, ResultSchema: () => ke2, RulePatchSchema: () => ve2, RuleSchema: () => Se2, RulesSchema: () => ye3, SetSchema: () => fe3, ValueConfigSchema: () => he3, ValueSchema: () => pe3, ValuesSchema: () => ue3, configJsonSchema: () => Je, loopJsonSchema: () => Pe3, mapJsonSchema: () => Ee3, policyJsonSchema: () => De3, ruleJsonSchema: () => Ie3, rulesJsonSchema: () => Oe2, setJsonSchema: () => je3, valueConfigJsonSchema: () => xe3, valueJsonSchema: () => Ce3 });
1932
+ pe3 = n3.lazy(() => n3.union([n3.string().describe('String value or property path (e.g., "data.id")'), n3.number().describe("Numeric value"), n3.boolean().describe("Boolean value"), n3.lazy(() => W), n3.array(pe3).describe("Array of values")])).meta({ id: "MappingValue", title: "Mapping.Value", description: "Polymorphic transform primitive used in every mapping field. A string path, constant, operator object (map/loop/set/condition/consent), or array of values." });
1929
1933
  ue3 = n3.array(pe3).meta({ id: "MappingValues", title: "Mapping.Values", description: "Array of transformation values." }).describe("Array of transformation values");
1930
1934
  me3 = n3.lazy(() => n3.tuple([pe3, pe3]).describe("Loop transformation: [source, transform] tuple for array processing")).meta({ id: "MappingLoop", title: "Mapping.Loop", description: "Loop tuple [source, transform] for iterating and transforming arrays." });
1931
1935
  fe3 = n3.lazy(() => n3.array(pe3).describe("Set: Array of values for selection or combination")).meta({ id: "MappingSet", title: "Mapping.Set", description: "Set: array of values for selection or combination." });
1932
1936
  ge3 = n3.lazy(() => n3.record(n3.string(), pe3).describe("Map: Object mapping keys to transformation values")).meta({ id: "MappingMap", title: "Mapping.Map", description: "Map: object mapping keys to transformation values." });
1933
- he3 = W2 = n3.object({ key: n3.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'), value: n3.union([n3.string(), n3.number(), n3.boolean()]).optional().describe("Static primitive value"), fn: n3.string().optional().describe("Custom transformation function as string (serialized)"), map: ge3.optional().describe("Object mapping: transform event data to structured output"), loop: me3.optional().describe("Loop transformation: [source, transform] for array processing"), set: fe3.optional().describe("Set of values: combine or select from multiple values"), consent: Z2.optional().describe("Required consent states to include this value"), condition: n3.string().optional().describe("Condition function as string: return true to include value"), validate: n3.string().optional().describe("Validation function as string: return true if value is valid") }).refine((e4) => Object.keys(e4).length > 0, { message: "ValueConfig must have at least one property" }).meta({ id: "MappingValueConfig", title: "Mapping.ValueConfig", description: "Object-form value transformation with map/loop/set/condition/consent etc." }).describe("Value transformation configuration with multiple strategies");
1937
+ he3 = W = n3.object({ key: n3.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'), value: n3.union([n3.string(), n3.number(), n3.boolean()]).optional().describe("Static primitive value"), fn: n3.string().optional().describe("Custom transformation function as string (serialized)"), map: ge3.optional().describe("Object mapping: transform event data to structured output"), loop: me3.optional().describe("Loop transformation: [source, transform] for array processing"), set: fe3.optional().describe("Set of values: combine or select from multiple values"), consent: Z2.optional().describe("Required consent states to include this value"), condition: n3.string().optional().describe("Condition function as string: return true to include value"), validate: n3.string().optional().describe("Validation function as string: return true if value is valid") }).refine((e4) => Object.keys(e4).length > 0, { message: "ValueConfig must have at least one property" }).meta({ id: "MappingValueConfig", title: "Mapping.ValueConfig", description: "Object-form value transformation with map/loop/set/condition/consent etc." }).describe("Value transformation configuration with multiple strategies");
1934
1938
  be3 = n3.record(n3.string(), pe3).meta({ id: "MappingPolicy", title: "Mapping.Policy", description: "Policy rules for event pre-processing (key \u2192 value transformation)." }).describe("Policy rules for event pre-processing (key \u2192 value mapping)");
1935
1939
  ve2 = n3.object({ name: n3.string().nullable().optional(), data: n3.union([pe3, ue3]).nullable().optional(), settings: n3.unknown().nullable().optional(), condition: n3.string().nullable().optional(), consent: Z2.nullable().optional(), policy: be3.nullable().optional(), batch: n3.union([n3.number(), n3.object({ wait: n3.number().optional(), size: n3.number().optional(), age: n3.number().optional() })]).nullable().optional(), include: n3.array(n3.string()).nullable().optional(), ignore: n3.boolean().nullable().optional(), silent: n3.boolean().nullable().optional() }).meta({ id: "MappingRulePatch", title: "Mapping.RulePatch", description: "Partial rule deep-merged onto a package-shipped default; a null value clears the inherited field." }).describe("Partial rule for `extend`; null clears an inherited field");
1936
1940
  Se2 = n3.object({ name: n3.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'), data: n3.union([pe3, ue3]).optional().describe("Data transformation rules for event"), settings: n3.unknown().optional().describe("Destination-specific settings for this event mapping"), condition: n3.string().optional().describe("Condition function as string: return true to process event"), consent: Z2.optional().describe("Required consent states to process this event"), policy: be3.optional().describe("Event-level policy overrides (applied after config-level policy)"), batch: n3.union([n3.number(), n3.object({ wait: n3.number().optional(), size: n3.number().optional(), age: n3.number().optional() })]).optional().describe("Batch scheduling: bare number is the debounce wait window (legacy); object form supports wait/size/age."), include: n3.array(n3.string()).optional().describe('Event sections (e.g. ["context", "globals"]) flattened into context.data'), ignore: n3.boolean().optional().describe("Skip the event entirely. No push, no side effects. Use for suppression."), silent: n3.boolean().optional().describe("Run side effects (settings.identify, ...) but suppress the destination default push call."), extend: ve2.optional().describe("Merge mode: a partial rule deep-merged onto the package-shipped default at this key (instead of replacing it). A null value clears an inherited field."), remove: n3.array(n3.string()).optional().describe("Dotted paths stripped from the produced data payload after evaluation (applied last).") }).meta({ id: "MappingRule", title: "Mapping.Rule", description: "Configuration for transforming a single event at one stage of the flow (source or destination)." }).describe("Mapping rule for specific entity-action combination");
@@ -1944,7 +1948,7 @@ var init_dev = __esm({
1944
1948
  Ee3 = o2(ge3);
1945
1949
  De3 = o2(be3);
1946
1950
  Ie3 = o2(Se2);
1947
- Oe3 = o2(ye3);
1951
+ Oe2 = o2(ye3);
1948
1952
  Je = o2(we2);
1949
1953
  Re2 = {};
1950
1954
  t3(Re2, { BatchSchema: () => dt, ConfigSchema: () => it2, ContextSchema: () => rt, DLQSchema: () => St, DataSchema: () => pt2, DestinationPolicySchema: () => ot2, DestinationsSchema: () => gt2, InitDestinationsSchema: () => ft2, InitSchema: () => mt2, InstanceSchema: () => ut2, PartialConfigSchema: () => nt2, PushBatchContextSchema: () => st, PushContextSchema: () => at2, PushEventSchema: () => ct3, PushEventsSchema: () => lt3, PushResultSchema: () => bt, RefSchema: () => ht2, ResultSchema: () => vt, batchJsonSchema: () => xt2, configJsonSchema: () => yt2, contextJsonSchema: () => kt2, instanceJsonSchema: () => Pt2, partialConfigJsonSchema: () => wt, pushContextJsonSchema: () => Ct2, resultJsonSchema: () => jt2 });
@@ -1957,8 +1961,8 @@ var init_dev = __esm({
1957
1961
  $e3 = n3.strictObject({ match: ze3.optional(), one: n3.array(n3.lazy(() => We2)) });
1958
1962
  qe2 = n3.strictObject({ match: ze3.optional(), many: n3.array(n3.lazy(() => We2)) });
1959
1963
  Ne2 = n3.strictObject({ match: ze3 });
1960
- Ae2 = n3.union([Le3, $e3, qe2, Ne2]);
1961
- We2 = n3.union([n3.string(), n3.array(n3.lazy(() => We2)), Ae2]).meta({ id: "Route", title: "Route", description: "Recursive route: string ID, sequence of routes, or a RouteConfig (next/one/many/gate)." });
1964
+ Ae3 = n3.union([Le3, $e3, qe2, Ne2]);
1965
+ We2 = n3.union([n3.string(), n3.array(n3.lazy(() => We2)), Ae3]).meta({ id: "Route", title: "Route", description: "Recursive route: string ID, sequence of routes, or a RouteConfig (next/one/many/gate)." });
1962
1966
  Be2 = n3.strictObject({ match: ze3.optional(), next: n3.lazy(() => He2) });
1963
1967
  Ue3 = n3.strictObject({ match: ze3.optional(), one: n3.array(n3.lazy(() => He2)) });
1964
1968
  Ve2 = n3.union([Be2, Ue3, Ne2]);
@@ -5468,8 +5472,8 @@ async function ue2(e4, t4, n4, o3, s5, r4, a4) {
5468
5472
  }
5469
5473
  if (s5 && s5._meta && s5._meta.path.length > 256) return e4.logger.error(`Max path length exceeded at ${o4}`), { event: null, respond: c2 };
5470
5474
  s5 && s5._meta && (s5._meta.hops++, s5._meta.path.push(o4));
5471
- if (!await Ze(ae, (t5) => {
5472
- if (t5 instanceof We) throw t5;
5475
+ if (!await Ue(ae, (t5) => {
5476
+ if (t5 instanceof Ze) throw t5;
5473
5477
  return e4.status.failed++, e4.logger.scope(`transformer:${r5.type || "unknown"}`).error("transformer init failed", { transformer: o4, error: t5 }), false;
5474
5478
  })(e4, r5, o4)) return { event: null, respond: c2 };
5475
5479
  if (a4 && void 0 !== r5.config?.chainMocks?.[a4]) {
@@ -5503,9 +5507,9 @@ async function ue2(e4, t4, n4, o3, s5, r4, a4) {
5503
5507
  if (n6.stopped) return { event: Array.isArray(n6.event) ? n6.event[0] : n6.event, respond: n6.respond ?? c2, stopped: true };
5504
5508
  n6.respond && (c2 = n6.respond), i2 = Array.isArray(n6.event) ? n6.event[0] : n6.event;
5505
5509
  }
5506
- } else n5.length > 1 && await Promise.all(n5.map((n6) => Ze(ue2, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n6} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, re2(n6, oe(t4)), i2, ce2(s5, n6), void 0, a4)));
5510
+ } else n5.length > 1 && await Promise.all(n5.map((n6) => Ue(ue2, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n6} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, re2(n6, oe(t4)), i2, ce2(s5, n6), void 0, a4)));
5507
5511
  }
5508
- const g3 = await Ze(ie2, (t5) => (e4.logger.scope(`transformer:${r5.type || "unknown"}`).error("Push failed", { error: t5 }), false))(e4, r5, o4, i2, s5, c2);
5512
+ const g3 = await Ue(ie2, (t5) => (e4.logger.scope(`transformer:${r5.type || "unknown"}`).error("Push failed", { error: t5 }), false))(e4, r5, o4, i2, s5, c2);
5509
5513
  if (false === g3) return { event: null, respond: c2 };
5510
5514
  if (Array.isArray(g3)) {
5511
5515
  const r6 = n4.slice(n4.indexOf(o4) + 1), u5 = await Promise.all(g3.map(async (n5) => {
@@ -5517,7 +5521,7 @@ async function ue2(e4, t4, n4, o3, s5, r4, a4) {
5517
5521
  const n6 = re2(s6[0], oe(t4));
5518
5522
  return n6.length > 0 ? ue2(e4, t4, n6, o5, u6, c2, a4) : { event: o5, respond: c2 };
5519
5523
  }
5520
- return (await Promise.all(s6.map((n6) => Ze(ue2, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n6} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, re2(n6, oe(t4)), o5, ce2(u6, n6), void 0, a4)))).map((e5) => ({ event: e5.event, respond: void 0 }));
5524
+ return (await Promise.all(s6.map((n6) => Ue(ue2, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n6} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, re2(n6, oe(t4)), o5, ce2(u6, n6), void 0, a4)))).map((e5) => ({ event: e5.event, respond: void 0 }));
5521
5525
  }
5522
5526
  return r6.length > 0 ? ue2(e4, t4, r6, o5, u6, c2, a4) : { event: o5, respond: c2 };
5523
5527
  }));
@@ -5542,7 +5546,7 @@ async function ue2(e4, t4, n4, o3, s5, r4, a4) {
5542
5546
  const u5 = re2(o6[0], oe(t4));
5543
5547
  return u5.length > 0 ? ue2(e4, t4, u5, n5 || i2, s5, c2, a4) : (e4.logger.warn(`Branch target not found: ${JSON.stringify(r6)}`), { event: null, respond: c2 });
5544
5548
  }
5545
- return await Promise.all(o6.map((o7) => Ze(ue2, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${o7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, re2(o7, oe(t4)), n5 || i2, ce2(s5, o7), void 0, a4))), { event: null, respond: void 0 };
5549
+ return await Promise.all(o6.map((o7) => Ue(ue2, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${o7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, re2(o7, oe(t4)), n5 || i2, ce2(s5, o7), void 0, a4))), { event: null, respond: void 0 };
5546
5550
  }
5547
5551
  n5 && (i2 = n5);
5548
5552
  }
@@ -5554,7 +5558,7 @@ async function ue2(e4, t4, n4, o3, s5, r4, a4) {
5554
5558
  const o5 = re2(n5[0], oe(t4));
5555
5559
  return o5.length > 0 ? ue2(e4, t4, o5, i2, s5, c2, a4) : { event: i2, respond: c2 };
5556
5560
  }
5557
- return n5.length > 1 ? (await Promise.all(n5.map((n6) => Ze(ue2, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n6} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, re2(n6, oe(t4)), i2, ce2(s5, n6), void 0, a4))), { event: null, respond: void 0 }) : { event: i2, respond: c2 };
5561
+ return n5.length > 1 ? (await Promise.all(n5.map((n6) => Ue(ue2, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n6} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, re2(n6, oe(t4)), i2, ce2(s5, n6), void 0, a4))), { event: null, respond: void 0 }) : { event: i2, respond: c2 };
5558
5562
  }
5559
5563
  }
5560
5564
  return { event: i2, respond: c2 };
@@ -5570,8 +5574,8 @@ async function fe2(e4, t4, n4) {
5570
5574
  const o3 = t4.queueOn;
5571
5575
  t4.queueOn = [];
5572
5576
  const s5 = n4 || t4.config?.id || "unknown";
5573
- for (const { type: n5, data: r4 } of o3) await Ze(t4.on, (t5) => {
5574
- if (t5 instanceof We) throw t5;
5577
+ for (const { type: n5, data: r4 } of o3) await Ue(t4.on, (t5) => {
5578
+ if (t5 instanceof Ze) throw t5;
5575
5579
  e4.status.failed++, e4.logger.scope("source").error("source on flush failed", { sourceId: s5, type: n5, error: t5 });
5576
5580
  })(n5, r4);
5577
5581
  }
@@ -5600,12 +5604,12 @@ async function ge2(e4, t4, n4) {
5600
5604
  if (o5) {
5601
5605
  if ("HIT" === o5.status && void 0 !== o5.value && l2.stop) {
5602
5606
  let t6 = o5.value;
5603
- return o5.rule.update && (t6 = await Ut(t6, o5.rule.update, { ...n6, cache: { status: "HIT" } }, e4)), r5.respond?.(t6), { ok: true };
5607
+ return o5.rule.update && (t6 = await Ft(t6, o5.rule.update, { ...n6, cache: { status: "HIT" } }, e4)), r5.respond?.(t6), { ok: true };
5604
5608
  }
5605
5609
  if ("MISS" === o5.status && l2.stop && r5.respond) {
5606
5610
  const s6 = r5.respond, i3 = o5.rule.update, c3 = { ...n6, cache: { status: "MISS" } }, u6 = o5.key, d4 = o5.rule.ttl, l3 = (n7) => {
5607
5611
  Dt(t5, u6, n7, d4), i3 ? a5 = (async () => {
5608
- const t6 = await Ut(n7, i3, c3, e4);
5612
+ const t6 = await Ft(n7, i3, c3, e4);
5609
5613
  s6(t6);
5610
5614
  })() : s6(n7);
5611
5615
  };
@@ -5620,7 +5624,7 @@ async function ge2(e4, t4, n4) {
5620
5624
  return 0 === t5.length ? { kind: "single", preChain: [] } : 1 === t5.length ? { kind: "single", preChain: re2(t5[0], oe(e4.transformers)) } : { kind: "many", branches: t5.map((t6) => re2(t6, oe(e4.transformers))) };
5621
5625
  })() : { kind: "single", preChain: [] };
5622
5626
  let y3 = { ok: true };
5623
- for (const n6 of d3) "many" === g4.kind ? (await Promise.all(g4.branches.map((a6, i3) => Ze(async () => h3 ? m3(n6) : m3(n6, { ...o4, id: t4, ingest: ce2(r5.ingest, `${t4}.${i3}`), respond: void 0, mapping: s5, preChain: a6 }), (t5) => (e4.logger.scope("source:many").error(`many branch ${i3} failed`, { error: t5 }), { ok: true }))())), y3 = { ok: true }) : y3 = h3 ? await m3(n6) : await m3(n6, { ...o4, id: t4, ingest: r5.ingest, respond: r5.respond, mapping: s5, preChain: g4.preChain });
5627
+ for (const n6 of d3) "many" === g4.kind ? (await Promise.all(g4.branches.map((a6, i3) => Ue(async () => h3 ? m3(n6) : m3(n6, { ...o4, id: t4, ingest: ce2(r5.ingest, `${t4}.${i3}`), respond: void 0, mapping: s5, preChain: a6 }), (t5) => (e4.logger.scope("source:many").error(`many branch ${i3} failed`, { error: t5 }), { ok: true }))())), y3 = { ok: true }) : y3 = h3 ? await m3(n6) : await m3(n6, { ...o4, id: t4, ingest: r5.ingest, respond: r5.respond, mapping: s5, preChain: g4.preChain });
5624
5628
  return a5 && await a5, y3;
5625
5629
  }, w3 = async (n5) => {
5626
5630
  const o4 = E(t4);
@@ -5633,8 +5637,8 @@ async function ge2(e4, t4, n4) {
5633
5637
  } }, k2 = { collector: e4, logger: v3, id: t4, config: s5, env: b3, withScope: async (e5, t5, n5) => {
5634
5638
  const o4 = { ingest: await w3(e5), respond: t5 };
5635
5639
  return n5({ ...b3, push: (e6, t6 = {}) => y2(e6, t6, o4), ingest: o4.ingest, respond: o4.respond });
5636
- } }, C3 = await Ze(o3, (n5) => {
5637
- if (n5 instanceof We) throw n5;
5640
+ } }, C3 = await Ue(o3, (n5) => {
5641
+ if (n5 instanceof Ze) throw n5;
5638
5642
  e4.status.failed++, e4.logger.scope("source").error("source factory failed", { sourceId: t4, error: n5 });
5639
5643
  })(k2);
5640
5644
  if (!C3) return;
@@ -5653,15 +5657,15 @@ async function me2(e4, t4 = {}) {
5653
5657
  for (const t5 of Object.keys(n4)) {
5654
5658
  const n5 = e4.sources[t5];
5655
5659
  let o3 = false;
5656
- n5.init && await Ze(n5.init.bind(n5), (n6) => {
5657
- if (n6 instanceof We) throw n6;
5660
+ n5.init && await Ue(n5.init.bind(n5), (n6) => {
5661
+ if (n6 instanceof Ze) throw n6;
5658
5662
  o3 = true, e4.status.failed++, e4.logger.scope("source").error("source init failed", { sourceId: t5, error: n6 });
5659
5663
  })(), o3 || (n5.config.init = true, pe2(n5) && await fe2(e4, n5, t5));
5660
5664
  }
5661
5665
  return n4;
5662
5666
  }
5663
5667
  function he2(e4, t4, n4, o3) {
5664
- if (n4 instanceof We) throw n4;
5668
+ if (n4 instanceof Ze) throw n4;
5665
5669
  e4.logger.scope("on").error("on callback failed", { kind: t4, ...o3, error: n4 });
5666
5670
  }
5667
5671
  function ye2(e4, t4) {
@@ -5676,7 +5680,7 @@ async function we(e4, t4, n4) {
5676
5680
  function ve(e4, t4, n4, o3, s5) {
5677
5681
  if (!t4.on) return;
5678
5682
  const r4 = t4.type || "unknown", a4 = e4.logger.scope(r4).scope("on").scope(o3), i2 = { collector: e4, logger: a4, id: n4, config: t4.config, data: s5, env: Be(t4.env, t4.config.env) };
5679
- Ue(t4.on, (t5) => he2(e4, "destination", t5, { destId: n4, type: o3 }))(o3, i2);
5683
+ Fe(t4.on, (t5) => he2(e4, "destination", t5, { destId: n4, type: o3 }))(o3, i2);
5680
5684
  }
5681
5685
  function be2(e4, t4, o3, s5) {
5682
5686
  let r4;
@@ -5710,7 +5714,7 @@ function be2(e4, t4, o3, s5) {
5710
5714
  const s6 = o4 || e5.consent, r5 = ye2(e5, n.Commands.Consent);
5711
5715
  t5.forEach((t6) => {
5712
5716
  Object.keys(s6).filter((e6) => e6 in t6).forEach((n4) => {
5713
- Ue(t6[n4], (t7) => he2(e5, "consent", t7, { key: n4 }))(s6, r5);
5717
+ Fe(t6[n4], (t7) => he2(e5, "consent", t7, { key: n4 }))(s6, r5);
5714
5718
  });
5715
5719
  });
5716
5720
  })(e4, o3, s5);
@@ -5720,7 +5724,7 @@ function be2(e4, t4, o3, s5) {
5720
5724
  if (!e5.allowed) return;
5721
5725
  const o4 = ye2(e5, n.Commands.Ready);
5722
5726
  t5.forEach((t6) => {
5723
- Ue(t6, (t7) => he2(e5, "ready", t7))(void 0, o4);
5727
+ Fe(t6, (t7) => he2(e5, "ready", t7))(void 0, o4);
5724
5728
  });
5725
5729
  })(e4, o3);
5726
5730
  break;
@@ -5729,7 +5733,7 @@ function be2(e4, t4, o3, s5) {
5729
5733
  if (!e5.allowed) return;
5730
5734
  const o4 = ye2(e5, n.Commands.Run);
5731
5735
  t5.forEach((t6) => {
5732
- Ue(t6, (t7) => he2(e5, "run", t7))(void 0, o4);
5736
+ Fe(t6, (t7) => he2(e5, "run", t7))(void 0, o4);
5733
5737
  });
5734
5738
  })(e4, o3);
5735
5739
  break;
@@ -5738,14 +5742,14 @@ function be2(e4, t4, o3, s5) {
5738
5742
  if (!e5.session) return;
5739
5743
  const o4 = ye2(e5, n.Commands.Session);
5740
5744
  t5.forEach((t6) => {
5741
- Ue(t6, (t7) => he2(e5, "session", t7))(e5.session, o4);
5745
+ Fe(t6, (t7) => he2(e5, "session", t7))(e5.session, o4);
5742
5746
  });
5743
5747
  })(e4, o3);
5744
5748
  break;
5745
5749
  default: {
5746
5750
  const n4 = ye2(e4, t4);
5747
5751
  o3.forEach((o4) => {
5748
- "function" == typeof o4 && Ue(o4, (n5) => he2(e4, "generic", n5, { type: t4 }))(r4, n4);
5752
+ "function" == typeof o4 && Fe(o4, (n5) => he2(e4, "generic", n5, { type: t4 }))(r4, n4);
5749
5753
  });
5750
5754
  break;
5751
5755
  }
@@ -5784,7 +5788,7 @@ async function ke(e4, t4, o3, s5) {
5784
5788
  -1 !== e5 && o4.config.require.splice(e5, 1);
5785
5789
  }
5786
5790
  if (o4.on) if (pe2(o4)) {
5787
- false === await Ze(o4.on, (o5) => he2(e4, "source", o5, { sourceId: n4, type: t4 }))(t4, r4) && (i2 = true);
5791
+ false === await Ue(o4.on, (o5) => he2(e4, "source", o5, { sourceId: n4, type: t4 }))(t4, r4) && (i2 = true);
5788
5792
  } else o4.queueOn = o4.queueOn || [], o4.queueOn.push({ type: t4, data: r4 });
5789
5793
  }
5790
5794
  Object.entries(e4.destinations).forEach(([n4, o4]) => {
@@ -5822,9 +5826,9 @@ function qe(e4, t4, n4, o3) {
5822
5826
  function xe2(e4) {
5823
5827
  Ie2.delete(e4);
5824
5828
  }
5825
- var Oe2 = Object.freeze({ batched: true });
5829
+ var Oe = Object.freeze({ batched: true });
5826
5830
  function Se(e4) {
5827
- return e4 === Oe2;
5831
+ return e4 === Oe;
5828
5832
  }
5829
5833
  function je2(e4) {
5830
5834
  return void 0 === e4 ? {} : "number" == typeof e4 ? { wait: e4 } : { wait: e4.wait, size: e4.size, age: e4.age };
@@ -5832,7 +5836,7 @@ function je2(e4) {
5832
5836
  function De2(e4, t4) {
5833
5837
  return e4.status.destinations[t4] || (e4.status.destinations[t4] = { count: 0, failed: 0, duration: 0, queuePushSize: 0, dlqSize: 0 }), e4.status.destinations[t4];
5834
5838
  }
5835
- function Ae(e4, t4, n4, o3) {
5839
+ function Ae2(e4, t4, n4, o3) {
5836
5840
  e4.dropped[t4] || (e4.dropped[t4] = {});
5837
5841
  const s5 = e4.dropped[t4];
5838
5842
  return s5[n4] = (s5[n4] ?? 0) + o3, s5[n4];
@@ -5853,7 +5857,7 @@ async function Ee2(e4, t4) {
5853
5857
  const d2 = { ...n4, config: u4, env: Be(n4.env, s5) };
5854
5858
  let l2 = d2.config.id;
5855
5859
  if (!l2) do {
5856
- l2 = Oe(5, "abcdefghijklmnopqrstuvwxyz");
5860
+ l2 = Ae(5, "abcdefghijklmnopqrstuvwxyz");
5857
5861
  } while (e4.destinations[l2]);
5858
5862
  return e4.destinations[l2] = d2, false !== d2.config.queue && (d2.queuePush = [...e4.queue]), Me2(e4, void 0, {}, { [l2]: d2 });
5859
5863
  }
@@ -5865,7 +5869,7 @@ async function Me2(e4, t4, n4 = {}, o3) {
5865
5869
  if (void 0 === n5) throw new Error("Collector.Config.queueMax is undefined; defaults must be seeded by collector()");
5866
5870
  const o4 = Ce2(e4.queue, t4, { max: n5 });
5867
5871
  if (o4.dropped > 0) {
5868
- const t5 = Ae(e4.status, o("collector"), "queue", o4.dropped);
5872
+ const t5 = Ae2(e4.status, o("collector"), "queue", o4.dropped);
5869
5873
  qe(e4.queue, e4.logger, "collector.queue overflow; oldest events dropped", { buffer: "queue", cap: n5, droppedCount: t5 });
5870
5874
  } else e4.queue.length < n5 && xe2(e4.queue);
5871
5875
  e4.status.in++;
@@ -5902,7 +5906,7 @@ async function Me2(e4, t4, n4 = {}, o3) {
5902
5906
  }
5903
5907
  if (a5 > 0) {
5904
5908
  De2(e4, n5);
5905
- const o5 = Ae(e4.status, o("destination", n5), "queue", a5);
5909
+ const o5 = Ae2(e4.status, o("destination", n5), "queue", a5);
5906
5910
  qe(t5, e4.logger.scope(s6.type || "unknown"), "destination.queuePush overflow; oldest events dropped", { buffer: "queuePush", destination: n5, cap: r5.max, droppedCount: o5 });
5907
5911
  } else t5.length < r5.max && xe2(t5);
5908
5912
  }
@@ -5939,13 +5943,13 @@ async function Me2(e4, t4, n4 = {}, o3) {
5939
5943
  }
5940
5944
  const p2 = Date.now();
5941
5945
  let m3 = false;
5942
- const y2 = await Ze(_e2, (t6) => {
5946
+ const y2 = await Ue(_e2, (t6) => {
5943
5947
  const n5 = s6.type || "unknown";
5944
5948
  e4.logger.scope(n5).error("Push failed", { error: t6, event: u4.name }), C3 = t6, m3 = true;
5945
5949
  const r6 = s6.dlq, a5 = s6.config.id || o4, i2 = { max: s6.config.dlqMax ?? 100 }, c2 = Ce2(r6, [u4, t6], i2);
5946
5950
  if (c2.dropped > 0) {
5947
5951
  De2(e4, a5);
5948
- const t7 = Ae(e4.status, o("destination", a5), "dlq", c2.dropped);
5952
+ const t7 = Ae2(e4.status, o("destination", a5), "dlq", c2.dropped);
5949
5953
  qe(r6, e4.logger.scope(s6.type || "unknown"), "destination.dlq overflow; oldest entries dropped", { buffer: "dlq", destination: a5, cap: i2.max, droppedCount: t7 });
5950
5954
  } else r6.length < i2.max && xe2(r6);
5951
5955
  })(e4, s6, o4, u4, v4, d2);
@@ -6015,7 +6019,7 @@ async function _e2(e4, t4, n4, o3, s5, r4) {
6015
6019
  const c5 = t4.config.id || n4, d5 = De2(e4, c5), l3 = Date.now(), g3 = S(e4, { stepId: o("destination", n4), stepType: "destination", phase: "flush", eventId: "", now: l3 });
6016
6020
  g3.batch = { size: s7.entries.length, index: 0 }, lt(e4, g3);
6017
6021
  let h4 = true;
6018
- await Ze(ot(t4.pushBatch, "DestinationPushBatch", e4.hooks, e4.logger), (o7) => {
6022
+ await Ue(ot(t4.pushBatch, "DestinationPushBatch", e4.hooks, e4.logger), (o7) => {
6019
6023
  h4 = false;
6020
6024
  const r7 = Date.now(), a5 = S(e4, { stepId: o("destination", n4), stepType: "destination", phase: "error", eventId: "", now: r7 });
6021
6025
  a5.durationMs = r7 - l3, a5.error = o7 instanceof Error ? { name: o7.name, message: o7.message } : { message: String(o7) }, a5.batch = { size: s7.entries.length, index: 0 }, lt(e4, a5);
@@ -6025,7 +6029,7 @@ async function _e2(e4, t4, n4, o3, s5, r4) {
6025
6029
  p3 += Ce2(i5, [e5.event, o7], f4).dropped;
6026
6030
  }
6027
6031
  if (p3 > 0) {
6028
- const t5 = Ae(e4.status, o("destination", c5), "dlq", p3);
6032
+ const t5 = Ae2(e4.status, o("destination", c5), "dlq", p3);
6029
6033
  qe(i5, u4, "destination.dlq overflow; oldest entries dropped", { buffer: "dlq", destination: c5, cap: f4.max, droppedCount: t5 });
6030
6034
  } else i5.length < f4.max && xe2(i5);
6031
6035
  d5.failed += s7.entries.length, d5.dlqSize = i5.length, e4.status.failed += s7.entries.length, u4.error("Push batch failed", { error: o7 instanceof Error ? o7.message : String(o7), entries: s7.entries.length });
@@ -6040,7 +6044,7 @@ async function _e2(e4, t4, n4, o3, s5, r4) {
6040
6044
  const o4 = t4.batches[f3];
6041
6045
  o4.batched.entries.push({ event: i2.event, ingest: s5, respond: r4, rule: l2, data: i2.data }), o4.batched.events.push(i2.event), ie(i2.data) && o4.batched.data.push(i2.data);
6042
6046
  const c3 = t4.config.id || n4, d3 = De2(e4, c3);
6043
- return d3.inFlightBatch = (d3.inFlightBatch ?? 0) + 1, o4.batchFn(), Oe2;
6047
+ return d3.inFlightBatch = (d3.inFlightBatch ?? 0) + 1, o4.batchFn(), Oe;
6044
6048
  }
6045
6049
  {
6046
6050
  u4.debug("push", { event: i2.event.name });
@@ -6152,7 +6156,7 @@ async function Ve(e4, t4) {
6152
6156
  return await Me2(e4);
6153
6157
  }
6154
6158
  function nt(e4, t4) {
6155
- const n4 = ot(async (n5, o3 = {}) => await Ze(async () => {
6159
+ const n4 = ot(async (n5, o3 = {}) => await Ue(async () => {
6156
6160
  const s5 = Date.now(), { id: r4, ingest: a4, respond: i2, mapping: c2, preChain: u4, include: d2, exclude: l2 } = o3;
6157
6161
  let f3 = i2, p2 = n5;
6158
6162
  const g3 = d2 || l2 ? (function(e5, t5, n6) {
@@ -6193,7 +6197,7 @@ function nt(e4, t4) {
6193
6197
  }
6194
6198
  return w3;
6195
6199
  }, (t5) => {
6196
- if (t5 instanceof We) throw t5;
6200
+ if (t5 instanceof Ze) throw t5;
6197
6201
  return e4.status.failed++, e4.logger.error("push failed", { event: n5, ingest: o3.ingest, error: t5 }), Pe2({ ok: false });
6198
6202
  })(), "Push", e4.hooks, e4.logger);
6199
6203
  return async (t5, o3) => {
@@ -6311,14 +6315,14 @@ function ft(e4, t4, n4) {
6311
6315
  }
6312
6316
  }, t4.set = async (t5, n5, s6) => {
6313
6317
  const a5 = Date.now(), i2 = S(e4, { stepId: o3, stepType: "store", phase: "in", eventId: "", now: a5 });
6314
- i2.meta = { op: "set", key: t5, value: n5 }, lt(e4, i2);
6318
+ i2.meta = { op: "set", key: t5 }, lt(e4, i2);
6315
6319
  try {
6316
6320
  await r4(t5, n5, s6);
6317
6321
  const i3 = Date.now(), c2 = S(e4, { stepId: o3, stepType: "store", phase: "out", eventId: "", now: i3 });
6318
- c2.durationMs = i3 - a5, c2.meta = { op: "set", key: t5, value: n5 }, lt(e4, c2);
6319
- } catch (s7) {
6320
- const r5 = Date.now(), i3 = S(e4, { stepId: o3, stepType: "store", phase: "error", eventId: "", now: r5 });
6321
- throw i3.durationMs = r5 - a5, i3.meta = { op: "set", key: t5, value: n5 }, i3.error = s7 instanceof Error ? { name: s7.name, message: s7.message } : { message: String(s7) }, lt(e4, i3), s7;
6322
+ c2.durationMs = i3 - a5, c2.meta = { op: "set", key: t5 }, lt(e4, c2);
6323
+ } catch (n6) {
6324
+ const s7 = Date.now(), r5 = S(e4, { stepId: o3, stepType: "store", phase: "error", eventId: "", now: s7 });
6325
+ throw r5.durationMs = s7 - a5, r5.meta = { op: "set", key: t5 }, r5.error = n6 instanceof Error ? { name: n6.name, message: n6.message } : { message: String(n6) }, lt(e4, r5), n6;
6322
6326
  }
6323
6327
  }, t4.delete = async (t5) => {
6324
6328
  const n5 = Date.now(), s6 = S(e4, { stepId: o3, stepType: "store", phase: "in", eventId: "", now: n5 });
@@ -6374,9 +6378,9 @@ async function pt(e4, t4 = {}) {
6374
6378
  }
6375
6379
  async function gt(e4) {
6376
6380
  const t4 = ee({ globalsStatic: {}, sessionStatic: {}, run: true, queueMax: 1e3 }, e4, { merge: false, extend: false }), n4 = { level: e4.logger?.level, handler: e4.logger?.handler }, o3 = ze(n4), s5 = { ...t4.globalsStatic, ...e4.globals }, i2 = { allowed: false, config: t4, consent: e4.consent || {}, custom: e4.custom || {}, destinations: {}, transformers: {}, stores: {}, globals: s5, hooks: e4.hooks || {}, observers: /* @__PURE__ */ new Set(), logger: o3, on: {}, queue: [], round: 0, session: void 0, status: { startedAt: Date.now(), in: 0, out: 0, failed: 0, sources: {}, destinations: {}, dropped: {} }, timing: Date.now(), user: e4.user || {}, sources: {}, pending: { destinations: {} }, push: void 0, command: void 0 };
6377
- i2.push = nt(i2, (e5) => ({ timing: Math.round((Date.now() - i2.timing) / 10) / 100, source: { type: "collector", schema: "4", version: "4.1.1-next-1779822275564" }, ...e5 })), i2.command = (function(e5, t5) {
6378
- return ot(async (n5, o4, s6) => await Ze(async () => await t5(e5, n5, o4, s6), (t6) => {
6379
- if (t6 instanceof We) throw t6;
6381
+ i2.push = nt(i2, (e5) => ({ timing: Math.round((Date.now() - i2.timing) / 10) / 100, source: { type: "collector", schema: "4", version: "4.1.1" }, ...e5 })), i2.command = (function(e5, t5) {
6382
+ return ot(async (n5, o4, s6) => await Ue(async () => await t5(e5, n5, o4, s6), (t6) => {
6383
+ if (t6 instanceof Ze) throw t6;
6380
6384
  return e5.status.failed++, e5.logger.error("command failed", { command: n5, data: o4, error: t6 }), Pe2({ ok: false });
6381
6385
  })(), "Command", e5.hooks, e5.logger);
6382
6386
  })(i2, Ue2);
@@ -8809,10 +8813,10 @@ function buildTelemetryObservers(flowId) {
8809
8813
  const url = process.env.WALKEROS_OBSERVER_URL;
8810
8814
  const token = process.env.WALKEROS_INGEST_TOKEN;
8811
8815
  if (!url || !token) return void 0;
8812
- const opts = ct({ flowId });
8813
- if (!opts) return void 0;
8814
8816
  const emit = ut({ url, token });
8815
- return [at(emit, opts)];
8817
+ return [
8818
+ at(emit, () => ct({ flowId }))
8819
+ ];
8816
8820
  }
8817
8821
  async function injectSecrets(api, logger) {
8818
8822
  try {
@@ -9940,7 +9944,7 @@ function validateMapping(input) {
9940
9944
  // src/commands/validate/validators/entry.ts
9941
9945
  init_dist();
9942
9946
  import Ajv from "ajv";
9943
- var CLIENT_HEADER = "walkeros-cli/4.1.1-next-1779822275564";
9947
+ var CLIENT_HEADER = "walkeros-cli/4.1.1";
9944
9948
  var SECTIONS = ["destinations", "sources", "transformers"];
9945
9949
  function resolveEntry(path19, flowConfig) {
9946
9950
  const flows = flowConfig.flows;